diff options
Diffstat (limited to 'sapi/apache')
| -rw-r--r-- | sapi/apache/apMakefile.libdir | 4 | ||||
| -rw-r--r-- | sapi/apache/apMakefile.tmpl | 77 | ||||
| -rw-r--r-- | sapi/apache/config.m4 | 4 |
3 files changed, 83 insertions, 2 deletions
diff --git a/sapi/apache/apMakefile.libdir b/sapi/apache/apMakefile.libdir new file mode 100644 index 0000000000..7b5254013a --- /dev/null +++ b/sapi/apache/apMakefile.libdir @@ -0,0 +1,4 @@ +This is a place-holder which indicates to Configure that it shouldn't +provide the default targets when building the Makefile in this directory. +Instead it'll just prepend all the important variable definitions, and +copy the Makefile.tmpl onto the end. diff --git a/sapi/apache/apMakefile.tmpl b/sapi/apache/apMakefile.tmpl new file mode 100644 index 0000000000..c485d1785f --- /dev/null +++ b/sapi/apache/apMakefile.tmpl @@ -0,0 +1,77 @@ +## +## Apache 1.3 Makefile template for PHP 4.0 Module +## [src/modules/php4/Makefile.tmpl] +## + +# the parametrized target +LIB=libphp4.$(LIBEXT) + +# objects for building the static library +OBJS=mod_php4.o +OBJS_LIB=libmodphp4.a + +# objects for building the shared object library +SHLIB_OBJS=mod_php4.so-o +SHLIB_OBJS_LIB=libmodphp4.a + +# the general targets +all: lib +lib: $(LIB) + +# build the static library by merging the object files +libphp4.a: $(OBJS) $(OBJS_LIB) + cp $(OBJS_LIB) $@ + ar r $@ $(OBJS) + $(RANLIB) $@ + +# ugly hack to support older Apache-1.3 betas that don't set $LIBEXT +libphp4.: $(OBJS) $(OBJS_LIB) + cp $(OBJS_LIB) $@ + ar r $@ $(OBJS) + $(RANLIB) $@ + cp libphp4. libphp4.a + +# build the shared object library by linking the object files +libphp4.so: $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) + rm -f $@ + $(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) $(LIBS) + +# 1. extension .o for shared objects cannot be used here because +# first these files aren't still shared objects and second we +# have to use a different name to trigger the different +# implicit Make rule +# 2. extension -so.o (as used elsewhere) cannot be used because +# the suffix feature of Make really wants just .x, so we use +# extension .so-o +.SUFFIXES: .o .so-o +.c.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) $< +.c.so-o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(CFLAGS_SHLIB) $(SPACER) $< && mv $*.o $*.so-o + +# cleanup +clean: + -rm -f $(OBJS) $(SHLIB_OBJS) $(LIB) + +# We really don't expect end users to use this rule. It works only with +# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# using it. +depend: + cp Makefile.tmpl Makefile.tmpl.bak \ + && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \ + && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ + && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ + > Makefile.tmpl \ + && rm Makefile.new + +#Dependencies + +$(OBJS): Makefile + +# DO NOT REMOVE +mod_php4.o: mod_php4.c $(INCDIR)/httpd.h $(INCDIR)/conf.h \ + $(INCDIR)/alloc.h $(INCDIR)/buff.h \ + $(INCDIR)/http_config.h \ + $(INCDIR)/http_core.h $(INCDIR)/http_main.h \ + $(INCDIR)/http_protocol.h $(INCDIR)/http_request.h \ + $(INCDIR)/http_log.h $(INCDIR)/util_script.h mod_php4.h diff --git a/sapi/apache/config.m4 b/sapi/apache/config.m4 index c70a04b13d..9ebdad0b3d 100644 --- a/sapi/apache/config.m4 +++ b/sapi/apache/config.m4 @@ -69,7 +69,7 @@ AC_ARG_WITH(apache, mkdir $APACHE_TARGET fi PHP_SAPI=apache - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" + APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4" AC_DEFINE(APACHE) AC_MSG_RESULT(yes - Apache 1.3.x) @@ -100,7 +100,7 @@ AC_ARG_WITH(apache, fi PHP_SAPI=apache PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4" - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" + APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" AC_DEFINE(APACHE) AC_MSG_RESULT(yes - Apache 1.3.x) STRONGHOLD= |
