--- /dev/null
+gdbm-compat is now preferred over ndbm if both are available on the system.
+This allows avoiding the problematic ndbm.h on macOS.
/* Some Linux systems install gdbm/ndbm.h, but not ndbm.h. This supports
* whichever configure was able to locate.
*/
-#if defined(USE_NDBM)
- #include <ndbm.h>
- static const char which_dbm[] = "GNU gdbm"; /* EMX port of GDBM */
-#elif defined(USE_GDBM_COMPAT)
+#if defined(USE_GDBM_COMPAT)
#ifdef HAVE_GDBM_NDBM_H
#include <gdbm/ndbm.h>
#elif HAVE_GDBM_DASH_NDBM_H
#error "No gdbm/ndbm.h or gdbm-ndbm.h available"
#endif
static const char which_dbm[] = "GNU gdbm";
+#elif defined(USE_NDBM)
+ #include <ndbm.h>
+ static const char which_dbm[] = "GNU gdbm";
#elif defined(USE_BERKDB)
#ifndef DB_DBM_HSEARCH
#define DB_DBM_HSEARCH 1
if test "${with_dbmliborder+set}" = set; then :
withval=$with_dbmliborder;
else
- with_dbmliborder=ndbm:gdbm:bdb
+ with_dbmliborder=gdbm:ndbm:bdb
fi
IFS=$as_save_IFS
if test "x$with_dbmliborder" = xerror; then :
- as_fn_error $? "proper usage is --with-dbmliborder=db1:db2:... (ndbm:gdbm:bdb)" "$LINENO" 5
+ as_fn_error $? "proper usage is --with-dbmliborder=db1:db2:... (gdbm:ndbm:bdb)" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_dbmliborder" >&5
AC_MSG_CHECKING(for --with-dbmliborder)
AC_ARG_WITH(dbmliborder,
AS_HELP_STRING([--with-dbmliborder=db1:db2:...], [override order to check db backends for dbm; a valid value is a colon separated string with the backend names `ndbm', `gdbm' and `bdb'.]),
-[], [with_dbmliborder=ndbm:gdbm:bdb])
+[], [with_dbmliborder=gdbm:ndbm:bdb])
have_gdbm_dbmliborder=no
as_save_IFS=$IFS
done
IFS=$as_save_IFS
AS_VAR_IF([with_dbmliborder], [error], [
- AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:... (ndbm:gdbm:bdb)])
+ AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:... (gdbm:ndbm:bdb)])
])
AC_MSG_RESULT($with_dbmliborder)
if dbm_args:
dbm_order = [arg.split('=')[-1] for arg in dbm_args][-1].split(":")
else:
- dbm_order = "ndbm:gdbm:bdb".split(":")
+ dbm_order = "gdbm:ndbm:bdb".split(":")
dbmext = None
for cand in dbm_order:
if cand == "ndbm":