From 508d5b0653cbad17b5ca21518cb16cd0eb48f221 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Mon, 6 Nov 2023 09:54:15 -0400 Subject: [PATCH] only check when using -lsqlite3 --- r/adbcsqlite/configure | 17 +++++++++++------ r/adbcsqlite/tools/test_extension.c | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/r/adbcsqlite/configure b/r/adbcsqlite/configure index f81d30c2be..d26c794d68 100755 --- a/r/adbcsqlite/configure +++ b/r/adbcsqlite/configure @@ -50,14 +50,19 @@ if [ $? -ne 0 ] || [ ! -z "$FORCE_VENDORED_SQLITE3" ]; then else echo "Success!" PKG_LIBS="$PKG_LIBS -lsqlite3" -fi -echo "Testing SQLite for sqlite3_load_extension()" -PKG_CPPFLAGS="$PKG_CPPFLAGS" PKG_LIBS="$PKG_LIBS -lsqlite3" \ - $R_HOME/bin/R CMD SHLIB tools/test_extension.c -o sqlite_test >sqlite_test.log 2>&1 + # Apple -lsqlite3 does not contain sqlite3_load_extension() + echo "Testing SQLite for sqlite3_load_extension()" + PKG_CPPFLAGS="$PKG_CPPFLAGS" PKG_LIBS="$PKG_LIBS" \ + $R_HOME/bin/R CMD SHLIB tools/test_extension.c -o sqlite_test >sqlite_test.log 2>&1 -if [ $? -ne 0 ]; then - PKG_CPPFLAGS="$PKG_CPPFLAGS -DADBC_SQLITE_WITH_NO_LOAD_EXTENSION" + if [ $? -ne 0 ]; then + echo "Compile of sqlite3_load_extension() test failed" + cat sqlite_test.log + PKG_CPPFLAGS="$PKG_CPPFLAGS -DADBC_SQLITE_WITH_NO_LOAD_EXTENSION" + else + echo "Success!" + fi fi # Add mingw printf flag if on Windows diff --git a/r/adbcsqlite/tools/test_extension.c b/r/adbcsqlite/tools/test_extension.c index 77a6193ead..6a35045afa 100644 --- a/r/adbcsqlite/tools/test_extension.c +++ b/r/adbcsqlite/tools/test_extension.c @@ -16,5 +16,6 @@ // under the License. #include +#include void try_load_extension() { sqlite3_load_extension(NULL, NULL, NULL, NULL); }