From dbf1c3d1754adc5ee571e71395dbd297a9c3d093 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 18 Oct 2016 12:28:53 +0000 Subject: [PATCH] ndbm fix for trusty --- m4/posix/ndbm.m4 | 12 ++++++------ m4/psi/psi.m4 | 10 ++++++++-- m4/psi/psi_decl.m4 | 12 ++++++------ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/m4/posix/ndbm.m4 b/m4/posix/ndbm.m4 index 3d60b06..e59fbef 100644 --- a/m4/posix/ndbm.m4 +++ b/m4/posix/ndbm.m4 @@ -1,18 +1,18 @@ PSI_CHECK_NDBM() { - PSI_CONFIG_POSIX(ndbm, ndbm.h) - + PSI_CONFIG_POSIX(ndbm, ndbm.h gdbm-ndbm.h) + PHP_CHECK_FUNC_LIB(dbm_open, gdbm_compat) - + PSI_STRUCT(datum, [ void *dptr, int dsize] ) - + PSI_OPAQUE_TYPE(DBM) - + PSI_CONST(DBM_INSERT, int) PSI_CONST(DBM_REPLACE, int) - + PSI_DECL(void dbm_clearerr, [(DBM *db)]) PSI_DECL(void dbm_close, [(DBM *db)]) PSI_DECL(int dbm_delete, [(DBM *db, datum key)]) diff --git a/m4/psi/psi.m4 b/m4/psi/psi.m4 index 2a1e681..dbe3def 100644 --- a/m4/psi/psi.m4 +++ b/m4/psi/psi.m4 @@ -137,7 +137,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 +185,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 #endif @@ -212,6 +216,8 @@ AC_DEFUN(PSI_INCLUDES, [AC_INCLUDES_DEFAULT() #endif #ifdef HAVE_NDBM_H # include +#elif HAVE_GDBM_NDBM_H +# include #endif #ifdef HAVE_NETDB_H # include diff --git a/m4/psi/psi_decl.m4 b/m4/psi/psi_decl.m4 index 9730839..fa2bf55 100644 --- a/m4/psi/psi_decl.m4 +++ b/m4/psi/psi_decl.m4 @@ -2,7 +2,7 @@ # Add a function redirection to $PSI_REDIRS. psi_add_redir() { cat >>$PSI_REDIRS <>$PSI_VA_DECLS <>$PSI_DECLS <