os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/win/configure.in
Update contrib.
2 # This file is an input file used by the GNU "autoconf" program to
3 # generate the file "configure", which is run during Tcl installation
4 # to configure the system for the local environment.
6 # RCS: @(#) $Id: configure.in,v 1.68.2.19 2006/10/23 17:53:28 dgp Exp $
8 AC_INIT(../generic/tcl.h)
15 VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION
18 TCL_DDE_MAJOR_VERSION=1
19 TCL_DDE_MINOR_VERSION=2
20 DDEVER=$TCL_DDE_MAJOR_VERSION$TCL_DDE_MINOR_VERSION
23 TCL_REG_MAJOR_VERSION=1
24 TCL_REG_MINOR_VERSION=1
25 REGVER=$TCL_REG_MAJOR_VERSION$TCL_REG_MINOR_VERSION
27 #------------------------------------------------------------------------
28 # Handle the --prefix=... option
29 #------------------------------------------------------------------------
31 if test "${prefix}" = "NONE"; then
34 if test "${exec_prefix}" = "NONE"; then
37 # libdir must be a fully qualified path (not ${exec_prefix}/lib)
40 #------------------------------------------------------------------------
41 # Standard compiler checks
42 #------------------------------------------------------------------------
44 # If the user did not set CFLAGS, set it now to keep
45 # the AC_PROG_CC macro from adding "-g -O2".
46 if test "${CFLAGS+set}" != "set" ; then
52 # To properly support cross-compilation, one would
53 # need to use these tool checks instead of
54 # the ones below and reconfigure with
55 # autoconf 2.50. You can also just set
56 # the CC, AR, RANLIB, and RC environment
57 # variables if you want to cross compile.
58 dnl AC_CHECK_TOOL(AR, ar)
59 dnl AC_CHECK_TOOL(RANLIB, ranlib)
60 dnl AC_CHECK_TOOL(RC, windres)
62 if test "${GCC}" = "yes" ; then
63 AC_CHECK_PROG(AR, ar, ar)
64 AC_CHECK_PROG(RANLIB, ranlib, ranlib)
65 AC_CHECK_PROG(RC, windres, windres)
67 if test "${AR}" = "" ; then
68 AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.])
70 if test "${RANLIB}" = "" ; then
71 AC_MSG_ERROR([Required archive index tool 'ranlib' not found on PATH.])
73 if test "${RC}" = "" ; then
74 AC_MSG_ERROR([Required resource tool 'windres' not found on PATH.])
78 #--------------------------------------------------------------------
79 # Checks to see if the make progeam sets the $MAKE variable.
80 #--------------------------------------------------------------------
84 #--------------------------------------------------------------------
85 # Perform additinal compiler tests.
86 #--------------------------------------------------------------------
90 if test "$ac_cv_cygwin" = "yes" ; then
91 AC_MSG_ERROR([Compiling under Cygwin is not currently supported.
92 A maintainer for the Cygwin port of Tcl/Tk is needed. See the README
93 file for information about building with Mingw.])
97 AC_CACHE_CHECK(for SEH support in compiler,
100 #define WIN32_LEAN_AND_MEAN
102 #undef WIN32_LEAN_AND_MEAN
104 int main(int argc, char** argv) {
109 __except (EXCEPTION_EXECUTE_HANDLER) {
119 if test "$tcl_cv_seh" = "no" ; then
120 AC_DEFINE(HAVE_NO_SEH, 1,
121 [Defined when mingw does not support SEH])
125 # Check to see if the excpt.h include file provided contains the
126 # definition for EXCEPTION_DISPOSITION; if not, which is the case
127 # with Cygwin's version as of 2002-04-10, define it to be int,
128 # sufficient for getting the current code to work.
130 AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files,
131 tcl_cv_eh_disposition,
133 #define WIN32_LEAN_AND_MEAN
135 #undef WIN32_LEAN_AND_MEAN
138 EXCEPTION_DISPOSITION x;
140 tcl_cv_eh_disposition=yes,
141 tcl_cv_eh_disposition=no)
143 if test "$tcl_cv_eh_disposition" = "no" ; then
144 AC_DEFINE(EXCEPTION_DISPOSITION, int,
145 [Defined when cygwin/mingw does not support EXCEPTION DISPOSITION])
149 # Check to see if the winsock2.h include file provided contains
150 # typedefs like LPFN_ACCEPT and friends.
152 AC_CACHE_CHECK(for LPFN_ACCEPT support in winsock2.h,
155 #define WIN32_LEAN_AND_MEAN
157 #undef WIN32_LEAN_AND_MEAN
158 #include <winsock2.h>
163 tcl_cv_lpfn_decls=yes,
164 tcl_cv_lpfn_decls=no)
166 if test "$tcl_cv_lpfn_decls" = "no" ; then
167 AC_DEFINE(HAVE_NO_LPFN_DECLS, 1,
168 [Defined when cygwin/mingw does not support LPFN_ACCEPT and friends.])
171 # Check to see if winnt.h defines CHAR, SHORT, and LONG
172 # even if VOID has already been #defined. The win32api
173 # used by mingw and cygwin is known to do this.
175 AC_CACHE_CHECK(for winnt.h that ignores VOID define,
176 tcl_cv_winnt_ignore_void,
179 #define WIN32_LEAN_AND_MEAN
181 #undef WIN32_LEAN_AND_MEAN
188 tcl_cv_winnt_ignore_void=yes,
189 tcl_cv_winnt_ignore_void=no)
191 if test "$tcl_cv_winnt_ignore_void" = "yes" ; then
192 AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1,
193 [Defined when cygwin/mingw ignores VOID define in winnt.h])
196 # Check to see if malloc.h is missing the alloca function
197 # declaration. This is known to be a problem with Mingw.
198 # If we compiled without the function declaration, it
199 # would work but we would get a warning message from gcc.
200 # If we add the function declaration ourselves, it
201 # would not compile correctly because the _alloca
202 # function expects the argument to be passed in a
203 # register and not on the stack. Instead, we just
204 # call it from inline asm code.
206 AC_CACHE_CHECK(for alloca declaration in malloc.h,
207 tcl_cv_malloc_decl_alloca,
217 tcl_cv_malloc_decl_alloca=yes,
218 tcl_cv_malloc_decl_alloca=no)
220 if test "$tcl_cv_malloc_decl_alloca" = "no" &&
221 test "${GCC}" = "yes" ; then
222 AC_DEFINE(HAVE_ALLOCA_GCC_INLINE, 1,
223 [Defined when gcc should use inline ASM to call alloca.])
226 # See if the compiler supports casting to a union type.
227 # This is used to stop gcc from printing a compiler
228 # warning when initializing a union member.
230 AC_CACHE_CHECK(for cast to union support,
231 tcl_cv_cast_to_union,
234 union foo { int i; double d; };
235 union foo f = (union foo) (int) 0;
237 tcl_cv_cast_to_union=yes,
238 tcl_cv_cast_to_union=no)
240 if test "$tcl_cv_cast_to_union" = "yes"; then
241 AC_DEFINE(HAVE_CAST_TO_UNION, 1,
242 [Defined when compiler supports casting to union type.])
246 #--------------------------------------------------------------------
247 # Determines the correct binary file extension (.o, .obj, .exe etc.)
248 #--------------------------------------------------------------------
253 #--------------------------------------------------------------------
254 # Check whether --enable-threads or --disable-threads was given.
255 #--------------------------------------------------------------------
259 #--------------------------------------------------------------------
260 # The statements below define a collection of symbols related to
261 # building libtcl as a shared library instead of a static library.
262 #--------------------------------------------------------------------
266 #--------------------------------------------------------------------
267 # The statements below define a collection of compile flags. This
268 # macro depends on the value of SHARED_BUILD, and should be called
269 # after SC_ENABLE_SHARED checks the configure switches.
270 #--------------------------------------------------------------------
274 #--------------------------------------------------------------------
275 # Set the default compiler switches based on the --enable-symbols
276 # option. This macro depends on C flags, and should be called
277 # after SC_CONFIG_CFLAGS macro is called.
278 #--------------------------------------------------------------------
284 #--------------------------------------------------------------------
285 # man2tcl needs this so that it can use errno.h
286 #--------------------------------------------------------------------
288 AC_CHECK_HEADER(errno.h, , MAN2TCLFLAGS="-DNO_ERRNO_H")
289 AC_SUBST(MAN2TCLFLAGS)
291 #------------------------------------------------------------------------
292 # tclConfig.sh refers to this by a different name
293 #------------------------------------------------------------------------
295 TCL_SHARED_BUILD=${SHARED_BUILD}
297 #--------------------------------------------------------------------
298 # Perform final evaluations of variables with possible substitutions.
299 #--------------------------------------------------------------------
301 TCL_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}"
302 TCL_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
303 TCL_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
305 eval "TCL_SRC_DIR=\"`cd $srcdir/..; pwd`\""
307 eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}"
309 eval "TCL_LIB_FILE=${LIBPREFIX}tcl$VER${LIBSUFFIX}"
311 eval "TCL_LIB_FLAG=\"-ltcl${VER}${LIBFLAGSUFFIX}\""
312 eval "TCL_BUILD_LIB_SPEC=\"-L`pwd` ${TCL_LIB_FLAG}\""
313 eval "TCL_LIB_SPEC=\"-L${libdir} ${TCL_LIB_FLAG}\""
315 eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${VER}${LIBSUFFIX}\""
316 eval "TCL_STUB_LIB_FLAG=\"-ltclstub${VER}${LIBFLAGSUFFIX}\""
317 eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`pwd` ${TCL_STUB_LIB_FLAG}\""
318 eval "TCL_STUB_LIB_SPEC=\"-L${libdir} ${TCL_STUB_LIB_FLAG}\""
319 eval "TCL_BUILD_STUB_LIB_PATH=\"`pwd`/${TCL_STUB_LIB_FILE}\""
320 eval "TCL_STUB_LIB_PATH=\"${libdir}/${TCL_STUB_LIB_FILE}\""
322 # Install time header dir can be set via --includedir
323 eval "TCL_INCLUDE_SPEC=\"-I${includedir}\""
326 eval "DLLSUFFIX=${DLLSUFFIX}"
327 eval "LIBPREFIX=${LIBPREFIX}"
328 eval "LIBSUFFIX=${LIBSUFFIX}"
329 eval "EXESUFFIX=${EXESUFFIX}"
331 CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}
332 CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}
333 CFG_TCL_EXPORT_FILE_SUFFIX=${TCL_EXPORT_FILE_SUFFIX}
335 #--------------------------------------------------------------------
336 # Adjust the defines for how the resources are built depending
337 # on symbols and static vs. shared.
338 #--------------------------------------------------------------------
340 if test ${SHARED_BUILD} = 0 ; then
341 if test "${DBGX}" = "g"; then
342 RC_DEFINES="${RC_DEFINE} STATIC_BUILD ${RC_DEFINE} DEBUG"
344 RC_DEFINES="${RC_DEFINE} STATIC_BUILD"
347 if test "${DBGX}" = "g"; then
348 RC_DEFINES="${RC_DEFINE} DEBUG"
354 #--------------------------------------------------------------------
355 # The statements below define the symbol TCL_PACKAGE_PATH, which
356 # gives a list of directories that may contain packages. The list
357 # consists of one directory for machine-dependent binaries and
358 # another for platform-independent scripts.
359 #--------------------------------------------------------------------
361 if test "$prefix" != "$exec_prefix"; then
362 TCL_PACKAGE_PATH="${libdir} ${prefix}/lib"
364 TCL_PACKAGE_PATH="${prefix}/lib"
367 AC_SUBST(TCL_VERSION)
368 AC_SUBST(TCL_MAJOR_VERSION)
369 AC_SUBST(TCL_MINOR_VERSION)
370 AC_SUBST(TCL_PATCH_LEVEL)
372 AC_SUBST(TCL_LIB_FILE)
373 AC_SUBST(TCL_LIB_FLAG)
375 AC_SUBST(TCL_LIB_SPEC)
376 AC_SUBST(TCL_STUB_LIB_FILE)
377 AC_SUBST(TCL_STUB_LIB_FLAG)
378 AC_SUBST(TCL_STUB_LIB_SPEC)
379 AC_SUBST(TCL_STUB_LIB_PATH)
380 AC_SUBST(TCL_INCLUDE_SPEC)
381 AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
382 AC_SUBST(TCL_BUILD_STUB_LIB_PATH)
383 AC_SUBST(TCL_DLL_FILE)
385 AC_SUBST(TCL_SRC_DIR)
386 AC_SUBST(TCL_BIN_DIR)
388 AC_SUBST(CFG_TCL_SHARED_LIB_SUFFIX)
389 AC_SUBST(CFG_TCL_UNSHARED_LIB_SUFFIX)
390 AC_SUBST(CFG_TCL_EXPORT_FILE_SUFFIX)
392 # win/tcl.m4 doesn't set (CFLAGS)
393 AC_SUBST(CFLAGS_DEFAULT)
394 AC_SUBST(EXTRA_CFLAGS)
400 # win/tcl.m4 doesn't set (LDFLAGS)
401 AC_SUBST(LDFLAGS_DEFAULT)
402 AC_SUBST(LDFLAGS_DEBUG)
403 AC_SUBST(LDFLAGS_OPTIMIZE)
404 AC_SUBST(LDFLAGS_CONSOLE)
405 AC_SUBST(LDFLAGS_WINDOW)
411 AC_SUBST(SHLIB_LD_LIBS)
412 AC_SUBST(SHLIB_CFLAGS)
413 AC_SUBST(SHLIB_SUFFIX)
414 AC_SUBST(TCL_SHARED_BUILD)
424 AC_SUBST(POST_MAKE_LIB)
428 # empty on win, but needs sub'ing
429 AC_SUBST(TCL_BUILD_LIB_SPEC)
430 AC_SUBST(TCL_LD_SEARCH_FLAGS)
431 AC_SUBST(TCL_NEEDS_EXP_FILE)
432 AC_SUBST(TCL_BUILD_EXP_FILE)
433 AC_SUBST(TCL_EXP_FILE)
436 AC_SUBST(TCL_LIB_VERSIONS_OK)
437 AC_SUBST(TCL_PACKAGE_PATH)
440 AC_SUBST(TCL_DDE_VERSION)
441 AC_SUBST(TCL_DDE_MAJOR_VERSION)
442 AC_SUBST(TCL_DDE_MINOR_VERSION)
443 AC_SUBST(TCL_REG_VERSION)
444 AC_SUBST(TCL_REG_MAJOR_VERSION)
445 AC_SUBST(TCL_REG_MINOR_VERSION)
455 AC_OUTPUT(Makefile tclConfig.sh tcl.hpj)