Browse Source

Build structure change. Instead of using an external configure for libzend

and TSRM, the core code of these configures was separated into extra m4
files which we can now include into PHP's configure. Advantages:

- better integrated
- faster
- distribution becomes smaller (only one set of libtool files)
PHP-4.0.5
Sascha Schumann 26 years ago
parent
commit
a4c484a4d8
  1. 13
      build.mk
  2. 90
      configure.in

13
build.mk

@ -17,16 +17,16 @@ SUBDIRS = libzend TSRM
STAMP = buildmk.stamp
makefile_am_files = Makefile.am $(shell find ext sapi regex pear -name Makefile.am)
makefile_am_files = Makefile.am libzend/Makefile.am TSRM/Makefile.am $(shell find ext sapi regex pear -name Makefile.am)
makefile_in_files = $(makefile_am_files:.am=.in)
makefile_files = $(makefile_am_files:e.am=e)
config_h_in = php_config.h.in
config_h_files = \
$(shell echo ext/*/config.h.stub sapi/*/config.h.stub)
$(shell echo ext/*/config.h.stub sapi/*/config.h.stub libzend/acconfig.h TSRM/acconfig.h)
config_m4_files = \
config_m4_files = libzend/libzend.m4 TSRM/tsrm.m4 libzend/acinclude.m4 \
$(shell echo ext/*/config.m4 sapi/*/config.m4)
acconfig_h_SOURCES = acconfig.h.in $(config_h_files)
@ -36,7 +36,6 @@ targets = $(makefile_in_files) configure $(config_h_in)
all: $(targets)
@for i in $(SUBDIRS); do \
test -d $$i || (test -d ../$$i && ln -s ../$$i $$i); \
(cd $$i>/dev/null && $(MAKE) -f build.mk AMFLAGS=$(AMFLAGS)); \
done
all: $(STAMP)
@ -44,6 +43,12 @@ all: $(STAMP)
$(STAMP): buildcheck.sh
@./buildcheck.sh && touch $(STAMP)
libzend/Makefile.am:
test -d libzend || (test -d ../libzend && ln -s ../libzend libzend)
TSRM/Makefile.am:
test -d TSRM || (test -d ../TSRM && ln -s ../TSRM TSRM)
dist:
@rm -f $(SUBDIRS) 2>/dev/null || true
@for i in $(SUBDIRS); do \

90
configure.in

@ -112,17 +112,9 @@ if test "$ac_cv_c_const" = "yes" ; then
fi
AC_SUBST(LEX_CFLAGS)
dnl Hack to work around a Mac OS X cpp problem
dnl Known versions needing this workaround are 5.3 and 5.4
if test "$ac_cv_prog_gcc" = "yes" -a "`uname -s`" = "Rhapsody"; then
CPPFLAGS="$CPPFLAGS -traditional-cpp"
fi
dnl Ugly hack to get around a problem with gcc on AIX.
if test "$CC" = "gcc" -a "$ac_cv_prog_cc_g" = "yes" -a \
"`uname -sv`" = "AIX 4"; then
CFLAGS=`echo $CFLAGS | sed -e 's/-g//'`
fi
sinclude(libzend/acinclude.m4)
sinclude(libzend/libzend.m4)
sinclude(TSRM/tsrm.m4)
dnl check for -R, etc. switch
AC_MSG_CHECKING(if compiler supports -R)
@ -443,33 +435,29 @@ AC_ARG_WITH(config-file-path,
])
AC_MSG_CHECKING(whether to include debugging symbols)
AC_ARG_ENABLE(debug,
[ --disable-debug Compile without debugging symbols],
[
if test "$enableval" = "yes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(DEBUG,1)
PHP_DEBUG=1
DEBUG_CFLAGS="-g"
test -n "$GCC" && DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall"
test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \
DEBUG_CFLAGS="$DEBUG_CFLAGS -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
else
AC_MSG_RESULT(no)
AC_DEFINE(DEBUG,0)
PHP_DEBUG=0
DEBUG_CFLAGS=""
fi
[ --disable-debug Compile without debugging symbols], [
PHP_DEBUG=$enableval
],[
AC_MSG_RESULT(yes)
PHP_DEBUG=yes
])
AC_MSG_CHECKING(whether to include debugging symbols)
AC_MSG_RESULT($PHP_DEBUG)
if test "$PHP_DEBUG"; then
AC_DEFINE(DEBUG,1)
PHP_DEBUG=1
DEBUG_CFLAGS="-g"
])
ZEND_DEBUG=yes
else
AC_DEFINE(DEBUG,0)
PHP_DEBUG=0
ZEND_DEBUG=no
fi
AC_SUBST(DEBUG_CFLAGS)
AC_SUBST(PHP_DEBUG)
CFLAGS="$CFLAGS $DEBUG_CFLAGS"
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
AC_MSG_CHECKING(whether to enable safe mode by default)
@ -609,15 +597,6 @@ AC_ARG_ENABLE(dmalloc,
])
AC_MSG_RESULT($DMALLOC_RESULT)
AC_MSG_CHECKING(whether to enable experimental ZTS mode)
AC_ARG_ENABLE(experimental-zts,
[ --enable-experimental-zts This will most likely break your build.],[
PHP_EXPERIMENTAL_ZTS=$enableval
],[
PHP_EXPERIMENTAL_ZTS=no
])
AC_MSG_RESULT($PHP_EXPERIMENTAL_ZTS)
AC_MSG_CHECKING(whether to try to stay below resource limits)
AC_ARG_ENABLE(low-memory,
[ --enable-low-memory Try to stay below resource limits],[
@ -703,22 +682,21 @@ test -n "$auto_cflags" && test -n "$GCC" && CFLAGS="$CFLAGS -O2"
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT"
export CPPFLAGS
LIBZEND_BASIC_CHECKS
LIBZEND_OTHER_CHECKS
if test "$PHP_THREAD_SAFETY" = "yes" || test "$PHP_EXPERIMENTAL_ZTS" = "yes"; then
passthru="$passthru --enable-thread-safety"
if test "$PHP_THREAD_SAFETY" = "yes" || test "$ZEND_EXPERIMENTAL_ZTS" = "yes"; then
TSRM_LIB='TSRM/libtsrm.la'
TSRM_DIR=TSRM
AC_DEFINE(ZTS)
INCLUDES="$INCLUDES -I\$(top_builddir)/TSRM -I\$(top_srcdir)/TSRM"
PHP_THREAD_SAFETY=yes
PHP_OUTPUT(TSRM/Makefile)
else
PHP_THREAD_SAFETY=no
fi
AC_MSG_CHECKING(whether to build PHP thread-safe)
AC_MSG_RESULT($PHP_THREAD_SAFETY)
AC_SUBST(TSRM_DIR)
AC_SUBST(TSRM_LIB)
@ -763,8 +741,13 @@ AC_SUBST(PHP_LIBS)
AC_SUBST(PHP_SAPI)
AC_SUBST(INSTALL_IT)
if test "$PHP_THREAD_SAFETY" = "yes"; then
TSRM_BASIC_CHECKS
TSRM_PTHREAD
fi
#libphp4.module
AC_OUTPUT([Makefile php4.spec ext/Makefile sapi/Makefile pear/Makefile
AC_OUTPUT([Makefile php4.spec libzend/Makefile ext/Makefile sapi/Makefile pear/Makefile
$PHP_OUTPUT_FILES
scripts/mkextlib build-defs.h], [], [
@ -775,13 +758,8 @@ 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 "$PHP_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
test -d TSRM && echo '#include "../php_config.h"' > TSRM/tsrm_config.h
echo '#include "../php_config.h"' > libzend/zend_config.h
# run this only when generating all the files?
if true; then

Loading…
Cancel
Save