Date: 09/28/00
- Next message: Benjamin Lee: "Re: [PHP-DEV] Re: [PHP] Level of Java Support in PHP"
- Previous message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #5993 Updated: numeric fields with field len > 10 are chopped"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I have a question about the config.m4 file that I think just needs another
command added to fix my problem, and should be simple for those "in the
know". Stay with me whilst reading this. I'm going to try to give as much
info without swamping you with too much.
I have an extension that makes use of a custom file handler I wrote to
output a special type of file. The module works great under Linux (GCC) and
WIN32 (MSVC 6.0). No problems all works well... except when under Linux I
try to enable shared support for my module. My module was build with the
./ext_skel command as per normal and I've slightly modified the config.m4
file to add support.
Basically what happens is that my library (let's say it's called
libmyfile.a) and include file (myfile.h) site in a "remote" directory that I
specify at the ./configure stage:
./configure --with-myfile --with-myfile-dir=/usr/local/src/myfile (and the
rest of the options)
This works fine and php sees not only my module, but my library as well. If
I change the configuration to:
./configure --with-myfile=shared --with-myfile-dir=/usr/local/src/myfile
(and the rest of the options)
and update the php.ini file to add:
extension=myfile.so (which is in the ./modules directory)
it finds my loadable module OK, but then it complains that it can't resolve
the address to any of my library functions. I think I know why...
When it compiles my module is compiled with the correct include directory
with the -I/usr/local/src/myfile/include statement, but my library doesn't
get loaded until the end when it creates libphp4.la file. Therefore, it
hasn't linked my library with my loadable module.
So, quite simply, how can I get my library to be loaded with my module?
Below is an a copy of my config.m4 file:
dnl $Id$
dnl config.m4 for extension myfile
PHP_ARG_WITH(myfile, for myfile support,
[ --with-myfile Include myfile support])
if test "$PHP_myfile" != "no"; then
AC_DEFINE(HAVE_myfile, 1, [ ])
PHP_EXTENSION(myfile, $ext_shared)
AC_ARG_WITH(myfile-dir,
[ --with-myfile-dir[=DIR] where the root myfile src directory is
installed],[
if test -z $withval; then
withval="/usr/local/src/myfile"
fi
AC_ADD_LIBRARY_WITH_PATH(myfile, $withval/lib)
AC_ADD_INCLUDE($withval/include)
])
fi
Any help would be greatly appreciated.
Thanks,
Mike Berry-Porter
mikebp <email protected>
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Benjamin Lee: "Re: [PHP-DEV] Re: [PHP] Level of Java Support in PHP"
- Previous message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #5993 Updated: numeric fields with field len > 10 are chopped"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

