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.
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 #-----------------------------------------------------------------------
11 #-----------------------------------------------------------------------
13 # Set your package name and version numbers here.
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 #-----------------------------------------------------------------------
22 AC_INIT([sqlite],[3.46.1])
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 #--------------------------------------------------------------------
32 AC_CONFIG_AUX_DIR(tclconfig)
34 #--------------------------------------------------------------------
35 # Load the tclConfig.sh file
36 #--------------------------------------------------------------------
41 #--------------------------------------------------------------------
42 # Load the tkConfig.sh file if necessary (Tk extension)
43 #--------------------------------------------------------------------
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 #-----------------------------------------------------------------------
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 #-----------------------------------------------------------------------
64 #-----------------------------------------------------------------------
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 #-----------------------------------------------------------------------
74 TEA_ADD_SOURCES([tclsqlite3.c])
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([])
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.
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"])])
110 #--------------------------------------------------------------------
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.
118 # A few miscellaneous platform-specific items:
119 # TEA_ADD_* any platform specific compiler/build info here.
120 #--------------------------------------------------------------------
122 #CLEANFILES="$CLEANFILES pkgIndex.tcl"
123 if test "${TEA_PLATFORM}" = "windows" ; then
124 # Ensure no empty if clauses
126 #TEA_ADD_SOURCES([win/winFile.c])
127 #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
129 # Ensure no empty else clauses
131 #TEA_ADD_SOURCES([unix/unixFile.c])
132 #TEA_ADD_LIBS([-lsuperfly])
135 #--------------------------------------------------------------------
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
141 # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
142 #--------------------------------------------------------------------
144 TEA_PUBLIC_TCL_HEADERS
145 #TEA_PRIVATE_TCL_HEADERS
147 #TEA_PUBLIC_TK_HEADERS
148 #TEA_PRIVATE_TK_HEADERS
151 #--------------------------------------------------------------------
152 # Check whether --enable-threads or --disable-threads was given.
153 # This auto-enables if Tcl was compiled threaded.
154 #--------------------------------------------------------------------
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])
163 AC_DEFINE(SQLITE_THREADSAFE, 0, [Trigger sqlite non-threadsafe build])
166 #--------------------------------------------------------------------
167 # The statement below defines a collection of symbols related to
168 # building as a shared library instead of a static library.
169 #--------------------------------------------------------------------
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 #--------------------------------------------------------------------
181 #--------------------------------------------------------------------
182 # Set the default compiler switches based on the --enable-symbols option.
183 #--------------------------------------------------------------------
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 #--------------------------------------------------------------------
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 #--------------------------------------------------------------------
206 #--------------------------------------------------------------------
207 # Setup a *Config.sh.in configuration file.
208 #--------------------------------------------------------------------
210 #TEA_EXPORT_CONFIG([sample])
211 #AC_SUBST(SAMPLE_VAR)
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 #--------------------------------------------------------------------
219 AC_CONFIG_FILES([Makefile pkgIndex.tcl])
220 #AC_CONFIG_FILES([sampleConfig.sh])
222 #--------------------------------------------------------------------
223 # Finally, substitute all of the various values into the files
224 # specified with AC_CONFIG_FILES.
225 #--------------------------------------------------------------------