1

I am working on a PHP module and I am having trouble linking with shared libraries under Linux.

What is the command I need to put in my config.m4 to link against a .so? If I have my .so file under /usr/lib/ or /usr/lib64/ the compiler should be able to find it right?

my current config.m4 file is shown below

PHP_ARG_ENABLE(my_module, whether to enable my_module support,
[  --enable-my_module           Enable my_module support])

if test "$PHP_MY_MODULE" = "yes"; then
  AC_DEFINE(HAVE_TERR_MY_MODULELIB,1,[ ])

  PHP_NEW_EXTENSION(my_module, my_module.c libSomething.so, $ext_shared)

fi

Thanks in advance

Alex

Charles
  • 50,943
  • 13
  • 104
  • 142
Alex
  • 11
  • 2

1 Answers1

0

You can take a look at this excellent tutorial Configuring php build system

Also you can check out this config.m4 file for reference Example config.m4 from php-logger

If you still have questions, post them as comments and I will reply :)

ludesign
  • 1,353
  • 7
  • 12