> On Mon, 2006-06-26 at 04:34 +0000, Harlan Stenn wrote: > > We are told that we should not use CPPFLAGS or CFLAGS in a Makefile.am, > > as they are for users. > That's only partially true. > > More precisely: You should not override user-supplied CPPFLAGS, CFLAGS, > CXXFLAGS, LIBS etc. > > Appending something to these vars would be OK, provided the > user-provided settings "always win".
And how, exactly, is that supposed to work? If we supply values for *FLAGS, how does the user easily keep those and append their own? > > The trick is that if we use a configure.ac file to help decide what > > flags may be needed, >inside< this configure script we need to use > > CFLAGS and CPPFLAGS to effect the running of configure. > Depends on what you add to *FLAGS. Please elaborate. For (possibly bad) examples, once upon a time I was told by developers that in order have a successful 'configure' run and to build The Software on: - i386-sequent-sysv4 that we needed to have CFLAGS+= -Wc,+abi-socket (please excuse the shorthand) - *-*-mpeix that we need: CPPFLAGS+="-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB" (and LDFLAGS+="-L/SYSLOG/PUB" and LIBS+="-lcurses") - *-next-nextstep4: CFLAGS+=-posix On more recent/normal issues, there are other cases where we may be pointed at "local" installation areas for OpenSSL, which would require feeding an override for -I and -L to the remainder of the configure script and also passing these values into the Makefile. Exactly how do you propose this be done? > One standard approach would be to use *FLAGS as package-global FLAGS and > AM_*FLAGS as per-Makefile.am FLAGS, i.e. not to AC_SUBST(AM_*FLAGS) > inside of a configure.ac, but set up AM_*FLAGS inside of each > Makefile.am anew from other AC_SUBST'ed vars to provide more > fine-grained control over FLAGS. Which is useful to some projects, I expect, but not mine... Again, if *FLAGS (I assume you mean CFLAGS, CPPFLAGS, LFLAGS, etc.) are set in configure and propagated to the Makefile's, how does the user override these without doing a lot of typing? H