Skip to content

Commit 4776820

Browse files
committed
Check in configure if we have sqlite3_enable_extension
1 parent 26e8af6 commit 4776820

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/configure.ac

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,14 @@ if test "x$SQLITE_LIBS" == "x"; then
179179
AC_MSG_ERROR([sqlite3 is required to install $PACKAGE_NAME])
180180
fi
181181

182+
AC_CHECK_LIB([sqlite3], [sqlite3_enable_load_extension],
183+
[HAVE_SQLITE3_ENABLE_LOAD_EXTENSION=yes],
184+
[HAVE_SQLITE3_ENABLE_LOAD_EXTENSION=no])
185+
186+
if test "$HAVE_SQLITE3_ENABLE_LOAD_EXTENSION" == "no"; then
187+
AC_DEFINE([HAVE_SQLITE3_ENABLE_LOAD_EXTENSION],[],[sql3_enable_extension is available])
188+
fi
189+
182190
## restore
183191
CPPFLAGS=$save_CPPFLAGS
184192
LDFLAGS=$save_LDFLAGS

src/octave_sqlite.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,13 @@ octave_sqlite::create (const std::string &infilename, const std::string &inmode)
244244
}
245245

246246
//Enable loading of external extensions (e.g. sqlean)
247+
#ifdef HAVE_SQLITE3_ENABLE_LOAD_EXTENSION
247248
rc = sqlite3_enable_load_extension(db, 1);
248249
if (rc)
249250
{
250251
warning("Failed to enable load extensions - '%s'", error_string(db, rc).c_str());
251252
}
253+
#endif
252254

253255
return true;
254256
}

0 commit comments

Comments
 (0)