]> granicus.if.org Git - php/commitdiff
Part 3 of static apache build fixes:
authorfoobar <sniper@php.net>
Tue, 23 Apr 2002 02:58:54 +0000 (02:58 +0000)
committerfoobar <sniper@php.net>
Tue, 23 Apr 2002 02:58:54 +0000 (02:58 +0000)
- Use the PHP_CFLAGS when compiling the php4 module in apache tree.
- Use the apache include dir only when compiling sapi/apache
  o Fixes the fnmatch.h issue Wez complained about :)

sapi/apache/apMakefile.tmpl
sapi/apache/config.m4
sapi/apache/libphp4.module.in

index f77b9975ba1b9da22cd13edf02dc33fdd1ffcdab..80fe34656151eef5a003062befcfe4ef81362b48 100644 (file)
@@ -34,7 +34,7 @@ libphp4.: $(OBJS) $(OBJS_LIB)
 #   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)
+       $(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) $(LIBS) $(PHP_LIBS) 
 
 # 1. extension .o for shared objects cannot be used here because
 #    first these files aren't still shared objects and second we
@@ -45,9 +45,9 @@ libphp4.so: $(SHLIB_OBJS) $(SHLIB_OBJS_LIB)
 #    extension .so-o
 .SUFFIXES: .o .so-o
 .c.o:
-       $(CC) -c $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(SPACER) $<
+       $(CC) -c $(INCLUDES) $(CFLAGS) $(PHP_CFLAGS) $(CPPFLAGS) $(SPACER) $<
 .c.so-o:
-       $(CC) -c $(INCLUDES) $(CFLAGS) $(CFLAGS_SHLIB) $(CPPFLAGS) $(SPACER) $< && mv $*.o $*.so-o
+       $(CC) -c $(INCLUDES) $(CFLAGS) $(CFLAGS_SHLIB) $(PHP_CFLAGS) $(CPPFLAGS) $(SPACER) $< && mv $*.o $*.so-o
 
 #   cleanup
 clean:
@@ -59,7 +59,7 @@ clean:
 depend:
        cp Makefile.tmpl Makefile.tmpl.bak \
            && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \
-           && gcc -MM $(INCLUDES) $(CFLAGS) $(CPPFLAGS) *.c >> Makefile.new \
+           && gcc -MM $(INCLUDES) $(CFLAGS) $(PHP_CFLAGS) $(CPPFLAGS) *.c >> Makefile.new \
            && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \
                > Makefile.tmpl \
            && rm Makefile.new
index 94e26527615d9d4187fef894c004efbf04242827..497bbeafdd8e2f4d10c415272ed7204e47f1de02 100644 (file)
@@ -42,17 +42,17 @@ AC_ARG_WITH(apxs,
   *aix*)
     APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR`
     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
-    PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php4.c php_apache.c)
+    PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php4.c php_apache.c, -I$APXS_INCLUDEDIR)
     ;;
   *darwin*)
     APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
     MH_BUNDLE_FLAGS="-dynamic -twolevel_namespace -bundle -bundle_loader $APXS_HTTPD"
     PHP_SUBST(MH_BUNDLE_FLAGS)
     SAPI_SHARED=libs/libphp4.so
-    PHP_SELECT_SAPI(apache, bundle, sapi_apache.c mod_php4.c php_apache.c)
+    PHP_SELECT_SAPI(apache, bundle, sapi_apache.c mod_php4.c php_apache.c, -I$APXS_INCLUDEDIR)
     ;;
   *)
-    PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php4.c php_apache.c)
+    PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php4.c php_apache.c, -I$APXS_INCLUDEDIR)
     ;;
   esac
 
@@ -61,8 +61,6 @@ AC_ARG_WITH(apxs,
     AC_MSG_ERROR([Use --with-apxs2 with Apache 2.x!]) 
   fi
 
-  PHP_ADD_INCLUDE($APXS_INCLUDEDIR)
-
   # Test whether apxs support -S option
   $APXS -q -S CFLAGS="$APXS_CFLAGS" CFLAGS >/dev/null 2>&1
 
@@ -101,7 +99,7 @@ AC_ARG_WITH(apache,
     if test -f $withval/src/httpd.h; then 
       APACHE_INCLUDE=-I$withval/src
       APACHE_TARGET=$withval/src
-      PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php4.c php_apache.c)
+      PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php4.c php_apache.c, $APACHE_INCLUDE)
       APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_INSTALL_FILES $APACHE_TARGET"
       PHP_LIBS="-L. -lphp3"
       AC_MSG_RESULT(yes - Apache 1.2.x)
@@ -121,7 +119,7 @@ AC_ARG_WITH(apache,
       if test ! -d $APACHE_TARGET; then
         mkdir $APACHE_TARGET
       fi
-      PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php4.c php_apache.c)
+      PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php4.c php_apache.c, $APACHE_INCLUDE)
       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_MSG_RESULT(yes - Apache 1.3.x)
@@ -147,7 +145,7 @@ AC_ARG_WITH(apache,
       if test ! -d $APACHE_TARGET; then
         mkdir $APACHE_TARGET
       fi
-      PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php4.c php_apache.c)
+      PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php4.c php_apache.c, $APACHE_INCLUDE)
       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/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir"
       AC_MSG_RESULT(yes - Apache 1.3.x)
@@ -169,7 +167,7 @@ AC_ARG_WITH(apache,
     elif test -f $withval/apache/httpd.h; then
       APACHE_INCLUDE=-"I$withval/apache -I$withval/ssl/include"
       APACHE_TARGET=$withval/apache
-      PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php4.c php_apache.c)
+      PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php4.c php_apache.c, $APACHE_INCLUDE)
       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"
       STRONGHOLD=-DSTRONGHOLD=1
@@ -198,7 +196,6 @@ AC_ARG_WITH(apache,
   AC_MSG_RESULT(no)
 ])
 
-  INCLUDES="$INCLUDES $APACHE_INCLUDE"
 fi
 
 if test "x$APXS" != "x" -a "`uname -sv`" = "AIX 4" -a "$GCC" != "yes"; then
index 277394b722cc8a56f7bda530c099c64537f6f6e5..e296ac2f80d8be220745446a49d2e6c612b43731 100644 (file)
@@ -1,7 +1,11 @@
 Name: php4_module
 ConfigStart
        RULE_WANTHSREGEX=no
-       LIBS="@NATIVE_RPATHS@ @PHP_LDFLAGS@ @PHP_LIBS@ @EXTRA_LIBS@ $LIBS"
        RULE_HIDE=yes
-       CFLAGS="$CFLAGS -I@abs_srcdir@ -I@abs_srcdir@/main -I@abs_builddir@/main -I@abs_srcdir@/Zend -I@abs_builddir@/Zend -I@abs_builddir@/TSRM -I@abs_srcdir@/TSRM -I@abs_builddir@"
+       PHP_LIBS="@NATIVE_RPATHS@ @PHP_LDFLAGS@ @PHP_LIBS@ @EXTRA_LIBS@ $LIBS"
+       PHP_CFLAGS="$CFLAGS -I@OPENSSL_INCDIR@ -I@php_abs_top_srcdir@ -I@php_abs_top_srcdir@/sapi -I@php_abs_top_srcdir@/sapi/apache -I@php_abs_top_srcdir@/main -I@php_abs_top_srcdir@/Zend -I@php_abs_top_srcdir@/TSRM"
+       my_outfile="Makefile.config"
+       echo "PHP_CFLAGS=$PHP_CFLAGS" >>$my_outfile
+       echo "PHP_LIBS=$PHP_LIBS" >>$my_outfile
+       LIBS=$PHP_LIBS
 ConfigEnd