--- /dev/null
+``configure --enable-loadable-sqlite-extensions`` is now handled by new ``PY_SQLITE_ENABLE_LOAD_EXTENSION`` macro instead of logic in setup.py.
return return_value;
}
-#if !defined(SQLITE_OMIT_LOAD_EXTENSION)
+#if defined(PY_SQLITE_ENABLE_LOAD_EXTENSION)
PyDoc_STRVAR(pysqlite_connection_enable_load_extension__doc__,
"enable_load_extension($self, enable, /)\n"
return return_value;
}
-#endif /* !defined(SQLITE_OMIT_LOAD_EXTENSION) */
+#endif /* defined(PY_SQLITE_ENABLE_LOAD_EXTENSION) */
-#if !defined(SQLITE_OMIT_LOAD_EXTENSION)
+#if defined(PY_SQLITE_ENABLE_LOAD_EXTENSION)
PyDoc_STRVAR(pysqlite_connection_load_extension__doc__,
"load_extension($self, name, /)\n"
return return_value;
}
-#endif /* !defined(SQLITE_OMIT_LOAD_EXTENSION) */
+#endif /* defined(PY_SQLITE_ENABLE_LOAD_EXTENSION) */
PyDoc_STRVAR(pysqlite_connection_execute__doc__,
"execute($self, sql, parameters=<unrepresentable>, /)\n"
#ifndef PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF
#define PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF
#endif /* !defined(PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF) */
-/*[clinic end generated code: output=0c3901153a3837a5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d71bf16bef67878f input=a9049054013a1b77]*/
Py_RETURN_NONE;
}
-#ifndef SQLITE_OMIT_LOAD_EXTENSION
+#ifdef PY_SQLITE_ENABLE_LOAD_EXTENSION
/*[clinic input]
_sqlite3.Connection.enable_load_extension as pysqlite_connection_enable_load_extension
if test "${enable_loadable_sqlite_extensions+set}" = set; then :
enableval=$enable_loadable_sqlite_extensions;
else
- enable_loadable_sqlite_extensions="no"
+ enable_loadable_sqlite_extensions=no
fi
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_loadable_sqlite_extensions" >&5
$as_echo "$enable_loadable_sqlite_extensions" >&6; }
+if test "x$enable_loadable_sqlite_extensions" = xyes; then :
+
+
+$as_echo "#define PY_SQLITE_ENABLE_LOAD_EXTENSION 1" >>confdefs.h
+
+
+fi
+
# Check for --with-tcltk-includes=path and --with-tcltk-libs=path
AS_HELP_STRING([--enable-loadable-sqlite-extensions],
[support loadable extensions in _sqlite module, see Doc/library/sqlite3.rst (default is no)]),
[],
- [enable_loadable_sqlite_extensions="no"])
-
+ [enable_loadable_sqlite_extensions=no])
AC_MSG_RESULT($enable_loadable_sqlite_extensions)
+AS_VAR_IF([enable_loadable_sqlite_extensions], [yes], [
+ AC_DEFINE(PY_SQLITE_ENABLE_LOAD_EXTENSION, 1,
+ [Define to 1 to build the sqlite module with loadable extensions support.])
+])
+
# Check for --with-tcltk-includes=path and --with-tcltk-libs=path
AC_SUBST(TCLTK_INCLUDES)
AC_SUBST(TCLTK_LIBS)
/* Define to printf format modifier for Py_ssize_t */
#undef PY_FORMAT_SIZE_T
+/* Define to 1 to build the sqlite module with loadable extensions support. */
+#undef PY_SQLITE_ENABLE_LOAD_EXTENSION
+
/* Default cipher suites list for ssl module. 1: Python's preferred selection,
2: leave OpenSSL defaults untouched, 0: custom string */
#undef PY_SSL_DEFAULT_CIPHERS
# Enable support for loadable extensions in the sqlite3 module
# if --enable-loadable-sqlite-extensions configure option is used.
- if '--enable-loadable-sqlite-extensions' not in sysconfig.get_config_var("CONFIG_ARGS"):
- sqlite_defines.append(("SQLITE_OMIT_LOAD_EXTENSION", "1"))
- elif MACOS and sqlite_incdir == os.path.join(MACOS_SDK_ROOT, "usr/include"):
+ if (
+ MACOS and
+ sqlite_incdir == os.path.join(MACOS_SDK_ROOT, "usr/include") and
+ sysconfig.get_config_var("PY_SQLITE_ENABLE_LOAD_EXTENSION")
+ ):
raise DistutilsError("System version of SQLite does not support loadable extensions")
if MACOS: