Bug #17423 Updated: COMPILE_DL_MODULENAME different in configure and config.h.in

From: Date: Sat, 29 Jun 2002 01:41:09 +0000
Subject: Bug #17423 Updated: COMPILE_DL_MODULENAME different in configure and config.h.in
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-12477@lists.php.net to get a copy of this message
ID: 17423 Updated by: imajes@php.net Reported By: list@firehawksystems.com -Status: Open +Status: Closed Bug Type: *Compile Issues Operating System: FreeBSD 4.3, same on any unix PHP Version: 4.2.1 New Comment: This bug has been fixed in CVS. You can grab a snapshot of the CVS version at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2002-05-25 01:38:16] list@firehawksystems.com I am changing the way I build my PHP extension and am running into some problems. I was originally would build it by copying the directory foo_bar into the ext directory and added --enable-foo_bar=shared to the configure line of PHP and build PHP. Everything worked great! Now I am looking to build it by: phpize ./configure --enable-foo_bar=shared make If I build PHP with the module and install it, include/php/main/php_config.h would have two lines in it: /* */ #define HAVE_FOO_BAR 1 /* Whether to build foo_bar as dynamic module */ #define COMPILE_DL_FOO_BAR 1 And now any clean rebuilds of the extension using the phpize way will work, becuase of the lines in php_config.h. Now if I do a clean build and install of PHP without the module, then try to build the module PHP via phpize, PHP can't load it. Running nm on it reveals that the get_module function is not in the .so file. I have traced the missing get_module function down to: #ifdef COMPILE_DL_FOO_BAR ZEND_GET_MODULE(foo_bar) #endif and COMPILE_DL_FOO_BAR is not defined at compile time. This is not defined because after running phpize config.h.in and configure are different: --- config.h.in #undef COMPILE_DL_FOO_BAR ---configure #define COMPILE_DL_FOOBAR 1 It seems that the configure script is getting the underscore removed from the module name. From what I can tell this is done in acinclude.m4 line 962: AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as dynamic module) I think this needs to be changed to: AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1, Whether to build $1 as dynamic module) This will handle extensions with both dashes and underscores, I think. I also find the same line in the aclocal.m4, so it may need changed there to. Thanks, Brian BTW, no my extension is not named foo_bar, but it does have a underscore it. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17423&edit=1

« previous php.bugs (#12477) next »