Index: noatun-plugins/oblique/configure.in.in =================================================================== --- noatun-plugins/oblique/configure.in.in (revision 433553) +++ noatun-plugins/oblique/configure.in.in (working copy) @@ -1,19 +1,31 @@ +AC_ARG_WITH(berkeley-db, + [AS_HELP_STRING(--with-berkeley-db, + [enable support for Berkeley DB++ @<:@default=check@:>@])], + [], with_berkeley_db=check) -AC_MSG_CHECKING(for Berkeley DB++) +AC_ARG_WITH(db-lib, + [AS_HELP_STRING([--with-db-lib=NAME],[name of the Berkeley DB++ library @<:@default=db_cxx@:>@])], + [ac_db_name="$withval"], [ac_db_name="db_cxx"]) + berkeley_db=no -AC_LANG_PUSH(C++) -AC_TRY_COMPILE([ - #include - ],[ - ],[ - berkeley_db=yes - ]) -AC_MSG_RESULT($berkeley_db) -AC_DEFINE(BERKELEY_DB,1,[Define if you have Berkeley DB++ installed]) -BERKELEY_DB_LIBS="-ldb_cxx" -AC_SUBST(BERKELEY_DB_LIBS) -AC_LANG_POP(C++) +if test "x$with_berkeley_db" != xno; then + berkeley_db=yes -AM_CONDITIONAL(include_BERKELEY_DB, test "$berkeley_db" = yes) + KDE_CHECK_HEADER([db_cxx.h], + [:], [berkeley_db=no]) + AC_CHECK_LIB([$ac_db_name], [main], + [:], [berkeley_db=no]) + if test "x$berkeley_db" = xyes; then + AC_DEFINE(BERKELEY_DB, 1, [Define if you have Berkeley DB++ installed]) + BERKELEY_DB_LIBS="-l$ac_db_name" + AC_SUBST(BERKELEY_DB_LIBS) + fi + + if test "x$with_berkeley_db" != xcheck && test "x$berkeley_db" != xyes; then + AC_MSG_FAILURE([--with-berkeley-db was given, but test for Berkeley DB++ failed]) + fi +fi + +AM_CONDITIONAL(include_BERKELEY_DB, test "$berkeley_db" = yes)