bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_PROG_CXX doesn't check whether what it finds is actually a C++ co


From: Eric Blake
Subject: Re: AC_PROG_CXX doesn't check whether what it finds is actually a C++ compiler
Date: Fri, 28 Jun 2013 14:46:38 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6

On 06/28/2013 11:11 AM, Guy Harris wrote:

[Can you convince your mailer to wrap long lines?]

> If you are on a system that
> 
>       1) doesn't have a program named g++, c++, gpp, or aCC installed;
> 
>       2) does have a C compiler named cc installed;
> 
>       3) has that program on a case-insensitive file system;
> 
> AC_PROG_CXX will misidentify cc as being a C++ compiler, as its search for CC 
> will find cc (due to the case-insensitive file system) but will not try to 
> compile a program containing C++-specific features with it.
> 
> (This was found by a somewhat artificial test, in which, on an OS X system 
> with the default case-insensitive root file system, I temporarily renamed g++ 
> and c++ so that AC_PROG_CXX wouldn't find them, and ran a configure script.  
> Whether this is something to be concerned about in the real world is another 
> matter.)

Not entirely artificial; this has been reported several times on the
Cygwin mailing lists as well.

I will point out that gnulib provides a nicer module for actually
detecting c++ (and not misidentifying 'cc' as a case-insensitive 'CC'
lookalike):
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=m4/ansi-c%2B%2B.m4;h=8319dd38;hb=HEAD

Maybe we should investigate pulling some of that code into autoconf proper?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]