[88981] trunk/base
cal at macports.org
cal at macports.org
Sun Jan 15 17:52:54 PST 2012
Revision: 88981
http://trac.macports.org/changeset/88981
Author: cal at macports.org
Date: 2012-01-15 17:52:49 -0800 (Sun, 15 Jan 2012)
Log Message:
-----------
configure: alias sqlite3_prepare_v2 to sqlite3_prepare if SQLite < 3.3.11
This should fix the build on all platforms with an older SQLite
Modified Paths:
--------------
trunk/base/aclocal.m4
trunk/base/configure
trunk/base/configure.ac
trunk/base/src/config.h.in
Modified: trunk/base/aclocal.m4
===================================================================
--- trunk/base/aclocal.m4 2012-01-16 00:37:12 UTC (rev 88980)
+++ trunk/base/aclocal.m4 2012-01-16 01:52:49 UTC (rev 88981)
@@ -1064,3 +1064,76 @@
fi
AC_SUBST([CFLAGS_WERROR])
])
+
+#------------------------------------------------------------------------
+# MP_CHECK_SQLITE_VERSION --
+#
+# Check for a specific SQLite version and execute commands depending on availability
+#
+# Arguments:
+# Required SQLite version for the test to succeed
+# then-commands to execute if the version is equal to or higher than the threshold
+# else-commands to execute if the version is lower than the threshold (optional)
+#
+# Requires:
+# MP_SQLITE3_FLAGS
+#
+# Depends:
+# AC_LANG_SOURCE
+#
+# Results:
+# availability of SQLITE_VERSION_NUMBER is cached
+# sets mp_sqlite_version_ge_$1 to yes or no
+#
+#------------------------------------------------------------------------
+AC_DEFUN(MP_CHECK_SQLITE_VERSION, [
+ AC_REQUIRE([MP_SQLITE3_FLAGS])
+
+ AC_MSG_CHECKING([for SQLite >= $1])
+
+ mp_check_sqlite_version_cppflags_save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $CFLAGS_SQLITE3"
+
+ AC_CACHE_VAL(mp_cv_sqlite_version_defined, [
+ AC_PREPROC_IFELSE(
+ [AC_LANG_SOURCE(
+ [[
+ #include <sqlite3.h>
+ #ifndef SQLITE_VERSION_NUMBER
+ # error "SQLITE_VERSION_NUMBER undefined"
+ #endif
+ ]]
+ )],
+ [mp_cv_sqlite_version_defined="yes"],
+ [AC_MSG_ERROR("SQLITE_VERSION_NUMBER undefined or sqlite3.h not found")]
+ )
+ ])
+
+ if test x"${mp_cv_sqlite_version_defined}" = "xno"; then
+ AC_MSG_RESULT([SQLite version not found])
+ mp_sqlite_version_ge_$1="no"
+ else
+ AC_CACHE_VAL(mp_cv_sqlite_version_ge_$1, [
+ AC_PREPROC_IFELSE(
+ [AC_LANG_SOURCE(
+ [[
+ #include <sqlite3.h>
+ #if (SQLITE_VERSION_NUMBER >= $1)
+ /* Everything is fine */
+ #else
+ # error "SQLite version too old"
+ #endif
+ ]]
+ )],
+ [mp_cv_sqlite_version_ge_$1="yes"],
+ [mp_cv_sqlite_version_ge_$1="no"]
+ )
+ ])
+
+ AC_MSG_RESULT(${mp_cv_sqlite_version_ge_$1})
+ mp_sqlite_version_ge_$1=${mp_cv_sqlite_version_ge_$1}
+ fi
+
+ CPPFLAGS=$mp_check_sqlite_version_cppflags_save
+])
+
Modified: trunk/base/configure
===================================================================
--- trunk/base/configure 2012-01-16 00:37:12 UTC (rev 88980)
+++ trunk/base/configure 2012-01-16 01:52:49 UTC (rev 88981)
@@ -9680,6 +9680,85 @@
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLite >= 3003011" >&5
+$as_echo_n "checking for SQLite >= 3003011... " >&6; }
+
+ mp_check_sqlite_version_cppflags_save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $CFLAGS_SQLITE3"
+
+ if ${mp_cv_sqlite_version_defined+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sqlite3.h>
+ #ifndef SQLITE_VERSION_NUMBER
+ # error "SQLITE_VERSION_NUMBER undefined"
+ #endif
+
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ mp_cv_sqlite_version_defined="yes"
+else
+ as_fn_error $? "\"SQLITE_VERSION_NUMBER undefined or sqlite3.h not found\"" "$LINENO" 5
+
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+fi
+
+
+ if test x"${mp_cv_sqlite_version_defined}" = "xno"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: SQLite version not found" >&5
+$as_echo "SQLite version not found" >&6; }
+ mp_sqlite_version_ge_3003011="no"
+ else
+ if ${mp_cv_sqlite_version_ge_3003011+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sqlite3.h>
+ #if (SQLITE_VERSION_NUMBER >= 3003011)
+ /* Everything is fine */
+ #else
+ # error "SQLite version too old"
+ #endif
+
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ mp_cv_sqlite_version_ge_3003011="yes"
+else
+ mp_cv_sqlite_version_ge_3003011="no"
+
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${mp_cv_sqlite_version_ge_3003011}" >&5
+$as_echo "${mp_cv_sqlite_version_ge_3003011}" >&6; }
+ mp_sqlite_version_ge_3003011=${mp_cv_sqlite_version_ge_3003011}
+ fi
+
+ CPPFLAGS=$mp_check_sqlite_version_cppflags_save
+
+if test "x${mp_sqlite_version_ge_3003011}" = "xno"; then
+
+$as_echo "#define sqlite3_prepare_v2 sqlite3_prepare" >>confdefs.h
+
+fi
+
# Determine if we need to install some bundled packages
OUR_INCLUDED_PACKAGES=
Modified: trunk/base/configure.ac
===================================================================
--- trunk/base/configure.ac 2012-01-16 00:37:12 UTC (rev 88980)
+++ trunk/base/configure.ac 2012-01-16 01:52:49 UTC (rev 88981)
@@ -231,7 +231,7 @@
[
AC_CHECK_LIB([readline], [readline], [
READLINE_LIBS=-lreadline
- AC_DEFINE([HAVE_LIBREADLINE], [1], [Define to 1 if you have the `readline' library (-lreadline).])
+ AC_DEFINE([HAVE_LIBREADLINE], [1], [Define to 1 if you have the 'readline' library (-lreadline).])
])
AC_CHECK_DECLS([rl_username_completion_function,rl_filename_completion_function,rl_completion_matches,username_completion_function,filename_completion_function,completion_matches], [], [],
[
@@ -271,6 +271,11 @@
## sqlite3
MP_SQLITE3_FLAGS
+MP_CHECK_SQLITE_VERSION(3003011)
+if test "x${mp_sqlite_version_ge_3003011}" = "xno"; then
+ AC_DEFINE([sqlite3_prepare_v2], [sqlite3_prepare], [define sqlite3_prepare to sqlite_prepare_v2 if the latter is not available])
+fi
+
# Determine if we need to install some bundled packages
OUR_INCLUDED_PACKAGES=
Modified: trunk/base/src/config.h.in
===================================================================
--- trunk/base/src/config.h.in 2012-01-16 00:37:12 UTC (rev 88980)
+++ trunk/base/src/config.h.in 2012-01-16 01:52:49 UTC (rev 88981)
@@ -89,7 +89,7 @@
/* Define if you have the `md' library (-lmd). */
#undef HAVE_LIBMD
-/* Define to 1 if you have the `readline' library (-lreadline). */
+/* Define to 1 if you have the 'readline' library (-lreadline). */
#undef HAVE_LIBREADLINE
/* Define to 1 if you have the <limits.h> header file. */
@@ -269,3 +269,7 @@
/* Attribute to mark unused variables */
#undef UNUSED
+
+/* define sqlite3_prepare to sqlite_prepare_v2 if the latter is not available
+ */
+#undef sqlite3_prepare_v2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120115/439e97e2/attachment.html>
More information about the macports-changes
mailing list