]> granicus.if.org Git - php/commitdiff
- Reorganized stuff in configure.in and added a few comments
authorMarko Karppinen <markonen@php.net>
Sat, 26 Jan 2002 23:57:17 +0000 (23:57 +0000)
committerMarko Karppinen <markonen@php.net>
Sat, 26 Jan 2002 23:57:17 +0000 (23:57 +0000)
# This isn't nearly as big a change as the diff would lead one to believe.
# I've tested this on all my machines and its working for sniper too.
- Added a check for ApplicationServices/ApplicationServices.h (Mac OS X)
- Added AC_PROG_CPP, AC_PROG_CXX and AC_PROG_CXXCPP
# (the bundled libmysql build was failing without them with ac2.52/OSX)
- Improved the IPv6 check to fail on Mac OS X (there's no IPv6 there yet)

configure.in

index 51e6fe9cf433087becabe60a04826235481b6aba..b49b785c4a21cbf21492ae5667a6151007c849ae 100644 (file)
@@ -3,37 +3,9 @@ dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
 
-AC_INIT(README.CVS-RULES)
-
-PHP_FAST_OUTPUT(sapi/Makefile ext/Makefile Makefile pear/Makefile main/Makefile sapi/cli/Makefile)
-
-if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then
-  AC_MSG_ERROR([--with-shared-apache is not supported. Please refer to the documentation for using APXS])
-fi
-
-if test -n "$with_apache" && test -n "$with_apxs"; then
-  AC_MSG_ERROR([--with-apache and --with-apxs cannot be used together])
-fi
-
-cwd=`pwd`
-
-PHP_CONFIG_NICE(config.nice)
-
-for arg in $0 "$@"; do
-  CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
-done
-
-php_shtool=$srcdir/build/shtool
-T_MD=`$php_shtool echo -n -e %B`
-T_ME=`$php_shtool echo -n -e %b`
-
-dnl Because ``make install'' is often performed by the superuser,
-dnl we create the libs subdirectory as the user who configures PHP.
-dnl Otherwise, the current user will not be able to delete libs
-dnl or the contents of libs.
-
-$php_shtool mkdir -p libs
-rm -f libs/*
+dnl ## Diversion 1 is the autoconf + automake setup phase. We also
+dnl ## set the PHP version, deal with platform-specific compile
+dnl ## options and check for the basic compile tools.
 
 dnl ## Diversion 2 is the initial checking of OS features, programs,
 dnl ## libraries and so on.
@@ -45,13 +17,33 @@ dnl ## tags are enabled, and the default behaviour of php.ini options.
 dnl ## This is also where an SAPI interface is selected (choosing between
 dnl ## Apache module, CGI etc.)
 
-dnl ## In diversion 4 we check which extensions should be compiled.
-dnl ## All of these are normally in the extension directories.
+dnl ## In diversion 4 we check user-configurable general settings.
 
+dnl ## In diversion 5 we check which extensions should be compiled.
+dnl ## All of these are normally in the extension directories.
 dnl ## Diversion 5 is the last one.  Here we generate files and clean up.
 
-dnl ## This is where the version number is changed from now on!
+
+
+dnl Basic autoconf + automake initialization, generation of config.nice.
+dnl -------------------------------------------------------------------------
+
+AC_INIT(README.CVS-RULES)
+
+PHP_CONFIG_NICE(config.nice)
+for arg in $0 "$@"; do
+  CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
+done
+
+AC_CANONICAL_HOST
 AM_INIT_AUTOMAKE(php, 4.2.0-dev, nodefine)
+AM_CONFIG_HEADER(main/php_config.h)
+AM_MAINTAINER_MODE
+
+
+
+dnl Setting up the PHP version based on the information above.
+dnl -------------------------------------------------------------------------
 
 PHP_VERSION=$VERSION
 echo "/* automatically generated by configure */" > php_version.h.new
@@ -65,37 +57,31 @@ else
        rm -f php_version.h.new
 fi
 
-AM_CONFIG_HEADER(main/php_config.h)
-AM_MAINTAINER_MODE
-AC_CANONICAL_HOST
 
-dnl We want this one before the checks, so the checks can modify CFLAGS.
-test -z "$CFLAGS" && auto_cflags=1
 
-dnl Checks for programs.
-AC_PROG_AWK
-AC_PROG_YACC
-if test "$YACC" != "bison -y"; then
-    AC_MSG_WARN([You will need bison if you want to regenerate the PHP parsers.])
-else
-    AC_MSG_CHECKING([bison version])
-    set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'`
-    if test "${1}" = "1" -a "${2}" -lt "28"; then
-      AC_MSG_WARN(You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2}).)
-    fi
-    AC_MSG_RESULT(${1}.${2} (ok))
+dnl Catch common errors here to save a few seconds of our users' time
+dnl -------------------------------------------------------------------------
+
+if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then
+  AC_MSG_ERROR([--with-shared-apache is not supported. Please refer to the documentation for using APXS])
+fi
+
+if test -n "$with_apache" && test -n "$with_apxs"; then
+  AC_MSG_ERROR([--with-apache and --with-apxs cannot be used together])
 fi
 
-AC_PROG_CC
-AC_AIX
 
-BSD_MAKEFILE=no
+
+dnl Platform-specific compile settings.
+dnl -------------------------------------------------------------------------
 
 dnl if host_alias is empty, ac_cv_host_alias may still have the info
 if test -z "$host_alias"; then
     host_alias=$ac_cv_host_alias
 fi
 
+BSD_MAKEFILE=no
+
 case $host_alias in
 *solaris*)
     CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
@@ -116,18 +102,91 @@ case $host_alias in
     CPPFLAGS="$CPPFLAGS -D_XPG_IV";;
 esac
 
-AM_PROG_CC_STDC
 
-AC_PROG_RANLIB
+
+dnl Settings we want to make before the checks.
+dnl -------------------------------------------------------------------------
+
+cwd=`pwd`
+
+php_shtool=$srcdir/build/shtool
+T_MD=`$php_shtool echo -n -e %B`
+T_ME=`$php_shtool echo -n -e %b`
+
+dnl We want this one before the checks, so the checks can modify CFLAGS.
+test -z "$CFLAGS" && auto_cflags=1
+
+dnl AC_AIX needs to be before any macros that run the C compiler. 
+AC_AIX
+
+abs_srcdir=`(cd $srcdir; pwd)`
+abs_builddir=`pwd`
+
+dnl Because ``make install'' is often performed by the superuser,
+dnl we create the libs subdirectory as the user who configures PHP.
+dnl Otherwise, the current user will not be able to delete libs
+dnl or the contents of libs.
+
+$php_shtool mkdir -p libs
+rm -f libs/*
+
+PHP_FAST_OUTPUT(sapi/Makefile ext/Makefile Makefile pear/Makefile main/Makefile sapi/cli/Makefile)
+
+
+dnl Checks for programs.
+dnl -------------------------------------------------------------------------
+
+AC_PROG_CC
 AC_PROG_CC_C_O
+dnl Change to AC_PROG_CC_STDC when we start requiring a post-2.13 autoconf
+AM_PROG_CC_STDC
+AC_PROG_CPP
+AC_PROG_CXX
+AC_PROG_CXXCPP
+dnl check for -R, etc. switch
+AC_MSG_CHECKING([whether compiler supports -R])
+AC_CACHE_VAL(php_cv_cc_dashr,[
+       SAVE_LIBS=$LIBS
+       LIBS="-R /usr/lib $LIBS"
+       AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no)
+       LIBS=$SAVE_LIBS])
+AC_MSG_RESULT([$php_cv_cc_dashr])
+if test $php_cv_cc_dashr = "yes"; then
+       ld_runpath_switch=-R
+else
+       AC_MSG_CHECKING([whether compiler supports -Wl,-rpath,])
+       AC_CACHE_VAL(php_cv_cc_rpath,[
+               SAVE_LIBS=$LIBS
+               LIBS="-Wl,-rpath,/usr/lib $LIBS"
+               AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no)
+               LIBS=$SAVE_LIBS])
+       AC_MSG_RESULT([$php_cv_cc_rpath])
+       if test $php_cv_cc_rpath = "yes"; then
+               ld_runpath_switch=-Wl,-rpath,
+       else
+               dnl something innocuous
+               ld_runpath_switch=-L
+       fi
+fi
+AC_PROG_RANLIB
 AC_PROG_LN_S
-
+AC_PROG_AWK
+AC_PROG_YACC
+if test "$YACC" != "bison -y"; then
+    AC_MSG_WARN([You will need bison if you want to regenerate the PHP parsers.])
+else
+    AC_MSG_CHECKING([bison version])
+    set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'`
+    if test "${1}" = "1" -a "${2}" -lt "28"; then
+      AC_MSG_WARN(You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2}).)
+    fi
+    AC_MSG_RESULT(${1}.${2} (ok))
+fi
 AC_PROG_LEX
 if test -n "$LEX"; then
   AC_DECL_YYTEXT
   :
 fi
-
 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
 dnl ## "limit-to-ANSI-standard" mode, not in "ANSI-compatible" mode
@@ -136,22 +195,39 @@ if test "$ac_cv_c_const" = "yes" ; then
   LEX_CFLAGS="-DYY_USE_CONST"
 fi
 
-abs_srcdir=`(cd $srcdir; pwd)`
-abs_builddir=`pwd`
+
+
+dnl Include Zend and TSRM configurations.
+dnl -------------------------------------------------------------------------
 
 sinclude(Zend/acinclude.m4)
 sinclude(Zend/Zend.m4)
 sinclude(TSRM/tsrm.m4)
 
+
+
 divert(2)
-PHP_HELP_SEPARATOR([SAPI modules:])
 
-PTHREADS_CHECK
+dnl ## Diversion 2 is where we set PHP-specific options and come up
+dnl ## with reasonable default values for them. We check for pthreads here
+dnl ## because the information is needed by the SAPI configuration.
+dnl ## This is also where an SAPI interface is selected (choosing between
+dnl ## Apache module, CGI etc.)
 
-PHP_SHLIB_SUFFIX_NAME
+dnl .
+dnl -------------------------------------------------------------------------
 
+PTHREADS_CHECK
+PHP_HELP_SEPARATOR([SAPI modules:])
+PHP_SHLIB_SUFFIX_NAME
 PHP_SAPI=cgi
 PHP_BUILD_PROGRAM
+
+
+
+dnl SAPI configuration.
+dnl -------------------------------------------------------------------------
+
 dnl paths to the targets are relative to the build directory
 SAPI_PROGRAM=php
 SAPI_SHARED=libs/libphp4.$SHLIB_SUFFIX_NAME
@@ -170,55 +246,39 @@ if test "$enable_experimental_zts" = "yes"; then
   PTHREADS_FLAGS
 fi
 
+
+
 divert(3)
 
-PHP_CONFIGURE_PART(Running system checks)
+dnl ## In diversion 3 we check for compile-time options to the PHP
+dnl ## core and how to deal with different system dependencies.  This
+dnl ## includes what regex library is used and whether debugging or short
+dnl ## tags are enabled, and the default behaviour of php.ini options.
 
-PHP_MISSING_TIME_R_DECL
 
-dnl check for -R, etc. switch
-AC_MSG_CHECKING([whether compiler supports -R])
-AC_CACHE_VAL(php_cv_cc_dashr,[
-       SAVE_LIBS=$LIBS
-       LIBS="-R /usr/lib $LIBS"
-       AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no)
-       LIBS=$SAVE_LIBS])
-AC_MSG_RESULT([$php_cv_cc_dashr])
-if test $php_cv_cc_dashr = "yes"; then
-       ld_runpath_switch=-R
-else
-       AC_MSG_CHECKING([whether compiler supports -Wl,-rpath,])
-       AC_CACHE_VAL(php_cv_cc_rpath,[
-               SAVE_LIBS=$LIBS
-               LIBS="-Wl,-rpath,/usr/lib $LIBS"
-               AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no)
-               LIBS=$SAVE_LIBS])
-       AC_MSG_RESULT([$php_cv_cc_rpath])
-       if test $php_cv_cc_rpath = "yes"; then
-               ld_runpath_switch=-Wl,-rpath,
-       else
-               dnl something innocuous
-               ld_runpath_switch=-L
-       fi
-fi
 
-PHP_PROG_SENDMAIL
+dnl Starting system checks.
+dnl -------------------------------------------------------------------------
 
+PHP_CONFIGURE_PART(Running system checks)
+
+PHP_MISSING_TIME_R_DECL
+PHP_PROG_SENDMAIL
 dnl Check whether the system uses EBCDIC (not ASCII) as its native codeset
 PHP_EBCDIC
-
-dnl
 dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary
 dnl and source packages.  This should be harmless on other OSs.
-dnl
 if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
        CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
        LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
 fi
-
 INCLUDES="$INCLUDES -I\$(top_builddir)/Zend"
+test -d /usr/ucblib && PHP_ADD_LIBPATH(/usr/ucblib)
 
 
+dnl First, library checks.
+dnl -------------------------------------------------------------------------
+
 AC_CHECK_LIB(socket, socket, [
  PHP_ADD_LIBRARY(socket)
  AC_DEFINE(HAVE_LIBSOCKET,1,[ ]) ], [
@@ -278,6 +338,11 @@ AC_CHECK_LIB(socket, res_search, [
  ]) 
 ])
 
+
+
+dnl Then headers.
+dnl -------------------------------------------------------------------------
+
 dnl Checks for header files.
 AC_HEADER_STDC
 
@@ -290,6 +355,7 @@ fi
 PHP_MISSING_FCLOSE_DECL
 dnl QNX requires unix.h to allow functions in libunix to work properly
 AC_CHECK_HEADERS(
+ApplicationServices/ApplicationServices.h \
 alloca.h \
 arpa/inet.h \
 arpa/nameser.h \
@@ -336,7 +402,11 @@ $ac_includes_default
 #endif
 ])
 
+
+
 dnl Checks for typedefs, structures, and compiler characteristics.
+dnl -------------------------------------------------------------------------
+
 AC_STRUCT_TM
 AC_STRUCT_TIMEZONE
 
@@ -347,8 +417,6 @@ PHP_SOCKLEN_T
 AC_CHECK_SIZEOF(long, 8)
 AC_CHECK_SIZEOF(int, 4)
 
-test -d /usr/ucblib && PHP_ADD_LIBPATH(/usr/ucblib)
-
 dnl Check for members of the stat structure
 AC_STRUCT_ST_BLKSIZE
 dnl AC_STRUCT_ST_BLOCKS will screw QNX because fileblocks.o does not exists
@@ -378,13 +446,17 @@ dnl Check for IPv6 support
 AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
 [AC_TRY_COMPILE([ #include <sys/types.h>
 #include <sys/socket.h>
-#include <netinet/in.h>], [struct sockaddr_in6 s; int i=AF_INET6; s],
+#include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s],
   ac_cv_ipv6_support=yes, ac_cv_ipv6_support=no)])
 if test "$ac_cv_ipv6_support" = yes; then
   AC_DEFINE(HAVE_IPV6,1,[Whether you have IPv6 support])
 fi
 
+
+
 dnl Checks for library functions.
+dnl -------------------------------------------------------------------------
+
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS(
 asctime_r \
@@ -487,7 +559,16 @@ if test $ac_cv_type_in_addr_t = no; then
   AC_DEFINE(in_addr_t, u_int, [ ])
 fi
 
+
+
 divert(4)
+
+dnl ## In diversion 4 we check user-configurable general settings.
+
+dnl General settings.
+dnl -------------------------------------------------------------------------
+
+
 PHP_HELP_SEPARATOR([General settings:])
 
 PHP_ARG_ENABLE(debug, whether to include debugging symbols,
@@ -658,7 +739,18 @@ AC_CHECK_LIB(crypt, crypt, [
   AC_DEFINE(HAVE_CRYPT,1,[ ]) 
 ])
 
+
+
 divert(5)
+
+dnl ## In diversion 5 we check which extensions should be compiled.
+dnl ## All of these are normally in the extension directories.
+
+
+
+dnl Extension configuration.
+dnl -------------------------------------------------------------------------
+
 PHP_HELP_SEPARATOR([Extensions:
 
   --with-EXTENSION=[shared[,PATH]]
@@ -679,6 +771,10 @@ esyscmd(./scripts/config-stubs ext)
 PHP_FAST_OUTPUT(sapi/$PHP_SAPI/Makefile)
 
 
+
+dnl Other settings.
+dnl -------------------------------------------------------------------------
+
 PHP_HELP_SEPARATOR([Other settings:])
 
 AC_MSG_CHECKING([whether to enable versioning])
@@ -729,6 +825,10 @@ fi
 
 PHP_REGEX
 
+
+dnl Configuring Zend and TSRM.
+dnl -------------------------------------------------------------------------
+
 PHP_CONFIGURE_PART(Configuring Zend)
 LIBZEND_BASIC_CHECKS
 LIBZEND_OTHER_CHECKS