|
Hate to admit that I completely fail at googling, but here it is: I seem to be unable to auto-configure db4 properly. Every time Fedora revs db4, we have to add another layer of this:
AC_CHECK_LIB(db-4.8, db_create, DB4_LIBS=-ldb-4.8,
AC_CHECK_LIB(db-4.7, db_create, DB4_LIBS=-ldb-4.7,
AC_CHECK_LIB(db-4.6, db_create, DB4_LIBS=-ldb-4.6,
AC_CHECK_LIB(db-4.5, db_create, DB4_LIBS=-ldb-4.5,
AC_CHECK_LIB(db-4.4, db_create, DB4_LIBS=-ldb-4.4,
AC_CHECK_LIB(db-4.3, db_create, DB4_LIBS=-ldb-4.3,
[AC_MSG_ERROR([Missing required libdb 4.x])]))))))
The nested AC_CHECK_LIB in configure.ac is bad enough, but what's worse, the crash before we understand that we ought to add another layer is completely unrelated. Fedora ships a compat package, but the <db.h> header is always new, so we (tabled) build with newest header and link the compat libdb, then crash. At best.
UPDATE: Diego Pettenò suggested AC_SEARCH_LIBS by e-mail. The problem with it, the best I can come up with is this:
AC_CHECK_HEADERS([db.h], [], [AC_MSG_ERROR(Missing required db.h)])
dnl We do not use sequence objects. This is a trick to force db4.3 or later.
dnl We suppress -ldb from LIBS and use DB4_LIBS in order to not link with
dnl db4 where not necessary.
DB4_LIBS_SAVE="$LIBS"
LIBS=""
AC_SEARCH_LIBS(db_sequence_create, [db], DB4_LIBS="$LIBS",
[AC_MSG_ERROR(Missing required libdb)])
LIBS="$DB4_LIBS_SAVE"
It looks pretty clumsy.
|