autoconf issue using -stdc=gnu++0x option in AC_CHECK_HEADER macro.

Stepan Kasal skasal at redhat.com
Fri Jan 11 16:21:04 UTC 2008


Hello,

On Thu, Jan 10, 2008 at 06:47:18PM +0100, Jochen Schmitt wrote:
> Kevin Kofler schrieb:
> > Add it to the CXXFLAGS, you'll need it there anyway when actually
> > building the program. I believe there's also a macro to check the
> > existence of the flag, which will add it to the CXXFLAGS
> > automatically if the test succeeds.
> >
> That was the first thing what I have tried to do after I have
> recognized this issue, but autoconf
> doesn't honor this settings when AC_CHECK_HEADER call the g++ compiler for
> compiling the test program.

Autoconf checks for features of a compiler.  To do this, it has to
know which programming language is the compiler supposed to compile.
This is why you have to specify the language using AC_LANG or
AC_LANG_PUSH/POP.  See
http://www.gnu.org/software/autoconf/manual/html_node/Language-Choice.html

The default language is C, thus people using C exclusively need not
know about the language selection.  But as soon as you use a
different language, e.g. Erlang, Fortran, or C++, you have to keep
this in mind.

(Using CC=g++ says "my C compiler is named g++" which is not usually
true.)

And yes, Autoconf uses CXXFLAGS instead of CFLAGS when checking for
C++ features.

Hope this helps,
	Stepan Kasal




More information about the fedora-devel-list mailing list