Re: Third Party lib.so

From: Date: Tue, 10 May 2011 13:37:11 +0000
Subject: Re: Third Party lib.so
References: 1 2 3 4 5 6 7 8  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-8244@lists.php.net to get a copy of this message
On 10/05/2011 14:15, Garry Taylor wrote:
On 09/05/2011 09:38, Garry Taylor wrote:
On 07/05/2011 20:08, Ángel González wrote:
Garry Taylor wrote:
Hi thanx for the info.. I have just realised that the lib is a pcplib.o and not a shared object pcplib.so (uuppps :D). Can you give any pointers as to how I can include the "LSB relocatable" pcplib.o file. Ps I have done the above and got the following error: debian:/home/gizard/PHP/php-5.3.6/ext/hello# make /bin/sh /home/gizard/PHP/php-5.3.6/ext/hello/libtool --mode=link cc -DPHP_ATOM_INC -I/home/gizard/PHP/php-5.3.6/ext/hello/include -I/home/gizard/PHP/php-5.3.6/ext/hello/main -I/home/gizard/PHP/php-5.3.6/ext/hello -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/home/gizard/paf-pcpplus/pcplus/lib/ -DHAVE_CONFIG_H -g -O0 -o hello.la -export-dynamic -avoid-version -prefer-pic -module -rpath /home/gizard/PHP/php-5.3.6/ext/hello/modules hello.lo -lpcplib cc -shared .libs/hello.o -lpcplib -Wl,-soname -Wl,hello.so -o .libs/hello.so */usr/bin/ld: cannot find -lpcplib* collect2: ld returned 1 exit status make: *** [hello.la] Error 1
Listing it with the source files should do the trick, although it's a strange way of providing a library. Don't you have the corresponding .c file? PHP_NEW_EXTENSION(hello, hello.c pcplib.o, $ext_shared)
Hi González, thanx for the feedback. I have updated but I am now getting the following error. /make /bin/sh /home/gizard/PHP/php-5.3.6/ext/hello/libtool --mode=compile cc -I. -I/home/gizard/PHP/php-5.3.6/ext/hello -DPHP_ATOM_INC -I/home/gizard/PHP/php-5.3.6/ext/hello/include -I/home/gizard/PHP/php-5.3.6/ext/hello/main -I/home/gizard/PHP/php-5.3.6/ext/hello -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O0 -c /home/gizard/PHP/php-5.3.6/ext/hello/hello.c -o hello.lo cc -I. -I/home/gizard/PHP/php-5.3.6/ext/hello -DPHP_ATOM_INC -I/home/gizard/PHP/php-5.3.6/ext/hello/include -I/home/gizard/PHP/php-5.3.6/ext/hello/main -I/home/gizard/PHP/php-5.3.6/ext/hello -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O0 -c /home/gizard/PHP/php-5.3.6/ext/hello/hello.c -fPIC -DPIC -o .libs/hello.o /bin/sh /home/gizard/PHP/php-5.3.6/ext/hello/libtool --mode=link cc -DPHP_ATOM_INC -I/home/gizard/PHP/php-5.3.6/ext/hello/include -I/home/gizard/PHP/php-5.3.6/ext/hello/main -I/home/gizard/PHP/php-5.3.6/ext/hello -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O0 -o hello.la -export-dynamic -avoid-version -prefer-pic -module -rpath /home/gizard/PHP/php-5.3.6/ext/hello/modules hello.lo pcplib.lo libtool: link: `pcplib.lo' is not a valid libtool object make: *** [hello.la] Error 1 / Here is my M4 Config /PHP_ARG_ENABLE(hello, whether to enable Hello World support, [ --enable-hello Enable Hello World support]) if test "$PHP_HELLO" = "yes"; then PHP_ADD_LIBPATH("/home/gizard/paf-pcpplus/pcplus/lib", PCPLIB_SHARED_LIBADD) AC_DEFINE(HAVE_HELLO, 1, [Whether you have Hello World]) PHP_NEW_EXTENSION(hello, hello.c pcplib.o, $ext_shared) PHP_SUBST(PCPLIB_SHARED_LIBADD) fi/ / /To compile I am running/ phpize && ./configure && make clean && make && cp modules/hello.so /usr/local/lib/php/extensions/debug-non-zts-20090626/hello.so && /etc/init.d/apache2 force-reload && tail -f /var/log/apache2/error.log// /I appears that the pcplib.lo file is not created and therefore error's when libtool tries to link them. Any help you can give... Giz
Been doing some more research, compiling other modules found on PECL without problems. I have even hacked at the code successfully. The problem is I have limited knowledge of linking using M4 and PHP/Extensions as most if my code is written using QT and I have god lazy with age :) Can anyone help out so I can get a build. Once I have a build, I will be able to work out the rest... Thanx again I don't believe it!!!! After two weeks banging my head against a brick wall I have just gone back to my Unit Tests and the original pcplib.o is corrupted !!!! :)
Replaced within the new object file and I am up and running... lol We live an learn.. Unit Test after every iteration... I must remember to.... thanx everyone for your help

« previous php.pecl.dev (#8244) next »