Opened 14 years ago

Last modified 14 years ago

#333 closed task

Do not set CPPFLAGS, CXXFLAGS, and LDFLAGS in configure — at Version 1

Reported by: Peter Johansson Owned by: Peter Johansson
Priority: major Milestone: svndigest 0.7
Component: build Version: trunk
Keywords: Cc:

Description (last modified by Peter Johansson)

Setting CPPFLAGS, CXXFLAGS, and LDFLAGS in configure is bad style.

See for example Automake manual 27.6.1 in which they suggest:

You should not add options to these user variables within configure either, for the same reason. Occasionally you need to modify these variables to perform a test, but you should reset their values afterwards. In contrast, it is OK to modify the ‘AM_’ variables within configure if you AC_SUBST them, but it is rather rare that you need to do this, unless you really want to change the default definitions of the ‘AM_’ variables in all Makefiles.

I suggest the following structure (I use CPPFLAGS here as an example; the same structure could be used for other flags as well):

  1. Save flag given by user - CPPFLAGS_SAVE = CPPFLAGS
  2. Set SD_CPPFLAGS depending on --enable-debug, --with-apr, and --with-svn
  4. Perform tests
  5. export SD_CPPFLAGS using AC_SUBST

The major change is that we need to split up chunks such as APR stuff, because some part belong in 2) and some parts belong in 4).

Change History (1)

comment:1 Changed 14 years ago by Peter Johansson

Description: modified (diff)
Note: See TracTickets for help on using tickets.