wez Sun Jul 18 08:03:51 2004 EDT
Added files:
/php-src/build order_by_dep.awk
Modified files:
/php-src acinclude.m4 configure.in
/php-src/build genif.sh
/php-src/ext/dom config.m4
/php-src/ext/simplexml config.m4
/php-src/ext/spl config.m4
/php-src/ext/xml config.m4
/php-src/ext/xsl config.m4
Log:
Implement extension load-order deps.
http://cvs.php.net/diff.php/php-src/acinclude.m4?r1=1.271&r2=1.272&ty=u
Index: php-src/acinclude.m4
diff -u php-src/acinclude.m4:1.271 php-src/acinclude.m4:1.272
--- php-src/acinclude.m4:1.271 Fri Mar 26 21:03:44 2004
+++ php-src/acinclude.m4 Sun Jul 18 08:03:51 2004
@@ -1,4 +1,4 @@
-dnl $Id: acinclude.m4,v 1.271 2004/03/27 02:03:44 abies Exp $
+dnl $Id: acinclude.m4,v 1.272 2004/07/18 12:03:51 wez Exp $
dnl
dnl This file contains local autoconf functions.
@@ -1920,3 +1920,14 @@
LIBS=$old_LIBS
])
])
+
+dnl This macro is currently a placeholder in the config.m4 file
+dnl it is scanned by genif.sh when it builds the internal functions
+dnl list, so that modules can be init'd in the correct order
+dnl $1 = name of extension, $2 = extension upon which it depends
+dnl $3 = optional: if true, it's ok for $2 to have not been configured
+dnl default is false and should halt the build.
+dnl See ADD_EXTENSION_DEP in win32 build
+AC_DEFUN(PHP_ADD_EXTENSION_DEP, [])
+
+
http://cvs.php.net/diff.php/php-src/configure.in?r1=1.514&r2=1.515&ty=u
Index: php-src/configure.in
diff -u php-src/configure.in:1.514 php-src/configure.in:1.515
--- php-src/configure.in:1.514 Tue Jul 13 15:56:48 2004
+++ php-src/configure.in Sun Jul 18 08:03:51 2004
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.514 2004/07/13 19:56:48 andi Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.515 2004/07/18 12:03:51 wez Exp $ -*- sh -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(1)
@@ -130,7 +130,31 @@
PHP_PROG_RE2C
AC_PROG_RANLIB
AC_PROG_LN_S
-AC_PROG_AWK
+
+dnl Some vendors force mawk before gawk; mawk is broken so we don't like that,
+dnl and check manually
+dnl AC_PROG_AWK
+AC_CHECK_PROGS(AWK, gawk nawk awk mawk, bork, /usr/xpg4/bin/:$PATH)
+case "$AWK" in
+ *mawk)
+ AC_MSG_WARN([mawk is known to have problems on some systems. You
should install GNU awk])
+ ;;
+ *gawk)
+ ;;
+ bork)
+ AC_MSG_ERROR([Could not find awk; Install GNU awk])
+ ;;
+ *)
+ AC_MSG_CHECKING([if $AWK is broken])
+ if ! $AWK 'function foo() {}' >/dev/null 2>&1 ; then
+ AC_MSG_RESULT([yes])
+ AC_MSG_ERROR([You should install GNU awk])
+ else
+ AC_MSG_RESULT([no - good!])
+ fi
+ ;;
+esac
+
AC_PROG_YACC
if test "$YACC" != "bison -y"; then
AC_MSG_WARN([You will need bison if you want to regenerate the PHP parsers.])
http://cvs.php.net/diff.php/php-src/build/genif.sh?r1=1.3&r2=1.4&ty=u
Index: php-src/build/genif.sh
diff -u php-src/build/genif.sh:1.3 php-src/build/genif.sh:1.4
--- php-src/build/genif.sh:1.3 Fri Mar 22 05:22:41 2002
+++ php-src/build/genif.sh Sun Jul 18 08:03:51 2004
@@ -1,6 +1,6 @@
#! /bin/sh
-# $Id: genif.sh,v 1.3 2002/03/22 10:22:41 sas Exp $
+# $Id: genif.sh,v 1.4 2004/07/18 12:03:51 wez Exp $
# replacement for genif.pl
infile=$1
@@ -17,13 +17,13 @@
exit 1
fi
-module_ptrs=$extra_module_ptrs
header_list=
olddir=`pwd`
cd $srcdir
+module_ptrs="$extra_module_ptrs`echo $@ | $awk -f ./build/order_by_dep.awk`"
+
for ext in ${1+"$@"} ; do
- module_ptrs=" phpext_${ext}_ptr,@[EMAIL PROTECTED]"
header_list="$header_list ext/$ext/*.h"
done
http://cvs.php.net/diff.php/php-src/ext/dom/config.m4?r1=1.15&r2=1.16&ty=u
Index: php-src/ext/dom/config.m4
diff -u php-src/ext/dom/config.m4:1.15 php-src/ext/dom/config.m4:1.16
--- php-src/ext/dom/config.m4:1.15 Sun Dec 7 10:37:30 2003
+++ php-src/ext/dom/config.m4 Sun Jul 18 08:03:51 2004
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.15 2003/12/07 15:37:30 sniper Exp $
+dnl $Id: config.m4,v 1.16 2004/07/18 12:03:51 wez Exp $
dnl
PHP_ARG_ENABLE(dom, whether to enable DOM support,
@@ -26,6 +26,7 @@
typeinfo.c domerror.c domlocator.c namednodemap.c
userdatahandler.c],
$ext_shared)
PHP_SUBST(DOM_SHARED_LIBADD)
+ PHP_ADD_EXTENSION_DEP(dom, libxml)
], [
AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
])
http://cvs.php.net/diff.php/php-src/ext/simplexml/config.m4?r1=1.7&r2=1.8&ty=u
Index: php-src/ext/simplexml/config.m4
diff -u php-src/ext/simplexml/config.m4:1.7 php-src/ext/simplexml/config.m4:1.8
--- php-src/ext/simplexml/config.m4:1.7 Wed Nov 12 18:42:35 2003
+++ php-src/ext/simplexml/config.m4 Sun Jul 18 08:03:51 2004
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.7 2003/11/12 23:42:35 sniper Exp $
+dnl $Id: config.m4,v 1.8 2004/07/18 12:03:51 wez Exp $
dnl config.m4 for extension simplexml
PHP_ARG_ENABLE(simplexml, whether to enable simplexml support,
@@ -18,4 +18,5 @@
], [
AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
])
+ PHP_ADD_EXTENSION_DEP(simplexml, libxml)
fi
http://cvs.php.net/diff.php/php-src/ext/spl/config.m4?r1=1.10&r2=1.11&ty=u
Index: php-src/ext/spl/config.m4
diff -u php-src/ext/spl/config.m4:1.10 php-src/ext/spl/config.m4:1.11
--- php-src/ext/spl/config.m4:1.10 Mon Feb 9 13:18:00 2004
+++ php-src/ext/spl/config.m4 Sun Jul 18 08:03:51 2004
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.10 2004/02/09 18:18:00 sniper Exp $
+dnl $Id: config.m4,v 1.11 2004/07/18 12:03:51 wez Exp $
dnl config.m4 for extension SPL
PHP_ARG_ENABLE(spl, enable SPL suppport,
@@ -10,4 +10,5 @@
fi
AC_DEFINE(HAVE_SPL, 1, [Whether you want SPL (Standard PHP Library) support])
PHP_NEW_EXTENSION(spl, php_spl.c spl_functions.c spl_engine.c spl_iterators.c
spl_array.c spl_directory.c spl_sxe.c, $ext_shared)
+ PHP_ADD_EXTENSION_DEP(spl, simplexml)
fi
http://cvs.php.net/diff.php/php-src/ext/xml/config.m4?r1=1.48&r2=1.49&ty=u
Index: php-src/ext/xml/config.m4
diff -u php-src/ext/xml/config.m4:1.48 php-src/ext/xml/config.m4:1.49
--- php-src/ext/xml/config.m4:1.48 Wed Nov 12 18:42:36 2003
+++ php-src/ext/xml/config.m4 Sun Jul 18 08:03:51 2004
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.48 2003/11/12 23:42:36 sniper Exp $
+dnl $Id: config.m4,v 1.49 2004/07/18 12:03:51 wez Exp $
dnl
PHP_ARG_ENABLE(xml,whether to enable XML support,
@@ -47,5 +47,6 @@
PHP_NEW_EXTENSION(xml, xml.c $xml_extra_sources, $ext_shared)
PHP_SUBST(XML_SHARED_LIBADD)
+ PHP_ADD_EXTENSION_DEP(xml, libxml)
AC_DEFINE(HAVE_XML, 1, [ ])
fi
http://cvs.php.net/diff.php/php-src/ext/xsl/config.m4?r1=1.7&r2=1.8&ty=u
Index: php-src/ext/xsl/config.m4
diff -u php-src/ext/xsl/config.m4:1.7 php-src/ext/xsl/config.m4:1.8
--- php-src/ext/xsl/config.m4:1.7 Wed Nov 19 07:07:59 2003
+++ php-src/ext/xsl/config.m4 Sun Jul 18 08:03:51 2004
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.7 2003/11/19 12:07:59 chregu Exp $
+dnl $Id: config.m4,v 1.8 2004/07/18 12:03:51 wez Exp $
dnl
PHP_ARG_WITH(xsl, for XSL support,
@@ -59,4 +59,5 @@
AC_DEFINE(HAVE_XSL,1,[ ])
PHP_NEW_EXTENSION(xsl, php_xsl.c xsltprocessor.c, $ext_shared)
PHP_SUBST(XSL_SHARED_LIBADD)
+ PHP_ADD_EXTENSION_DEP(xsl, libxml)
fi
http://cvs.php.net/co.php/php-src/build/order_by_dep.awk?r=1.1&p=1
Index: php-src/build/order_by_dep.awk
+++ php-src/build/order_by_dep.awk
BEGIN {
orig_rs = RS;
orig_fs = FS;
RS=" ";
mod_count = 0;
SUBSEP=":";
}
function get_deps(module_name, depline, cmd)
{
# this could probably be made *much* better
RS=orig_rs;
FS="[(,) \t]+"
cmd = "grep PHP_ADD_EXTENSION_DEP ext/" module_name "/config*.m4"
while (cmd | getline) {
# printf("GOT: %s,%s,%s,%s,%s\n", $1, $2, $3, $4, $5);
if (!length($5)) {
$5 = 0;
}
mod_deps[module_name, $4] = $5;
}
close(cmd)
RS=" ";
FS=orig_fs;
}
function get_module_index(name, i)
{
for (i in mods) {
if (mods[i] == name) {
return i;
}
}
return -1;
}
function do_deps(mod_idx, module_name, mod_name_len, dep, ext, val, depidx)
{
module_name = mods[mod_idx];
mod_name_len = length(module_name);
for (ext in mod_deps) {
if (substr(ext, 0, mod_name_len+1) != module_name SUBSEP) {
continue;
}
val = mod_deps[ext];
ext = substr(ext, mod_name_len+2, length(ext)-mod_name_len);
depidx = get_module_index(ext);
if (depidx >= 0) {
do_deps(depidx);
}
}
#printf(" phpext_%s_ptr,\n", module_name);
printf(" phpext_%s_ptr,@NEWLINE@", module_name);
delete mods[mod_idx];
}
function count(arr, n, i)
{
n = 0;
for (i in arr)
n++;
return n;
}
/^[a-zA-Z0-9_-]+/ {
# mini hack for pedantic awk
gsub("[^a-zA-Z0-9_-]", "", $1)
# add each item to array
mods[mod_count++] = $1
# see if it has any module deps
get_deps($1);
}
END {
# order it correctly
out_count = 0;
while (count(mods)) {
# count down, since we need to assemble it in reverse order
for (i = mod_count-1; i >= 0; --i) {
if (i in mods) {
do_deps(i);
}
}
}
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php