automake
[Top][All Lists]
Advanced

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

Re: CXXFLAGS and linking


From: William S Fulton
Subject: Re: CXXFLAGS and linking
Date: Fri, 24 Jan 2003 22:29:19 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130

Alexandre Duret-Lutz wrote:
 William> This doesn't seem correct as the C++ flags aren't
William> necessarily appropriate for linking.
The example you sent to Guido uses `AM_CXXFLAGS = -DSOMETHING'.
I wouldn't expect this to cause any trouble during linking.  Does it?
(If so you should probably change it to `AM_CPPFLAGS = -DSOMETHING'.)

Am I missing something?

 William> This isn't consistent with the per-program
 William> xxxx_CXXFLAGS which do not get passed to the
 William> linker. Is this all as intended?

I agree this is a bug.  We should honor per-target compiler
flags at link time for consistency.

Well I was mainly confused at the inconsistency. FWIW I am trying a sort of workaround for the lack of per file compiler flags by having separate CFLAGS and CXXFLAGS, so although CPPFLAGS might be more appropriate it doesn't help my workaround.

The GNU compiler doesn't mind the -D and -I being passed during the linking stage and the only other compiler I've tried is M$ VC++ which issued a warning. I know this compiler is completely non standard, but I wasn't sure whether this would cause a problem for the host of other compilers which our project will be compiled by, so I'm watching this discussion with interest. Should it be the case it would be handy to have a little explanation in the docs that the CXXFLAGS/CFLAGS are also used during linking. It currently says it is passed to the compiler (C++ Support section).

I'm intrigued by why the introduction of per-program flags result in the object file being called maude-sample.o and not sample.o (Program and Library Variables section). Perhaps some short insight could be documented for inquisitives like myself?

Cheers
William





reply via email to

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