diff options
author | Sascha Schumann <sas@php.net> | 1999-10-04 15:18:26 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 1999-10-04 15:18:26 +0000 |
commit | 232afa4816c60a20d3db48c304ac59312d46ec46 (patch) | |
tree | dd8df9145c12f6b14fe751f6cc862aa8c0768e06 /configure.in | |
parent | ec01d01400c67fd6d1bf2ae0e170771260e1ecc0 (diff) | |
download | php-git-232afa4816c60a20d3db48c304ac59312d46ec46.tar.gz |
* archive-based convenience libraries completely replaced
with libtool components
* SAPI targets can enable thread-safe mode and define
shared/static/program build target
* all configure scripts use the same config.cache
* phplibdir is $(top_builddir)/modules to avoid
permission problems
* sapi/*/Makefile.inc are gone
* runpath handling cleaned up
* top-level Makefile.in obsoleted through Makefile.am
* --enable-versioning uses libtool's cleaner and more
portable -export-symbols feature
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 164 |
1 files changed, 78 insertions, 86 deletions
diff --git a/configure.in b/configure.in index 75a8594bea..035e7f12ad 100644 --- a/configure.in +++ b/configure.in @@ -12,14 +12,8 @@ if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then exit 1 fi -if test "$no_recursion" != "yes"; then - cwd=`pwd` - (set -x; test -d libzend || mkdir libzend; cd libzend; $cwd/$srcdir/libzend/configure --cache-file=$cache_file $@) || exit 1 - if test "$enable_thread_safety" = "yes"; then - (set -x; test -d TSRM || mkdir TSRM; cd TSRM && $cwd/$srcdir/TSRM/configure --cache-file=$cache_file $@) || exit 1 - fi - (set -x; cd $srcdir; sh ltconfig --disable-static --enable-dlopen --cache-file=$cache_file ltmain.sh) -fi +cwd=`pwd` +passthru="$@" dnl ## Diversion 1 is the initial checking of OS features, programs, dnl ## libraries and so on. @@ -69,8 +63,6 @@ dnl test -n "$GCC" || CFLAGS="-Ae $CFLAGS -D_HPUX_SOURCE" dnl fi dnl Checks for programs. -AM_PROG_LIBTOOL -AM_SET_LIBTOOL_VARIABLE([--silent]) AC_PROG_YACC if test "$YACC" != "bison -y"; then AC_MSG_WARN(You will need bison if you want to regenerate the PHP parsers.) @@ -97,6 +89,7 @@ AC_PROG_CC_C_O AC_PROG_LN_S AC_PATH_PROG(PERL_PATH, perl) +AM_PROG_LEX dnl Make flex scanners use const if they can, even if __STDC__ is not dnl true, for compilers like Sun's that only set __STDC__ true in @@ -129,7 +122,6 @@ AC_CACHE_VAL(php_cv_cc_dashr,[ AC_MSG_RESULT($php_cv_cc_dashr) if test $php_cv_cc_dashr = "yes"; then ld_runpath_switch="-R" - apxs_runpath_switch="-Wl,-R'" else AC_MSG_CHECKING([if compiler supports -Wl,-rpath,]) AC_CACHE_VAL(php_cv_cc_rpath,[ @@ -140,42 +132,12 @@ else AC_MSG_RESULT($php_cv_cc_rpath) if test $php_cv_cc_rpath = "yes"; then ld_runpath_switch="-Wl,-rpath," - apxs_runpath_switch="-Wl,'-rpath " else dnl something innocuous ld_runpath_switch="-L" - apxs_runpath_switch="-L'" fi fi -AC_MSG_CHECKING([if compiler supports -Wl,--version-script]) -AC_CACHE_VAL(php_cv_cc_vscript,[ - SLIBS=$LIBS - LIBS="-Wl,--version-script=$srcdir/php.map $LIBS" - AC_TRY_LINK([],[],php_cv_cc_vscript=yes,php_cv_cc_vscript=no) - LIBS=$SLIBS ]) -AC_MSG_RESULT($php_cv_cc_vscript) - - -dnl Check compiler support for -rdynamic -AC_MSG_CHECKING(if compiler supports -rdynamic) -AC_CACHE_VAL(php_cc_rdynamic,[ - SAVE_LIBS="${LIBS}" - LIBS="-rdynamic ${LIBS}" - AC_TRY_LINK([], [], php_cc_rdynamic=yes, php_cc_rdynamic=no) - LIBS="${SAVE_LIBS}"]) -AC_MSG_RESULT($php_cc_rdynamic) -if test $php_cc_rdynamic = "yes"; then - AC_CHECK_CC_OPTION(rdynamic) -fi -if test $php_cc_rdynamic = "yes"; then - LDFLAGS="${LDFLAGS} -rdynamic" - RDYNAMIC_LFLAGS="-rdynamic" -else - RDYNAMIC_LFLAGS="" -fi -AC_SUBST(RDYNAMIC_LFLAGS) - dnl AC_PROG_INSTALL AC_PATH_PROG(PROG_SENDMAIL, sendmail, /usr/lib/sendmail, $PATH /usr/bin /usr/sbin /usr/etc /etc /usr/ucblib) if test -n "$PROG_SENDMAIL"; then @@ -192,7 +154,6 @@ if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then fi INCLUDES="-I\$(top_builddir)/libzend -I\$(top_builddir)/TSRM" -EXTRA_LIBS="$EXTRA_LIBS \`$cwd/libzend/zend_config --libs\`" AC_SUBST(INCLUDES) AC_CHECK_LIB(nsl, gethostname, [ @@ -410,30 +371,18 @@ abs_builddir=`pwd` AC_SUBST(abs_srcdir) AC_SUBST(abs_builddir) -versioning="no" +RESULT=no AC_MSG_CHECKING(whether to enable versioning) AC_ARG_ENABLE(versioning, [ --enable-versioning Take advantage of versioning and scoping. See INSTALL for more information], [ if test "$enableval" = "yes" ; then - case "`uname -sr`" in - "SunOS 5"*) - VERSION_SCRIPT="-Wl,'-M $abs_srcdir/php.map'" - ;; - *) - if test "$php_cv_cc_vscript" = "yes" ; then - VERSION_SCRIPT="-Wl,--version-script=$abs_srcdir/php.map" - else - AC_MSG_ERROR(versioning is not supported on your OS) - fi - ;; - esac - versioning="yes" + EXTRA_LDFLAGS="-export-symbols \$(srcdir)/php.sym" + RESULT="yes" fi ]) -AC_MSG_RESULT($versioning) -AC_SUBST(VERSION_SCRIPT) +AC_MSG_RESULT($RESULT) AC_MSG_CHECKING(whether to use bundled regex library) AC_ARG_WITH(system-regex, @@ -466,8 +415,7 @@ AC_ARG_WITH(system-regex, AC_MSG_RESULT($HSREGEX) if test "$HSREGEX" = "yes"; then - REGEX_LIB=regex/libregex.a - EXTRA_LIBS="-L$abs_builddir/regex -lregex $EXTRA_LIBS" + REGEX_LIB=regex/libregex.la AC_DEFINE(HSREGEX) AC_DEFINE(REGEX,1) else @@ -610,26 +558,6 @@ AC_ARG_ENABLE(magic-quotes, ]) -AC_MSG_CHECKING(whether to build PHP thread-safe) -AC_ARG_ENABLE(thread-safety, -[ --enable-thread-safety Whether to build PHP thread-safe.],[ - if test "$enableval" = "yes"; then - TSRM_LIB='TSRM/libtsrm.a' - TSRM_DIR=TSRM - EXTRA_LIBS="$EXTRA_LIBS \$(TSRM_DIR)/libtsrm.a \`\$(TSRM_DIR)/tsrm_config --libs\`" - AC_DEFINE(ZTS) - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi -],[ - TSRM_DIR="" - TSRM_LIB="" - AC_MSG_RESULT(no) -]) -AC_SUBST(TSRM_DIR) -AC_SUBST(TSRM_LIB) - AC_MSG_CHECKING(whether to enable runpaths) AC_ARG_ENABLE(rpath, [ --disable-rpath Disable passing additional runtime library @@ -696,12 +624,14 @@ AC_MSG_RESULT($DMALLOC_RESULT) dnl ## This is the default server API. PHP_SAPI=cgi SAPI_TARGET=php +PHP_BUILD_PROGRAM esyscmd(./scripts/config-stubs sapi) divert(3) AC_SUBST(EXTRA_LIBS) +AC_SUBST(EXTRA_LDFLAGS) # reading config stubs esyscmd(./scripts/config-stubs ext) @@ -710,9 +640,54 @@ PHP_OUTPUT(sapi/$PHP_SAPI/Makefile) divert(4) +enable_shared=yes +enable_static=yes + +case "$php_build_target" in +program) + enable_static=no + PHP_PROGRAM=php + passthru="$passthru --disable-static" +;; +shared) + enable_static=no + passthru="$passthru --disable-static" +;; +static) + enable_shared=no + passthru="$passthru --disable-shared" +;; +esac + + + +AM_PROG_LIBTOOL +if test "$enable_debug" != "yes"; then + AM_SET_LIBTOOL_VARIABLE([--silent]) +fi + dnl If we are using gcc and the user has not specified CFLAGS, add -O2. test -n "$auto_cflags" && test -n "$GCC" && CFLAGS="$CFLAGS -O2" +AC_MSG_CHECKING(whether to build PHP thread-safe) +AC_ARG_ENABLE(thread-safety, +[ --enable-thread-safety Whether to build PHP thread-safe.],[ + if test "$enableval" = "yes"; then + TSRM_LIB='TSRM/libtsrm.la' + TSRM_DIR=TSRM + AC_DEFINE(ZTS) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi +],[ + TSRM_DIR="" + TSRM_LIB="" + AC_MSG_RESULT(no) +]) +AC_SUBST(TSRM_DIR) +AC_SUBST(TSRM_LIB) + dnl *** Commented out - generates slow code and consumes a lot of dnl *** resources during compilation - we need to figure out how dnl *** to supply it only when absolutely necessary @@ -720,16 +695,23 @@ dnl If we are using gcc add -fpic to make dl() work on some platforms dnl test -n "$GCC" && CFLAGS="$CFLAGS -fpic" dnl add -fPIC option on Solaris if we are building dynamic extensions -PHP_SOLARIS_PIC_WEIRDNESS +dnl PHP_SOLARIS_PIC_WEIRDNESS AC_BUILD_RPATH +phplibdir="`pwd`/modules" +phptempdir="`pwd`/libs" +AC_SUBST(phplibdir) +AC_SUBST(phptempdir) +LDFLAGS="$LDFLAGS -module" +EXTRA_LIBS="$LIBS $EXTRA_LIBS" +LIBS="" + AC_SUBST(CFLAGS) AC_SUBST(PROG_SENDMAIL) -AC_SUBST(CFLAGS_SHLIB) -AC_SUBST(LDFLAGS_SHLIB) -AC_SUBST(LDFLAGS_SHLIB_EXPORT) -AC_SUBST(RPATHS) +AC_SUBST(PHP_RPATHS) +AC_SUBST(NATIVE_RPATHS) +AC_SUBST(PHP_PROGRAM) PHP_BUILD_DATE=`date '+%Y-%m-%d'` AC_SUBST(PHP_BUILD_DATE) @@ -741,7 +723,9 @@ AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS") AC_SUBST(PHP_LIBS) AC_SUBST(PHP_SAPI) -AC_SUBST(SAPI_TARGET) +AC_SUBST(INSTALL_IT) + +PHP_OUTPUT_FILES=`echo $PHP_OUTPUT_FILES | sort` #libphp4.module AC_OUTPUT([Makefile php4.spec ext/Makefile sapi/Makefile $PHP_OUTPUT_FILES @@ -754,6 +738,14 @@ if test ! -f $srcdir/ext/bcmath/number.c; then echo "/* Dummy File */" > $srcdir/ext/bcmath/number.h fi +if test "$no_recursion" != "yes"; then + (set -x; test -d libzend || mkdir libzend; cd libzend; $cwd/$srcdir/libzend/configure --cache-file=../$cache_file $passthru) || exit 1 + if test "$enable_thread_safety" = "yes"; then + (set -x; test -d TSRM || mkdir TSRM; cd TSRM && $cwd/$srcdir/TSRM/configure --cache-file=../$cache_file $passthru) || exit 1 + fi +dnl (set -x; cd $srcdir; sh ltconfig --disable-static --enable-dlopen --cache-file=$cache_file ltmain.sh) +fi + # run this only when generating all the files? if true; then chmod +x scripts/mkextlib |