dnl ## This is the default server API.
PHP_SAPI=cgi
-SAPI_TARGET=php
PHP_BUILD_PROGRAM
+dnl paths to the targets relative to the build directory
+SAPI_PROGRAM=php
+SAPI_SHARED=libs/libphp4.so
+SAPI_STATIC=libs/libphp4.a
esyscmd(./scripts/config-stubs sapi)
fi
# Warn about CGI version with no extra security options.
- if test "$SAPI_TARGET" = "php"; then
+ if test "$PHP_SAPI" = "cgi"; then
if test "$REDIRECT" = "0"; then
if test "$DISCARD_PATH" = "0"; then
echo "+--------------------------------------------------------------------+"
AC_DEFINE(HAVE_AOLSERVER)
PHP_SAPI=aolserver
PHP_BUILD_SHARED
- INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 libs/libphp4.so $NS_DIR/root/bin/libphp4.so"
+ INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_SHARED $NS_DIR/root/bin/"
RESULT=yes
])
AC_MSG_RESULT($RESULT)
AC_ADD_INCLUDE($APXS_INCLUDEDIR)
PHP_EXTENSION(apache)
PHP_SAPI=apache
- SAPI_TARGET=libphp4.so
- APACHE_INSTALL="$APXS -i -a -n php4 libs/libphp4.so"
+ APACHE_INSTALL="$APXS -i -a -n php4 $SAPI_SHARED"
PHP_BUILD_SHARED
STRONGHOLD=
AC_DEFINE(APACHE)
APACHE_INSTALL_FILES="\$(srcdir)/sapi/apache/mod_php4.* sapi/apache/libphp4.module"
-if test "$SAPI_TARGET" != "libphp4.so"; then
+if test "$PHP_SAPI" != "apache"; then
AC_MSG_CHECKING(for Apache module support)
AC_ARG_WITH(apache,
[ --with-apache[=DIR] Build Apache module. DIR is the top-level Apache
APACHE_INCLUDE=-I$withval/src
APACHE_TARGET=$withval/src
PHP_SAPI=apache
- SAPI_TARGET=libphp4.a
- APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_TARGET $APACHE_INSTALL_FILES $APACHE_TARGET"
+ APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_INSTALL_FILES $APACHE_TARGET"
PHP_LIBS="-L. -lphp3"
AC_DEFINE(APACHE)
AC_MSG_RESULT(yes - Apache 1.2.x)
mkdir $APACHE_TARGET
fi
PHP_SAPI=apache
- SAPI_TARGET=libs/libphp4.a
- APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_TARGET $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/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/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)
mkdir $APACHE_TARGET
fi
PHP_SAPI=apache
- SAPI_TARGET=libs/libphp4.a
PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
- APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_TARGET $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/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/apMakefile.libdir $APACHE_TARGET/Makefile.libdir"
AC_DEFINE(APACHE)
AC_MSG_RESULT(yes - Apache 1.3.x)
STRONGHOLD=
APACHE_INCLUDE=-"I$withval/apache -I$withval/ssl/include"
APACHE_TARGET=$withval/apache
PHP_SAPI=apache
- SAPI_TARGET=libs/libphp4.a
PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
- APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_TARGET $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET"
+ APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET"
STRONGHOLD=-DSTRONGHOLD=1
AC_DEFINE(APACHE)
AC_MSG_RESULT(yes - StrongHold)
-if test "$SAPI_TARGET" = "php"; then
+if test "$PHP_SAPI" = "cgi"; then
AC_MSG_CHECKING(whether to force Apache CGI redirect)
AC_ARG_ENABLE(force-cgi-redirect,
[ --enable-force-cgi-redirect
])
fi
-if test "$SAPI_TARGET" = "php" ; then
- INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_TARGET \$(bindir)/$SAPI_TARGET"
+if test "$PHP_SAPI" = "cgi" ; then
+ INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_PROGRAM \$(bindir)/$SAPI_CGI"
fi
AC_MSG_CHECKING(for fhttpd module support)
[ --with-fhttpd[=DIR] Build fhttpd module. DIR is the fhttpd sources
directory, defaults to /usr/local/src/fhttpd.],
[
- if test "$withval" = "yes"; then
- # fhttpd source directory
- withval=/usr/local/src/fhttpd
- fi
- if test "$withval" != "no"; then
+ if test "$withval" = "yes"; then
+ # fhttpd source directory
+ withval=/usr/local/src/fhttpd
+ fi
+ if test "$withval" != "no"; then
# For fhttpd 0.3.x
- if test -f $withval/servproc.h; then
- FHTTPD_INCLUDE=-I$withval/
- FHTTPD_LIB=$withval/servproc.o
- FHTTPD_TARGET=$withval/
- SAPI_TARGET=php
- AC_DEFINE(FHTTPD)
- AC_MSG_RESULT(yes - fhttpd 0.3.x)
- else
- AC_MSG_RESULT(no)
- AC_MSG_ERROR(Invalid fhttpd directory - unable to find servproc.h under $withval)
- fi
- else
- AC_MSG_RESULT(no)
- fi
+ if test -f $withval/servproc.h; then
+ FHTTPD_INCLUDE=-I$withval/
+ FHTTPD_LIB=$withval/servproc.o
+ FHTTPD_TARGET=$withval/
+ PHP_BUILD_STATIC
+ PHP_SAPI=cgi
+ AC_DEFINE(FHTTPD)
+ AC_MSG_RESULT(yes - fhttpd 0.3.x)
+ else
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR(Invalid fhttpd directory - unable to find servproc.h under $withval)
+ fi
+ else
+ AC_MSG_RESULT(no)
+ fi
],[
- AC_MSG_RESULT(no)
+ AC_MSG_RESULT(no)
])
INCLUDES="$INCLUDES $FHTTPD_INCLUDE"
dnl## AC_SUBST(FHTTPD_INCLUDE)
dnl AC_DEFINE(WITH_ZEUS)
dnl AC_ADD_INCLUDE($zeuspath/web/include)
dnl PHP_SAPI=isapi
-dnl SAPI_TARGET=php4isapi.so
+dnl PHP_BUILD_SHARED
dnl else
dnl AC_MSG_RESULT(no)
dnl fi