This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: CXXFLAGS and linking
- From: Guido Draheim <guidod-2003- at gmx dot de>
- To: William S Fulton <wsf at fultondesigns dot co dot uk>, automake at gnu dot org
- Date: Fri, 24 Jan 2003 00:07:58 +0100
- Subject: Re: CXXFLAGS and linking
- References: <3E30562C.5050100@fultondesigns.co.uk> <3E3067DC.4060106@gmx.de><3E30732C.8050402@fultondesigns.co.uk>
William S Fulton schrieb:
Guido Draheim wrote:
William S Fulton schrieb:
I see that CXXFLAGS and AM_CXXFLAGS gets passed to the linker
($CXXLINK). This doesn't seem correct as the C++ flags aren't
necessarily appropriate for linking. This isn't consistent with the
per-program xxxx_CXXFLAGS which do not get passed to the linker. Is
this all as intended?
your version of autotools? (autoconf, automake, libtool)
Sorry, the latest... Automake 1.7.2, Autoconf 2.57, m4 1.4 (I'm not
using libtool).
Perhaps to make it clearer, the following simple test case demonstrates
the problem:
-------------------------------------------
configure.in:
-------------------------------------------
AC_INIT([test], [1.0])
AC_PREREQ(2.57)
AC_CONFIG_SRCDIR([foo.cxx])
AM_INIT_AUTOMAKE
AC_PROG_CXX
AC_CONFIG_FILES([ Makefile ])
AC_OUTPUT
-------------------------------------------
Makefile.am:
-------------------------------------------
AUTOMAKE_OPTIONS = foreign
AM_CXXFLAGS = -DSOMETHING
test_SOURCES = foo.cxx
bin_PROGRAMS = test
-------------------------------------------
foo.cxx:
-------------------------------------------
#include <iostream>
using namespace std;
int main()
{
cout << "hi!" << endl;
}
The linker output is then:
g++ -DSOMETHING -g -O2 -o test.exe foo.o
hmmm, personally I'm using libtool support about everywhere
but it is quite similar....
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
however, I guess that libtool strips everything away that is
not understood by the actual linker as configured, right?
hth, cheers, guido