11# # $Id$ -*- autoconf -*-
22dnl ## Process this file with autoconf to produce a configure script.
33
4- dnl AC 2.13 Compatibility
5- PHP_DIVERT(1)
4+ divert ( 1 )
5+
6+ dnl ## Diversion 1 is the autoconf + automake setup phase. We also
7+ dnl ## set the PHP version, deal with platform-specific compile
8+ dnl ## options and check for the basic compile tools.
9+
10+ dnl ## Diversion 2 is the initial checking of OS features, programs,
11+ dnl ## libraries and so on.
12+
13+ dnl ## In diversion 3 we check for compile-time options to the PHP
14+ dnl ## core and how to deal with different system dependencies.
15+ dnl ## This includes whether debugging or short tags are enabled
16+ dnl ## and the default behaviour of php.ini options.
17+ dnl ## This is also where an SAPI interface is selected (choosing between
18+ dnl ## Apache module, CGI etc.)
19+
20+ dnl ## In diversion 4 we check user-configurable general settings.
21+
22+ dnl ## In diversion 5 we check which extensions should be compiled.
23+ dnl ## All of these are normally in the extension directories.
24+ dnl ## Diversion 5 is the last one. Here we generate files and clean up.
625
726dnl include Zend specific macro definitions first
827dnl -------------------------------------------------------------------------
@@ -13,9 +32,6 @@ dnl -------------------------------------------------------------------------
1332
1433AC_PREREQ ( 2.13 )
1534AC_INIT ( README.SVN-RULES )
16- dnl For autoconf 2.60+ we use AC_PRESERVE_HELP_ORDER
17- dnl instead of 2.13-style diversions
18- ifdef ( [ AC_PRESERVE_HELP_ORDER ] , [ AC_PRESERVE_HELP_ORDER ] , [ ] )
1935
2036PHP_CONFIG_NICE(config.nice)
2137
@@ -106,6 +122,21 @@ dnl or the contents of libs.
106122$php_shtool mkdir -p libs
107123rm -f libs/*
108124
125+ dnl Darwin 9 hack
126+ dnl Because the default debugging format used by Apple's GCC on Mac OS 10.5
127+ dnl causes errors in all current and past versions of Autoconf, we do a little
128+ dnl messing with the CFLAGS here to trick it.
129+ php_did_darwin9_cheat=0
130+ case $host_alias in
131+ *darwin9*)
132+ hasg=`echo $CFLAGS | grep -E '(^-g)|([ [ :space:] ] -g)'`
133+ if test x"$hasg" = "x"; then
134+ php_did_darwin9_cheat=1
135+ CFLAGS="$CFLAGS -gstabs"
136+ fi
137+ ;;
138+ esac
139+
109140dnl Checks for programs.
110141dnl -------------------------------------------------------------------------
111142
@@ -273,9 +304,16 @@ sinclude(Zend/Zend.m4)
273304sinclude ( TSRM/threads.m4 )
274305sinclude ( TSRM/tsrm.m4 )
275306
276- dnl AC 2.13 Compatibility
277- PHP_DIVERT(2)
278307
308+ divert ( 2 )
309+
310+ dnl ## Diversion 2 is where we set PHP-specific options and come up
311+ dnl ## with reasonable default values for them. We check for pthreads here
312+ dnl ## because the information is needed by the SAPI configuration.
313+ dnl ## This is also where an SAPI interface is selected (choosing between
314+ dnl ## Apache module, CGI etc.)
315+
316+ dnl .
279317dnl -------------------------------------------------------------------------
280318
281319PTHREADS_CHECK
@@ -306,8 +344,12 @@ if test "$enable_maintainer_zts" = "yes"; then
306344 PTHREADS_FLAGS
307345fi
308346
309- dnl AC 2.13 Compatibility
310- PHP_DIVERT(3)
347+ divert ( 3 )
348+
349+ dnl ## In diversion 3 we check for compile-time options to the PHP
350+ dnl ## core and how to deal with different system dependencies.
351+ dnl ## This includes whether debugging or short tags are enabled
352+ dnl ## and the default behaviour of php.ini options.
311353
312354dnl Starting system checks.
313355dnl -------------------------------------------------------------------------
@@ -649,8 +691,9 @@ if test "x$php_crypt_r" = "x1"; then
649691 PHP_CRYPT_R_STYLE
650692fi
651693
652- dnl AC 2.13 Compatibility
653- PHP_DIVERT(4)
694+ divert ( 4 )
695+
696+ dnl ## In diversion 4 we check user-configurable general settings.
654697
655698dnl General settings.
656699dnl -------------------------------------------------------------------------
@@ -889,8 +932,10 @@ else
889932 AC_MSG_RESULT ( [ using system default] )
890933fi
891934
892- dnl AC 2.13 Compatibility
893- PHP_DIVERT(5)
935+ divert ( 5 )
936+
937+ dnl ## In diversion 5 we check which extensions should be compiled.
938+ dnl ## All of these are normally in the extension directories.
894939
895940dnl Extension configuration.
896941dnl -------------------------------------------------------------------------
@@ -958,7 +1003,7 @@ if test "$ac_cv_lib_crypt_crypt" = "yes"; then
9581003 EXTRA_LIBS="-lcrypt $EXTRA_LIBS -lcrypt"
9591004fi
9601005
961- # unset LIBS LDFLAGS
1006+ unset LIBS LDFLAGS
9621007
9631008dnl PEAR
9641009dnl -------------------------------------------------------------------------
@@ -1041,7 +1086,7 @@ if test "$abs_srcdir" != "$abs_builddir"; then
10411086fi
10421087
10431088ZEND_EXTRA_LIBS="$LIBS"
1044- # unset LIBS LDFLAGS
1089+ unset LIBS LDFLAGS
10451090
10461091PHP_HELP_SEPARATOR([ TSRM:] )
10471092PHP_CONFIGURE_PART(Configuring TSRM)
10531098EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS"
10541099EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $LDFLAGS"
10551100EXTRA_LIBS="$EXTRA_LIBS $LIBS"
1056- # unset LIBS LDFLAGS
1101+ unset LIBS LDFLAGS
10571102
10581103test "$prefix" = "NONE" && prefix=/usr/local
10591104test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
@@ -1317,6 +1362,15 @@ SHARED_LIBTOOL='$(LIBTOOL)'
13171362
13181363CC=$old_CC
13191364
1365+ dnl Finish the Darwin hack
1366+ if test "$php_did_darwin9_cheat" -eq 1; then
1367+ if test "$PHP_DEBUG" = "1"; then
1368+ CFLAGS=`echo "$CFLAGS" | $SED -e 's/-gstabs/-g/g'`
1369+ else
1370+ CFLAGS=`echo "-O2 $CFLAGS" | $SED -e 's/-gstabs//g'`
1371+ fi
1372+ fi
1373+
13201374PHP_CONFIGURE_PART(Generating files)
13211375
13221376CXXFLAGS_CLEAN=$CXXFLAGS
0 commit comments