You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Ben Reser <be...@reser.org> on 2013/03/13 01:11:34 UTC

configure: C++ compiler detection improvement

Friend of mine was trying to build couchdb today and ran into a problem.

[[[
checking jsapi.h usability... no
checking jsapi.h presence... no
checking for jsapi.h... no
checking js/jsapi.h usability... no
checking js/jsapi.h presence... no
checking for js/jsapi.h... no
configure.jm: error: Could not find the jsapi header.

Are the Mozilla SpiderMonkey headers installed?
]]]

But he clearly had Mozilla Spidermonkey installed:
[[[
# locate jsapi.h
/usr/include/jsapi.h
/usr/include/js/jsapi.h
/usr/include/xulrunner-sdk-1.9.2/jsapi.h
]]]

He was stumped and asked me to take a look.  I looked at the
config.log and found:
[[[
configure.jm:16700: checking jsapi.h usability
configure.jm:16717: g++ -c  -DXP_UNIX
-I/usr/include/xulrunner-sdk-1.9.2
-I/usr/include/xulrunner-sdk-1.9.2/js
-I/usr/include/xulrunner-sdk-1.9.2/mozjs  -I/opt/local/include
-I/usr/local/include -I/usr/include  conftest.cpp >&5
./configure.jm: line 16718: g++: command not found
]]]

You're using AC_PROG_CXX in your configure.ac to find a C++ compiler.
Unfortunately due to a bug (or misfeature) of autoconf if AC_PROG_CXX
follows AC_PROG_CC then it won't fail if no C++ compiler is found.
See:
http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00001.html

Fortunately, it's relatively easy to work around this.  You can simply
test that the ac_ct_CXX shell variable is set after running
AC_PROG_CXX.  I've attached a patch that does so.

Running configure on a system without a C++ compiler now results in
the following:
[[[
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking that we found a C++ compiler... no
configure: error: A C++ compiler is required.
]]]

I'm not subscribed to your dev list so if you'd like to respond to me
please CC me.  Also my ASF username is breser an ICLA is already on
file for me.

Re: configure: C++ compiler detection improvement

Posted by Paul Davis <pa...@gmail.com>.
Dave threw this in Jira. Patch LGTM

https://issues.apache.org/jira/browse/COUCHDB-1699

On Tue, Mar 12, 2013 at 10:38 PM, Adam Kocoloski <ko...@apache.org> wrote:
> Wow, thanks for the detailed report and patch Ben.  Cheers,
>
> Adam
>
> On Mar 12, 2013, at 8:11 PM, Ben Reser <be...@reser.org> wrote:
>
>> Friend of mine was trying to build couchdb today and ran into a problem.
>>
>> [[[
>> checking jsapi.h usability... no
>> checking jsapi.h presence... no
>> checking for jsapi.h... no
>> checking js/jsapi.h usability... no
>> checking js/jsapi.h presence... no
>> checking for js/jsapi.h... no
>> configure.jm: error: Could not find the jsapi header.
>>
>> Are the Mozilla SpiderMonkey headers installed?
>> ]]]
>>
>> But he clearly had Mozilla Spidermonkey installed:
>> [[[
>> # locate jsapi.h
>> /usr/include/jsapi.h
>> /usr/include/js/jsapi.h
>> /usr/include/xulrunner-sdk-1.9.2/jsapi.h
>> ]]]
>>
>> He was stumped and asked me to take a look.  I looked at the
>> config.log and found:
>> [[[
>> configure.jm:16700: checking jsapi.h usability
>> configure.jm:16717: g++ -c  -DXP_UNIX
>> -I/usr/include/xulrunner-sdk-1.9.2
>> -I/usr/include/xulrunner-sdk-1.9.2/js
>> -I/usr/include/xulrunner-sdk-1.9.2/mozjs  -I/opt/local/include
>> -I/usr/local/include -I/usr/include  conftest.cpp >&5
>> ./configure.jm: line 16718: g++: command not found
>> ]]]
>>
>> You're using AC_PROG_CXX in your configure.ac to find a C++ compiler.
>> Unfortunately due to a bug (or misfeature) of autoconf if AC_PROG_CXX
>> follows AC_PROG_CC then it won't fail if no C++ compiler is found.
>> See:
>> http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00001.html
>>
>> Fortunately, it's relatively easy to work around this.  You can simply
>> test that the ac_ct_CXX shell variable is set after running
>> AC_PROG_CXX.  I've attached a patch that does so.
>>
>> Running configure on a system without a C++ compiler now results in
>> the following:
>> [[[
>> checking for g++... no
>> checking for c++... no
>> checking for gpp... no
>> checking for aCC... no
>> checking for CC... no
>> checking for cxx... no
>> checking for cc++... no
>> checking for cl.exe... no
>> checking for FCC... no
>> checking for KCC... no
>> checking for RCC... no
>> checking for xlC_r... no
>> checking for xlC... no
>> checking whether we are using the GNU C++ compiler... no
>> checking whether g++ accepts -g... no
>> checking dependency style of g++... none
>> checking that we found a C++ compiler... no
>> configure: error: A C++ compiler is required.
>> ]]]
>>
>> I'm not subscribed to your dev list so if you'd like to respond to me
>> please CC me.  Also my ASF username is breser an ICLA is already on
>> file for me.
>> <couchdb-c++-configure.patch.txt>
>

Re: configure: C++ compiler detection improvement

Posted by Adam Kocoloski <ko...@apache.org>.
Wow, thanks for the detailed report and patch Ben.  Cheers,

Adam

On Mar 12, 2013, at 8:11 PM, Ben Reser <be...@reser.org> wrote:

> Friend of mine was trying to build couchdb today and ran into a problem.
> 
> [[[
> checking jsapi.h usability... no
> checking jsapi.h presence... no
> checking for jsapi.h... no
> checking js/jsapi.h usability... no
> checking js/jsapi.h presence... no
> checking for js/jsapi.h... no
> configure.jm: error: Could not find the jsapi header.
> 
> Are the Mozilla SpiderMonkey headers installed?
> ]]]
> 
> But he clearly had Mozilla Spidermonkey installed:
> [[[
> # locate jsapi.h
> /usr/include/jsapi.h
> /usr/include/js/jsapi.h
> /usr/include/xulrunner-sdk-1.9.2/jsapi.h
> ]]]
> 
> He was stumped and asked me to take a look.  I looked at the
> config.log and found:
> [[[
> configure.jm:16700: checking jsapi.h usability
> configure.jm:16717: g++ -c  -DXP_UNIX
> -I/usr/include/xulrunner-sdk-1.9.2
> -I/usr/include/xulrunner-sdk-1.9.2/js
> -I/usr/include/xulrunner-sdk-1.9.2/mozjs  -I/opt/local/include
> -I/usr/local/include -I/usr/include  conftest.cpp >&5
> ./configure.jm: line 16718: g++: command not found
> ]]]
> 
> You're using AC_PROG_CXX in your configure.ac to find a C++ compiler.
> Unfortunately due to a bug (or misfeature) of autoconf if AC_PROG_CXX
> follows AC_PROG_CC then it won't fail if no C++ compiler is found.
> See:
> http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00001.html
> 
> Fortunately, it's relatively easy to work around this.  You can simply
> test that the ac_ct_CXX shell variable is set after running
> AC_PROG_CXX.  I've attached a patch that does so.
> 
> Running configure on a system without a C++ compiler now results in
> the following:
> [[[
> checking for g++... no
> checking for c++... no
> checking for gpp... no
> checking for aCC... no
> checking for CC... no
> checking for cxx... no
> checking for cc++... no
> checking for cl.exe... no
> checking for FCC... no
> checking for KCC... no
> checking for RCC... no
> checking for xlC_r... no
> checking for xlC... no
> checking whether we are using the GNU C++ compiler... no
> checking whether g++ accepts -g... no
> checking dependency style of g++... none
> checking that we found a C++ compiler... no
> configure: error: A C++ compiler is required.
> ]]]
> 
> I'm not subscribed to your dev list so if you'd like to respond to me
> please CC me.  Also my ASF username is breser an ICLA is already on
> file for me.
> <couchdb-c++-configure.patch.txt>


Re: configure: C++ compiler detection improvement

Posted by Noah Slater <ns...@apache.org>.
ACK


On 13 March 2013 09:40, Paul Davis <pa...@gmail.com> wrote:

> Won't have time for a few days. Trying to get through mergey mergey time.
>
> On Wed, Mar 13, 2013 at 4:38 AM, Noah Slater <ns...@apache.org> wrote:
> > This looks great! Thank you, Ben!
> >
> > If someone (Paul?) wants to apply this to master, and the relevant
> release
> > branches, along with an entry in CHANGES, well then, awesome. If not, I
> > will see to it once the current release is off my plate.
> >
> >
> > On 13 March 2013 00:11, Ben Reser <be...@reser.org> wrote:
> >
> >> Friend of mine was trying to build couchdb today and ran into a problem.
> >>
> >> [[[
> >> checking jsapi.h usability... no
> >> checking jsapi.h presence... no
> >> checking for jsapi.h... no
> >> checking js/jsapi.h usability... no
> >> checking js/jsapi.h presence... no
> >> checking for js/jsapi.h... no
> >> configure.jm: error: Could not find the jsapi header.
> >>
> >> Are the Mozilla SpiderMonkey headers installed?
> >> ]]]
> >>
> >> But he clearly had Mozilla Spidermonkey installed:
> >> [[[
> >> # locate jsapi.h
> >> /usr/include/jsapi.h
> >> /usr/include/js/jsapi.h
> >> /usr/include/xulrunner-sdk-1.9.2/jsapi.h
> >> ]]]
> >>
> >> He was stumped and asked me to take a look.  I looked at the
> >> config.log and found:
> >> [[[
> >> configure.jm:16700: checking jsapi.h usability
> >> configure.jm:16717: g++ -c  -DXP_UNIX
> >> -I/usr/include/xulrunner-sdk-1.9.2
> >> -I/usr/include/xulrunner-sdk-1.9.2/js
> >> -I/usr/include/xulrunner-sdk-1.9.2/mozjs  -I/opt/local/include
> >> -I/usr/local/include -I/usr/include  conftest.cpp >&5
> >> ./configure.jm: line 16718: g++: command not found
> >> ]]]
> >>
> >> You're using AC_PROG_CXX in your configure.ac to find a C++ compiler.
> >> Unfortunately due to a bug (or misfeature) of autoconf if AC_PROG_CXX
> >> follows AC_PROG_CC then it won't fail if no C++ compiler is found.
> >> See:
> >> http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00001.html
> >>
> >> Fortunately, it's relatively easy to work around this.  You can simply
> >> test that the ac_ct_CXX shell variable is set after running
> >> AC_PROG_CXX.  I've attached a patch that does so.
> >>
> >> Running configure on a system without a C++ compiler now results in
> >> the following:
> >> [[[
> >> checking for g++... no
> >> checking for c++... no
> >> checking for gpp... no
> >> checking for aCC... no
> >> checking for CC... no
> >> checking for cxx... no
> >> checking for cc++... no
> >> checking for cl.exe... no
> >> checking for FCC... no
> >> checking for KCC... no
> >> checking for RCC... no
> >> checking for xlC_r... no
> >> checking for xlC... no
> >> checking whether we are using the GNU C++ compiler... no
> >> checking whether g++ accepts -g... no
> >> checking dependency style of g++... none
> >> checking that we found a C++ compiler... no
> >> configure: error: A C++ compiler is required.
> >> ]]]
> >>
> >> I'm not subscribed to your dev list so if you'd like to respond to me
> >> please CC me.  Also my ASF username is breser an ICLA is already on
> >> file for me.
> >>
> >
> >
> >
> > --
> > NS
>



-- 
NS

Re: configure: C++ compiler detection improvement

Posted by Paul Davis <pa...@gmail.com>.
Won't have time for a few days. Trying to get through mergey mergey time.

On Wed, Mar 13, 2013 at 4:38 AM, Noah Slater <ns...@apache.org> wrote:
> This looks great! Thank you, Ben!
>
> If someone (Paul?) wants to apply this to master, and the relevant release
> branches, along with an entry in CHANGES, well then, awesome. If not, I
> will see to it once the current release is off my plate.
>
>
> On 13 March 2013 00:11, Ben Reser <be...@reser.org> wrote:
>
>> Friend of mine was trying to build couchdb today and ran into a problem.
>>
>> [[[
>> checking jsapi.h usability... no
>> checking jsapi.h presence... no
>> checking for jsapi.h... no
>> checking js/jsapi.h usability... no
>> checking js/jsapi.h presence... no
>> checking for js/jsapi.h... no
>> configure.jm: error: Could not find the jsapi header.
>>
>> Are the Mozilla SpiderMonkey headers installed?
>> ]]]
>>
>> But he clearly had Mozilla Spidermonkey installed:
>> [[[
>> # locate jsapi.h
>> /usr/include/jsapi.h
>> /usr/include/js/jsapi.h
>> /usr/include/xulrunner-sdk-1.9.2/jsapi.h
>> ]]]
>>
>> He was stumped and asked me to take a look.  I looked at the
>> config.log and found:
>> [[[
>> configure.jm:16700: checking jsapi.h usability
>> configure.jm:16717: g++ -c  -DXP_UNIX
>> -I/usr/include/xulrunner-sdk-1.9.2
>> -I/usr/include/xulrunner-sdk-1.9.2/js
>> -I/usr/include/xulrunner-sdk-1.9.2/mozjs  -I/opt/local/include
>> -I/usr/local/include -I/usr/include  conftest.cpp >&5
>> ./configure.jm: line 16718: g++: command not found
>> ]]]
>>
>> You're using AC_PROG_CXX in your configure.ac to find a C++ compiler.
>> Unfortunately due to a bug (or misfeature) of autoconf if AC_PROG_CXX
>> follows AC_PROG_CC then it won't fail if no C++ compiler is found.
>> See:
>> http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00001.html
>>
>> Fortunately, it's relatively easy to work around this.  You can simply
>> test that the ac_ct_CXX shell variable is set after running
>> AC_PROG_CXX.  I've attached a patch that does so.
>>
>> Running configure on a system without a C++ compiler now results in
>> the following:
>> [[[
>> checking for g++... no
>> checking for c++... no
>> checking for gpp... no
>> checking for aCC... no
>> checking for CC... no
>> checking for cxx... no
>> checking for cc++... no
>> checking for cl.exe... no
>> checking for FCC... no
>> checking for KCC... no
>> checking for RCC... no
>> checking for xlC_r... no
>> checking for xlC... no
>> checking whether we are using the GNU C++ compiler... no
>> checking whether g++ accepts -g... no
>> checking dependency style of g++... none
>> checking that we found a C++ compiler... no
>> configure: error: A C++ compiler is required.
>> ]]]
>>
>> I'm not subscribed to your dev list so if you'd like to respond to me
>> please CC me.  Also my ASF username is breser an ICLA is already on
>> file for me.
>>
>
>
>
> --
> NS

Re: configure: C++ compiler detection improvement

Posted by Noah Slater <ns...@apache.org>.
This looks great! Thank you, Ben!

If someone (Paul?) wants to apply this to master, and the relevant release
branches, along with an entry in CHANGES, well then, awesome. If not, I
will see to it once the current release is off my plate.


On 13 March 2013 00:11, Ben Reser <be...@reser.org> wrote:

> Friend of mine was trying to build couchdb today and ran into a problem.
>
> [[[
> checking jsapi.h usability... no
> checking jsapi.h presence... no
> checking for jsapi.h... no
> checking js/jsapi.h usability... no
> checking js/jsapi.h presence... no
> checking for js/jsapi.h... no
> configure.jm: error: Could not find the jsapi header.
>
> Are the Mozilla SpiderMonkey headers installed?
> ]]]
>
> But he clearly had Mozilla Spidermonkey installed:
> [[[
> # locate jsapi.h
> /usr/include/jsapi.h
> /usr/include/js/jsapi.h
> /usr/include/xulrunner-sdk-1.9.2/jsapi.h
> ]]]
>
> He was stumped and asked me to take a look.  I looked at the
> config.log and found:
> [[[
> configure.jm:16700: checking jsapi.h usability
> configure.jm:16717: g++ -c  -DXP_UNIX
> -I/usr/include/xulrunner-sdk-1.9.2
> -I/usr/include/xulrunner-sdk-1.9.2/js
> -I/usr/include/xulrunner-sdk-1.9.2/mozjs  -I/opt/local/include
> -I/usr/local/include -I/usr/include  conftest.cpp >&5
> ./configure.jm: line 16718: g++: command not found
> ]]]
>
> You're using AC_PROG_CXX in your configure.ac to find a C++ compiler.
> Unfortunately due to a bug (or misfeature) of autoconf if AC_PROG_CXX
> follows AC_PROG_CC then it won't fail if no C++ compiler is found.
> See:
> http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00001.html
>
> Fortunately, it's relatively easy to work around this.  You can simply
> test that the ac_ct_CXX shell variable is set after running
> AC_PROG_CXX.  I've attached a patch that does so.
>
> Running configure on a system without a C++ compiler now results in
> the following:
> [[[
> checking for g++... no
> checking for c++... no
> checking for gpp... no
> checking for aCC... no
> checking for CC... no
> checking for cxx... no
> checking for cc++... no
> checking for cl.exe... no
> checking for FCC... no
> checking for KCC... no
> checking for RCC... no
> checking for xlC_r... no
> checking for xlC... no
> checking whether we are using the GNU C++ compiler... no
> checking whether g++ accepts -g... no
> checking dependency style of g++... none
> checking that we found a C++ compiler... no
> configure: error: A C++ compiler is required.
> ]]]
>
> I'm not subscribed to your dev list so if you'd like to respond to me
> please CC me.  Also my ASF username is breser an ICLA is already on
> file for me.
>



-- 
NS