[66033] trunk/base

jmr at macports.org jmr at macports.org
Sun Apr 4 23:58:05 PDT 2010


Revision: 66033
          http://trac.macports.org/changeset/66033
Author:   jmr at macports.org
Date:     2010-04-04 23:58:02 -0700 (Sun, 04 Apr 2010)
Log Message:
-----------
avoid build failure when sqlite3ext.h is not available; fix setting of tclsqlite location using pkgconfig

Modified Paths:
--------------
    trunk/base/aclocal.m4
    trunk/base/configure
    trunk/base/src/config.h.in
    trunk/base/src/cregistry/sqlext.c

Modified: trunk/base/aclocal.m4
===================================================================
--- trunk/base/aclocal.m4	2010-04-05 05:54:36 UTC (rev 66032)
+++ trunk/base/aclocal.m4	2010-04-05 06:58:02 UTC (rev 66033)
@@ -805,7 +805,7 @@
             LDFLAGS_SQLITE3=$($PKG_CONFIG --libs sqlite3)
             # for tclsqlite below
             mp_sqlite3_dir=$($PKG_CONFIG --variable=prefix sqlite3)
-            if test "x$mp_sqlite3_dir" = "x"; then
+            if test "x$mp_sqlite3_dir" != "x"; then
                 mp_sqlite3_dir=${mp_sqlite3_dir}/lib/sqlite3
             fi
         fi
@@ -814,6 +814,12 @@
 		LDFLAGS_SQLITE3="-L${sqlite3prefix}/lib -lsqlite3"
 	fi
 
+    # check if we have sqlite3ext.h, using the appropriate cppflags
+    CPPFLAGS_OLD="${CPPFLAGS}"
+    CPPFLAGS="${CPPFLAGS} ${CFLAGS_SQLITE3}"
+    AC_CHECK_HEADERS(sqlite3ext.h)
+    CPPFLAGS="${CPPFLAGS_OLD}"
+
 	AC_SUBST(CFLAGS_SQLITE3)
 	AC_SUBST(LDFLAGS_SQLITE3)
 

Modified: trunk/base/configure
===================================================================
--- trunk/base/configure	2010-04-05 05:54:36 UTC (rev 66032)
+++ trunk/base/configure	2010-04-05 06:58:02 UTC (rev 66033)
@@ -9152,7 +9152,7 @@
             LDFLAGS_SQLITE3=$($PKG_CONFIG --libs sqlite3)
             # for tclsqlite below
             mp_sqlite3_dir=$($PKG_CONFIG --variable=prefix sqlite3)
-            if test "x$mp_sqlite3_dir" = "x"; then
+            if test "x$mp_sqlite3_dir" != "x"; then
                 mp_sqlite3_dir=${mp_sqlite3_dir}/lib/sqlite3
             fi
         fi
@@ -9161,9 +9161,26 @@
 		LDFLAGS_SQLITE3="-L${sqlite3prefix}/lib -lsqlite3"
 	fi
 
+    # check if we have sqlite3ext.h, using the appropriate cppflags
+    CPPFLAGS_OLD="${CPPFLAGS}"
+    CPPFLAGS="${CPPFLAGS} ${CFLAGS_SQLITE3}"
+    for ac_header in sqlite3ext.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "sqlite3ext.h" "ac_cv_header_sqlite3ext_h" "$ac_includes_default"
+if test "x$ac_cv_header_sqlite3ext_h" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SQLITE3EXT_H 1
+_ACEOF
 
+fi
 
+done
 
+    CPPFLAGS="${CPPFLAGS_OLD}"
+
+
+
+
 	# now the sqlite Tcl bindings
 
 # Check whether --with-tcl-sqlite3 was given.

Modified: trunk/base/src/config.h.in
===================================================================
--- trunk/base/src/config.h.in	2010-04-05 05:54:36 UTC (rev 66032)
+++ trunk/base/src/config.h.in	2010-04-05 06:58:02 UTC (rev 66033)
@@ -128,6 +128,9 @@
 /* Define to 1 if you have the `setmode' function. */
 #undef HAVE_SETMODE
 
+/* Define to 1 if you have the <sqlite3ext.h> header file. */
+#undef HAVE_SQLITE3EXT_H
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 

Modified: trunk/base/src/cregistry/sqlext.c
===================================================================
--- trunk/base/src/cregistry/sqlext.c	2010-04-05 05:54:36 UTC (rev 66032)
+++ trunk/base/src/cregistry/sqlext.c	2010-04-05 06:58:02 UTC (rev 66033)
@@ -5,8 +5,12 @@
 #include "vercomp.h"
 
 #include <string.h>
+#if HAVE_SQLITE3EXT_H
 #include <sqlite3ext.h>
 SQLITE_EXTENSION_INIT1
+#else
+#include <sqlite3.h>
+#endif
 
 /**
  * Extension for sqlite3 defining collates being used in our DB. This can be
@@ -21,9 +25,10 @@
     char **pzErrMsg UNUSED,      /* Write error messages here */
     const sqlite3_api_routines *pApi  /* API methods */
 ) {
+#if HAVE_SQLITE3EXT_H
     SQLITE_EXTENSION_INIT2(pApi)
 
     sqlite3_create_collation(db, "VERSION", SQLITE_UTF8, NULL, sql_version);
-
+#endif
     return 0;
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100404/e421e88b/attachment.html>


More information about the macports-changes mailing list