r23190 - gnucash/trunk - Bug 654196 - "make check" fails when built with --enable-dbi

John Ralls jralls at code.gnucash.org
Sat Sep 21 20:56:23 EDT 2013


Author: jralls
Date: 2013-09-21 20:56:23 -0400 (Sat, 21 Sep 2013)
New Revision: 23190
Trac: http://svn.gnucash.org/trac/changeset/23190

Modified:
   gnucash/trunk/configure.ac
Log:
Bug 654196 - "make check" fails when built with --enable-dbi

but without sqlite DBD installed.
Refine checks to use the values for dlopen and dlopen_lib already
discovered by libtool.
Improve the error message to offer more solutions.

Modified: gnucash/trunk/configure.ac
===================================================================
--- gnucash/trunk/configure.ac	2013-09-21 16:29:34 UTC (rev 23189)
+++ gnucash/trunk/configure.ac	2013-09-22 00:56:23 UTC (rev 23190)
@@ -531,48 +531,54 @@
    [want_dbi=true])
 if test x${want_dbi} = xtrue
 then
+  EXTRA_SEARCH_LIBS=""
   AC_CHECK_HEADERS(dbi/dbi.h)
   if test "x$ac_cv_header_dbi_dbi_h" != xno; then
     AC_ARG_WITH( dbi-dbd-dir,
       [AS_HELP_STRING([--with-dbi-dbd-dir=PATH],[specify location of libdbi drivers @<:@default=${libdir}/dbd@:>@])],
-      GNC_DBD_DIR="$with_dbi_dbd_dir",
-      GNC_DBD_DIR="")
-      case $host_os in
-      	   win32*|mingw*)
-	     LDINC="#include <windows.h>"
-	     LDFUNC=LoadLibrary
-	     LDFUNCARGS=""
-	     LDEXT=dll
-	     ;;
-	   Darwin*)
-	     LDINC="#include <dlfcn.h>"
-	     LDFUNC=dlopen
-	     LDFUNCARGS=", RTLD_NOW"
-	     LDEXT=so
-	     ;;
-      	   *)
-	     LDINC="#include <dlfcn.h>"
-	     LDFUNC=dlopen
-	     LDFUNCARGS=", RTLD_NOW"
-	     LDEXT=so
-	     export LDFLAGS="$LDFLAGS -ldl"
-	     ;;
+      [[GNC_DBD_DIR="$with_dbi_dbd_dir"
+       EXTRA_SEARCH_LIBS=$GNC_DBD_DIR]],
+      [[GNC_DBD_DIR=""
+       EXTRA_SEARCH_LIBS="/usr/lib/dbd:/usr/lib64/dbd:${libdir}/dbd"]]
+       )
+    case $host_os in
+       win32*|mingw*)
+	 LDINC="#include <windows.h>"
+	 LDFUNCARGS=""
+	 LDEXT=dll
+	 ;;
+       *)
+	 LDINC="#include <dlfcn.h>"
+	 LDFUNCARGS=", RTLD_NOW"
+	 LDEXT=so
+	 export LDFLAGS="$LDFLAGS $lt_cv_dlopen_libs"
+	 ;;
       esac
-      export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GNC_DBD_DIR"
+      export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$EXTRA_SEARCH_LIBS"
       AC_MSG_CHECKING([Looking for at least one supported DBD module])
       AC_RUN_IFELSE([AC_LANG_PROGRAM([$LDINC],
-				     [[if (!$LDFUNC("libdbdsqlite3.$LDEXT"$LDFUNCARGS)) return -1;
+				     [[if (!$lt_cv_dlopen("libdbdsqlite3.$LDEXT"$LDFUNCARGS)) return -1;
 				     ]])],AC_MSG_RESULT([SQLite3]),
       	AC_RUN_IFELSE([AC_LANG_PROGRAM([$LDINC],
-				     [[if (!$LDFUNC("libdbdmysql.$LDEXT"$LDFUNCARGS)) return -1;
+				     [[if (!$lt_cv_dlopen("libdbdmysql.$LDEXT"$LDFUNCARGS)) return -1;
 					]])],AC_MSG_RESULT([MySql]),
 	  AC_RUN_IFELSE([AC_LANG_PROGRAM([$LDINC],
-				     [[if (!$LDFUNC("libdbdpgsql.$LDEXT"$LDFUNCARGS)) return -1;
+				     [[if (!$lt_cv_dlopen("libdbdpgsql.$LDEXT"$LDFUNCARGS)) return -1;
 					 ]])],AC_MSG_RESULT([Postgresql]),
-        				 AC_MSG_FAILURE([[
-Unable to find any of the supported dbd modules (libdbdsqlite3, libdbdmysql, or libdbdpgsql) needed to actually use the SQL backend. Please install one or more of them to proceed.
-       ]]))))
+        				 AC_MSG_ERROR([
+Unable to find any of the supported dbd modules
+(libdbdsqlite3, libdbdmysql, or libdbdpgsql) needed to actually use the SQL
+backend.
 
+If you do have them installed the problem is either that dlopen cannot
+find them or that dlopen itself is not getting linked. Check config.log
+to find out which.  You can add the option --with-dbi-dbd-dir pointing to
+the directory in which they are located.
+
+If you do not actually want to build with libdi add --disable-dbi
+to the configure argument list and run it again.
+       ]))))
+
     LIBDBI_LIBS=-ldbi
     _COMPONENTS="$_COMPONENTS dbi"
   else



More information about the gnucash-changes mailing list