-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect SQLite in configure.ac #89932
Comments
"Autoconfiscate" SQLite detection. Plan:
Nice side effect: configure will bail if --enable-loadable-sqlite-extensions is used and the target SQLite library was compiled with SQLITE_OMIT_LOAD_EXTENSION, even if we are not on macOS. |
Your solution looks very similar to my WIP patch: AC_CHECK_HEADERS([sqlite3.h], AS_VAR_IF([ac_cv_search_sqlite3_version], [no], [], [
# found a working sqlite3.h and sqlite3 library
# ac_cv_search_sqlite3_version != no
LIBS="$LIBS $ac_cv_search_sqlite3_version"
AC_CACHE_CHECK([for sqlite3 version >= 3.7.15], [ac_cv_lib_sqlite3_supported], [
AC_LINK_IFELSE([
AC_LANG_PROGRAM([
#include <sqlite3.h>
#if SQLITE_VERSION_NUMBER < 3007015
#error "sqlite version is too old"
#endif], []
)
], [ac_cv_lib_sqlite3_supported=yes], [ac_cv_lib_sqlite3_supported=no])
])
AC_CACHE_CHECK([for sqlite3_enable_load_extension], [ac_cv_lib_sqlite3_sqlite3_enable_load_extension], [
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <sqlite3.h>], [void *x = sqlite3_enable_load_extension])],
[ac_cv_lib_sqlite3_sqlite3_enable_load_extension=yes],
[ac_cv_lib_sqlite3_sqlite3_enable_load_extension=no])
])
]) LIBS=$LIBS_SAVE AS_VAR_IF([ac_cv_lib_sqlite3_supported], [yes], AS_VAR_IF([ac_cv_lib_sqlite3_sqlite3_enable_load_extension], [yes], |
Nice. I think I'll steal some of your ideas tomorrow :) |
I saw your message concerning sqlite3 on the FreeBSD buildbot. It's hard to tell why configure on FreeBSD doesn't find sqlite3.h without access to config.log or a shell. Maybe sqlite3 is installed in /usr/local ? A "config.site" file should do the trick: $ mkdir -p /usr/local/etc
$ cat > /usr/local/etc/config.site << EOF
test -z "$CPPFLAGS" && CPPFLAGS="-I$/usr/local/include"
test -z "$LDFLAGS" && LDFLAGS="-L/usr/local/lib"
EOF |
Awesome work! Thanks to your tireless effort we know have a blue print how to use pkg-config for other librariess. |
Needs amendment before closing. See #73845. |
Thank you for reviewing, and thank you for paving the way with all these build system improvements :) |
Reopening: the current detection is a little bit weak; many SQLite API's may be disabled at SQLite compile time using SQLITE_OMIT_* defines. We must make sure we've got all vital functions in place before marking the sqlite3 module as present and usable. The following API's can be omitted using compile time defines:
The following API's _may_ be disabled in the future using SQLITE_OMIT_FLOATING_POINT:
|
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: