summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Schumann <sascha@apache.org>2000-04-30 18:27:18 +0000
committerSascha Schumann <sascha@apache.org>2000-04-30 18:27:18 +0000
commit6a0e55e69858bac414fcc22f0cade0e80cf3a86f (patch)
treeeecc40e80b4bfc4e1f5247e38ff3f08531785387
parent998b29182f90218db342db47d102ea8f34f6fb9b (diff)
downloadhttpd-6a0e55e69858bac414fcc22f0cade0e80cf3a86f.tar.gz
Add VPATH support to Apache:
os/$(OS_DIR) is now equivalent to the old $(OS_DIR) Necessary include paths are added only in VPATH mode. Dependencies are stored in the build directory now. They contain paths which depend on the current build, and therefore they are not general. Fixed two dependencies in main/Makefile.in. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85113 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--Makefile.in2
-rw-r--r--build/rules.mk7
-rw-r--r--configure.in26
-rw-r--r--os/Makefile.in2
-rw-r--r--os/config.m411
-rw-r--r--server/Makefile.in4
6 files changed, 34 insertions, 18 deletions
diff --git a/Makefile.in b/Makefile.in
index 38c4a00573..759e0f81f5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -8,7 +8,7 @@ PROGRAM_DEPENDENCIES = \
$(BUILTIN_LIBS) \
$(MPM_LIB) \
main/libmain.la \
- $(OS_DIR)/libos.la \
+ os/$(OS_DIR)/libos.la \
ap/libap.la \
lib/apr/$(LIBPRE)apr.a \
$(REGEX_LIB)
diff --git a/build/rules.mk b/build/rules.mk
index efde9d28e4..98c3cfdc0b 100644
--- a/build/rules.mk
+++ b/build/rules.mk
@@ -71,7 +71,7 @@ APACHE_COMPILE = $(COMPILE) -c $< && touch $@
APACHE_SH_COMPILE = $(SHLIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $< && touch $@
SHLINK = $(SHLIBTOOL) --mode=link $(CCLD) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@
-DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(top_builddir)
+DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir)
.SUFFIXES:
.SUFFIXES: .S .c .lo .o .s .y .l .slo
@@ -131,7 +131,8 @@ install-p: $(targets) $(install_targets)
distclean-p depend-p clean-p:
depend: depend-recursive
- test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > .deps
+ gcc -MM $(INCLUDES) $(EXTRA_INCLUDES) $(DEFS) $(CPPFLAGS) $(srcdir)/*.c > $(builddir)/.deps
+# test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > .deps
clean: clean-recursive clean-x
@@ -143,7 +144,7 @@ distclean: distclean-recursive clean-x
rm -f config.cache config.log config.status config_vars.mk libtool \
stamp-h Makefile shlibtool .deps $(DISTCLEANFILES)
-include $(srcdir)/.deps
+include $(builddir)/.deps
.PHONY: all-recursive clean-recursive install-recursive \
$(install_targets) install all clean depend depend-recursive shared \
diff --git a/configure.in b/configure.in
index 10c49f52a1..0d3ae683f8 100644
--- a/configure.in
+++ b/configure.in
@@ -16,8 +16,16 @@ APACHE_SUBST(APACHE_VERSION)
test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
test "$prefix" = "NONE" && prefix='/usr/local'
-dnl Needed for APACHE_MODULE() to work
-cwd=`pwd`
+dnl Absolute source/build directory
+abs_srcdir=`(cd $srcdir && pwd)`
+abs_builddir=`pwd`
+
+dnl If the source dir is not equal to the build dir,
+dnl then we are running in VPATH mode.
+
+if test "$abs_builddir" != "$abs_srcdir"; then
+ USE_VPATH=1
+fi
dnl ## Run configure for packages Apache uses
AC_CONFIG_SUBDIRS(lib/apr)
@@ -133,12 +141,14 @@ APACHE_ENABLE_MODULES
APACHE_ENABLE_SHARED
INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/lib/apr/include"
-APACHE_SUBST(INCLUDES)
+if test -n "$USE_VPATH"; then
+ INCLUDES="$INCLUDES -I\$(top_builddir)/include -I\$(top_builddir)/lib/apr/include"
+fi
dnl reading config stubs
esyscmd(./helpers/config-stubs .)
-INCLUDES="$INCLUDES -I\$(top_srcdir)/\$(OS_DIR)"
+INCLUDES="$INCLUDES -I\$(top_srcdir)/os/\$(OS_DIR)"
EXTRA_LIBS="$EXTRA_LIBS $LIBS"
EXTRA_LDFLAGS="$LDFLAGS"
LIBS=""
@@ -147,6 +157,7 @@ APACHE_SUBST(progname)
APACHE_SUBST(EXTRA_CFLAGS)
APACHE_SUBST(EXTRA_LDFLAGS)
APACHE_SUBST(EXTRA_LIBS)
+APACHE_SUBST(INCLUDES)
APACHE_SUBST(REGEX_DIR)
APACHE_SUBST(REGEX_LIB)
APACHE_SUBST(MPM_LIB)
@@ -172,7 +183,12 @@ APACHE_FAST_OUTPUT(Makefile ap/Makefile lib/Makefile main/Makefile
modules/Makefile os/Makefile support/Makefile)
APACHE_FAST_GENERATE
-
+
+dnl There needs to be a .deps file in the top build directory.
+dnl All others are created dynamically by rules.mk.
+
+touch .deps
+
dnl ## Build modules.c
rm -f $srcdir/modules.c
echo $MODLIST | $AWK -f $srcdir/helpers/build-modules-c.awk > $srcdir/modules.c
diff --git a/os/Makefile.in b/os/Makefile.in
index 8d1105c0f2..6850624f70 100644
--- a/os/Makefile.in
+++ b/os/Makefile.in
@@ -1,4 +1,4 @@
-SUBDIRS = $(top_builddir)/$(OS_DIR)
+SUBDIRS = $(OS_DIR)
include $(top_srcdir)/build/rules.mk
diff --git a/os/config.m4 b/os/config.m4
index d6e3949163..00c7ff6599 100644
--- a/os/config.m4
+++ b/os/config.m4
@@ -7,22 +7,21 @@ LIBPRE=lib
case "$PLATFORM" in
*beos*)
OS="beos"
- OS_DIR=os/$OS
+ OS_DIR=$OS
;;
*pc-os2_emx*)
LIBPRE=""
OS="os2"
- OS_DIR=os/$OS
+ OS_DIR=$OS
;;
bs2000*)
OS="unix"
- OS_DIR=os/bs2000 # only the OS_DIR is platform specific.
+ OS_DIR=bs2000 # only the OS_DIR is platform specific.
;;
*)
OS="unix"
- OS_DIR=os/$OS;;
+ OS_DIR=$OS;;
esac
-
AC_MSG_RESULT($OS)
-APACHE_FAST_OUTPUT($OS_DIR/Makefile)
+APACHE_FAST_OUTPUT(os/$OS_DIR/Makefile)
diff --git a/server/Makefile.in b/server/Makefile.in
index 860118527c..9fb0dc51f8 100644
--- a/server/Makefile.in
+++ b/server/Makefile.in
@@ -25,5 +25,5 @@ uri_delims.h: gen_uri_delims
test_char.h: gen_test_char
./gen_test_char > test_char.h
-util_uri.c: uri_delims.h
-util.c: test_char.h
+$(srcdir)/util_uri.c: uri_delims.h
+$(srcdir)/util.c: test_char.h