I've cooked up a patch [1] that causes extension modules to be initialized in an order appropriate to their dependencies. (in other words, it only affects internal_functions.c during configure time).
The heart of the patch is an awk script that spits out the module_ptr structures according to the dependencies it spots in config*.m4 files. You mark a dependency using a new (dummy) macro: PHP_ADD_EXTENSION_DEP(extension, extension-it-depends-upon) This mirrors the ADD_EXTENSION_DEP that we have in the win32 build; this patch is effectively a port of the same kind of code from the win32 build. Now, my awk is a little rusty (it's been more than 6 years since I used it for anything serious), so that part definitely has room for improvement. I'd like to get this into the tree for PHP 5.0, as it will help eliminate some hacks (like SPL and SimpleXML have at the moment). Please test it, particularly on non-Linux platforms (check my awk portability!) to make sure it doesn't mess things up. If someone feels like cleaning up my awk, feel free. If someone can do it all in 100% portable bourne shell (!) feel free also :) --Wez. [1] http://www.php.net/~wez/configure-deps.diff -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php