3
# This file provides a set of autoconf macros to help TEA-enable
6
# Copyright (c) 1999-2000 Ajuba Solutions.
7
# Copyright (c) 2002-2003 ActiveState Corporation.
9
# See the file "license.terms" for information on usage and redistribution
10
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12
# RCS: @(#) $Id: tcl.m4,v 1.1 2004/01/25 23:42:33 davidw Exp $
16
#------------------------------------------------------------------------
17
# TEA_PATH_TCLCONFIG --
19
# Locate the tclConfig.sh file and perform a sanity check on
20
# the Tcl compile flags
27
# Adds the following arguments to configure:
30
# Defines the following vars:
31
# TCL_BIN_DIR Full path to the directory containing
32
# the tclConfig.sh file
33
#------------------------------------------------------------------------
35
AC_DEFUN(TEA_PATH_TCLCONFIG, [
36
dnl Make sure we are initialized
37
AC_REQUIRE([TEA_INIT])
39
# Ok, lets find the tcl configuration
40
# First, look for one uninstalled.
41
# the alternative search directory is invoked by --with-tcl
44
if test x"${no_tcl}" = x ; then
45
# we reset no_tcl in case something fails here
47
AC_ARG_WITH(tcl, [ --with-tcl directory containing tcl configuration (tclConfig.sh)], with_tclconfig=${withval})
48
AC_MSG_CHECKING([for Tcl configuration])
49
AC_CACHE_VAL(ac_cv_c_tclconfig,[
51
# First check to see if --with-tcl was specified.
52
if test x"${with_tclconfig}" != x ; then
53
if test -f "${with_tclconfig}/tclConfig.sh" ; then
54
ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
56
AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
60
# then check for a private Tcl installation
61
if test x"${ac_cv_c_tclconfig}" = x ; then
64
`ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
66
`ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
68
`ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
69
if test -f "$i/unix/tclConfig.sh" ; then
70
ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
76
# check in a few common install locations
77
if test x"${ac_cv_c_tclconfig}" = x ; then
78
for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \
79
`ls -d ${prefix}/lib 2>/dev/null` \
80
`ls -d /usr/local/lib 2>/dev/null` \
81
`ls -d /usr/contrib/lib 2>/dev/null` \
82
`ls -d /usr/lib 2>/dev/null` \
84
if test -f "$i/tclConfig.sh" ; then
85
ac_cv_c_tclconfig=`(cd $i; pwd)`
91
# check in a few other private locations
92
if test x"${ac_cv_c_tclconfig}" = x ; then
95
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
96
if test -f "$i/unix/tclConfig.sh" ; then
97
ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
104
if test x"${ac_cv_c_tclconfig}" = x ; then
105
TCL_BIN_DIR="# no Tcl configs found"
106
AC_MSG_WARN("Cannot find Tcl configuration definitions")
110
TCL_BIN_DIR=${ac_cv_c_tclconfig}
111
AC_MSG_RESULT([found $TCL_BIN_DIR/tclConfig.sh])
116
#------------------------------------------------------------------------
117
# TEA_PATH_TKCONFIG --
119
# Locate the tkConfig.sh file
126
# Adds the following arguments to configure:
129
# Defines the following vars:
130
# TK_BIN_DIR Full path to the directory containing
131
# the tkConfig.sh file
132
#------------------------------------------------------------------------
134
AC_DEFUN(TEA_PATH_TKCONFIG, [
136
# Ok, lets find the tk configuration
137
# First, look for one uninstalled.
138
# the alternative search directory is invoked by --with-tk
141
if test x"${no_tk}" = x ; then
142
# we reset no_tk in case something fails here
144
AC_ARG_WITH(tk, [ --with-tk directory containing tk configuration (tkConfig.sh)], with_tkconfig=${withval})
145
AC_MSG_CHECKING([for Tk configuration])
146
AC_CACHE_VAL(ac_cv_c_tkconfig,[
148
# First check to see if --with-tkconfig was specified.
149
if test x"${with_tkconfig}" != x ; then
150
if test -f "${with_tkconfig}/tkConfig.sh" ; then
151
ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
153
AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
157
# then check for a private Tk library
158
if test x"${ac_cv_c_tkconfig}" = x ; then
161
`ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \
163
`ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \
165
`ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
166
if test -f "$i/unix/tkConfig.sh" ; then
167
ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
172
# check in a few common install locations
173
if test x"${ac_cv_c_tkconfig}" = x ; then
174
for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \
175
`ls -d ${prefix}/lib 2>/dev/null` \
176
`ls -d /usr/local/lib 2>/dev/null` \
177
`ls -d /usr/contrib/lib 2>/dev/null` \
178
`ls -d /usr/lib 2>/dev/null` \
180
if test -f "$i/tkConfig.sh" ; then
181
ac_cv_c_tkconfig=`(cd $i; pwd)`
186
# check in a few other private locations
187
if test x"${ac_cv_c_tkconfig}" = x ; then
190
`ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
191
if test -f "$i/unix/tkConfig.sh" ; then
192
ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
198
if test x"${ac_cv_c_tkconfig}" = x ; then
199
TK_BIN_DIR="# no Tk configs found"
200
AC_MSG_WARN("Cannot find Tk configuration definitions")
204
TK_BIN_DIR=${ac_cv_c_tkconfig}
205
AC_MSG_RESULT([found $TK_BIN_DIR/tkConfig.sh])
211
#------------------------------------------------------------------------
212
# TEA_LOAD_TCLCONFIG --
214
# Load the tclConfig.sh file
218
# Requires the following vars to be set:
223
# Subst the following vars:
228
#------------------------------------------------------------------------
230
AC_DEFUN(TEA_LOAD_TCLCONFIG, [
231
AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh])
233
if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
234
AC_MSG_RESULT([loading])
235
. $TCL_BIN_DIR/tclConfig.sh
237
AC_MSG_RESULT([file not found])
241
# If the TCL_BIN_DIR is the build directory (not the install directory),
242
# then set the common variable name to the value of the build variables.
243
# For example, the variable TCL_LIB_SPEC will be set to the value
244
# of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
245
# instead of TCL_BUILD_LIB_SPEC since it will work with both an
246
# installed and uninstalled version of Tcl.
249
if test -f $TCL_BIN_DIR/Makefile ; then
250
TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
251
TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
252
TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
256
# eval is required to do the TCL_DBGX substitution
259
eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
260
eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
261
eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
263
eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
264
eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
265
eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
267
AC_SUBST(TCL_VERSION)
268
AC_SUBST(TCL_BIN_DIR)
269
AC_SUBST(TCL_SRC_DIR)
271
AC_SUBST(TCL_LIB_FILE)
272
AC_SUBST(TCL_LIB_FLAG)
273
AC_SUBST(TCL_LIB_SPEC)
275
AC_SUBST(TCL_STUB_LIB_FILE)
276
AC_SUBST(TCL_STUB_LIB_FLAG)
277
AC_SUBST(TCL_STUB_LIB_SPEC)
282
AC_SUBST(TCL_EXTRA_CFLAGS)
283
AC_SUBST(TCL_LD_FLAGS)
284
AC_SUBST(TCL_SHLIB_LD_LIBS)
285
#AC_SUBST(TCL_BUILD_LIB_SPEC)
286
#AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
289
#------------------------------------------------------------------------
290
# TEA_LOAD_TKCONFIG --
292
# Load the tkConfig.sh file
296
# Requires the following vars to be set:
301
# Sets the following vars that should be in tkConfig.sh:
303
#------------------------------------------------------------------------
305
AC_DEFUN(TEA_LOAD_TKCONFIG, [
306
AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh])
308
if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
309
AC_MSG_RESULT([loading])
310
. $TK_BIN_DIR/tkConfig.sh
312
AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
316
# If the TK_BIN_DIR is the build directory (not the install directory),
317
# then set the common variable name to the value of the build variables.
318
# For example, the variable TK_LIB_SPEC will be set to the value
319
# of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
320
# instead of TK_BUILD_LIB_SPEC since it will work with both an
321
# installed and uninstalled version of Tcl.
324
if test -f $TK_BIN_DIR/Makefile ; then
325
TK_LIB_SPEC=${TK_BUILD_LIB_SPEC}
326
TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC}
327
TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH}
331
# eval is required to do the TK_DBGX substitution
334
eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
335
eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
336
eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
338
eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
339
eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
340
eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
346
AC_SUBST(TK_LIB_FILE)
347
AC_SUBST(TK_LIB_FLAG)
348
AC_SUBST(TK_LIB_SPEC)
350
AC_SUBST(TK_STUB_LIB_FILE)
351
AC_SUBST(TK_STUB_LIB_FLAG)
352
AC_SUBST(TK_STUB_LIB_SPEC)
355
AC_SUBST(TK_XINCLUDES)
358
#------------------------------------------------------------------------
359
# TEA_ENABLE_SHARED --
361
# Allows the building of shared libraries
368
# Adds the following arguments to configure:
369
# --enable-shared=yes|no
371
# Defines the following vars:
372
# STATIC_BUILD Used for building import/export libraries
375
# Sets the following vars:
376
# SHARED_BUILD Value of 1 or 0
377
#------------------------------------------------------------------------
379
AC_DEFUN(TEA_ENABLE_SHARED, [
380
AC_MSG_CHECKING([how to build libraries])
381
AC_ARG_ENABLE(shared,
382
[ --enable-shared build and link with shared libraries [--enable-shared]],
383
[tcl_ok=$enableval], [tcl_ok=yes])
385
if test "${enable_shared+set}" = set; then
386
enableval="$enable_shared"
392
if test "$tcl_ok" = "yes" ; then
393
AC_MSG_RESULT([shared])
396
AC_MSG_RESULT([static])
398
AC_DEFINE(STATIC_BUILD)
400
AC_SUBST(SHARED_BUILD)
403
#------------------------------------------------------------------------
404
# TEA_ENABLE_THREADS --
406
# Specify if thread support should be enabled. If "yes" is
407
# specified as an arg (optional), threads are enabled by default.
414
# Adds the following arguments to configure:
417
# Sets the following vars:
418
# THREADS_LIBS Thread library(s)
420
# Defines the following vars:
424
#------------------------------------------------------------------------
426
AC_DEFUN(TEA_ENABLE_THREADS, [
427
AC_ARG_ENABLE(threads, [ --enable-threads build with threads],
428
[tcl_ok=$enableval], [tcl_ok=$1])
430
if test "$tcl_ok" = "yes"; then
433
if test "${TEA_PLATFORM}" != "windows" ; then
434
# We are always OK on Windows, so check what this platform wants.
435
AC_DEFINE(USE_THREAD_ALLOC)
436
AC_DEFINE(_REENTRANT)
437
AC_DEFINE(_THREAD_SAFE)
438
AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
439
if test "$tcl_ok" = "no"; then
440
# Check a little harder for __pthread_mutex_init in the
441
# same library, as some systems hide it there until
442
# pthread.h is defined. We could alternatively do an
443
# AC_TRY_COMPILE with pthread.h, but that will work with
444
# libpthread really doesn't exist, like AIX 4.2.
446
AC_CHECK_LIB(pthread, __pthread_mutex_init,
447
tcl_ok=yes, tcl_ok=no)
450
if test "$tcl_ok" = "yes"; then
451
# The space is needed
452
THREADS_LIBS=" -lpthread"
454
AC_CHECK_LIB(pthreads, pthread_mutex_init,
455
tcl_ok=yes, tcl_ok=no)
456
if test "$tcl_ok" = "yes"; then
457
# The space is needed
458
THREADS_LIBS=" -lpthreads"
460
AC_CHECK_LIB(c, pthread_mutex_init,
461
tcl_ok=yes, tcl_ok=no)
462
if test "$tcl_ok" = "no"; then
463
AC_CHECK_LIB(c_r, pthread_mutex_init,
464
tcl_ok=yes, tcl_ok=no)
465
if test "$tcl_ok" = "yes"; then
466
# The space is needed
467
THREADS_LIBS=" -pthread"
470
AC_MSG_WARN("Don t know how to find pthread lib on your system - thread support disabled")
476
# Does the pthread-implementation provide
477
# 'pthread_attr_setstacksize' ?
480
LIBS="$LIBS $THREADS_LIBS"
481
AC_CHECK_FUNCS(pthread_attr_setstacksize)
483
AC_CHECK_FUNCS(readdir_r)
488
# Do checking message here to not mess up interleaved configure output
489
AC_MSG_CHECKING([for building with threads])
490
if test "${TCL_THREADS}" = "1"; then
491
AC_DEFINE(TCL_THREADS)
494
AC_MSG_RESULT([no (default)])
496
# TCL_THREADS sanity checking. See if our request for building with
497
# threads is the same as the way Tcl was built. If not, warn the user.
500
if test "${TCL_THREADS}" = "0"; then
502
Building ${PACKAGE_NAME} without threads enabled, but building against a Tcl
503
that IS thread-enabled.])
507
if test "${TCL_THREADS}" = "1"; then
509
--enable-threads requested, but attempting building against a Tcl
510
that is NOT thread-enabled.])
514
AC_SUBST(TCL_THREADS)
517
#------------------------------------------------------------------------
518
# TEA_ENABLE_SYMBOLS --
520
# Specify if debugging symbols should be used
521
# Memory (TCL_MEM_DEBUG) debugging can also be enabled.
526
# Requires the following vars to be set:
534
# Adds the following arguments to configure:
537
# Defines the following vars:
538
# CFLAGS_DEFAULT Sets to CFLAGS_DEBUG if true
539
# Sets to CFLAGS_OPTIMIZE if false
540
# LDFLAGS_DEFAULT Sets to LDFLAGS_DEBUG if true
541
# Sets to LDFLAGS_OPTIMIZE if false
542
# DBGX Debug library extension
544
#------------------------------------------------------------------------
546
AC_DEFUN(TEA_ENABLE_SYMBOLS, [
547
dnl Make sure we are initialized
548
AC_REQUIRE([TEA_CONFIG_CFLAGS])
550
if test "${TEA_PLATFORM}" = "windows" ; then
556
AC_MSG_CHECKING([for build with symbols])
557
AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no])
558
if test "$tcl_ok" = "no"; then
559
CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}"
560
LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
565
CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
566
LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
569
if test "$tcl_ok" = "yes"; then
570
AC_MSG_RESULT([yes (standard debugging)])
573
if test "${TEA_PLATFORM}" != "windows" ; then
574
LDFLAGS_DEFAULT="${LDFLAGS}"
578
AC_SUBST(CFLAGS_DEFAULT)
579
AC_SUBST(LDFLAGS_DEFAULT)
581
if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
582
AC_DEFINE(TCL_MEM_DEBUG)
585
if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
586
if test "$tcl_ok" = "all"; then
587
AC_MSG_RESULT([enabled symbols mem debugging])
589
AC_MSG_RESULT([enabled $tcl_ok debugging])
594
#------------------------------------------------------------------------
595
# TEA_ENABLE_LANGINFO --
597
# Allows use of modern nl_langinfo check for better l10n.
598
# This is only relevant for Unix.
605
# Adds the following arguments to configure:
606
# --enable-langinfo=yes|no (default is yes)
608
# Defines the following vars:
609
# HAVE_LANGINFO Triggers use of nl_langinfo if defined.
611
#------------------------------------------------------------------------
613
AC_DEFUN(TEA_ENABLE_LANGINFO, [
614
AC_ARG_ENABLE(langinfo,
615
[ --enable-langinfo use nl_langinfo if possible to determine
616
encoding at startup, otherwise use old heuristic],
617
[langinfo_ok=$enableval], [langinfo_ok=yes])
620
if test "$langinfo_ok" = "yes"; then
621
if test "$langinfo_ok" = "yes"; then
622
AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no])
625
AC_MSG_CHECKING([whether to use nl_langinfo])
626
if test "$langinfo_ok" = "yes"; then
627
AC_TRY_COMPILE([#include <langinfo.h>],
628
[nl_langinfo(CODESET);],[langinfo_ok=yes],[langinfo_ok=no])
629
if test "$langinfo_ok" = "no"; then
630
langinfo_ok="no (could not compile with nl_langinfo)";
632
if test "$langinfo_ok" = "yes"; then
633
AC_DEFINE(HAVE_LANGINFO)
636
AC_MSG_RESULT([$langinfo_ok])
639
#--------------------------------------------------------------------
642
# Try to determine the proper flags to pass to the compiler
643
# for building shared libraries and other such nonsense.
650
# Defines the following vars:
652
# DL_OBJS - Name of the object file that implements dynamic
653
# loading for Tcl on this system.
654
# DL_LIBS - Library file(s) to include in tclsh and other base
655
# applications in order for the "load" command to work.
656
# LDFLAGS - Flags to pass to the compiler when linking object
657
# files into an executable application binary such
659
# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib",
660
# that tell the run-time dynamic linker where to look
661
# for shared libraries such as libtcl.so. Depends on
662
# the variable LIB_RUNTIME_DIR in the Makefile.
663
# SHLIB_CFLAGS - Flags to pass to cc when compiling the components
664
# of a shared library (may request position-independent
665
# code, among other things).
666
# SHLIB_LD - Base command to use for combining object files
667
# into a shared library.
668
# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
669
# creating shared libraries. This symbol typically
670
# goes at the end of the "ld" commands that build
671
# shared libraries. The value of the symbol is
672
# "${LIBS}" if all of the dependent libraries should
673
# be specified when creating a shared library. If
674
# dependent libraries should not be specified (as on
675
# SunOS 4.x, where they cause the link to fail, or in
676
# general if Tcl and Tk aren't themselves shared
677
# libraries), then this symbol has an empty string
679
# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable
680
# extensions. An empty string means we don't know how
681
# to use shared libraries on this platform.
682
# TCL_LIB_FILE - Name of the file that contains the Tcl library, such
683
# as libtcl7.8.so or libtcl7.8.a.
684
# TCL_LIB_SUFFIX -Specifies everything that comes after the "libtcl"
685
# in the shared library name, using the
686
# ${PACKAGE_VERSION} variable to put the version in
687
# the right place. This is used by platforms that
688
# need non-standard library names.
689
# Examples: ${PACKAGE_VERSION}.so.1.1 on NetBSD,
690
# since it needs to have a version after the .so, and
691
# ${PACKAGE_VERSION}.a on AIX, since the Tcl shared
692
# library needs to have a .a extension whereas shared
693
# objects for loadable extensions have a .so
694
# extension. Defaults to
695
# ${PACKAGE_VERSION}${SHLIB_SUFFIX}.
696
# TCL_NEEDS_EXP_FILE -
697
# 1 means that an export file is needed to link to a
699
# TCL_EXP_FILE - The name of the installed export / import file which
700
# should be used to link to the Tcl shared library.
701
# Empty if Tcl is unshared.
702
# TCL_BUILD_EXP_FILE -
703
# The name of the built export / import file which
704
# should be used to link to the Tcl shared library.
705
# Empty if Tcl is unshared.
707
# Flags used when running the compiler in debug mode
709
# Flags used when running the compiler in optimize mode
711
# Extra CFLAGS to pass to the compiler
713
# Subst's the following vars:
725
#--------------------------------------------------------------------
727
AC_DEFUN(TEA_CONFIG_CFLAGS, [
728
dnl Make sure we are initialized
729
AC_REQUIRE([TEA_INIT])
731
# Step 0: Enable 64 bit support?
733
AC_MSG_CHECKING([if 64bit support is enabled])
734
AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)], [do64bit=$enableval], [do64bit=no])
735
AC_MSG_RESULT([$do64bit])
737
# Step 0.b: Enable Solaris 64 bit VIS support?
739
AC_MSG_CHECKING([if 64bit Sparc VIS support is requested])
740
AC_ARG_ENABLE(64bit-vis,[ --enable-64bit-vis enable 64bit Sparc VIS support], [do64bitVIS=$enableval], [do64bitVIS=no])
741
AC_MSG_RESULT([$do64bitVIS])
743
if test "$do64bitVIS" = "yes"; then
744
# Force 64bit on with VIS
748
# Step 0.c: Cross-compiling options for Windows/CE builds?
750
if test "${TEA_PLATFORM}" = "windows" ; then
751
AC_MSG_CHECKING([if Windows/CE build is requested])
752
AC_ARG_ENABLE(wince,[ --enable-wince enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no])
753
AC_MSG_RESULT($doWince)
756
# Step 1: set the variable "system" to hold the name and version number
757
# for the system. This can usually be done via the "uname" command, but
758
# there are a few systems, like Next, where this doesn't work.
760
AC_MSG_CHECKING([system version (for dynamic loading)])
761
if test -f /usr/lib/NextStep/software_version; then
762
system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
764
system=`uname -s`-`uname -r`
765
if test "$?" -ne 0 ; then
766
AC_MSG_RESULT([unknown (can't find uname command)])
769
# Special check for weird MP-RAS system (uname returns weird
770
# results, and the version is kept in special file).
772
if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
773
system=MP-RAS-`awk '{print $3}' /etc/.relid'`
775
if test "`uname -s`" = "AIX" ; then
776
system=AIX-`uname -v`.`uname -r`
778
if test "${TEA_PLATFORM}" = "windows" ; then
781
AC_MSG_RESULT([$system])
785
# Step 2: check for existence of -ldl library. This is needed because
786
# Linux can use either -ldl or -ldld for dynamic loading.
788
AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
790
# Step 3: set configuration options based on system name and version.
794
TCL_EXPORT_FILE_SUFFIX=""
795
UNSHARED_LIB_SUFFIX=""
796
TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
797
ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
798
TCL_LIB_VERSIONS_OK=ok
801
if test "$GCC" = "yes" ; then
802
CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int"
807
TCL_BUILD_EXP_FILE=""
809
dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed.
810
dnl AC_CHECK_TOOL(AR, ar, :)
811
AC_CHECK_PROG(AR, ar, ar)
813
LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
816
# This is a 2-stage check to make sure we have the 64-bit SDK
817
# We have to know where the SDK is installed.
818
if test "$do64bit" = "yes" ; then
819
if test "x${MSSDK}x" = "xx" ; then
820
MSSDK="C:/Progra~1/Microsoft SDK"
822
# In order to work in the tortured autoconf environment,
823
# we need to ensure that this path has no spaces
824
MSSDK=`cygpath -w -s "$MSSDK" | sed -e 's!\\\!/!g'`
825
if test ! -d "${MSSDK}/bin/win64" ; then
826
AC_MSG_WARN("could not find 64-bit SDK to enable 64bit mode")
833
if test "$doWince" != "no" ; then
834
if test "$do64bit" = "yes" ; then
835
AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible])
837
if test "$GCC" = "yes" ; then
838
AC_MSG_ERROR([Windows/CE and GCC builds incompatible])
842
# Currently Tcl requires 300+
843
CEVERSION=300; # could be 211 300 301 ...
844
TARGETCPU=ARM; # could be ARM MIPS SH3 X86 ...
845
PLATFORM="Pocket PC 2002"
846
if test "$doWince" = "yes"; then
847
doWince="300,ARM,ARM,Pocket PC 2002"
849
eval `echo $doWince | awk -F "," '{ \
850
if (length([$]1)) { printf "CEVERSION=%s\n", [$]1 }; \
851
if (length([$]2)) { printf "TARGETCPU=%s\n", toupper([$]2) }; \
852
if (length([$]3)) { printf "ARCH=%s\n", toupper([$]3) }; \
853
if (length([$]4)) { printf "PLATFORM=%s\n", [$]4 }; \
855
OSVERSION=WCE$CEVERSION;
856
if test "x${ARCH}" = "x" ; then
857
ARCH=$TARGETCPU; # could be ARM MIPS SH3 X86 X86EM ...
859
if test "x${WCEROOT}" = "x" ; then
860
WCEROOT="C:/Program Files/Microsoft eMbedded Tools"
862
if test "x${SDKROOT}" = "x" ; then
863
SDKROOT="C:/Windows CE Tools"
865
# In order to work in the tortured autoconf environment,
866
# we need to ensure that this path has no spaces
867
WCEROOT=`cygpath -w -s "$WCEROOT" | sed -e 's!\\\!/!g'`
868
SDKROOT=`cygpath -w -s "$SDKROOT" | sed -e 's!\\\!/!g'`
869
CELIB_DIR=`cygpath -w -s "$CELIB_DIR" | sed -e 's!\\\!/!g'`
870
if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \
871
-o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then
872
AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]])
875
CEINCLUDE=`cygpath -w -s "${SDKROOT}/${OSVERSION}/${PLATFORM}/include" | sed -e 's!\\\!/!g'`
876
CELIBPATH=`cygpath -w -s "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" | sed -e 's!\\\!/!g'`
880
if test "$GCC" != "yes" ; then
881
if test "${SHARED_BUILD}" = "0" ; then
887
if test "$do64bit" = "yes" ; then
888
# All this magic is necessary for the Win64 SDK RC1 - hobbs
889
export CC="${MSSDK}/Bin/Win64/cl.exe \
890
-I${MSSDK}/Include/prerelease \
891
-I${MSSDK}/Include/Win64/crt \
893
export RC="${MSSDK}/bin/rc.exe"
894
export lflags="-MACHINE:IA64 -LIBPATH:${MSSDK}/Lib/IA64 \
895
-LIBPATH:${MSSDK}/Lib/Prerelease/IA64"
896
export STLIB_LD="${MSSDK}/bin/win64/lib.exe -nologo ${lflags}"
897
export LINKBIN="${MSSDK}/bin/win64/link.exe ${lflags}"
898
CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
899
CFLAGS_OPTIMIZE="-nologo -O2 -Gs -W2 ${runtime}"
900
elif test "$doWince" != "no" ; then
901
if test "${TARGETCPU}" = "X86"; then
902
CC="${WCEROOT}/EVC/${OSVERSION}/bin/cl.exe -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
904
CC="${WCEROOT}/EVC/${OSVERSION}/bin/cl${TARGETCPU}.exe -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
906
RC="${WCEROOT}/Common/EVC/bin/rc.exe"
907
cpulower=`echo ${TARGETCPU} | awk '{print tolower([$]0)}'`
908
defs="${TARGETCPU} _${TARGETCPU}_ ${cpulower} _${cpulower}_ POCKET_SIZE PALM_SIZE _MT _DLL _WINDOWS"
910
AC_DEFINE_UNQUOTED($i)
912
AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION)
913
AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION)
914
CFLAGS_DEBUG="-nologo -Zi -Od"
915
CFLAGS_OPTIMIZE="-nologo -Ox"
916
lflags="-MACHINE:${TARGETCPU} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,3.00"
917
STLIB_LD="${WCEROOT}/EVC/${OSVERSION}/bin/lib.exe -nologo ${lflags}"
918
LINKBIN="${WCEROOT}/EVC/${OSVERSION}/bin/link.exe ${lflags}"
921
STLIB_LD="lib -nologo"
922
LINKBIN="link -link50compat"
923
CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
924
CFLAGS_OPTIMIZE="-nologo -O2 -Gs -GD -W2 ${runtime}"
928
if test "$GCC" = "yes"; then
932
CFLAGS_OPTIMIZE="-O2"
933
SHLIB_LD="$CC -shared"
934
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
935
LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
936
LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
938
SHLIB_LD="${LINKBIN} -dll -nologo"
939
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.lib'
942
# For information on what debugtype is most useful, see:
943
# http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
944
# This essentially turns it all on.
945
LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2"
946
LDFLAGS_OPTIMIZE="-release"
947
if test "$doWince" != "no" ; then
948
LDFLAGS_CONSOLE="-link ${lflags}"
949
LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
951
LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
952
LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
956
SHLIB_LD_LIBS='${LIBS}'
958
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.dll'
960
TCL_LIB_VERSIONS_OK=nodots
961
# Bogus to avoid getting this turned off
962
DL_OBJS="tclLoadNone.obj"
965
if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
966
# AIX requires the _r compiler when gcc isn't being used
967
if test "${CC}" != "cc_r" ; then
970
AC_MSG_RESULT([Using $CC for compiling with threads])
975
SHLIB_LD_LIBS='${LIBS}'
977
DL_OBJS="tclLoadDl.o"
979
LD_LIBRARY_PATH_VAR="LIBPATH"
981
# AIX v<=4.1 has some different flags than 4.2+
982
if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
983
#LIBOBJS="$LIBOBJS tclLoadAix.o"
984
AC_LIBOBJ([tclLoadAix])
988
# Check to enable 64-bit flags for compiler/linker on AIX 4+
989
if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then
990
if test "$GCC" = "yes" ; then
991
AC_MSG_WARN("64bit mode not supported with GCC on $system")
996
RANLIB="${RANLIB} -X64"
998
SHLIB_LD_FLAGS="-b64"
1002
if test "`uname -m`" = "ia64" ; then
1003
# AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
1004
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
1005
# AIX-5 has dl* in libc.so
1007
if test "$GCC" = "yes" ; then
1008
LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
1010
LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
1013
SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}"
1015
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
1016
TCL_NEEDS_EXP_FILE=1
1017
TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}\$\{DBGX\}.exp'
1020
# On AIX <=v4 systems, libbsd.a has to be linked in to support
1021
# non-blocking file IO. This library has to be linked in after
1022
# the MATH_LIBS or it breaks the pow() function. The way to
1023
# insure proper sequencing, is to add it to the tail of MATH_LIBS.
1024
# This library also supplies gettimeofday.
1026
# AIX does not have a timezone field in struct tm. When the AIX
1027
# bsd library is used, the timezone global and the gettimeofday
1028
# methods are to be avoided for timezone deduction instead, we
1029
# deduce the timezone by comparing the localtime result on a
1032
AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no)
1033
if test $libbsd = yes; then
1034
MATH_LIBS="$MATH_LIBS -lbsd"
1035
AC_DEFINE(USE_DELTA_FOR_TZ)
1038
BSD/OS-2.1*|BSD/OS-3*)
1040
SHLIB_LD="shlicc -r"
1041
SHLIB_LD_LIBS='${LIBS}'
1043
DL_OBJS="tclLoadDl.o"
1049
SHLIB_CFLAGS="-export-dynamic -fPIC"
1050
SHLIB_LD="cc -shared"
1051
SHLIB_LD_LIBS='${LIBS}'
1053
DL_OBJS="tclLoadDl.o"
1055
LDFLAGS="-export-dynamic"
1059
SHLIB_CFLAGS="-K PIC"
1063
DL_OBJS="tclLoadDl.o"
1069
# Use updated header definitions where possible
1070
AC_DEFINE(_XOPEN_SOURCE_EXTENDED)
1073
AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
1074
if test "$tcl_ok" = yes; then
1077
SHLIB_LD_LIBS='${LIBS}'
1078
DL_OBJS="tclLoadShl.o"
1081
LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
1083
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
1085
# Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
1086
#EXTRA_CFLAGS="+DAportable"
1088
# Check to enable 64-bit flags for compiler/linker
1089
if test "$do64bit" = "yes" ; then
1090
if test "$GCC" = "yes" ; then
1091
hpux_arch=`${CC} -dumpmachine`
1094
# 64-bit gcc in use. Fix flags for GNU ld.
1096
SHLIB_LD="${CC} -shared"
1101
AC_MSG_WARN("64bit mode not supported with GCC on $system")
1106
if test "`uname -m`" = "ia64" ; then
1107
EXTRA_CFLAGS="+DD64"
1108
LDFLAGS="+DD64 $LDFLAGS"
1110
EXTRA_CFLAGS="+DA2.0W"
1111
LDFLAGS="+DA2.0W $LDFLAGS"
1116
HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
1118
AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
1119
if test "$tcl_ok" = yes; then
1123
DL_OBJS="tclLoadShl.o"
1126
LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
1128
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
1133
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
1134
SHLIB_LD_LIBS='${LIBS}'
1135
DL_OBJS="tclLoadAout.o"
1137
LDFLAGS="-Wl,-D,08000000"
1138
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
1139
SHARED_LIB_SUFFIX='${PACKAGE_VERSION}\$\{DBGX\}.a'
1143
SHLIB_LD="ld -shared -rdata_shared"
1144
SHLIB_LD_LIBS='${LIBS}'
1146
DL_OBJS="tclLoadDl.o"
1148
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1152
IRIX-6.*|IRIX64-6.5*)
1154
SHLIB_LD="ld -n32 -shared -rdata_shared"
1155
SHLIB_LD_LIBS='${LIBS}'
1157
DL_OBJS="tclLoadDl.o"
1159
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1160
if test "$GCC" = "yes" ; then
1161
EXTRA_CFLAGS="-mabi=n32"
1166
# Use to build 6.2 compatible binaries on 6.3.
1167
EXTRA_CFLAGS="-n32 -D_OLD_TERMIOS"
1178
SHLIB_LD="ld -n32 -shared -rdata_shared"
1179
SHLIB_LD_LIBS='${LIBS}'
1181
DL_OBJS="tclLoadDl.o"
1184
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1186
# Check to enable 64-bit flags for compiler/linker
1188
if test "$do64bit" = "yes" ; then
1189
if test "$GCC" = "yes" ; then
1190
AC_MSG_WARN([64bit mode not supported by gcc])
1193
SHLIB_LD="ld -64 -shared -rdata_shared"
1200
SHLIB_CFLAGS="-fPIC"
1201
SHLIB_LD_LIBS='${LIBS}'
1204
# egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings
1205
# when you inline the string and math operations. Turn this off to
1206
# get rid of the warnings.
1208
#CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
1210
if test "$have_dl" = yes; then
1211
SHLIB_LD="${CC} -shared"
1212
DL_OBJS="tclLoadDl.o"
1215
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1217
AC_CHECK_HEADER(dld.h, [
1218
SHLIB_LD="ld -shared"
1219
DL_OBJS="tclLoadDld.o"
1222
LD_SEARCH_FLAGS=""])
1224
if test "`uname -m`" = "alpha" ; then
1225
EXTRA_CFLAGS="-mieee"
1228
# The combo of gcc + glibc has a bug related
1229
# to inlining of functions like strtod(). The
1230
# -fno-builtin flag should address this problem
1231
# but it does not work. The -fno-inline flag
1232
# is kind of overkill but it works.
1233
# Disable inlining only when one of the
1234
# files in compat/*.c is being linked in.
1235
if test x"${USE_COMPAT}" != x ; then
1236
EXTRA_CFLAGS="${EXTRA_CFLAGS} -fno-inline"
1241
SHLIB_CFLAGS="-fPIC"
1242
SHLIB_LD_LIBS='${LIBS}'
1245
if test "$have_dl" = yes; then
1246
SHLIB_LD="${CC} -shared"
1252
AC_CHECK_HEADER(dld.h, [
1253
SHLIB_LD="ld -shared"
1257
LD_SEARCH_FLAGS=""])
1259
if test "`uname -m`" = "alpha" ; then
1260
EXTRA_CFLAGS="-mieee"
1264
SHLIB_CFLAGS="-K PIC"
1268
DL_OBJS="tclLoadDl.o"
1274
SHLIB_CFLAGS="-K PIC"
1278
DL_OBJS="tclLoadDl.o"
1280
LDFLAGS="-Wl,-Bexport"
1283
NetBSD-*|FreeBSD-[[1-2]].*)
1284
# Not available on all versions: check for include file.
1285
AC_CHECK_HEADER(dlfcn.h, [
1286
# NetBSD/SPARC needs -fPIC, -fpic will not do.
1287
SHLIB_CFLAGS="-fPIC"
1288
SHLIB_LD="ld -Bshareable -x"
1291
DL_OBJS="tclLoadDl.o"
1294
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1295
AC_MSG_CHECKING([for ELF])
1301
AC_MSG_RESULT([yes])
1302
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so',
1304
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
1308
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
1309
SHLIB_LD_LIBS='${LIBS}'
1311
DL_OBJS="tclLoadAout.o"
1314
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
1315
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
1318
# FreeBSD doesn't handle version numbers with dots.
1320
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
1321
TCL_LIB_VERSIONS_OK=nodots
1324
SHLIB_LD="${CC} -shared"
1325
SHLIB_LD_LIBS='${LIBS}'
1327
DL_OBJS="tclLoadDl.o"
1331
AC_MSG_CHECKING(for ELF)
1338
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'],
1340
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0']
1343
# OpenBSD doesn't do version numbers with dots.
1344
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
1345
TCL_LIB_VERSIONS_OK=nodots
1348
# FreeBSD 3.* and greater have ELF.
1349
SHLIB_CFLAGS="-fPIC"
1350
SHLIB_LD="ld -Bshareable -x"
1351
SHLIB_LD_LIBS='${LIBS}'
1353
DL_OBJS="tclLoadDl.o"
1355
LDFLAGS="-export-dynamic"
1356
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1357
if test "${TCL_THREADS}" = "1" ; then
1358
# The -pthread needs to go in the CFLAGS, not LIBS
1359
LIBS=`echo $LIBS | sed s/-pthread//`
1360
EXTRA_CFLAGS="-pthread"
1361
LDFLAGS="$LDFLAGS -pthread"
1365
# FreeBSD-3 doesn't handle version numbers with dots.
1366
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
1367
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
1368
TCL_LIB_VERSIONS_OK=nodots
1372
Rhapsody-*|Darwin-*)
1373
SHLIB_CFLAGS="-fno-common"
1374
SHLIB_LD="cc -dynamiclib \${LDFLAGS}"
1375
TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_MAJOR_VERSION} -current_version \${PACKAGE_VERSION} -install_name \${LIB_RUNTIME_DIR}/\${TCL_LIB_FILE} -prebind -seg1addr 0xa000000"
1376
SHLIB_LD_LIBS='${LIBS}'
1377
SHLIB_SUFFIX=".dylib"
1378
DL_OBJS="tclLoadDyld.o"
1382
LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
1383
CFLAGS_OPTIMIZE="-O3"
1384
EXTRA_CFLAGS="-arch ppc -pipe"
1388
SHLIB_LD="cc -nostdlib -r"
1391
DL_OBJS="tclLoadNext.o"
1397
CFLAGS_OPTIMIZE="" # Optimizer is buggy
1398
AC_DEFINE(_OE_SOCKETS) # needed in sys/socket.h
1400
OSF1-1.0|OSF1-1.1|OSF1-1.2)
1401
# OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
1403
# Hack: make package name same as library name
1404
SHLIB_LD='ld -R -export $@:'
1407
DL_OBJS="tclLoadOSF.o"
1413
# OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
1414
SHLIB_CFLAGS="-fPIC"
1415
if test "$SHARED_BUILD" = "1" ; then
1416
SHLIB_LD="ld -shared"
1418
SHLIB_LD="ld -non_shared"
1422
DL_OBJS="tclLoadDl.o"
1430
if test "$SHARED_BUILD" = "1" ; then
1431
SHLIB_LD='ld -shared -expect_unresolved "*"'
1433
SHLIB_LD='ld -non_shared -expect_unresolved "*"'
1437
DL_OBJS="tclLoadDl.o"
1440
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
1441
if test "$GCC" != "yes" ; then
1442
EXTRA_CFLAGS="-DHAVE_TZSET -std1"
1444
# see pthread_intro(3) for pthread support on osf1, k.furukawa
1445
if test "${TCL_THREADS}" = "1" ; then
1446
EXTRA_CFLAGS="${EXTRA_CFLAGS} -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
1447
EXTRA_CFLAGS="${EXTRA_CFLAGS} -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
1448
LIBS=`echo $LIBS | sed s/-lpthreads//`
1449
if test "$GCC" = "yes" ; then
1450
LIBS="$LIBS -lpthread -lmach -lexc"
1452
EXTRA_CFLAGS="${EXTRA_CFLAGS} -pthread"
1460
# This may work for all QNX, but it was only reported for v6.
1461
SHLIB_CFLAGS="-fPIC"
1462
SHLIB_LD="ld -Bshareable -x"
1465
DL_OBJS="tclLoadDl.o"
1466
# dlopen is in -lc on QNX
1473
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
1474
SHLIB_LD_LIBS='${LIBS}'
1476
DL_OBJS="tclLoadAout.o"
1478
LDFLAGS="-Wl,-D,08000000"
1479
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
1482
# Note, dlopen is available only on SCO 3.2.5 and greater. However,
1483
# this test works, since "uname -s" was non-standard in 3.2.4 and
1485
if test "$GCC" = "yes" ; then
1486
SHLIB_CFLAGS="-fPIC -melf"
1487
LDFLAGS="-melf -Wl,-Bexport"
1489
SHLIB_CFLAGS="-Kpic -belf"
1490
LDFLAGS="-belf -Wl,-Bexport"
1495
DL_OBJS="tclLoadDl.o"
1500
SHLIB_CFLAGS="-K PIC"
1504
DL_OBJS="tclLoadDl.o"
1514
DL_OBJS="tclLoadDl.o"
1517
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
1519
# SunOS can't handle version numbers with dots in them in library
1520
# specs, like -ltcl7.5, so use -ltcl75 instead. Also, it
1521
# requires an extra version number at the end of .so file names.
1522
# So, the library has to have a name like libtcl75.so.1.0
1524
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
1525
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
1526
TCL_LIB_VERSIONS_OK=nodots
1530
# Note: If _REENTRANT isn't defined, then Solaris
1531
# won't define thread-safe library routines.
1533
AC_DEFINE(_REENTRANT)
1534
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
1536
SHLIB_CFLAGS="-KPIC"
1538
# Note: need the LIBS below, otherwise Tk won't find Tcl's
1539
# symbols when dynamically loaded into tclsh.
1541
SHLIB_LD_LIBS='${LIBS}'
1543
DL_OBJS="tclLoadDl.o"
1546
if test "$GCC" = "yes" ; then
1547
SHLIB_LD="$CC -shared"
1548
LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
1550
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
1551
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
1556
# Note: If _REENTRANT isn't defined, then Solaris
1557
# won't define thread-safe library routines.
1559
AC_DEFINE(_REENTRANT)
1560
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
1562
SHLIB_CFLAGS="-KPIC"
1565
# Check to enable 64-bit flags for compiler/linker
1566
if test "$do64bit" = "yes" ; then
1568
if test "$arch" = "sparcv9 sparc" ; then
1569
if test "$GCC" = "yes" ; then
1570
AC_MSG_WARN("64bit mode not supported with GCC on $system")
1573
if test "$do64bitVIS" = "yes" ; then
1574
EXTRA_CFLAGS="-xarch=v9a"
1575
LDFLAGS="-xarch=v9a"
1577
EXTRA_CFLAGS="-xarch=v9"
1582
AC_MSG_WARN("64bit mode only supported sparcv9 system")
1586
# Note: need the LIBS below, otherwise Tk won't find Tcl's
1587
# symbols when dynamically loaded into tclsh.
1589
SHLIB_LD_LIBS='${LIBS}'
1591
DL_OBJS="tclLoadDl.o"
1593
if test "$GCC" = "yes" ; then
1594
SHLIB_LD="$CC -shared"
1595
LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
1597
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
1598
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
1604
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
1605
SHLIB_LD_LIBS='${LIBS}'
1606
DL_OBJS="tclLoadAout.o"
1608
LDFLAGS="-Wl,-D,08000000"
1609
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
1610
if test "$GCC" != "yes" ; then
1611
EXTRA_CFLAGS="-DHAVE_TZSET -std1"
1614
UNIX_SV* | UnixWare-5*)
1615
SHLIB_CFLAGS="-KPIC"
1619
DL_OBJS="tclLoadDl.o"
1621
# Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
1622
# that don't grok the -Bexport option. Test that it does.
1623
hold_ldflags=$LDFLAGS
1624
AC_MSG_CHECKING([for ld accepts -Bexport flag])
1625
LDFLAGS="${LDFLAGS} -Wl,-Bexport"
1626
AC_TRY_LINK(, [int i;], found=yes, found=no)
1627
LDFLAGS=$hold_ldflags
1628
AC_MSG_RESULT([$found])
1629
if test $found = yes; then
1630
LDFLAGS="-Wl,-Bexport"
1638
if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then
1639
AC_MSG_WARN("64bit support being disabled -- don\'t know magic for this platform")
1642
# Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic
1643
# Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop,
1644
# New Orleans, LA, Computerized Processes Unlimited, 1994), then we need
1645
# to determine which of several header files defines the a.out file
1646
# format (a.out.h, sys/exec.h, or sys/exec_aout.h). At present, we
1647
# support only a file format that is more or less version-7-compatible.
1649
# - a.out files must begin with `struct exec'.
1650
# - the N_TXTOFF on the `struct exec' must compute the seek address
1651
# of the text segment
1652
# - The `struct exec' must contain a_magic, a_text, a_data, a_bss
1653
# and a_entry fields.
1654
# The following compilation should succeed if and only if either sys/exec.h
1655
# or a.out.h is usable for the purpose.
1657
# Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the
1658
# `struct exec' includes a second header that contains information that
1659
# duplicates the v7 fields that are needed.
1661
if test "x$DL_OBJS" = "xtclLoadAout.o" ; then
1662
AC_MSG_CHECKING([sys/exec.h])
1663
AC_TRY_COMPILE([#include <sys/exec.h>],[
1667
#if defined(__mips) || defined(mips)
1668
seek = N_TXTOFF (foo.ex_f, foo.ex_o);
1670
seek = N_TXTOFF (foo);
1672
flag = (foo.a_magic == OMAGIC);
1673
return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
1674
], tcl_ok=usable, tcl_ok=unusable)
1675
AC_MSG_RESULT([$tcl_ok])
1676
if test $tcl_ok = usable; then
1677
AC_DEFINE(USE_SYS_EXEC_H)
1679
AC_MSG_CHECKING([a.out.h])
1680
AC_TRY_COMPILE([#include <a.out.h>],[
1684
#if defined(__mips) || defined(mips)
1685
seek = N_TXTOFF (foo.ex_f, foo.ex_o);
1687
seek = N_TXTOFF (foo);
1689
flag = (foo.a_magic == OMAGIC);
1690
return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
1691
], tcl_ok=usable, tcl_ok=unusable)
1692
AC_MSG_RESULT([$tcl_ok])
1693
if test $tcl_ok = usable; then
1694
AC_DEFINE(USE_A_OUT_H)
1696
AC_MSG_CHECKING([sys/exec_aout.h])
1697
AC_TRY_COMPILE([#include <sys/exec_aout.h>],[
1701
#if defined(__mips) || defined(mips)
1702
seek = N_TXTOFF (foo.ex_f, foo.ex_o);
1704
seek = N_TXTOFF (foo);
1706
flag = (foo.a_midmag == OMAGIC);
1707
return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
1708
], tcl_ok=usable, tcl_ok=unusable)
1709
AC_MSG_RESULT([$tcl_ok])
1710
if test $tcl_ok = usable; then
1711
AC_DEFINE(USE_SYS_EXEC_AOUT_H)
1719
# Step 5: disable dynamic loading if requested via a command-line switch.
1721
AC_ARG_ENABLE(load, [ --disable-load disallow dynamic loading and "load" command],
1722
[tcl_ok=$enableval], [tcl_ok=yes])
1723
if test "$tcl_ok" = "no"; then
1727
if test "x$DL_OBJS" != "x" ; then
1728
BUILD_DLTEST="\$(DLTEST_TARGETS)"
1730
echo "Can't figure out how to do dynamic loading or shared libraries"
1731
echo "on this system."
1735
DL_OBJS="tclLoadNone.o"
1742
# If we're running gcc, then change the C flags for compiling shared
1743
# libraries to the right flags for gcc, instead of those for the
1744
# standard manufacturer compiler.
1746
if test "$DL_OBJS" != "tclLoadNone.o" ; then
1747
if test "$GCC" = "yes" ; then
1757
Rhapsody-*|Darwin-*)
1768
SHLIB_CFLAGS="-fPIC"
1774
if test "$SHARED_LIB_SUFFIX" = "" ; then
1775
SHARED_LIB_SUFFIX='${PACKAGE_VERSION}\$\{DBGX\}${SHLIB_SUFFIX}'
1777
if test "$UNSHARED_LIB_SUFFIX" = "" ; then
1778
UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}\$\{DBGX\}.a'
1782
AC_SUBST(CFLAGS_DEBUG)
1783
AC_SUBST(CFLAGS_OPTIMIZE)
1784
AC_SUBST(CFLAGS_WARNING)
1785
AC_SUBST(EXTRA_CFLAGS)
1789
AC_SUBST(SHLIB_CFLAGS)
1790
AC_SUBST(SHLIB_LD_FLAGS)
1791
AC_SUBST(SHLIB_LD_LIBS)
1792
AC_SUBST(LDFLAGS_DEBUG)
1793
AC_SUBST(LDFLAGS_OPTIMIZE)
1794
AC_SUBST(LD_LIBRARY_PATH_VAR)
1797
#--------------------------------------------------------------------
1800
# Determine which interface to use to talk to the serial port.
1801
# Note that #include lines must begin in leftmost column for
1802
# some compilers to recognize them as preprocessor directives,
1803
# and some build environments have stdin not pointing at a
1804
# pseudo-terminal (usually /dev/null instead.)
1811
# Defines only one of the following vars:
1817
#--------------------------------------------------------------------
1819
AC_DEFUN(TEA_SERIAL_PORT, [
1820
AC_CHECK_HEADERS(sys/modem.h)
1821
AC_MSG_CHECKING([termios vs. termio vs. sgtty])
1822
AC_CACHE_VAL(tcl_cv_api_serial, [
1824
#include <termios.h>
1828
if (tcgetattr(0, &t) == 0) {
1830
t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
1834
}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
1835
if test $tcl_cv_api_serial = no ; then
1841
if (ioctl(0, TCGETA, &t) == 0) {
1842
t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
1846
}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
1848
if test $tcl_cv_api_serial = no ; then
1854
if (ioctl(0, TIOCGETP, &t) == 0) {
1856
t.sg_flags |= ODDP | EVENP | RAW;
1860
}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none)
1862
if test $tcl_cv_api_serial = no ; then
1864
#include <termios.h>
1869
if (tcgetattr(0, &t) == 0
1870
|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
1872
t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
1876
}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
1878
if test $tcl_cv_api_serial = no; then
1885
if (ioctl(0, TCGETA, &t) == 0
1886
|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
1887
t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
1891
}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
1893
if test $tcl_cv_api_serial = no; then
1900
if (ioctl(0, TIOCGETP, &t) == 0
1901
|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
1903
t.sg_flags |= ODDP | EVENP | RAW;
1907
}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none)
1909
case $tcl_cv_api_serial in
1910
termios) AC_DEFINE(USE_TERMIOS);;
1911
termio) AC_DEFINE(USE_TERMIO);;
1912
sgtty) AC_DEFINE(USE_SGTTY);;
1914
AC_MSG_RESULT([$tcl_cv_api_serial])
1917
#--------------------------------------------------------------------
1918
# TEA_MISSING_POSIX_HEADERS
1920
# Supply substitutes for missing POSIX header files. Special
1922
# - stdlib.h doesn't define strtol, strtoul, or
1923
# strtod insome versions of SunOS
1924
# - some versions of string.h don't declare procedures such
1932
# Defines some of the following vars:
1946
#--------------------------------------------------------------------
1948
AC_DEFUN(TEA_MISSING_POSIX_HEADERS, [
1949
AC_MSG_CHECKING([dirent.h])
1950
AC_TRY_LINK([#include <sys/types.h>
1951
#include <dirent.h>], [
1952
#ifndef _POSIX_SOURCE
1955
* Generate compilation error to make the test fail: Lynx headers
1956
* are only valid if really in the POSIX environment.
1959
missing_procedure();
1963
struct dirent *entryPtr;
1965
d = opendir("foobar");
1966
entryPtr = readdir(d);
1967
p = entryPtr->d_name;
1969
], tcl_ok=yes, tcl_ok=no)
1971
if test $tcl_ok = no; then
1972
AC_DEFINE(NO_DIRENT_H)
1975
AC_MSG_RESULT([$tcl_ok])
1976
AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H)])
1977
AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H)])
1978
AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H)])
1979
AC_CHECK_HEADER(limits.h, , [AC_DEFINE(NO_LIMITS_H)])
1980
AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
1981
AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0)
1982
AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0)
1983
AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0)
1984
if test $tcl_ok = 0; then
1985
AC_DEFINE(NO_STDLIB_H)
1987
AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0)
1988
AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0)
1989
AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0)
1991
# See also memmove check below for a place where NO_STRING_H can be
1994
if test $tcl_ok = 0; then
1995
AC_DEFINE(NO_STRING_H)
1998
AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H)])
1999
AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H)])
2001
# OS/390 lacks sys/param.h (and doesn't need it, by chance).
2003
AC_HAVE_HEADERS(unistd.h sys/param.h)
2007
#--------------------------------------------------------------------
2010
# Locate the X11 header files and the X11 library archive. Try
2011
# the ac_path_x macro first, but if it doesn't find the X stuff
2012
# (e.g. because there's no xmkmf program) then check through
2013
# a list of possible directories. Under some conditions the
2014
# autoconf macro will return an include directory that contains
2015
# no include files, so double-check its result just to be safe.
2017
# This should be called after TEA_CONFIG_CFLAGS as setting the
2018
# LIBS line can confuse some configure macro magic.
2025
# Sets the following vars:
2030
#--------------------------------------------------------------------
2032
AC_DEFUN(TEA_PATH_X, [
2033
if test "${TEA_PLATFORM}" = "unix" ; then
2038
AC_DEFUN(TEA_PATH_UNIX_X, [
2041
if test "$no_x" = ""; then
2042
if test "$x_includes" = ""; then
2043
AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
2045
if test ! -r $x_includes/X11/Intrinsic.h; then
2046
not_really_there="yes"
2050
if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
2051
AC_MSG_CHECKING([for X11 header files])
2052
XINCLUDES="# no special path needed"
2053
AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="nope")
2054
if test "$XINCLUDES" = nope; then
2055
dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
2057
if test -r $i/X11/Intrinsic.h; then
2065
if test "$x_includes" != ""; then
2066
XINCLUDES=-I$x_includes
2068
XINCLUDES="# no special path needed"
2071
if test "$XINCLUDES" = nope; then
2072
AC_MSG_RESULT([could not find any!])
2073
XINCLUDES="# no include files found"
2076
if test "$no_x" = yes; then
2077
AC_MSG_CHECKING([for X11 libraries])
2079
dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
2081
if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
2089
if test "$x_libraries" = ""; then
2092
XLIBSW="-L$x_libraries -lX11"
2095
if test "$XLIBSW" = nope ; then
2096
AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
2098
if test "$XLIBSW" = nope ; then
2099
AC_MSG_RESULT([could not find any! Using -lX11.])
2102
if test x"${XLIBSW}" != x ; then
2103
PKG_LIBS="${PKG_LIBS} ${XLIBSW}"
2107
#--------------------------------------------------------------------
2108
# TEA_BLOCKING_STYLE
2110
# The statements below check for systems where POSIX-style
2111
# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented.
2112
# On these systems (mostly older ones), use the old BSD-style
2113
# FIONBIO approach instead.
2120
# Defines some of the following vars:
2126
#--------------------------------------------------------------------
2128
AC_DEFUN(TEA_BLOCKING_STYLE, [
2129
AC_CHECK_HEADERS(sys/ioctl.h)
2130
AC_CHECK_HEADERS(sys/filio.h)
2131
AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O])
2132
if test -f /usr/lib/NextStep/software_version; then
2133
system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
2135
system=`uname -s`-`uname -r`
2136
if test "$?" -ne 0 ; then
2139
# Special check for weird MP-RAS system (uname returns weird
2140
# results, and the version is kept in special file).
2142
if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
2143
system=MP-RAS-`awk '{print $3}' /etc/.relid'`
2145
if test "`uname -s`" = "AIX" ; then
2146
system=AIX-`uname -v`.`uname -r`
2151
# There used to be code here to use FIONBIO under AIX. However, it
2152
# was reported that FIONBIO doesn't work under AIX 3.2.5. Since
2153
# using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO
2154
# code (JO, 5/31/97).
2157
AC_DEFINE(USE_FIONBIO)
2158
AC_MSG_RESULT([FIONBIO])
2161
AC_DEFINE(USE_FIONBIO)
2162
AC_MSG_RESULT([FIONBIO])
2165
AC_DEFINE(USE_FIONBIO)
2166
AC_MSG_RESULT([FIONBIO])
2169
AC_MSG_RESULT([O_NONBLOCK])
2174
#--------------------------------------------------------------------
2177
# Checks how the system deals with time.h, what time structures
2178
# are used on the system, and what fields the structures have.
2185
# Defines some of the following vars:
2191
#--------------------------------------------------------------------
2193
AC_DEFUN(TEA_TIME_HANDLER, [
2194
AC_CHECK_HEADERS(sys/time.h)
2198
AC_CHECK_FUNCS(gmtime_r localtime_r)
2200
AC_MSG_CHECKING([tm_tzadj in struct tm])
2201
AC_CACHE_VAL(tcl_cv_member_tm_tzadj,
2202
AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;],
2203
tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no))
2204
AC_MSG_RESULT([$tcl_cv_member_tm_tzadj])
2205
if test $tcl_cv_member_tm_tzadj = yes ; then
2206
AC_DEFINE(HAVE_TM_TZADJ)
2209
AC_MSG_CHECKING([tm_gmtoff in struct tm])
2210
AC_CACHE_VAL(tcl_cv_member_tm_gmtoff,
2211
AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
2212
tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no))
2213
AC_MSG_RESULT([$tcl_cv_member_tm_gmtoff])
2214
if test $tcl_cv_member_tm_gmtoff = yes ; then
2215
AC_DEFINE(HAVE_TM_GMTOFF)
2219
# Its important to include time.h in this check, as some systems
2220
# (like convex) have timezone functions, etc.
2222
AC_MSG_CHECKING([long timezone variable])
2223
AC_CACHE_VAL(tcl_cv_var_timezone,
2224
AC_TRY_COMPILE([#include <time.h>],
2225
[extern long timezone;
2228
tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no))
2229
AC_MSG_RESULT([$tcl_cv_timezone_long])
2230
if test $tcl_cv_timezone_long = yes ; then
2231
AC_DEFINE(HAVE_TIMEZONE_VAR)
2234
# On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
2236
AC_MSG_CHECKING([time_t timezone variable])
2237
AC_CACHE_VAL(tcl_cv_timezone_time,
2238
AC_TRY_COMPILE([#include <time.h>],
2239
[extern time_t timezone;
2242
tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no))
2243
AC_MSG_RESULT([$tcl_cv_timezone_time])
2244
if test $tcl_cv_timezone_time = yes ; then
2245
AC_DEFINE(HAVE_TIMEZONE_VAR)
2250
#--------------------------------------------------------------------
2253
# Under Solaris 2.4, strtod returns the wrong value for the
2254
# terminating character under some conditions. Check for this
2255
# and if the problem exists use a substitute procedure
2256
# "fixstrtod" (provided by Tcl) that corrects the error.
2257
# Also, on Compaq's Tru64 Unix 5.0,
2258
# strtod(" ") returns 0.0 instead of a failure to convert.
2265
# Might defines some of the following vars:
2266
# strtod (=fixstrtod)
2268
#--------------------------------------------------------------------
2270
AC_DEFUN(TEA_BUGGY_STRTOD, [
2271
AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0)
2272
if test "$tcl_strtod" = 1; then
2273
AC_MSG_CHECKING([for Solaris2.4/Tru64 strtod bugs])
2275
extern double strtod();
2278
char *string = "NaN", *spaceString = " ";
2281
value = strtod(string, &term);
2282
if ((term != string) && (term[-1] == 0)) {
2285
value = strtod(spaceString, &term);
2286
if (term == (spaceString+1)) {
2290
}], tcl_ok=1, tcl_ok=0, tcl_ok=0)
2291
if test "$tcl_ok" = 1; then
2294
AC_MSG_RESULT([buggy])
2295
#LIBOBJS="$LIBOBJS fixstrtod.o"
2296
AC_LIBOBJ([fixstrtod])
2298
AC_DEFINE(strtod, fixstrtod)
2303
#--------------------------------------------------------------------
2306
# Search for the libraries needed to link the Tcl shell.
2307
# Things like the math library (-lm) and socket stuff (-lsocket vs.
2308
# -lnsl) are dealt with here.
2311
# Requires the following vars to be set in the Makefile:
2318
# Subst's the following var:
2322
# Might append to the following vars:
2325
# Might define the following vars:
2328
#--------------------------------------------------------------------
2330
AC_DEFUN(TEA_TCL_LINK_LIBS, [
2331
#--------------------------------------------------------------------
2332
# On a few very rare systems, all of the libm.a stuff is
2333
# already in libc.a. Set compiler flags accordingly.
2334
# Also, Linux requires the "ieee" library for math to work
2335
# right (and it must appear before "-lm").
2336
#--------------------------------------------------------------------
2338
AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm")
2339
AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
2341
#--------------------------------------------------------------------
2342
# Interactive UNIX requires -linet instead of -lsocket, plus it
2343
# needs net/errno.h to define the socket-related error codes.
2344
#--------------------------------------------------------------------
2346
AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"])
2347
AC_CHECK_HEADER(net/errno.h, AC_DEFINE(HAVE_NET_ERRNO_H))
2349
#--------------------------------------------------------------------
2350
# Check for the existence of the -lsocket and -lnsl libraries.
2351
# The order here is important, so that they end up in the right
2352
# order in the command line generated by make. Here are some
2353
# special considerations:
2354
# 1. Use "connect" and "accept" to check for -lsocket, and
2355
# "gethostbyname" to check for -lnsl.
2356
# 2. Use each function name only once: can't redo a check because
2357
# autoconf caches the results of the last check and won't redo it.
2358
# 3. Use -lnsl and -lsocket only if they supply procedures that
2359
# aren't already present in the normal libraries. This is because
2360
# IRIX 5.2 has libraries, but they aren't needed and they're
2361
# bogus: they goof up name resolution if used.
2362
# 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
2363
# To get around this problem, check for both libraries together
2364
# if -lsocket doesn't work by itself.
2365
#--------------------------------------------------------------------
2368
AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
2369
if test "$tcl_checkSocket" = 1; then
2370
AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt,
2371
LIBS="$LIBS -lsocket", tcl_checkBoth=1)])
2373
if test "$tcl_checkBoth" = 1; then
2375
LIBS="$LIBS -lsocket -lnsl"
2376
AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs])
2378
AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname,
2379
[LIBS="$LIBS -lnsl"])])
2381
# Don't perform the eval of the libraries here because DL_LIBS
2382
# won't be set until we call TEA_CONFIG_CFLAGS
2384
TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
2389
#--------------------------------------------------------------------
2390
# TEA_TCL_EARLY_FLAGS
2392
# Check for what flags are needed to be passed so the correct OS
2393
# features are available.
2400
# Might define the following vars:
2402
# _LARGEFILE64_SOURCE
2404
#--------------------------------------------------------------------
2406
AC_DEFUN(TEA_TCL_EARLY_FLAG,[
2407
AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
2408
AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,
2409
AC_TRY_COMPILE([[#define ]$1[ 1
2411
[tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
2412
[tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)))
2413
if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
2415
tcl_flags="$tcl_flags $1"
2419
AC_DEFUN(TEA_TCL_EARLY_FLAGS,[
2420
AC_MSG_CHECKING([for required early compiler flags])
2422
TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include <stdlib.h>],
2423
[char *p = (char *)strtoll; char *q = (char *)strtoull;])
2424
TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include <sys/stat.h>],
2425
[struct stat64 buf; int i = stat64("/", &buf);])
2426
if test "x${tcl_flags}" = "x" ; then
2427
AC_MSG_RESULT([none])
2429
AC_MSG_RESULT([${tcl_flags}])
2433
#--------------------------------------------------------------------
2434
# TEA_TCL_64BIT_FLAGS
2436
# Check for what is defined in the way of 64-bit features.
2443
# Might define the following vars:
2444
# TCL_WIDE_INT_IS_LONG
2446
# HAVE_STRUCT_DIRENT64
2447
# HAVE_STRUCT_STAT64
2450
#--------------------------------------------------------------------
2452
AC_DEFUN(TEA_TCL_64BIT_FLAGS, [
2453
AC_MSG_CHECKING([for 64-bit integer type])
2454
AC_CACHE_VAL(tcl_cv_type_64bit,[
2455
AC_TRY_COMPILE(,[__int64 value = (__int64) 0;],
2456
tcl_cv_type_64bit=__int64,tcl_cv_type_64bit=none
2457
AC_TRY_RUN([#include <unistd.h>
2458
int main() {exit(!(sizeof(long long) > sizeof(long)));}
2459
], tcl_cv_type_64bit="long long"))])
2460
if test "${tcl_cv_type_64bit}" = none ; then
2461
AC_MSG_RESULT([using long])
2462
elif test "${tcl_cv_type_64bit}" = "__int64" ; then
2463
# We actually want to use the default tcl.h checks in this
2464
# case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
2465
AC_MSG_RESULT([using Tcl header defaults])
2467
AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit})
2468
AC_MSG_RESULT([${tcl_cv_type_64bit}])
2470
# Now check for auxiliary declarations
2471
AC_MSG_CHECKING([for struct dirent64])
2472
AC_CACHE_VAL(tcl_cv_struct_dirent64,[
2473
AC_TRY_COMPILE([#include <sys/types.h>
2474
#include <sys/dirent.h>],[struct dirent64 p;],
2475
tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)])
2476
if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
2477
AC_DEFINE(HAVE_STRUCT_DIRENT64)
2479
AC_MSG_RESULT([${tcl_cv_struct_dirent64}])
2481
AC_MSG_CHECKING([for struct stat64])
2482
AC_CACHE_VAL(tcl_cv_struct_stat64,[
2483
AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
2485
tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)])
2486
if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
2487
AC_DEFINE(HAVE_STRUCT_STAT64)
2489
AC_MSG_RESULT([${tcl_cv_struct_stat64}])
2491
AC_MSG_CHECKING([for off64_t])
2492
AC_CACHE_VAL(tcl_cv_type_off64_t,[
2493
AC_TRY_COMPILE([#include <sys/types.h>],[off64_t offset;
2495
tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)])
2496
if test "x${tcl_cv_type_off64_t}" = "xyes" ; then
2497
AC_DEFINE(HAVE_TYPE_OFF64_T)
2499
AC_MSG_RESULT([${tcl_cv_type_off64_t}])
2504
## Here ends the standard Tcl configuration bits and starts the
2505
## TEA specific functions
2508
#------------------------------------------------------------------------
2511
# Init various Tcl Extension Architecture (TEA) variables.
2512
# This should be the first called TEA_* macro.
2519
# Defines and substs the following vars:
2524
# TEA_PLATFORM (windows or unix)
2526
# "cygpath" is used on windows to generate native path names for include
2527
# files. These variables should only be used with the compiler and linker
2528
# since they generate native path names.
2531
# Select the executable extension based on the host type. This
2532
# is a lightweight replacement for AC_EXEEXT that doesn't require
2534
#------------------------------------------------------------------------
2536
AC_DEFUN(TEA_INIT, [
2539
AC_MSG_CHECKING([for correct TEA configuration])
2540
if test x"${PACKAGE_NAME}" = x ; then
2542
The PACKAGE_NAME variable must be defined by your TEA configure.in])
2544
if test x"$1" = x ; then
2546
TEA version not specified.])
2547
elif test "$1" != "${TEA_VERSION}" ; then
2548
AC_MSG_RESULT([warning: TEA version "$1" != ${TEA_VERSION}])
2552
case "`uname -s`" in
2553
*win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*)
2554
AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo)
2556
TEA_PLATFORM="windows"
2565
# Check if exec_prefix is set. If not use fall back to prefix
2566
if test x$exec_prefix = xNONE ; then exec_prefix=$prefix ; fi
2571
# This package name must be replaced statically for AC_SUBST to work
2572
AC_SUBST(PKG_LIB_FILE)
2573
# Substitute STUB_LIB_FILE in case package creates a stub library too.
2574
AC_SUBST(PKG_STUB_LIB_FILE)
2576
# We AC_SUBST these here to ensure they are subst'ed,
2577
# in case the user doesn't call TEA_ADD_...
2578
AC_SUBST(PKG_STUB_SOURCES)
2579
AC_SUBST(PKG_STUB_OBJECTS)
2580
AC_SUBST(PKG_TCL_SOURCES)
2581
AC_SUBST(PKG_HEADERS)
2582
AC_SUBST(PKG_INCLUDES)
2584
AC_SUBST(PKG_CFLAGS)
2587
#------------------------------------------------------------------------
2588
# TEA_ADD_SOURCES --
2590
# Specify one or more source files. Users should check for
2591
# the right platform before adding to their list.
2592
# It is not important to specify the directory, as long as it is
2593
# in the generic, win or unix subdirectory of $(srcdir).
2596
# one or more file names
2600
# Defines and substs the following vars:
2603
#------------------------------------------------------------------------
2604
AC_DEFUN(TEA_ADD_SOURCES, [
2607
# check for existence - allows for generic/win/unix VPATH
2608
if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
2609
-a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
2611
AC_MSG_ERROR([could not find source file '$i'])
2613
PKG_SOURCES="$PKG_SOURCES $i"
2614
# this assumes it is in a VPATH dir
2616
# handle user calling this before or after TEA_SETUP_COMPILER
2617
if test x"${OBJEXT}" != x ; then
2618
j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
2620
j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
2622
PKG_OBJECTS="$PKG_OBJECTS $j"
2624
AC_SUBST(PKG_SOURCES)
2625
AC_SUBST(PKG_OBJECTS)
2628
#------------------------------------------------------------------------
2629
# TEA_ADD_STUB_SOURCES --
2631
# Specify one or more source files. Users should check for
2632
# the right platform before adding to their list.
2633
# It is not important to specify the directory, as long as it is
2634
# in the generic, win or unix subdirectory of $(srcdir).
2637
# one or more file names
2641
# Defines and substs the following vars:
2644
#------------------------------------------------------------------------
2645
AC_DEFUN(TEA_ADD_STUB_SOURCES, [
2648
# check for existence - allows for generic/win/unix VPATH
2649
if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
2650
-a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
2652
AC_MSG_ERROR([could not find stub source file '$i'])
2654
PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i"
2655
# this assumes it is in a VPATH dir
2657
# handle user calling this before or after TEA_SETUP_COMPILER
2658
if test x"${OBJEXT}" != x ; then
2659
j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
2661
j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
2663
PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j"
2665
AC_SUBST(PKG_STUB_SOURCES)
2666
AC_SUBST(PKG_STUB_OBJECTS)
2669
#------------------------------------------------------------------------
2670
# TEA_ADD_TCL_SOURCES --
2672
# Specify one or more Tcl source files. These should be platform
2673
# independent runtime files.
2676
# one or more file names
2680
# Defines and substs the following vars:
2682
#------------------------------------------------------------------------
2683
AC_DEFUN(TEA_ADD_TCL_SOURCES, [
2686
# check for existence, be strict because it is installed
2687
if test ! -f "${srcdir}/$i" ; then
2688
AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i'])
2690
PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i"
2692
AC_SUBST(PKG_TCL_SOURCES)
2695
#------------------------------------------------------------------------
2696
# TEA_ADD_HEADERS --
2698
# Specify one or more source headers. Users should check for
2699
# the right platform before adding to their list.
2702
# one or more file names
2706
# Defines and substs the following vars:
2708
#------------------------------------------------------------------------
2709
AC_DEFUN(TEA_ADD_HEADERS, [
2712
# check for existence, be strict because it is installed
2713
if test ! -f "${srcdir}/$i" ; then
2714
AC_MSG_ERROR([could not find header file '${srcdir}/$i'])
2716
PKG_HEADERS="$PKG_HEADERS $i"
2718
AC_SUBST(PKG_HEADERS)
2721
#------------------------------------------------------------------------
2722
# TEA_ADD_INCLUDES --
2724
# Specify one or more include dirs. Users should check for
2725
# the right platform before adding to their list.
2728
# one or more file names
2732
# Defines and substs the following vars:
2734
#------------------------------------------------------------------------
2735
AC_DEFUN(TEA_ADD_INCLUDES, [
2738
PKG_INCLUDES="$PKG_INCLUDES $i"
2740
AC_SUBST(PKG_INCLUDES)
2743
#------------------------------------------------------------------------
2746
# Specify one or more libraries. Users should check for
2747
# the right platform before adding to their list.
2750
# one or more file names
2754
# Defines and substs the following vars:
2756
#------------------------------------------------------------------------
2757
AC_DEFUN(TEA_ADD_LIBS, [
2760
PKG_LIBS="$PKG_LIBS $i"
2765
#------------------------------------------------------------------------
2768
# Specify one or more CFLAGS. Users should check for
2769
# the right platform before adding to their list.
2772
# one or more file names
2776
# Defines and substs the following vars:
2778
#------------------------------------------------------------------------
2779
AC_DEFUN(TEA_ADD_CFLAGS, [
2780
PKG_CFLAGS="$PKG_CFLAGS $@"
2781
AC_SUBST(PKG_CFLAGS)
2784
#------------------------------------------------------------------------
2787
# Handle the --prefix=... option by defaulting to what Tcl gave
2794
# If --prefix or --exec-prefix was not specified, $prefix and
2795
# $exec_prefix will be set to the values given to Tcl when it was
2797
#------------------------------------------------------------------------
2798
AC_DEFUN(TEA_PREFIX, [
2799
# Should be AC_MSG_NOTICE, but that requires autoconf 2.50
2800
if test "${prefix}" = "NONE"; then
2802
if test x"${TCL_PREFIX}" != x; then
2803
AC_MSG_WARN([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}])
2804
prefix=${TCL_PREFIX}
2809
if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" ; then
2810
if test x"${TCL_EXEC_PREFIX}" != x; then
2811
AC_MSG_WARN([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}])
2812
exec_prefix=${TCL_EXEC_PREFIX}
2819
#------------------------------------------------------------------------
2820
# TEA_SETUP_COMPILER_CC --
2822
# Do compiler checks the way we want. This is just a replacement
2823
# for AC_PROG_CC in TEA configure.in files to make them cleaner.
2830
# Sets up CC var and other standard bits we need to make executables.
2831
#------------------------------------------------------------------------
2832
AC_DEFUN(TEA_SETUP_COMPILER_CC, [
2833
# Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
2834
# in this macro, they need to go into TEA_SETUP_COMPILER instead.
2836
# If the user did not set CFLAGS, set it now to keep
2837
# the AC_PROG_CC macro from adding "-g -O2".
2838
if test "${CFLAGS+set}" != "set" ; then
2847
#--------------------------------------------------------------------
2848
# Checks to see if the make program sets the $MAKE variable.
2849
#--------------------------------------------------------------------
2853
#--------------------------------------------------------------------
2855
#--------------------------------------------------------------------
2859
#--------------------------------------------------------------------
2860
# Determines the correct binary file extension (.o, .obj, .exe etc.)
2861
#--------------------------------------------------------------------
2867
#------------------------------------------------------------------------
2868
# TEA_SETUP_COMPILER --
2870
# Do compiler checks that use the compiler. This must go after
2871
# TEA_SETUP_COMPILER_CC, which does the actual compiler check.
2878
# Sets up CC var and other standard bits we need to make executables.
2879
#------------------------------------------------------------------------
2880
AC_DEFUN(TEA_SETUP_COMPILER, [
2881
# Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
2882
AC_REQUIRE([TEA_SETUP_COMPILER_CC])
2884
#------------------------------------------------------------------------
2885
# If we're using GCC, see if the compiler understands -pipe. If so, use it.
2886
# It makes compiling go faster. (This is only a performance feature.)
2887
#------------------------------------------------------------------------
2889
if test -z "$no_pipe" -a -n "$GCC"; then
2890
AC_MSG_CHECKING([if the compiler understands -pipe])
2893
AC_TRY_COMPILE(,, AC_MSG_RESULT([yes]), CC="$OLDCC"
2894
AC_MSG_RESULT([no]))
2897
#--------------------------------------------------------------------
2898
# Common compiler flag setup
2899
#--------------------------------------------------------------------
2904
if test "${TEA_PLATFORM}" = "unix" ; then
2906
TEA_MISSING_POSIX_HEADERS
2907
# Let the user call this, because if it triggers, they will
2908
# need a compat/strtod.c that is correct. Users can also
2909
# use Tcl_GetDouble(FromObj) instead.
2914
#------------------------------------------------------------------------
2917
# Generate a line that can be used to build a shared/unshared library
2918
# in a platform independent manner.
2927
# Defines the following vars:
2928
# CFLAGS - Done late here to note disturb other AC macros
2929
# MAKE_LIB - Command to execute to build the Tcl library;
2930
# differs depending on whether or not Tcl is being
2931
# compiled as a shared library.
2932
# MAKE_SHARED_LIB Makefile rule for building a shared library
2933
# MAKE_STATIC_LIB Makefile rule for building a static library
2934
# MAKE_STUB_LIB Makefile rule for building a stub library
2935
#------------------------------------------------------------------------
2937
AC_DEFUN(TEA_MAKE_LIB, [
2938
if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
2939
MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)"
2940
MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_FLAGS} \${SHLIB_LD_LIBS} \$(LDFLAGS) -out:\[$]@ \$(PKG_OBJECTS)"
2941
MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)"
2943
MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)"
2944
MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_FLAGS} \${SHLIB_LD_LIBS}"
2945
MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)"
2948
if test "${SHARED_BUILD}" = "1" ; then
2949
MAKE_LIB="${MAKE_SHARED_LIB} "
2951
MAKE_LIB="${MAKE_STATIC_LIB} "
2954
#--------------------------------------------------------------------
2955
# Shared libraries and static libraries have different names.
2956
# Use the double eval to make sure the ${DBGX} in the suffix is
2958
#--------------------------------------------------------------------
2960
RANLIB_STUB="${RANLIB}"
2961
if test "${TEA_PLATFORM}" = "windows" ; then
2962
if test "${SHARED_BUILD}" = "1" ; then
2963
# We force the unresolved linking of symbols that are really in
2964
# the private libraries of Tcl and Tk.
2965
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\""
2966
if test x"${TK_BIN_DIR}" != x ; then
2967
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\""
2969
eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
2972
eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
2974
# Some packages build there own stubs libraries
2975
eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
2977
if test "${SHARED_BUILD}" = "1" ; then
2978
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}"
2979
if test x"${TK_BIN_DIR}" != x ; then
2980
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}"
2982
eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
2985
eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
2987
# Some packages build there own stubs libraries
2988
eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
2991
# These are escaped so that only CFLAGS is picked up at configure time.
2992
# The other values will be substituted at make time.
2993
CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}"
2994
if test "${SHARED_BUILD}" = "1" ; then
2995
CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}"
2999
AC_SUBST(MAKE_SHARED_LIB)
3000
AC_SUBST(MAKE_STATIC_LIB)
3001
AC_SUBST(MAKE_STUB_LIB)
3002
AC_SUBST(RANLIB_STUB)
3005
#------------------------------------------------------------------------
3008
# Compute the name of an existing object library located in libdir
3009
# from the given base name and produce the appropriate linker flags.
3012
# basename The base name of the library without version
3013
# numbers, extensions, or "lib" prefixes.
3014
# extra_dir Extra directory in which to search for the
3015
# library. This location is used first, then
3016
# $prefix/$exec-prefix, then some defaults.
3019
# TEA_INIT and TEA_PREFIX must be called first.
3023
# Defines the following vars:
3024
# ${basename}_LIB_NAME The computed library name.
3025
# ${basename}_LIB_SPEC The computed linker flags.
3026
#------------------------------------------------------------------------
3028
AC_DEFUN(TEA_LIB_SPEC, [
3029
AC_MSG_CHECKING([for $1 library])
3031
# Look in exec-prefix for the library (defined by TEA_PREFIX).
3033
tea_lib_name_dir="${exec_prefix}/lib"
3035
# Or in a user-specified location.
3037
if test x"$2" != x ; then
3038
tea_extra_lib_dir=$2
3040
tea_extra_lib_dir=NONE
3044
`ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
3045
`ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \
3046
`ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
3047
`ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \
3048
`ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \
3049
`ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \
3050
`ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \
3051
`ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do
3052
if test -f "$i" ; then
3053
tea_lib_name_dir=`dirname $i`
3054
$1_LIB_NAME=`basename $i`
3060
if test "${TEA_PLATFORM}" = "windows"; then
3061
$1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\"
3063
# Strip off the leading "lib" and trailing ".a" or ".so"
3065
tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'`
3066
$1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}"
3069
if test "x${$1_LIB_NAME}" = x ; then
3070
AC_MSG_ERROR([not found])
3072
AC_MSG_RESULT([${$1_LIB_SPEC}])
3076
#------------------------------------------------------------------------
3077
# TEA_PRIVATE_TCL_HEADERS --
3079
# Locate the private Tcl include files
3084
# TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has
3085
# already been called.
3089
# Substs the following vars:
3090
# TCL_TOP_DIR_NATIVE
3091
# TCL_GENERIC_DIR_NATIVE
3092
# TCL_UNIX_DIR_NATIVE
3093
# TCL_WIN_DIR_NATIVE
3094
# TCL_BMAP_DIR_NATIVE
3095
# TCL_TOOL_DIR_NATIVE
3096
# TCL_PLATFORM_DIR_NATIVE
3097
# TCL_BIN_DIR_NATIVE
3099
#------------------------------------------------------------------------
3101
AC_DEFUN(TEA_PRIVATE_TCL_HEADERS, [
3102
AC_MSG_CHECKING([for Tcl private include files])
3104
if test "${TEA_PLATFORM}" = "windows"; then
3105
TCL_TOP_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}`\"
3106
TCL_GENERIC_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/generic`\"
3107
TCL_UNIX_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/unix`\"
3108
TCL_WIN_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/win`\"
3109
TCL_BMAP_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/bitmaps`\"
3110
TCL_TOOL_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/tools`\"
3111
TCL_COMPAT_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/compat`\"
3112
TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE}
3114
TCL_TOP_DIR_NATIVE='$(TCL_SRC_DIR)'
3115
TCL_GENERIC_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/generic'
3116
TCL_UNIX_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/unix'
3117
TCL_WIN_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/win'
3118
TCL_BMAP_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/bitmaps'
3119
TCL_TOOL_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/tools'
3120
TCL_COMPAT_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/compat'
3121
TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE}
3124
AC_SUBST(TCL_TOP_DIR_NATIVE)
3125
AC_SUBST(TCL_GENERIC_DIR_NATIVE)
3126
AC_SUBST(TCL_UNIX_DIR_NATIVE)
3127
AC_SUBST(TCL_WIN_DIR_NATIVE)
3128
AC_SUBST(TCL_BMAP_DIR_NATIVE)
3129
AC_SUBST(TCL_TOOL_DIR_NATIVE)
3130
AC_SUBST(TCL_PLATFORM_DIR_NATIVE)
3132
TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}"
3133
AC_SUBST(TCL_INCLUDES)
3134
AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}])
3137
#------------------------------------------------------------------------
3138
# TEA_PUBLIC_TCL_HEADERS --
3140
# Locate the installed public Tcl header files
3146
# CYGPATH must be set
3150
# Adds a --with-tclinclude switch to configure.
3153
# Substs the following vars:
3155
#------------------------------------------------------------------------
3157
AC_DEFUN(TEA_PUBLIC_TCL_HEADERS, [
3158
AC_MSG_CHECKING([for Tcl public headers])
3160
AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval})
3162
AC_CACHE_VAL(ac_cv_c_tclh, [
3163
# Use the value from --with-tclinclude, if it was given
3165
if test x"${with_tclinclude}" != x ; then
3166
if test -f "${with_tclinclude}/tcl.h" ; then
3167
ac_cv_c_tclh=${with_tclinclude}
3169
AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h])
3172
# Check order: pkg --prefix location, Tcl's --prefix location,
3173
# directory of tclConfig.sh, and Tcl source directory.
3174
# Looking in the source dir is not ideal, but OK.
3176
eval "temp_includedir=${includedir}"
3177
list="`ls -d ${temp_includedir} 2>/dev/null` \
3178
`ls -d ${TCL_PREFIX}/include 2>/dev/null` \
3179
`ls -d ${TCL_BIN_DIR}/../include 2>/dev/null` \
3180
`ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`"
3181
if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
3182
list="$list /usr/local/include /usr/include"
3185
if test -f "$i/tcl.h" ; then
3193
# Print a message based on how we determined the include path
3195
if test x"${ac_cv_c_tclh}" = x ; then
3196
AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude])
3198
AC_MSG_RESULT([${ac_cv_c_tclh}])
3201
# Convert to a native path and substitute into the output files.
3203
INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}`
3205
TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
3207
AC_SUBST(TCL_INCLUDES)
3210
#------------------------------------------------------------------------
3211
# TEA_PRIVATE_TK_HEADERS --
3213
# Locate the private Tk include files
3218
# TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has
3219
# already been called.
3223
# Substs the following vars:
3225
#------------------------------------------------------------------------
3227
AC_DEFUN(TEA_PRIVATE_TK_HEADERS, [
3228
AC_MSG_CHECKING([for Tk private include files])
3230
if test "${TEA_PLATFORM}" = "windows"; then
3231
TK_TOP_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}`\"
3232
TK_UNIX_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/unix`\"
3233
TK_WIN_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/win`\"
3234
TK_GENERIC_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/generic`\"
3235
TK_XLIB_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/xlib`\"
3236
TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE}
3238
TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE} -I${TK_XLIB_DIR_NATIVE}"
3240
TK_TOP_DIR_NATIVE='$(TK_SRC_DIR)'
3241
TK_GENERIC_DIR_NATIVE='$(TK_TOP_DIR_NATIVE)/generic'
3242
TK_UNIX_DIR_NATIVE='$(TK_TOP_DIR_NATIVE)/unix'
3243
TK_WIN_DIR_NATIVE='$(TK_TOP_DIR_NATIVE)/win'
3244
TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE}
3246
TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}"
3249
AC_SUBST(TK_TOP_DIR_NATIVE)
3250
AC_SUBST(TK_UNIX_DIR_NATIVE)
3251
AC_SUBST(TK_WIN_DIR_NATIVE)
3252
AC_SUBST(TK_GENERIC_DIR_NATIVE)
3253
AC_SUBST(TK_XLIB_DIR_NATIVE)
3254
AC_SUBST(TK_PLATFORM_DIR_NATIVE)
3256
AC_SUBST(TK_INCLUDES)
3257
AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}])
3260
#------------------------------------------------------------------------
3261
# TEA_PUBLIC_TK_HEADERS --
3263
# Locate the installed public Tk header files
3269
# CYGPATH must be set
3273
# Adds a --with-tkinclude switch to configure.
3276
# Substs the following vars:
3278
#------------------------------------------------------------------------
3280
AC_DEFUN(TEA_PUBLIC_TK_HEADERS, [
3281
AC_MSG_CHECKING([for Tk public headers])
3283
AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files.], with_tkinclude=${withval})
3285
AC_CACHE_VAL(ac_cv_c_tkh, [
3286
# Use the value from --with-tkinclude, if it was given
3288
if test x"${with_tkinclude}" != x ; then
3289
if test -f "${with_tkinclude}/tk.h" ; then
3290
ac_cv_c_tkh=${with_tkinclude}
3292
AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h])
3295
# Check order: pkg --prefix location, Tcl's --prefix location,
3296
# directory of tclConfig.sh, and Tcl source directory.
3297
# Looking in the source dir is not ideal, but OK.
3299
eval "temp_includedir=${includedir}"
3300
list="`ls -d ${temp_includedir} 2>/dev/null` \
3301
`ls -d ${TK_PREFIX}/include 2>/dev/null` \
3302
`ls -d ${TCL_PREFIX}/include 2>/dev/null` \
3303
`ls -d ${TCL_BIN_DIR}/../include 2>/dev/null` \
3304
`ls -d ${TK_SRC_DIR}/generic 2>/dev/null`"
3305
if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
3306
list="$list /usr/local/include /usr/include"
3309
if test -f "$i/tk.h" ; then
3317
# Print a message based on how we determined the include path
3319
if test x"${ac_cv_c_tkh}" = x ; then
3320
AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude])
3322
AC_MSG_RESULT([${ac_cv_c_tkh}])
3325
# Convert to a native path and substitute into the output files.
3327
INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}`
3329
TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
3331
AC_SUBST(TK_INCLUDES)
3333
if test "${TEA_PLATFORM}" = "windows" ; then
3334
# On Windows, we need the X compat headers
3335
AC_MSG_CHECKING([for X11 header files])
3336
if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then
3337
INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`"
3338
TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
3339
AC_SUBST(TK_XINCLUDES)
3341
AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}])
3345
#------------------------------------------------------------------------
3347
# Locate a tclsh shell in the following directories:
3348
# ${TCL_BIN_DIR} ${TCL_BIN_DIR}/../bin
3349
# ${exec_prefix}/bin ${prefix}/bin
3356
# Subst's the following values:
3358
#------------------------------------------------------------------------
3360
AC_DEFUN(TEA_PROG_TCLSH, [
3361
AC_MSG_CHECKING([for tclsh])
3363
AC_CACHE_VAL(ac_cv_path_tclsh, [
3364
if test "x${CELIB_DIR}" != "x" ; then
3365
# If CELIB_DIR is defined, assume Windows/CE target is requested
3366
# which means target tclsh cannot be run (cross-compile)
3367
search_path=`echo ${PATH} | sed -e 's/:/ /g'`
3369
search_path=`echo ${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${exec_prefix}/bin:${prefix}/bin:${PATH} | sed -e 's/:/ /g'`
3371
for dir in $search_path ; do
3372
for j in `ls -r $dir/tclsh[[8-9]]*${EXEEXT} 2> /dev/null` \
3373
`ls -r $dir/tclsh*${EXEEXT} 2> /dev/null` ; do
3374
if test x"$ac_cv_path_tclsh" = x ; then
3375
if test -f "$j" ; then
3384
if test -f "$ac_cv_path_tclsh" ; then
3385
TCLSH_PROG=$ac_cv_path_tclsh
3386
AC_MSG_RESULT([$TCLSH_PROG])
3388
AC_MSG_ERROR([No tclsh found in PATH: $search_path])
3390
AC_SUBST(TCLSH_PROG)
3393
#------------------------------------------------------------------------
3395
# Locate a wish shell in the following directories:
3396
# ${TK_BIN_DIR} ${TK_BIN_DIR}/../bin
3397
# ${TCL_BIN_DIR} ${TCL_BIN_DIR}/../bin
3398
# ${exec_prefix}/bin ${prefix}/bin
3405
# Subst's the following values:
3407
#------------------------------------------------------------------------
3409
AC_DEFUN(TEA_PROG_WISH, [
3410
AC_MSG_CHECKING([for wish])
3412
AC_CACHE_VAL(ac_cv_path_wish, [
3413
if test "x${CELIB_DIR}" != "x" ; then
3414
# If CELIB_DIR is defined, assume Windows/CE target is requested
3415
# which means target wish cannot be run (cross-compile)
3416
search_path=`echo ${PATH} | sed -e 's/:/ /g'`
3418
search_path=`echo ${TK_BIN_DIR}:${TK_BIN_DIR}/../bin:${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${exec_prefix}/bin:${prefix}/bin:${PATH} | sed -e 's/:/ /g'`
3420
for dir in $search_path ; do
3421
for j in `ls -r $dir/wish[[8-9]]*${EXEEXT} 2> /dev/null` \
3422
`ls -r $dir/wish*${EXEEXT} 2> /dev/null` ; do
3423
if test x"$ac_cv_path_wish" = x ; then
3424
if test -f "$j" ; then
3433
if test -f "$ac_cv_path_wish" ; then
3434
WISH_PROG=$ac_cv_path_wish
3435
AC_MSG_RESULT([$WISH_PROG])
3437
AC_MSG_ERROR([No wish found in PATH: $search_path])
3442
#------------------------------------------------------------------------
3443
# TEA_PATH_CONFIG --
3445
# Locate the ${1}Config.sh file and perform a sanity check on
3446
# the ${1} compile flags. These are used by packages like
3447
# [incr Tk] that load *Config.sh files from more than Tcl and Tk.
3454
# Adds the following arguments to configure:
3457
# Defines the following vars:
3458
# $1_BIN_DIR Full path to the directory containing
3459
# the $1Config.sh file
3460
#------------------------------------------------------------------------
3462
AC_DEFUN(TEA_PATH_CONFIG, [
3464
# Ok, lets find the $1 configuration
3465
# First, look for one uninstalled.
3466
# the alternative search directory is invoked by --with-$1
3469
if test x"${no_$1}" = x ; then
3470
# we reset no_$1 in case something fails here
3472
AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval})
3473
AC_MSG_CHECKING([for $1 configuration])
3474
AC_CACHE_VAL(ac_cv_c_$1config,[
3476
# First check to see if --with-$1 was specified.
3477
if test x"${with_$1config}" != x ; then
3478
if test -f "${with_$1config}/$1Config.sh" ; then
3479
ac_cv_c_$1config=`(cd ${with_$1config}; pwd)`
3481
AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh])
3485
# then check for a private $1 installation
3486
if test x"${ac_cv_c_$1config}" = x ; then
3489
`ls -dr ../$1[[8-9]].[[0-9]]* 2>/dev/null` \
3491
`ls -dr ../../$1[[8-9]].[[0-9]]* 2>/dev/null` \
3493
`ls -dr ../../../$1[[8-9]].[[0-9]]* 2>/dev/null` \
3495
`ls -dr ${srcdir}/../$1[[8-9]].[[0-9]]* 2>/dev/null` \
3497
if test -f "$i/$1Config.sh" ; then
3498
ac_cv_c_$1config=`(cd $i; pwd)`
3501
if test -f "$i/unix/$1Config.sh" ; then
3502
ac_cv_c_$1config=`(cd $i/unix; pwd)`
3508
# check in a few common install locations
3509
if test x"${ac_cv_c_$1config}" = x ; then
3510
for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \
3511
`ls -d ${prefix}/lib 2>/dev/null` \
3512
`ls -d /usr/local/lib 2>/dev/null` \
3513
`ls -d /usr/contrib/lib 2>/dev/null` \
3514
`ls -d /usr/lib 2>/dev/null` \
3516
if test -f "$i/$1Config.sh" ; then
3517
ac_cv_c_$1config=`(cd $i; pwd)`
3524
if test x"${ac_cv_c_$1config}" = x ; then
3525
$1_BIN_DIR="# no $1 configs found"
3526
AC_MSG_WARN("Cannot find $1 configuration definitions")
3530
$1_BIN_DIR=${ac_cv_c_$1config}
3531
AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh])
3536
#------------------------------------------------------------------------
3537
# TEA_LOAD_CONFIG --
3539
# Load the $1Config.sh file
3543
# Requires the following vars to be set:
3548
# Subst the following vars:
3553
#------------------------------------------------------------------------
3555
AC_DEFUN(TEA_LOAD_CONFIG, [
3556
AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh])
3558
if test -f "${$1_BIN_DIR}/$1Config.sh" ; then
3559
AC_MSG_RESULT([loading])
3560
. ${$1_BIN_DIR}/$1Config.sh
3562
AC_MSG_RESULT([file not found])
3566
# If the $1_BIN_DIR is the build directory (not the install directory),
3567
# then set the common variable name to the value of the build variables.
3568
# For example, the variable $1_LIB_SPEC will be set to the value
3569
# of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC
3570
# instead of $1_BUILD_LIB_SPEC since it will work with both an
3571
# installed and uninstalled version of Tcl.
3574
if test -f ${$1_BIN_DIR}/Makefile ; then
3575
AC_MSG_WARN([Found Makefile - using build library specs for $1])
3576
$1_LIB_SPEC=${$1_BUILD_LIB_SPEC}
3577
$1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC}
3578
$1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH}
3581
AC_SUBST($1_VERSION)
3582
AC_SUBST($1_SRC_DIR)
3584
AC_SUBST($1_LIB_FILE)
3585
AC_SUBST($1_LIB_SPEC)
3587
AC_SUBST($1_STUB_LIB_FILE)
3588
AC_SUBST($1_STUB_LIB_SPEC)
3589
AC_SUBST($1_STUB_LIB_PATH)
3592
#------------------------------------------------------------------------
3595
# Locate Keuchel's celib emulation layer for targeting Win/CE
3602
# Adds the following arguments to configure:
3605
# Defines the following vars:
3606
# CELIB_DIR Full path to the directory containing
3607
# the include and platform lib files
3608
#------------------------------------------------------------------------
3610
AC_DEFUN(TEA_PATH_CELIB, [
3611
# First, look for one uninstalled.
3612
# the alternative search directory is invoked by --with-celib
3614
if test x"${no_celib}" = x ; then
3615
# we reset no_celib in case something fails here
3617
AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval})
3618
AC_MSG_CHECKING([for Windows/CE celib directory])
3619
AC_CACHE_VAL(ac_cv_c_celibconfig,[
3620
# First check to see if --with-celibconfig was specified.
3621
if test x"${with_celibconfig}" != x ; then
3622
if test -d "${with_celibconfig}/inc" ; then
3623
ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)`
3625
AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory])
3629
# then check for a celib library
3630
if test x"${ac_cv_c_celibconfig}" = x ; then
3634
../../celib-palm-3.0 \
3636
`ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \
3637
${srcdir}/../celib-palm-3.0 \
3638
${srcdir}/../celib \
3639
`ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \
3641
if test -d "$i/inc" ; then
3642
ac_cv_c_celibconfig=`(cd $i; pwd)`
3648
if test x"${ac_cv_c_celibconfig}" = x ; then
3649
CELIB_DIR="# no Celib configs found"
3650
AC_MSG_ERROR([Cannot find celib support library directory])
3653
CELIB_DIR=${ac_cv_c_celibconfig}
3654
AC_MSG_RESULT([found $CELIB_DIR])