Skip to content

Commit 937358e

Browse files
committed
Revert attempt at supporting both autoconf 2.13 and
modern versions in the same build chain. There are simply too many broken things in 2.13 to make it work. Cache handling is broken as well which is why I need to revert the pdo_inc_path cache fix as well. trunk is now 2.60+ only and I'll work on cleaning out all the legacy cruft from there.
1 parent 20ee379 commit 937358e

File tree

11 files changed

+113
-66
lines changed

11 files changed

+113
-66
lines changed

Diff for: acinclude.m4

+5-9
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ AC_DEFUN([PHP_CONFIGURE_PART],[
2929
AC_MSG_RESULT([${T_MD}$1${T_ME}])
3030
])
3131

32-
AC_DEFUN([PHP_DIVERT],[
33-
ifdef([AC_PRESERVE_HELP_ORDER], [], [ divert($1) ] )
34-
])
35-
3632
dnl -------------------------------------------------------------------------
3733
dnl Build system helper macros
3834
dnl -------------------------------------------------------------------------
@@ -2740,17 +2736,17 @@ dnl
27402736
dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]])
27412737
dnl
27422738
AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[
2743-
AC_CACHE_CHECK([for PDO includes], pdo_cv_inc_path, [
2739+
AC_CACHE_CHECK([for PDO includes], pdo_inc_path, [
27442740
AC_MSG_CHECKING([for PDO includes])
27452741
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
2746-
pdo_cv_inc_path=$abs_srcdir/ext
2742+
pdo_inc_path=$abs_srcdir/ext
27472743
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
2748-
pdo_cv_inc_path=$abs_srcdir/ext
2744+
pdo_inc_path=$abs_srcdir/ext
27492745
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
2750-
pdo_cv_inc_path=$prefix/include/php/ext
2746+
pdo_inc_path=$prefix/include/php/ext
27512747
fi
27522748
])
2753-
if test -n "$pdo_cv_inc_path"; then
2749+
if test -n "$pdo_inc_path"; then
27542750
ifelse([$1],[],:,[$1])
27552751
else
27562752
ifelse([$2],[],[AC_MSG_ERROR([Cannot find php_pdo_driver.h.])],[$2])

Diff for: configure.in

+70-16
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
11
## $Id$ -*- autoconf -*-
22
dnl ## 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

726
dnl include Zend specific macro definitions first
827
dnl -------------------------------------------------------------------------
@@ -13,9 +32,6 @@ dnl -------------------------------------------------------------------------
1332

1433
AC_PREREQ(2.13)
1534
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], [])
1935

2036
PHP_CONFIG_NICE(config.nice)
2137

@@ -106,6 +122,21 @@ dnl or the contents of libs.
106122
$php_shtool mkdir -p libs
107123
rm -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+
109140
dnl Checks for programs.
110141
dnl -------------------------------------------------------------------------
111142

@@ -273,9 +304,16 @@ sinclude(Zend/Zend.m4)
273304
sinclude(TSRM/threads.m4)
274305
sinclude(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 .
279317
dnl -------------------------------------------------------------------------
280318

281319
PTHREADS_CHECK
@@ -306,8 +344,12 @@ if test "$enable_maintainer_zts" = "yes"; then
306344
PTHREADS_FLAGS
307345
fi
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

312354
dnl Starting system checks.
313355
dnl -------------------------------------------------------------------------
@@ -649,8 +691,9 @@ if test "x$php_crypt_r" = "x1"; then
649691
PHP_CRYPT_R_STYLE
650692
fi
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

655698
dnl General settings.
656699
dnl -------------------------------------------------------------------------
@@ -889,8 +932,10 @@ else
889932
AC_MSG_RESULT([using system default])
890933
fi
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

895940
dnl Extension configuration.
896941
dnl -------------------------------------------------------------------------
@@ -958,7 +1003,7 @@ if test "$ac_cv_lib_crypt_crypt" = "yes"; then
9581003
EXTRA_LIBS="-lcrypt $EXTRA_LIBS -lcrypt"
9591004
fi
9601005

961-
#unset LIBS LDFLAGS
1006+
unset LIBS LDFLAGS
9621007

9631008
dnl PEAR
9641009
dnl -------------------------------------------------------------------------
@@ -1041,7 +1086,7 @@ if test "$abs_srcdir" != "$abs_builddir"; then
10411086
fi
10421087

10431088
ZEND_EXTRA_LIBS="$LIBS"
1044-
#unset LIBS LDFLAGS
1089+
unset LIBS LDFLAGS
10451090

10461091
PHP_HELP_SEPARATOR([TSRM:])
10471092
PHP_CONFIGURE_PART(Configuring TSRM)
@@ -1053,7 +1098,7 @@ fi
10531098
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS"
10541099
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $LDFLAGS"
10551100
EXTRA_LIBS="$EXTRA_LIBS $LIBS"
1056-
#unset LIBS LDFLAGS
1101+
unset LIBS LDFLAGS
10571102

10581103
test "$prefix" = "NONE" && prefix=/usr/local
10591104
test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
@@ -1317,6 +1362,15 @@ SHARED_LIBTOOL='$(LIBTOOL)'
13171362

13181363
CC=$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+
13201374
PHP_CONFIGURE_PART(Generating files)
13211375

13221376
CXXFLAGS_CLEAN=$CXXFLAGS

Diff for: ext/pdo_dblib/config.m4

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,19 @@ if test "$PHP_PDO_DBLIB" != "no"; then
5959
],[
6060
AC_MSG_CHECKING([for PDO includes])
6161
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
62-
pdo_cv_inc_path=$abs_srcdir/ext
62+
pdo_inc_path=$abs_srcdir/ext
6363
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
64-
pdo_cv_inc_path=$abs_srcdir/ext
64+
pdo_inc_path=$abs_srcdir/ext
6565
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
66-
pdo_cv_inc_path=$prefix/include/php/ext
66+
pdo_inc_path=$prefix/include/php/ext
6767
else
6868
AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
6969
fi
70-
AC_MSG_RESULT($pdo_cv_inc_path)
70+
AC_MSG_RESULT($pdo_inc_path)
7171
])
7272

7373
PDO_DBLIB_DEFS="-DPDO_DBLIB_FLAVOUR=\\\"freetds\\\""
74-
PHP_NEW_EXTENSION(pdo_dblib, pdo_dblib.c dblib_driver.c dblib_stmt.c, $ext_shared,,-I$pdo_cv_inc_path $PDO_DBLIB_DEFS)
74+
PHP_NEW_EXTENSION(pdo_dblib, pdo_dblib.c dblib_driver.c dblib_stmt.c, $ext_shared,,-I$pdo_inc_path $PDO_DBLIB_DEFS)
7575
AC_CHECK_LIB(dnet_stub, dnet_addr,
7676
[ PHP_ADD_LIBRARY_WITH_PATH(dnet_stub,,PDO_DBLIB_SHARED_LIBADD)
7777
AC_DEFINE(HAVE_LIBDNET_STUB,1,[ ])

Diff for: ext/pdo_firebird/config.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if test "$PHP_PDO_FIREBIRD" != "no"; then
5050
PHP_ADD_LIBRARY_WITH_PATH($FIREBIRD_LIBNAME, $FIREBIRD_LIBDIR, PDO_FIREBIRD_SHARED_LIBADD)
5151
PHP_ADD_INCLUDE($FIREBIRD_INCDIR)
5252
AC_DEFINE(HAVE_PDO_FIREBIRD,1,[ ])
53-
PHP_NEW_EXTENSION(pdo_firebird, pdo_firebird.c firebird_driver.c firebird_statement.c, $ext_shared,,-I$pdo_cv_inc_path)
53+
PHP_NEW_EXTENSION(pdo_firebird, pdo_firebird.c firebird_driver.c firebird_statement.c, $ext_shared,,-I$pdo_inc_path)
5454
PHP_SUBST(PDO_FIREBIRD_SHARED_LIBADD)
5555
PHP_ADD_EXTENSION_DEP(pdo_firebird, pdo)
5656
fi

Diff for: ext/pdo_mysql/config.m4

+5-5
Original file line numberDiff line numberDiff line change
@@ -148,20 +148,20 @@ if test "$PHP_PDO_MYSQL" != "no"; then
148148
],[
149149
AC_MSG_CHECKING([for PDO includes])
150150
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
151-
pdo_cv_inc_path=$abs_srcdir/ext
151+
pdo_inc_path=$abs_srcdir/ext
152152
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
153-
pdo_cv_inc_path=$abs_srcdir/ext
153+
pdo_inc_path=$abs_srcdir/ext
154154
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
155-
pdo_cv_inc_path=$prefix/include/php/ext
155+
pdo_inc_path=$prefix/include/php/ext
156156
else
157157
AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
158158
fi
159-
AC_MSG_RESULT($pdo_cv_inc_path)
159+
AC_MSG_RESULT($pdo_inc_path)
160160
])
161161

162162

163163
dnl fix after renaming to pdo_mysql
164-
PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_cv_inc_path -I)
164+
PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_inc_path -I)
165165
ifdef([PHP_ADD_EXTENSION_DEP],
166166
[
167167
PHP_ADD_EXTENSION_DEP(pdo_mysql, pdo)

Diff for: ext/pdo_oci/config.m4

+5-5
Original file line numberDiff line numberDiff line change
@@ -199,18 +199,18 @@ You need to tell me where to find your Oracle Instant Client SDK, or set ORACLE_
199199
],[
200200
AC_MSG_CHECKING([for PDO includes])
201201
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
202-
pdo_cv_inc_path=$abs_srcdir/ext
202+
pdo_inc_path=$abs_srcdir/ext
203203
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
204-
pdo_cv_inc_path=$abs_srcdir/ext
204+
pdo_inc_path=$abs_srcdir/ext
205205
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
206-
pdo_cv_inc_path=$prefix/include/php/ext
206+
pdo_inc_path=$prefix/include/php/ext
207207
else
208208
AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
209209
fi
210-
AC_MSG_RESULT($pdo_cv_inc_path)
210+
AC_MSG_RESULT($pdo_inc_path)
211211
])
212212

213-
PHP_NEW_EXTENSION(pdo_oci, pdo_oci.c oci_driver.c oci_statement.c, $ext_shared,,-I$pdo_cv_inc_path)
213+
PHP_NEW_EXTENSION(pdo_oci, pdo_oci.c oci_driver.c oci_statement.c, $ext_shared,,-I$pdo_inc_path)
214214

215215
PHP_SUBST_OLD(PDO_OCI_SHARED_LIBADD)
216216
PHP_SUBST_OLD(PDO_OCI_DIR)

Diff for: ext/pdo_odbc/config.m4

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ if test "$PHP_PDO_ODBC" != "no"; then
4747
],[
4848
AC_MSG_CHECKING([for PDO includes])
4949
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
50-
pdo_cv_inc_path=$abs_srcdir/ext
50+
pdo_inc_path=$abs_srcdir/ext
5151
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
52-
pdo_cv_inc_path=$abs_srcdir/ext
52+
pdo_inc_path=$abs_srcdir/ext
5353
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
54-
pdo_cv_inc_path=$prefix/include/php/ext
54+
pdo_inc_path=$prefix/include/php/ext
5555
else
5656
AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
5757
fi
58-
AC_MSG_RESULT($pdo_cv_inc_path)
58+
AC_MSG_RESULT($pdo_inc_path)
5959
])
6060

6161
AC_MSG_CHECKING([for selected PDO ODBC flavour])
@@ -165,7 +165,7 @@ functions required for PDO support.
165165
AC_MSG_ERROR([Your ODBC library does not exist or there was an error. Check config.log for more information])
166166
], $PDO_ODBC_LDFLAGS)
167167

168-
PHP_NEW_EXTENSION(pdo_odbc, pdo_odbc.c odbc_driver.c odbc_stmt.c, $ext_shared,,-I$pdo_cv_inc_path $PDO_ODBC_INCLUDE)
168+
PHP_NEW_EXTENSION(pdo_odbc, pdo_odbc.c odbc_driver.c odbc_stmt.c, $ext_shared,,-I$pdo_inc_path $PDO_ODBC_INCLUDE)
169169
PHP_SUBST(PDO_ODBC_SHARED_LIBADD)
170170
ifdef([PHP_ADD_EXTENSION_DEP],
171171
[

Diff for: ext/pdo_pgsql/config.m4

+5-5
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,18 @@ if test "$PHP_PDO_PGSQL" != "no"; then
109109
],[
110110
AC_MSG_CHECKING([for PDO includes])
111111
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
112-
pdo_cv_inc_path=$abs_srcdir/ext
112+
pdo_inc_path=$abs_srcdir/ext
113113
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
114-
pdo_cv_inc_path=$abs_srcdir/ext
114+
pdo_inc_path=$abs_srcdir/ext
115115
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
116-
pdo_cv_inc_path=$prefix/include/php/ext
116+
pdo_inc_path=$prefix/include/php/ext
117117
else
118118
AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
119119
fi
120-
AC_MSG_RESULT($pdo_cv_inc_path)
120+
AC_MSG_RESULT($pdo_inc_path)
121121
])
122122

123-
PHP_NEW_EXTENSION(pdo_pgsql, pdo_pgsql.c pgsql_driver.c pgsql_statement.c, $ext_shared,,-I$pdo_cv_inc_path $PDO_PGSQL_CFLAGS)
123+
PHP_NEW_EXTENSION(pdo_pgsql, pdo_pgsql.c pgsql_driver.c pgsql_statement.c, $ext_shared,,-I$pdo_inc_path $PDO_PGSQL_CFLAGS)
124124
ifdef([PHP_ADD_EXTENSION_DEP],
125125
[
126126
PHP_ADD_EXTENSION_DEP(pdo_pgsql, pdo)

Diff for: ext/pdo_sqlite/config.m4

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ if test "$PHP_PDO_SQLITE" != "no"; then
1919
],[
2020
AC_MSG_CHECKING([for PDO includes])
2121
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
22-
pdo_cv_inc_path=$abs_srcdir/ext
22+
pdo_inc_path=$abs_srcdir/ext
2323
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
24-
pdo_cv_inc_path=$abs_srcdir/ext
24+
pdo_inc_path=$abs_srcdir/ext
2525
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
26-
pdo_cv_inc_path=$prefix/include/php/ext
26+
pdo_inc_path=$prefix/include/php/ext
2727
else
2828
AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
2929
fi
30-
AC_MSG_RESULT($pdo_cv_inc_path)
30+
AC_MSG_RESULT($pdo_inc_path)
3131
])
3232

3333
php_pdo_sqlite_sources_core="pdo_sqlite.c sqlite_driver.c sqlite_statement.c"
@@ -70,7 +70,7 @@ if test "$PHP_PDO_SQLITE" != "no"; then
7070
])
7171

7272
PHP_SUBST(PDO_SQLITE_SHARED_LIBADD)
73-
PHP_NEW_EXTENSION(pdo_sqlite, $php_pdo_sqlite_sources_core, $ext_shared,,-I$pdo_cv_inc_path)
73+
PHP_NEW_EXTENSION(pdo_sqlite, $php_pdo_sqlite_sources_core, $ext_shared,,-I$pdo_inc_path)
7474
else
7575
# use bundled libs
7676
if test "$enable_maintainer_zts" = "yes"; then
@@ -92,7 +92,7 @@ if test "$PHP_PDO_SQLITE" != "no"; then
9292

9393
PHP_NEW_EXTENSION(pdo_sqlite,
9494
$php_pdo_sqlite_sources_core,
95-
$ext_shared,,-DPDO_SQLITE_BUNDLED=1 $other_flags $threadsafe_flags -I$pdo_cv_inc_path)
95+
$ext_shared,,-DPDO_SQLITE_BUNDLED=1 $other_flags $threadsafe_flags -I$pdo_inc_path)
9696

9797
PHP_SUBST(PDO_SQLITE_SHARED_LIBADD)
9898
PHP_ADD_EXTENSION_DEP(pdo_sqlite, sqlite3)

0 commit comments

Comments
 (0)