diff options
author | Roy T. Fielding <fielding@apache.org> | 2001-04-29 07:24:11 +0200 |
---|---|---|
committer | Roy T. Fielding <fielding@apache.org> | 2001-04-29 07:24:11 +0200 |
commit | f1f5f01fdbacc32f785df43b94acfd6d6dbdfe4b (patch) | |
tree | 8ef14138ddf6b62c758dca169f8a348c9de1792e /build/rules.mk | |
parent | Pass the perms arg to apr_dbm_open (diff) | |
download | apache2-f1f5f01fdbacc32f785df43b94acfd6d6dbdfe4b.tar.xz apache2-f1f5f01fdbacc32f785df43b94acfd6d6dbdfe4b.zip |
Completely revamp configure so that it preserves the standard make
variables CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS and LIBS by moving
the configure additions to EXTRA_* variables. Also, allow the user
to specify NOTEST_* values for all of the above, which eliminates the
need for THREAD_CPPFLAGS, THREAD_CFLAGS, and OPTIM. Fix the setting
of INCLUDES and EXTRA_INCLUDES. Check flags as they are added to
avoid pointless duplications. Fix the order in which flags are given
on the compile and link lines.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88960 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build/rules.mk')
-rw-r--r-- | build/rules.mk | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/build/rules.mk b/build/rules.mk index 4c6df265ce..b8a1165d9b 100644 --- a/build/rules.mk +++ b/build/rules.mk @@ -56,11 +56,22 @@ include $(top_builddir)/config_vars.mk +# Combine all of the flags together in the proper order so that +# the user-defined flags can always override the configure ones, if needed. +# Note that includes are listed after the flags because -I options have +# left-to-right precedence and CPPFLAGS may include user-defined overrides. +# +ALL_CPPFLAGS = $(DEFS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS) +ALL_CFLAGS = $(EXTRA_CFLAGS) $(NOTEST_CFLAGS) $(CFLAGS) +ALL_CXXFLAGS = $(EXTRA_CXXFLAGS) $(NOTEST_CXXFLAGS) $(CXXFLAGS) +ALL_LDFLAGS = $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(LDFLAGS) +ALL_LIBS = $(EXTRA_LIBS) $(NOTEST_LIBS) $(LIBS) +ALL_INCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) + # Compile commands -COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(EXTRA_CPPFLAGS) $(CPPFLAGS) -COMPILE = $(CC) $(COMMON_FLAGS) $(EXTRA_CFLAGS) $(CFLAGS) $(NOTEST_CFLAGS) -CXX_COMPILE = $(CXX) $(COMMON_FLAGS) $(EXTRA_CXXFLAGS) $(CXXFLAGS) +COMPILE = $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(ALL_INCLUDES) +CXX_COMPILE = $(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) $(ALL_INCLUDES) SH_COMPILE = $(SH_LIBTOOL) --mode=compile $(COMPILE) -c $< && touch $@ SH_CXX_COMPILE = $(SH_LIBTOOL) --mode=compile $(CXX_COMPILE) -c $< && touch $@ @@ -70,9 +81,9 @@ LT_CXX_COMPILE = $(LIBTOOL) --mode=compile $(CXX_COMPILE) -c $< && touch $@ # Link-related commands -LINK = $(LIBTOOL) --mode=link $(COMPILE) $(LTFLAGS) $(LDFLAGS) $(NOTEST_LDFLAGS) -o $@ -SH_LINK = $(SH_LIBTOOL) --mode=link $(COMPILE) $(LTFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(SH_LDFLAGS) $(CORE_IMPLIB) -o $@ -MOD_LINK = $(LIBTOOL) --mode=link $(COMPILE) -module $(LTFLAGS) $(LDFLAGS) $(NOTEST_LDFLAGS) -o $@ +LINK = $(LIBTOOL) --mode=link $(COMPILE) $(LTFLAGS) $(ALL_LDFLAGS) -o $@ +SH_LINK = $(SH_LIBTOOL) --mode=link $(COMPILE) $(LTFLAGS) $(ALL_LDFLAGS) $(SH_LDFLAGS) $(CORE_IMPLIB) -o $@ +MOD_LINK = $(LIBTOOL) --mode=link $(COMPILE) -module $(LTFLAGS) $(ALL_LDFLAGS) -o $@ # Cross compile commands @@ -83,8 +94,6 @@ INSTALL = $(abs_srcdir)/build/install.sh -c INSTALL_DATA = $(INSTALL) -m 644 INSTALL_PROGRAM = $(INSTALL) -m 755 -DEFS = -I. -I$(srcdir) -I$(top_srcdir)/server/mpm/$(MPM_NAME) -I$(top_srcdir)/modules/http - # Suffixes CXX_SUFFIX = cpp @@ -214,9 +223,9 @@ distclean-p depend-p clean-p: depend: depend-recursive if test "`echo $(srcdir)/*.c`" != "$(srcdir)'/*.c'"; then \ - gcc -MM $(COMMON_FLAGS) $(srcdir)/*.c | sed 's/\.o:/.lo:/' > $(builddir)/.deps || true; \ + gcc -MM $(ALL_CPPFLAGS) $(ALL_INCLUDES) $(srcdir)/*.c | sed 's/\.o:/.lo:/' > $(builddir)/.deps || true; \ fi -# test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > .deps +# test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) *.c > .deps clean: clean-recursive clean-x |