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 # RCS: @(#) $Id: configure.in,v 1.43 2005/07/26 19:17:05 mdejong Exp $
8 #-----------------------------------------------------------------------
9 # Sample configure.ac for Tcl Extensions. The only places you should
10 # need to modify this file are marked by the string __CHANGE__
11 #-----------------------------------------------------------------------
13 #-----------------------------------------------------------------------
15 # Set your package name and version numbers here.
17 # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
18 # set as provided. These will also be added as -D defs in your Makefile
19 # so you can encode the package version directly into the source files.
20 #-----------------------------------------------------------------------
22 AC_INIT([sqlite], [3.36.0])
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, AC_PROG_INSTALL and a few others to create
59 # the basic setup 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])
76 TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${srcdir}/generic`\"])
78 TEA_ADD_CFLAGS([-DSQLITE_ENABLE_DBPAGE_VTAB=1])
79 TEA_ADD_CFLAGS([-DSQLITE_ENABLE_DBSTAT_VTAB=1])
80 TEA_ADD_CFLAGS([-DSQLITE_ENABLE_FTS3_PARENTHESIS=1])
81 TEA_ADD_CFLAGS([-DSQLITE_ENABLE_FTS4=1])
82 TEA_ADD_CFLAGS([-DSQLITE_ENABLE_FTS5=1])
83 TEA_ADD_CFLAGS([-DSQLITE_ENABLE_COLUMN_METADATA=1])
84 TEA_ADD_CFLAGS([-DSQLITE_ENABLE_JSON1=1])
85 TEA_ADD_CFLAGS([-DSQLITE_3_SUFFIX_ONLY=1])
86 TEA_ADD_CFLAGS([-DSQLITE_ENABLE_RTREE=1])
87 TEA_ADD_CFLAGS([-DSQLITE_ENABLE_GEOPOLY=1])
88 TEA_ADD_CFLAGS([-DSQLITE_ENABLE_STAT4=1])
89 TEA_ADD_CFLAGS([-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1])
90 TEA_ADD_CFLAGS([-DSQLITE_ENABLE_MATH_FUNCTIONS=1])
91 TEA_ADD_CFLAGS([-DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1])
92 TEA_ADD_CFLAGS([-DSQLITE_UNTESTABLE=1])
93 TEA_ADD_CFLAGS([-DSQLITE_OMIT_DEPRECATED=1])
94 TEA_ADD_CFLAGS([-DSQLITE_OMIT_LOOKASIDE=1])
95 TEA_ADD_CFLAGS([-DSQLITE_SECURE_DELETE=1])
96 TEA_ADD_CFLAGS([-DSQLITE_SOUNDEX=1])
97 TEA_ADD_CFLAGS([-DSQLITE_USE_ALLOCA=1])
98 TEA_ADD_CFLAGS([-DSQLITE_WIN32_NO_ANSI=1])
99 TEA_ADD_CFLAGS([-DSQLITE_WIN32_GETVERSIONEX=0])
100 TEA_ADD_STUB_SOURCES([])
101 TEA_ADD_TCL_SOURCES([])
103 #--------------------------------------------------------------------
104 # The --with-system-sqlite causes the TCL bindings to SQLite to use
105 # the system shared library for SQLite rather than statically linking
106 # against its own private copy. This is dangerous and leads to
107 # undersirable dependences and is not recommended.
109 #--------------------------------------------------------------------
110 AC_ARG_WITH([system-sqlite],
111 [AS_HELP_STRING([--with-system-sqlite],
112 [use a system-supplied libsqlite3 instead of the bundled one])],
113 [], [with_system_sqlite=no])
114 if test x$with_system_sqlite != xno; then
115 AC_CHECK_HEADER([sqlite3.h],
116 [AC_CHECK_LIB([sqlite3],[sqlite3_initialize],
117 [AC_DEFINE(USE_SYSTEM_SQLITE)
118 LIBS="$LIBS -lsqlite3"])])
121 #--------------------------------------------------------------------
123 # Choose which headers you need. Extension authors should try very
124 # hard to only rely on the Tcl public header files. Internal headers
125 # contain private data structures and are subject to change without
127 # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
128 #--------------------------------------------------------------------
130 TEA_PUBLIC_TCL_HEADERS
131 #TEA_PRIVATE_TCL_HEADERS
133 #TEA_PUBLIC_TK_HEADERS
134 #TEA_PRIVATE_TK_HEADERS
137 #--------------------------------------------------------------------
138 # Check whether --enable-threads or --disable-threads was given.
139 # This auto-enables if Tcl was compiled threaded.
140 #--------------------------------------------------------------------
143 if test "${TCL_THREADS}" = "1" ; then
144 AC_DEFINE(SQLITE_THREADSAFE, 1, [Trigger sqlite threadsafe build])
145 # Not automatically added by Tcl because its assumed Tcl links to them,
146 # but it may not if it isn't really a threaded build.
147 TEA_ADD_LIBS([$THREADS_LIBS])
149 AC_DEFINE(SQLITE_THREADSAFE, 0, [Trigger sqlite non-threadsafe build])
152 #--------------------------------------------------------------------
153 # The statement below defines a collection of symbols related to
154 # building as a shared library instead of a static library.
155 #--------------------------------------------------------------------
159 #--------------------------------------------------------------------
160 # This macro figures out what flags to use with the compiler/linker
161 # when building shared/static debug/optimized objects. This information
162 # can be taken from the tclConfig.sh file, but this figures it all out.
163 #--------------------------------------------------------------------
167 #--------------------------------------------------------------------
168 # Set the default compiler switches based on the --enable-symbols option.
169 #--------------------------------------------------------------------
173 #--------------------------------------------------------------------
174 # Everyone should be linking against the Tcl stub library. If you
175 # can't for some reason, remove this definition. If you aren't using
176 # stubs, you also need to modify the SHLIB_LD_LIBS setting below to
177 # link against the non-stubbed Tcl library. Add Tk too if necessary.
178 #--------------------------------------------------------------------
180 AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
181 #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
184 #--------------------------------------------------------------------
185 # Redefine fdatasync as fsync on systems that lack fdatasync
186 #--------------------------------------------------------------------
188 #AC_CHECK_FUNC(fdatasync, , AC_DEFINE(fdatasync, fsync))
189 AC_CHECK_HEADERS([malloc.h])
190 # Check for library functions that SQLite can optionally use.
191 AC_CHECK_FUNCS([fdatasync usleep strchrnul localtime_r gmtime_r localtime_s malloc_usable_size utime flock readlink lstat pread pread64 pwrite pwrite64 rand_s])
196 #--------------------------------------------------------------------
197 # This macro generates a line to use when building a library. It
198 # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
199 # and TEA_LOAD_TCLCONFIG macros above.
200 #--------------------------------------------------------------------
204 #--------------------------------------------------------------------
205 # Determine the name of the tclsh and/or wish executables in the
206 # Tcl and Tk build directories or the location they were installed
207 # into. These paths are used to support running test cases only,
208 # the Makefile should not be making use of these paths to generate
209 # a pkgIndex.tcl file or anything else at extension build time.
210 #--------------------------------------------------------------------
215 #--------------------------------------------------------------------
216 # Finally, substitute all of the various values into the Makefile.
217 # You may alternatively have a special pkgIndex.tcl.in or other files
218 # which require substituting th AC variables in. Include these here.
219 #--------------------------------------------------------------------
221 AC_CONFIG_FILES([Makefile pkgIndex.tcl])