Second attempt to make DB selection saner.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
This commit is contained in:

committed by
Love Hornquist Astrand

parent
6a836fc939
commit
9cbe3298d7
39
cf/db.m4
39
cf/db.m4
@@ -46,7 +46,7 @@ AS_IF([test "x$with_berkeley_db" != xno],
|
|||||||
|
|
||||||
dnl db_create is used by db3 and db4 and db5
|
dnl db_create is used by db3 and db4 and db5
|
||||||
|
|
||||||
AC_FIND_FUNC_NO_LIBS(db_create_HACK, [$dbheader] db5 db4 db3 db, [
|
AC_FIND_FUNC_NO_LIBS(db_create, [$dbheader] db5 db4 db3 db, [
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef HAVE_DBHEADER
|
#ifdef HAVE_DBHEADER
|
||||||
#include <$dbheader/db.h>
|
#include <$dbheader/db.h>
|
||||||
@@ -69,30 +69,29 @@ dnl db_create is used by db3 and db4 and db5
|
|||||||
DBLIB=""
|
DBLIB=""
|
||||||
fi
|
fi
|
||||||
AC_DEFINE(HAVE_DB3, 1, [define if you have a berkeley db3/4/5 library])
|
AC_DEFINE(HAVE_DB3, 1, [define if you have a berkeley db3/4/5 library])
|
||||||
else
|
fi
|
||||||
|
|
||||||
dnl dbopen is used by db1/db2
|
dnl dbopen is used by db1/db2
|
||||||
|
|
||||||
AC_FIND_FUNC_NO_LIBS(dbopen, db2 db, [
|
AC_FIND_FUNC_NO_LIBS(dbopen, db2 db, [
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#if defined(HAVE_DB2_DB_H)
|
#if defined(HAVE_DB2_DB_H)
|
||||||
#include <db2/db.h>
|
#include <db2/db.h>
|
||||||
#elif defined(HAVE_DB_H)
|
#elif defined(HAVE_DB_H)
|
||||||
#include <db.h>
|
#include <db.h>
|
||||||
#else
|
#else
|
||||||
#error no db.h
|
#error no db.h
|
||||||
#endif
|
#endif
|
||||||
],[NULL, 0, 0, 0, NULL])
|
],[NULL, 0, 0, 0, NULL])
|
||||||
|
|
||||||
if test "$ac_cv_func_dbopen" = "yes"; then
|
if test "$ac_cv_func_dbopen" = "yes"; then
|
||||||
db_type=db1
|
db_type=db1
|
||||||
if test "$ac_cv_funclib_dbopen" != "yes"; then
|
if test "$ac_cv_funclib_dbopen" != "yes"; then
|
||||||
DBLIB="$ac_cv_funclib_dbopen"
|
DBLIB="$ac_cv_funclib_dbopen"
|
||||||
else
|
else
|
||||||
DBLIB=""
|
DBLIB=""
|
||||||
fi
|
|
||||||
AC_DEFINE(HAVE_DB1, 1, [define if you have a berkeley db1/2 library])
|
|
||||||
fi
|
fi
|
||||||
|
AC_DEFINE(HAVE_DB1, 1, [define if you have a berkeley db1/2 library])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl test for ndbm compatability
|
dnl test for ndbm compatability
|
||||||
|
@@ -16,11 +16,15 @@ lib_LTLIBRARIES = libotp.la
|
|||||||
libotp_la_LDFLAGS = -version-info 1:5:1
|
libotp_la_LDFLAGS = -version-info 1:5:1
|
||||||
libotp_la_LIBADD = $(LIB_hcrypto) $(LIB_roken) $(LIB_NDBM)
|
libotp_la_LIBADD = $(LIB_hcrypto) $(LIB_roken) $(LIB_NDBM)
|
||||||
|
|
||||||
|
if HAVE_DB1
|
||||||
|
ndbm_wrap = ndbm_wrap.c ndbm_wrap.h
|
||||||
|
else
|
||||||
if HAVE_DB3
|
if HAVE_DB3
|
||||||
ndbm_wrap = ndbm_wrap.c ndbm_wrap.h
|
ndbm_wrap = ndbm_wrap.c ndbm_wrap.h
|
||||||
else
|
else
|
||||||
ndbm_wrap =
|
ndbm_wrap =
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
dist_libotp_la_SOURCES = \
|
dist_libotp_la_SOURCES = \
|
||||||
otp.c \
|
otp.c \
|
||||||
|
Reference in New Issue
Block a user