configure: add -lgdbm if needed for ndbm support
[m6w6/ext-psi] / config.m4
index 47ee1b071268c15aaf0856ff14f003a491287f0e..df18db6d66fe51b29e28c0950f4df8067862e90b 100644 (file)
--- a/config.m4
+++ b/config.m4
@@ -2,41 +2,41 @@ PHP_PSI_SRCDIR=PHP_EXT_SRCDIR(psi)
 PHP_PSI_BUILDDIR=PHP_EXT_BUILDDIR(psi)
 
 m4_foreach(incfile, [
-       [ax_check_sign.m4],
-       [ax_pthread.m4],
-       [psi.m4],
-       [psi_type.m4],
-       [psi_const.m4],
-       [psi_decl.m4],
-       [psi_macro.m4],
-       [psi_struct.m4],
-       [errno.m4],
-       [fcntl.m4],
-       [glob.m4],
-       [locale.m4],
-       [stddef.m4],
-       [stdio.m4],
-       [stdint.m4],
-       [stdlib.m4],
-       [sys_select.m4],
-       [sys_socket.m4],
-       [sys_stat.m4],
-       [sys_time.m4],
-       [sys_times.m4],
-       [sys_types.m4],
-       [sys_uio.m4],
-       [sys_utsname.m4],
-       [ndbm.m4],
-       [netdb.m4],
-       [netinet_in.m4],
-       [netinet_tcp.m4],
-       [poll.m4],
-       [signal.m4],
-       [syslog.m4],
-       [time.m4],
-       [unistd.m4],
-       [wchar.m4],
-       [wctype.m4]], [
+       [ax/ax_check_sign.m4],
+       [ax/ax_pthread.m4],
+       [psi/psi.m4],
+       [psi/psi_type.m4],
+       [psi/psi_const.m4],
+       [psi/psi_decl.m4],
+       [psi/psi_macro.m4],
+       [psi/psi_struct.m4],
+       [posix/errno.m4],
+       [posix/fcntl.m4],
+       [posix/glob.m4],
+       [posix/locale.m4],
+       [posix/stddef.m4],
+       [posix/stdio.m4],
+       [posix/stdint.m4],
+       [posix/stdlib.m4],
+       [posix/sys_select.m4],
+       [posix/sys_socket.m4],
+       [posix/sys_stat.m4],
+       [posix/sys_time.m4],
+       [posix/sys_times.m4],
+       [posix/sys_types.m4],
+       [posix/sys_uio.m4],
+       [posix/sys_utsname.m4],
+       [posix/ndbm.m4],
+       [posix/netdb.m4],
+       [posix/netinet_in.m4],
+       [posix/netinet_tcp.m4],
+       [posix/poll.m4],
+       [posix/signal.m4],
+       [posix/syslog.m4],
+       [posix/time.m4],
+       [posix/unistd.m4],
+       [posix/wchar.m4],
+       [posix/wctype.m4]], [
        dnl pecl build
        sinclude([m4/]incfile)
        dnl php-src build
@@ -57,14 +57,17 @@ PHP_ARG_WITH(psi-libffi, where to find libffi,
 
 if test "$PHP_PSI" != no; then
        PHP_CONFIGURE_PART(Configuring PSI)
-       
+
+       save_LIBS=$LIBS
+       LIBS=
+
        PSI_LEMON
        PSI_CHECK_LIBJIT
        PSI_CHECK_LIBFFI
 
        AC_PATH_PROG(NM, nm)
        AC_FUNC_FNMATCH
-       
+
        PSI_CONFIG_INIT
        PSI_CHECK_STD_TYPES
        PSI_CHECK_STDINT
@@ -96,6 +99,9 @@ if test "$PHP_PSI" != no; then
        PSI_CHECK_WCTYPE
        PSI_CONFIG_DONE
 
+       eval_LIBS=$LIBS
+       LIBS=$save_LIBS
+       PHP_EVAL_LIBLINE($eval_LIBS, PSI_SHARED_LIBADD)
        PHP_SUBST(PSI_SHARED_LIBADD)
 
        AC_DEFINE_UNQUOTED(PHP_PSI_SHLIB_SUFFIX, ["$SHLIB_SUFFIX_NAME"], DL suffix)