# [PATCH] primitive load order deps for unix build system

- Thread: https://externals.io/message/9979
- Original archive: https://news-web.php.net/php.internals/9979
- Started by Wez Furlong on 2004-05-20T19:34:01+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #9979 — Wez Furlong — 2004-05-20T19:34:01+00:00

URL: https://externals.io/message/9979#9979

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

---

## #9983 — Andi Gutmans — 2004-05-21T04:46:56+00:00

URL: https://externals.io/message/9979#9983 · In reply to: #9979

How many platforms did you check this one?

Andi

At 08:34 PM 5/20/2004 +0100, Wez Furlong wrote:
>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
