Debian Codegraph @

pTk/mTk/tclWin/configure.in

raw
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.68.2.4 2003/10/02 23:07:35 dgp Exp $
7
8 AC_INIT(../generic/tcl.h)
9 AC_PREREQ(2.13)
10
11 TCL_VERSION=8.4
12 TCL_MAJOR_VERSION=8
13 TCL_MINOR_VERSION=4
14 TCL_PATCH_LEVEL=".5"
15 VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION
16
17 TCL_DDE_VERSION=1.2
18 TCL_DDE_MAJOR_VERSION=1
19 TCL_DDE_MINOR_VERSION=2
20 DDEVER=$TCL_DDE_MAJOR_VERSION$TCL_DDE_MINOR_VERSION
21
22 TCL_REG_VERSION=1.1
23 TCL_REG_MAJOR_VERSION=1
24 TCL_REG_MINOR_VERSION=1
25 REGVER=$TCL_REG_MAJOR_VERSION$TCL_REG_MINOR_VERSION
26
27 #------------------------------------------------------------------------
28 # Handle the --prefix=... option
29 #------------------------------------------------------------------------
30
31 if test "${prefix}" = "NONE"; then
32 prefix=/usr/local
33 fi
34 if test "${exec_prefix}" = "NONE"; then
35 exec_prefix=$prefix
36 fi
37 # libdir must be a fully qualified path (not ${exec_prefix}/lib)
38 eval libdir="$libdir"
39
40 #------------------------------------------------------------------------
41 # Standard compiler checks
42 #------------------------------------------------------------------------
43
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
47 CFLAGS=""
48 fi
49
50 AC_PROG_CC
51
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)
61
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)
66
67 if test "${AR}" = "" ; then
68 AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.])
69 fi
70 if test "${RANLIB}" = "" ; then
71 AC_MSG_ERROR([Required archive index tool 'ranlib' not found on PATH.])
72 fi
73 if test "${RC}" = "" ; then
74 AC_MSG_ERROR([Required resource tool 'windres' not found on PATH.])
75 fi
76 fi
77
78 #--------------------------------------------------------------------
79 # Checks to see if the make progeam sets the $MAKE variable.
80 #--------------------------------------------------------------------
81
82 AC_PROG_MAKE_SET
83
84 #--------------------------------------------------------------------
85 # Perform additinal compiler tests.
86 #--------------------------------------------------------------------
87
88 AC_CYGWIN
89
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.])
94 fi
95
96
97 AC_CACHE_CHECK(for SEH support in compiler,
98 tcl_cv_seh,
99 AC_TRY_RUN([
100 #define WIN32_LEAN_AND_MEAN
101 #include <windows.h>
102 #undef WIN32_LEAN_AND_MEAN
103
104 int main(int argc, char** argv) {
105 int a, b = 0;
106 __try {
107 a = 666 / b;
108 }
109 __except (EXCEPTION_EXECUTE_HANDLER) {
110 return 0;
111 }
112 return 1;
113 }
114 ],
115 tcl_cv_seh=yes,
116 tcl_cv_seh=no,
117 tcl_cv_seh=no)
118 )
119 if test "$tcl_cv_seh" = "no" ; then
120 AC_DEFINE(HAVE_NO_SEH, 1,
121 [Defined when mingw does not support SEH])
122 fi
123
124 #
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.
129 #
130 AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files,
131 tcl_cv_eh_disposition,
132 AC_TRY_COMPILE([
133 #define WIN32_LEAN_AND_MEAN
134 #include <windows.h>
135 #undef WIN32_LEAN_AND_MEAN
136 ],
137 [
138 EXCEPTION_DISPOSITION x;
139 ],
140 tcl_cv_eh_disposition=yes,
141 tcl_cv_eh_disposition=no)
142 )
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])
146 fi
147
148
149 # Check to see if the winsock2.h include file provided contains
150 # typedefs like LPFN_ACCEPT and friends.
151 #
152 AC_CACHE_CHECK(for LPFN_ACCEPT support in winsock2.h,
153 tcl_cv_lpfn_decls,
154 AC_TRY_COMPILE([
155 #define WIN32_LEAN_AND_MEAN
156 #include <windows.h>
157 #undef WIN32_LEAN_AND_MEAN
158 #include <winsock2.h>
159 ],
160 [
161 LPFN_ACCEPT accept;
162 ],
163 tcl_cv_lpfn_decls=yes,
164 tcl_cv_lpfn_decls=no)
165 )
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.])
169 fi
170
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.
174
175 AC_CACHE_CHECK(for winnt.h that ignores VOID define,
176 tcl_cv_winnt_ignore_void,
177 AC_TRY_COMPILE([
178 #define VOID void
179 #define WIN32_LEAN_AND_MEAN
180 #include <windows.h>
181 #undef WIN32_LEAN_AND_MEAN
182 ],
183 [
184 CHAR c;
185 SHORT s;
186 LONG l;
187 ],
188 tcl_cv_winnt_ignore_void=yes,
189 tcl_cv_winnt_ignore_void=no)
190 )
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])
194 fi
195
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.
205
206 AC_CACHE_CHECK(for alloca declaration in malloc.h,
207 tcl_cv_malloc_decl_alloca,
208 AC_TRY_COMPILE([
209 #include <malloc.h>
210 ],
211 [
212 size_t arg = 0;
213 void* ptr;
214 ptr = alloca;
215 ptr = alloca(arg);
216 ],
217 tcl_cv_malloc_decl_alloca=yes,
218 tcl_cv_malloc_decl_alloca=no)
219 )
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.])
224 fi
225
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.
229
230 AC_CACHE_CHECK(for cast to union support,
231 tcl_cv_cast_to_union,
232 AC_TRY_COMPILE([],
233 [
234 union foo { int i; double d; };
235 union foo f = (union foo) (int) 0;
236 ],
237 tcl_cv_cast_to_union=yes,
238 tcl_cv_cast_to_union=no)
239 )
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.])
243 fi
244
245
246 #--------------------------------------------------------------------
247 # Determines the correct binary file extension (.o, .obj, .exe etc.)
248 #--------------------------------------------------------------------
249
250 AC_OBJEXT
251 AC_EXEEXT
252
253 #--------------------------------------------------------------------
254 # Check whether --enable-threads or --disable-threads was given.
255 #--------------------------------------------------------------------
256
257 SC_ENABLE_THREADS
258
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 #--------------------------------------------------------------------
263
264 SC_ENABLE_SHARED
265
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 #--------------------------------------------------------------------
271
272 SC_CONFIG_CFLAGS
273
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 #--------------------------------------------------------------------
279
280 SC_ENABLE_SYMBOLS
281
282 TCL_DBGX=${DBGX}
283
284 #--------------------------------------------------------------------
285 # man2tcl needs this so that it can use errno.h
286 #--------------------------------------------------------------------
287
288 AC_CHECK_HEADER(errno.h, , MAN2TCLFLAGS="-DNO_ERRNO_H")
289 AC_SUBST(MAN2TCLFLAGS)
290
291 #------------------------------------------------------------------------
292 # tclConfig.sh refers to this by a different name
293 #------------------------------------------------------------------------
294
295 TCL_SHARED_BUILD=${SHARED_BUILD}
296
297 #--------------------------------------------------------------------
298 # Perform final evaluations of variables with possible substitutions.
299 #--------------------------------------------------------------------
300
301 TCL_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}"
302 TCL_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
303 TCL_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
304
305 eval "TCL_SRC_DIR=\"`cd $srcdir/..; pwd`\""
306
307 eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}"
308
309 eval "TCL_LIB_FILE=${LIBPREFIX}tcl$VER${LIBSUFFIX}"
310 # FIMXE: These variables decls are missing
311 #TCL_LIB_FLAG
312 #TCL_BUILD_LIB_SPEC
313 #TCL_LIB_SPEC
314
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}\""
321
322 # Install time header dir can be set via --includedir
323 eval "TCL_INCLUDE_SPEC=\"-I${includedir}\""
324
325
326 eval "DLLSUFFIX=${DLLSUFFIX}"
327 eval "LIBPREFIX=${LIBPREFIX}"
328 eval "LIBSUFFIX=${LIBSUFFIX}"
329 eval "EXESUFFIX=${EXESUFFIX}"
330
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}
334
335 #--------------------------------------------------------------------
336 # Adjust the defines for how the resources are built depending
337 # on symbols and static vs. shared.
338 #--------------------------------------------------------------------
339
340 if test ${SHARED_BUILD} = 0 ; then
341 if test "${DBGX}" = "g"; then
342 RC_DEFINES="${RC_DEFINE} STATIC_BUILD ${RC_DEFINE} DEBUG"
343 else
344 RC_DEFINES="${RC_DEFINE} STATIC_BUILD"
345 fi
346 else
347 if test "${DBGX}" = "g"; then
348 RC_DEFINES="${RC_DEFINE} DEBUG"
349 else
350 RC_DEFINES=""
351 fi
352 fi
353
354
355 AC_SUBST(TCL_VERSION)
356 AC_SUBST(TCL_MAJOR_VERSION)
357 AC_SUBST(TCL_MINOR_VERSION)
358 AC_SUBST(TCL_PATCH_LEVEL)
359
360 AC_SUBST(TCL_LIB_FILE)
361 AC_SUBST(TCL_LIB_FLAG)
362 # empty on win
363 AC_SUBST(TCL_LIB_SPEC)
364 AC_SUBST(TCL_STUB_LIB_FILE)
365 AC_SUBST(TCL_STUB_LIB_FLAG)
366 AC_SUBST(TCL_STUB_LIB_SPEC)
367 AC_SUBST(TCL_STUB_LIB_PATH)
368 AC_SUBST(TCL_INCLUDE_SPEC)
369 AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
370 AC_SUBST(TCL_BUILD_STUB_LIB_PATH)
371 AC_SUBST(TCL_DLL_FILE)
372
373 AC_SUBST(TCL_SRC_DIR)
374 AC_SUBST(TCL_BIN_DIR)
375 AC_SUBST(TCL_DBGX)
376 AC_SUBST(CFG_TCL_SHARED_LIB_SUFFIX)
377 AC_SUBST(CFG_TCL_UNSHARED_LIB_SUFFIX)
378 AC_SUBST(CFG_TCL_EXPORT_FILE_SUFFIX)
379
380 # win/tcl.m4 doesn't set (CFLAGS)
381 AC_SUBST(CFLAGS_DEFAULT)
382 AC_SUBST(EXTRA_CFLAGS)
383 AC_SUBST(CYGPATH)
384 AC_SUBST(DEPARG)
385 AC_SUBST(CC_OBJNAME)
386 AC_SUBST(CC_EXENAME)
387
388 # win/tcl.m4 doesn't set (LDFLAGS)
389 AC_SUBST(LDFLAGS_DEFAULT)
390 AC_SUBST(LDFLAGS_DEBUG)
391 AC_SUBST(LDFLAGS_OPTIMIZE)
392 AC_SUBST(LDFLAGS_CONSOLE)
393 AC_SUBST(LDFLAGS_WINDOW)
394 AC_SUBST(AR)
395 AC_SUBST(RANLIB)
396
397 AC_SUBST(STLIB_LD)
398 AC_SUBST(SHLIB_LD)
399 AC_SUBST(SHLIB_LD_LIBS)
400 AC_SUBST(SHLIB_CFLAGS)
401 AC_SUBST(SHLIB_SUFFIX)
402 AC_SUBST(TCL_SHARED_BUILD)
403
404 AC_SUBST(LIBS)
405 AC_SUBST(LIBS_GUI)
406 AC_SUBST(DLLSUFFIX)
407 AC_SUBST(LIBPREFIX)
408 AC_SUBST(LIBSUFFIX)
409 AC_SUBST(EXESUFFIX)
410 AC_SUBST(LIBRARIES)
411 AC_SUBST(MAKE_LIB)
412 AC_SUBST(POST_MAKE_LIB)
413 AC_SUBST(MAKE_DLL)
414 AC_SUBST(MAKE_EXE)
415
416 # empty on win, but needs sub'ing
417 AC_SUBST(TCL_BUILD_LIB_SPEC)
418 AC_SUBST(TCL_LD_SEARCH_FLAGS)
419 AC_SUBST(TCL_NEEDS_EXP_FILE)
420 AC_SUBST(TCL_BUILD_EXP_FILE)
421 AC_SUBST(TCL_EXP_FILE)
422 AC_SUBST(DL_LIBS)
423 AC_SUBST(LIBOBJS)
424 AC_SUBST(TCL_LIB_VERSIONS_OK)
425 AC_SUBST(TCL_PACKAGE_PATH)
426
427 # win only
428 AC_SUBST(TCL_DDE_VERSION)
429 AC_SUBST(TCL_DDE_MAJOR_VERSION)
430 AC_SUBST(TCL_DDE_MINOR_VERSION)
431 AC_SUBST(TCL_REG_VERSION)
432 AC_SUBST(TCL_REG_MAJOR_VERSION)
433 AC_SUBST(TCL_REG_MINOR_VERSION)
434
435 AC_SUBST(RC)
436 AC_SUBST(RC_OUT)
437 AC_SUBST(RC_TYPE)
438 AC_SUBST(RC_INCLUDE)
439 AC_SUBST(RC_DEFINE)
440 AC_SUBST(RC_DEFINES)
441 AC_SUBST(RES)
442
443 AC_OUTPUT(Makefile tclConfig.sh tcl.hpj)