configure: add -lgdbm if needed for ndbm support
authorMichael Wallner <mike@php.net>
Thu, 20 Oct 2016 06:45:12 +0000 (08:45 +0200)
committerMichael Wallner <mike@php.net>
Thu, 20 Oct 2016 06:45:12 +0000 (08:45 +0200)
m4/posix/ndbm.m4
m4/psi/psi.m4

index bd2617b60e9cffc0ae8bcf7531ebbe6ed87f7930..7b04504536b60495f9dc4afebff8b5cebc95c634 100644 (file)
@@ -2,6 +2,10 @@ PSI_CHECK_NDBM() {
        PSI_CONFIG_POSIX(ndbm, ndbm.h gdbm-ndbm.h)
 
        PHP_CHECK_FUNC(dbm_open, gdbm_compat)
+       # See http://www.gnu.org.ua/software/gdbm/manual/html_section/gdbm_19.html
+       if expr X"$LIBS" : "X.*-lgdbm_compat" >/dev/null; then
+               LIBS="-lgdbm $LIBS"
+       fi
 
        PSI_STRUCT(datum, [
                void *dptr,
index dbe3defc8f4d89acb3139b18d98c9e8c899b026b..6b3668e1600bf47ba9b4d0c02d938b430cfa1864 100644 (file)
@@ -110,12 +110,6 @@ AC_DEFUN(PSI_CONFIG_DONE, [
 /* generated by configure */
 #ifndef _PSI_STDINC
 # define _PSI_STDINC
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
-#ifndef _XOPEN_SOURCE
-# define _XOPEN_SOURCE
-#endif
 PSI_INCLUDES
 #endif
 EOF