# How are plugins built on OS X?

- Thread: https://externals.io/message/78851
- Original archive: https://news-web.php.net/php.internals/78851
- Started by Kevin Ingwersen Ingwie Phoenix on 2014-11-07T18:26:01+00:00
- Messages: 1
- 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

---

## #78851 — Kevin Ingwersen Ingwie Phoenix — 2014-11-07T18:26:01+00:00

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

Hey.

While I am creating a small build tool and learning more about Clang/GCC and the various linkers, I came across the differences between shared/dynamic libraries, plugins and executables on the various platforms. That made me wonder, how PHP’s plugins are compiled.

For instance, if one had `enable-curl=shared` turned on, with the CGI and CLI SAPI, we’d get two binaries and a shared object - a „bundle“ on OS X. But, there are two ways to compile php_curl.so :

	-bundle -bundle_loader /path/to/php
or
	-bundle -undefined dynamic_lookup

Both are only needed if unresolved symbols occur, though. In my test-run with a plugin framework, I ran into this issue. By Apple’s docs, one basically needs -bundle and „flags and switches that one would use during the compilation of an executable“.

Which of the above methods are mainly used for PHP’s shared extensions? I would go and try and dig my way thru Make and Autoconf/phpize - but my make-fu is far beyond what I would need here, only to find one single answer. :)

Kind regards, Ingwie
