Reputation: 41
I have a C++ library I would like to link to and use in PHP: libsigx.a
I would like to link with it by putting it in my config.m4 file (Zend).
[config.m4]
PHP_ARG_ENABLE(sigx,
[Whether to enable the "sigx" extension],
[ --enable-sigx Enable "sigx" extension support])
if test $PHP_SIGX != "no"; then
PHP_REQUIRE_CXX()
PHP_SUBST(SIGX_SHARED_LIBADD)
PHP_ADD_LIBRARY(stdc++, 1, SIGX_SHARED_LIBADD)
PHP_ADD_LIBRARY(stdc++, 1, "libsigx.a")
PHP_NEW_EXTENSION(sigx, sigx.cc, $ext_shared)
fi
This is not working for me. I can run phpize and ./configure just fine, but when I go to run a test script, it complains about objects in the library not being available.
Upvotes: 1
Views: 1150
Reputation: 41
What I said in my comment worked.
PHP_ADD_LIBRARY_WITH_PATH(sigx, ., SIGX_SHARED_LIBADD)
Upvotes: 3