configure: add -lgdbm if needed for ndbm support
[m6w6/ext-psi] / m4 / psi / psi.m4
index 2a1e681cc174e9c9d528b756b5a4dcf6264ee214..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
@@ -137,7 +131,7 @@ AC_DEFUN(PSI_CONFIG_POSIX_ENABLED, [
        AS_TR_SH([psi_config_posix_]$1)=false
        case "$PHP_PSI_POSIX" in
        yes|all)
-               AS_TR_SH([psi_config_posix_]$1)=true 
+               AS_TR_SH([psi_config_posix_]$1)=true
                ;;
        *)
                if expr "$PHP_PSI_POSIX" : '\b$1\b' >/dev/null; then
@@ -185,7 +179,11 @@ AC_DEFUN(PSI_PTHREAD, [
 dnl PSI_INCLUDES()
 dnl Expands to a complete list of include statements including
 dnl AC_INCLUDES_DEFAULT().
-AC_DEFUN(PSI_INCLUDES, [AC_INCLUDES_DEFAULT()
+AC_DEFUN(PSI_INCLUDES, [#define PSI_INCLUDES
+#define _GNU_SOURCE 1
+#define _POSIX_C_SOURCE 200809L
+#define _XOPEN_SOURCE 700
+AC_INCLUDES_DEFAULT()
 #ifdef HAVE_ERRNO_H
 # include <errno.h>
 #endif
@@ -212,6 +210,8 @@ AC_DEFUN(PSI_INCLUDES, [AC_INCLUDES_DEFAULT()
 #endif
 #ifdef HAVE_NDBM_H
 # include <ndbm.h>
+#elif HAVE_GDBM_NDBM_H
+# include <gdbm-ndbm.h>
 #endif
 #ifdef HAVE_NETDB_H
 # include <netdb.h>