1
1
# # $Id$ -*- autoconf -*-
2
2
dnl ## Process this file with autoconf to produce a configure script.
3
3
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.
6
25
7
26
dnl include Zend specific macro definitions first
8
27
dnl -------------------------------------------------------------------------
@@ -13,9 +32,6 @@ dnl -------------------------------------------------------------------------
13
32
14
33
AC_PREREQ ( 2.13 )
15
34
AC_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 ] , [ ] )
19
35
20
36
PHP_CONFIG_NICE(config.nice)
21
37
@@ -106,6 +122,21 @@ dnl or the contents of libs.
106
122
$php_shtool mkdir -p libs
107
123
rm -f libs/*
108
124
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
+
109
140
dnl Checks for programs.
110
141
dnl -------------------------------------------------------------------------
111
142
@@ -273,9 +304,16 @@ sinclude(Zend/Zend.m4)
273
304
sinclude ( TSRM/threads.m4 )
274
305
sinclude ( TSRM/tsrm.m4 )
275
306
276
- dnl AC 2.13 Compatibility
277
- PHP_DIVERT(2)
278
307
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 .
279
317
dnl -------------------------------------------------------------------------
280
318
281
319
PTHREADS_CHECK
@@ -306,8 +344,12 @@ if test "$enable_maintainer_zts" = "yes"; then
306
344
PTHREADS_FLAGS
307
345
fi
308
346
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.
311
353
312
354
dnl Starting system checks.
313
355
dnl -------------------------------------------------------------------------
@@ -649,8 +691,9 @@ if test "x$php_crypt_r" = "x1"; then
649
691
PHP_CRYPT_R_STYLE
650
692
fi
651
693
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.
654
697
655
698
dnl General settings.
656
699
dnl -------------------------------------------------------------------------
@@ -889,8 +932,10 @@ else
889
932
AC_MSG_RESULT ( [ using system default] )
890
933
fi
891
934
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.
894
939
895
940
dnl Extension configuration.
896
941
dnl -------------------------------------------------------------------------
@@ -958,7 +1003,7 @@ if test "$ac_cv_lib_crypt_crypt" = "yes"; then
958
1003
EXTRA_LIBS="-lcrypt $EXTRA_LIBS -lcrypt"
959
1004
fi
960
1005
961
- # unset LIBS LDFLAGS
1006
+ unset LIBS LDFLAGS
962
1007
963
1008
dnl PEAR
964
1009
dnl -------------------------------------------------------------------------
@@ -1041,7 +1086,7 @@ if test "$abs_srcdir" != "$abs_builddir"; then
1041
1086
fi
1042
1087
1043
1088
ZEND_EXTRA_LIBS="$LIBS"
1044
- # unset LIBS LDFLAGS
1089
+ unset LIBS LDFLAGS
1045
1090
1046
1091
PHP_HELP_SEPARATOR([ TSRM:] )
1047
1092
PHP_CONFIGURE_PART(Configuring TSRM)
1053
1098
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS"
1054
1099
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $LDFLAGS"
1055
1100
EXTRA_LIBS="$EXTRA_LIBS $LIBS"
1056
- # unset LIBS LDFLAGS
1101
+ unset LIBS LDFLAGS
1057
1102
1058
1103
test "$prefix" = "NONE" && prefix=/usr/local
1059
1104
test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
@@ -1317,6 +1362,15 @@ SHARED_LIBTOOL='$(LIBTOOL)'
1317
1362
1318
1363
CC=$old_CC
1319
1364
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
+
1320
1374
PHP_CONFIGURE_PART(Generating files)
1321
1375
1322
1376
CXXFLAGS_CLEAN=$CXXFLAGS
0 commit comments