automake
[Top][All Lists]
Advanced

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

Re: CXXFLAGS and linking


From: Guido Draheim
Subject: Re: CXXFLAGS and linking
Date: Fri, 24 Jan 2003 00:07:58 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.1) Gecko/20020826



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





reply via email to

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