Opened 14 years ago
Closed 14 years ago
#333 closed task (fixed)
Do not set CPPFLAGS, CXXFLAGS, and LDFLAGS in configure
Reported by: | Peter Johansson | Owned by: | Peter Johansson |
---|---|---|---|
Priority: | major | Milestone: | svndigest 0.7 |
Component: | build | Version: | trunk |
Keywords: | Cc: |
Description (last modified by )
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):
- Save flag given by user - CPPFLAGS_SAVE = CPPFLAGS
- Set SD_CPPFLAGS depending on --enable-debug, --with-apr, and --with-svn
- Set CPPFLAGS = SD_CPPFLAGS CPPFLAGS
- Perform tests
- export SD_CPPFLAGS using AC_SUBST
- reset CPPFLAGS to CPPFLAGS_SAVE
- AC_OUTPUT
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 (2)
comment:1 Changed 14 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
fixed in [640]