| 1 |
#!/bin/bash -norc |
| 2 |
dnl This file is an input file used by the GNU "autoconf" program to |
| 3 |
dnl generate the file "configure", which is run during Tcl installation |
| 4 |
dnl to configure the system for the local environment. |
| 5 |
|
| 6 |
#----------------------------------------------------------------------- |
| 7 |
# Sample configure.ac for Tcl Extensions. The only places you should |
| 8 |
# need to modify this file are marked by the string __CHANGE__ |
| 9 |
#----------------------------------------------------------------------- |
| 10 |
|
| 11 |
#----------------------------------------------------------------------- |
| 12 |
# __CHANGE__ |
| 13 |
# Set your package name and version numbers here. |
| 14 |
# |
| 15 |
# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION |
| 16 |
# set as provided. These will also be added as -D defs in your Makefile |
| 17 |
# so you can encode the package version directly into the source files. |
| 18 |
# This will also define a special symbol for Windows (BUILD_<PACKAGE_NAME> |
| 19 |
# so that we create the export library with the dll. |
| 20 |
#----------------------------------------------------------------------- |
| 21 |
|
| 22 |
AC_INIT([sqlite],[3.46.1]) |
| 23 |
|
| 24 |
#-------------------------------------------------------------------- |
| 25 |
# Call TEA_INIT as the first TEA_ macro to set up initial vars. |
| 26 |
# This will define a ${TEA_PLATFORM} variable == "unix" or "windows" |
| 27 |
# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. |
| 28 |
#-------------------------------------------------------------------- |
| 29 |
|
| 30 |
TEA_INIT() |
| 31 |
|
| 32 |
AC_CONFIG_AUX_DIR(tclconfig) |
| 33 |
|
| 34 |
#-------------------------------------------------------------------- |
| 35 |
# Load the tclConfig.sh file |
| 36 |
#-------------------------------------------------------------------- |
| 37 |
|
| 38 |
TEA_PATH_TCLCONFIG |
| 39 |
TEA_LOAD_TCLCONFIG |
| 40 |
|
| 41 |
#-------------------------------------------------------------------- |
| 42 |
# Load the tkConfig.sh file if necessary (Tk extension) |
| 43 |
#-------------------------------------------------------------------- |
| 44 |
|
| 45 |
#TEA_PATH_TKCONFIG |
| 46 |
#TEA_LOAD_TKCONFIG |
| 47 |
|
| 48 |
#----------------------------------------------------------------------- |
| 49 |
# Handle the --prefix=... option by defaulting to what Tcl gave. |
| 50 |
# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. |
| 51 |
#----------------------------------------------------------------------- |
| 52 |
|
| 53 |
TEA_PREFIX |
| 54 |
|
| 55 |
#----------------------------------------------------------------------- |
| 56 |
# Standard compiler checks. |
| 57 |
# This sets up CC by using the CC env var, or looks for gcc otherwise. |
| 58 |
# This also calls AC_PROG_CC and a few others to create the basic setup |
| 59 |
# necessary to compile executables. |
| 60 |
#----------------------------------------------------------------------- |
| 61 |
|
| 62 |
TEA_SETUP_COMPILER |
| 63 |
|
| 64 |
#----------------------------------------------------------------------- |
| 65 |
# __CHANGE__ |
| 66 |
# Specify the C source files to compile in TEA_ADD_SOURCES, |
| 67 |
# public headers that need to be installed in TEA_ADD_HEADERS, |
| 68 |
# stub library C source files to compile in TEA_ADD_STUB_SOURCES, |
| 69 |
# and runtime Tcl library files in TEA_ADD_TCL_SOURCES. |
| 70 |
# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS |
| 71 |
# and PKG_TCL_SOURCES. |
| 72 |
#----------------------------------------------------------------------- |
| 73 |
|
| 74 |
TEA_ADD_SOURCES([tclsqlite3.c]) |
| 75 |
TEA_ADD_HEADERS([]) |
| 76 |
TEA_ADD_INCLUDES([]) |
| 77 |
TEA_ADD_LIBS([]) |
| 78 |
TEA_ADD_CFLAGS([-DSQLITE_ENABLE_FTS3=1]) |
| 79 |
TEA_ADD_CFLAGS([-DSQLITE_ENABLE_FTS4=1]) |
| 80 |
TEA_ADD_CFLAGS([-DSQLITE_ENABLE_FTS5=1]) |
| 81 |
TEA_ADD_CFLAGS([-DSQLITE_3_SUFFIX_ONLY=1]) |
| 82 |
TEA_ADD_CFLAGS([-DSQLITE_ENABLE_RTREE=1]) |
| 83 |
TEA_ADD_CFLAGS([-DSQLITE_ENABLE_GEOPOLY=1]) |
| 84 |
TEA_ADD_CFLAGS([-DSQLITE_ENABLE_MATH_FUNCTIONS=1]) |
| 85 |
TEA_ADD_CFLAGS([-DSQLITE_ENABLE_DESERIALIZE=1]) |
| 86 |
TEA_ADD_CFLAGS([-DSQLITE_ENABLE_DBPAGE_VTAB=1]) |
| 87 |
TEA_ADD_CFLAGS([-DSQLITE_ENABLE_BYTECODE_VTAB=1]) |
| 88 |
TEA_ADD_CFLAGS([-DSQLITE_ENABLE_DBSTAT_VTAB=1]) |
| 89 |
TEA_ADD_STUB_SOURCES([]) |
| 90 |
TEA_ADD_TCL_SOURCES([]) |
| 91 |
|
| 92 |
#-------------------------------------------------------------------- |
| 93 |
# The --with-system-sqlite causes the TCL bindings to SQLite to use |
| 94 |
# the system shared library for SQLite rather than statically linking |
| 95 |
# against its own private copy. This is dangerous and leads to |
| 96 |
# undersirable dependences and is not recommended. |
| 97 |
# Patchs from rmax. |
| 98 |
#-------------------------------------------------------------------- |
| 99 |
AC_ARG_WITH([system-sqlite], |
| 100 |
[AC_HELP_STRING([--with-system-sqlite], |
| 101 |
[use a system-supplied libsqlite3 instead of the bundled one])], |
| 102 |
[], [with_system_sqlite=no]) |
| 103 |
if test x$with_system_sqlite != xno; then |
| 104 |
AC_CHECK_HEADER([sqlite3.h], |
| 105 |
[AC_CHECK_LIB([sqlite3],[sqlite3_initialize], |
| 106 |
[AC_DEFINE(USE_SYSTEM_SQLITE) |
| 107 |
LIBS="$LIBS -lsqlite3"])]) |
| 108 |
fi |
| 109 |
|
| 110 |
#-------------------------------------------------------------------- |
| 111 |
# __CHANGE__ |
| 112 |
# |
| 113 |
# You can add more files to clean if your extension creates any extra |
| 114 |
# files by extending CLEANFILES. |
| 115 |
# Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure |
| 116 |
# and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var. |
| 117 |
# |
| 118 |
# A few miscellaneous platform-specific items: |
| 119 |
# TEA_ADD_* any platform specific compiler/build info here. |
| 120 |
#-------------------------------------------------------------------- |
| 121 |
|
| 122 |
#CLEANFILES="$CLEANFILES pkgIndex.tcl" |
| 123 |
if test "${TEA_PLATFORM}" = "windows" ; then |
| 124 |
# Ensure no empty if clauses |
| 125 |
: |
| 126 |
#TEA_ADD_SOURCES([win/winFile.c]) |
| 127 |
#TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) |
| 128 |
else |
| 129 |
# Ensure no empty else clauses |
| 130 |
: |
| 131 |
#TEA_ADD_SOURCES([unix/unixFile.c]) |
| 132 |
#TEA_ADD_LIBS([-lsuperfly]) |
| 133 |
fi |
| 134 |
|
| 135 |
#-------------------------------------------------------------------- |
| 136 |
# __CHANGE__ |
| 137 |
# Choose which headers you need. Extension authors should try very |
| 138 |
# hard to only rely on the Tcl public header files. Internal headers |
| 139 |
# contain private data structures and are subject to change without |
| 140 |
# notice. |
| 141 |
# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG |
| 142 |
#-------------------------------------------------------------------- |
| 143 |
|
| 144 |
TEA_PUBLIC_TCL_HEADERS |
| 145 |
#TEA_PRIVATE_TCL_HEADERS |
| 146 |
|
| 147 |
#TEA_PUBLIC_TK_HEADERS |
| 148 |
#TEA_PRIVATE_TK_HEADERS |
| 149 |
#TEA_PATH_X |
| 150 |
|
| 151 |
#-------------------------------------------------------------------- |
| 152 |
# Check whether --enable-threads or --disable-threads was given. |
| 153 |
# This auto-enables if Tcl was compiled threaded. |
| 154 |
#-------------------------------------------------------------------- |
| 155 |
|
| 156 |
TEA_ENABLE_THREADS |
| 157 |
if test "${TCL_THREADS}" = "1" ; then |
| 158 |
AC_DEFINE(SQLITE_THREADSAFE, 1, [Trigger sqlite threadsafe build]) |
| 159 |
# Not automatically added by Tcl because its assumed Tcl links to them, |
| 160 |
# but it may not if it isn't really a threaded build. |
| 161 |
TEA_ADD_LIBS([$THREADS_LIBS]) |
| 162 |
else |
| 163 |
AC_DEFINE(SQLITE_THREADSAFE, 0, [Trigger sqlite non-threadsafe build]) |
| 164 |
fi |
| 165 |
|
| 166 |
#-------------------------------------------------------------------- |
| 167 |
# The statement below defines a collection of symbols related to |
| 168 |
# building as a shared library instead of a static library. |
| 169 |
#-------------------------------------------------------------------- |
| 170 |
|
| 171 |
TEA_ENABLE_SHARED |
| 172 |
|
| 173 |
#-------------------------------------------------------------------- |
| 174 |
# This macro figures out what flags to use with the compiler/linker |
| 175 |
# when building shared/static debug/optimized objects. This information |
| 176 |
# can be taken from the tclConfig.sh file, but this figures it all out. |
| 177 |
#-------------------------------------------------------------------- |
| 178 |
|
| 179 |
TEA_CONFIG_CFLAGS |
| 180 |
|
| 181 |
#-------------------------------------------------------------------- |
| 182 |
# Set the default compiler switches based on the --enable-symbols option. |
| 183 |
#-------------------------------------------------------------------- |
| 184 |
|
| 185 |
TEA_ENABLE_SYMBOLS |
| 186 |
|
| 187 |
#-------------------------------------------------------------------- |
| 188 |
# This macro generates a line to use when building a library. It |
| 189 |
# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, |
| 190 |
# and TEA_LOAD_TCLCONFIG macros above. |
| 191 |
#-------------------------------------------------------------------- |
| 192 |
|
| 193 |
TEA_MAKE_LIB |
| 194 |
|
| 195 |
#-------------------------------------------------------------------- |
| 196 |
# Determine the name of the tclsh and/or wish executables in the |
| 197 |
# Tcl and Tk build directories or the location they were installed |
| 198 |
# into. These paths are used to support running test cases only, |
| 199 |
# the Makefile should not be making use of these paths to generate |
| 200 |
# a pkgIndex.tcl file or anything else at extension build time. |
| 201 |
#-------------------------------------------------------------------- |
| 202 |
|
| 203 |
TEA_PROG_TCLSH |
| 204 |
#TEA_PROG_WISH |
| 205 |
|
| 206 |
#-------------------------------------------------------------------- |
| 207 |
# Setup a *Config.sh.in configuration file. |
| 208 |
#-------------------------------------------------------------------- |
| 209 |
|
| 210 |
#TEA_EXPORT_CONFIG([sample]) |
| 211 |
#AC_SUBST(SAMPLE_VAR) |
| 212 |
|
| 213 |
#-------------------------------------------------------------------- |
| 214 |
# Specify files to substitute AC variables in. You may alternatively |
| 215 |
# have a special pkgIndex.tcl.in or other files which require |
| 216 |
# substituting the AC variables in. Include these here. |
| 217 |
#-------------------------------------------------------------------- |
| 218 |
|
| 219 |
AC_CONFIG_FILES([Makefile pkgIndex.tcl]) |
| 220 |
#AC_CONFIG_FILES([sampleConfig.sh]) |
| 221 |
|
| 222 |
#-------------------------------------------------------------------- |
| 223 |
# Finally, substitute all of the various values into the files |
| 224 |
# specified with AC_CONFIG_FILES. |
| 225 |
#-------------------------------------------------------------------- |
| 226 |
|
| 227 |
AC_OUTPUT |