I have been trying to build session support as a shared extension and
here is what I have found. It works fine if you us the phpize,
./configure, make method, but if you try building it shared while
building PHP it will not work.
./configure --with-layout=GNU --enable-session=shared --with-mm=shared
<snip> (it works)
make
<snip>(while compiling main/internal_functions.c)
internal_functions.c:47: `phpext_ps_mm_ptr' undeclared here (not in a function)
internal_functions.c:47: initializer element is not constant
internal_functions.c:47: (near initialization for `php_builtin_extensions[6]')
--- internal_functions.c ---
zend_module_entry *php_builtin_extensions[] = {
phpext_xml_ptr,
phpext_standard_ptr,
phpext_posix_ptr,
phpext_pcre_ptr,
phpext_mysql_ptr,
phpext_ctype_ptr,
phpext_ps_mm_ptr,
};
It seems that phpext_ps_mm_ptr gets added if --with-mm or
--with-mm=shared is set. Adding it with --with-mm=shared is bad as
it is not needed and doesn't include the right headers for that
function anyway. I have created a patch to fix this, but wanted to
make sure this was the best way to fix it. Is there a better way?
Comments?
Thanks,
Brian
BTW,
./configure --with-layout=GNU --enable-session=shared --with-mm=no
and
./configure --with-layout=GNU --enable-session=shared --without-mm
will not build it shared either, but I am not worried about that.
---------------- Patch
--- php-4.2.1/configure Mon Jun 24 14:15:58 2002
+++ php-4.2.1/configure Mon Jun 24 14:16:36 2002
@@ -57197,9 +57197,9 @@
#define HAVE_LIBMM 1
EOF
-
- EXTRA_MODULE_PTRS="$EXTRA_MODULE_PTRS phpext_ps_mm_ptr,"
-
+ if test "$ext_shared" != "yes"; then
+ EXTRA_MODULE_PTRS="$EXTRA_MODULE_PTRS phpext_ps_mm_ptr,"
+ fi
fi
if test "$PHP_SESSION" != "no"; then
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php