Debian Codegraph @

win/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 AC_INIT([tcl],[8.6])
7 AC_CONFIG_SRCDIR([../generic/tcl.h])
8 AC_PREREQ([2.59])
9
10 # The following define is needed when building with Cygwin since newer
11 # versions of autoconf incorrectly set SHELL to /bin/bash instead of
12 # /bin/sh. The bash shell seems to suffer from some strange failures.
13 SHELL=/bin/sh
14
15 TCL_VERSION=8.6
16 TCL_MAJOR_VERSION=8
17 TCL_MINOR_VERSION=6
18 TCL_PATCH_LEVEL=".18"
19 VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION
20
21 TCL_DDE_VERSION=1.4
22 TCL_DDE_MAJOR_VERSION=1
23 TCL_DDE_MINOR_VERSION=4
24 DDEVER=$TCL_DDE_MAJOR_VERSION$TCL_DDE_MINOR_VERSION
25
26 TCL_REG_VERSION=1.3
27 TCL_REG_MAJOR_VERSION=1
28 TCL_REG_MINOR_VERSION=3
29 REGVER=$TCL_REG_MAJOR_VERSION$TCL_REG_MINOR_VERSION
30
31 PKG_CFG_ARGS=$@
32
33 #------------------------------------------------------------------------
34 # Empty slate for bundled packages, to avoid stale configuration
35 #------------------------------------------------------------------------
36 rm -Rf pkgs
37
38 #------------------------------------------------------------------------
39 # Handle the --prefix=... option
40 #------------------------------------------------------------------------
41
42 if test "${prefix}" = "NONE"; then
43 prefix=/usr/local
44 fi
45 if test "${exec_prefix}" = "NONE"; then
46 exec_prefix=$prefix
47 fi
48 # libdir must be a fully qualified path (not ${exec_prefix}/lib)
49 eval libdir="$libdir"
50
51 #------------------------------------------------------------------------
52 # Standard compiler checks
53 #------------------------------------------------------------------------
54
55 # If the user did not set CFLAGS, set it now to keep
56 # the AC_PROG_CC macro from adding "-g -O2".
57 if test "${CFLAGS+set}" != "set" ; then
58 CFLAGS=""
59 fi
60
61 AC_PROG_CC
62 AC_C_INLINE
63 AC_HEADER_STDC
64
65 AC_CHECK_TOOL(AR, ar)
66 AC_CHECK_TOOL(RANLIB, ranlib)
67 AC_CHECK_TOOL(RC, windres)
68
69 #--------------------------------------------------------------------
70 # Checks to see if the make program sets the $MAKE variable.
71 #--------------------------------------------------------------------
72
73 AC_PROG_MAKE_SET
74
75 #--------------------------------------------------------------------
76 # Determines the correct binary file extension (.o, .obj, .exe etc.)
77 #--------------------------------------------------------------------
78
79 AC_OBJEXT
80 AC_EXEEXT
81
82 #--------------------------------------------------------------------
83 # Check whether --enable-threads or --disable-threads was given.
84 #--------------------------------------------------------------------
85
86 SC_ENABLE_THREADS
87
88 #------------------------------------------------------------------------
89 # Embedded configuration information, encoding to use for the values, TIP #59
90 #------------------------------------------------------------------------
91
92 SC_TCL_CFG_ENCODING
93
94 #--------------------------------------------------------------------
95 # The statements below define a collection of symbols related to
96 # building libtcl as a shared library instead of a static library.
97 #--------------------------------------------------------------------
98
99 SC_ENABLE_SHARED
100
101 #--------------------------------------------------------------------
102 # Check whether --enable-time64bit was given.
103 #--------------------------------------------------------------------
104
105 AC_MSG_CHECKING([force of 64-bit time_t])
106 AC_ARG_ENABLE(time64bit,
107 AS_HELP_STRING([--enable-time64bit],
108 [force 64-bit time_t for 32-bit build (default: off)]),
109 [tcl_ok=$enableval], [tcl_ok=no])
110 AC_MSG_RESULT("$tcl_ok")
111 if test "$tcl_ok" = "yes"; then
112 CFLAGS="${CFLAGS} -D_USE_64BIT_TIME_T"
113 fi
114
115 #--------------------------------------------------------------------
116 # The statements below define a collection of compile flags. This
117 # macro depends on the value of SHARED_BUILD, and should be called
118 # after SC_ENABLE_SHARED checks the configure switches.
119 #--------------------------------------------------------------------
120
121 SC_CONFIG_CFLAGS
122
123 # Cross-compiling
124 case ${host_alias} in
125 *mingw32*)
126 TCL_EXE="tclsh"
127 ;;
128 *)
129 TCL_EXE="TCL_LIBRARY=\"\${LIBRARY_DIR}\"; export TCL_LIBRARY; ./\${TCLSH}"
130 ;;
131 esac
132
133 #------------------------------------------------------------------------
134 # Add stuff for zlib; note that this is mostly done in the makefile now
135 # as we just assume that the platform hasn't got a usable z.lib
136 #------------------------------------------------------------------------
137
138 AS_IF([test "${enable_shared+set}" = "set"], [
139 enableval="$enable_shared"
140 tcl_ok=$enableval
141 ], [
142 tcl_ok=yes
143 ])
144 zlib_lib_name=zdll.lib
145 AS_IF([test "$tcl_ok" = "yes"], [
146 AC_SUBST(ZLIB_DLL_FILE,[\${ZLIB_DLL_FILE}])
147 AS_IF([test "$do64bit" != "no"], [
148 AS_IF([test "$do64bit" = "arm64" -o "$do64bit" = "aarch64"], [
149 AS_IF([test "$GCC" = "yes"],[
150 AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64-arm/libz.dll.a])
151 zlib_lib_name=libz.dll.a
152 ], [
153 AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64-arm/zdll.lib])
154 ])
155 ], [
156 AS_IF([test "$GCC" = "yes"],[
157 AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64/libz.dll.a])
158 zlib_lib_name=libz.dll.a
159 ], [
160 AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64/zdll.lib])
161 ])
162 ])
163 ], [
164 AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win32/zdll.lib])
165 ])
166 ], [
167 AC_SUBST(ZLIB_OBJS,[\${ZLIB_OBJS}])
168 ])
169 AC_DEFINE(HAVE_ZLIB, 1, [Is there an installed zlib?])
170 AC_SUBST(TCL_ZLIB_LIB_NAME, $zlib_lib_name)
171
172 AC_CHECK_TYPE([intptr_t], [
173 AC_DEFINE([HAVE_INTPTR_T], 1, [Do we have the intptr_t type?])], [
174 AC_CACHE_CHECK([for pointer-size signed integer type], tcl_cv_intptr_t, [
175 for tcl_cv_intptr_t in "int" "long" "long long" none; do
176 if test "$tcl_cv_intptr_t" != none; then
177 AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT],
178 [[sizeof (void *) <= sizeof ($tcl_cv_intptr_t)]])],
179 [tcl_ok=yes], [tcl_ok=no])
180 test "$tcl_ok" = yes && break; fi
181 done])
182 if test "$tcl_cv_intptr_t" != none; then
183 AC_DEFINE_UNQUOTED([intptr_t], [$tcl_cv_intptr_t], [Signed integer
184 type wide enough to hold a pointer.])
185 fi
186 ])
187 AC_CHECK_TYPE([uintptr_t], [
188 AC_DEFINE([HAVE_UINTPTR_T], 1, [Do we have the uintptr_t type?])], [
189 AC_CACHE_CHECK([for pointer-size unsigned integer type], tcl_cv_uintptr_t, [
190 for tcl_cv_uintptr_t in "unsigned int" "unsigned long" "unsigned long long" \
191 none; do
192 if test "$tcl_cv_uintptr_t" != none; then
193 AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT],
194 [[sizeof (void *) <= sizeof ($tcl_cv_uintptr_t)]])],
195 [tcl_ok=yes], [tcl_ok=no])
196 test "$tcl_ok" = yes && break; fi
197 done])
198 if test "$tcl_cv_uintptr_t" != none; then
199 AC_DEFINE_UNQUOTED([uintptr_t], [$tcl_cv_uintptr_t], [Unsigned integer
200 type wide enough to hold a pointer.])
201 fi
202 ])
203
204 #--------------------------------------------------------------------
205 # Perform additinal compiler tests.
206 #--------------------------------------------------------------------
207
208 # See if declarations like FINDEX_INFO_LEVELS are
209 # missing from winbase.h. This is known to be
210 # a problem with VC++ 5.2.
211
212 AC_CACHE_CHECK(for FINDEX_INFO_LEVELS in winbase.h,
213 tcl_cv_findex_enums,
214 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
215 #define WIN32_LEAN_AND_MEAN
216 #include <windows.h>
217 #undef WIN32_LEAN_AND_MEAN
218 ]], [[
219 FINDEX_INFO_LEVELS i;
220 FINDEX_SEARCH_OPS j;
221 ]])],
222 [tcl_cv_findex_enums=yes],
223 [tcl_cv_findex_enums=no])
224 )
225 if test "$tcl_cv_findex_enums" = "no"; then
226 AC_DEFINE(HAVE_NO_FINDEX_ENUMS, 1,
227 [Defined when enums are missing from winbase.h])
228 fi
229
230 # See if the compiler supports intrinsics.
231
232 AC_CACHE_CHECK(for intrinsics support in compiler,
233 tcl_cv_intrinsics,
234 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
235 #define WIN32_LEAN_AND_MEAN
236 #include <windows.h>
237 #undef WIN32_LEAN_AND_MEAN
238 #include <intrin.h>
239 ]], [[
240 __cpuidex(0,0,0);
241 ]])],
242 [tcl_cv_intrinsics=yes],
243 [tcl_cv_intrinsics=no])
244 )
245 if test "$tcl_cv_intrinsics" = "yes"; then
246 AC_DEFINE(HAVE_INTRIN_H, 1,
247 [Defined when the compilers supports intrinsics])
248 fi
249
250 # See if the compiler supports cpuid header.
251
252 AC_CACHE_CHECK(for cpuid.h,
253 tcl_cv_cpuid_h,
254 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
255 #include <cpuid.h>
256 ]], [[
257 __get_cpuid(0, 0, 0, 0, 0);
258 ]])],
259 [tcl_cv_cpuid_h=yes],
260 [tcl_cv_cpuid_h=no])
261 )
262 if test "$tcl_cv_cpuid_h" = "yes"; then
263 AC_DEFINE(HAVE_CPUID_H, 1,
264 [Defined when cpuid.h exists])
265 fi
266
267 # See if the <wspiapi.h> header file is present
268
269 AC_CACHE_CHECK(for wspiapi.h,
270 tcl_cv_wspiapi_h,
271 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
272 #include <wspiapi.h>
273 ]], [[]])],
274 [tcl_cv_wspiapi_h=yes],
275 [tcl_cv_wspiapi_h=no])
276 )
277 if test "$tcl_cv_wspiapi_h" = "yes"; then
278 AC_DEFINE(HAVE_WSPIAPI_H, 1,
279 [Defined when wspiapi.h exists])
280 fi
281
282 # See if declarations like FINDEX_INFO_LEVELS are
283 # missing from winbase.h. This is known to be
284 # a problem with VC++ 5.2.
285
286 AC_CACHE_CHECK(for FINDEX_INFO_LEVELS in winbase.h,
287 tcl_cv_findex_enums,
288 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
289 #define WIN32_LEAN_AND_MEAN
290 #include <windows.h>
291 #undef WIN32_LEAN_AND_MEAN
292 ]], [[
293 FINDEX_INFO_LEVELS i;
294 FINDEX_SEARCH_OPS j;
295 ]])],
296 [tcl_cv_findex_enums=yes],
297 [tcl_cv_findex_enums=no])
298 )
299 if test "$tcl_cv_findex_enums" = "no"; then
300 AC_DEFINE(HAVE_NO_FINDEX_ENUMS, 1,
301 [Defined when enums are missing from winbase.h])
302 fi
303
304 #--------------------------------------------------------------------
305 # Set the default compiler switches based on the --enable-symbols
306 # option. This macro depends on C flags, and should be called
307 # after SC_CONFIG_CFLAGS macro is called.
308 #--------------------------------------------------------------------
309
310 SC_ENABLE_SYMBOLS
311
312 TCL_DBGX=${DBGX}
313
314 #--------------------------------------------------------------------
315 # Embed the manifest if we can determine how
316 #--------------------------------------------------------------------
317
318 SC_EMBED_MANIFEST
319
320 #------------------------------------------------------------------------
321 # tclConfig.sh refers to this by a different name
322 #------------------------------------------------------------------------
323
324 TCL_SHARED_BUILD=${SHARED_BUILD}
325
326 #--------------------------------------------------------------------
327 # Perform final evaluations of variables with possible substitutions.
328 #--------------------------------------------------------------------
329
330 eval "TCL_SRC_DIR=\"`cd $srcdir/..; $CYGPATH $(pwd)`\""
331
332 eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}"
333
334 eval "TCL_LIB_FLAG=\"-ltcl${VER}${LIBFLAGSUFFIX}\""
335 eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${VER}${LIBSUFFIX}\""
336 eval "TCL_STUB_LIB_FLAG=\"-ltclstub${VER}${LIBFLAGSUFFIX}\""
337 eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_STUB_LIB_FLAG}\""
338 eval "TCL_STUB_LIB_SPEC=\"-L${libdir} ${TCL_STUB_LIB_FLAG}\""
339 eval "TCL_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TCL_STUB_LIB_FILE}\""
340 eval "TCL_STUB_LIB_PATH=\"${libdir}/${TCL_STUB_LIB_FILE}\""
341
342 if test ${SHARED_BUILD} = 0 -o "$GCC" != "yes" ; then
343 eval "TCL_LIB_FLAG=\"${LIBPREFIX}tcl${VER}${LIBSUFFIX}\""
344 eval "TCL_LIB_FILE=\"${LIBPREFIX}tcl${VER}${LIBSUFFIX}\""
345 else
346 eval "TCL_LIB_FLAG=\"-ltcl${VER}${FLAGSUFFIX}\""
347 eval "TCL_LIB_FILE=\"${LIBPREFIX}tcl${VER}${DLLSUFFIX}.a\""
348 fi
349 eval "TCL_BUILD_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_LIB_FLAG}\""
350 eval "TCL_LIB_SPEC=\"-L${libdir} ${TCL_LIB_FLAG}\""
351
352 # Install time header dir can be set via --includedir
353 eval "TCL_INCLUDE_SPEC=\"-I${includedir}\""
354
355 eval "DLLSUFFIX=${DLLSUFFIX}"
356 eval "LIBPREFIX=${LIBPREFIX}"
357 eval "LIBSUFFIX=${LIBSUFFIX}"
358 eval "EXESUFFIX=${EXESUFFIX}"
359
360 TCL_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}"
361 TCL_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
362
363 CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}
364 CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}
365
366 #--------------------------------------------------------------------
367 # Adjust the defines for how the resources are built depending
368 # on symbols and static vs. shared.
369 #--------------------------------------------------------------------
370
371 if test ${SHARED_BUILD} = 0 ; then
372 if test "${DBGX}" = "g"; then
373 RC_DEFINES="${RC_DEFINE} STATIC_BUILD ${RC_DEFINE} DEBUG"
374 else
375 RC_DEFINES="${RC_DEFINE} STATIC_BUILD"
376 fi
377 else
378 if test "${DBGX}" = "g"; then
379 RC_DEFINES="${RC_DEFINE} DEBUG"
380 else
381 RC_DEFINES=""
382 fi
383 fi
384
385 #--------------------------------------------------------------------
386 # The statements below define the symbol TCL_PACKAGE_PATH, which
387 # gives a list of directories that may contain packages. The list
388 # consists of one directory for machine-dependent binaries and
389 # another for platform-independent scripts.
390 #--------------------------------------------------------------------
391
392 if test "$prefix/lib" != "$libdir"; then
393 TCL_PACKAGE_PATH="${libdir};${prefix}\\lib"
394 else
395 TCL_PACKAGE_PATH="${prefix}\\lib"
396 fi
397
398 # The tclsh.exe.manifest requires these
399 # TCL_WIN_VERSION is the 4 dotted pair Windows version format which needs
400 # the release level, and must account for interim release versioning
401 case "$TCL_PATCH_LEVEL" in
402 *a*) TCL_RELEASE_LEVEL=0 ;;
403 *b*) TCL_RELEASE_LEVEL=1 ;;
404 *) TCL_RELEASE_LEVEL=2 ;;
405 esac
406 TCL_WIN_VERSION="$TCL_VERSION.$TCL_RELEASE_LEVEL.`echo $TCL_PATCH_LEVEL | tr -d ab.`"
407 AC_SUBST(TCL_WIN_VERSION)
408 # X86|AMD64|ARM64|IA64 for manifest
409 AC_SUBST(MACHINE)
410
411 AC_SUBST(TCL_VERSION)
412 AC_SUBST(TCL_MAJOR_VERSION)
413 AC_SUBST(TCL_MINOR_VERSION)
414 AC_SUBST(TCL_PATCH_LEVEL)
415 AC_SUBST(PKG_CFG_ARGS)
416 AC_SUBST(TCL_EXE)
417
418 AC_SUBST(TCL_LIB_FILE)
419 AC_SUBST(TCL_LIB_FLAG)
420 AC_SUBST(TCL_STATIC_LIB_FILE)
421 AC_SUBST(TCL_STATIC_LIB_FLAG)
422 AC_SUBST(TCL_IMPORT_LIB_FILE)
423 AC_SUBST(TCL_IMPORT_LIB_FLAG)
424 # empty on win
425 AC_SUBST(TCL_LIBS)
426 AC_SUBST(TCL_LIB_SPEC)
427 AC_SUBST(TCL_STUB_LIB_FILE)
428 AC_SUBST(TCL_STUB_LIB_FLAG)
429 AC_SUBST(TCL_STUB_LIB_SPEC)
430 AC_SUBST(TCL_STUB_LIB_PATH)
431 AC_SUBST(TCL_INCLUDE_SPEC)
432 AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
433 AC_SUBST(TCL_BUILD_STUB_LIB_PATH)
434 AC_SUBST(TCL_DLL_FILE)
435
436 AC_SUBST(TCL_SRC_DIR)
437 AC_SUBST(TCL_BIN_DIR)
438 AC_SUBST(TCL_DBGX)
439 AC_SUBST(CFG_TCL_SHARED_LIB_SUFFIX)
440 AC_SUBST(CFG_TCL_UNSHARED_LIB_SUFFIX)
441
442 # win/tcl.m4 doesn't set (CFLAGS)
443 AC_SUBST(CFLAGS_DEFAULT)
444 AC_SUBST(EXTRA_CFLAGS)
445 AC_SUBST(CYGPATH)
446 AC_SUBST(DEPARG)
447 AC_SUBST(CC_OBJNAME)
448 AC_SUBST(CC_EXENAME)
449
450 # win/tcl.m4 doesn't set (LDFLAGS)
451 AC_SUBST(LDFLAGS_DEFAULT)
452 AC_SUBST(LDFLAGS_DEBUG)
453 AC_SUBST(LDFLAGS_OPTIMIZE)
454 AC_SUBST(LDFLAGS_CONSOLE)
455 AC_SUBST(LDFLAGS_WINDOW)
456 AC_SUBST(AR)
457 AC_SUBST(RANLIB)
458
459 AC_SUBST(STLIB_LD)
460 AC_SUBST(SHLIB_LD)
461 AC_SUBST(SHLIB_LD_LIBS)
462 AC_SUBST(SHLIB_CFLAGS)
463 AC_SUBST(SHLIB_SUFFIX)
464 AC_SUBST(TCL_SHARED_BUILD)
465
466 AC_SUBST(LIBS)
467 AC_SUBST(LIBS_GUI)
468 AC_SUBST(DLLSUFFIX)
469 AC_SUBST(LIBPREFIX)
470 AC_SUBST(LIBSUFFIX)
471 AC_SUBST(EXESUFFIX)
472 AC_SUBST(LIBRARIES)
473 AC_SUBST(MAKE_LIB)
474 AC_SUBST(MAKE_STUB_LIB)
475 AC_SUBST(POST_MAKE_LIB)
476 AC_SUBST(MAKE_DLL)
477 AC_SUBST(MAKE_EXE)
478
479 # empty on win, but needs sub'ing
480 AC_SUBST(TCL_BUILD_LIB_SPEC)
481 AC_SUBST(TCL_CC_SEARCH_FLAGS)
482 AC_SUBST(TCL_LD_SEARCH_FLAGS)
483 AC_SUBST(TCL_BUILD_EXP_FILE)
484 AC_SUBST(TCL_EXP_FILE)
485 AC_SUBST(DL_LIBS)
486 AC_SUBST(TCL_PACKAGE_PATH)
487
488 # win only
489 AC_SUBST(TCL_DDE_VERSION)
490 AC_SUBST(TCL_DDE_MAJOR_VERSION)
491 AC_SUBST(TCL_DDE_MINOR_VERSION)
492 AC_SUBST(TCL_REG_VERSION)
493 AC_SUBST(TCL_REG_MAJOR_VERSION)
494 AC_SUBST(TCL_REG_MINOR_VERSION)
495
496 AC_SUBST(RC)
497 AC_SUBST(RC_OUT)
498 AC_SUBST(RC_TYPE)
499 AC_SUBST(RC_INCLUDE)
500 AC_SUBST(RC_DEFINE)
501 AC_SUBST(RC_DEFINES)
502 AC_SUBST(RES)
503
504 AC_CONFIG_FILES([Makefile tclConfig.sh tcl.hpj tclsh.exe.manifest tcl.pc:../unix/tcl.pc.in])
505 AC_OUTPUT
506
507 dnl Local Variables:
508 dnl mode: autoconf
509 dnl End: