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

John Ralls jralls at code.gnucash.org
Fri Sep 20 18:41:51 EDT 2013


Author: jralls
Date: 2013-09-20 18:41:50 -0400 (Fri, 20 Sep 2013)
New Revision: 23186
Trac: http://svn.gnucash.org/trac/changeset/23186

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

but without sqlite DBD installed. Add configure test to ensure
that at least one of the supported modules is installed

Modified: gnucash/trunk/configure.ac
===================================================================
--- gnucash/trunk/configure.ac	2013-09-20 21:09:46 UTC (rev 23185)
+++ gnucash/trunk/configure.ac	2013-09-20 22:41:50 UTC (rev 23186)
@@ -537,6 +537,41 @@
       [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"
+	     ;;
+      esac
+      export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GNC_DBD_DIR"
+      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;
+				     ]])],AC_MSG_RESULT([SQLite3]),
+      	AC_RUN_IFELSE([AC_LANG_PROGRAM([$LDINC],
+				     [[if (!$LDFUNC("libdbdmysql.$LDEXT"$LDFUNCARGS)) return -1;
+					]])],AC_MSG_RESULT([MySql]),
+	  AC_RUN_IFELSE([AC_LANG_PROGRAM([$LDINC],
+				     [[if (!$LDFUNC("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.
+       ]]))))
 
     LIBDBI_LIBS=-ldbi
     _COMPONENTS="$_COMPONENTS dbi"



More information about the gnucash-changes mailing list