php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17423 COMPILE_DL_MODULENAME different in configure and config.h.in
Submitted: 2002-05-25 01:38 UTC Modified: 2002-06-28 21:41 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: list at firehawksystems dot com Assigned:
Status: Closed Package: *Compile Issues
PHP Version: 4.2.1 OS: FreeBSD 4.3, same on any unix
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: list at firehawksystems dot com
New email:
PHP Version: OS:

 

 [2002-05-25 01:38 UTC] list at firehawksystems dot 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-28 21:41 UTC] imajes@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 08:01:32 2024 UTC