Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/win/configure.in @ 25

Last change on this file since 25 was 25, checked in by landauf, 16 years ago

added tcl to libs

File size: 14.5 KB
Line 
1#! /bin/bash -norc
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.
5#
6# RCS: @(#) $Id: configure.in,v 1.104 2008/03/28 17:31:48 dgp Exp $
7
8AC_INIT(../generic/tcl.h)
9AC_PREREQ(2.59)
10
11# The following define is needed when building with Cygwin since newer
12# versions of autoconf incorrectly set SHELL to /bin/bash instead of
13# /bin/sh. The bash shell seems to suffer from some strange failures.
14SHELL=/bin/sh
15
16TCL_VERSION=8.5
17TCL_MAJOR_VERSION=8
18TCL_MINOR_VERSION=5
19TCL_PATCH_LEVEL=".2"
20VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION
21
22TCL_DDE_VERSION=1.3
23TCL_DDE_MAJOR_VERSION=1
24TCL_DDE_MINOR_VERSION=3
25TCL_DDE_PATCH_LEVEL="2"
26DDEVER=$TCL_DDE_MAJOR_VERSION$TCL_DDE_MINOR_VERSION
27
28TCL_REG_VERSION=1.2
29TCL_REG_MAJOR_VERSION=1
30TCL_REG_MINOR_VERSION=2
31TCL_REG_PATCH_LEVEL="1"
32REGVER=$TCL_REG_MAJOR_VERSION$TCL_REG_MINOR_VERSION
33
34#------------------------------------------------------------------------
35# Handle the --prefix=... option
36#------------------------------------------------------------------------
37
38if test "${prefix}" = "NONE"; then
39    prefix=/usr/local
40fi
41if test "${exec_prefix}" = "NONE"; then
42    exec_prefix=$prefix
43fi
44# libdir must be a fully qualified path (not ${exec_prefix}/lib)
45eval libdir="$libdir"
46
47#------------------------------------------------------------------------
48# Standard compiler checks
49#------------------------------------------------------------------------
50
51# If the user did not set CFLAGS, set it now to keep
52# the AC_PROG_CC macro from adding "-g -O2".
53if test "${CFLAGS+set}" != "set" ; then
54    CFLAGS=""
55fi
56
57AC_PROG_CC
58AC_C_INLINE
59AC_HEADER_STDC
60
61# To properly support cross-compilation, one would
62# need to use these tool checks instead of
63# the ones below and reconfigure with
64# autoconf 2.50. You can also just set
65# the CC, AR, RANLIB, and RC environment
66# variables if you want to cross compile.
67dnl AC_CHECK_TOOL(AR, ar)
68dnl AC_CHECK_TOOL(RANLIB, ranlib)
69dnl AC_CHECK_TOOL(RC, windres)
70
71if test "${GCC}" = "yes" ; then
72    AC_CHECK_PROG(AR, ar, ar)
73    AC_CHECK_PROG(RANLIB, ranlib, ranlib)
74    AC_CHECK_PROG(RC, windres, windres)
75
76    if test "${AR}" = "" ; then
77        AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.])
78    fi
79    if test "${RANLIB}" = "" ; then
80        AC_MSG_ERROR([Required archive index tool 'ranlib' not found on PATH.])
81    fi
82    if test "${RC}" = "" ; then
83        AC_MSG_ERROR([Required resource tool 'windres' not found on PATH.])
84    fi
85fi
86
87#--------------------------------------------------------------------
88# Checks to see if the make program sets the $MAKE variable.
89#--------------------------------------------------------------------
90
91AC_PROG_MAKE_SET
92
93#--------------------------------------------------------------------
94# Perform additinal compiler tests.
95#--------------------------------------------------------------------
96
97dnl Currently AC_CYGWIN is disabled since it invokes AC_CANONICAL_HOST
98dnl under autoconf 2.5X.
99dnl
100dnl AC_CYGWIN
101
102AC_CACHE_CHECK(for Cygwin version of gcc,
103    ac_cv_cygwin,
104AC_TRY_COMPILE([
105#ifdef __CYGWIN__
106#error cygwin
107#endif
108],
109[],
110        ac_cv_cygwin=no,
111        ac_cv_cygwin=yes)
112)
113if test "$ac_cv_cygwin" = "yes" ; then
114    AC_MSG_ERROR([Compiling under Cygwin is not currently supported.
115A maintainer for the Cygwin port of Tcl/Tk is needed. See the README
116file for information about building with Mingw.])
117fi
118
119
120AC_CACHE_CHECK(for SEH support in compiler,
121    tcl_cv_seh,
122AC_TRY_RUN([
123#define WIN32_LEAN_AND_MEAN
124#include <windows.h>
125#undef WIN32_LEAN_AND_MEAN
126
127int main(int argc, char** argv) {
128    int a, b = 0;
129    __try {
130        a = 666 / b;
131    }
132    __except (EXCEPTION_EXECUTE_HANDLER) {
133        return 0;
134    }
135    return 1;
136}
137],
138        tcl_cv_seh=yes,
139        tcl_cv_seh=no,
140        tcl_cv_seh=no)
141)
142if test "$tcl_cv_seh" = "no" ; then
143    AC_DEFINE(HAVE_NO_SEH, 1,
144            [Defined when mingw does not support SEH])
145fi
146
147#
148# Check to see if the excpt.h include file provided contains the
149# definition for EXCEPTION_DISPOSITION; if not, which is the case
150# with Cygwin's version as of 2002-04-10, define it to be int,
151# sufficient for getting the current code to work.
152#
153AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files,
154    tcl_cv_eh_disposition,
155AC_TRY_COMPILE([
156#define WIN32_LEAN_AND_MEAN
157#include <windows.h>
158#undef WIN32_LEAN_AND_MEAN
159],
160[
161  EXCEPTION_DISPOSITION x;
162],
163        tcl_cv_eh_disposition=yes,
164        tcl_cv_eh_disposition=no)
165)
166if test "$tcl_cv_eh_disposition" = "no" ; then
167    AC_DEFINE(EXCEPTION_DISPOSITION, int,
168            [Defined when cygwin/mingw does not support EXCEPTION DISPOSITION])
169fi
170
171
172# Check to see if the winsock2.h include file provided contains
173# typedefs like LPFN_ACCEPT and friends.
174#
175AC_CACHE_CHECK(for LPFN_ACCEPT support in winsock2.h,
176    tcl_cv_lpfn_decls,
177AC_TRY_COMPILE([
178#define WIN32_LEAN_AND_MEAN
179#include <windows.h>
180#undef WIN32_LEAN_AND_MEAN
181#include <winsock2.h>
182],
183[
184  LPFN_ACCEPT accept;
185],
186        tcl_cv_lpfn_decls=yes,
187        tcl_cv_lpfn_decls=no)
188)
189if test "$tcl_cv_lpfn_decls" = "no" ; then
190    AC_DEFINE(HAVE_NO_LPFN_DECLS, 1,
191            [Defined when cygwin/mingw does not support LPFN_ACCEPT and friends.])
192fi
193
194# Check to see if winnt.h defines CHAR, SHORT, and LONG
195# even if VOID has already been #defined. The win32api
196# used by mingw and cygwin is known to do this.
197
198AC_CACHE_CHECK(for winnt.h that ignores VOID define,
199    tcl_cv_winnt_ignore_void,
200AC_TRY_COMPILE([
201#define VOID void
202#define WIN32_LEAN_AND_MEAN
203#include <windows.h>
204#undef WIN32_LEAN_AND_MEAN
205],
206[
207  CHAR c;
208  SHORT s;
209  LONG l;
210],
211        tcl_cv_winnt_ignore_void=yes,
212        tcl_cv_winnt_ignore_void=no)
213)
214if test "$tcl_cv_winnt_ignore_void" = "yes" ; then
215    AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1,
216            [Defined when cygwin/mingw ignores VOID define in winnt.h])
217fi
218
219# Check to see if malloc.h is missing the alloca function
220# declaration. This is known to be a problem with Mingw.
221# If we compiled without the function declaration, it
222# would work but we would get a warning message from gcc.
223# If we add the function declaration ourselves, it
224# would not compile correctly because the _alloca
225# function expects the argument to be passed in a
226# register and not on the stack. Instead, we just
227# call it from inline asm code.
228
229AC_CACHE_CHECK(for alloca declaration in malloc.h,
230    tcl_cv_malloc_decl_alloca,
231AC_TRY_COMPILE([
232#include <malloc.h>
233],
234[
235  size_t arg = 0;
236  void* ptr;
237  ptr = alloca;
238  ptr = alloca(arg);
239],
240        tcl_cv_malloc_decl_alloca=yes,
241        tcl_cv_malloc_decl_alloca=no)
242)
243if test "$tcl_cv_malloc_decl_alloca" = "no" &&
244   test "${GCC}" = "yes" ; then
245    AC_DEFINE(HAVE_ALLOCA_GCC_INLINE, 1,
246            [Defined when gcc should use inline ASM to call alloca.])
247fi
248
249# See if the compiler supports casting to a union type.
250# This is used to stop gcc from printing a compiler
251# warning when initializing a union member.
252
253AC_CACHE_CHECK(for cast to union support,
254    tcl_cv_cast_to_union,
255AC_TRY_COMPILE([],
256[
257  union foo { int i; double d; };
258  union foo f = (union foo) (int) 0;
259],
260        tcl_cv_cast_to_union=yes,
261        tcl_cv_cast_to_union=no)
262)
263if test "$tcl_cv_cast_to_union" = "yes"; then
264    AC_DEFINE(HAVE_CAST_TO_UNION, 1,
265            [Defined when compiler supports casting to union type.])
266fi
267
268
269# See if declarations like FINDEX_INFO_LEVELS are
270# missing from winbase.h. This is known to be
271# a problem with VC++ 5.2.
272
273AC_CACHE_CHECK(for FINDEX_INFO_LEVELS in winbase.h,
274    tcl_cv_findex_enums,
275AC_TRY_COMPILE([
276#define WIN32_LEAN_AND_MEAN
277#include <windows.h>
278#undef WIN32_LEAN_AND_MEAN
279],
280[
281  FINDEX_INFO_LEVELS i;
282  FINDEX_SEARCH_OPS j;
283],
284        tcl_cv_findex_enums=yes,
285        tcl_cv_findex_enums=no)
286)
287if test "$tcl_cv_findex_enums" = "no"; then
288    AC_DEFINE(HAVE_NO_FINDEX_ENUMS, 1,
289            [Defined when enums are missing from winbase.h])
290fi
291
292# See if MWMO_ALERTABLE is missing from winuser.h
293# This is known to be a problem with Mingw.
294
295AC_CACHE_CHECK(for MWMO_ALERTABLE in winuser.h,
296    tcl_cv_mwmo_alertable,
297AC_TRY_COMPILE([
298#define WIN32_LEAN_AND_MEAN
299#include <windows.h>
300#undef WIN32_LEAN_AND_MEAN
301],
302[
303  int i = MWMO_ALERTABLE;
304],
305        tcl_cv_mwmo_alertable=yes,
306        tcl_cv_mwmo_alertable=no)
307)
308if test "$tcl_cv_mwmo_alertable" = "no"; then
309    AC_DEFINE(HAVE_NO_MWMO_ALERTABLE, 1,
310            [Defined when MWMO_ALERTABLE is missing from winuser.h])
311fi
312
313#--------------------------------------------------------------------
314# Determines the correct binary file extension (.o, .obj, .exe etc.)
315#--------------------------------------------------------------------
316
317AC_OBJEXT
318AC_EXEEXT
319
320#--------------------------------------------------------------------
321# Check whether --enable-threads or --disable-threads was given.
322#--------------------------------------------------------------------
323
324SC_ENABLE_THREADS
325
326#------------------------------------------------------------------------
327# Embedded configuration information, encoding to use for the values, TIP #59
328#------------------------------------------------------------------------
329
330SC_TCL_CFG_ENCODING
331
332#--------------------------------------------------------------------
333# The statements below define a collection of symbols related to
334# building libtcl as a shared library instead of a static library.
335#--------------------------------------------------------------------
336
337SC_ENABLE_SHARED
338
339#--------------------------------------------------------------------
340# The statements below define a collection of compile flags.  This
341# macro depends on the value of SHARED_BUILD, and should be called
342# after SC_ENABLE_SHARED checks the configure switches.
343#--------------------------------------------------------------------
344
345SC_CONFIG_CFLAGS
346
347#--------------------------------------------------------------------
348# Set the default compiler switches based on the --enable-symbols
349# option.  This macro depends on C flags, and should be called
350# after SC_CONFIG_CFLAGS macro is called.
351#--------------------------------------------------------------------
352
353SC_ENABLE_SYMBOLS
354
355TCL_DBGX=${DBGX}
356
357#------------------------------------------------------------------------
358# tclConfig.sh refers to this by a different name
359#------------------------------------------------------------------------
360
361TCL_SHARED_BUILD=${SHARED_BUILD}
362
363#--------------------------------------------------------------------
364# Perform final evaluations of variables with possible substitutions.
365#--------------------------------------------------------------------
366
367TCL_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}"
368TCL_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
369TCL_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
370
371eval "TCL_SRC_DIR=\"`cd $srcdir/..; pwd`\""
372
373eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}"
374
375eval "TCL_LIB_FILE=${LIBPREFIX}tcl$VER${LIBSUFFIX}"
376
377eval "TCL_LIB_FLAG=\"-ltcl${VER}${LIBFLAGSUFFIX}\""
378eval "TCL_BUILD_LIB_SPEC=\"-L`pwd` ${TCL_LIB_FLAG}\""
379eval "TCL_LIB_SPEC=\"-L${libdir} ${TCL_LIB_FLAG}\""
380
381eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${VER}${LIBSUFFIX}\""
382eval "TCL_STUB_LIB_FLAG=\"-ltclstub${VER}${LIBFLAGSUFFIX}\""
383eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`pwd` ${TCL_STUB_LIB_FLAG}\""
384eval "TCL_STUB_LIB_SPEC=\"-L${libdir} ${TCL_STUB_LIB_FLAG}\""
385eval "TCL_BUILD_STUB_LIB_PATH=\"`pwd`/${TCL_STUB_LIB_FILE}\""
386eval "TCL_STUB_LIB_PATH=\"${libdir}/${TCL_STUB_LIB_FILE}\""
387
388# Install time header dir can be set via --includedir
389eval "TCL_INCLUDE_SPEC=\"-I${includedir}\""
390
391
392eval "DLLSUFFIX=${DLLSUFFIX}"
393eval "LIBPREFIX=${LIBPREFIX}"
394eval "LIBSUFFIX=${LIBSUFFIX}"
395eval "EXESUFFIX=${EXESUFFIX}"
396
397CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}
398CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}
399CFG_TCL_EXPORT_FILE_SUFFIX=${TCL_EXPORT_FILE_SUFFIX}
400
401#--------------------------------------------------------------------
402# Adjust the defines for how the resources are built depending
403# on symbols and static vs. shared.
404#--------------------------------------------------------------------
405
406if test ${SHARED_BUILD} = 0 ; then
407    if test "${DBGX}" = "g"; then
408        RC_DEFINES="${RC_DEFINE} STATIC_BUILD ${RC_DEFINE} DEBUG"
409    else
410        RC_DEFINES="${RC_DEFINE} STATIC_BUILD"
411    fi
412else
413    if test "${DBGX}" = "g"; then
414        RC_DEFINES="${RC_DEFINE} DEBUG"
415    else
416        RC_DEFINES=""
417    fi
418fi
419
420#--------------------------------------------------------------------
421#       The statements below define the symbol TCL_PACKAGE_PATH, which
422#       gives a list of directories that may contain packages.  The list
423#       consists of one directory for machine-dependent binaries and
424#       another for platform-independent scripts.
425#--------------------------------------------------------------------
426
427if test "$prefix/lib" != "$libdir"; then
428    TCL_PACKAGE_PATH="${libdir} ${prefix}/lib"
429else
430    TCL_PACKAGE_PATH="${prefix}/lib"
431fi
432
433AC_SUBST(TCL_VERSION)
434AC_SUBST(TCL_MAJOR_VERSION)
435AC_SUBST(TCL_MINOR_VERSION)
436AC_SUBST(TCL_PATCH_LEVEL)
437
438AC_SUBST(TCL_LIB_FILE)
439AC_SUBST(TCL_LIB_FLAG)
440# empty on win
441AC_SUBST(TCL_LIB_SPEC)
442AC_SUBST(TCL_STUB_LIB_FILE)
443AC_SUBST(TCL_STUB_LIB_FLAG)
444AC_SUBST(TCL_STUB_LIB_SPEC)
445AC_SUBST(TCL_STUB_LIB_PATH)
446AC_SUBST(TCL_INCLUDE_SPEC)
447AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
448AC_SUBST(TCL_BUILD_STUB_LIB_PATH)
449AC_SUBST(TCL_DLL_FILE)
450
451AC_SUBST(TCL_SRC_DIR)
452AC_SUBST(TCL_BIN_DIR)
453AC_SUBST(TCL_DBGX)
454AC_SUBST(CFG_TCL_SHARED_LIB_SUFFIX)
455AC_SUBST(CFG_TCL_UNSHARED_LIB_SUFFIX)
456AC_SUBST(CFG_TCL_EXPORT_FILE_SUFFIX)
457
458# win/tcl.m4 doesn't set (CFLAGS)
459AC_SUBST(CFLAGS_DEFAULT)
460AC_SUBST(EXTRA_CFLAGS)
461AC_SUBST(CYGPATH)
462AC_SUBST(DEPARG)
463AC_SUBST(CC_OBJNAME)
464AC_SUBST(CC_EXENAME)
465
466# win/tcl.m4 doesn't set (LDFLAGS)
467AC_SUBST(LDFLAGS_DEFAULT)
468AC_SUBST(LDFLAGS_DEBUG)
469AC_SUBST(LDFLAGS_OPTIMIZE)
470AC_SUBST(LDFLAGS_CONSOLE)
471AC_SUBST(LDFLAGS_WINDOW)
472AC_SUBST(AR)
473AC_SUBST(RANLIB)
474
475AC_SUBST(STLIB_LD)
476AC_SUBST(SHLIB_LD)
477AC_SUBST(SHLIB_LD_LIBS)
478AC_SUBST(SHLIB_CFLAGS)
479AC_SUBST(SHLIB_SUFFIX)
480AC_SUBST(TCL_SHARED_BUILD)
481
482AC_SUBST(LIBS)
483AC_SUBST(LIBS_GUI)
484AC_SUBST(DLLSUFFIX)
485AC_SUBST(LIBPREFIX)
486AC_SUBST(LIBSUFFIX)
487AC_SUBST(EXESUFFIX)
488AC_SUBST(LIBRARIES)
489AC_SUBST(MAKE_LIB)
490AC_SUBST(POST_MAKE_LIB)
491AC_SUBST(MAKE_DLL)
492AC_SUBST(MAKE_EXE)
493
494# empty on win, but needs sub'ing
495AC_SUBST(TCL_BUILD_LIB_SPEC)
496AC_SUBST(TCL_LD_SEARCH_FLAGS)
497AC_SUBST(TCL_NEEDS_EXP_FILE)
498AC_SUBST(TCL_BUILD_EXP_FILE)
499AC_SUBST(TCL_EXP_FILE)
500AC_SUBST(DL_LIBS)
501AC_SUBST(TCL_LIB_VERSIONS_OK)
502AC_SUBST(TCL_PACKAGE_PATH)
503
504# win only
505AC_SUBST(TCL_DDE_VERSION)
506AC_SUBST(TCL_DDE_MAJOR_VERSION)
507AC_SUBST(TCL_DDE_MINOR_VERSION)
508AC_SUBST(TCL_DDE_PATCH_LEVEL)
509AC_SUBST(TCL_REG_VERSION)
510AC_SUBST(TCL_REG_MAJOR_VERSION)
511AC_SUBST(TCL_REG_MINOR_VERSION)
512AC_SUBST(TCL_REG_PATCH_LEVEL)
513
514AC_SUBST(RC)
515AC_SUBST(RC_OUT)
516AC_SUBST(RC_TYPE)
517AC_SUBST(RC_INCLUDE)
518AC_SUBST(RC_DEFINE)
519AC_SUBST(RC_DEFINES)
520AC_SUBST(RES)
521
522AC_OUTPUT(Makefile tclConfig.sh tcl.hpj)
Note: See TracBrowser for help on using the repository browser.