summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
Diffstat (limited to 'unix')
-rw-r--r--unix/Makefile.in1745
-rw-r--r--unix/README12
-rwxr-xr-xunix/config.status.lineno920
-rwxr-xr-xunix/configure23030
-rw-r--r--unix/configure.in (renamed from unix/configure.ac)521
-rw-r--r--unix/dltest/Makefile.in56
-rw-r--r--unix/dltest/pkga.c42
-rw-r--r--unix/dltest/pkgb.c83
-rw-r--r--unix/dltest/pkgc.c47
-rw-r--r--unix/dltest/pkgd.c47
-rw-r--r--unix/dltest/pkge.c12
-rw-r--r--unix/dltest/pkgooa.c148
-rw-r--r--unix/dltest/pkgt.c118
-rw-r--r--unix/dltest/pkgua.c104
-rwxr-xr-xunix/install-sh437
-rwxr-xr-xunix/installManPage71
-rwxr-xr-xunix/ldAix6
-rw-r--r--unix/tcl.m41459
-rw-r--r--unix/tcl.pc.in8
-rw-r--r--unix/tcl.spec4
-rw-r--r--unix/tclAppInit.c116
-rw-r--r--unix/tclConfig.h.in264
-rw-r--r--unix/tclConfig.sh.in13
-rw-r--r--unix/tclEpollNotfy.c844
-rw-r--r--unix/tclKqueueNotfy.c840
-rw-r--r--unix/tclLoadAix.c36
-rw-r--r--unix/tclLoadDl.c177
-rw-r--r--unix/tclLoadDyld.c432
-rw-r--r--unix/tclLoadNext.c87
-rw-r--r--unix/tclLoadOSF.c89
-rw-r--r--unix/tclLoadShl.c91
-rw-r--r--unix/tclSelectNotfy.c1233
-rw-r--r--unix/tclUnixChan.c2678
-rw-r--r--unix/tclUnixCompat.c100
-rw-r--r--unix/tclUnixEvent.c6
-rw-r--r--unix/tclUnixFCmd.c944
-rw-r--r--unix/tclUnixFile.c528
-rw-r--r--unix/tclUnixInit.c823
-rw-r--r--unix/tclUnixNotfy.c1475
-rw-r--r--unix/tclUnixPipe.c497
-rw-r--r--unix/tclUnixPort.h605
-rw-r--r--unix/tclUnixSock.c1837
-rw-r--r--unix/tclUnixTest.c441
-rw-r--r--unix/tclUnixThrd.c533
-rw-r--r--unix/tclUnixThrd.h19
-rw-r--r--unix/tclUnixTime.c283
-rw-r--r--unix/tclXtNotify.c58
-rw-r--r--unix/tclXtTest.c60
-rw-r--r--unix/tclooConfig.sh19
49 files changed, 23336 insertions, 20662 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 0a9d84e..84d0391 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -28,7 +28,6 @@ bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
datarootdir = @datarootdir@
-runstatedir = @runstatedir@
mandir = @mandir@
# The following definition can be set to non-null for special systems like AFS
@@ -53,9 +52,6 @@ DLL_INSTALL_DIR = @DLL_INSTALL_DIR@
# Path name to use when installing library scripts.
SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TCL_LIBRARY)
-# Path name to use when installing Tcl modules.
-MODULE_INSTALL_DIR = $(SCRIPT_INSTALL_DIR)/../tcl8
-
# Directory in which to install the include file tcl.h:
INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir)
@@ -86,9 +82,6 @@ HTML_INSTALL_DIR = $(INSTALL_ROOT)$(HTML_DIR)
# Directory in which to install the configuration file tclConfig.sh
CONFIG_INSTALL_DIR = $(INSTALL_ROOT)$(libdir)
-# Directory in which to install bundled packages:
-PACKAGE_DIR = @PACKAGE_DIR@
-
# Package search path.
TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@
@@ -114,6 +107,11 @@ LDFLAGS_DEBUG = @LDFLAGS_DEBUG@
LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@
LDFLAGS = @LDFLAGS_DEFAULT@ @LDFLAGS@
+# To disable ANSI-C procedure prototypes reverse the comment characters on the
+# following lines:
+PROTO_FLAGS =
+#PROTO_FLAGS = -DNO_PROTOTYPE
+
# If you use the setenv, putenv, or unsetenv procedures to modify environment
# variables in your application and you'd like those modifications to appear
# in the "env" Tcl variable, switch the comments on the two lines below so
@@ -150,8 +148,8 @@ SHELL = @MAKEFILE_SHELL@
# around; better to use the install-sh script that comes with the
# distribution, which is slower but guaranteed to work.
-INSTALL_STRIP_PROGRAM = strip
-INSTALL_STRIP_LIBRARY = strip -x
+INSTALL_STRIP_PROGRAM = -s
+INSTALL_STRIP_LIBRARY = -S -x
INSTALL = $(SHELL) $(UNIX_DIR)/install-sh -c
INSTALL_PROGRAM = ${INSTALL}
@@ -159,18 +157,14 @@ INSTALL_LIBRARY = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_DATA_DIR = ${INSTALL} -d -m 755
-# NATIVE_TCLSH is the name of a tclsh executable that is available *BEFORE*
-# running make for the first time. Certain build targets (make genstubs) need
-# it to be available on the PATH. This executable should *NOT* be required
-# just to do a normal build although it can be required to run make dist.
-# Do not use SHELL_ENV for NATIVE_TCLSH unless it is the tclsh being built.
-EXE_SUFFIX = @EXEEXT@
-TCL_EXE = tclsh${EXE_SUFFIX}
-TCLTEST_EXE = tcltest${EXE_SUFFIX}
-NATIVE_TCLSH = @TCLSH_PROG@
+# TCL_EXE is the name of a tclsh executable that is available *BEFORE* running
+# make for the first time. Certain build targets (make genstubs) need it to be
+# available on the PATH. This executable should *NOT* be required just to do a
+# normal build although it can be required to run make dist.
+TCL_EXE = tclsh@EXEEXT@
# The symbols below provide support for dynamic loading and shared libraries.
-# See configure.ac for a description of what the symbols mean. The values of
+# See configure.in for a description of what the symbols mean. The values of
# the symbols are normally set by the configure script. You shouldn't normally
# need to modify any of these definitions by hand.
@@ -178,10 +172,10 @@ STLIB_LD = @STLIB_LD@
SHLIB_LD = @SHLIB_LD@
SHLIB_CFLAGS = @SHLIB_CFLAGS@
SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
-SHLIB_LD_FLAGS = @SHLIB_LD_FLAGS@
TCL_SHLIB_LD_EXTRAS = @TCL_SHLIB_LD_EXTRAS@
SHLIB_SUFFIX = @SHLIB_SUFFIX@
+#SHLIB_SUFFIX =
DLTEST_TARGETS = dltest.marker
@@ -209,7 +203,7 @@ TCL_LIB_FLAG = @TCL_LIB_FLAG@
#TCL_LIB_FLAG = -ltcl
# support for embedded libraries on Darwin / Mac OS X
-DYLIB_INSTALL_DIR = $(libdir)
+DYLIB_INSTALL_DIR = ${LIB_RUNTIME_DIR}
#--------------------------------------------------------------------------
# The information below is modified by the configure script when Makefile is
@@ -224,32 +218,25 @@ AR = @AR@
RANLIB = @RANLIB@
DTRACE = @DTRACE@
SRC_DIR = @srcdir@
-TOP_DIR = @TCL_SRC_DIR@
+TOP_DIR = $(SRC_DIR)/..
BUILD_DIR = @builddir@
GENERIC_DIR = $(TOP_DIR)/generic
+TOMMATH_DIR = $(TOP_DIR)/libtommath
COMPAT_DIR = $(TOP_DIR)/compat
TOOL_DIR = $(TOP_DIR)/tools
UNIX_DIR = $(TOP_DIR)/unix
MAC_OSX_DIR = $(TOP_DIR)/macosx
-PKGS_DIR = $(TOP_DIR)/pkgs
# Must be absolute because of the cd dltest $(DLTEST_DIR)/configure below.
DLTEST_DIR = @TCL_SRC_DIR@/unix/dltest
# Must be absolute to so the corresponding tcltest's tcl_library is absolute.
-TCL_BUILDTIME_LIBRARY = @TCL_BUILDTIME_LIBRARY@
-
-ZLIB_DIR = ${COMPAT_DIR}/zlib
-ZLIB_INCLUDE = @ZLIB_INCLUDE@
-TOMMATH_DIR = $(TOP_DIR)/libtommath
-TOMMATH_INCLUDE = @TOMMATH_INCLUDE@
+TCL_BUILDTIME_LIBRARY = @TCL_SRC_DIR@/library
CC = @CC@
-OBJEXT = @OBJEXT@
-
#CC = purify -best-effort @CC@ -DPURIFY
# Flags to be passed to installManPage to control how the manpages should be
# installed (symlinks, compression, package name suffix).
-MAN_FLAGS = @MAN_FLAGS@
+MAN_FLAGS = @MAN_FLAGS@
# If non-empty, install the timezone files that are included with Tcl,
# otherwise use the ones that ship with the OS.
@@ -262,33 +249,24 @@ INSTALL_TZDATA = @INSTALL_TZDATA@
#--------------------------------------------------------------------------
GDB = gdb
-LLDB = lldb
-TRACE = strace
-TRACE_OPTS =
-VALGRIND = valgrind
-VALGRINDARGS = --tool=memcheck --num-callers=24 \
- --leak-resolution=high --leak-check=yes --show-reachable=yes -v \
- --keep-debuginfo=yes \
- --suppressions=$(TOOL_DIR)/valgrind_suppress
#--------------------------------------------------------------------------
# The information below should be usable as is. The configure script won't
# modify it and you shouldn't need to modify it either.
#--------------------------------------------------------------------------
-STUB_CC_SWITCHES = -I"${BUILD_DIR}" -I${UNIX_DIR} -I${GENERIC_DIR} -I${TOMMATH_DIR} \
- ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \
- ${AC_FLAGS} ${ENV_FLAGS} ${EXTRA_CFLAGS} @EXTRA_CC_SWITCHES@ \
- ${NO_DEPRECATED_FLAGS} -DMP_FIXED_CUTOFFS
+STUB_CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \
+-I"${BUILD_DIR}" -I${UNIX_DIR} -I${GENERIC_DIR} -I${TOMMATH_DIR} \
+${AC_FLAGS} ${PROTO_FLAGS} ${ENV_FLAGS} ${EXTRA_CFLAGS} @EXTRA_CC_SWITCHES@
-CC_SWITCHES = $(STUB_CC_SWITCHES) -DBUILD_tcl
+CC_SWITCHES = $(STUB_CC_SWITCHES) ${NO_DEPRECATED_FLAGS}
-APP_CC_SWITCHES = $(STUB_CC_SWITCHES) @EXTRA_APP_CC_SWITCHES@
+APP_CC_SWITCHES = $(CC_SWITCHES) @EXTRA_APP_CC_SWITCHES@
LIBS = @TCL_LIBS@
DEPEND_SWITCHES = ${CFLAGS} -I${UNIX_DIR} -I${GENERIC_DIR} \
- ${AC_FLAGS} ${EXTRA_CFLAGS} @EXTRA_CC_SWITCHES@
+${AC_FLAGS} ${PROTO_FLAGS} ${EXTRA_CFLAGS} @EXTRA_CC_SWITCHES@
TCLSH_OBJS = tclAppInit.o
@@ -299,83 +277,65 @@ XTTEST_OBJS = xtTestInit.o tclTest.o tclTestObj.o tclTestProcBodyObj.o \
tclThreadTest.o tclUnixTest.o tclXtNotify.o tclXtTest.o
GENERIC_OBJS = regcomp.o regexec.o regfree.o regerror.o tclAlloc.o \
- tclArithSeries.o tclAssembly.o tclAsync.o tclBasic.o tclBinary.o \
- tclCkalloc.o tclClock.o tclCmdAH.o tclCmdIL.o tclCmdMZ.o \
- tclCompCmds.o tclCompCmdsGR.o tclCompCmdsSZ.o tclCompExpr.o \
- tclCompile.o tclConfig.o tclDate.o tclDictObj.o tclDisassemble.o \
- tclEncoding.o tclEnsemble.o \
+ tclAsync.o tclBasic.o tclBinary.o tclCkalloc.o tclClock.o \
+ tclCmdAH.o tclCmdIL.o tclCmdMZ.o tclCompCmds.o tclCompExpr.o \
+ tclCompile.o tclConfig.o tclDate.o tclDictObj.o tclEncoding.o \
tclEnv.o tclEvent.o tclExecute.o tclFCmd.o tclFileName.o tclGet.o \
tclHash.o tclHistory.o tclIndexObj.o tclInterp.o tclIO.o tclIOCmd.o \
- tclIORChan.o tclIORTrans.o tclIOGT.o tclIOSock.o tclIOUtil.o \
- tclLink.o tclListObj.o \
+ tclIORChan.o tclIOGT.o tclIOSock.o tclIOUtil.o tclLink.o tclListObj.o \
tclLiteral.o tclLoad.o tclMain.o tclNamesp.o tclNotify.o \
- tclObj.o tclOptimize.o tclPanic.o tclParse.o tclPathObj.o tclPipe.o \
+ tclObj.o tclPanic.o tclParse.o tclPathObj.o tclPipe.o \
tclPkg.o tclPkgConfig.o tclPosixStr.o \
- tclPreserve.o tclProc.o tclProcess.o tclRegexp.o \
+ tclPreserve.o tclProc.o tclRegexp.o \
tclResolve.o tclResult.o tclScan.o tclStringObj.o \
tclStrToD.o tclThread.o \
tclThreadAlloc.o tclThreadJoin.o tclThreadStorage.o tclStubInit.o \
- tclTimer.o tclTrace.o tclUtf.o tclUtil.o tclVar.o tclZlib.o \
- tclTomMathInterface.o tclZipfs.o
-
-OO_OBJS = tclOO.o tclOOBasic.o tclOOCall.o tclOODefineCmds.o tclOOInfo.o \
- tclOOMethod.o tclOOStubInit.o
+ tclStubLib.o tclTimer.o tclTrace.o tclUtf.o tclUtil.o tclVar.o \
+ tclTomMathInterface.o
-TOMMATH_OBJS = bn_s_mp_reverse.o bn_s_mp_mul_digs_fast.o \
- bn_s_mp_sqr_fast.o bn_mp_add.o bn_mp_and.o \
- bn_mp_add_d.o bn_mp_clamp.o bn_mp_clear.o bn_mp_clear_multi.o \
- bn_mp_cmp.o bn_mp_cmp_d.o bn_mp_cmp_mag.o \
+TOMMATH_OBJS = bncore.o bn_reverse.o bn_fast_s_mp_mul_digs.o \
+ bn_fast_s_mp_sqr.o bn_mp_add.o bn_mp_and.o \
+ bn_mp_add_d.o bn_mp_clamp.o bn_mp_clear.o bn_mp_clear_multi.o \
+ bn_mp_cmp.o bn_mp_cmp_d.o bn_mp_cmp_mag.o \
bn_mp_cnt_lsb.o bn_mp_copy.o \
bn_mp_count_bits.o bn_mp_div.o bn_mp_div_d.o bn_mp_div_2.o \
- bn_mp_div_2d.o bn_mp_div_3.o bn_mp_exch.o bn_mp_expt_u32.o \
- bn_mp_get_mag_u64.o \
- bn_mp_grow.o bn_mp_init.o \
+ bn_mp_div_2d.o bn_mp_div_3.o \
+ bn_mp_exch.o bn_mp_expt_d.o bn_mp_grow.o bn_mp_init.o \
bn_mp_init_copy.o bn_mp_init_multi.o bn_mp_init_set.o \
- bn_mp_init_size.o bn_s_mp_karatsuba_mul.o \
- bn_mp_init_i64.o bn_mp_init_u64.o \
- bn_s_mp_karatsuba_sqr.o bn_s_mp_balance_mul.o \
- bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mul.o bn_mp_mul_2.o \
- bn_mp_mul_2d.o bn_mp_mul_d.o bn_mp_neg.o bn_mp_or.o bn_mp_pack.o \
- bn_mp_pack_count.o bn_mp_radix_size.o bn_mp_radix_smap.o \
- bn_mp_set_i64.o bn_mp_read_radix.o bn_mp_rshd.o \
- bn_mp_set_u64.o bn_mp_shrink.o \
+ bn_mp_init_set_int.o bn_mp_init_size.o bn_mp_karatsuba_mul.o \
+ bn_mp_karatsuba_sqr.o \
+ bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mul.o bn_mp_mul_2.o \
+ bn_mp_mul_2d.o bn_mp_mul_d.o bn_mp_neg.o bn_mp_or.o \
+ bn_mp_radix_size.o bn_mp_radix_smap.o \
+ bn_mp_read_radix.o bn_mp_rshd.o bn_mp_set.o bn_mp_set_int.o \
+ bn_mp_shrink.o \
bn_mp_sqr.o bn_mp_sqrt.o bn_mp_sub.o bn_mp_sub_d.o \
- bn_mp_signed_rsh.o \
- bn_mp_to_ubin.o bn_mp_unpack.o \
- bn_s_mp_toom_mul.o bn_s_mp_toom_sqr.o bn_mp_to_radix.o \
- bn_mp_ubin_size.o bn_mp_xor.o bn_mp_zero.o bn_s_mp_add.o \
- bn_s_mp_mul_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o
+ bn_mp_to_unsigned_bin.o bn_mp_to_unsigned_bin_n.o \
+ bn_mp_toom_mul.o bn_mp_toom_sqr.o bn_mp_toradix_n.o \
+ bn_mp_unsigned_bin_size.o bn_mp_xor.o bn_mp_zero.o bn_s_mp_add.o \
+ bn_s_mp_mul_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o
-STUB_LIB_OBJS = tclStubLib.o \
- tclTomMathStubLib.o \
- tclOOStubLib.o \
- ${COMPAT_OBJS}
+STUB_LIB_OBJS = tclStubLib.o ${COMPAT_OBJS}
UNIX_OBJS = tclUnixChan.o tclUnixEvent.o tclUnixFCmd.o \
tclUnixFile.o tclUnixPipe.o tclUnixSock.o \
tclUnixTime.o tclUnixInit.o tclUnixThrd.o \
tclUnixCompat.o
-NOTIFY_OBJS = tclEpollNotfy.o tclKqueueNotfy.o tclSelectNotfy.o
+NOTIFY_OBJS = tclUnixNotfy.o
MAC_OSX_OBJS = tclMacOSXBundle.o tclMacOSXFCmd.o tclMacOSXNotify.o
-CYGWIN_OBJS = tclWinError.o
-
DTRACE_OBJ = tclDTrace.o
-ZLIB_OBJS = Zadler32.o Zcompress.o Zcrc32.o Zdeflate.o Zinfback.o \
- Zinffast.o Zinflate.o Zinftrees.o Ztrees.o Zuncompr.o Zzutil.o
-
TCL_OBJS = ${GENERIC_OBJS} ${UNIX_OBJS} ${NOTIFY_OBJS} ${COMPAT_OBJS} \
- ${OO_OBJS} @DL_OBJS@ @PLAT_OBJS@
+ @DL_OBJS@ @PLAT_OBJS@
-OBJS = ${TCL_OBJS} @DTRACE_OBJ@ @ZLIB_OBJS@ @TOMMATH_OBJS@
+OBJS = ${TCL_OBJS} ${TOMMATH_OBJS} @DTRACE_OBJ@
TCL_DECLS = \
$(GENERIC_DIR)/tcl.decls \
$(GENERIC_DIR)/tclInt.decls \
- $(GENERIC_DIR)/tclOO.decls \
$(GENERIC_DIR)/tclTomMath.decls
GENERIC_HDRS = \
@@ -386,10 +346,6 @@ GENERIC_HDRS = \
$(GENERIC_DIR)/tclIntPlatDecls.h \
$(GENERIC_DIR)/tclTomMath.h \
$(GENERIC_DIR)/tclTomMathDecls.h \
- $(GENERIC_DIR)/tclOO.h \
- $(GENERIC_DIR)/tclOODecls.h \
- $(GENERIC_DIR)/tclOOInt.h \
- $(GENERIC_DIR)/tclOOIntDecls.h \
$(GENERIC_DIR)/tclPatch.h \
$(GENERIC_DIR)/tclPlatDecls.h \
$(GENERIC_DIR)/tclPort.h \
@@ -401,8 +357,6 @@ GENERIC_SRCS = \
$(GENERIC_DIR)/regfree.c \
$(GENERIC_DIR)/regerror.c \
$(GENERIC_DIR)/tclAlloc.c \
- $(GENERIC_DIR)/tclArithSeries.c \
- $(GENERIC_DIR)/tclAssembly.c \
$(GENERIC_DIR)/tclAsync.c \
$(GENERIC_DIR)/tclBasic.c \
$(GENERIC_DIR)/tclBinary.c \
@@ -412,16 +366,12 @@ GENERIC_SRCS = \
$(GENERIC_DIR)/tclCmdIL.c \
$(GENERIC_DIR)/tclCmdMZ.c \
$(GENERIC_DIR)/tclCompCmds.c \
- $(GENERIC_DIR)/tclCompCmdsGR.c \
- $(GENERIC_DIR)/tclCompCmdsSZ.c \
$(GENERIC_DIR)/tclCompExpr.c \
$(GENERIC_DIR)/tclCompile.c \
$(GENERIC_DIR)/tclConfig.c \
$(GENERIC_DIR)/tclDate.c \
$(GENERIC_DIR)/tclDictObj.c \
- $(GENERIC_DIR)/tclDisassemble.c \
$(GENERIC_DIR)/tclEncoding.c \
- $(GENERIC_DIR)/tclEnsemble.c \
$(GENERIC_DIR)/tclEnv.c \
$(GENERIC_DIR)/tclEvent.c \
$(GENERIC_DIR)/tclExecute.c \
@@ -438,7 +388,6 @@ GENERIC_SRCS = \
$(GENERIC_DIR)/tclIOSock.c \
$(GENERIC_DIR)/tclIOUtil.c \
$(GENERIC_DIR)/tclIORChan.c \
- $(GENERIC_DIR)/tclIORTrans.c \
$(GENERIC_DIR)/tclLink.c \
$(GENERIC_DIR)/tclListObj.c \
$(GENERIC_DIR)/tclLiteral.c \
@@ -447,8 +396,7 @@ GENERIC_SRCS = \
$(GENERIC_DIR)/tclNamesp.c \
$(GENERIC_DIR)/tclNotify.c \
$(GENERIC_DIR)/tclObj.c \
- $(GENERIC_DIR)/tclOptimize.c \
- $(GENERIC_DIR)/tclParse.c \
+ $(GENERIC_DIR)/tclParse.c \
$(GENERIC_DIR)/tclPathObj.c \
$(GENERIC_DIR)/tclPipe.c \
$(GENERIC_DIR)/tclPkg.c \
@@ -456,12 +404,12 @@ GENERIC_SRCS = \
$(GENERIC_DIR)/tclPosixStr.c \
$(GENERIC_DIR)/tclPreserve.c \
$(GENERIC_DIR)/tclProc.c \
- $(GENERIC_DIR)/tclProcess.c \
$(GENERIC_DIR)/tclRegexp.c \
$(GENERIC_DIR)/tclResolve.c \
$(GENERIC_DIR)/tclResult.c \
$(GENERIC_DIR)/tclScan.c \
$(GENERIC_DIR)/tclStubInit.c \
+ $(GENERIC_DIR)/tclStubLib.c \
$(GENERIC_DIR)/tclStringObj.c \
$(GENERIC_DIR)/tclStrToD.c \
$(GENERIC_DIR)/tclTest.c \
@@ -474,33 +422,18 @@ GENERIC_SRCS = \
$(GENERIC_DIR)/tclTimer.c \
$(GENERIC_DIR)/tclTrace.c \
$(GENERIC_DIR)/tclUtil.c \
- $(GENERIC_DIR)/tclVar.c \
- $(GENERIC_DIR)/tclAssembly.c \
- $(GENERIC_DIR)/tclZlib.c \
- $(GENERIC_DIR)/tclZipfs.c
-
-OO_SRCS = \
- $(GENERIC_DIR)/tclOO.c \
- $(GENERIC_DIR)/tclOOBasic.c \
- $(GENERIC_DIR)/tclOOCall.c \
- $(GENERIC_DIR)/tclOODefineCmds.c \
- $(GENERIC_DIR)/tclOOInfo.c \
- $(GENERIC_DIR)/tclOOMethod.c \
- $(GENERIC_DIR)/tclOOStubInit.c
+ $(GENERIC_DIR)/tclVar.c
STUB_SRCS = \
- $(GENERIC_DIR)/tclStubLib.c \
- $(GENERIC_DIR)/tclTomMathStubLib.c \
- $(GENERIC_DIR)/tclOOStubLib.c
+ $(GENERIC_DIR)/tclStubLib.c
TOMMATH_SRCS = \
- $(TOMMATH_DIR)/bn_cutoffs.c \
- $(TOMMATH_DIR)/bn_deprecated.c \
- $(TOMMATH_DIR)/bn_mp_2expt.c \
- $(TOMMATH_DIR)/bn_mp_abs.c \
+ $(TOMMATH_DIR)/bncore.c \
+ $(TOMMATH_DIR)/bn_reverse.c \
+ $(TOMMATH_DIR)/bn_fast_s_mp_mul_digs.c \
+ $(TOMMATH_DIR)/bn_fast_s_mp_sqr.c \
$(TOMMATH_DIR)/bn_mp_add.c \
$(TOMMATH_DIR)/bn_mp_add_d.c \
- $(TOMMATH_DIR)/bn_mp_addmod.c \
$(TOMMATH_DIR)/bn_mp_and.c \
$(TOMMATH_DIR)/bn_mp_clamp.c \
$(TOMMATH_DIR)/bn_mp_clear.c \
@@ -508,149 +441,57 @@ TOMMATH_SRCS = \
$(TOMMATH_DIR)/bn_mp_cmp.c \
$(TOMMATH_DIR)/bn_mp_cmp_d.c \
$(TOMMATH_DIR)/bn_mp_cmp_mag.c \
- $(TOMMATH_DIR)/bn_mp_cnt_lsb.c \
- $(TOMMATH_DIR)/bn_mp_complement.c \
$(TOMMATH_DIR)/bn_mp_copy.c \
+ $(TOMMATH_DIR)/bn_mp_cnt_lsb.c \
$(TOMMATH_DIR)/bn_mp_count_bits.c \
- $(TOMMATH_DIR)/bn_mp_decr.c \
$(TOMMATH_DIR)/bn_mp_div.c \
+ $(TOMMATH_DIR)/bn_mp_div_d.c \
$(TOMMATH_DIR)/bn_mp_div_2.c \
$(TOMMATH_DIR)/bn_mp_div_2d.c \
$(TOMMATH_DIR)/bn_mp_div_3.c \
- $(TOMMATH_DIR)/bn_mp_div_d.c \
- $(TOMMATH_DIR)/bn_mp_dr_is_modulus.c \
- $(TOMMATH_DIR)/bn_mp_dr_reduce.c \
- $(TOMMATH_DIR)/bn_mp_dr_setup.c \
- $(TOMMATH_DIR)/bn_mp_error_to_string.c \
$(TOMMATH_DIR)/bn_mp_exch.c \
- $(TOMMATH_DIR)/bn_mp_expt_u32.c \
- $(TOMMATH_DIR)/bn_mp_exptmod.c \
- $(TOMMATH_DIR)/bn_mp_exteuclid.c \
- $(TOMMATH_DIR)/bn_mp_fread.c \
- $(TOMMATH_DIR)/bn_mp_from_sbin.c \
- $(TOMMATH_DIR)/bn_mp_from_ubin.c \
- $(TOMMATH_DIR)/bn_mp_fwrite.c \
- $(TOMMATH_DIR)/bn_mp_gcd.c \
- $(TOMMATH_DIR)/bn_mp_get_double.c \
- $(TOMMATH_DIR)/bn_mp_get_i32.c \
- $(TOMMATH_DIR)/bn_mp_get_i64.c \
- $(TOMMATH_DIR)/bn_mp_get_l.c \
- $(TOMMATH_DIR)/bn_mp_get_ll.c \
- $(TOMMATH_DIR)/bn_mp_get_mag_u32.c \
- $(TOMMATH_DIR)/bn_mp_get_mag_u64.c \
- $(TOMMATH_DIR)/bn_mp_get_mag_ul.c \
- $(TOMMATH_DIR)/bn_mp_get_mag_ull.c \
+ $(TOMMATH_DIR)/bn_mp_expt_d.c \
$(TOMMATH_DIR)/bn_mp_grow.c \
- $(TOMMATH_DIR)/bn_mp_incr.c \
$(TOMMATH_DIR)/bn_mp_init.c \
$(TOMMATH_DIR)/bn_mp_init_copy.c \
- $(TOMMATH_DIR)/bn_mp_init_i32.c \
- $(TOMMATH_DIR)/bn_mp_init_i64.c \
- $(TOMMATH_DIR)/bn_mp_init_l.c \
- $(TOMMATH_DIR)/bn_mp_init_ll.c \
$(TOMMATH_DIR)/bn_mp_init_multi.c \
$(TOMMATH_DIR)/bn_mp_init_set.c \
+ $(TOMMATH_DIR)/bn_mp_init_set_int.c \
$(TOMMATH_DIR)/bn_mp_init_size.c \
- $(TOMMATH_DIR)/bn_mp_init_u32.c \
- $(TOMMATH_DIR)/bn_mp_init_u64.c \
- $(TOMMATH_DIR)/bn_mp_init_ul.c \
- $(TOMMATH_DIR)/bn_mp_init_ull.c \
- $(TOMMATH_DIR)/bn_mp_invmod.c \
- $(TOMMATH_DIR)/bn_mp_is_square.c \
- $(TOMMATH_DIR)/bn_mp_iseven.c \
- $(TOMMATH_DIR)/bn_mp_isodd.c \
- $(TOMMATH_DIR)/bn_mp_kronecker.c \
- $(TOMMATH_DIR)/bn_mp_lcm.c \
- $(TOMMATH_DIR)/bn_mp_log_u32.c \
+ $(TOMMATH_DIR)/bn_mp_karatsuba_mul.c \
+ $(TOMMATH_DIR)/bn_mp_karatsuba_sqr.c \
$(TOMMATH_DIR)/bn_mp_lshd.c \
$(TOMMATH_DIR)/bn_mp_mod.c \
$(TOMMATH_DIR)/bn_mp_mod_2d.c \
- $(TOMMATH_DIR)/bn_mp_mod_d.c \
- $(TOMMATH_DIR)/bn_mp_montgomery_calc_normalization.c \
- $(TOMMATH_DIR)/bn_mp_montgomery_reduce.c \
- $(TOMMATH_DIR)/bn_mp_montgomery_setup.c \
$(TOMMATH_DIR)/bn_mp_mul.c \
$(TOMMATH_DIR)/bn_mp_mul_2.c \
$(TOMMATH_DIR)/bn_mp_mul_2d.c \
$(TOMMATH_DIR)/bn_mp_mul_d.c \
- $(TOMMATH_DIR)/bn_mp_mulmod.c \
$(TOMMATH_DIR)/bn_mp_neg.c \
$(TOMMATH_DIR)/bn_mp_or.c \
- $(TOMMATH_DIR)/bn_mp_pack.c \
- $(TOMMATH_DIR)/bn_mp_pack_count.c \
- $(TOMMATH_DIR)/bn_mp_prime_fermat.c \
- $(TOMMATH_DIR)/bn_mp_prime_frobenius_underwood.c \
- $(TOMMATH_DIR)/bn_mp_prime_is_prime.c \
- $(TOMMATH_DIR)/bn_mp_prime_miller_rabin.c \
- $(TOMMATH_DIR)/bn_mp_prime_next_prime.c \
- $(TOMMATH_DIR)/bn_mp_prime_rabin_miller_trials.c \
- $(TOMMATH_DIR)/bn_mp_prime_rand.c \
- $(TOMMATH_DIR)/bn_mp_prime_strong_lucas_selfridge.c \
$(TOMMATH_DIR)/bn_mp_radix_size.c \
$(TOMMATH_DIR)/bn_mp_radix_smap.c \
- $(TOMMATH_DIR)/bn_mp_rand.c \
$(TOMMATH_DIR)/bn_mp_read_radix.c \
- $(TOMMATH_DIR)/bn_mp_reduce.c \
- $(TOMMATH_DIR)/bn_mp_reduce_2k.c \
- $(TOMMATH_DIR)/bn_mp_reduce_2k_l.c \
- $(TOMMATH_DIR)/bn_mp_reduce_2k_setup.c \
- $(TOMMATH_DIR)/bn_mp_reduce_2k_setup_l.c \
- $(TOMMATH_DIR)/bn_mp_reduce_is_2k.c \
- $(TOMMATH_DIR)/bn_mp_reduce_is_2k_l.c \
- $(TOMMATH_DIR)/bn_mp_reduce_setup.c \
- $(TOMMATH_DIR)/bn_mp_root_u32.c \
$(TOMMATH_DIR)/bn_mp_rshd.c \
- $(TOMMATH_DIR)/bn_mp_sbin_size.c \
$(TOMMATH_DIR)/bn_mp_set.c \
- $(TOMMATH_DIR)/bn_mp_set_double.c \
- $(TOMMATH_DIR)/bn_mp_set_i32.c \
- $(TOMMATH_DIR)/bn_mp_set_i64.c \
- $(TOMMATH_DIR)/bn_mp_set_l.c \
- $(TOMMATH_DIR)/bn_mp_set_ll.c \
- $(TOMMATH_DIR)/bn_mp_set_u32.c \
- $(TOMMATH_DIR)/bn_mp_set_u64.c \
- $(TOMMATH_DIR)/bn_mp_set_ul.c \
- $(TOMMATH_DIR)/bn_mp_set_ull.c \
+ $(TOMMATH_DIR)/bn_mp_set_int.c \
$(TOMMATH_DIR)/bn_mp_shrink.c \
- $(TOMMATH_DIR)/bn_mp_signed_rsh.c \
$(TOMMATH_DIR)/bn_mp_sqr.c \
- $(TOMMATH_DIR)/bn_mp_sqrmod.c \
$(TOMMATH_DIR)/bn_mp_sqrt.c \
- $(TOMMATH_DIR)/bn_mp_sqrtmod_prime.c \
$(TOMMATH_DIR)/bn_mp_sub.c \
$(TOMMATH_DIR)/bn_mp_sub_d.c \
- $(TOMMATH_DIR)/bn_mp_submod.c \
- $(TOMMATH_DIR)/bn_mp_to_radix.c \
- $(TOMMATH_DIR)/bn_mp_to_sbin.c \
- $(TOMMATH_DIR)/bn_mp_to_ubin.c \
- $(TOMMATH_DIR)/bn_mp_ubin_size.c \
- $(TOMMATH_DIR)/bn_mp_unpack.c \
+ $(TOMMATH_DIR)/bn_mp_to_unsigned_bin.c \
+ $(TOMMATH_DIR)/bn_mp_to_unsigned_bin_n.c \
+ $(TOMMATH_DIR)/bn_mp_toom_mul.c \
+ $(TOMMATH_DIR)/bn_mp_toom_sqr.c \
+ $(TOMMATH_DIR)/bn_mp_toradix_n.c \
+ $(TOMMATH_DIR)/bn_mp_unsigned_bin_size.c \
$(TOMMATH_DIR)/bn_mp_xor.c \
$(TOMMATH_DIR)/bn_mp_zero.c \
- $(TOMMATH_DIR)/bn_prime_tab.c \
$(TOMMATH_DIR)/bn_s_mp_add.c \
- $(TOMMATH_DIR)/bn_s_mp_balance_mul.c \
- $(TOMMATH_DIR)/bn_s_mp_exptmod.c \
- $(TOMMATH_DIR)/bn_s_mp_exptmod_fast.c \
- $(TOMMATH_DIR)/bn_s_mp_get_bit.c \
- $(TOMMATH_DIR)/bn_s_mp_invmod_fast.c \
- $(TOMMATH_DIR)/bn_s_mp_invmod_slow.c \
- $(TOMMATH_DIR)/bn_s_mp_karatsuba_mul.c \
- $(TOMMATH_DIR)/bn_s_mp_karatsuba_sqr.c \
- $(TOMMATH_DIR)/bn_s_mp_montgomery_reduce_fast.c \
$(TOMMATH_DIR)/bn_s_mp_mul_digs.c \
- $(TOMMATH_DIR)/bn_s_mp_mul_digs_fast.c \
- $(TOMMATH_DIR)/bn_s_mp_mul_high_digs.c \
- $(TOMMATH_DIR)/bn_s_mp_mul_high_digs_fast.c \
- $(TOMMATH_DIR)/bn_s_mp_prime_is_divisible.c \
- $(TOMMATH_DIR)/bn_s_mp_rand_jenkins.c \
- $(TOMMATH_DIR)/bn_s_mp_rand_platform.c \
- $(TOMMATH_DIR)/bn_s_mp_reverse.c \
$(TOMMATH_DIR)/bn_s_mp_sqr.c \
- $(TOMMATH_DIR)/bn_s_mp_sqr_fast.c \
- $(TOMMATH_DIR)/bn_s_mp_sub.c \
- $(TOMMATH_DIR)/bn_s_mp_toom_mul.c \
- $(TOMMATH_DIR)/bn_s_mp_toom_sqr.c
+ $(TOMMATH_DIR)/bn_s_mp_sub.c
UNIX_HDRS = \
$(UNIX_DIR)/tclUnixPort.h
@@ -671,9 +512,6 @@ UNIX_SRCS = \
$(UNIX_DIR)/tclUnixCompat.c
NOTIFY_SRCS = \
- $(UNIX_DIR)/tclEpollNotfy.c \
- $(UNIX_DIR)/tclKqueueNotfy.c \
- $(UNIX_DIR)/tclSelectNotfy.c \
$(UNIX_DIR)/tclUnixNotfy.c
DL_SRCS = \
@@ -691,77 +529,22 @@ MAC_OSX_SRCS = \
$(MAC_OSX_DIR)/tclMacOSXFCmd.c \
$(MAC_OSX_DIR)/tclMacOSXNotify.c
-CYGWIN_SRCS = \
- $(TOP_DIR)/win/tclWinError.c
-
DTRACE_HDR = tclDTrace.h
DTRACE_SRC = $(GENERIC_DIR)/tclDTrace.d
-ZLIB_SRCS = \
- $(ZLIB_DIR)/adler32.c \
- $(ZLIB_DIR)/compress.c \
- $(ZLIB_DIR)/crc32.c \
- $(ZLIB_DIR)/deflate.c \
- $(ZLIB_DIR)/infback.c \
- $(ZLIB_DIR)/inffast.c \
- $(ZLIB_DIR)/inflate.c \
- $(ZLIB_DIR)/inftrees.c \
- $(ZLIB_DIR)/trees.c \
- $(ZLIB_DIR)/uncompr.c \
- $(ZLIB_DIR)/zutil.c
-
# Note: don't include DL_SRCS or MAC_OSX_SRCS in SRCS: most of those files
# won't compile on the current machine, and they will cause problems for
# things like "make depend".
-SRCS = $(GENERIC_SRCS) $(UNIX_SRCS) $(NOTIFY_SRCS) \
- $(OO_SRCS) $(STUB_SRCS) @PLAT_SRCS@ @ZLIB_SRCS@ @TOMMATH_SRCS@
-
-###
-# Tip 430 - ZipFS Modifications
-###
-
-TCL_ZIP_FILE = @TCL_ZIP_FILE@
-TCL_VFS_ROOT = libtcl.vfs
-TCL_VFS_PATH = ${TCL_VFS_ROOT}/tcl_library
-
-HOST_CC = @CC_FOR_BUILD@
-HOST_EXEEXT = @EXEEXT_FOR_BUILD@
-HOST_OBJEXT = @OBJEXT_FOR_BUILD@
-ZIPFS_BUILD = @ZIPFS_BUILD@
-MACHER = @MACHER_PROG@
-NATIVE_ZIP = @ZIP_PROG@
-ZIP_PROG_OPTIONS = @ZIP_PROG_OPTIONS@
-ZIP_PROG_VFSSEARCH = @ZIP_PROG_VFSSEARCH@
-SHARED_BUILD = @SHARED_BUILD@
-INSTALL_LIBRARIES = @INSTALL_LIBRARIES@
-INSTALL_MSGS = @INSTALL_MSGS@
-
-# Minizip
-MINIZIP_OBJS = \
- adler32.$(HOST_OBJEXT) \
- compress.$(HOST_OBJEXT) \
- crc32.$(HOST_OBJEXT) \
- deflate.$(HOST_OBJEXT) \
- infback.$(HOST_OBJEXT) \
- inffast.$(HOST_OBJEXT) \
- inflate.$(HOST_OBJEXT) \
- inftrees.$(HOST_OBJEXT) \
- ioapi.$(HOST_OBJEXT) \
- trees.$(HOST_OBJEXT) \
- uncompr.$(HOST_OBJEXT) \
- zip.$(HOST_OBJEXT) \
- zutil.$(HOST_OBJEXT) \
- minizip.$(HOST_OBJEXT)
-
-ZIP_INSTALL_OBJS = @ZIP_INSTALL_OBJS@
+SRCS = $(GENERIC_SRCS) $(TOMMATH_SRCS) $(UNIX_SRCS) $(NOTIFY_SRCS) \
+ $(STUB_SRCS) @PLAT_SRCS@
#--------------------------------------------------------------------------
# Start of rules
#--------------------------------------------------------------------------
-all: binaries libraries doc packages
+all: binaries libraries doc
binaries: ${LIB_FILE} ${TCL_EXE}
@@ -769,45 +552,15 @@ libraries:
doc:
-tclzipfile: ${TCL_ZIP_FILE}
-
-${TCL_ZIP_FILE}: ${ZIP_INSTALL_OBJS}
- @rm -rf ${TCL_VFS_ROOT}
- @mkdir -p ${TCL_VFS_PATH}
- @echo "creating ${TCL_VFS_PATH} (prepare compression)"
- @if \
- ln -s $(TOP_DIR)/library/* ${TCL_VFS_PATH}/; \
- then : ; else \
- cp -a $(TOP_DIR)/library/* ${TCL_VFS_PATH}; \
- fi
- mv ${TCL_VFS_PATH}/manifest.txt ${TCL_VFS_PATH}/pkgIndex.tcl
- rm -rf ${TCL_VFS_PATH}/dde ${TCL_VFS_PATH}/registry
- @find ${TCL_VFS_ROOT} -type d -empty -delete
- @echo "creating ${TCL_ZIP_FILE} from ${TCL_VFS_PATH}"
- @(zip=`(realpath '${NATIVE_ZIP}' || readlink -m '${NATIVE_ZIP}' || \
- echo '${NATIVE_ZIP}' | sed "s?^\./?$$(pwd)/?") 2>/dev/null`; \
- echo 'cd ${TCL_VFS_ROOT} &&' $$zip '${ZIP_PROG_OPTIONS} ../${TCL_ZIP_FILE} ${ZIP_PROG_VFSSEARCH}'; \
- cd ${TCL_VFS_ROOT} && \
- $$zip ${ZIP_PROG_OPTIONS} ../${TCL_ZIP_FILE} ${ZIP_PROG_VFSSEARCH} >/dev/null)
-
# The following target is configured by autoconf to generate either a shared
# library or non-shared library for Tcl.
-${LIB_FILE}: ${STUB_LIB_FILE} ${OBJS} ${TCL_ZIP_FILE}
+${LIB_FILE}: ${STUB_LIB_FILE} ${OBJS}
rm -f $@
@MAKE_LIB@
- @if test "${ZIPFS_BUILD}" = "1" ; then \
- if test "x$(MACHER)" = "x" ; then \
- cat ${TCL_ZIP_FILE} >> ${LIB_FILE}; \
- else $(MACHER) append ${LIB_FILE} ${TCL_ZIP_FILE} /tmp/macher_output; \
- mv /tmp/macher_output ${LIB_FILE}; chmod u+x ${LIB_FILE}; \
- fi; \
- ${NATIVE_ZIP} -A ${LIB_FILE} \
- || echo 'ignore zip-error by adjust sfx process (not executable?)'; \
- fi
${STUB_LIB_FILE}: ${STUB_LIB_OBJS}
- @if [ "x${LIB_FILE}" = "xlibtcl${MAJOR_VERSION}.${MINOR_VERSION}.dll" ] ; then \
- ( cd ${TOP_DIR}/win; ${MAKE} winextensions ); \
+ @if test "x${LIB_FILE}" = "xlibtcl${MAJOR_VERSION}.${MINOR_VERSION}.dll"; then \
+ (cd ${TOP_DIR}/win; ${MAKE} winextensions); \
fi
rm -f $@
@MAKE_STUB_LIB@
@@ -822,82 +575,22 @@ tclLibObjs:
# This targets actually build the objects needed for the lib in the above case
objs: ${OBJS}
-${TCL_EXE}: ${TCLSH_OBJS} ${TCL_LIB_FILE} ${TCL_STUB_LIB_FILE} ${TCL_ZIP_FILE}
- ${CC} ${CFLAGS} ${LDFLAGS} ${TCLSH_OBJS} \
- @TCL_BUILD_LIB_SPEC@ ${TCL_STUB_LIB_FILE} ${LIBS} @EXTRA_TCLSH_LIBS@ \
- ${CC_SEARCH_FLAGS} -o ${TCL_EXE}
- @if test "${ZIPFS_BUILD}" = "2" ; then \
- if test "x$(MACHER)" = "x" ; then \
- cat ${TCL_ZIP_FILE} >> ${TCL_EXE}; \
- else $(MACHER) append ${TCL_EXE} ${TCL_ZIP_FILE} /tmp/macher_output; \
- mv /tmp/macher_output ${TCL_EXE}; chmod u+x ${TCL_EXE}; \
- fi; \
- ${NATIVE_ZIP} -A ${TCL_EXE} \
- || echo 'ignore zip-error by adjust sfx process (not executable?)'; \
- fi
-
-# Must be empty so it doesn't conflict with rule for ${TCL_EXE} above
-${NATIVE_TCLSH}:
-
-Makefile: $(UNIX_DIR)/Makefile.in $(DLTEST_DIR)/Makefile.in
- $(SHELL) config.status
-#tclConfig.h: $(UNIX_DIR)/tclConfig.h.in
-# $(SHELL) config.status
-
-clean: clean-packages
- rm -rf *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out \
- errors ${TCL_EXE} ${TCLTEST_EXE} lib.exp Tcl @DTRACE_HDR@ \
- minizip${HOST_EXEEXT} *.${HOST_OBJEXT} *.zip *.vfs
- (cd dltest ; $(MAKE) clean)
-
-distclean: distclean-packages clean
- rm -rf Makefile config.status config.cache config.log tclConfig.sh \
- tclConfig.h *.plist Tcl.framework tcl.pc tclUuid.h
- (cd dltest ; $(MAKE) distclean)
-
-depend:
- makedepend -- $(DEPEND_SWITCHES) -- $(SRCS)
-
-#--------------------------------------------------------------------------
-# The following target outputs the name of the top-level source directory for
-# Tcl (it is used by Tk's configure script, for example). The .NO_PARALLEL
-# line is needed to avoid problems under Sun's "pmake". Note: this target is
-# now obsolete (use the autoconf variable TCL_SRC_DIR from tclConfig.sh
-# instead).
-#--------------------------------------------------------------------------
-.NO_PARALLEL: topDirName
-topDirName:
- @cd $(TOP_DIR); pwd
-
-#--------------------------------------------------------------------------
-# Rules for testing
-#--------------------------------------------------------------------------
+${TCL_EXE}: ${TCLSH_OBJS} ${TCL_LIB_FILE}
+ ${CC} ${CFLAGS} ${LDFLAGS} ${TCLSH_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} @EXTRA_TCLSH_LIBS@ \
+ ${CC_SEARCH_FLAGS} -o ${TCL_EXE}
# Resetting the LIB_RUNTIME_DIR below is required so that the generated
# tcltest executable gets the build directory burned into its ld search path.
# This keeps tcltest from picking up an already installed version of the Tcl
# library.
-SHELL_ENV = @LD_LIBRARY_PATH_VAR@=`pwd`:${@LD_LIBRARY_PATH_VAR@} \
- TCLLIBPATH="@abs_builddir@/pkgs" \
- TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"
-${TCLTEST_EXE}: ${TCLTEST_OBJS} ${TCL_LIB_FILE} ${TCL_STUB_LIB_FILE} ${BUILD_DLTEST} ${TCL_ZIP_FILE}
+tcltest@EXEEXT@: ${TCLTEST_OBJS} ${TCL_LIB_FILE} ${BUILD_DLTEST}
$(MAKE) tcltest-real LIB_RUNTIME_DIR="`pwd`"
tcltest-real:
- ${CC} ${CFLAGS} ${LDFLAGS} ${TCLTEST_OBJS} \
- @TCL_BUILD_LIB_SPEC@ ${TCL_STUB_LIB_FILE} ${LIBS} @EXTRA_TCLSH_LIBS@ \
- ${CC_SEARCH_FLAGS} -o ${TCLTEST_EXE}
- @if test "${ZIPFS_BUILD}" = "2" ; then \
- if test "x$(MACHER)" = "x" ; then \
- cat ${TCL_ZIP_FILE} >> ${TCLTEST_EXE}; \
- else $(MACHER) append ${TCLTEST_EXE} ${TCL_ZIP_FILE} /tmp/macher_output; \
- mv /tmp/macher_output ${TCLTEST_EXE}; chmod u+x ${TCLTEST_EXE}; \
- fi; \
- ${NATIVE_ZIP} -A ${TCLTEST_EXE} \
- || echo 'ignore zip-error by adjust sfx process (not executable?)'; \
- fi
+ ${CC} ${CFLAGS} ${LDFLAGS} ${TCLTEST_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} @EXTRA_TCLSH_LIBS@ \
+ ${CC_SEARCH_FLAGS} -o tcltest@EXEEXT@
# Note, in the targets below TCL_LIBRARY needs to be set or else "make test"
# won't work in the case where the compilation directory isn't the same as the
@@ -907,302 +600,320 @@ tcltest-real:
# tcltest, ie:
# % make test TESTFLAGS="-verbose bps -file fileName.test"
-test: test-tcl test-packages
-
-test-tcl: ${TCLTEST_EXE}
- $(SHELL_ENV) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
-
-gdb-test: ${TCLTEST_EXE}
- $(SHELL_ENV) $(GDB) --args ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl \
- $(TESTFLAGS) -singleproc 1
-
-lldb-test: ${TCLTEST_EXE}
- $(SHELL_ENV) $(LLDB) -- ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl \
- $(TESTFLAGS) -singleproc 1
+test: tcltest@EXEEXT@
+ @LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \
+ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
+ ./tcltest@EXEEXT@ $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
+gdb-test: tcltest@EXEEXT@
+ @echo "set env @LD_LIBRARY_PATH_VAR@=\"`pwd`:$${@LD_LIBRARY_PATH_VAR@}\"" > gdb.run
+ @echo "set env TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" >> gdb.run
+ @echo "set args $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) -singleproc 1" >> gdb.run
+ $(GDB) ./tcltest@EXEEXT@ --command=gdb.run
+ rm gdb.run
# Useful target to launch a built tcltest with the proper path,...
-runtest: ${TCLTEST_EXE}
- $(SHELL_ENV) ./${TCLTEST_EXE}
+runtest: tcltest@EXEEXT@
+ @LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \
+ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
+ ./tcltest@EXEEXT@
# Useful target for running the test suite with an unwritable current
# directory...
-ro-test: ${TCLTEST_EXE}
- echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ./${TCLTEST_EXE}
-
-# The following target generates the shared libraries in dltest/ that are used
-# for testing; they are included as part of the "tcltest" target (via the
-# BUILD_DLTEST variable) if dynamic loading is supported on this platform. The
-# Makefile in the dltest subdirectory creates the dltest.marker file in this
-# directory after a successful build.
-
-dltest.marker: ${STUB_LIB_FILE}
- cd dltest ; $(MAKE)
-
-#--------------------------------------------------------------------------
-# Rules for running a shell before installation
-#--------------------------------------------------------------------------
+ro-test: tcltest@EXEEXT@
+ @LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \
+ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
+ echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | ./tcltest@EXEEXT@
# This target can be used to run tclsh from the build directory
# via `make shell SCRIPT=/tmp/foo.tcl`
shell: ${TCL_EXE}
- $(SHELL_ENV) ./${TCL_EXE} $(SCRIPT)
+ @LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \
+ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
+ ./${TCL_EXE} $(SCRIPT)
# This target can be used to run tclsh inside either gdb or insight
gdb: ${TCL_EXE}
- $(SHELL_ENV) $(GDB) ./${TCL_EXE}
+ @echo "set env @LD_LIBRARY_PATH_VAR@=\"`pwd`:$${@LD_LIBRARY_PATH_VAR@}\"" > gdb.run
+ @echo "set env TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" >> gdb.run
+ $(GDB) ./${TCL_EXE} --command=gdb.run
+ rm gdb.run
-lldb: ${TCL_EXE}
- $(SHELL_ENV) $(LLDB) ./${TCL_EXE}
+VALGRINDARGS=--tool=memcheck --num-callers=8 --leak-resolution=high --leak-check=yes --show-reachable=yes -v
-valgrind: ${TCL_EXE} ${TCLTEST_EXE}
- $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCLTEST_EXE} \
- $(TOP_DIR)/tests/all.tcl -singleproc 1 -constraints valgrind \
- $(TESTFLAGS)
+valgrind: ${TCL_EXE} tcltest@EXEEXT@
+ @LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \
+ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
+ valgrind $(VALGRINDARGS) ./tcltest@EXEEXT@ $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS)
-testresults/valgrind/%.result: ${TCL_EXE} ${TCLTEST_EXE}
- @mkdir -p testresults/valgrind
- $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCLTEST_EXE} \
- $(TOP_DIR)/tests/all.tcl -singleproc 1 -constraints valgrind \
- -file $(basename $(notdir $@)) > $@.tmp 2>&1
- @mv $@.tmp $@
-.PRECIOUS: testresults/valgrind/%.result
+valgrindshell: ${TCL_EXE}
+ @LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \
+ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
+ valgrind $(VALGRINDARGS) ./${TCL_EXE} $(SCRIPT)
+# The following target outputs the name of the top-level source directory for
+# Tcl (it is used by Tk's configure script, for example). The .NO_PARALLEL
+# line is needed to avoid problems under Sun's "pmake". Note: this target is
+# now obsolete (use the autoconf variable TCL_SRC_DIR from tclConfig.sh
+# instead).
-testresults/valgrind/%.success: testresults/valgrind/%.result
- @printf '%s' valgrind >&2
- @printf ' %s' $(basename $(notdir $@)) >&2
- @printf '\n >&2'
- @status=$$(./${TCLTEST_EXE} $(TOP_DIR)/tools/valgrind_check_success \
- file $(basename $@).result); \
- if [ "$$status" -eq 1 ]; then touch $@; exit 0; else exit 1; fi
+.NO_PARALLEL: topDirName
+topDirName:
+ @cd $(TOP_DIR); pwd
-valgrind_each: $(addprefix testresults/valgrind/,$(addsuffix .success,$(notdir\
- $(wildcard $(TOP_DIR)/tests/*.test))))
+# The following target generates the file generic/tclDate.c from the yacc
+# grammar found in generic/tclGetDate.y. This is only run by hand as yacc is
+# not available in all environments. The name of the .c file is different than
+# the name of the .y file so that make doesn't try to automatically regenerate
+# the .c file.
+gendate:
+ bison --output-file=$(GENERIC_DIR)/tclDate.c \
+ --no-lines \
+ --name-prefix=TclDate \
+ $(GENERIC_DIR)/tclGetDate.y
-valgrindshell: ${TCL_EXE}
- $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCL_EXE} $(SCRIPT)
+# yacc -l $(GENERIC_DIR)/tclGetDate.y
+# sed -e 's/yy/TclDate/g' -e '/^#include <values.h>/d' \
+# -e 's?SCCSID?RCS: @(#) ?' \
+# -e '/#ifdef __STDC__/,/#endif/d' -e '/TclDateerrlab:/d' \
+# -e '/TclDatenewstate:/d' -e '/#pragma/d' \
+# -e '/#include <inttypes.h>/d' -e 's/const /CONST /g' \
+# -e '/#define YYNEW/s/malloc/TclDateAlloc/g' \
+# -e '/#define YYENLARGE/,/realloc/s/realloc/TclDateRealloc/g' \
+# <y.tab.c >$(GENERIC_DIR)/tclDate.c
+# rm y.tab.c
-trace-shell: ${TCL_EXE}
- $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCL_EXE} $(SCRIPT)
+# The following target generates the file generic/tclTomMath.h. It needs to be
+# run (and the results checked) after updating to a new release of libtommath.
-trace-test: ${TCLTEST_EXE}
- $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS)
+gentommath_h:
+ $(TCL_EXE) "$(TOOL_DIR)/fix_tommath_h.tcl" \
+ "$(TOMMATH_DIR)/tommath.h" \
+ > "$(GENERIC_DIR)/tclTomMath.h"
-#--------------------------------------------------------------------------
-# Installation rules
-#--------------------------------------------------------------------------
+# The following target generates the shared libraries in dltest/ that are used
+# for testing; they are included as part of the "tcltest" target (via the
+# BUILD_DLTEST variable) if dynamic loading is supported on this platform. The
+# Makefile in the dltest subdirectory creates the dltest.marker file in this
+# directory after a successful build.
-INSTALL_BASE_TARGETS = install-binaries $(INSTALL_LIBRARIES) $(INSTALL_MSGS) $(INSTALL_TZDATA)
-INSTALL_DOC_TARGETS = install-doc
-INSTALL_PACKAGE_TARGETS = install-packages
-INSTALL_DEV_TARGETS = install-headers
-INSTALL_EXTRA_TARGETS = @EXTRA_INSTALL@
-INSTALL_TARGETS = $(INSTALL_BASE_TARGETS) $(INSTALL_DOC_TARGETS) $(INSTALL_DEV_TARGETS) \
- $(INSTALL_PACKAGE_TARGETS) $(INSTALL_EXTRA_TARGETS)
+dltest.marker: ${STUB_LIB_FILE}
+ cd dltest ; $(MAKE)
+
+INSTALL_TARGETS = install-binaries install-libraries install-doc @EXTRA_INSTALL@
install: $(INSTALL_TARGETS)
install-strip:
$(MAKE) $(INSTALL_TARGETS) \
- INSTALL_PROGRAM="STRIPPROG='${INSTALL_STRIP_PROGRAM}' $(INSTALL_PROGRAM) -s" \
- INSTALL_LIBRARY="STRIPPROG='${INSTALL_STRIP_LIBRARY}' $(INSTALL_LIBRARY) -s"
+ INSTALL_PROGRAM="$(INSTALL_PROGRAM) ${INSTALL_STRIP_PROGRAM}" \
+ INSTALL_LIBRARY="$(INSTALL_LIBRARY) ${INSTALL_STRIP_LIBRARY}"
+
+# Note: before running ranlib below, must cd to target directory because some
+# ranlibs write to current directory, and this might not always be possible
+# (e.g. if installing as root).
install-binaries: binaries
@for i in "$(LIB_INSTALL_DIR)" "$(BIN_INSTALL_DIR)" \
- "$(CONFIG_INSTALL_DIR)" ; do \
+ "$(CONFIG_INSTALL_DIR)"; \
+ do \
if [ ! -d "$$i" ] ; then \
echo "Making directory $$i"; \
$(INSTALL_DATA_DIR) "$$i"; \
- fi; \
- done
+ else true; \
+ fi; \
+ done;
@echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/"
@@INSTALL_LIB@
@chmod 555 "$(DLL_INSTALL_DIR)/$(LIB_FILE)"
- @echo "Installing ${TCL_EXE} as $(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"
- @$(INSTALL_PROGRAM) ${TCL_EXE} "$(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"
+ @echo "Installing ${TCL_EXE} as $(BIN_INSTALL_DIR)/tclsh$(VERSION)@EXEEXT@"
+ @$(INSTALL_PROGRAM) ${TCL_EXE} "$(BIN_INSTALL_DIR)/tclsh$(VERSION)@EXEEXT@"
@echo "Installing tclConfig.sh to $(CONFIG_INSTALL_DIR)/"
@$(INSTALL_DATA) tclConfig.sh "$(CONFIG_INSTALL_DIR)/tclConfig.sh"
- @echo "Installing tclooConfig.sh to $(CONFIG_INSTALL_DIR)/"
- @$(INSTALL_DATA) $(UNIX_DIR)/tclooConfig.sh \
- "$(CONFIG_INSTALL_DIR)/tclooConfig.sh"
@if test "$(STUB_LIB_FILE)" != "" ; then \
echo "Installing $(STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \
@INSTALL_STUB_LIB@ ; \
fi
@EXTRA_INSTALL_BINARIES@
@echo "Installing pkg-config file to $(LIB_INSTALL_DIR)/pkgconfig/"
- @$(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/pkgconfig"
- @$(INSTALL_DATA) tcl.pc "$(LIB_INSTALL_DIR)/pkgconfig/tcl.pc"
+ @mkdir -p $(LIB_INSTALL_DIR)/pkgconfig
+ @$(INSTALL_DATA) tcl.pc $(LIB_INSTALL_DIR)/pkgconfig/tcl.pc
-install-libraries: libraries
- @for i in "$(SCRIPT_INSTALL_DIR)" "$(MODULE_INSTALL_DIR)"; \
+install-libraries: libraries $(INSTALL_TZDATA) install-msgs
+ @for i in "$(INCLUDE_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)"; \
do \
if [ ! -d "$$i" ] ; then \
echo "Making directory $$i"; \
$(INSTALL_DATA_DIR) "$$i"; \
- fi; \
+ else true; \
+ fi; \
done;
- @for i in opt0.4 cookiejar0.2 encoding; \
+ @for i in opt0.4 http1.0 encoding ../tcl8 ../tcl8/8.4 ../tcl8/8.4/platform ../tcl8/8.5; \
do \
- if [ ! -d "$(SCRIPT_INSTALL_DIR)/$$i" ] ; then \
+ if [ ! -d "$(SCRIPT_INSTALL_DIR)"/$$i ] ; then \
echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \
- $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)/$$i"; \
+ $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)"/$$i; \
else true; \
fi; \
done;
- @for i in 8.4 8.4/platform 8.5 8.6 8.7; \
+ @echo "Installing header files to $(INCLUDE_INSTALL_DIR)/";
+ @for i in $(GENERIC_DIR)/tcl.h $(GENERIC_DIR)/tclDecls.h \
+ $(GENERIC_DIR)/tclPlatDecls.h \
+ $(GENERIC_DIR)/tclTomMath.h \
+ $(GENERIC_DIR)/tclTomMathDecls.h ; \
do \
- if [ ! -d "$(MODULE_INSTALL_DIR)/$$i" ] ; then \
- echo "Making directory $(MODULE_INSTALL_DIR)/$$i"; \
- $(INSTALL_DATA_DIR) "$(MODULE_INSTALL_DIR)/$$i"; \
- fi; \
+ $(INSTALL_DATA) $$i "$(INCLUDE_INSTALL_DIR)"; \
done;
- @echo "Installing library files to $(SCRIPT_INSTALL_DIR)/"
+ @echo "Installing library files to $(SCRIPT_INSTALL_DIR)/";
@for i in $(TOP_DIR)/library/*.tcl $(TOP_DIR)/library/tclIndex \
- $(UNIX_DIR)/tclAppInit.c @LDAIX_SRC@ @DTRACE_SRC@ ; do \
+ $(UNIX_DIR)/tclAppInit.c @LDAIX_SRC@ @DTRACE_SRC@; \
+ do \
$(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"; \
- done;
- @echo "Installing package cookiejar 0.2 files to $(SCRIPT_INSTALL_DIR)/cookiejar0.2/"
- @for i in $(TOP_DIR)/library/cookiejar/*.tcl \
- $(TOP_DIR)/library/cookiejar/*.gz; \
+ done;
+ @echo "Installing package http1.0 files to $(SCRIPT_INSTALL_DIR)/http1.0/";
+ @for i in $(TOP_DIR)/library/http1.0/*.tcl ; \
do \
- $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/cookiejar0.2"; \
- done
- @echo "Installing package http 2.10b2 as a Tcl Module"
- @$(INSTALL_DATA) $(TOP_DIR)/library/http/http.tcl \
- "$(MODULE_INSTALL_DIR)/8.6/http-2.10b2.tm"
- @echo "Installing package opt0.4 files to $(SCRIPT_INSTALL_DIR)/opt0.4/"
- @for i in $(TOP_DIR)/library/opt/*.tcl; do \
- $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/opt0.4"; \
- done
- @echo "Installing package msgcat 1.7.1 as a Tcl Module"
- @$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl \
- "$(MODULE_INSTALL_DIR)/8.7/msgcat-1.7.1.tm"
- @echo "Installing package tcltest 2.5.8 as a Tcl Module"
- @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl \
- "$(MODULE_INSTALL_DIR)/8.5/tcltest-2.5.8.tm"
- @echo "Installing package platform 1.0.19 as a Tcl Module"
- @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl \
- "$(MODULE_INSTALL_DIR)/8.4/platform-1.0.19.tm"
- @echo "Installing package platform::shell 1.1.4 as a Tcl Module"
- @$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl \
- "$(MODULE_INSTALL_DIR)/8.4/platform/shell-1.1.4.tm"
- @echo "Installing encoding files to $(SCRIPT_INSTALL_DIR)/encoding/"
- @for i in $(TOP_DIR)/library/encoding/*.enc; do \
- $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/encoding"; \
- done
- @if [ -n "$(TCL_MODULE_PATH)" -a -f $(TOP_DIR)/library/tm.tcl ] ; then \
+ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/http1.0; \
+ done;
+ @echo "Installing package http 2.7.13 as a Tcl Module";
+ @$(INSTALL_DATA) $(TOP_DIR)/library/http/http.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/http-2.7.13.tm;
+ @echo "Installing package opt0.4 files to $(SCRIPT_INSTALL_DIR)/opt0.4/";
+ @for i in $(TOP_DIR)/library/opt/*.tcl ; \
+ do \
+ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/opt0.4; \
+ done;
+ @echo "Installing package msgcat 1.5.2 as a Tcl Module";
+ @$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/msgcat-1.5.2.tm;
+ @echo "Installing package tcltest 2.3.8 as a Tcl Module";
+ @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.3.8.tm;
+
+ @echo "Installing package platform 1.0.14 as a Tcl Module";
+ @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.14.tm;
+ @echo "Installing package platform::shell 1.1.4 as a Tcl Module";
+ @$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform/shell-1.1.4.tm;
+
+ @echo "Installing encoding files to $(SCRIPT_INSTALL_DIR)/encoding/";
+ @for i in $(TOP_DIR)/library/encoding/*.enc ; do \
+ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/encoding; \
+ done;
+ @if [ -n "$(TCL_MODULE_PATH)" -a -f $(TOP_DIR)/library/tm.tcl ]; then \
echo "Customizing tcl module path"; \
- echo "if {![interp issafe]} { ::tcl::tm::roots [list $(TCL_MODULE_PATH)] }" >> \
- "$(SCRIPT_INSTALL_DIR)/tm.tcl"; \
+ echo "if {![interp issafe]} { ::tcl::tm::roots {$(TCL_MODULE_PATH)} }" >> \
+ "$(SCRIPT_INSTALL_DIR)"/tm.tcl; \
fi
install-tzdata:
- @for i in tzdata; do \
- if [ ! -d "$(SCRIPT_INSTALL_DIR)/$$i" ] ; then \
+ @for i in tzdata; \
+ do \
+ if [ ! -d "$(SCRIPT_INSTALL_DIR)"/$$i ] ; then \
echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \
- $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)/$$i"; \
- fi; \
- done
+ $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)"/$$i; \
+ else true; \
+ fi; \
+ done;
@echo "Installing time zone files to $(SCRIPT_INSTALL_DIR)/tzdata/"
- @for i in $(TOP_DIR)/library/tzdata/*; do \
+ @for i in $(TOP_DIR)/library/tzdata/* ; do \
if [ -d $$i ] ; then \
ii=`basename $$i`; \
- if [ ! -d "$(SCRIPT_INSTALL_DIR)/tzdata/$$ii" ] ; then \
- $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)/tzdata/$$ii"; \
+ if [ ! -d "$(SCRIPT_INSTALL_DIR)"/tzdata/$$ii ] ; then \
+ $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)"/tzdata/$$ii; \
fi; \
- for j in $$i/*; do \
+ for j in $$i/* ; do \
if [ -d $$j ] ; then \
jj=`basename $$j`; \
- if [ ! -d "$(SCRIPT_INSTALL_DIR)/tzdata/$$ii/$$jj" ] ; then \
- $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)/tzdata/$$ii/$$jj"; \
+ if [ ! -d "$(SCRIPT_INSTALL_DIR)"/tzdata/$$ii/$$jj ] ; then \
+ $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)"/tzdata/$$ii/$$jj; \
fi; \
- for k in $$j/*; do \
- $(INSTALL_DATA) $$k "$(SCRIPT_INSTALL_DIR)/tzdata/$$ii/$$jj"; \
+ for k in $$j/* ; do \
+ $(INSTALL_DATA) $$k "$(SCRIPT_INSTALL_DIR)"/tzdata/$$ii/$$jj; \
done; \
else \
- $(INSTALL_DATA) $$j "$(SCRIPT_INSTALL_DIR)/tzdata/$$ii"; \
+ $(INSTALL_DATA) $$j "$(SCRIPT_INSTALL_DIR)"/tzdata/$$ii; \
fi; \
done; \
else \
- $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/tzdata"; \
+ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/tzdata; \
fi; \
- done
+ done;
install-msgs:
- @for i in msgs; do \
- if [ ! -d "$(SCRIPT_INSTALL_DIR)/$$i" ] ; then \
+ @for i in msgs; \
+ do \
+ if [ ! -d "$(SCRIPT_INSTALL_DIR)"/$$i ] ; then \
echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \
- $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)/$$i"; \
- fi; \
- done
+ $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)"/$$i; \
+ else true; \
+ fi; \
+ done;
@echo "Installing message catalog files to $(SCRIPT_INSTALL_DIR)/msgs/"
- @for i in $(TOP_DIR)/library/msgs/*.msg; do \
- $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/msgs"; \
- done
+ @for i in $(TOP_DIR)/library/msgs/*.msg ; do \
+ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/msgs; \
+ done;
install-doc: doc
- @for i in "$(MAN_INSTALL_DIR)" "$(MAN1_INSTALL_DIR)" "$(MAN3_INSTALL_DIR)" "$(MANN_INSTALL_DIR)"; do \
+ @for i in "$(MAN_INSTALL_DIR)" "$(MAN1_INSTALL_DIR)" "$(MAN3_INSTALL_DIR)" "$(MANN_INSTALL_DIR)" ; \
+ do \
if [ ! -d "$$i" ] ; then \
echo "Making directory $$i"; \
$(INSTALL_DATA_DIR) "$$i"; \
- fi; \
- done
- @echo "Installing and cross-linking top-level (.1) docs to $(MAN1_INSTALL_DIR)/"
+ else true; \
+ fi; \
+ done;
+ @echo "Installing and cross-linking top-level (.1) docs to $(MAN1_INSTALL_DIR)/";
@for i in $(TOP_DIR)/doc/*.1; do \
$(SHELL) $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MAN1_INSTALL_DIR)"; \
done
- @echo "Installing and cross-linking C API (.3) docs to $(MAN3_INSTALL_DIR)/"
+
+ @echo "Installing and cross-linking C API (.3) docs to $(MAN3_INSTALL_DIR)/";
@for i in $(TOP_DIR)/doc/*.3; do \
$(SHELL) $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MAN3_INSTALL_DIR)"; \
done
+
@echo "Installing and cross-linking command (.n) docs to $(MANN_INSTALL_DIR)/";
@for i in $(TOP_DIR)/doc/*.n; do \
$(SHELL) $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MANN_INSTALL_DIR)"; \
done
-# Public headers that define Tcl's API
-TCL_PUBLIC_HEADERS = $(GENERIC_DIR)/tcl.h $(GENERIC_DIR)/tclDecls.h \
- $(GENERIC_DIR)/tclOO.h $(GENERIC_DIR)/tclOODecls.h \
- $(GENERIC_DIR)/tclPlatDecls.h $(GENERIC_DIR)/tclTomMath.h \
- $(GENERIC_DIR)/tclTomMathDecls.h
-# Private headers that define Tcl's internal API
-TCL_PRIVATE_HEADERS = $(GENERIC_DIR)/tclInt.h $(GENERIC_DIR)/tclIntDecls.h \
- $(GENERIC_DIR)/tclIntPlatDecls.h $(GENERIC_DIR)/tclPort.h \
- $(GENERIC_DIR)/tclOOInt.h $(GENERIC_DIR)/tclOOIntDecls.h \
- $(UNIX_DIR)/tclUnixPort.h
-# Any other headers you find in the Tcl sources are purely part of Tcl's
-# implementation, and aren't to be installed.
-
-install-headers:
- @for i in "$(INCLUDE_INSTALL_DIR)"; do \
- if [ ! -d "$$i" ] ; then \
- echo "Making directory $$i"; \
- $(INSTALL_DATA_DIR) "$$i"; \
- fi; \
- done
- @echo "Installing header files to $(INCLUDE_INSTALL_DIR)/";
- @for i in $(TCL_PUBLIC_HEADERS); do \
- $(INSTALL_DATA) $$i "$(INCLUDE_INSTALL_DIR)"; \
- done
-
# Optional target to install private headers
-install-private-headers:
- @for i in "$(PRIVATE_INCLUDE_INSTALL_DIR)"; do \
+install-private-headers: libraries
+ @for i in "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \
+ do \
if [ ! -d "$$i" ] ; then \
echo "Making directory $$i"; \
$(INSTALL_DATA_DIR) "$$i"; \
- fi; \
- done
+ else true; \
+ fi; \
+ done;
@echo "Installing private header files to $(PRIVATE_INCLUDE_INSTALL_DIR)/";
- @for i in $(TCL_PRIVATE_HEADERS); do \
+ @for i in $(GENERIC_DIR)/tclInt.h $(GENERIC_DIR)/tclIntDecls.h \
+ $(GENERIC_DIR)/tclIntPlatDecls.h $(GENERIC_DIR)/tclPort.h \
+ $(UNIX_DIR)/tclUnixPort.h; \
+ do \
$(INSTALL_DATA) $$i "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \
- done
+ done;
@if test -f tclConfig.h; then\
$(INSTALL_DATA) tclConfig.h "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \
- fi
+ fi;
+
+Makefile: $(UNIX_DIR)/Makefile.in $(DLTEST_DIR)/Makefile.in
+ $(SHELL) config.status
+#tclConfig.h: $(UNIX_DIR)/tclConfig.h.in
+# $(SHELL) config.status
+
+clean:
+ rm -f *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out \
+ errors ${TCL_EXE} tcltest@EXEEXT@ lib.exp Tcl @DTRACE_HDR@
+ cd dltest ; $(MAKE) clean
+
+distclean: clean
+ rm -rf Makefile config.status config.cache config.log tclConfig.sh \
+ $(PACKAGE).* prototype tclConfig.h *.plist Tcl.framework \
+ tcl.pc
+ cd dltest ; $(MAKE) distclean
+
+depend:
+ makedepend -- $(DEPEND_SWITCHES) -- $(SRCS)
#--------------------------------------------------------------------------
# Rules for how to compile C files
@@ -1221,45 +932,39 @@ tclTestInit.o: $(UNIX_DIR)/tclAppInit.c ${TCL_EXE}
@if test -f tclAppInit.o ; then \
rm -f tclAppInit.sav; \
mv tclAppInit.o tclAppInit.sav; \
- fi
+ fi;
$(CC) -c $(APP_CC_SWITCHES) \
-DTCL_BUILDTIME_LIBRARY="\"${TCL_BUILDTIME_LIBRARY}\"" \
-DTCL_TEST $(UNIX_DIR)/tclAppInit.c
- @rm -f tclTestInit.o
+ rm -f tclTestInit.o
mv tclAppInit.o tclTestInit.o
@if test -f tclAppInit.sav ; then \
mv tclAppInit.sav tclAppInit.o; \
- fi
+ fi;
xtTestInit.o: $(UNIX_DIR)/tclAppInit.c ${TCL_EXE}
@if test -f tclAppInit.o ; then \
rm -f tclAppInit.sav; \
mv tclAppInit.o tclAppInit.sav; \
- fi
+ fi;
$(CC) -c $(APP_CC_SWITCHES) \
-DTCL_BUILDTIME_LIBRARY="\"${TCL_BUILDTIME_LIBRARY}\"" \
-DTCL_TEST -DTCL_XT_TEST $(UNIX_DIR)/tclAppInit.c
- @rm -f xtTestInit.o
+ rm -f xtTestInit.o
mv tclAppInit.o xtTestInit.o
@if test -f tclAppInit.sav ; then \
mv tclAppInit.sav tclAppInit.o; \
- fi
+ fi;
# Object files used on all Unix systems:
-REGHDRS = $(GENERIC_DIR)/regex.h $(GENERIC_DIR)/regguts.h \
- $(GENERIC_DIR)/regcustom.h
-TCLREHDRS = $(GENERIC_DIR)/tclRegexp.h
-COMPILEHDR = $(GENERIC_DIR)/tclCompile.h
-FSHDR = $(GENERIC_DIR)/tclFileSystem.h
-IOHDR = $(GENERIC_DIR)/tclIO.h
-MATHHDRS = $(GENERIC_DIR)/tclTomMath.h $(GENERIC_DIR)/tclTomMathDecls.h
-PARSEHDR = $(GENERIC_DIR)/tclParse.h
-NREHDR = $(GENERIC_DIR)/tclInt.h
-TRIMHDR = $(GENERIC_DIR)/tclStringTrim.h
-
-TCL_LOCATIONS = -DTCL_LIBRARY="\"${TCL_LIBRARY}\"" \
- -DTCL_PACKAGE_PATH="\"${TCL_PACKAGE_PATH}\""
+REGHDRS=$(GENERIC_DIR)/regex.h $(GENERIC_DIR)/regguts.h \
+ $(GENERIC_DIR)/regcustom.h
+TCLREHDRS=$(GENERIC_DIR)/tclRegexp.h
+COMPILEHDR=$(GENERIC_DIR)/tclCompile.h
+FSHDR=$(GENERIC_DIR)/tclFileSystem.h
+IOHDR=$(GENERIC_DIR)/tclIO.h
+MATHHDRS=$(GENERIC_DIR)/tommath.h $(GENERIC_DIR)/tclTomMath.h
regcomp.o: $(REGHDRS) $(GENERIC_DIR)/regcomp.c $(GENERIC_DIR)/regc_lex.c \
$(GENERIC_DIR)/regc_color.c $(GENERIC_DIR)/regc_locale.c \
@@ -1281,16 +986,10 @@ tclAppInit.o: $(UNIX_DIR)/tclAppInit.c
tclAlloc.o: $(GENERIC_DIR)/tclAlloc.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclAlloc.c
-tclArithSeries.o: $(GENERIC_DIR)/tclArithSeries.c $(COMPILEHDR)
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclArithSeries.c
-
-tclAssembly.o: $(GENERIC_DIR)/tclAssembly.c $(COMPILEHDR)
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclAssembly.c
-
tclAsync.o: $(GENERIC_DIR)/tclAsync.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclAsync.c
-tclBasic.o: $(GENERIC_DIR)/tclBasic.c $(COMPILEHDR) $(MATHHDRS) $(NREHDR)
+tclBasic.o: $(GENERIC_DIR)/tclBasic.c $(COMPILEHDR) $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclBasic.c
tclBinary.o: $(GENERIC_DIR)/tclBinary.c
@@ -1308,7 +1007,7 @@ tclCmdAH.o: $(GENERIC_DIR)/tclCmdAH.c
tclCmdIL.o: $(GENERIC_DIR)/tclCmdIL.c $(TCLREHDRS)
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCmdIL.c
-tclCmdMZ.o: $(GENERIC_DIR)/tclCmdMZ.c $(TCLREHDRS) $(TRIMHDR)
+tclCmdMZ.o: $(GENERIC_DIR)/tclCmdMZ.c $(TCLREHDRS)
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCmdMZ.c
tclDate.o: $(GENERIC_DIR)/tclDate.c
@@ -1317,12 +1016,6 @@ tclDate.o: $(GENERIC_DIR)/tclDate.c
tclCompCmds.o: $(GENERIC_DIR)/tclCompCmds.c $(COMPILEHDR)
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCompCmds.c
-tclCompCmdsGR.o: $(GENERIC_DIR)/tclCompCmdsGR.c $(COMPILEHDR)
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCompCmdsGR.c
-
-tclCompCmdsSZ.o: $(GENERIC_DIR)/tclCompCmdsSZ.c $(COMPILEHDR) $(TRIMHDR)
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCompCmdsSZ.c
-
tclCompExpr.o: $(GENERIC_DIR)/tclCompExpr.c $(COMPILEHDR)
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCompExpr.c
@@ -1335,22 +1028,16 @@ tclConfig.o: $(GENERIC_DIR)/tclConfig.c
tclDictObj.o: $(GENERIC_DIR)/tclDictObj.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclDictObj.c
-tclDisassemble.o: $(GENERIC_DIR)/tclDisassemble.c $(COMPILEHDR)
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclDisassemble.c
-
tclEncoding.o: $(GENERIC_DIR)/tclEncoding.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclEncoding.c
-tclEnsemble.o: $(GENERIC_DIR)/tclEnsemble.c $(COMPILEHDR)
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclEnsemble.c
-
tclEnv.o: $(GENERIC_DIR)/tclEnv.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclEnv.c
-tclEvent.o: $(GENERIC_DIR)/tclEvent.c tclUuid.h
+tclEvent.o: $(GENERIC_DIR)/tclEvent.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclEvent.c
-tclExecute.o: $(GENERIC_DIR)/tclExecute.c $(COMPILEHDR) $(MATHHDRS) $(NREHDR)
+tclExecute.o: $(GENERIC_DIR)/tclExecute.c $(COMPILEHDR) $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclExecute.c
tclFCmd.o: $(GENERIC_DIR)/tclFCmd.c
@@ -1392,9 +1079,6 @@ tclIOUtil.o: $(GENERIC_DIR)/tclIOUtil.c $(FSHDR)
tclIORChan.o: $(GENERIC_DIR)/tclIORChan.c $(IOHDR)
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIORChan.c
-tclIORTrans.o: $(GENERIC_DIR)/tclIORTrans.c $(IOHDR)
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIORTrans.c
-
tclLink.o: $(GENERIC_DIR)/tclLink.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclLink.c
@@ -1407,9 +1091,6 @@ tclLiteral.o: $(GENERIC_DIR)/tclLiteral.c $(COMPILEHDR)
tclObj.o: $(GENERIC_DIR)/tclObj.c $(COMPILEHDR) $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclObj.c
-tclOptimize.o: $(GENERIC_DIR)/tclOptimize.c $(COMPILEHDR)
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOptimize.c
-
tclLoad.o: $(GENERIC_DIR)/tclLoad.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclLoad.c
@@ -1440,34 +1121,13 @@ tclLoadShl.o: $(UNIX_DIR)/tclLoadShl.c
tclMain.o: $(GENERIC_DIR)/tclMain.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclMain.c
-tclNamesp.o: $(GENERIC_DIR)/tclNamesp.c $(COMPILEHDR)
+tclNamesp.o: $(GENERIC_DIR)/tclNamesp.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclNamesp.c
tclNotify.o: $(GENERIC_DIR)/tclNotify.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclNotify.c
-tclOO.o: $(GENERIC_DIR)/tclOO.c $(GENERIC_DIR)/tclOOScript.h
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOO.c
-
-tclOOBasic.o: $(GENERIC_DIR)/tclOOBasic.c
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOOBasic.c
-
-tclOOCall.o: $(GENERIC_DIR)/tclOOCall.c
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOOCall.c
-
-tclOODefineCmds.o: $(GENERIC_DIR)/tclOODefineCmds.c
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOODefineCmds.c
-
-tclOOInfo.o: $(GENERIC_DIR)/tclOOInfo.c
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOOInfo.c
-
-tclOOMethod.o: $(GENERIC_DIR)/tclOOMethod.c
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOOMethod.c
-
-tclOOStubInit.o: $(GENERIC_DIR)/tclOOStubInit.c
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOOStubInit.c
-
-tclParse.o: $(GENERIC_DIR)/tclParse.c $(PARSEHDR)
+tclParse.o: $(GENERIC_DIR)/tclParse.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclParse.c
tclPanic.o: $(GENERIC_DIR)/tclPanic.c
@@ -1491,18 +1151,19 @@ tclPkg.o: $(GENERIC_DIR)/tclPkg.c
# prefix/exec_prefix but all the different paths individually.
tclPkgConfig.o: $(GENERIC_DIR)/tclPkgConfig.c
- $(CC) -c $(CC_SWITCHES) \
+ $(CC) -c $(CC_SWITCHES) \
-DCFG_INSTALL_LIBDIR="\"$(LIB_INSTALL_DIR)\"" \
-DCFG_INSTALL_BINDIR="\"$(BIN_INSTALL_DIR)\"" \
-DCFG_INSTALL_SCRDIR="\"$(SCRIPT_INSTALL_DIR)\"" \
-DCFG_INSTALL_INCDIR="\"$(INCLUDE_INSTALL_DIR)\"" \
-DCFG_INSTALL_DOCDIR="\"$(MAN_INSTALL_DIR)\"" \
+ \
-DCFG_RUNTIME_LIBDIR="\"$(libdir)\"" \
-DCFG_RUNTIME_BINDIR="\"$(bindir)\"" \
-DCFG_RUNTIME_SCRDIR="\"$(TCL_LIBRARY)\"" \
-DCFG_RUNTIME_INCDIR="\"$(includedir)\"" \
-DCFG_RUNTIME_DOCDIR="\"$(mandir)\"" \
- -DCFG_RUNTIME_DLLFILE="\"$(TCL_LIB_FILE)\"" \
+ \
$(GENERIC_DIR)/tclPkgConfig.c
tclPosixStr.o: $(GENERIC_DIR)/tclPosixStr.c
@@ -1511,12 +1172,9 @@ tclPosixStr.o: $(GENERIC_DIR)/tclPosixStr.c
tclPreserve.o: $(GENERIC_DIR)/tclPreserve.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPreserve.c
-tclProc.o: $(GENERIC_DIR)/tclProc.c $(COMPILEHDR) $(NREHDR)
+tclProc.o: $(GENERIC_DIR)/tclProc.c $(COMPILEHDR)
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclProc.c
-tclProcess.o: $(GENERIC_DIR)/tclProcess.c
- $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclProcess.c
-
tclRegexp.o: $(GENERIC_DIR)/tclRegexp.c $(TCLREHDRS)
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclRegexp.c
@@ -1541,7 +1199,7 @@ tclStubInit.o: $(GENERIC_DIR)/tclStubInit.c
tclTrace.o: $(GENERIC_DIR)/tclTrace.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclTrace.c
-tclUtil.o: $(GENERIC_DIR)/tclUtil.c $(PARSEHDR) $(TRIMHDR)
+tclUtil.o: $(GENERIC_DIR)/tclUtil.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclUtil.c
tclUtf.o: $(GENERIC_DIR)/tclUtf.c $(GENERIC_DIR)/tclUniData.c
@@ -1550,17 +1208,7 @@ tclUtf.o: $(GENERIC_DIR)/tclUtf.c $(GENERIC_DIR)/tclUniData.c
tclVar.o: $(GENERIC_DIR)/tclVar.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclVar.c
-tclZlib.o: $(GENERIC_DIR)/tclZlib.c
- $(CC) -c $(CC_SWITCHES) $(ZLIB_INCLUDE) $(GENERIC_DIR)/tclZlib.c
-
-tclZipfs.o: $(GENERIC_DIR)/tclZipfs.c
- $(CC) -c $(CC_SWITCHES) -D_GNU_SOURCE \
- -DCFG_RUNTIME_DLLFILE="\"$(TCL_LIB_FILE)\"" \
- -DCFG_RUNTIME_LIBDIR="\"$(libdir)\"" \
- -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip \
- $(GENERIC_DIR)/tclZipfs.c
-
-tclTest.o: $(GENERIC_DIR)/tclTest.c $(IOHDR) $(TCLREHDRS) tclUuid.h
+tclTest.o: $(GENERIC_DIR)/tclTest.c $(IOHDR) $(TCLREHDRS)
$(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tclTest.c
tclTestObj.o: $(GENERIC_DIR)/tclTestObj.c $(MATHHDRS)
@@ -1590,14 +1238,17 @@ tclThreadTest.o: $(GENERIC_DIR)/tclThreadTest.c
tclTomMathInterface.o: $(GENERIC_DIR)/tclTomMathInterface.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclTomMathInterface.c
-bn_s_mp_reverse.o: $(TOMMATH_DIR)/bn_s_mp_reverse.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_reverse.c
+bncore.o: $(TOMMATH_DIR)/bncore.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bncore.c
+
+bn_reverse.o: $(TOMMATH_DIR)/bn_reverse.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_reverse.c
-bn_s_mp_mul_digs_fast.o: $(TOMMATH_DIR)/bn_s_mp_mul_digs_fast.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_mul_digs_fast.c
+bn_fast_s_mp_mul_digs.o: $(TOMMATH_DIR)/bn_fast_s_mp_mul_digs.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_fast_s_mp_mul_digs.c
-bn_s_mp_sqr_fast.o: $(TOMMATH_DIR)/bn_s_mp_sqr_fast.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_sqr_fast.c
+bn_fast_s_mp_sqr.o: $(TOMMATH_DIR)/bn_fast_s_mp_sqr.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_fast_s_mp_sqr.c
bn_mp_add.o: $(TOMMATH_DIR)/bn_mp_add.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_add.c
@@ -1653,11 +1304,8 @@ bn_mp_div_3.o: $(TOMMATH_DIR)/bn_mp_div_3.c $(MATHHDRS)
bn_mp_exch.o: $(TOMMATH_DIR)/bn_mp_exch.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_exch.c
-bn_mp_expt_u32.o: $(TOMMATH_DIR)/bn_mp_expt_u32.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_expt_u32.c
-
-bn_mp_get_mag_u64.o: $(TOMMATH_DIR)/bn_mp_get_mag_u64.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_get_mag_u64.c
+bn_mp_expt_d.o: $(TOMMATH_DIR)/bn_mp_expt_d.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_expt_d.c
bn_mp_grow.o: $(TOMMATH_DIR)/bn_mp_grow.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_grow.c
@@ -1668,29 +1316,23 @@ bn_mp_init.o: $(TOMMATH_DIR)/bn_mp_init.c $(MATHHDRS)
bn_mp_init_copy.o: $(TOMMATH_DIR)/bn_mp_init_copy.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_copy.c
-bn_mp_init_i64.o:$(TOMMATH_DIR)/bn_mp_init_i64.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_i64.c
-
bn_mp_init_multi.o: $(TOMMATH_DIR)/bn_mp_init_multi.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_multi.c
bn_mp_init_set.o: $(TOMMATH_DIR)/bn_mp_init_set.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_set.c
+bn_mp_init_set_int.o: $(TOMMATH_DIR)/bn_mp_init_set_int.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_set_int.c
+
bn_mp_init_size.o:$(TOMMATH_DIR)/bn_mp_init_size.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_size.c
-bn_mp_init_u64.o:$(TOMMATH_DIR)/bn_mp_init_u64.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_u64.c
-
-bn_s_mp_karatsuba_mul.o: $(TOMMATH_DIR)/bn_s_mp_karatsuba_mul.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_karatsuba_mul.c
+bn_mp_karatsuba_mul.o: $(TOMMATH_DIR)/bn_mp_karatsuba_mul.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_karatsuba_mul.c
-bn_s_mp_karatsuba_sqr.o: $(TOMMATH_DIR)/bn_s_mp_karatsuba_sqr.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_karatsuba_sqr.c
-
-bn_s_mp_balance_mul.o: $(TOMMATH_DIR)/bn_s_mp_balance_mul.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_balance_mul.c
+bn_mp_karatsuba_sqr.o: $(TOMMATH_DIR)/bn_mp_karatsuba_sqr.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_karatsuba_sqr.c
bn_mp_lshd.o: $(TOMMATH_DIR)/bn_mp_lshd.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_lshd.c
@@ -1719,12 +1361,6 @@ bn_mp_neg.o: $(TOMMATH_DIR)/bn_mp_neg.c $(MATHHDRS)
bn_mp_or.o: $(TOMMATH_DIR)/bn_mp_or.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_or.c
-bn_mp_pack.o: $(TOMMATH_DIR)/bn_mp_pack.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_pack.c
-
-bn_mp_pack_count.o: $(TOMMATH_DIR)/bn_mp_pack_count.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_pack_count.c
-
bn_mp_radix_size.o: $(TOMMATH_DIR)/bn_mp_radix_size.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_radix_size.c
@@ -1737,11 +1373,11 @@ bn_mp_read_radix.o: $(TOMMATH_DIR)/bn_mp_read_radix.c $(MATHHDRS)
bn_mp_rshd.o: $(TOMMATH_DIR)/bn_mp_rshd.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_rshd.c
-bn_mp_set_i64.o: $(TOMMATH_DIR)/bn_mp_set_i64.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_set_i64.c
+bn_mp_set.o: $(TOMMATH_DIR)/bn_mp_set.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_set.c
-bn_mp_set_u64.o: $(TOMMATH_DIR)/bn_mp_set_u64.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_set_u64.c
+bn_mp_set_int.o: $(TOMMATH_DIR)/bn_mp_set_int.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_set_int.c
bn_mp_shrink.o: $(TOMMATH_DIR)/bn_mp_shrink.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_shrink.c
@@ -1758,26 +1394,23 @@ bn_mp_sub.o: $(TOMMATH_DIR)/bn_mp_sub.c $(MATHHDRS)
bn_mp_sub_d.o: $(TOMMATH_DIR)/bn_mp_sub_d.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_sub_d.c
-bn_mp_signed_rsh.o: $(TOMMATH_DIR)/bn_mp_signed_rsh.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_signed_rsh.c
-
-bn_mp_to_ubin.o: $(TOMMATH_DIR)/bn_mp_to_ubin.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_to_ubin.c
+bn_mp_to_unsigned_bin.o: $(TOMMATH_DIR)/bn_mp_to_unsigned_bin.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_to_unsigned_bin.c
-bn_s_mp_toom_mul.o: $(TOMMATH_DIR)/bn_s_mp_toom_mul.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_toom_mul.c
+bn_mp_to_unsigned_bin_n.o: $(TOMMATH_DIR)/bn_mp_to_unsigned_bin_n.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_to_unsigned_bin_n.c
-bn_s_mp_toom_sqr.o: $(TOMMATH_DIR)/bn_s_mp_toom_sqr.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_toom_sqr.c
+bn_mp_toom_mul.o: $(TOMMATH_DIR)/bn_mp_toom_mul.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_toom_mul.c
-bn_mp_to_radix.o: $(TOMMATH_DIR)/bn_mp_to_radix.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_to_radix.c
+bn_mp_toom_sqr.o: $(TOMMATH_DIR)/bn_mp_toom_sqr.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_toom_sqr.c
-bn_mp_ubin_size.o: $(TOMMATH_DIR)/bn_mp_ubin_size.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_ubin_size.c
+bn_mp_toradix_n.o: $(TOMMATH_DIR)/bn_mp_toradix_n.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_toradix_n.c
-bn_mp_unpack.o: $(TOMMATH_DIR)/bn_mp_unpack.c $(MATHHDRS)
- $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_unpack.c
+bn_mp_unsigned_bin_size.o: $(TOMMATH_DIR)/bn_mp_unsigned_bin_size.c $(MATHHDRS)
+ $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_unsigned_bin_size.c
bn_mp_xor.o: $(TOMMATH_DIR)/bn_mp_xor.c $(MATHHDRS)
$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_xor.c
@@ -1809,14 +1442,8 @@ tclUnixFCmd.o: $(UNIX_DIR)/tclUnixFCmd.c
tclUnixFile.o: $(UNIX_DIR)/tclUnixFile.c $(FSHDR)
$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixFile.c
-tclEpollNotfy.o: $(UNIX_DIR)/tclEpollNotfy.c $(UNIX_DIR)/tclUnixNotfy.c
- $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclEpollNotfy.c
-
-tclKqueueNotfy.o: $(UNIX_DIR)/tclKqueueNotfy.c $(UNIX_DIR)/tclUnixNotfy.c
- $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclKqueueNotfy.c
-
-tclSelectNotfy.o: $(UNIX_DIR)/tclSelectNotfy.c $(UNIX_DIR)/tclUnixNotfy.c
- $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclSelectNotfy.c
+tclUnixNotfy.o: $(UNIX_DIR)/tclUnixNotfy.c
+ $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixNotfy.c
tclUnixPipe.o: $(UNIX_DIR)/tclUnixPipe.c
$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixPipe.c
@@ -1834,7 +1461,9 @@ tclUnixTime.o: $(UNIX_DIR)/tclUnixTime.c
$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixTime.c
tclUnixInit.o: $(UNIX_DIR)/tclUnixInit.c tclConfig.sh
- $(CC) -c $(CC_SWITCHES) $(TCL_LOCATIONS) $(UNIX_DIR)/tclUnixInit.c
+ $(CC) -c $(CC_SWITCHES) -DTCL_LIBRARY=\"${TCL_LIBRARY}\" \
+ -DTCL_PACKAGE_PATH="\"${TCL_PACKAGE_PATH}\"" \
+ $(UNIX_DIR)/tclUnixInit.c
tclUnixCompat.o: $(UNIX_DIR)/tclUnixCompat.c
$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixCompat.c
@@ -1855,7 +1484,7 @@ tclWinError.o: $(TOP_DIR)/win/tclWinError.c
# DTrace support
-$(TCL_OBJS) $(STUB_LIB_OBJS) $(TCLSH_OBJS) $(TCLTEST_OBJS) $(XTTEST_OBJS) $(TOMMATH_OBJS): @DTRACE_HDR@
+$(TCL_OBJS) $(STUB_LIB_OBJS) $(TCLSH_OBJS) $(TCLTEST_OBJS) $(XTTEST_OBJS): @DTRACE_HDR@
$(DTRACE_HDR): $(DTRACE_SRC)
$(DTRACE) -h $(DTRACE_SWITCHES) -o $@ -s $(DTRACE_SRC)
@@ -1869,9 +1498,10 @@ $(DTRACE_OBJ): $(DTRACE_SRC) $(TCL_OBJS)
# notifier can modify them to suit their own installation.
#--------------------------------------------------------------------------
-xttest: ${XTTEST_OBJS} ${TCL_LIB_FILE} ${TCL_STUB_LIB_FILE} ${BUILD_DLTEST}
- ${CC} ${CFLAGS} ${LDFLAGS} ${XTTEST_OBJS} \
- @TCL_BUILD_LIB_SPEC@ ${TCL_STUB_LIB_FILE} ${LIBS} @EXTRA_TCLSH_LIBS@ \
+xttest: ${XTTEST_OBJS} ${GENERIC_OBJS} ${UNIX_OBJS} ${COMPAT_OBJS} \
+ @DL_OBJS@ ${BUILD_DLTEST}
+ ${CC} ${XTTEST_OBJS} ${GENERIC_OBJS} ${UNIX_OBJS} ${COMPAT_OBJS} \
+ @DL_OBJS@ @TCL_BUILD_LIB_SPEC@ ${LIBS} \
${CC_SEARCH_FLAGS} -L/usr/openwin/lib -lXt -o xttest
tclXtNotify.o: $(UNIX_DIR)/tclXtNotify.c
@@ -1889,242 +1519,44 @@ tclXtTest.o: $(UNIX_DIR)/tclXtTest.c
# relocatable.
#--------------------------------------------------------------------------
-mkstemp.o: $(COMPAT_DIR)/mkstemp.c
- $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/mkstemp.c
+fixstrtod.o: $(COMPAT_DIR)/fixstrtod.c
+ $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/fixstrtod.c
+
+opendir.o: $(COMPAT_DIR)/opendir.c
+ $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/opendir.c
+
+memcmp.o: $(COMPAT_DIR)/memcmp.c
+ $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/memcmp.c
strncasecmp.o: $(COMPAT_DIR)/strncasecmp.c
$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strncasecmp.c
+strstr.o: $(COMPAT_DIR)/strstr.c
+ $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strstr.c
+
+strtod.o: $(COMPAT_DIR)/strtod.c
+ $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strtod.c
+
+strtol.o: $(COMPAT_DIR)/strtol.c
+ $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strtol.c
+
+strtoul.o: $(COMPAT_DIR)/strtoul.c
+ $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strtoul.c
+
waitpid.o: $(COMPAT_DIR)/waitpid.c
$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/waitpid.c
-fake-rfc2553.o: $(COMPAT_DIR)/fake-rfc2553.c
- $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/fake-rfc2553.c
-
-# For building zlib, only used in some build configurations
-Zadler32.o: $(ZLIB_DIR)/adler32.c
- $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/adler32.c
-Zcompress.o: $(ZLIB_DIR)/compress.c
- $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/compress.c
-Zcrc32.o: $(ZLIB_DIR)/crc32.c
- $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/crc32.c
-Zdeflate.o: $(ZLIB_DIR)/deflate.c
- $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/deflate.c
-Zinfback.o: $(ZLIB_DIR)/infback.c
- $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/infback.c
-Zinffast.o: $(ZLIB_DIR)/inffast.c
- $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/inffast.c
-Zinflate.o: $(ZLIB_DIR)/inflate.c
- $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/inflate.c
-Zinftrees.o: $(ZLIB_DIR)/inftrees.c
- $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/inftrees.c
-Ztrees.o: $(ZLIB_DIR)/trees.c
- $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/trees.c
-Zuncompr.o: $(ZLIB_DIR)/uncompr.c
- $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/uncompr.c
-Zzutil.o: $(ZLIB_DIR)/zutil.c
- $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/zutil.c
-
#--------------------------------------------------------------------------
# Stub library binaries, these must be compiled for use in a shared library
# even though they will be placed in a static archive
#--------------------------------------------------------------------------
tclStubLib.o: $(GENERIC_DIR)/tclStubLib.c
- $(CC) -c $(STUB_CC_SWITCHES) -DSTATIC_BUILD @CFLAGS_NOLTO@ $(GENERIC_DIR)/tclStubLib.c
-
-tclTomMathStubLib.o: $(GENERIC_DIR)/tclTomMathStubLib.c
- $(CC) -c $(STUB_CC_SWITCHES) @CFLAGS_NOLTO@ $(GENERIC_DIR)/tclTomMathStubLib.c
-
-tclOOStubLib.o: $(GENERIC_DIR)/tclOOStubLib.c
- $(CC) -c $(STUB_CC_SWITCHES) @CFLAGS_NOLTO@ $(GENERIC_DIR)/tclOOStubLib.c
+ $(CC) -c $(STUB_CC_SWITCHES) -DSTATIC_BUILD $(GENERIC_DIR)/tclStubLib.c
.c.o:
$(CC) -c $(CC_SWITCHES) $<
-#--------------------------------------------------------------------------
-# Minizip implementation
-#--------------------------------------------------------------------------
-adler32.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/adler32.c
-
-compress.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/compress.c
-
-crc32.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/crc32.c
-
-deflate.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/deflate.c
-
-ioapi.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -DIOAPI_NO_64 -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c \
- $(ZLIB_DIR)/contrib/minizip/ioapi.c
-
-infback.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/infback.c
-
-inffast.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/inffast.c
-
-inflate.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/inflate.c
-
-inftrees.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/inftrees.c
-
-trees.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/trees.c
-
-uncompr.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/uncompr.c
-
-zip.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c \
- $(ZLIB_DIR)/contrib/minizip/zip.c
-
-zutil.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/zutil.c
-
-minizip.$(HOST_OBJEXT):
- $(HOST_CC) -o $@ -DIOAPI_NO_64 -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c \
- $(ZLIB_DIR)/contrib/minizip/minizip.c
-
-minizip${HOST_EXEEXT}: $(MINIZIP_OBJS)
- $(HOST_CC) -o $@ $(MINIZIP_OBJS)
-
-#--------------------------------------------------------------------------
-# Bundled Package targets
-#--------------------------------------------------------------------------
-
-# Propagate configure args like --enable-64bit to package configure
-PKG_CFG_ARGS = @PKG_CFG_ARGS@
-# If PKG_DIR is changed to a different relative depth to the build dir, need
-# to adapt the ../.. relative paths below and at the top of configure.ac (we
-# cannot use absolute paths due to issues in nested configure when path to
-# build dir contains spaces).
-PKG_DIR = ./pkgs
-
-configure-packages:
- @for i in $(PKGS_DIR)/*; do \
- if [ -d $$i ] ; then \
- if [ -x $$i/configure ] ; then \
- pkg=`basename $$i`; \
- echo "Configuring package '$$pkg'"; \
- mkdir -p $(PKG_DIR)/$$pkg; \
- if [ ! -f $(PKG_DIR)/$$pkg/Makefile ] ; then \
- ( cd $(PKG_DIR)/$$pkg; \
- $$i/configure --with-tcl=../.. \
- --with-tclinclude=$(GENERIC_DIR) \
- $(PKG_CFG_ARGS) --libdir=$(PACKAGE_DIR) \
- --enable-shared; ) || exit $$?; \
- fi; \
- fi; \
- fi; \
- done
-
-packages: configure-packages ${STUB_LIB_FILE}
- @for i in $(PKGS_DIR)/*; do \
- if [ -d $$i ] ; then \
- pkg=`basename $$i`; \
- if [ -f $(PKG_DIR)/$$pkg/Makefile ] ; then \
- echo "Building package '$$pkg'"; \
- ( cd $(PKG_DIR)/$$pkg; $(MAKE); ) || exit $$?; \
- fi; \
- fi; \
- done
-
-install-packages: packages
- @for i in $(PKGS_DIR)/*; do \
- if [ -d $$i ] ; then \
- pkg=`basename $$i`; \
- if [ -f $(PKG_DIR)/$$pkg/Makefile ] ; then \
- echo "Installing package '$$pkg'"; \
- ( cd $(PKG_DIR)/$$pkg; $(MAKE) install \
- "DESTDIR=$(INSTALL_ROOT)"; ) || exit $$?; \
- fi; \
- fi; \
- done
-
-test-packages: ${TCLTEST_EXE} packages
- @for i in $(PKGS_DIR)/*; do \
- if [ -d $$i ] ; then \
- pkg=`basename $$i`; \
- if [ -f $(PKG_DIR)/$$pkg/Makefile ] ; then \
- echo "Testing package '$$pkg'"; \
- ( cd $(PKG_DIR)/$$pkg; $(MAKE) \
- "@LD_LIBRARY_PATH_VAR@=../..:$${@LD_LIBRARY_PATH_VAR@}" \
- "TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" \
- "TCLLIBPATH=../../pkgs" test \
- "TCLSH_PROG=../../${TCLTEST_EXE}"; ) \
- fi; \
- fi; \
- done
-
-clean-packages:
- @for i in $(PKGS_DIR)/*; do \
- if [ -d $$i ] ; then \
- pkg=`basename $$i`; \
- if [ -f $(PKG_DIR)/$$pkg/Makefile ] ; then \
- ( cd $(PKG_DIR)/$$pkg; $(MAKE) clean; ) \
- fi; \
- fi; \
- done
-
-distclean-packages:
- @for i in $(PKGS_DIR)/*; do \
- if [ -d $$i ] ; then \
- pkg=`basename $$i`; \
- if [ -f $(PKG_DIR)/$$pkg/Makefile ] ; then \
- ( cd $(PKG_DIR)/$$pkg; $(MAKE) distclean; ) \
- fi; \
- rm -rf $(PKG_DIR)/$$pkg; \
- fi; \
- done; \
- rm -rf $(PKG_DIR)
-
-dist-packages: configure-packages
- @rm -rf $(DISTROOT)/pkgs; \
- mkdir -p $(DISTROOT)/pkgs; \
- for i in $(PKGS_DIR)/*; do \
- if [ -d $$i ] ; then \
- pkg=`basename $$i`; \
- if [ -f $(PKG_DIR)/$$pkg/Makefile ] ; then \
- ( cd $(PKG_DIR)/$$pkg; $(MAKE) dist \
- "DIST_ROOT=$(DISTROOT)/pkgs"; ) || exit $$?; \
- fi; \
- fi; \
- done
-
-#--------------------------------------------------------------------------
-# Maintainer-only targets
-#--------------------------------------------------------------------------
-
-# The following target generates the file generic/tclDate.c from the yacc
-# grammar found in generic/tclGetDate.y. This is only run by hand as yacc is
-# not available in all environments. The name of the .c file is different than
-# the name of the .y file so that make doesn't try to automatically regenerate
-# the .c file.
-
-#
-# Remark: see [54a305cb88]. tclDate.c is manually edited, removing the unused "yynerrs" variable
-gendate:
- bison --output-file=$(GENERIC_DIR)/tclDate.c \
- --no-lines \
- --name-prefix=TclDate \
- $(GENERIC_DIR)/tclGetDate.y
-
-# yacc -l $(GENERIC_DIR)/tclGetDate.y
-# sed -e 's/yy/TclDate/g' -e '/^#include <values.h>/d' \
-# -e 's?SCCSID?RCS: @(#) ?' \
-# -e '/#ifdef __STDC__/,/#endif/d' -e '/TclDateerrlab:/d' \
-# -e '/TclDatenewstate:/d' -e '/#pragma/d' \
-# -e '/#include <inttypes.h>/d' \
-# -e '/#define YYNEW/s/malloc/TclDateAlloc/g' \
-# -e '/#define YYENLARGE/,/realloc/s/realloc/TclDateRealloc/g' \
-# <y.tab.c >$(GENERIC_DIR)/tclDate.c
-# rm y.tab.c
-
#
# Target to regenerate header files and stub files from the *.decls tables.
#
@@ -2135,26 +1567,10 @@ $(GENERIC_DIR)/tclStubInit.c: $(GENERIC_DIR)/tcl.decls \
@echo "Developers may want to run \"make genstubs\" to regenerate."
@echo "This warning can be safely ignored, do not report as a bug!"
-$(GENERIC_DIR)/tclOOStubInit.c: $(GENERIC_DIR)/tclOO.decls
- @echo "Warning: tclOOStubInit.c may be out of date."
- @echo "Developers may want to run \"make genstubs\" to regenerate."
- @echo "This warning can be safely ignored, do not report as a bug!"
-
-$(GENERIC_DIR)/tclOOScript.h: $(TOOL_DIR)/tclOOScript.tcl
- @echo "Warning: tclOOScript.h may be out of date."
- @echo "Developers may want to run \"make genscript\" to regenerate."
- @echo "This warning can be safely ignored, do not report as a bug!"
-
genstubs:
- $(NATIVE_TCLSH) $(TOOL_DIR)/genStubs.tcl $(GENERIC_DIR) \
+ $(TCL_EXE) $(TOOL_DIR)/genStubs.tcl $(GENERIC_DIR) \
$(GENERIC_DIR)/tcl.decls $(GENERIC_DIR)/tclInt.decls \
$(GENERIC_DIR)/tclTomMath.decls
- $(NATIVE_TCLSH) $(TOOL_DIR)/genStubs.tcl $(GENERIC_DIR) \
- $(GENERIC_DIR)/tclOO.decls
-
-genscript:
- $(NATIVE_TCLSH) $(TOOL_DIR)/makeHeader.tcl \
- $(TOOL_DIR)/tclOOScript.tcl $(GENERIC_DIR)/tclOOScript.h
#
# Target to check that all exported functions have an entry in the stubs
@@ -2164,16 +1580,14 @@ genscript:
checkstubs: $(TCL_LIB_FILE)
-@for i in `nm -p $(TCL_LIB_FILE) \
| awk '$$2 ~ /^[TDBCS]$$/ { sub("^_", "", $$3); print $$3 }' \
- | sort -n` ; do \
- match=0; \
- for j in $(TCL_DECLS); do \
- if [ `grep -c "$$i *(" $$j` -gt 0 ] ; then \
- match=1; \
- fi; \
- done; \
- if [ $$match -eq 0 ] ; then \
- echo $$i; \
- fi; \
+ | sort -n`; do \
+ match=0; \
+ for j in $(TCL_DECLS); do \
+ if [ `grep -c "$$i *(" $$j` -gt 0 ]; then \
+ match=1; \
+ fi; \
+ done; \
+ if [ $$match -eq 0 ]; then echo $$i; fi \
done
#
@@ -2183,17 +1597,14 @@ checkstubs: $(TCL_LIB_FILE)
checkdoc: $(TCL_LIB_FILE)
-@for i in `nm -p $(TCL_LIB_FILE) | awk '$$3 ~ /Tcl_/ { print $$3 }' \
- | grep -Fv . | grep -v 'Cmd$$' | sort -n`; do \
- match=0; \
- i=`echo $$i | sed 's/^_//'`; \
- for j in $(TOP_DIR)/doc/*.3; do \
- if [ `grep '\-' $$j | grep -c $$i` -gt 0 ]; then \
- match=1; \
- fi; \
- done; \
- if [ $$match -eq 0 ]; then \
- echo $$i; \
- fi; \
+ | grep -v 'Cmd$$' | sort -n`; do \
+ match=0; \
+ for j in $(TOP_DIR)/doc/*.3; do \
+ if [ `grep '\-' $$j | grep -c $$i` -gt 0 ]; then \
+ match=1; \
+ fi; \
+ done; \
+ if [ $$match -eq 0 ]; then echo $$i; fi \
done
#
@@ -2201,7 +1612,7 @@ checkdoc: $(TCL_LIB_FILE)
#
checkuchar:
- -@egrep isalnum\|isalpha\|iscntrl\|isdigit\|islower\|isprint\|ispunct\|isspace\|isupper\|isxdigit\|toupper\|tolower $(SRCS) | grep -v UCHAR
+ -egrep isalnum\|isalpha\|iscntrl\|isdigit\|islower\|isprint\|ispunct\|isspace\|isupper\|isxdigit\|toupper\|tolower $(SRCS) | grep -v UCHAR
#
# Target to make sure that only symbols with "Tcl" prefixes are exported.
@@ -2221,34 +1632,27 @@ checkexports: $(TCL_LIB_FILE)
# system.
#
-RPM_PLATFORMS = i386
rpm: all
- -@rm -f THIS.TCL.SPEC
+ rm -f THIS.TCL.SPEC
echo "%define _builddir `pwd`" > THIS.TCL.SPEC
echo "%define _rpmdir `pwd`/RPMS" >> THIS.TCL.SPEC
cat tcl.spec >> THIS.TCL.SPEC
- for platform in $(RPM_PLATFORMS); do \
- mkdir -p RPMS/$$platform && \
- rpmbuild -bb THIS.TCL.SPEC && \
- mv RPMS/$$platform/*.rpm .; \
- done
- -rm -rf RPMS THIS.TCL.SPEC
+ mkdir -p RPMS/i386
+ rpmbuild -bb THIS.TCL.SPEC
+ mv RPMS/i386/*.rpm .
+ rm -rf RPMS THIS.TCL.SPEC
#
-# Target to create a proper Tcl distribution from information in the
-# source directory. DISTDIR must be defined to indicate where to put
-# the distribution. DISTDIR must be an absolute path name.
+# Target to create a proper Tcl distribution from information in the master
+# source directory. DISTDIR must be defined to indicate where to put the
+# distribution. DISTDIR must be an absolute path name.
#
DISTROOT = /tmp/dist
DISTNAME = tcl${VERSION}${PATCH_LEVEL}
ZIPNAME = tcl${MAJOR_VERSION}${MINOR_VERSION}${PATCH_LEVEL}-src.zip
DISTDIR = $(DISTROOT)/$(DISTNAME)
-DIST_INSTALL_DATA = $(INSTALL) -p -m 644
-DIST_INSTALL_SCRIPT = $(INSTALL) -p -m 755
-BUILTIN_PACKAGE_LIST = cookiejar http opt msgcat registry dde tcltest platform
-
-$(UNIX_DIR)/configure: $(UNIX_DIR)/configure.ac $(UNIX_DIR)/tcl.m4 \
+$(UNIX_DIR)/configure: $(UNIX_DIR)/configure.in $(UNIX_DIR)/tcl.m4 \
$(UNIX_DIR)/aclocal.m4
cd $(UNIX_DIR); autoconf
$(MAC_OSX_DIR)/configure: $(MAC_OSX_DIR)/configure.ac $(UNIX_DIR)/configure
@@ -2256,208 +1660,205 @@ $(MAC_OSX_DIR)/configure: $(MAC_OSX_DIR)/configure.ac $(UNIX_DIR)/configure
$(UNIX_DIR)/tclConfig.h.in: $(MAC_OSX_DIR)/configure
cd $(MAC_OSX_DIR); autoheader; touch $@
-tclUuid.h: $(TOP_DIR)/manifest.uuid
- echo "#define TCL_VERSION_UUID \\" >$@
- cat $(TOP_DIR)/manifest.uuid >>$@
- echo "" >>$@
-
-$(TOP_DIR)/manifest.uuid:
- printf "git-" >$(TOP_DIR)/manifest.uuid
- (cd $(TOP_DIR); git rev-parse HEAD >>$(TOP_DIR)/manifest.uuid || \
- (printf "svn-r" >$(TOP_DIR)/manifest.uuid ; \
- svn info --show-item last-changed-revision >>$(TOP_DIR)/manifest.uuid) || \
- printf "unknown" >$(TOP_DIR)/manifest.uuid)
-
-dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tclConfig.h.in $(UNIX_DIR)/tcl.pc.in genstubs \
- $(MAC_OSX_DIR)/configure $(TOP_DIR)/manifest.uuid dist-packages ${NATIVE_TCLSH}
+dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tclConfig.h.in $(UNIX_DIR)/tcl.pc.in $(MAC_OSX_DIR)/configure genstubs
rm -rf $(DISTDIR)
- $(INSTALL_DATA_DIR) $(DISTDIR)/unix
- $(DIST_INSTALL_DATA) $(TOP_DIR)/manifest.uuid $(DISTDIR)
- $(DIST_INSTALL_DATA) $(UNIX_DIR)/*.[ch] $(DISTDIR)/unix
- $(DIST_INSTALL_DATA) $(UNIX_DIR)/Makefile.in $(DISTDIR)/unix
- $(DIST_INSTALL_DATA) $(UNIX_DIR)/configure.ac \
+ mkdir -p $(DISTDIR)/unix
+ cp -p $(UNIX_DIR)/*.[ch] $(DISTDIR)/unix
+ cp $(UNIX_DIR)/Makefile.in $(DISTDIR)/unix
+ chmod 664 $(DISTDIR)/unix/Makefile.in
+ cp $(UNIX_DIR)/configure $(UNIX_DIR)/configure.in \
$(UNIX_DIR)/tcl.m4 $(UNIX_DIR)/aclocal.m4 \
- $(UNIX_DIR)/tclConfig.sh.in $(UNIX_DIR)/tclooConfig.sh \
- $(UNIX_DIR)/install-sh \
- $(UNIX_DIR)/README $(UNIX_DIR)/tcl.spec \
+ $(UNIX_DIR)/tclConfig.sh.in $(UNIX_DIR)/install-sh \
+ $(UNIX_DIR)/README $(UNIX_DIR)/ldAix $(UNIX_DIR)/tcl.spec \
$(UNIX_DIR)/installManPage $(UNIX_DIR)/tclConfig.h.in \
$(UNIX_DIR)/tcl.pc.in $(DISTDIR)/unix
- $(DIST_INSTALL_SCRIPT) $(UNIX_DIR)/configure $(UNIX_DIR)/ldAix $(DISTDIR)/unix
- $(INSTALL_DATA_DIR) $(DISTDIR)/generic
- $(DIST_INSTALL_DATA) $(GENERIC_DIR)/*.[cdh] $(DISTDIR)/generic
- $(DIST_INSTALL_DATA) $(GENERIC_DIR)/*.decls $(DISTDIR)/generic
- $(DIST_INSTALL_DATA) $(GENERIC_DIR)/README $(DISTDIR)/generic
- $(DIST_INSTALL_DATA) $(GENERIC_DIR)/tclGetDate.y $(DISTDIR)/generic
- $(DIST_INSTALL_DATA) $(TOP_DIR)/changes $(TOP_DIR)/README.md \
- $(TOP_DIR)/license.terms $(DISTDIR)
- $(INSTALL_DATA_DIR) $(DISTDIR)/library
- $(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(TOP_DIR)/library/*.tcl \
- $(TOP_DIR)/library/manifest.txt \
+ chmod 775 $(DISTDIR)/unix/configure $(DISTDIR)/unix/configure.in
+ chmod 775 $(DISTDIR)/unix/ldAix
+ @mkdir $(DISTDIR)/generic
+ cp -p $(GENERIC_DIR)/*.[cdh] $(DISTDIR)/generic
+ cp -p $(GENERIC_DIR)/*.decls $(DISTDIR)/generic
+ cp -p $(GENERIC_DIR)/README $(DISTDIR)/generic
+ cp -p $(GENERIC_DIR)/tclGetDate.y $(DISTDIR)/generic
+ cp -p $(TOP_DIR)/changes $(TOP_DIR)/ChangeLog $(TOP_DIR)/README \
+ $(TOP_DIR)/ChangeLog.[12]??? $(TOP_DIR)/license.terms \
+ $(DISTDIR)
+ @mkdir $(DISTDIR)/library
+ cp -p $(TOP_DIR)/license.terms $(TOP_DIR)/library/*.tcl \
$(TOP_DIR)/library/tclIndex $(DISTDIR)/library
- @for i in $(BUILTIN_PACKAGE_LIST); do \
- $(INSTALL_DATA_DIR) $(DISTDIR)/library/$$i;\
- $(DIST_INSTALL_DATA) $(TOP_DIR)/library/$$i/*.tcl $(DISTDIR)/library/$$i; \
- done
- $(DIST_INSTALL_DATA) $(TOP_DIR)/library/cookiejar/*.dat.gz $(DISTDIR)/library/cookiejar
- $(INSTALL_DATA_DIR) $(DISTDIR)/library/encoding
- $(DIST_INSTALL_DATA) $(TOP_DIR)/library/encoding/*.enc $(DISTDIR)/library/encoding
- $(INSTALL_DATA_DIR) $(DISTDIR)/library/msgs
- $(DIST_INSTALL_DATA) $(TOP_DIR)/library/msgs/*.msg $(DISTDIR)/library/msgs
+ for i in http1.0 http opt msgcat reg dde tcltest platform; \
+ do \
+ mkdir $(DISTDIR)/library/$$i ;\
+ cp -p $(TOP_DIR)/library/$$i/*.tcl $(DISTDIR)/library/$$i; \
+ done;
+ @mkdir $(DISTDIR)/library/encoding
+ cp -p $(TOP_DIR)/library/encoding/*.enc $(DISTDIR)/library/encoding
+ @mkdir $(DISTDIR)/library/msgs
+ cp -p $(TOP_DIR)/library/msgs/*.msg $(DISTDIR)/library/msgs
@echo cp -r $(TOP_DIR)/library/tzdata $(DISTDIR)/library/tzdata
- @( cd $(TOP_DIR); find library/tzdata -type f -print ) \
+ @( cd $(TOP_DIR); \
+ find library/tzdata -name CVS -prune -o -type f -print ) \
| ( cd $(TOP_DIR) ; xargs tar cf - ) \
| ( cd $(DISTDIR) ; tar xfp - )
- $(INSTALL_DATA_DIR) $(DISTDIR)/doc
- $(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(TOP_DIR)/doc/*.[13n] \
+ @mkdir $(DISTDIR)/doc
+ cp -p $(TOP_DIR)/license.terms $(TOP_DIR)/doc/*.[13n] \
$(TOP_DIR)/doc/man.macros $(DISTDIR)/doc
- $(INSTALL_DATA_DIR) $(DISTDIR)/compat
- $(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(COMPAT_DIR)/*.[ch] \
+ @mkdir $(DISTDIR)/compat
+ cp -p $(TOP_DIR)/license.terms $(COMPAT_DIR)/*.[ch] \
$(COMPAT_DIR)/README $(DISTDIR)/compat
- $(INSTALL_DATA_DIR) $(DISTDIR)/compat/zlib
- @echo cp -r $(COMPAT_DIR)/zlib $(DISTDIR)/compat/zlib
- @( cd $(COMPAT_DIR)/zlib; find . -type f -print ) \
- | ( cd $(COMPAT_DIR)/zlib ; xargs tar cf - ) \
- | ( cd $(DISTDIR)/compat/zlib ; tar xfp - )
- $(INSTALL_DATA_DIR) $(DISTDIR)/libtommath
- @echo cp -r $(TOP_DIR)/libtommath $(DISTDIR)/libtommath
- @( cd $(TOP_DIR)/libtommath; find . -type f -print ) \
- | ( cd $(TOP_DIR)/libtommath ; xargs tar cf - ) \
- | ( cd $(DISTDIR)/libtommath ; tar xfp - )
- $(INSTALL_DATA_DIR) $(DISTDIR)/tests
- $(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(DISTDIR)/tests
- $(DIST_INSTALL_DATA) $(TOP_DIR)/tests/*.test $(TOP_DIR)/tests/README \
- $(TOP_DIR)/tests/*.bench $(TOP_DIR)/tests/*.tar.gz \
+ @mkdir $(DISTDIR)/tests
+ cp -p $(TOP_DIR)/license.terms $(DISTDIR)/tests
+ cp -p $(TOP_DIR)/tests/*.test $(TOP_DIR)/tests/README \
$(TOP_DIR)/tests/httpd $(TOP_DIR)/tests/*.tcl \
- $(TOP_DIR)/tests/auto-files.zip $(DISTDIR)/tests
- @mkdir $(DISTDIR)/tests/auto0
- for i in auto1 auto2 ; \
- do \
- $(INSTALL_DATA_DIR) $(DISTDIR)/tests/auto0/$$i ;\
- $(DIST_INSTALL_DATA) $(TOP_DIR)/tests/auto0/$$i/tclIndex $(TOP_DIR)/tests/auto0/$$i/*.tcl \
- $(DISTDIR)/tests/auto0/$$i; \
- done;
- for i in modules modules/mod1 modules/mod2 ; \
- do \
- $(INSTALL_DATA_DIR) $(DISTDIR)/tests/auto0/$$i ;\
- $(DIST_INSTALL_DATA) $(TOP_DIR)/tests/auto0/$$i/*.tm \
- $(DISTDIR)/tests/auto0/$$i; \
- done;
- @mkdir $(DISTDIR)/tests/zipfiles
- $(INSTALL_DATA_DIR) $(DISTDIR)/tests/zipfiles
- $(DIST_INSTALL_DATA) $(TOP_DIR)/tests/zipfiles/*.zip \
- $(DISTDIR)/tests/zipfiles
- $(DIST_INSTALL_DATA) $(TOP_DIR)/tests/zipfiles/README \
- $(DISTDIR)/tests/zipfiles
- $(DIST_INSTALL_DATA) $(TOP_DIR)/tests/zipfiles/LICENSE-libzip \
- $(DISTDIR)/tests/zipfiles
- $(INSTALL_DATA_DIR) $(DISTDIR)/tests-perf
- $(DIST_INSTALL_DATA) $(TOP_DIR)/tests-perf/*.tcl $(DISTDIR)/tests-perf
- $(INSTALL_DATA_DIR) $(DISTDIR)/win
- $(DIST_INSTALL_DATA) $(TOP_DIR)/win/Makefile.in $(DISTDIR)/win
- $(DIST_INSTALL_DATA) $(TOP_DIR)/win/configure.ac \
- $(TOP_DIR)/win/tclConfig.sh.in $(TOP_DIR)/win/tclooConfig.sh \
+ $(DISTDIR)/tests
+ @mkdir $(DISTDIR)/win
+ cp $(TOP_DIR)/win/Makefile.in $(DISTDIR)/win
+ cp $(TOP_DIR)/win/configure.in $(TOP_DIR)/win/configure \
+ $(TOP_DIR)/win/tclConfig.sh.in \
$(TOP_DIR)/win/tcl.m4 $(TOP_DIR)/win/aclocal.m4 \
- $(TOP_DIR)/win/tclsh.exe.manifest.in $(TOP_DIR)/win/tclUuid.h.in \
- $(TOP_DIR)/win/gitmanifest.in $(TOP_DIR)/win/svnmanifest.in \
- $(TOP_DIR)/win/x86_64-w64-mingw32-nmakehlp.exe $(DISTDIR)/win
- chmod 775 $(DISTDIR)/win/x86_64-w64-mingw32-nmakehlp.exe
- $(DIST_INSTALL_SCRIPT) $(TOP_DIR)/win/configure $(DISTDIR)/win
- $(DIST_INSTALL_DATA) $(TOP_DIR)/win/*.[ch] $(TOP_DIR)/win/*.ico $(TOP_DIR)/win/*.rc \
+ $(TOP_DIR)/win/tclsh.exe.manifest.in \
+ $(DISTDIR)/win
+ cp -p $(TOP_DIR)/win/*.[ch] $(TOP_DIR)/win/*.ico $(TOP_DIR)/win/*.rc \
$(DISTDIR)/win
- $(DIST_INSTALL_DATA) $(TOP_DIR)/win/*.bat $(DISTDIR)/win
- $(DIST_INSTALL_DATA) $(TOP_DIR)/win/*.vc $(DISTDIR)/win
- $(DIST_INSTALL_DATA) $(TOP_DIR)/win/tcl.ds* $(DISTDIR)/win
- $(DIST_INSTALL_DATA) $(TOP_DIR)/win/README $(DISTDIR)/win
- $(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(DISTDIR)/win
- $(INSTALL_DATA_DIR) $(DISTDIR)/macosx
- $(DIST_INSTALL_DATA) $(MAC_OSX_DIR)/GNUmakefile $(MAC_OSX_DIR)/README \
+ cp -p $(TOP_DIR)/win/*.bat $(DISTDIR)/win
+ cp -p $(TOP_DIR)/win/makefile.* $(DISTDIR)/win
+ cp -p $(TOP_DIR)/win/rules.vc $(DISTDIR)/win
+ cp -p $(TOP_DIR)/win/coffbase.txt $(DISTDIR)/win
+ cp -p $(TOP_DIR)/win/tcl.hpj.in $(DISTDIR)/win
+ cp -p $(TOP_DIR)/win/tcl.ds* $(DISTDIR)/win
+ cp -p $(TOP_DIR)/win/README $(DISTDIR)/win
+ cp -p $(TOP_DIR)/license.terms $(DISTDIR)/win
+ @mkdir $(DISTDIR)/macosx
+ cp -p $(MAC_OSX_DIR)/GNUmakefile $(MAC_OSX_DIR)/README \
$(MAC_OSX_DIR)/*.c $(MAC_OSX_DIR)/*.in \
$(MAC_OSX_DIR)/*.ac $(MAC_OSX_DIR)/*.xcconfig \
- $(DISTDIR)/macosx
- $(DIST_INSTALL_SCRIPT) $(MAC_OSX_DIR)/configure $(DISTDIR)/macosx
- $(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(DISTDIR)/macosx
- $(INSTALL_DATA_DIR) $(DISTDIR)/macosx/Tcl.xcodeproj
- $(DIST_INSTALL_DATA) $(MAC_OSX_DIR)/Tcl.xcodeproj/project.pbxproj \
- $(MAC_OSX_DIR)/Tcl.xcodeproj/default.pbxuser \
- $(DISTDIR)/macosx/Tcl.xcodeproj
- $(INSTALL_DATA_DIR) $(DISTDIR)/unix/dltest
- $(DIST_INSTALL_DATA) $(UNIX_DIR)/dltest/*.c $(UNIX_DIR)/dltest/Makefile.in \
- $(UNIX_DIR)/dltest/README $(DISTDIR)/unix/dltest
- $(INSTALL_DATA_DIR) $(DISTDIR)/tools
- $(DIST_INSTALL_DATA) $(TOOL_DIR)/README $(TOOL_DIR)/*.c $(TOOL_DIR)/*.svg \
- $(TOOL_DIR)/*.tcl $(TOOL_DIR)/*.bmp $(TOOL_DIR)/valgrind_suppress \
- $(TOOL_DIR)/valgrind_check_success $(DISTDIR)/tools
- chmod 755 $(DISTDIR)/tools/checkLibraryDoc.tcl \
- $(DISTDIR)/tools/findBadExternals.tcl \
- $(DISTDIR)/tools/loadICU.tcl \
- $(DISTDIR)/tools/makeTestCases.tcl $(DISTDIR)/tools/tclZIC.tcl \
- $(DISTDIR)/tools/tcltk-man2html.tcl
- $(INSTALL_DATA_DIR) $(DISTDIR)/pkgs
- $(DIST_INSTALL_DATA) $(TOP_DIR)/pkgs/README $(DISTDIR)/pkgs
- $(DIST_INSTALL_DATA) $(TOP_DIR)/pkgs/package.list.txt $(DISTDIR)/pkgs
- for i in `ls $(DISTROOT)/pkgs/*.tar.gz 2> /dev/null`; do \
- tar -C $(DISTDIR)/pkgs -xzf "$$i"; \
- done
- $(DIST_INSTALL_DATA) $(TOP_DIR)/.travis.yml $(DISTDIR)
- $(INSTALL_DATA_DIR) $(DISTDIR)/.github/workflows
- $(DIST_INSTALL_DATA) $(TOP_DIR)/.github/workflows/*.yml $(DISTDIR)/.github/workflows
+ $(MAC_OSX_DIR)/configure $(DISTDIR)/macosx
+ cp -p $(TOP_DIR)/license.terms $(DISTDIR)/macosx
+ @mkdir $(DISTDIR)/macosx/Tcl.pbproj
+ cp -p $(MAC_OSX_DIR)/Tcl.pbproj/*.pbx* $(DISTDIR)/macosx/Tcl.pbproj
+ @mkdir $(DISTDIR)/macosx/Tcl.xcode
+ cp -p $(MAC_OSX_DIR)/Tcl.xcode/*.pbx* $(DISTDIR)/macosx/Tcl.xcode
+ @mkdir $(DISTDIR)/macosx/Tcl.xcodeproj
+ cp -p $(TOP_DIR)/macosx/Tcl.xcodeproj/*.pbx* $(DISTDIR)/macosx/Tcl.xcodeproj
+ @mkdir $(DISTDIR)/unix/dltest
+ cp -p $(UNIX_DIR)/dltest/*.c $(UNIX_DIR)/dltest/Makefile.in \
+ $(UNIX_DIR)/dltest/README \
+ $(DISTDIR)/unix/dltest
+ @mkdir $(DISTDIR)/tools
+ cp -p $(TOOL_DIR)/Makefile.in $(TOOL_DIR)/README \
+ $(TOOL_DIR)/configure $(TOOL_DIR)/configure.in \
+ $(TOOL_DIR)/*.tcl $(TOOL_DIR)/man2tcl.c \
+ $(TOOL_DIR)/tcl.wse.in $(TOOL_DIR)/*.bmp \
+ $(TOOL_DIR)/tcl.hpj.in \
+ $(DISTDIR)/tools
+ @mkdir $(DISTDIR)/libtommath
+ cp -p $(TOMMATH_SRCS) $(TOMMATH_DIR)/*.h \
+ $(DISTDIR)/libtommath
alldist: dist
rm -f $(DISTROOT)/$(DISTNAME)-src.tar.gz $(DISTROOT)/$(ZIPNAME)
- ( cd $(DISTROOT); \
- tar cf $(DISTNAME)-src.tar $(DISTNAME); \
- gzip -9 $(DISTNAME)-src.tar; \
- zip -qr8 $(ZIPNAME) $(DISTNAME) )
+ cd $(DISTROOT); tar cf $(DISTNAME)-src.tar $(DISTNAME); \
+ gzip -9 $(DISTNAME)-src.tar; zip -qr8 $(ZIPNAME) $(DISTNAME)
#--------------------------------------------------------------------------
# This target creates the HTML folder for Tcl & Tk and places it in
# DISTDIR/html. It uses the tcltk-man2html.tcl tool from the Tcl group's tool
# workspace. It depends on the Tcl & Tk being in directories called tcl8.* &
# tk8.* up two directories from the TOOL_DIR.
-#
-# Note that for platforms where this is important, it is more common to use a
-# build of this HTML documentation that has already been placed online. As
-# such, this rule is not guaranteed to work well on all systems; it only needs
-# to function on those of the Tcl/Tk maintainers.
-#
-# Also note that the 8.6 tool build requires an installed 8.6 native Tcl
-# interpreter in order to be able to run.
#--------------------------------------------------------------------------
-html: ${NATIVE_TCLSH}
+html: ${TCL_EXE}
$(BUILD_HTML)
@EXTRA_BUILD_HTML@
-
-html-tcl: ${NATIVE_TCLSH}
+html-tcl: ${TCL_EXE}
$(BUILD_HTML) --tcl
@EXTRA_BUILD_HTML@
-
-html-tk: ${NATIVE_TCLSH}
+html-tk: ${TCL_EXE}
$(BUILD_HTML) --tk
@EXTRA_BUILD_HTML@
BUILD_HTML = \
- @${NATIVE_TCLSH} -encoding utf-8 $(TOOL_DIR)/tcltk-man2html.tcl \
- --useversion=$(MAJOR_VERSION).$(MINOR_VERSION) \
- --htmldir="$(HTML_INSTALL_DIR)" \
- --srcdir=$(TOP_DIR) $(BUILD_HTML_FLAGS)
+ @@LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \
+ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
+ ./${TCL_EXE} $(TOOL_DIR)/tcltk-man2html.tcl --htmldir="$(HTML_INSTALL_DIR)" \
+ --srcdir=$(TOP_DIR)/.. $(BUILD_HTML_FLAGS)
-#--------------------------------------------------------------------------
-# The list of all the targets that do not correspond to real files. This stops
-# 'make' from getting confused when someone makes an error in a rule.
-#--------------------------------------------------------------------------
+#
+# Targets to build Solaris package of the distribution for the current
+# architecture. To build stream packages for both sun4 and i86pc
+# architectures:
+#
+# On the sun4 machine, execute the following:
+# make distclean; ./configure
+# make DISTDIR=<distdir> package
+#
+# Once the build is complete, execute the following on the i86pc machine:
+# make DISTDIR=<distdir> package-quick
+#
+# <distdir> is the absolute path to a directory where the build should take
+# place. These steps will generate the $(PACKAGE).sun4 and $(PACKAGE).i86pc
+# stream packages. It is important that the packages be built in this fashion
+# in order to ensure that the architecture independent files are exactly the
+# same, including timestamps, in both packages.
+#
+
+PACKAGE=SCRPtcl
+
+package: dist package-config package-common package-binaries package-generate
+package-quick: package-config package-binaries package-generate
+
+#
+# Configure for the current architecture in the dist directory.
+#
+package-config:
+ mkdir -p $(DISTDIR)/unix/`arch`
+ cd $(DISTDIR)/unix/`arch`; \
+ ../configure --prefix=/opt/$(PACKAGE)/$(VERSION) \
+ --exec_prefix=/opt/$(PACKAGE)/$(VERSION)/`arch` \
+ --enable-shared
+ mkdir -p $(DISTDIR)/$(PACKAGE)/$(VERSION)
+ mkdir -p $(DISTDIR)/$(PACKAGE)/$(VERSION)/`arch`
+
+#
+# Build and install the architecture independent files in the dist directory.
+#
+
+package-common:
+ cd $(DISTDIR)/unix/`arch`;\
+ $(MAKE); \
+ $(MAKE) prefix=$(DISTDIR)/$(PACKAGE)/$(VERSION) \
+ exec_prefix=$(DISTDIR)/$(PACKAGE)/$(VERSION)/`arch` \
+ install-libraries install-man
+ mkdir -p $(DISTDIR)/$(PACKAGE)/$(VERSION)/bin
+ sed -e "s/TCLVERSION/$(VERSION)/g" < $(UNIX_DIR)/tclsh.sh \
+ > $(DISTDIR)/$(PACKAGE)/$(VERSION)/bin/tclsh$(VERSION)
+ chmod 755 $(DISTDIR)/$(PACKAGE)/$(VERSION)/bin/tclsh$(VERSION)
+
+#
+# Build and install the architecture specific files in the dist directory.
+#
+
+package-binaries:
+ cd $(DISTDIR)/unix/`arch`; \
+ $(MAKE); \
+ $(MAKE) install-binaries prefix=$(DISTDIR)/$(PACKAGE)/$(VERSION) \
+ exec_prefix=$(DISTDIR)/$(PACKAGE)/$(VERSION)/`arch`
+
+#
+# Generate a package from the installed files in the dist directory for the
+# current architecture.
+#
-.PHONY: all binaries libraries objs doc html html-tcl html-tk test runtest
-.PHONY: install install-strip install-binaries install-libraries
-.PHONY: install-headers install-private-headers install-doc
-.PHONY: clean distclean depend genstubs checkstubs checkexports checkuchar
-.PHONY: shell gdb valgrind valgrindshell dist alldist rpm
-.PHONY: tclLibObjs tcltest-real test-tcl gdb-test ro-test trace-test xttest
-.PHONY: topDirName gendate gentommath_h trace-shell checkdoc
-.PHONY: install-tzdata install-msgs
-.PHONY: packages configure-packages test-packages clean-packages
-.PHONY: dist-packages distclean-packages install-packages
-.PHONY: tclzipfile
+package-generate:
+ pkgproto $(DISTDIR)/$(PACKAGE)/$(VERSION)/bin=bin \
+ $(DISTDIR)/$(PACKAGE)/$(VERSION)/include=include \
+ $(DISTDIR)/$(PACKAGE)/$(VERSION)/lib=lib \
+ $(DISTDIR)/$(PACKAGE)/$(VERSION)/man=man \
+ $(DISTDIR)/$(PACKAGE)/$(VERSION)/`arch`=`arch` \
+ | $(TCL_EXE) $(UNIX_DIR)/mkProto.tcl \
+ $(VERSION) $(UNIX_DIR) > prototype
+ pkgmk -o -d . -f prototype -a `arch`
+ pkgtrans -s . $(PACKAGE).`arch` $(PACKAGE)
+ rm -rf $(PACKAGE)
#--------------------------------------------------------------------------
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/unix/README b/unix/README
index 9dad93a..d8f1090 100644
--- a/unix/README
+++ b/unix/README
@@ -8,11 +8,11 @@ MacOSX platform too, but they all depend on UNIX (POSIX/ANSI C) interfaces and
some of them only make sense under UNIX.
Updated forms of the information found in this file is available at:
- https://www.tcl-lang.org/doc/howto/compile.html#unix
+ http://www.tcl.tk/doc/howto/compile.html#unix
For information on platforms where Tcl is known to compile, along with any
porting notes for getting it to work on those platforms, see:
- https://www.tcl-lang.org/software/tcltk/platforms.html
+ http://www.tcl.tk/software/tcltk/platforms.html
The rest of this file contains instructions on how to do this. The release
should compile and run either "out of the box" or with trivial changes on any
@@ -45,6 +45,8 @@ How To Compile And Install Tcl:
refer to the autoconf documentation (not included here). Tcl's "configure"
supports the following special switches in addition to the standard ones:
+ --enable-threads If this switch is set, Tcl will compile itself
+ with multithreading support.
--disable-load If this switch is specified then Tcl will
configure itself not to allow dynamic loading,
even if your system appears to support it.
@@ -89,9 +91,9 @@ How To Compile And Install Tcl:
--enable-dtrace Enable tcl DTrace provider (if DTrace is
available on the platform), c.f. tclDTrace.d
for descriptions of the probes made available,
- see https://wiki.tcl-lang.org/page/DTrace for more details
+ see http://wiki.tcl.tk/DTrace for more details
--with-encoding=ENCODING Specifies the encoding for compile-time
- configuration values. Defaults to utf-8,
+ configuration values. Defaults to iso8859-1,
which is also sufficient for ASCII.
--with-tzdata=FLAG Specifies whether to install timezone data. By
default, the configure script tries to detect
@@ -163,5 +165,5 @@ don't run the tests as superuser: this will cause several of them to fail. If
a test is failing consistently, please send us a bug report with as much
detail as you can manage to our tracker:
- https://core.tcl-lang.org/tcl/reportlist
+ http://core.tcl.tk/tcl/reportlist
diff --git a/unix/config.status.lineno b/unix/config.status.lineno
deleted file mode 100755
index f252363..0000000
--- a/unix/config.status.lineno
+++ /dev/null
@@ -1,920 +0,0 @@
-#! /bin/bash
-# Generated by configure.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=${CONFIG_SHELL-/bin/bash}
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=103
- as_lineno_2=104
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { { echo "$as_me:128: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=143
- as_lineno_2=144
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with 160
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that 165 is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { { echo "$as_me:179: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-exec 6>&1
-
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling. Logging --version etc. is OK.
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by tcl $as_me 8.6, which was
-generated by GNU Autoconf 2.59. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
-config_files=" Makefile:../unix/Makefile.in dltest/Makefile:../unix/dltest/Makefile.in tclConfig.sh:../unix/tclConfig.sh.in tcl.pc:../unix/tcl.pc.in"
-
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Configuration commands:
-$config_commands
-
-Report bugs to <bug-autoconf@gnu.org>."
-ac_cs_version="\
-tcl config.status 8.6
-configured by ./configure, generated by GNU Autoconf 2.59,
- with options \"'--prefix=/home/jima/space/ins/lin64/dynamic/main'\"
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-srcdir=/home/jima/space/bui/lin64/dynamic/main/tcl/unix
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=*)
- ac_option=`expr "x$1" : 'x\([^=]*\)='`
- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- -*)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- *) # This is not an option, so the user has probably given explicit
- # arguments.
- ac_option=$1
- ac_need_defaults=false;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --vers* | -V )
- echo "$ac_cs_version"; exit 0 ;;
- --he | --h)
- # Conflict between --help and --header
- { { echo "$as_me:336: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit 0 ;;
- --debug | --d* | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) { { echo "$as_me:358: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$ac_config_targets $1" ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-if $ac_cs_recheck; then
- echo "running /bin/bash ./configure " '--prefix=/home/jima/space/ins/lin64/dynamic/main' $ac_configure_extra_args " --no-create --no-recursion" >&6
- exec /bin/bash ./configure '--prefix=/home/jima/space/ins/lin64/dynamic/main' $ac_configure_extra_args --no-create --no-recursion
-fi
-
-#
-# INIT-COMMANDS section.
-#
-
-VERSION=8.6
-
-for ac_config_target in $ac_config_targets
-do
- case "$ac_config_target" in
- # Handling of arguments.
- "Tcl-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Tcl-Info.plist:../macosx/Tcl-Info.plist.in" ;;
- "Tclsh-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Tclsh-Info.plist:../macosx/Tclsh-Info.plist.in" ;;
- "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile:../unix/Makefile.in" ;;
- "dltest/Makefile" ) CONFIG_FILES="$CONFIG_FILES dltest/Makefile:../unix/dltest/Makefile.in" ;;
- "tclConfig.sh" ) CONFIG_FILES="$CONFIG_FILES tclConfig.sh:../unix/tclConfig.sh.in" ;;
- "tcl.pc" ) CONFIG_FILES="$CONFIG_FILES tcl.pc:../unix/tcl.pc.in" ;;
- "Tcl.framework" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Tcl.framework" ;;
- *) { { echo "$as_me:399: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./confstat$$-$RANDOM
- (umask 077 && mkdir $tmp)
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-
-#
-# CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "$CONFIG_FILES"; then
- # Protect against being on the right side of a sed subst in config.status.
- sed 's/,@/@@/; s/@,/@@/; s/,;t t$/@;t t/; /@;t t$/s/[\\&,]/\\&/g;
- s/@@/,@/; s/@@/@,/; s/@;t t$/,;t t/' >$tmp/subs.sed <<\CEOF
-s,@SHELL@,/bin/bash,;t t
-s,@PATH_SEPARATOR@,:,;t t
-s,@PACKAGE_NAME@,tcl,;t t
-s,@PACKAGE_TARNAME@,tcl,;t t
-s,@PACKAGE_VERSION@,8.6,;t t
-s,@PACKAGE_STRING@,tcl 8.6,;t t
-s,@PACKAGE_BUGREPORT@,,;t t
-s,@exec_prefix@,/home/jima/space/ins/lin64/dynamic/main,;t t
-s,@prefix@,/home/jima/space/ins/lin64/dynamic/main,;t t
-s,@program_transform_name@,s,x,x,,;t t
-s,@bindir@,${exec_prefix}/bin,;t t
-s,@sbindir@,${exec_prefix}/sbin,;t t
-s,@libexecdir@,${exec_prefix}/libexec,;t t
-s,@datadir@,${prefix}/share,;t t
-s,@sysconfdir@,${prefix}/etc,;t t
-s,@sharedstatedir@,${prefix}/com,;t t
-s,@localstatedir@,${prefix}/var,;t t
-s,@libdir@,/home/jima/space/ins/lin64/dynamic/main/lib,;t t
-s,@includedir@,${prefix}/include,;t t
-s,@oldincludedir@,/usr/include,;t t
-s,@infodir@,${prefix}/info,;t t
-s,@mandir@,${prefix}/man,;t t
-s,@build_alias@,,;t t
-s,@host_alias@,,;t t
-s,@target_alias@,,;t t
-s,@DEFS@,-DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"8.6\" -DPACKAGE_STRING=\"tcl\ 8.6\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DHAVE_ZLIB=1 -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -DHAVE_HIDDEN=1 -DHAVE_CAST_TO_UNION=1 -DTCL_SHLIB_EXT=\".so\" -DNDEBUG=1 -DTCL_CFG_OPTIMIZED=1 -DTCL_TOMMATH=1 -DMP_PREC=4 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_GETCWD=1 -DHAVE_MKSTEMP=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_WAITPID=1 -DHAVE_GETNAMEINFO=1 -DHAVE_GETADDRINFO=1 -DHAVE_FREEADDRINFO=1 -DHAVE_GAI_STRERROR=1 -DHAVE_STRUCT_ADDRINFO=1 -DHAVE_STRUCT_IN6_ADDR=1 -DHAVE_STRUCT_SOCKADDR_IN6=1 -DHAVE_STRUCT_SOCKADDR_STORAGE=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_DECL_GETHOSTBYNAME_R=1 -DHAVE_GETHOSTBYNAME_R_6=1 -DHAVE_GETHOSTBYNAME_R=1 -DHAVE_DECL_GETHOSTBYADDR_R=1 -DHAVE_GETHOSTBYADDR_R_8=1 -DHAVE_GETHOSTBYADDR_R=1 -DHAVE_TERMIOS_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_STRUCT_STAT_ST_BLOCKS=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_BLKCNT_T=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DNO_UNION_WAIT=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_MKSTEMPS=1 -DHAVE_FTS=1 -DHAVE_SYS_IOCTL_H=1 -DTCL_UNLOAD_DLLS=1 -DHAVE_CPUID=1 ,;t t
-s,@ECHO_C@,,;t t
-s,@ECHO_N@,-n,;t t
-s,@ECHO_T@,,;t t
-s,@LIBS@,-lz -lpthread,;t t
-s,@MAN_FLAGS@,,;t t
-s,@CC@,gcc,;t t
-s,@CFLAGS@, -pipe ,;t t
-s,@LDFLAGS@, -Wl,--export-dynamic ,;t t
-s,@CPPFLAGS@,,;t t
-s,@ac_ct_CC@,gcc,;t t
-s,@EXEEXT@,,;t t
-s,@OBJEXT@,o,;t t
-s,@CPP@,gcc -E,;t t
-s,@EGREP@,grep -E,;t t
-s,@TCL_THREADS@,1,;t t
-s,@TCLSH_PROG@,/usr/bin/tclsh8.6,;t t
-s,@ZLIB_OBJS@,,;t t
-s,@ZLIB_SRCS@,,;t t
-s,@ZLIB_INCLUDE@,,;t t
-s,@RANLIB@,ranlib,;t t
-s,@ac_ct_RANLIB@,ranlib,;t t
-s,@AR@,ar,;t t
-s,@ac_ct_AR@,ar,;t t
-s,@LIBOBJS@,,;t t
-s,@TCL_LIBS@,-ldl -lz -lpthread -lm,;t t
-s,@DL_LIBS@,-ldl,;t t
-s,@DL_OBJS@,tclLoadDl.o,;t t
-s,@PLAT_OBJS@,,;t t
-s,@PLAT_SRCS@,,;t t
-s,@LDAIX_SRC@,,;t t
-s,@CFLAGS_DEBUG@,-g,;t t
-s,@CFLAGS_OPTIMIZE@,-O2,;t t
-s,@CFLAGS_WARNING@,-Wall,;t t
-s,@LDFLAGS_DEBUG@,,;t t
-s,@LDFLAGS_OPTIMIZE@,,;t t
-s,@CC_SEARCH_FLAGS@,-Wl,-rpath,${LIB_RUNTIME_DIR},;t t
-s,@LD_SEARCH_FLAGS@,-Wl,-rpath,${LIB_RUNTIME_DIR},;t t
-s,@STLIB_LD@,${AR} cr,;t t
-s,@SHLIB_LD@,${CC} ${CFLAGS} ${LDFLAGS} -shared,;t t
-s,@TCL_SHLIB_LD_EXTRAS@,,;t t
-s,@TK_SHLIB_LD_EXTRAS@,,;t t
-s,@SHLIB_LD_LIBS@,${LIBS},;t t
-s,@SHLIB_CFLAGS@,-fPIC,;t t
-s,@SHLIB_SUFFIX@,.so,;t t
-s,@MAKE_LIB@,${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS},;t t
-s,@MAKE_STUB_LIB@,${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@,;t t
-s,@INSTALL_LIB@,$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)",;t t
-s,@DLL_INSTALL_DIR@,$(LIB_INSTALL_DIR),;t t
-s,@INSTALL_STUB_LIB@,$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)",;t t
-s,@CFLAGS_DEFAULT@,$(CFLAGS_OPTIMIZE),;t t
-s,@LDFLAGS_DEFAULT@,$(LDFLAGS_OPTIMIZE),;t t
-s,@DTRACE@,,;t t
-s,@TCL_VERSION@,8.6,;t t
-s,@TCL_MAJOR_VERSION@,8,;t t
-s,@TCL_MINOR_VERSION@,6,;t t
-s,@TCL_PATCH_LEVEL@,.10,;t t
-s,@TCL_YEAR@,,;t t
-s,@PKG_CFG_ARGS@,'--prefix=/home/jima/space/ins/lin64/dynamic/main' ,;t t
-s,@TCL_LIB_FILE@,libtcl8.6.so,;t t
-s,@TCL_LIB_FLAG@,-ltcl8.6,;t t
-s,@TCL_LIB_SPEC@,-L/home/jima/space/ins/lin64/dynamic/main/lib -ltcl8.6,;t t
-s,@TCL_STUB_LIB_FILE@,libtclstub8.6.a,;t t
-s,@TCL_STUB_LIB_FLAG@,-ltclstub8.6,;t t
-s,@TCL_STUB_LIB_SPEC@,-L/home/jima/space/ins/lin64/dynamic/main/lib -ltclstub8.6,;t t
-s,@TCL_STUB_LIB_PATH@,/home/jima/space/ins/lin64/dynamic/main/lib/libtclstub8.6.a,;t t
-s,@TCL_INCLUDE_SPEC@,-I/home/jima/space/ins/lin64/dynamic/main/include,;t t
-s,@TCL_BUILD_STUB_LIB_SPEC@,-L/home/jima/space/bui/lin64/dynamic/main/tcl/unix -ltclstub8.6,;t t
-s,@TCL_BUILD_STUB_LIB_PATH@,/home/jima/space/bui/lin64/dynamic/main/tcl/unix/libtclstub8.6.a,;t t
-s,@TCL_SRC_DIR@,/home/jima/space/bui/lin64/dynamic/main/tcl,;t t
-s,@CFG_TCL_SHARED_LIB_SUFFIX@,${VERSION}.so,;t t
-s,@CFG_TCL_UNSHARED_LIB_SUFFIX@,${VERSION}.a,;t t
-s,@TCL_SHARED_BUILD@,1,;t t
-s,@LD_LIBRARY_PATH_VAR@,LD_LIBRARY_PATH,;t t
-s,@TCL_BUILD_LIB_SPEC@,-L/home/jima/space/bui/lin64/dynamic/main/tcl/unix -ltcl8.6,;t t
-s,@TCL_LIB_VERSIONS_OK@,ok,;t t
-s,@TCL_SHARED_LIB_SUFFIX@,${VERSION}${SHLIB_SUFFIX},;t t
-s,@TCL_UNSHARED_LIB_SUFFIX@,${VERSION}.a,;t t
-s,@TCL_HAS_LONGLONG@,,;t t
-s,@INSTALL_TZDATA@,,;t t
-s,@DTRACE_SRC@,,;t t
-s,@DTRACE_HDR@,,;t t
-s,@DTRACE_OBJ@,,;t t
-s,@MAKEFILE_SHELL@,/bin/sh,;t t
-s,@BUILD_DLTEST@,$(DLTEST_TARGETS),;t t
-s,@TCL_PACKAGE_PATH@,/home/jima/space/ins/lin64/dynamic/main/lib ,;t t
-s,@TCL_MODULE_PATH@,,;t t
-s,@TCL_LIBRARY@,$(prefix)/lib/tcl$(VERSION),;t t
-s,@PRIVATE_INCLUDE_DIR@,$(includedir),;t t
-s,@HTML_DIR@,$(DISTDIR)/html,;t t
-s,@PACKAGE_DIR@,/home/jima/space/ins/lin64/dynamic/main/lib,;t t
-s,@EXTRA_CC_SWITCHES@,,;t t
-s,@EXTRA_APP_CC_SWITCHES@,,;t t
-s,@EXTRA_INSTALL@,,;t t
-s,@EXTRA_INSTALL_BINARIES@,@:,;t t
-s,@EXTRA_BUILD_HTML@,@:,;t t
-s,@EXTRA_TCLSH_LIBS@,,;t t
-s,@DLTEST_LD@,${SHLIB_LD},;t t
-s,@DLTEST_SUFFIX@,,;t t
-CEOF
-
- # Split the substitutions into bite-sized pieces for seds with
- # small command number limits, like on Digital OSF/1 and HP-UX.
- ac_max_sed_lines=48
- ac_sed_frag=1 # Number of current file.
- ac_beg=1 # First line for current file.
- ac_end=$ac_max_sed_lines # Line after last line for current file.
- ac_more_lines=:
- ac_sed_cmds=
- while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- else
- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- fi
- if test ! -s $tmp/subs.frag; then
- ac_more_lines=false
- else
- # The purpose of the label and of the branching condition is to
- # speed up the sed processing (if there are no `@' at all, there
- # is no need to browse any of the substitutions).
- # These are the two extra sed commands mentioned above.
- (echo ':t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
- fi
- ac_sed_frag=`expr $ac_sed_frag + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_lines`
- fi
- done
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
- fi
-fi # test -n "$CONFIG_FILES"
-
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
- esac
-
- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:660: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
-
-
- if test x"$ac_file" != x-; then
- { echo "$as_me:732: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- configure_input=
- else
- configure_input="$ac_file. "
- fi
- configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:755: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- { { echo "$as_me:768: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
- sed "
-
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
- rm -f $tmp/stdin
- if test x"$ac_file" != x-; then
- mv $tmp/out $ac_file
- else
- cat $tmp/out
- rm -f $tmp/out
- fi
-
-done
-
-#
-# CONFIG_COMMANDS section.
-#
-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
- ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
- ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_dest" : 'X\(//\)[^/]' \| \
- X"$ac_dest" : 'X\(//\)$' \| \
- X"$ac_dest" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:837: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
-
- { echo "$as_me:907: executing $ac_dest commands" >&5
-echo "$as_me: executing $ac_dest commands" >&6;}
- case $ac_dest in
- Tcl.framework ) n=Tcl &&
- f=$n.framework && v=Versions/$VERSION &&
- rm -rf $f && mkdir -p $f/$v/Resources &&
- ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v &&
- ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist &&
- unset n f v
- ;;
- esac
-done
-
-{ (exit 0); exit 0; }
diff --git a/unix/configure b/unix/configure
index 092f19c..a90aff3 100755
--- a/unix/configure
+++ b/unix/configure
@@ -1,469 +1,81 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for tcl 8.7.
-#
-#
-# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation,
-# Inc.
-#
+# Generated by GNU Autoconf 2.59 for tcl 8.5.
#
+# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
-then :
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else case e in #(
- e) case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac ;;
-esac
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
fi
+DUALCASE=1; export DUALCASE # for MKS sh
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
-# Reset variables that may have inherited troublesome values from
-# the environment.
-
-# IFS needs to be set, to space, tab, and newline, in precisely that order.
-# (If _AS_PATH_WALK were called with IFS unset, it would have the
-# side effect of setting IFS to empty, thus disabling word splitting.)
-# Quoting is to prevent editors from complaining about space-tab.
-as_nl='
-'
-export as_nl
-IFS=" "" $as_nl"
-
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
PS1='$ '
PS2='> '
PS4='+ '
-# Ensure predictable behavior from utilities with locale-dependent output.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# We cannot yet rely on "unset" to work, but we need these variables
-# to be unset--not just set to an empty or harmless value--now, to
-# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
-# also avoids known problems related to "unset" and subshell syntax
-# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
-for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
-do eval test \${$as_var+y} \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-
-# Ensure that fds 0, 1, and 2 are open.
-if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
-if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
-if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
-
-# The user is always right.
-if ${PATH_SEPARATOR+false} :; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
do
- IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- test -r "$as_dir$0" && as_myself=$as_dir$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as 'sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-
-# Use a proper internal environment variable to ensure we don't fall
- # into an infinite loop, continuously re-executing ourselves.
- if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
- _as_can_reexec=no; export _as_can_reexec;
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed 'exec'.
-printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
- fi
- # We don't want this to propagate to other subprocesses.
- { _as_can_reexec=; unset _as_can_reexec;}
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
-then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else case e in #(
- e) case \`(set -o) 2>/dev/null\` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac ;;
-esac
-fi
-"
- as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" )
-then :
-
-else case e in #(
- e) exitcode=1; echo positional parameters were not saved. ;;
-esac
-fi
-test x\$exitcode = x0 || exit 1
-blah=\$(echo \$(echo blah))
-test x\"\$blah\" = xblah || exit 1
-test -x / || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
- if (eval "$as_required") 2>/dev/null
-then :
- as_have_required=yes
-else case e in #(
- e) as_have_required=no ;;
-esac
-fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
-then :
-
-else case e in #(
- e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- as_found=:
- case $as_dir in #(
- /*)
- for as_base in sh bash ksh sh5; do
- # Try only shells that exist, to save several forks.
- as_shell=$as_dir$as_base
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null
-then :
- CONFIG_SHELL=$as_shell as_have_required=yes
- if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null
-then :
- break 2
-fi
-fi
- done;;
- esac
- as_found=false
-done
-IFS=$as_save_IFS
-if $as_found
-then :
-
-else case e in #(
- e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
-then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi ;;
-esac
-fi
-
-
- if test "x$CONFIG_SHELL" != x
-then :
- export CONFIG_SHELL
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed 'exec'.
-printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
-fi
-
- if test x$as_have_required = xno
-then :
- printf "%s\n" "$0: This script requires a shell more modern than all"
- printf "%s\n" "$0: the shells that I found on your system."
- if test ${ZSH_VERSION+y} ; then
- printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
else
- printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system,
-$0: including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
+ $as_unset $as_var
fi
- exit 1
-fi ;;
-esac
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-printf "%s\n" X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
-then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else case e in #(
- e) as_fn_append ()
- {
- eval $1=\$$1\$2
- } ;;
-esac
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
-then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else case e in #(
- e) as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- } ;;
-esac
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- printf "%s\n" "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
+done
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
as_expr=expr
else
as_expr=false
fi
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-as_me=`$as_basename -- "$0" ||
+# Name of the executable.
+as_me=`$as_basename "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-printf "%s\n" X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+# PATH needs CR, and LINENO needs CR and PATH.
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -471,360 +83,237 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
sed '
- t clear
- :clear
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
t loop
- s/-\n.*//
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
- # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
- # already done that, so ensure we don't try to do so again and fall
- # in an infinite loop. This has already happened in practice.
- _as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
# Exit status is that of the last command.
exit
}
-# Determine whether it's possible to make 'echo' print without a newline.
-# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
-# for compatibility with existing Makefiles.
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
esac
-# For backward compatibility with old third-party macros, we provide
-# the shell variables $as_echo and $as_echo_n. New code should use
-# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
-as_echo='printf %s\n'
-as_echo_n='printf %s'
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
+ as_expr=false
fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable.
- # In both cases, we have to default to 'cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
else
- as_ln_s='cp -pR'
+ as_ln_s='ln -s'
fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
else
- as_ln_s='cp -pR'
+ as_ln_s='cp -p'
fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
+rm -f conf$$ conf$$.exe conf$$.file
if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
+ as_mkdir_p=:
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
+as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
-as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
-as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
-as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
-as_tr_sh="eval sed '$as_sed_sh'" # deprecated
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+exec 6>&1
+
#
# Initializations.
#
ac_default_prefix=/usr/local
-ac_clean_files=
ac_config_libobj_dir=.
-LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
# Identity of this package.
PACKAGE_NAME='tcl'
PACKAGE_TARNAME='tcl'
-PACKAGE_VERSION='8.7'
-PACKAGE_STRING='tcl 8.7'
+PACKAGE_VERSION='8.5'
+PACKAGE_STRING='tcl 8.5'
PACKAGE_BUGREPORT=''
-PACKAGE_URL=''
# Factoring default headers for most tests.
ac_includes_default="\
-#include <stddef.h>
-#ifdef HAVE_STDIO_H
-# include <stdio.h>
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
#endif
-#ifdef HAVE_STDLIB_H
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
#endif
-#ifdef HAVE_STRING_H
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
# include <string.h>
#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_STRINGS_H
+#if HAVE_STRINGS_H
# include <strings.h>
#endif
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
#endif
-#ifdef HAVE_UNISTD_H
+#if HAVE_UNISTD_H
# include <unistd.h>
#endif"
-ac_header_c_list=
-ac_subst_vars='DLTEST_SUFFIX
-DLTEST_LD
-EXTRA_TCLSH_LIBS
-EXTRA_BUILD_HTML
-EXTRA_INSTALL_BINARIES
-EXTRA_INSTALL
-EXTRA_APP_CC_SWITCHES
-EXTRA_CC_SWITCHES
-PACKAGE_DIR
-HTML_DIR
-PRIVATE_INCLUDE_DIR
-TCL_LIBRARY
-TCL_MODULE_PATH
-TCL_PACKAGE_PATH
-BUILD_DLTEST
-MAKEFILE_SHELL
-DTRACE_OBJ
-DTRACE_HDR
-DTRACE_SRC
-INSTALL_TZDATA
-TCL_HAS_LONGLONG
-TCL_UNSHARED_LIB_SUFFIX
-TCL_SHARED_LIB_SUFFIX
-TCL_LIB_VERSIONS_OK
-TCL_BUILD_LIB_SPEC
-LD_LIBRARY_PATH_VAR
-TCL_SHARED_BUILD
-CFG_TCL_UNSHARED_LIB_SUFFIX
-CFG_TCL_SHARED_LIB_SUFFIX
-TCL_SRC_DIR
-TCL_BUILD_STUB_LIB_PATH
-TCL_BUILD_STUB_LIB_SPEC
-TCL_INCLUDE_SPEC
-TCL_STUB_LIB_PATH
-TCL_STUB_LIB_SPEC
-TCL_STUB_LIB_FLAG
-TCL_STUB_LIB_FILE
-TCL_LIB_SPEC
-TCL_LIB_FLAG
-TCL_LIB_FILE
-PKG_CFG_ARGS
-TCL_YEAR
-TCL_PATCH_LEVEL
-TCL_MINOR_VERSION
-TCL_MAJOR_VERSION
-TCL_VERSION
-TCL_BUILDTIME_LIBRARY
-INSTALL_MSGS
-INSTALL_LIBRARIES
-TCL_ZIP_FILE
-ZIPFS_BUILD
-ZIP_INSTALL_OBJS
-ZIP_PROG_VFSSEARCH
-ZIP_PROG_OPTIONS
-ZIP_PROG
-MACHER_PROG
-EXEEXT_FOR_BUILD
-CC_FOR_BUILD
-DTRACE
-LDFLAGS_DEFAULT
-CFLAGS_DEFAULT
-INSTALL_STUB_LIB
-DLL_INSTALL_DIR
-INSTALL_LIB
-MAKE_STUB_LIB
-MAKE_LIB
-SHLIB_SUFFIX
-SHLIB_CFLAGS
-SHLIB_LD_LIBS
-TK_SHLIB_LD_EXTRAS
-TCL_SHLIB_LD_EXTRAS
-SHLIB_LD
-STLIB_LD
-LD_SEARCH_FLAGS
-CC_SEARCH_FLAGS
-LDFLAGS_OPTIMIZE
-LDFLAGS_DEBUG
-CFLAGS_NOLTO
-CFLAGS_WARNING
-CFLAGS_OPTIMIZE
-CFLAGS_DEBUG
-LDAIX_SRC
-PLAT_SRCS
-PLAT_OBJS
-DL_OBJS
-DL_LIBS
-TCL_LIBS
-LIBOBJS
-AR
-RANLIB
-TOMMATH_INCLUDE
-TOMMATH_SRCS
-TOMMATH_OBJS
-TCL_PC_CFLAGS
-TCL_PC_REQUIRES_PRIVATE
-ZLIB_INCLUDE
-ZLIB_SRCS
-ZLIB_OBJS
-TCLSH_PROG
-SHARED_BUILD
-CPP
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-MAN_FLAGS
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-runstatedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL
-OBJEXT_FOR_BUILD'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR ac_ct_AR TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS LDAIX_SRC CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB DLL_INSTALL_DIR INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT LIBOBJS DTRACE TCL_VERSION TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_YEAR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_STUB_LIB_PATH TCL_INCLUDE_SPEC TCL_BUILD_STUB_LIB_SPEC TCL_BUILD_STUB_LIB_PATH TCL_SRC_DIR CFG_TCL_SHARED_LIB_SUFFIX CFG_TCL_UNSHARED_LIB_SUFFIX TCL_SHARED_BUILD LD_LIBRARY_PATH_VAR TCL_BUILD_LIB_SPEC TCL_LIB_VERSIONS_OK TCL_SHARED_LIB_SUFFIX TCL_UNSHARED_LIB_SUFFIX TCL_HAS_LONGLONG INSTALL_TZDATA DTRACE_SRC DTRACE_HDR DTRACE_OBJ MAKEFILE_SHELL BUILD_DLTEST TCL_PACKAGE_PATH TCL_MODULE_PATH TCL_LIBRARY PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_TCLSH_LIBS DLTEST_LD DLTEST_SUFFIX'
ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_man_symlinks
-enable_man_compression
-enable_man_suffix
-with_encoding
-enable_shared
-with_system_libtommath
-enable_64bit
-enable_64bit_vis
-enable_rpath
-enable_corefoundation
-enable_load
-enable_symbols
-enable_langinfo
-enable_dll_unloading
-with_tzdata
-enable_dtrace
-enable_framework
-enable_zipfs
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CPP'
-
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
@@ -847,48 +336,34 @@ x_libraries=NONE
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
+datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
-runstatedir='${localstatedir}/run'
+libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
ac_prev=
-ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
+ eval "$ac_prev=\$ac_option"
ac_prev=
continue
fi
- case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
- esac
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
+ case $ac_option in
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
@@ -910,59 +385,33 @@ do
--config-cache | -C)
cache_file=config.cache ;;
- -datadir | --datadir | --datadi | --datad)
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
datadir=$ac_optarg ;;
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
-disable-* | --disable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: '$ac_useropt'"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
-enable-* | --enable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: '$ac_useropt'"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
esac
- eval enable_$ac_useropt=\$ac_optarg ;;
+ eval "enable_$ac_feature='$ac_optarg'" ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -989,12 +438,6 @@ do
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
@@ -1019,16 +462,13 @@ do
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
-localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -1093,29 +533,10 @@ do
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
- -runstatedir | --runstatedir | --runstatedi | --runstated \
- | --runstate | --runstat | --runsta | --runst | --runs \
- | --run | --ru | --r)
- ac_prev=runstatedir ;;
- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
- | --run=* | --ru=* | --r=*)
- runstatedir=$ac_optarg ;;
-
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1162,36 +583,26 @@ do
ac_init_version=: ;;
-with-* | --with-*)
- ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: '$ac_useropt'"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
esac
- eval with_$ac_useropt=\$ac_optarg ;;
+ eval "with_$ac_package='$ac_optarg'" ;;
-without-* | --without-*)
- ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: '$ac_useropt'"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=no ;;
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
--x)
# Obsolete; use --with-x.
@@ -1211,26 +622,27 @@ do
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
- -*) as_fn_error $? "unrecognized option: '$ac_option'
-Try '$0 --help' for more information"
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
- case $ac_envvar in #(
- '' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: '$ac_envvar'" ;;
- esac
- eval $ac_envvar=\$ac_optarg
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
- printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2
- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
;;
esac
@@ -1238,39 +650,34 @@ done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
- case $enable_option_checking in
- no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
- esac
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
fi
-# Check all directory arguments for consistency.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir runstatedir
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
do
- eval ac_val=\$$ac_var
- # Remove trailing slashes.
+ eval ac_val=$`echo $ac_var`
case $ac_val in
- */ )
- ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
- eval $ac_var=\$ac_val;;
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
esac
- # Be sure to have absolute directory names.
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
+do
+ eval ac_val=$`echo $ac_var`
case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
-# There might be people who depend on the old broken behavior: '$host'
+# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
@@ -1281,6 +688,8 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1292,72 +701,74 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
-
-
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_myself" : 'X\(//\)[^/]' \| \
- X"$as_myself" : 'X\(//\)$' \| \
- X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-printf "%s\n" X"$as_myself" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
+ if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
#
# Report the --help message.
@@ -1366,7 +777,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures tcl 8.7 to adapt to many kinds of systems.
+\`configure' configures tcl 8.5 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1380,46 +791,41 @@ Configuration:
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
- -q, --quiet, --silent do not print 'checking ...' messages
+ -q, --quiet, --silent do not print \`checking...' messages
--cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for '--cache-file=config.cache'
+ -C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or '..']
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+ cat <<_ACEOF
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
+ [$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
+ [PREFIX]
-By default, 'make install' will install all the files in
-'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than '$ac_default_prefix' using '--prefix',
-for instance '--prefix=\$HOME'.
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/tcl]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
_ACEOF
cat <<\_ACEOF
@@ -1428,12 +834,11 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of tcl 8.7:";;
+ short | recursive ) echo "Configuration of tcl 8.5:";;
esac
cat <<\_ACEOF
Optional Features:
- --disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-man-symlinks use symlinks for the manpages (default: off)
@@ -1443,6 +848,7 @@ Optional Features:
use STRING as a suffix to manpage file names
(default: no, tcl if enabled without
specifying STRING)
+ --enable-threads build with threads (default: off)
--enable-shared build and link with shared libraries (default: on)
--enable-64bit enable 64bit support (default: off)
--enable-64bit-vis enable 64bit Sparc VIS support (default: off)
@@ -1457,15 +863,12 @@ Optional Features:
--enable-dtrace build with DTrace support (default: off)
--enable-framework package shared libraries in MacOSX frameworks
(default: off)
- --enable-zipfs build with Zipfs support (default: on)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-encoding encoding for configuration values (default: utf-8)
- --with-system-libtommath
- use external libtommath (default: true if available,
- false otherwise)
+ --with-encoding encoding for configuration values (default:
+ iso8859-1)
--with-tzdata install timezone data (default: autodetect)
Some influential environment variables:
@@ -1473,568 +876,128 @@ Some influential environment variables:
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
CPP C preprocessor
-Use these variables to override the choices made by 'configure' or to help
+Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
-Report bugs to the package provider.
_ACEOF
-ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" ||
- { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
- continue
+ test -d $ac_dir || continue
ac_builddir=.
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
case $srcdir in
- .) # We are building in place.
+ .) # No --srcdir option. We are building in place.
ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for configure.gnu first; this name is used for a wrapper for
- # Metaconfig's "Configure" on case-insensitive file systems.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
else
- printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-tcl configure 8.7
-generated by GNU Autoconf 2.72
-
-Copyright (C) 2023 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest.beam
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-printf "%s\n" "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext
-then :
- ac_retval=0
-else case e in #(
- e) printf "%s\n" "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1 ;;
-esac
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-printf %s "checking for $2... " >&6; }
-if eval test \${$3+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- eval "$3=yes"
-else case e in #(
- e) eval "$3=no" ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
-fi
-eval ac_res=\$$3
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-printf "%s\n" "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-printf "%s\n" "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }
-then :
- ac_retval=0
-else case e in #(
- e) printf "%s\n" "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1 ;;
-esac
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-printf "%s\n" "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }
-then :
- ac_retval=0
-else case e in #(
- e) printf "%s\n" "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1 ;;
-esac
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-printf %s "checking for $2... " >&6; }
-if eval test \${$3+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (void); below. */
-
-#include <limits.h>
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 (void);
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main (void)
-{
-return $2 ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- eval "$3=yes"
-else case e in #(
- e) eval "$3=no" ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext ;;
-esac
-fi
-eval ac_res=\$$3
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-printf "%s\n" "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
-
-# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR
-# ------------------------------------------------------------------
-# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
-# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR.
-ac_fn_check_decl ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- as_decl_name=`echo $2|sed 's/ *(.*//'`
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
-printf %s "checking whether $as_decl_name is declared... " >&6; }
-if eval test \${$3+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
- eval ac_save_FLAGS=\$$6
- as_fn_append $6 " $5"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main (void)
-{
-#ifndef $as_decl_name
-#ifdef __cplusplus
- (void) $as_decl_use;
-#else
- (void) $as_decl_name;
-#endif
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- eval "$3=yes"
-else case e in #(
- e) eval "$3=no" ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- eval $6=\$ac_save_FLAGS
- ;;
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-fi
-eval ac_res=\$$3
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-printf "%s\n" "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_check_decl
-
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-printf %s "checking for $2... " >&6; }
-if eval test \${$3+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) eval "$3=no"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main (void)
-{
-if (sizeof ($2))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main (void)
-{
-if (sizeof (($2)))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-else case e in #(
- e) eval "$3=yes" ;;
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
esac
-fi
-eval ac_res=\$$3
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-printf "%s\n" "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_type
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that
-# executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-printf "%s\n" "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-printf "%s\n" "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }
-then :
- ac_retval=0
-else case e in #(
- e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5
- printf "%s\n" "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_retval=$ac_status ;;
-esac
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
+ done
fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-} # ac_fn_c_try_run
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+tcl configure 8.5
+generated by GNU Autoconf 2.59
-# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
-# ----------------------------------------------------
-# Tries to find if the field MEMBER exists in type AGGR, after including
-# INCLUDES, setting cache variable VAR accordingly.
-ac_fn_c_check_member ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
-printf %s "checking for $2.$3... " >&6; }
-if eval test \${$4+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$5
-int
-main (void)
-{
-static $2 ac_aggr;
-if (ac_aggr.$3)
-return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- eval "$4=yes"
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$5
-int
-main (void)
-{
-static $2 ac_aggr;
-if (sizeof ac_aggr.$3)
-return 0;
- ;
- return 0;
-}
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- eval "$4=yes"
-else case e in #(
- e) eval "$4=no" ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+ exit 0
fi
-eval ac_res=\$$4
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-printf "%s\n" "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_member
-ac_configure_args_raw=
-for ac_arg
-do
- case $ac_arg in
- *\'*)
- ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- as_fn_append ac_configure_args_raw " '$ac_arg'"
-done
-
-case $ac_configure_args_raw in
- *$as_nl*)
- ac_safe_unquote= ;;
- *)
- ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab.
- ac_unsafe_a="$ac_unsafe_z#~"
- ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g"
- ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;;
-esac
-
-cat >config.log <<_ACEOF
+exec 5>config.log
+cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by tcl $as_me 8.7, which was
-generated by GNU Autoconf 2.72. Invocation command line was
+It was created by tcl $as_me 8.5, which was
+generated by GNU Autoconf 2.59. Invocation command line was
- $ $0$ac_configure_args_raw
+ $ $0 $@
_ACEOF
-exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
@@ -2053,7 +1016,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown`
/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
@@ -2064,14 +1027,9 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- printf "%s\n" "PATH: $as_dir"
- done
-IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
} >&5
@@ -2093,6 +1051,7 @@ _ACEOF
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
+ac_sep=
ac_must_keep_next=false
for ac_pass in 1 2
do
@@ -2103,13 +1062,13 @@ do
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
- *\'*)
- ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
- 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
2)
- as_fn_append ac_configure_args1 " '$ac_arg'"
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
if test $ac_must_keep_next = true; then
ac_must_keep_next=false # Got value, back to normal.
else
@@ -2125,576 +1084,217 @@ do
-* ) ac_must_keep_next=true ;;
esac
fi
- as_fn_append ac_configure_args " '$ac_arg'"
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
;;
esac
done
done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
trap 'exit_status=$?
- # Sanitize IFS.
- IFS=" "" $as_nl"
# Save into config.log some information that might help in debugging.
{
echo
- printf "%s\n" "## ---------------- ##
+ cat <<\_ASBOX
+## ---------------- ##
## Cache variables. ##
-## ---------------- ##"
+## ---------------- ##
+_ASBOX
echo
# The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
+{
(set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
*)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
- esac |
- sort
-)
+ esac;
+}
echo
- printf "%s\n" "## ----------------- ##
+ cat <<\_ASBOX
+## ----------------- ##
## Output variables. ##
-## ----------------- ##"
+## ----------------- ##
+_ASBOX
echo
for ac_var in $ac_subst_vars
do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- printf "%s\n" "$ac_var='\''$ac_val'\''"
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
done | sort
echo
if test -n "$ac_subst_files"; then
- printf "%s\n" "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
echo
for ac_var in $ac_subst_files
do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- printf "%s\n" "$ac_var='\''$ac_val'\''"
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
done | sort
echo
fi
if test -s confdefs.h; then
- printf "%s\n" "## ----------- ##
+ cat <<\_ASBOX
+## ----------- ##
## confdefs.h. ##
-## ----------- ##"
+## ----------- ##
+_ASBOX
echo
- cat confdefs.h
+ sed "/^$/d" confdefs.h | sort
echo
fi
test "$ac_signal" != 0 &&
- printf "%s\n" "$as_me: caught signal $ac_signal"
- printf "%s\n" "$as_me: exit $exit_status"
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
} >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ rm -f core *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
-' 0
+ ' 0
for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
done
ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-printf "%s\n" "/* confdefs.h */" > confdefs.h
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
# Predefined preprocessor variables.
-printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
-printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h
-printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
-printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
-printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h
-printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-if test -n "$CONFIG_SITE"; then
- ac_site_files="$CONFIG_SITE"
-elif test "x$prefix" != xNONE; then
- ac_site_files="$prefix/share/config.site $prefix/etc/config.site"
-else
- ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
fi
-
-for ac_site_file in $ac_site_files
-do
- case $ac_site_file in #(
- */*) :
- ;; #(
- *) :
- ac_site_file=./$ac_site_file ;;
-esac
- if test -f "$ac_site_file" && test -r "$ac_site_file"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;}
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
-printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See 'config.log' for more details" "$LINENO" 5; }
+ . "$ac_site_file"
fi
done
if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special files
- # actually), so we avoid doing that. DJGPP emulates it as a regular file.
- if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-printf "%s\n" "$as_me: loading cache $cache_file" >&6;}
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
esac
fi
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-printf "%s\n" "$as_me: creating cache $cache_file" >&6;}
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
-# Test code for whether the C compiler supports C89 (global declarations)
-ac_c_conftest_c89_globals='
-/* Does the compiler advertise C89 conformance?
- Do not test the value of __STDC__, because some compilers set it to 0
- while being otherwise adequately conformant. */
-#if !defined __STDC__
-# error "Compiler does not advertise C89 conformance"
-#endif
-
-#include <stddef.h>
-#include <stdarg.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */
-struct buf { int x; };
-struct buf * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (char **p, int i)
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* C89 style stringification. */
-#define noexpand_stringify(a) #a
-const char *stringified = noexpand_stringify(arbitrary+token=sequence);
-
-/* C89 style token pasting. Exercises some of the corner cases that
- e.g. old MSVC gets wrong, but not very hard. */
-#define noexpand_concat(a,b) a##b
-#define expand_concat(a,b) noexpand_concat(a,b)
-extern int vA;
-extern int vbee;
-#define aye A
-#define bee B
-int *pvA = &expand_concat(v,aye);
-int *pvbee = &noexpand_concat(v,bee);
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not \xHH hex character constants.
- These do not provoke an error unfortunately, instead are silently treated
- as an "x". The following induces an error, until -std is added to get
- proper ANSI mode. Curiously \x00 != x always comes out true, for an
- array size at least. It is necessary to write \x00 == 0 to get something
- that is true only with -std. */
-int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) '\''x'\''
-int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),
- int, int);'
-
-# Test code for whether the C compiler supports C89 (body of main).
-ac_c_conftest_c89_main='
-ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]);
-'
-
-# Test code for whether the C compiler supports C99 (global declarations)
-ac_c_conftest_c99_globals='
-/* Does the compiler advertise C99 conformance? */
-#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
-# error "Compiler does not advertise C99 conformance"
-#endif
-
-// See if C++-style comments work.
-
-#include <stdbool.h>
-extern int puts (const char *);
-extern int printf (const char *, ...);
-extern int dprintf (int, const char *, ...);
-extern void *malloc (size_t);
-extern void free (void *);
-
-// Check varargs macros. These examples are taken from C99 6.10.3.5.
-// dprintf is used instead of fprintf to avoid needing to declare
-// FILE and stderr.
-#define debug(...) dprintf (2, __VA_ARGS__)
-#define showlist(...) puts (#__VA_ARGS__)
-#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
-static void
-test_varargs_macros (void)
-{
- int x = 1234;
- int y = 5678;
- debug ("Flag");
- debug ("X = %d\n", x);
- showlist (The first, second, and third items.);
- report (x>y, "x is %d but y is %d", x, y);
-}
-
-// Check long long types.
-#define BIG64 18446744073709551615ull
-#define BIG32 4294967295ul
-#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
-#if !BIG_OK
- #error "your preprocessor is broken"
-#endif
-#if BIG_OK
-#else
- #error "your preprocessor is broken"
-#endif
-static long long int bignum = -9223372036854775807LL;
-static unsigned long long int ubignum = BIG64;
-
-struct incomplete_array
-{
- int datasize;
- double data[];
-};
-
-struct named_init {
- int number;
- const wchar_t *name;
- double average;
-};
-
-typedef const char *ccp;
-
-static inline int
-test_restrict (ccp restrict text)
-{
- // Iterate through items via the restricted pointer.
- // Also check for declarations in for loops.
- for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i)
- continue;
- return 0;
-}
-
-// Check varargs and va_copy.
-static bool
-test_varargs (const char *format, ...)
-{
- va_list args;
- va_start (args, format);
- va_list args_copy;
- va_copy (args_copy, args);
-
- const char *str = "";
- int number = 0;
- float fnumber = 0;
-
- while (*format)
- {
- switch (*format++)
- {
- case '\''s'\'': // string
- str = va_arg (args_copy, const char *);
- break;
- case '\''d'\'': // int
- number = va_arg (args_copy, int);
- break;
- case '\''f'\'': // float
- fnumber = va_arg (args_copy, double);
- break;
- default:
- break;
- }
- }
- va_end (args_copy);
- va_end (args);
-
- return *str && number && fnumber;
-}
-'
-
-# Test code for whether the C compiler supports C99 (body of main).
-ac_c_conftest_c99_main='
- // Check bool.
- _Bool success = false;
- success |= (argc != 0);
-
- // Check restrict.
- if (test_restrict ("String literal") == 0)
- success = true;
- char *restrict newvar = "Another string";
-
- // Check varargs.
- success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234);
- test_varargs_macros ();
-
- // Check flexible array members.
- struct incomplete_array *ia =
- malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
- ia->datasize = 10;
- for (int i = 0; i < ia->datasize; ++i)
- ia->data[i] = i * 1.234;
- // Work around memory leak warnings.
- free (ia);
-
- // Check named initializers.
- struct named_init ni = {
- .number = 34,
- .name = L"Test wide string",
- .average = 543.34343,
- };
-
- ni.number = 58;
-
- int dynamic_array[ni.number];
- dynamic_array[0] = argv[0][0];
- dynamic_array[ni.number - 1] = 543;
-
- // work around unused variable warnings
- ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\''
- || dynamic_array[ni.number - 1] != 543);
-'
-
-# Test code for whether the C compiler supports C11 (global declarations)
-ac_c_conftest_c11_globals='
-/* Does the compiler advertise C11 conformance? */
-#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
-# error "Compiler does not advertise C11 conformance"
-#endif
-
-// Check _Alignas.
-char _Alignas (double) aligned_as_double;
-char _Alignas (0) no_special_alignment;
-extern char aligned_as_int;
-char _Alignas (0) _Alignas (int) aligned_as_int;
-
-// Check _Alignof.
-enum
-{
- int_alignment = _Alignof (int),
- int_array_alignment = _Alignof (int[100]),
- char_alignment = _Alignof (char)
-};
-_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
-
-// Check _Noreturn.
-int _Noreturn does_not_return (void) { for (;;) continue; }
-
-// Check _Static_assert.
-struct test_static_assert
-{
- int x;
- _Static_assert (sizeof (int) <= sizeof (long int),
- "_Static_assert does not work in struct");
- long int y;
-};
-
-// Check UTF-8 literals.
-#define u8 syntax error!
-char const utf8_literal[] = u8"happens to be ASCII" "another string";
-
-// Check duplicate typedefs.
-typedef long *long_ptr;
-typedef long int *long_ptr;
-typedef long_ptr long_ptr;
-
-// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
-struct anonymous
-{
- union {
- struct { int i; int j; };
- struct { int k; long int l; } w;
- };
- int m;
-} v1;
-'
-
-# Test code for whether the C compiler supports C11 (body of main).
-ac_c_conftest_c11_main='
- _Static_assert ((offsetof (struct anonymous, i)
- == offsetof (struct anonymous, w.k)),
- "Anonymous union alignment botch");
- v1.i = 2;
- v1.w.k = 5;
- ok |= v1.i != 5;
-'
-
-# Test code for whether the C compiler supports C11 (complete).
-ac_c_conftest_c11_program="${ac_c_conftest_c89_globals}
-${ac_c_conftest_c99_globals}
-${ac_c_conftest_c11_globals}
-
-int
-main (int argc, char **argv)
-{
- int ok = 0;
- ${ac_c_conftest_c89_main}
- ${ac_c_conftest_c99_main}
- ${ac_c_conftest_c11_main}
- return ok;
-}
-"
-
-# Test code for whether the C compiler supports C99 (complete).
-ac_c_conftest_c99_program="${ac_c_conftest_c89_globals}
-${ac_c_conftest_c99_globals}
-
-int
-main (int argc, char **argv)
-{
- int ok = 0;
- ${ac_c_conftest_c89_main}
- ${ac_c_conftest_c99_main}
- return ok;
-}
-"
-
-# Test code for whether the C compiler supports C89 (complete).
-ac_c_conftest_c89_program="${ac_c_conftest_c89_globals}
-
-int
-main (int argc, char **argv)
-{
- int ok = 0;
- ${ac_c_conftest_c89_main}
- return ok;
-}
-"
-
-as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H"
-as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H"
-as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H"
-as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H"
-as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H"
-as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H"
-as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H"
-as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H"
-as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H"
-as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H"
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
case $ac_old_set,$ac_new_set in
set,)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5
-printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;}
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5
-printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;}
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- # differences in whitespace do not lead to failure.
- ac_old_val_w=`echo x $ac_old_val`
- ac_new_val_w=`echo x $ac_new_val`
- if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5
-printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;}
- ac_cache_corrupted=:
- else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5
-printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;}
- eval $ac_var=\$ac_old_val
- fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5
-printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;}
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5
-printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;}
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
- *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
-printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file'
- and start over" "$LINENO" 5
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -2707,36 +1307,36 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-TCL_VERSION=8.7
-TCL_MAJOR_VERSION=8
-TCL_MINOR_VERSION=7
-TCL_PATCH_LEVEL="b1"
-VERSION=${TCL_VERSION}
-EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"}
-EXTRA_BUILD_HTML=${EXTRA_BUILD_HTML:-"@:"}
-#------------------------------------------------------------------------
-# Setup configure arguments for bundled packages
-#------------------------------------------------------------------------
-PKG_CFG_ARGS="$ac_configure_args ${PKG_CFG_ARGS}"
-if test -r "$cache_file" -a -f "$cache_file"; then
- case $cache_file in
- [\\/]* | ?:[\\/]* ) pkg_cache_file=$cache_file ;;
- *) pkg_cache_file=../../$cache_file ;;
- esac
- PKG_CFG_ARGS="${PKG_CFG_ARGS} --cache-file=$pkg_cache_file"
-fi
-#------------------------------------------------------------------------
-# Empty slate for bundled packages, to avoid stale configuration
-#------------------------------------------------------------------------
-#rm -Rf pkgs
-if test -f Makefile; then
- make distclean-packages
-fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+TCL_VERSION=8.5
+TCL_MAJOR_VERSION=8
+TCL_MINOR_VERSION=5
+TCL_PATCH_LEVEL=".18"
+VERSION=${TCL_VERSION}
#------------------------------------------------------------------------
# Handle the --prefix=... option
@@ -2757,66 +1357,62 @@ TCL_SRC_DIR="`cd "$srcdir"/..; pwd`"
#------------------------------------------------------------------------
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use symlinks for manpages" >&5
-printf %s "checking whether to use symlinks for manpages... " >&6; }
- # Check whether --enable-man-symlinks was given.
-if test ${enable_man_symlinks+y}
-then :
- enableval=$enable_man_symlinks; test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks"
-else case e in #(
- e) enableval="no" ;;
-esac
-fi
-
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
-printf "%s\n" "$enableval" >&6; }
-
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to compress the manpages" >&5
-printf %s "checking whether to compress the manpages... " >&6; }
- # Check whether --enable-man-compression was given.
-if test ${enable_man_compression+y}
-then :
- enableval=$enable_man_compression; case $enableval in
- yes) as_fn_error $? "missing argument to --enable-man-compression" "$LINENO" 5;;
+ echo "$as_me:$LINENO: checking whether to use symlinks for manpages" >&5
+echo $ECHO_N "checking whether to use symlinks for manpages... $ECHO_C" >&6
+ # Check whether --enable-man-symlinks or --disable-man-symlinks was given.
+if test "${enable_man_symlinks+set}" = set; then
+ enableval="$enable_man_symlinks"
+ test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks"
+else
+ enableval="no"
+fi;
+ echo "$as_me:$LINENO: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+
+ echo "$as_me:$LINENO: checking whether to compress the manpages" >&5
+echo $ECHO_N "checking whether to compress the manpages... $ECHO_C" >&6
+ # Check whether --enable-man-compression or --disable-man-compression was given.
+if test "${enable_man_compression+set}" = set; then
+ enableval="$enable_man_compression"
+ case $enableval in
+ yes) { { echo "$as_me:$LINENO: error: missing argument to --enable-man-compression" >&5
+echo "$as_me: error: missing argument to --enable-man-compression" >&2;}
+ { (exit 1); exit 1; }; };;
no) ;;
*) MAN_FLAGS="$MAN_FLAGS --compress $enableval";;
esac
-else case e in #(
- e) enableval="no" ;;
-esac
-fi
-
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
-printf "%s\n" "$enableval" >&6; }
+else
+ enableval="no"
+fi;
+ echo "$as_me:$LINENO: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
if test "$enableval" != "no"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compressed file suffix" >&5
-printf %s "checking for compressed file suffix... " >&6; }
+ echo "$as_me:$LINENO: checking for compressed file suffix" >&5
+echo $ECHO_N "checking for compressed file suffix... $ECHO_C" >&6
touch TeST
$enableval TeST
Z=`ls TeST* | sed 's/^....//'`
rm -f TeST*
MAN_FLAGS="$MAN_FLAGS --extension $Z"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $Z" >&5
-printf "%s\n" "$Z" >&6; }
+ echo "$as_me:$LINENO: result: $Z" >&5
+echo "${ECHO_T}$Z" >&6
fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to add a package name suffix for the manpages" >&5
-printf %s "checking whether to add a package name suffix for the manpages... " >&6; }
- # Check whether --enable-man-suffix was given.
-if test ${enable_man_suffix+y}
-then :
- enableval=$enable_man_suffix; case $enableval in
+ echo "$as_me:$LINENO: checking whether to add a package name suffix for the manpages" >&5
+echo $ECHO_N "checking whether to add a package name suffix for the manpages... $ECHO_C" >&6
+ # Check whether --enable-man-suffix or --disable-man-suffix was given.
+if test "${enable_man_suffix+set}" = set; then
+ enableval="$enable_man_suffix"
+ case $enableval in
yes) enableval="tcl" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";;
no) ;;
*) MAN_FLAGS="$MAN_FLAGS --suffix $enableval";;
esac
-else case e in #(
- e) enableval="no" ;;
-esac
-fi
-
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
-printf "%s\n" "$enableval" >&6; }
+else
+ enableval="no"
+fi;
+ echo "$as_me:$LINENO: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
@@ -2831,15 +1427,6 @@ if test "${CFLAGS+set}" != "set" ; then
CFLAGS=""
fi
-
-
-
-
-
-
-
-
-
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2848,164 +1435,172 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_CC+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -n "$CC"; then
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
-fi ;;
-esac
+fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-printf "%s\n" "$CC" >&6; }
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
fi
if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_ac_ct_CC+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -n "$ac_ct_CC"; then
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
-fi ;;
-esac
+fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-printf "%s\n" "$ac_ct_CC" >&6; }
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
+ CC=$ac_ct_CC
else
CC="$ac_cv_prog_CC"
fi
if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_CC+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -n "$CC"; then
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
-fi ;;
-esac
+fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-printf "%s\n" "$CC" >&6; }
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_CC+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -n "$CC"; then
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
ac_prog_rejected=no
@@ -3013,24 +1608,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
- if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
@@ -3041,280 +1631,146 @@ if test $ac_prog_rejected = yes; then
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
- ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@"
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
fi
fi
-fi ;;
-esac
+fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-printf "%s\n" "$CC" >&6; }
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
+ for ac_prog in cl
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_CC+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -n "$CC"; then
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
-fi ;;
-esac
+fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-printf "%s\n" "$CC" >&6; }
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
test -n "$CC" && break
done
fi
if test -z "$CC"; then
ac_ct_CC=$CC
- for ac_prog in cl.exe
+ for ac_prog in cl
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_ac_ct_CC+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -n "$ac_ct_CC"; then
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
-fi ;;
-esac
+fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-printf "%s\n" "$ac_ct_CC" >&6; }
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
test -n "$ac_ct_CC" && break
done
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
-set dummy ${ac_tool_prefix}clang; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_CC+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}clang"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi ;;
-esac
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-printf "%s\n" "$CC" >&6; }
-else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "clang", so it can be a program name with args.
-set dummy clang; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_ac_ct_CC+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="clang"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi ;;
-esac
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-printf "%s\n" "$ac_ct_CC" >&6; }
-else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
+ CC=$ac_ct_CC
fi
fi
-test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
-printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See 'config.log' for more details" "$LINENO" 5; }
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
# Provide some information about the compiler.
-printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion -version; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-printf "%s\n" "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
-main (void)
+main ()
{
;
@@ -3322,213 +1778,155 @@ main (void)
}
_ACEOF
ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-printf %s "checking whether the C compiler works... " >&6; }
-ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-printf "%s\n" "$ac_try_echo"; } >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-then :
- # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'.
-# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
;;
[ab].out )
# We found the default executable, but exeext='' is most
# certainly right.
break;;
*.* )
- if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an '-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
break;;
* )
break;;
esac
done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else case e in #(
- e) ac_file='' ;;
-esac
-fi
-if test -z "$ac_file"
-then :
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
-printf "%s\n" "$as_me: failed program was:" >&5
+else
+ echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
-printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See 'config.log' for more details" "$LINENO" 5; }
-else case e in #(
- e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; } ;;
-esac
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-printf %s "checking for C compiler default output file name... " >&6; }
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-printf "%s\n" "$ac_file" >&6; }
+
ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-printf %s "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-printf "%s\n" "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-then :
- # If both 'conftest.exe' and 'conftest' are 'present' (well, observable)
-# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will
-# work properly (i.e., refer to 'conftest.exe'), while it won't with
-# 'rm'.
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
break;;
* ) break;;
esac
done
-else case e in #(
- e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
-printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See 'config.log' for more details" "$LINENO" 5; } ;;
-esac
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
-rm -f conftest conftest$ac_cv_exeext
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-printf "%s\n" "$ac_cv_exeext" >&6; }
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main (void)
-{
-FILE *f = fopen ("conftest.out", "w");
- if (!f)
- return 1;
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-printf %s "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
- { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-printf "%s\n" "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if { ac_try='./conftest$ac_cv_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-printf "%s\n" "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
-printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
-as_fn_error 77 "cannot run C compiled programs.
-If you meant to cross compile, use '--host'.
-See 'config.log' for more details" "$LINENO" 5; }
- fi
- fi
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-printf "%s\n" "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext \
- conftest.o conftest.obj conftest.out
-ac_clean_files=$ac_clean_files_save
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-printf %s "checking for suffix of object files... " >&6; }
-if test ${ac_cv_objext+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
-main (void)
+main ()
{
;
@@ -3536,54 +1934,49 @@ main (void)
}
_ACEOF
rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-printf "%s\n" "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-then :
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
-else case e in #(
- e) printf "%s\n" "$as_me: failed program was:" >&5
+else
+ echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
-printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See 'config.log' for more details" "$LINENO" 5; } ;;
-esac
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext ;;
-esac
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-printf "%s\n" "$ac_cv_objext" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5
-printf %s "checking whether the compiler supports GNU C... " >&6; }
-if test ${ac_cv_c_compiler_gnu+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
-main (void)
+main ()
{
#ifndef __GNUC__
choke me
@@ -3593,100 +1986,99 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_compiler_gnu=yes
-else case e in #(
- e) ac_compiler_gnu=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
- ;;
-esac
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; }
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test $ac_compiler_gnu = yes; then
- GCC=yes
-else
- GCC=
fi
-ac_test_CFLAGS=${CFLAGS+y}
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-printf %s "checking whether $CC accepts -g... " >&6; }
-if test ${ac_cv_prog_cc_g+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main (void)
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- ac_cv_prog_cc_g=yes
-else case e in #(
- e) CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main (void)
-{
-
- ;
- return 0;
-}
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-
-else case e in #(
- e) ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
-main (void)
+main ()
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-printf "%s\n" "$ac_cv_prog_cc_g" >&6; }
-if test $ac_test_CFLAGS; then
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
@@ -3701,155 +2093,264 @@ else
CFLAGS=
fi
fi
-ac_prog_cc_stdc=no
-if test x$ac_prog_cc_stdc = xno
-then :
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
-printf %s "checking for $CC option to enable C11 features... " >&6; }
-if test ${ac_cv_prog_cc_c11+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_cv_prog_cc_c11=no
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_c_conftest_c11_program
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
_ACEOF
-for ac_arg in '' -std=gnu11
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"
-then :
- ac_cv_prog_cc_c11=$ac_arg
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam
- test "x$ac_cv_prog_cc_c11" != "xno" && break
+rm -f conftest.err conftest.$ac_objext
done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC ;;
-esac
-fi
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
-if test "x$ac_cv_prog_cc_c11" = xno
-then :
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-printf "%s\n" "unsupported" >&6; }
-else case e in #(
- e) if test "x$ac_cv_prog_cc_c11" = x
-then :
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-printf "%s\n" "none needed" >&6; }
-else case e in #(
- e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
-printf "%s\n" "$ac_cv_prog_cc_c11" >&6; }
- CC="$CC $ac_cv_prog_cc_c11" ;;
-esac
fi
- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
- ac_prog_cc_stdc=c11 ;;
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
esac
-fi
-fi
-if test x$ac_prog_cc_stdc = xno
-then :
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
-printf %s "checking for $CC option to enable C99 features... " >&6; }
-if test ${ac_cv_prog_cc_c99+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_cv_prog_cc_c99=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_c_conftest_c99_program
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
_ACEOF
-for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99=
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"
-then :
- ac_cv_prog_cc_c99=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam
- test "x$ac_cv_prog_cc_c99" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC ;;
-esac
-fi
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-if test "x$ac_cv_prog_cc_c99" = xno
-then :
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-printf "%s\n" "unsupported" >&6; }
-else case e in #(
- e) if test "x$ac_cv_prog_cc_c99" = x
-then :
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-printf "%s\n" "none needed" >&6; }
-else case e in #(
- e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
-printf "%s\n" "$ac_cv_prog_cc_c99" >&6; }
- CC="$CC $ac_cv_prog_cc_c99" ;;
-esac
-fi
- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
- ac_prog_cc_stdc=c99 ;;
-esac
-fi
+continue
fi
-if test x$ac_prog_cc_stdc = xno
-then :
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
-printf %s "checking for $CC option to enable C89 features... " >&6; }
-if test ${ac_cv_prog_cc_c89+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_c_conftest_c89_program
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"
-then :
- ac_cv_prog_cc_c89=$ac_arg
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam
- test "x$ac_cv_prog_cc_c89" != "xno" && break
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC ;;
-esac
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
fi
-if test "x$ac_cv_prog_cc_c89" = xno
-then :
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-printf "%s\n" "unsupported" >&6; }
-else case e in #(
- e) if test "x$ac_cv_prog_cc_c89" = x
-then :
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-printf "%s\n" "none needed" >&6; }
-else case e in #(
- e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-printf "%s\n" "$ac_cv_prog_cc_c89" >&6; }
- CC="$CC $ac_cv_prog_cc_c89" ;;
-esac
-fi
- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
- ac_prog_cc_stdc=c89 ;;
-esac
-fi
-fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3857,35 +2358,61 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-printf %s "checking for inline... " >&6; }
-if test ${ac_cv_c_inline+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_cv_c_inline=no
+echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifndef __cplusplus
typedef int foo_t;
-static $ac_kw foo_t static_foo (void) {return 0; }
-$ac_kw foo_t foo (void) {return 0; }
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
#endif
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- ac_cv_c_inline=$ac_kw
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_inline=$ac_kw; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- test "$ac_cv_c_inline" != no && break
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
- ;;
-esac
+
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-printf "%s\n" "$ac_cv_c_inline" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
+
case $ac_cv_c_inline in
inline | yes) ;;
@@ -3903,175 +2430,241 @@ _ACEOF
esac
-
#--------------------------------------------------------------------
# Supply substitutes for missing POSIX header files. Special notes:
-# - stdlib.h doesn't define strtol or strtoul in some versions
-# of SunOS
+# - stdlib.h doesn't define strtol, strtoul, or
+# strtod insome versions of SunOS
# - some versions of string.h don't declare procedures such
# as strstr
# Do this early, otherwise an autoconf bug throws errors on configure
#--------------------------------------------------------------------
-ac_header= ac_cache=
-for ac_item in $ac_header_c_list
-do
- if test $ac_cache; then
- ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default"
- if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then
- printf "%s\n" "#define $ac_item 1" >> confdefs.h
- fi
- ac_header= ac_cache=
- elif test $ac_header; then
- ac_cache=$ac_item
- else
- ac_header=$ac_item
- fi
-done
-
-
-
-
-
-
-
-
-if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes
-then :
-
-printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-printf %s "checking how to run the C preprocessor... " >&6; }
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
- if test ${ac_cv_prog_CPP+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) # Double quotes because $CC needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
do
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <limits.h>
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
Syntax error
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"
-then :
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-else case e in #(
- e) # Broken: fails on valid input.
-continue ;;
-esac
+ # Broken: fails on valid input.
+continue
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
- # OK, works on sane cases. Now check whether nonexistent headers
+ # OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"
-then :
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
# Broken: success on invalid input.
continue
-else case e in #(
- e) # Passes both tests.
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
ac_preproc_ok=:
-break ;;
-esac
+break
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
done
-# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok
-then :
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
break
fi
done
ac_cv_prog_CPP=$CPP
- ;;
-esac
+
fi
CPP=$ac_cv_prog_CPP
else
ac_cv_prog_CPP=$CPP
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-printf "%s\n" "$CPP" >&6; }
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <limits.h>
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
Syntax error
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"
-then :
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-else case e in #(
- e) # Broken: fails on valid input.
-continue ;;
-esac
+ # Broken: fails on valid input.
+continue
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
- # OK, works on sane cases. Now check whether nonexistent headers
+ # OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"
-then :
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
# Broken: success on invalid input.
continue
-else case e in #(
- e) # Passes both tests.
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
ac_preproc_ok=:
-break ;;
-esac
+break
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
done
-# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok
-then :
-
-else case e in #(
- e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
-printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See 'config.log' for more details" "$LINENO" 5; } ;;
-esac
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
ac_ext=c
@@ -4081,179 +2674,1170 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5
-printf %s "checking for egrep -e... " >&6; }
-if test ${ac_cv_path_EGREP_TRADITIONAL+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -z "$EGREP_TRADITIONAL"; then
- ac_path_EGREP_TRADITIONAL_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_prog in grep ggrep
- do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue
-# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found.
- # Check for GNU $ac_path_EGREP_TRADITIONAL
-case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #(
-*GNU*)
- ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;;
-#(
-*)
- ac_count=0
- printf %s 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl"
- "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL"
- ac_path_EGREP_TRADITIONAL_max=$ac_count
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
- $ac_path_EGREP_TRADITIONAL_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then
- :
- fi
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- if test "$ac_cv_path_EGREP_TRADITIONAL"
-then :
- ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E"
-else case e in #(
- e) if test -z "$EGREP_TRADITIONAL"; then
- ac_path_EGREP_TRADITIONAL_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
do
- IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_prog in egrep
- do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue
-# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found.
- # Check for GNU $ac_path_EGREP_TRADITIONAL
-case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #(
-*GNU*)
- ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;;
-#(
-*)
- ac_count=0
- printf %s 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl"
- "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL"
- ac_path_EGREP_TRADITIONAL_max=$ac_count
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+ echo "$as_me:$LINENO: checking dirent.h" >&5
+echo $ECHO_N "checking dirent.h... $ECHO_C" >&6
+if test "${tcl_cv_dirent_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <dirent.h>
+int
+main ()
+{
+
+#ifndef _POSIX_SOURCE
+# ifdef __Lynx__
+ /*
+ * Generate compilation error to make the test fail: Lynx headers
+ * are only valid if really in the POSIX environment.
+ */
+
+ missing_procedure();
+# endif
+#endif
+DIR *d;
+struct dirent *entryPtr;
+char *p;
+d = opendir("foobar");
+entryPtr = readdir(d);
+p = entryPtr->d_name;
+closedir(d);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_dirent_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_dirent_h=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5
+echo "${ECHO_T}$tcl_cv_dirent_h" >&6
+
+ if test $tcl_cv_dirent_h = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_DIRENT_H 1
+_ACEOF
+
fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+
+ if test "${ac_cv_header_float_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for float.h" >&5
+echo $ECHO_N "checking for float.h... $ECHO_C" >&6
+if test "${ac_cv_header_float_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5
+echo "${ECHO_T}$ac_cv_header_float_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking float.h usability" >&5
+echo $ECHO_N "checking float.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <float.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking float.h presence" >&5
+echo $ECHO_N "checking float.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <float.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
esac
+echo "$as_me:$LINENO: checking for float.h" >&5
+echo $ECHO_N "checking for float.h... $ECHO_C" >&6
+if test "${ac_cv_header_float_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_float_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5
+echo "${ECHO_T}$ac_cv_header_float_h" >&6
- $ac_path_EGREP_TRADITIONAL_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+fi
+if test $ac_cv_header_float_h = yes; then
+ :
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_FLOAT_H 1
+_ACEOF
+
+fi
+
+
+ if test "${ac_cv_header_values_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for values.h" >&5
+echo $ECHO_N "checking for values.h... $ECHO_C" >&6
+if test "${ac_cv_header_values_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5
+echo "${ECHO_T}$ac_cv_header_values_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking values.h usability" >&5
+echo $ECHO_N "checking values.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <values.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking values.h presence" >&5
+echo $ECHO_N "checking values.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <values.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
fi
else
- ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL
+ ac_cpp_err=yes
fi
- ;;
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
esac
-fi ;;
+echo "$as_me:$LINENO: checking for values.h" >&5
+echo $ECHO_N "checking for values.h... $ECHO_C" >&6
+if test "${ac_cv_header_values_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_values_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5
+echo "${ECHO_T}$ac_cv_header_values_h" >&6
+
+fi
+if test $ac_cv_header_values_h = yes; then
+ :
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_VALUES_H 1
+_ACEOF
+
+fi
+
+
+ if test "${ac_cv_header_limits_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for limits.h" >&5
+echo $ECHO_N "checking for limits.h... $ECHO_C" >&6
+if test "${ac_cv_header_limits_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5
+echo "${ECHO_T}$ac_cv_header_limits_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking limits.h usability" >&5
+echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <limits.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking limits.h presence" >&5
+echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <limits.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
esac
+echo "$as_me:$LINENO: checking for limits.h" >&5
+echo $ECHO_N "checking for limits.h... $ECHO_C" >&6
+if test "${ac_cv_header_limits_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_limits_h=$ac_header_preproc
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5
-printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; }
- EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL
+echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5
+echo "${ECHO_T}$ac_cv_header_limits_h" >&6
+fi
+if test $ac_cv_header_limits_h = yes; then
- ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default"
-if test "x$ac_cv_header_string_h" = xyes
-then :
- tcl_ok=1
-else case e in #(
- e) tcl_ok=0 ;;
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIMITS_H 1
+_ACEOF
+
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_LIMITS_H 1
+_ACEOF
+
+fi
+
+
+ if test "${ac_cv_header_stdlib_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for stdlib.h" >&5
+echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6
+if test "${ac_cv_header_stdlib_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking stdlib.h usability" >&5
+echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <stdlib.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking stdlib.h presence" >&5
+echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
esac
+echo "$as_me:$LINENO: checking for stdlib.h" >&5
+echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6
+if test "${ac_cv_header_stdlib_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_stdlib_h=$ac_header_preproc
fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+fi
+if test $ac_cv_header_stdlib_h = yes; then
+ tcl_ok=1
+else
+ tcl_ok=0
+fi
+
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <string.h>
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strtol" >/dev/null 2>&1; then
+ :
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strtoul" >/dev/null 2>&1; then
+ :
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP_TRADITIONAL "strstr" >/dev/null 2>&1
-then :
+ $EGREP "strtod" >/dev/null 2>&1; then
+ :
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+ if test $tcl_ok = 0; then
-else case e in #(
- e) tcl_ok=0 ;;
+cat >>confdefs.h <<\_ACEOF
+#define NO_STDLIB_H 1
+_ACEOF
+
+ fi
+ if test "${ac_cv_header_string_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for string.h" >&5
+echo $ECHO_N "checking for string.h... $ECHO_C" >&6
+if test "${ac_cv_header_string_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5
+echo "${ECHO_T}$ac_cv_header_string_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking string.h usability" >&5
+echo $ECHO_N "checking string.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <string.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking string.h presence" >&5
+echo $ECHO_N "checking string.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
esac
+echo "$as_me:$LINENO: checking for string.h" >&5
+echo $ECHO_N "checking for string.h... $ECHO_C" >&6
+if test "${ac_cv_header_string_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_string_h=$ac_header_preproc
fi
-rm -rf conftest*
+echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5
+echo "${ECHO_T}$ac_cv_header_string_h" >&6
+
+fi
+if test $ac_cv_header_string_h = yes; then
+ tcl_ok=1
+else
+ tcl_ok=0
+fi
+
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <string.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP_TRADITIONAL "strerror" >/dev/null 2>&1
-then :
+ $EGREP "strstr" >/dev/null 2>&1; then
+ :
+else
+ tcl_ok=0
+fi
+rm -f conftest*
-else case e in #(
- e) tcl_ok=0 ;;
-esac
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strerror" >/dev/null 2>&1; then
+ :
+else
+ tcl_ok=0
fi
-rm -rf conftest*
+rm -f conftest*
# See also memmove check below for a place where NO_STRING_H can be
@@ -4261,46 +3845,459 @@ rm -rf conftest*
if test $tcl_ok = 0; then
-printf "%s\n" "#define NO_STRING_H 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define NO_STRING_H 1
+_ACEOF
fi
- ac_fn_c_check_header_compile "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_wait_h" = xyes
-then :
+ if test "${ac_cv_header_sys_wait_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for sys/wait.h" >&5
+echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_wait_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking sys/wait.h usability" >&5
+echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <sys/wait.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-else case e in #(
- e)
-printf "%s\n" "#define NO_SYS_WAIT_H 1" >>confdefs.h
- ;;
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking sys/wait.h presence" >&5
+echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/wait.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
esac
+echo "$as_me:$LINENO: checking for sys/wait.h" >&5
+echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_wait_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_sys_wait_h=$ac_header_preproc
fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
- ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default"
-if test "x$ac_cv_header_dlfcn_h" = xyes
-then :
+fi
+if test $ac_cv_header_sys_wait_h = yes; then
+ :
+else
-else case e in #(
- e)
-printf "%s\n" "#define NO_DLFCN_H 1" >>confdefs.h
- ;;
+cat >>confdefs.h <<\_ACEOF
+#define NO_SYS_WAIT_H 1
+_ACEOF
+
+fi
+
+
+ if test "${ac_cv_header_dlfcn_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for dlfcn.h" >&5
+echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6
+if test "${ac_cv_header_dlfcn_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
+echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking dlfcn.h usability" >&5
+echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <dlfcn.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking dlfcn.h presence" >&5
+echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <dlfcn.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
esac
+echo "$as_me:$LINENO: checking for dlfcn.h" >&5
+echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6
+if test "${ac_cv_header_dlfcn_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_dlfcn_h=$ac_header_preproc
fi
+echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
+echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6
+
+fi
+if test $ac_cv_header_dlfcn_h = yes; then
+ :
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_DLFCN_H 1
+_ACEOF
+
+fi
+
# OS/390 lacks sys/param.h (and doesn't need it, by chance).
- ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_param_h" = xyes
-then :
- printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h
+for ac_header in sys/param.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
-#--------------------------------------------------------------------
-# Determines the correct executable file extension (.exe)
-#--------------------------------------------------------------------
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
@@ -4310,1017 +4307,1999 @@ fi
#------------------------------------------------------------------------
if test -z "$no_pipe" && test -n "$GCC"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5
-printf %s "checking if the compiler understands -pipe... " >&6; }
-if test ${tcl_cv_cc_pipe+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
+ echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5
+echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6
+if test "${tcl_cv_cc_pipe+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
-main (void)
+main ()
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_cc_pipe=yes
-else case e in #(
- e) tcl_cv_cc_pipe=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_cc_pipe=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- CFLAGS=$hold_cflags ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS=$hold_cflags
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5
-printf "%s\n" "$tcl_cv_cc_pipe" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5
+echo "${ECHO_T}$tcl_cv_cc_pipe" >&6
if test $tcl_cv_cc_pipe = yes; then
CFLAGS="$CFLAGS -pipe"
fi
fi
#------------------------------------------------------------------------
-# Embedded configuration information, encoding to use for the values, TIP #59
+# Threads support
#------------------------------------------------------------------------
+ # Check whether --enable-threads or --disable-threads was given.
+if test "${enable_threads+set}" = set; then
+ enableval="$enable_threads"
+ tcl_ok=$enableval
+else
+ tcl_ok=no
+fi;
-# Check whether --with-encoding was given.
-if test ${with_encoding+y}
-then :
- withval=$with_encoding; with_tcencoding=${withval}
-fi
+ if test "${TCL_THREADS}" = 1; then
+ tcl_threaded_core=1;
+ fi
+ if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
+ TCL_THREADS=1
+ # USE_THREAD_ALLOC tells us to try the special thread-based
+ # allocator that significantly reduces lock contention
- if test x"${with_tcencoding}" != x ; then
+cat >>confdefs.h <<\_ACEOF
+#define USE_THREAD_ALLOC 1
+_ACEOF
-printf "%s\n" "#define TCL_CFGVAL_ENCODING \"${with_tcencoding}\"" >>confdefs.h
- else
+cat >>confdefs.h <<\_ACEOF
+#define _REENTRANT 1
+_ACEOF
-printf "%s\n" "#define TCL_CFGVAL_ENCODING \"utf-8\"" >>confdefs.h
+ if test "`uname -s`" = "SunOS" ; then
- fi
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_PTHREAD_SEMANTICS 1
+_ACEOF
+ fi
-#--------------------------------------------------------------------
-# Look for libraries that we will need when compiling the Tcl shell
-#--------------------------------------------------------------------
+cat >>confdefs.h <<\_ACEOF
+#define _THREAD_SAFE 1
+_ACEOF
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5
-printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; }
-if test ${ac_cv_c_undeclared_builtin_options+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_save_CFLAGS=$CFLAGS
- ac_cv_c_undeclared_builtin_options='cannot detect'
- for ac_arg in '' -fno-builtin; do
- CFLAGS="$ac_save_CFLAGS $ac_arg"
- # This test program should *not* compile successfully.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5
+echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6
+if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pthread_mutex_init ();
int
-main (void)
+main ()
{
-(void) strchr;
+pthread_mutex_init ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_pthread_pthread_mutex_init=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-else case e in #(
- e) # This test program should compile successfully.
- # No library function is consistently available on
- # freestanding implementations, so test against a dummy
- # declaration. Include always-available headers on the
- # off chance that they somehow elicit warnings.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ac_cv_lib_pthread_pthread_mutex_init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6
+if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
+ tcl_ok=yes
+else
+ tcl_ok=no
+fi
+
+ if test "$tcl_ok" = "no"; then
+ # Check a little harder for __pthread_mutex_init in the same
+ # library, as some systems hide it there until pthread.h is
+ # defined. We could alternatively do an AC_TRY_COMPILE with
+ # pthread.h, but that will work with libpthread really doesn't
+ # exist, like AIX 4.2. [Bug: 4359]
+ echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5
+echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6
+if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <float.h>
-#include <limits.h>
-#include <stdarg.h>
-#include <stddef.h>
-extern void ac_decl (int, char *);
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char __pthread_mutex_init ();
int
-main (void)
+main ()
{
-(void) ac_decl (0, (char *) 0);
- (void) ac_decl;
-
+__pthread_mutex_init ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- if test x"$ac_arg" = x
-then :
- ac_cv_c_undeclared_builtin_options='none needed'
-else case e in #(
- e) ac_cv_c_undeclared_builtin_options=$ac_arg ;;
-esac
-fi
- break
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_pthread___pthread_mutex_init=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_pthread___pthread_mutex_init=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- done
- CFLAGS=$ac_save_CFLAGS
- ;;
-esac
+echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6
+if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then
+ tcl_ok=yes
+else
+ tcl_ok=no
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5
-printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; }
- case $ac_cv_c_undeclared_builtin_options in #(
- 'cannot detect') :
- { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
-printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
-as_fn_error $? "cannot make $CC report undeclared builtins
-See 'config.log' for more details" "$LINENO" 5; } ;; #(
- 'none needed') :
- ac_c_undeclared_builtin_options='' ;; #(
- *) :
- ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;;
-esac
+ fi
- #--------------------------------------------------------------------
- # On a few very rare systems, all of the libm.a stuff is
- # already in libc.a. Set compiler flags accordingly.
- #--------------------------------------------------------------------
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthread"
+ else
+ echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5
+echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6
+if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthreads $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
- ac_fn_c_check_func "$LINENO" "sin" "ac_cv_func_sin"
-if test "x$ac_cv_func_sin" = xyes
-then :
- MATH_LIBS=""
-else case e in #(
- e) MATH_LIBS="-lm" ;;
-esac
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pthread_mutex_init ();
+int
+main ()
+{
+pthread_mutex_init ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_pthreads_pthread_mutex_init=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_pthreads_pthread_mutex_init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5
+echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6
+if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then
+ tcl_ok=yes
+else
+ tcl_ok=no
fi
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthreads"
+ else
+ echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5
+echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6
+if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
- #--------------------------------------------------------------------
- # Interactive UNIX requires -linet instead of -lsocket, plus it
- # needs net/errno.h to define the socket-related error codes.
- #--------------------------------------------------------------------
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pthread_mutex_init ();
+int
+main ()
+{
+pthread_mutex_init ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_c_pthread_mutex_init=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -linet" >&5
-printf %s "checking for main in -linet... " >&6; }
-if test ${ac_cv_lib_inet_main+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
-LIBS="-linet $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+ac_cv_lib_c_pthread_mutex_init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5
+echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6
+if test $ac_cv_lib_c_pthread_mutex_init = yes; then
+ tcl_ok=yes
+else
+ tcl_ok=no
+fi
+ if test "$tcl_ok" = "no"; then
+ echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5
+echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6
+if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pthread_mutex_init ();
int
-main (void)
+main ()
{
-return main ();
+pthread_mutex_init ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- ac_cv_lib_inet_main=yes
-else case e in #(
- e) ac_cv_lib_inet_main=no ;;
-esac
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_c_r_pthread_mutex_init=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_c_r_pthread_mutex_init=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_main" >&5
-printf "%s\n" "$ac_cv_lib_inet_main" >&6; }
-if test "x$ac_cv_lib_inet_main" = xyes
-then :
- LIBS="$LIBS -linet"
+echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5
+echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6
+if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then
+ tcl_ok=yes
+else
+ tcl_ok=no
fi
- ac_fn_c_check_header_compile "$LINENO" "net/errno.h" "ac_cv_header_net_errno_h" "$ac_includes_default"
-if test "x$ac_cv_header_net_errno_h" = xyes
-then :
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -pthread"
+ else
+ TCL_THREADS=0
+ { echo "$as_me:$LINENO: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&5
+echo "$as_me: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&2;}
+ fi
+ fi
+ fi
+ fi
+ # Does the pthread-implementation provide
+ # 'pthread_attr_setstacksize' ?
-printf "%s\n" "#define HAVE_NET_ERRNO_H 1" >>confdefs.h
+ ac_saved_libs=$LIBS
+ LIBS="$LIBS $THREADS_LIBS"
-fi
+for ac_func in pthread_attr_setstacksize pthread_atfork
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
- #--------------------------------------------------------------------
- # Check for the existence of the -lsocket and -lnsl libraries.
- # The order here is important, so that they end up in the right
- # order in the command line generated by make. Here are some
- # special considerations:
- # 1. Use "connect" and "accept" to check for -lsocket, and
- # "gethostbyname" to check for -lnsl.
- # 2. Use each function name only once: can't redo a check because
- # autoconf caches the results of the last check and won't redo it.
- # 3. Use -lnsl and -lsocket only if they supply procedures that
- # aren't already present in the normal libraries. This is because
- # IRIX 5.2 has libraries, but they aren't needed and they're
- # bogus: they goof up name resolution if used.
- # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
- # To get around this problem, check for both libraries together
- # if -lsocket doesn't work by itself.
- #--------------------------------------------------------------------
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
- tcl_checkBoth=0
- ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect"
-if test "x$ac_cv_func_connect" = xyes
-then :
- tcl_checkSocket=0
-else case e in #(
- e) tcl_checkSocket=1 ;;
-esac
-fi
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
- if test "$tcl_checkSocket" = 1; then
- ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt"
-if test "x$ac_cv_func_setsockopt" = xyes
-then :
-
-else case e in #(
- e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5
-printf %s "checking for setsockopt in -lsocket... " >&6; }
-if test ${ac_cv_lib_socket_setsockopt+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+#undef $ac_func
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-char setsockopt (void);
+
int
-main (void)
+main ()
{
-return setsockopt ();
+return f != $ac_func;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- ac_cv_lib_socket_setsockopt=yes
-else case e in #(
- e) ac_cv_lib_socket_setsockopt=no ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5
-printf "%s\n" "$ac_cv_lib_socket_setsockopt" >&6; }
-if test "x$ac_cv_lib_socket_setsockopt" = xyes
-then :
- LIBS="$LIBS -lsocket"
-else case e in #(
- e) tcl_checkBoth=1 ;;
-esac
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
- ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
- fi
- if test "$tcl_checkBoth" = 1; then
- tk_oldLibs=$LIBS
- LIBS="$LIBS -lsocket -lnsl"
- ac_fn_c_check_func "$LINENO" "accept" "ac_cv_func_accept"
-if test "x$ac_cv_func_accept" = xyes
-then :
- tcl_checkNsl=0
-else case e in #(
- e) LIBS=$tk_oldLibs ;;
-esac
fi
+done
- fi
- ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
-if test "x$ac_cv_func_gethostbyname" = xyes
-then :
-
-else case e in #(
- e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
-printf %s "checking for gethostbyname in -lnsl... " >&6; }
-if test ${ac_cv_lib_nsl_gethostbyname+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for pthread_attr_get_np" >&5
+echo $ECHO_N "checking for pthread_attr_get_np... $ECHO_C" >&6
+if test "${ac_cv_func_pthread_attr_get_np+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define pthread_attr_get_np to an innocuous variant, in case <limits.h> declares pthread_attr_get_np.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define pthread_attr_get_np innocuous_pthread_attr_get_np
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char pthread_attr_get_np (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
+#undef pthread_attr_get_np
+
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pthread_attr_get_np ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_pthread_attr_get_np) || defined (__stub___pthread_attr_get_np)
+choke me
+#else
+char (*f) () = pthread_attr_get_np;
+#endif
+#ifdef __cplusplus
+}
#endif
-char gethostbyname (void);
+
int
-main (void)
+main ()
{
-return gethostbyname ();
+return f != pthread_attr_get_np;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- ac_cv_lib_nsl_gethostbyname=yes
-else case e in #(
- e) ac_cv_lib_nsl_gethostbyname=no ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_pthread_attr_get_np=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_pthread_attr_get_np=no
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
-printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test "x$ac_cv_lib_nsl_gethostbyname" = xyes
-then :
- LIBS="$LIBS -lnsl"
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
- ;;
-esac
+echo "$as_me:$LINENO: result: $ac_cv_func_pthread_attr_get_np" >&5
+echo "${ECHO_T}$ac_cv_func_pthread_attr_get_np" >&6
+if test $ac_cv_func_pthread_attr_get_np = yes; then
+ tcl_ok=yes
+else
+ tcl_ok=no
fi
+ if test $tcl_ok = yes ; then
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTHREAD_ATTR_GET_NP 1
+_ACEOF
-printf "%s\n" "#define _REENTRANT 1" >>confdefs.h
+ echo "$as_me:$LINENO: checking for pthread_attr_get_np declaration" >&5
+echo $ECHO_N "checking for pthread_attr_get_np declaration... $ECHO_C" >&6
+if test "${tcl_cv_grep_pthread_attr_get_np+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <pthread.h>
-printf "%s\n" "#define _THREAD_SAFE 1" >>confdefs.h
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pthread_attr_get_np" >/dev/null 2>&1; then
+ tcl_cv_grep_pthread_attr_get_np=present
+else
+ tcl_cv_grep_pthread_attr_get_np=missing
+fi
+rm -f conftest*
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5
-printf %s "checking for pthread_mutex_init in -lpthread... " >&6; }
-if test ${ac_cv_lib_pthread_pthread_mutex_init+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_grep_pthread_attr_get_np" >&5
+echo "${ECHO_T}$tcl_cv_grep_pthread_attr_get_np" >&6
+ if test $tcl_cv_grep_pthread_attr_get_np = missing ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define ATTRGETNP_NOT_DECLARED 1
+_ACEOF
+
+ fi
+ else
+ echo "$as_me:$LINENO: checking for pthread_getattr_np" >&5
+echo $ECHO_N "checking for pthread_getattr_np... $ECHO_C" >&6
+if test "${ac_cv_func_pthread_getattr_np+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define pthread_getattr_np to an innocuous variant, in case <limits.h> declares pthread_getattr_np.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define pthread_getattr_np innocuous_pthread_getattr_np
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char pthread_getattr_np (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef pthread_getattr_np
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pthread_getattr_np ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_pthread_getattr_np) || defined (__stub___pthread_getattr_np)
+choke me
+#else
+char (*f) () = pthread_getattr_np;
+#endif
+#ifdef __cplusplus
+}
#endif
-char pthread_mutex_init (void);
+
int
-main (void)
+main ()
{
-return pthread_mutex_init ();
+return f != pthread_getattr_np;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- ac_cv_lib_pthread_pthread_mutex_init=yes
-else case e in #(
- e) ac_cv_lib_pthread_pthread_mutex_init=no ;;
-esac
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_pthread_getattr_np=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_pthread_getattr_np=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5
-printf "%s\n" "$ac_cv_lib_pthread_pthread_mutex_init" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes
-then :
+echo "$as_me:$LINENO: result: $ac_cv_func_pthread_getattr_np" >&5
+echo "${ECHO_T}$ac_cv_func_pthread_getattr_np" >&6
+if test $ac_cv_func_pthread_getattr_np = yes; then
tcl_ok=yes
-else case e in #(
- e) tcl_ok=no ;;
-esac
+else
+ tcl_ok=no
fi
- if test "$tcl_ok" = "no"; then
- # Check a little harder for __pthread_mutex_init in the same
- # library, as some systems hide it there until pthread.h is
- # defined. We could alternatively do an AC_TRY_COMPILE with
- # pthread.h, but that will work with libpthread really doesn't
- # exist, like AIX 4.2. [Bug: 4359]
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5
-printf %s "checking for __pthread_mutex_init in -lpthread... " >&6; }
-if test ${ac_cv_lib_pthread___pthread_mutex_init+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ if test $tcl_ok = yes ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTHREAD_GETATTR_NP 1
+_ACEOF
+
+ echo "$as_me:$LINENO: checking for pthread_getattr_np declaration" >&5
+echo $ECHO_N "checking for pthread_getattr_np declaration... $ECHO_C" >&6
+if test "${tcl_cv_grep_pthread_getattr_np+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+#include <pthread.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pthread_getattr_np" >/dev/null 2>&1; then
+ tcl_cv_grep_pthread_getattr_np=present
+else
+ tcl_cv_grep_pthread_getattr_np=missing
+fi
+rm -f conftest*
+
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_grep_pthread_getattr_np" >&5
+echo "${ECHO_T}$tcl_cv_grep_pthread_getattr_np" >&6
+ if test $tcl_cv_grep_pthread_getattr_np = missing ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define GETATTRNP_NOT_DECLARED 1
+_ACEOF
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
+ fi
+ fi
+ fi
+ if test $tcl_ok = no; then
+ # Darwin thread stacksize API
+
+for ac_func in pthread_get_stacksize_np
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
#endif
-char __pthread_mutex_init (void);
+#ifdef __cplusplus
+}
+#endif
+
int
-main (void)
+main ()
{
-return __pthread_mutex_init ();
+return f != $ac_func;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- ac_cv_lib_pthread___pthread_mutex_init=yes
-else case e in #(
- e) ac_cv_lib_pthread___pthread_mutex_init=no ;;
-esac
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5
-printf "%s\n" "$ac_cv_lib_pthread___pthread_mutex_init" >&6; }
-if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes
-then :
- tcl_ok=yes
-else case e in #(
- e) tcl_ok=no ;;
-esac
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
fi
+done
+ fi
+ LIBS=$ac_saved_libs
+ else
+ TCL_THREADS=0
fi
+ # Do checking message here to not mess up interleaved configure output
+ echo "$as_me:$LINENO: checking for building with threads" >&5
+echo $ECHO_N "checking for building with threads... $ECHO_C" >&6
+ if test "${TCL_THREADS}" = 1; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TCL_THREADS 1
+_ACEOF
- if test "$tcl_ok" = "yes"; then
- # The space is needed
- THREADS_LIBS=" -lpthread"
+ if test "${tcl_threaded_core}" = 1; then
+ echo "$as_me:$LINENO: result: yes (threaded core)" >&5
+echo "${ECHO_T}yes (threaded core)" >&6
+ else
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ fi
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5
-printf %s "checking for pthread_mutex_init in -lpthreads... " >&6; }
-if test ${ac_cv_lib_pthreads_pthread_mutex_init+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthreads $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: result: no (default)" >&5
+echo "${ECHO_T}no (default)" >&6
+ fi
+
+
+
+
+#------------------------------------------------------------------------
+# Embedded configuration information, encoding to use for the values, TIP #59
+#------------------------------------------------------------------------
+
+
+
+# Check whether --with-encoding or --without-encoding was given.
+if test "${with_encoding+set}" = set; then
+ withval="$with_encoding"
+ with_tcencoding=${withval}
+fi;
+
+ if test x"${with_tcencoding}" != x ; then
+
+cat >>confdefs.h <<_ACEOF
+#define TCL_CFGVAL_ENCODING "${with_tcencoding}"
+_ACEOF
+
+ else
+
+cat >>confdefs.h <<\_ACEOF
+#define TCL_CFGVAL_ENCODING "iso8859-1"
+_ACEOF
+
+ fi
+
+
+#--------------------------------------------------------------------
+# Look for libraries that we will need when compiling the Tcl shell
+#--------------------------------------------------------------------
+
+
+ #--------------------------------------------------------------------
+ # On a few very rare systems, all of the libm.a stuff is
+ # already in libc.a. Set compiler flags accordingly.
+ # Also, Linux requires the "ieee" library for math to work
+ # right (and it must appear before "-lm").
+ #--------------------------------------------------------------------
+
+ echo "$as_me:$LINENO: checking for sin" >&5
+echo $ECHO_N "checking for sin... $ECHO_C" >&6
+if test "${ac_cv_func_sin+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define sin to an innocuous variant, in case <limits.h> declares sin.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define sin innocuous_sin
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char sin (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef sin
+
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
+{
#endif
-char pthread_mutex_init (void);
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char sin ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_sin) || defined (__stub___sin)
+choke me
+#else
+char (*f) () = sin;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
int
-main (void)
+main ()
{
-return pthread_mutex_init ();
+return f != sin;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- ac_cv_lib_pthreads_pthread_mutex_init=yes
-else case e in #(
- e) ac_cv_lib_pthreads_pthread_mutex_init=no ;;
-esac
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_sin=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_sin=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5
-printf "%s\n" "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; }
-if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes
-then :
- _ok=yes
-else case e in #(
- e) tcl_ok=no ;;
-esac
+echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5
+echo "${ECHO_T}$ac_cv_func_sin" >&6
+if test $ac_cv_func_sin = yes; then
+ MATH_LIBS=""
+else
+ MATH_LIBS="-lm"
fi
- if test "$tcl_ok" = "yes"; then
- # The space is needed
- THREADS_LIBS=" -lpthreads"
- else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5
-printf %s "checking for pthread_mutex_init in -lc... " >&6; }
-if test ${ac_cv_lib_c_pthread_mutex_init+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for main in -lieee" >&5
+echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6
+if test "${ac_cv_lib_ieee_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lieee $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_mutex_init (void);
+
int
-main (void)
+main ()
{
-return pthread_mutex_init ();
+main ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- ac_cv_lib_c_pthread_mutex_init=yes
-else case e in #(
- e) ac_cv_lib_c_pthread_mutex_init=no ;;
-esac
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_ieee_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ieee_main=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5
-printf "%s\n" "$ac_cv_lib_c_pthread_mutex_init" >&6; }
-if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes
-then :
- tcl_ok=yes
-else case e in #(
- e) tcl_ok=no ;;
-esac
+echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5
+echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6
+if test $ac_cv_lib_ieee_main = yes; then
+ MATH_LIBS="-lieee $MATH_LIBS"
fi
- if test "$tcl_ok" = "no"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5
-printf %s "checking for pthread_mutex_init in -lc_r... " >&6; }
-if test ${ac_cv_lib_c_r_pthread_mutex_init+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc_r $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+ #--------------------------------------------------------------------
+ # Interactive UNIX requires -linet instead of -lsocket, plus it
+ # needs net/errno.h to define the socket-related error codes.
+ #--------------------------------------------------------------------
+
+ echo "$as_me:$LINENO: checking for main in -linet" >&5
+echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6
+if test "${ac_cv_lib_inet_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-linet $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_mutex_init (void);
+
int
-main (void)
+main ()
{
-return pthread_mutex_init ();
+main ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- ac_cv_lib_c_r_pthread_mutex_init=yes
-else case e in #(
- e) ac_cv_lib_c_r_pthread_mutex_init=no ;;
-esac
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_inet_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_inet_main=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5
-printf "%s\n" "$ac_cv_lib_c_r_pthread_mutex_init" >&6; }
-if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes
-then :
- tcl_ok=yes
-else case e in #(
- e) tcl_ok=no ;;
-esac
+echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5
+echo "${ECHO_T}$ac_cv_lib_inet_main" >&6
+if test $ac_cv_lib_inet_main = yes; then
+ LIBS="$LIBS -linet"
fi
- if test "$tcl_ok" = "yes"; then
- # The space is needed
- THREADS_LIBS=" -pthread"
- else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how to find pthread lib on your system - you must edit the LIBS in the Makefile..." >&5
-printf "%s\n" "$as_me: WARNING: Don't know how to find pthread lib on your system - you must edit the LIBS in the Makefile..." >&2;}
- fi
- fi
- fi
- fi
-
- # Does the pthread-implementation provide
- # 'pthread_attr_setstacksize' ?
-
- ac_saved_libs=$LIBS
- LIBS="$LIBS $THREADS_LIBS"
- ac_fn_c_check_func "$LINENO" "pthread_attr_setstacksize" "ac_cv_func_pthread_attr_setstacksize"
-if test "x$ac_cv_func_pthread_attr_setstacksize" = xyes
-then :
- printf "%s\n" "#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1" >>confdefs.h
+ if test "${ac_cv_header_net_errno_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for net/errno.h" >&5
+echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6
+if test "${ac_cv_header_net_errno_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5
+echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking net/errno.h usability" >&5
+echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <net/errno.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_header_compiler=no
fi
-ac_fn_c_check_func "$LINENO" "pthread_atfork" "ac_cv_func_pthread_atfork"
-if test "x$ac_cv_func_pthread_atfork" = xyes
-then :
- printf "%s\n" "#define HAVE_PTHREAD_ATFORK 1" >>confdefs.h
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+# Is the header present?
+echo "$as_me:$LINENO: checking net/errno.h presence" >&5
+echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <net/errno.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- LIBS=$ac_saved_libs
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
- # TIP #509
- ac_fn_check_decl "$LINENO" "PTHREAD_MUTEX_RECURSIVE" "ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE" "#include <pthread.h>
-" "$ac_c_undeclared_builtin_options" "CFLAGS"
-if test "x$ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE" = xyes
-then :
- ac_have_decl=1
-else case e in #(
- e) ac_have_decl=0 ;;
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
esac
+echo "$as_me:$LINENO: checking for net/errno.h" >&5
+echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6
+if test "${ac_cv_header_net_errno_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_net_errno_h=$ac_header_preproc
fi
-printf "%s\n" "#define HAVE_DECL_PTHREAD_MUTEX_RECURSIVE $ac_have_decl" >>confdefs.h
-if test $ac_have_decl = 1
-then :
- tcl_ok=yes
-else case e in #(
- e) tcl_ok=no ;;
-esac
+echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5
+echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6
+
fi
+if test $ac_cv_header_net_errno_h = yes; then
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_NET_ERRNO_H 1
+_ACEOF
-# Add the threads support libraries
-LIBS="$LIBS$THREADS_LIBS"
+fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5
-printf %s "checking how to build libraries... " >&6; }
- # Check whether --enable-shared was given.
-if test ${enable_shared+y}
-then :
- enableval=$enable_shared; tcl_ok=$enableval
-else case e in #(
- e) tcl_ok=yes ;;
-esac
-fi
- if test "$tcl_ok" = "yes" ; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared" >&5
-printf "%s\n" "shared" >&6; }
- SHARED_BUILD=1
- else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5
-printf "%s\n" "static" >&6; }
- SHARED_BUILD=0
+ #--------------------------------------------------------------------
+ # Check for the existence of the -lsocket and -lnsl libraries.
+ # The order here is important, so that they end up in the right
+ # order in the command line generated by make. Here are some
+ # special considerations:
+ # 1. Use "connect" and "accept" to check for -lsocket, and
+ # "gethostbyname" to check for -lnsl.
+ # 2. Use each function name only once: can't redo a check because
+ # autoconf caches the results of the last check and won't redo it.
+ # 3. Use -lnsl and -lsocket only if they supply procedures that
+ # aren't already present in the normal libraries. This is because
+ # IRIX 5.2 has libraries, but they aren't needed and they're
+ # bogus: they goof up name resolution if used.
+ # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
+ # To get around this problem, check for both libraries together
+ # if -lsocket doesn't work by itself.
+ #--------------------------------------------------------------------
-printf "%s\n" "#define STATIC_BUILD 1" >>confdefs.h
+ tcl_checkBoth=0
+ echo "$as_me:$LINENO: checking for connect" >&5
+echo $ECHO_N "checking for connect... $ECHO_C" >&6
+if test "${ac_cv_func_connect+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define connect to an innocuous variant, in case <limits.h> declares connect.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define connect innocuous_connect
- fi
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char connect (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+#undef connect
-#--------------------------------------------------------------------
-# Look for a native installed tclsh binary (if available)
-# If one cannot be found then use the binary we build (fails for
-# cross compiling). This is used for NATIVE_TCLSH in Makefile.
-#--------------------------------------------------------------------
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char connect ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_connect) || defined (__stub___connect)
+choke me
+#else
+char (*f) () = connect;
+#endif
+#ifdef __cplusplus
+}
+#endif
+int
+main ()
+{
+return f != connect;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_connect=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5
-printf %s "checking for tclsh... " >&6; }
- if test ${ac_cv_path_tclsh+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- search_path=`echo ${PATH} | sed -e 's/:/ /g'`
- for dir in $search_path ; do
- for j in `ls -r $dir/tclsh[8-9]* 2> /dev/null` \
- `ls -r $dir/tclsh* 2> /dev/null` ; do
- if test x"$ac_cv_path_tclsh" = x ; then
- if test -f "$j" ; then
- ac_cv_path_tclsh=$j
- break
- fi
- fi
- done
- done
- ;;
-esac
+ac_cv_func_connect=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
+echo "${ECHO_T}$ac_cv_func_connect" >&6
+if test $ac_cv_func_connect = yes; then
+ tcl_checkSocket=0
+else
+ tcl_checkSocket=1
fi
+ if test "$tcl_checkSocket" = 1; then
+ echo "$as_me:$LINENO: checking for setsockopt" >&5
+echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6
+if test "${ac_cv_func_setsockopt+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define setsockopt to an innocuous variant, in case <limits.h> declares setsockopt.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define setsockopt innocuous_setsockopt
- if test -f "$ac_cv_path_tclsh" ; then
- TCLSH_PROG="$ac_cv_path_tclsh"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TCLSH_PROG" >&5
-printf "%s\n" "$TCLSH_PROG" >&6; }
- else
- # It is not an error if an installed version of Tcl can't be located.
- TCLSH_PROG=""
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: No tclsh found on PATH" >&5
-printf "%s\n" "No tclsh found on PATH" >&6; }
- fi
-
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char setsockopt (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
-if test "$TCLSH_PROG" = ""; then
- TCLSH_PROG='./${TCL_EXE}'
-fi
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
-#------------------------------------------------------------------------
-# Add stuff for zlib
-#------------------------------------------------------------------------
+#undef setsockopt
-zlib_ok=yes
-ac_fn_c_check_header_compile "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_zlib_h" = xyes
-then :
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char setsockopt ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_setsockopt) || defined (__stub___setsockopt)
+choke me
+#else
+char (*f) () = setsockopt;
+#endif
+#ifdef __cplusplus
+}
+#endif
- ac_fn_c_check_type "$LINENO" "gz_header" "ac_cv_type_gz_header" "#include <zlib.h>
-"
-if test "x$ac_cv_type_gz_header" = xyes
-then :
+int
+main ()
+{
+return f != setsockopt;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_setsockopt=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-else case e in #(
- e) zlib_ok=no ;;
-esac
+ac_cv_func_setsockopt=no
fi
-
-else case e in #(
- e)
- zlib_ok=no ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-
-if test $zlib_ok = yes
-then :
-
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing deflateSetHeader" >&5
-printf %s "checking for library containing deflateSetHeader... " >&6; }
-if test ${ac_cv_search_deflateSetHeader+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5
+echo "${ECHO_T}$ac_cv_func_setsockopt" >&6
+if test $ac_cv_func_setsockopt = yes; then
+ :
+else
+ echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5
+echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6
+if test "${ac_cv_lib_socket_setsockopt+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
-char deflateSetHeader (void);
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char setsockopt ();
int
-main (void)
+main ()
{
-return deflateSetHeader ();
+setsockopt ();
;
return 0;
}
_ACEOF
-for ac_lib in '' z
-do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"
-then :
- ac_cv_search_deflateSetHeader=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext
- if test ${ac_cv_search_deflateSetHeader+y}
-then :
- break
-fi
-done
-if test ${ac_cv_search_deflateSetHeader+y}
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_socket_setsockopt=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-else case e in #(
- e) ac_cv_search_deflateSetHeader=no ;;
-esac
+ac_cv_lib_socket_setsockopt=no
fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_deflateSetHeader" >&5
-printf "%s\n" "$ac_cv_search_deflateSetHeader" >&6; }
-ac_res=$ac_cv_search_deflateSetHeader
-if test "$ac_res" != no
-then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-else case e in #(
- e)
- zlib_ok=no
- ;;
-esac
+echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6
+if test $ac_cv_lib_socket_setsockopt = yes; then
+ LIBS="$LIBS -lsocket"
+else
+ tcl_checkBoth=1
fi
fi
-if test $zlib_ok = no
-then :
- ZLIB_OBJS=\${ZLIB_OBJS}
+ fi
+ if test "$tcl_checkBoth" = 1; then
+ tk_oldLibs=$LIBS
+ LIBS="$LIBS -lsocket -lnsl"
+ echo "$as_me:$LINENO: checking for accept" >&5
+echo $ECHO_N "checking for accept... $ECHO_C" >&6
+if test "${ac_cv_func_accept+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define accept to an innocuous variant, in case <limits.h> declares accept.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define accept innocuous_accept
- ZLIB_SRCS=\${ZLIB_SRCS}
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char accept (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
- ZLIB_INCLUDE=-I\${ZLIB_DIR}
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+#undef accept
-fi
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char accept ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_accept) || defined (__stub___accept)
+choke me
+#else
+char (*f) () = accept;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != accept;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_accept=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-printf "%s\n" "#define HAVE_ZLIB 1" >>confdefs.h
+ac_cv_func_accept=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5
+echo "${ECHO_T}$ac_cv_func_accept" >&6
+if test $ac_cv_func_accept = yes; then
+ tcl_checkNsl=0
+else
+ LIBS=$tk_oldLibs
+fi
+ fi
+ echo "$as_me:$LINENO: checking for gethostbyname" >&5
+echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
+if test "${ac_cv_func_gethostbyname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define gethostbyname innocuous_gethostbyname
-#------------------------------------------------------------------------
-# Add stuff for libtommath
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char gethostbyname (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
-libtommath_ok=yes
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
-# Check whether --with-system-libtommath was given.
-if test ${with_system_libtommath+y}
-then :
- withval=$with_system_libtommath; libtommath_ok=${withval}
-fi
+#undef gethostbyname
-if test x"${libtommath_ok}" = x -o x"${libtommath_ok}" != xno; then
- ac_fn_c_check_header_compile "$LINENO" "tommath.h" "ac_cv_header_tommath_h" "$ac_includes_default"
-if test "x$ac_cv_header_tommath_h" = xyes
-then :
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
+choke me
+#else
+char (*f) () = gethostbyname;
+#endif
+#ifdef __cplusplus
+}
+#endif
- ac_fn_c_check_type "$LINENO" "mp_int" "ac_cv_type_mp_int" "#include <tommath.h>
-"
-if test "x$ac_cv_type_mp_int" = xyes
-then :
+int
+main ()
+{
+return f != gethostbyname;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_gethostbyname=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-else case e in #(
- e) libtommath_ok=no ;;
-esac
+ac_cv_func_gethostbyname=no
fi
-
-else case e in #(
- e)
- libtommath_ok=no ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-
- if test $libtommath_ok = yes
-then :
-
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mp_log_u32 in -ltommath" >&5
-printf %s "checking for mp_log_u32 in -ltommath... " >&6; }
-if test ${ac_cv_lib_tommath_mp_log_u32+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltommath $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
+if test $ac_cv_func_gethostbyname = yes; then
+ :
+else
+ echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
-char mp_log_u32 (void);
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname ();
int
-main (void)
+main ()
{
-return mp_log_u32 ();
+gethostbyname ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- ac_cv_lib_tommath_mp_log_u32=yes
-else case e in #(
- e) ac_cv_lib_tommath_mp_log_u32=no ;;
-esac
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_nsl_gethostbyname=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_nsl_gethostbyname=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tommath_mp_log_u32" >&5
-printf "%s\n" "$ac_cv_lib_tommath_mp_log_u32" >&6; }
-if test "x$ac_cv_lib_tommath_mp_log_u32" = xyes
-then :
- MATH_LIBS="$MATH_LIBS -ltommath"
-else case e in #(
- e)
- libtommath_ok=no ;;
-esac
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
+if test $ac_cv_lib_nsl_gethostbyname = yes; then
+ LIBS="$LIBS -lnsl"
fi
fi
-fi
-if test $libtommath_ok = yes
-then :
- TCL_PC_REQUIRES_PRIVATE='libtommath >= 1.2.0,'
- TCL_PC_CFLAGS='-DTCL_WITH_EXTERNAL_TOMMATH'
+# Add the threads support libraries
+LIBS="$LIBS$THREADS_LIBS"
-printf "%s\n" "#define TCL_WITH_EXTERNAL_TOMMATH 1" >>confdefs.h
+ echo "$as_me:$LINENO: checking how to build libraries" >&5
+echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6
+ # Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ tcl_ok=$enableval
+else
+ tcl_ok=yes
+fi;
-else case e in #(
- e)
- TOMMATH_OBJS=\${TOMMATH_OBJS}
+ if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ tcl_ok=$enableval
+ else
+ tcl_ok=yes
+ fi
- TOMMATH_SRCS=\${TOMMATH_SRCS}
+ if test "$tcl_ok" = "yes" ; then
+ echo "$as_me:$LINENO: result: shared" >&5
+echo "${ECHO_T}shared" >&6
+ SHARED_BUILD=1
+ else
+ echo "$as_me:$LINENO: result: static" >&5
+echo "${ECHO_T}static" >&6
+ SHARED_BUILD=0
- TOMMATH_INCLUDE=-I\${TOMMATH_DIR}
+cat >>confdefs.h <<\_ACEOF
+#define STATIC_BUILD 1
+_ACEOF
+
+ fi
- ;;
-esac
-fi
#--------------------------------------------------------------------
# The statements below define a collection of compile flags. This
@@ -5331,103 +6310,79 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_RANLIB+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -n "$RANLIB"; then
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
-fi ;;
-esac
+fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-printf "%s\n" "$RANLIB" >&6; }
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
fi
if test -z "$ac_cv_prog_RANLIB"; then
ac_ct_RANLIB=$RANLIB
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_ac_ct_RANLIB+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -n "$ac_ct_RANLIB"; then
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
-fi ;;
-esac
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-printf "%s\n" "$ac_ct_RANLIB" >&6; }
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
+ RANLIB=$ac_ct_RANLIB
else
RANLIB="$ac_cv_prog_RANLIB"
fi
@@ -5436,199 +6391,240 @@ fi
# Step 0.a: Enable 64 bit support?
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5
-printf %s "checking if 64bit support is requested... " >&6; }
- # Check whether --enable-64bit was given.
-if test ${enable_64bit+y}
-then :
- enableval=$enable_64bit; do64bit=$enableval
-else case e in #(
- e) do64bit=no ;;
-esac
-fi
-
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5
-printf "%s\n" "$do64bit" >&6; }
+ echo "$as_me:$LINENO: checking if 64bit support is requested" >&5
+echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6
+ # Check whether --enable-64bit or --disable-64bit was given.
+if test "${enable_64bit+set}" = set; then
+ enableval="$enable_64bit"
+ do64bit=$enableval
+else
+ do64bit=no
+fi;
+ echo "$as_me:$LINENO: result: $do64bit" >&5
+echo "${ECHO_T}$do64bit" >&6
# Step 0.b: Enable Solaris 64 bit VIS support?
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5
-printf %s "checking if 64bit Sparc VIS support is requested... " >&6; }
- # Check whether --enable-64bit-vis was given.
-if test ${enable_64bit_vis+y}
-then :
- enableval=$enable_64bit_vis; do64bitVIS=$enableval
-else case e in #(
- e) do64bitVIS=no ;;
-esac
-fi
-
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5
-printf "%s\n" "$do64bitVIS" >&6; }
+ echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5
+echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6
+ # Check whether --enable-64bit-vis or --disable-64bit-vis was given.
+if test "${enable_64bit_vis+set}" = set; then
+ enableval="$enable_64bit_vis"
+ do64bitVIS=$enableval
+else
+ do64bitVIS=no
+fi;
+ echo "$as_me:$LINENO: result: $do64bitVIS" >&5
+echo "${ECHO_T}$do64bitVIS" >&6
# Force 64bit on with VIS
- if test "$do64bitVIS" = "yes"
-then :
+ if test "$do64bitVIS" = "yes"; then
do64bit=yes
fi
+
# Step 0.c: Check if visibility support is available. Do this here so
# that platform specific alternatives can be used below if this fails.
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5
-printf %s "checking if compiler supports visibility \"hidden\"... " >&6; }
-if test ${tcl_cv_cc_visibility_hidden+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
+ echo "$as_me:$LINENO: checking if compiler supports visibility \"hidden\"" >&5
+echo $ECHO_N "checking if compiler supports visibility \"hidden\"... $ECHO_C" >&6
+if test "${tcl_cv_cc_visibility_hidden+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
extern __attribute__((__visibility__("hidden"))) void f(void);
void f(void) {}
int
-main (void)
+main ()
{
f();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_cc_visibility_hidden=yes
-else case e in #(
- e) tcl_cv_cc_visibility_hidden=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_cc_visibility_hidden=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
- CFLAGS=$hold_cflags ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5
-printf "%s\n" "$tcl_cv_cc_visibility_hidden" >&6; }
- if test $tcl_cv_cc_visibility_hidden = yes
-then :
-
+echo "$as_me:$LINENO: result: $tcl_cv_cc_visibility_hidden" >&5
+echo "${ECHO_T}$tcl_cv_cc_visibility_hidden" >&6
+ if test $tcl_cv_cc_visibility_hidden = yes; then
-printf "%s\n" "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h
-
-printf "%s\n" "#define HAVE_HIDDEN 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define MODULE_SCOPE extern __attribute__((__visibility__("hidden")))
+_ACEOF
fi
- # Step 0.d: Disable -rpath support?
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5
-printf %s "checking if rpath support is requested... " >&6; }
- # Check whether --enable-rpath was given.
-if test ${enable_rpath+y}
-then :
- enableval=$enable_rpath; doRpath=$enableval
-else case e in #(
- e) doRpath=yes ;;
-esac
-fi
+ # Step 0.d: Disable -rpath support?
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5
-printf "%s\n" "$doRpath" >&6; }
+ echo "$as_me:$LINENO: checking if rpath support is requested" >&5
+echo $ECHO_N "checking if rpath support is requested... $ECHO_C" >&6
+ # Check whether --enable-rpath or --disable-rpath was given.
+if test "${enable_rpath+set}" = set; then
+ enableval="$enable_rpath"
+ doRpath=$enableval
+else
+ doRpath=yes
+fi;
+ echo "$as_me:$LINENO: result: $doRpath" >&5
+echo "${ECHO_T}$doRpath" >&6
# Step 1: set the variable "system" to hold the name and version number
# for the system.
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking system version" >&5
-printf %s "checking system version... " >&6; }
-if test ${tcl_cv_sys_version+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- if test "${TEA_PLATFORM}" = "windows" ; then
- tcl_cv_sys_version=windows
+ echo "$as_me:$LINENO: checking system version" >&5
+echo $ECHO_N "checking system version... $ECHO_C" >&6
+if test "${tcl_cv_sys_version+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ if test -f /usr/lib/NextStep/software_version; then
+ tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
else
tcl_cv_sys_version=`uname -s`-`uname -r`
if test "$?" -ne 0 ; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5
-printf "%s\n" "$as_me: WARNING: can't find uname command" >&2;}
+ { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5
+echo "$as_me: WARNING: can't find uname command" >&2;}
tcl_cv_sys_version=unknown
else
+ # Special check for weird MP-RAS system (uname returns weird
+ # results, and the version is kept in special file).
+
+ if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
+ tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid`
+ fi
if test "`uname -s`" = "AIX" ; then
tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
fi
- if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then
- tcl_cv_sys_version=NetBSD-Debian
- fi
fi
fi
- ;;
-esac
+
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5
-printf "%s\n" "$tcl_cv_sys_version" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5
+echo "${ECHO_T}$tcl_cv_sys_version" >&6
system=$tcl_cv_sys_version
# Step 2: check for existence of -ldl library. This is needed because
# Linux can use either -ldl or -ldld for dynamic loading.
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-printf %s "checking for dlopen in -ldl... " >&6; }
-if test ${ac_cv_lib_dl_dlopen+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
-char dlopen (void);
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
int
-main (void)
+main ()
{
-return dlopen ();
+dlopen ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_dl_dlopen=yes
-else case e in #(
- e) ac_cv_lib_dl_dlopen=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes
-then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
have_dl=yes
-else case e in #(
- e) have_dl=no ;;
-esac
+else
+ have_dl=no
fi
# Require ranlib early so we can override it in special cases below.
+ if test x"${SHLIB_VERSION}" = x; then
+ SHLIB_VERSION="1.0"
+fi
+
@@ -5647,127 +6643,90 @@ fi
ECHO_VERSION='`echo ${VERSION}`'
TCL_LIB_VERSIONS_OK=ok
CFLAGS_DEBUG=-g
- if test "$GCC" = yes
-then :
-
- CFLAGS_OPTIMIZE=-O2
- CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith"
- case "${CC}" in
- *++|*++-*)
- ;;
- *)
- CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers"
- ;;
- esac
+ CFLAGS_OPTIMIZE=-O
+ if test "$GCC" = yes; then
+ CFLAGS_WARNING="-Wall"
-else case e in #(
- e)
- CFLAGS_OPTIMIZE=-O
- CFLAGS_WARNING=""
- ;;
-esac
+else
+ CFLAGS_WARNING=""
fi
+
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_AR+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -n "$AR"; then
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AR"; then
ac_cv_prog_AR="$AR" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AR="${ac_tool_prefix}ar"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
-fi ;;
-esac
+fi
fi
AR=$ac_cv_prog_AR
if test -n "$AR"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-printf "%s\n" "$AR" >&6; }
+ echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
fi
if test -z "$ac_cv_prog_AR"; then
ac_ct_AR=$AR
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_ac_ct_AR+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) if test -n "$ac_ct_AR"; then
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_AR"; then
ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_AR="ar"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
-fi ;;
-esac
+fi
fi
ac_ct_AR=$ac_cv_prog_ac_ct_AR
if test -n "$ac_ct_AR"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-printf "%s\n" "$ac_ct_AR" >&6; }
+ echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- if test "x$ac_ct_AR" = x; then
- AR=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_ct_AR
- fi
+ AR=$ac_ct_AR
else
AR="$ac_cv_prog_AR"
fi
@@ -5777,14 +6736,9 @@ fi
PLAT_OBJS=""
PLAT_SRCS=""
LDAIX_SRC=""
- if test "x${SHLIB_VERSION}" = x
-then :
- SHLIB_VERSION="1.0"
-fi
case $system in
AIX-*)
- if test "$GCC" != "yes"
-then :
+ if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then
# AIX requires the _r compiler when gcc isn't being used
case "${CC}" in
@@ -5796,10 +6750,11 @@ then :
CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'`
;;
esac
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5
-printf "%s\n" "Using $CC for compiling with threads" >&6; }
+ echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5
+echo "${ECHO_T}Using $CC for compiling with threads" >&6
fi
+
LIBS="$LIBS -lc"
SHLIB_CFLAGS=""
SHLIB_SUFFIX=".so"
@@ -5812,70 +6767,66 @@ fi
LDAIX_SRC='$(UNIX_DIR)/ldAix'
# Check to enable 64-bit flags for compiler/linker
- if test "$do64bit" = yes
-then :
+ if test "$do64bit" = yes; then
+
+ if test "$GCC" = yes; then
- if test "$GCC" = yes
-then :
+ { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5
+echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5
-printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
+else
-else case e in #(
- e)
do64bit_ok=yes
CFLAGS="$CFLAGS -q64"
LDFLAGS_ARCH="-q64"
RANLIB="${RANLIB} -X64"
AR="${AR} -X64"
SHLIB_LD_FLAGS="-b64"
- ;;
-esac
+
fi
+
fi
- if test "`uname -m`" = ia64
-then :
+
+ if test "`uname -m`" = ia64; then
# AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
# AIX-5 has dl* in libc.so
DL_LIBS=""
- if test "$GCC" = yes
-then :
+ if test "$GCC" = yes; then
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
-else case e in #(
- e)
+else
+
CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
- ;;
-esac
+
fi
+
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
-else case e in #(
- e)
- if test "$GCC" = yes
-then :
+else
+
+ if test "$GCC" = yes; then
SHLIB_LD='${CC} -shared -Wl,-bexpall'
-else case e in #(
- e)
+else
+
SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry"
LDFLAGS="$LDFLAGS -brtl"
- ;;
-esac
+
fi
+
SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
- ;;
-esac
+
fi
+
;;
BeOS*)
SHLIB_CFLAGS="-fPIC"
@@ -5889,51 +6840,71 @@ fi
# -lsocket, even if the network functions are in -lnet which
# is always linked to, for compatibility.
#-----------------------------------------------------------
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5
-printf %s "checking for inet_ntoa in -lbind... " >&6; }
-if test ${ac_cv_lib_bind_inet_ntoa+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
+ echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5
+echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6
+if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-lbind $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
-char inet_ntoa (void);
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char inet_ntoa ();
int
-main (void)
+main ()
{
-return inet_ntoa ();
+inet_ntoa ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_bind_inet_ntoa=yes
-else case e in #(
- e) ac_cv_lib_bind_inet_ntoa=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_bind_inet_ntoa=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5
-printf "%s\n" "$ac_cv_lib_bind_inet_ntoa" >&6; }
-if test "x$ac_cv_lib_bind_inet_ntoa" = xyes
-then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5
+echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6
+if test $ac_cv_lib_bind_inet_ntoa = yes; then
LIBS="$LIBS -lbind -lsocket"
fi
@@ -5957,23 +6928,27 @@ fi
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
- CYGWIN_*|MINGW32_*|MSYS_*)
- SHLIB_CFLAGS="-fno-common"
+ CYGWIN_*|MINGW32*)
+ SHLIB_CFLAGS=""
SHLIB_LD='${CC} -shared'
SHLIB_SUFFIX=".dll"
- DL_OBJS="tclLoadDl.o"
- PLAT_OBJS='${CYGWIN_OBJS}'
- PLAT_SRCS='${CYGWIN_SRCS}'
+ DL_OBJS="tclLoadDl.o tclWinError.o"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Cygwin version of gcc" >&5
-printf %s "checking for Cygwin version of gcc... " >&6; }
-if test ${ac_cv_cygwin+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ TCL_NEEDS_EXP_FILE=1
+ TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a'
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$@.a"
+ echo "$as_me:$LINENO: checking for Cygwin version of gcc" >&5
+echo $ECHO_N "checking for Cygwin version of gcc... $ECHO_C" >&6
+if test "${ac_cv_cygwin+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef __CYGWIN__
@@ -5981,34 +6956,62 @@ else case e in #(
#endif
int
-main (void)
+main ()
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_cygwin=no
-else case e in #(
- e) ac_cv_cygwin=yes ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_cygwin=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cygwin" >&5
-printf "%s\n" "$ac_cv_cygwin" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_cygwin" >&5
+echo "${ECHO_T}$ac_cv_cygwin" >&6
if test "$ac_cv_cygwin" = "no"; then
- as_fn_error $? "${CC} is not a cygwin compiler." "$LINENO" 5
+ { { echo "$as_me:$LINENO: error: ${CC} is not a cygwin compiler." >&5
+echo "$as_me: error: ${CC} is not a cygwin compiler." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ if test "x${TCL_THREADS}" = "x0"; then
+ { { echo "$as_me:$LINENO: error: CYGWIN compile is only supported with --enable-threads" >&5
+echo "$as_me: error: CYGWIN compile is only supported with --enable-threads" >&2;}
+ { (exit 1); exit 1; }; }
fi
do64bit_ok=yes
if test "x${SHARED_BUILD}" = "x1"; then
- echo "running cd ../win; ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32"
+ echo "running cd ${TCL_SRC_DIR}/win; ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args"
# The eval makes quoting arguments work.
- if cd ../win; eval ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32; cd ../unix
+ if cd ${TCL_SRC_DIR}/win; eval ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args; cd ../unix
then :
else
{ echo "configure: error: configure failed for ../win" 1>&2; exit 1; }
@@ -6029,54 +7032,74 @@ printf "%s\n" "$ac_cv_cygwin" >&6; }
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
SHLIB_CFLAGS="-fPIC"
SHLIB_SUFFIX=".so"
- SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared'
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
DL_OBJS="tclLoadDl.o"
DL_LIBS="-lroot"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5
-printf %s "checking for inet_ntoa in -lnetwork... " >&6; }
-if test ${ac_cv_lib_network_inet_ntoa+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
+ echo "$as_me:$LINENO: checking for inet_ntoa in -lnetwork" >&5
+echo $ECHO_N "checking for inet_ntoa in -lnetwork... $ECHO_C" >&6
+if test "${ac_cv_lib_network_inet_ntoa+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-lnetwork $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
-char inet_ntoa (void);
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char inet_ntoa ();
int
-main (void)
+main ()
{
-return inet_ntoa ();
+inet_ntoa ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_network_inet_ntoa=yes
-else case e in #(
- e) ac_cv_lib_network_inet_ntoa=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_network_inet_ntoa=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5
-printf "%s\n" "$ac_cv_lib_network_inet_ntoa" >&6; }
-if test "x$ac_cv_lib_network_inet_ntoa" = xyes
-then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_network_inet_ntoa" >&5
+echo "${ECHO_T}$ac_cv_lib_network_inet_ntoa" >&6
+if test $ac_cv_lib_network_inet_ntoa = yes; then
LIBS="$LIBS -lnetwork"
fi
@@ -6084,77 +7107,98 @@ fi
HP-UX-*.11.*)
# Use updated header definitions where possible
-printf "%s\n" "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define _XOPEN_SOURCE_EXTENDED 1
+_ACEOF
-printf "%s\n" "#define _XOPEN_SOURCE 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define _XOPEN_SOURCE 1
+_ACEOF
LIBS="$LIBS -lxnet" # Use the XOPEN network library
- if test "`uname -m`" = ia64
-then :
+ if test "`uname -m`" = ia64; then
SHLIB_SUFFIX=".so"
-else case e in #(
- e)
+else
+
SHLIB_SUFFIX=".sl"
- ;;
-esac
+
fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-printf %s "checking for shl_load in -ldld... " >&6; }
-if test ${ac_cv_lib_dld_shl_load+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
+
+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
-char shl_load (void);
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
int
-main (void)
+main ()
{
-return shl_load ();
+shl_load ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_dld_shl_load=yes
-else case e in #(
- e) ac_cv_lib_dld_shl_load=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = xyes
-then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
tcl_ok=yes
-else case e in #(
- e) tcl_ok=no ;;
-esac
+else
+ tcl_ok=no
fi
- if test "$tcl_ok" = yes
-then :
+ if test "$tcl_ok" = yes; then
SHLIB_CFLAGS="+z"
SHLIB_LD="ld -b"
@@ -6166,112 +7210,125 @@ then :
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
fi
- if test "$GCC" = yes
-then :
+
+ if test "$GCC" = yes; then
SHLIB_LD='${CC} -shared'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
-else case e in #(
- e)
- CFLAGS="$CFLAGS -z"
- ;;
-esac
fi
+
# Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
#CFLAGS="$CFLAGS +DAportable"
# Check to enable 64-bit flags for compiler/linker
- if test "$do64bit" = "yes"
-then :
+ if test "$do64bit" = "yes"; then
- if test "$GCC" = yes
-then :
+ if test "$GCC" = yes; then
case `${CC} -dumpmachine` in
hppa64*)
# 64-bit gcc in use. Fix flags for GNU ld.
do64bit_ok=yes
SHLIB_LD='${CC} -shared'
- if test $doRpath = yes
-then :
+ if test $doRpath = yes; then
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
fi
+
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
;;
*)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5
-printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
+ { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5
+echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
;;
esac
-else case e in #(
- e)
+else
+
do64bit_ok=yes
CFLAGS="$CFLAGS +DD64"
LDFLAGS_ARCH="+DD64"
- ;;
-esac
+
fi
-fi ;;
+
+fi
+ ;;
HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
SHLIB_SUFFIX=".sl"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-printf %s "checking for shl_load in -ldld... " >&6; }
-if test ${ac_cv_lib_dld_shl_load+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
-char shl_load (void);
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
int
-main (void)
+main ()
{
-return shl_load ();
+shl_load ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_dld_shl_load=yes
-else case e in #(
- e) ac_cv_lib_dld_shl_load=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = xyes
-then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
tcl_ok=yes
-else case e in #(
- e) tcl_ok=no ;;
-esac
+else
+ tcl_ok=no
fi
- if test "$tcl_ok" = yes
-then :
+ if test "$tcl_ok" = yes; then
SHLIB_CFLAGS="+z"
SHLIB_LD="ld -b"
@@ -6283,25 +7340,20 @@ then :
LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
-fi ;;
+fi
+ ;;
IRIX-5.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -shared -rdata_shared"
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
- case " $LIBOBJS " in
- *" mkstemp.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext"
- ;;
-esac
-
- if test $doRpath = yes
-then :
+ if test $doRpath = yes; then
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
fi
+
;;
IRIX-6.*)
SHLIB_CFLAGS=""
@@ -6309,26 +7361,19 @@ fi
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
- case " $LIBOBJS " in
- *" mkstemp.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext"
- ;;
-esac
-
- if test $doRpath = yes
-then :
+ if test $doRpath = yes; then
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
fi
- if test "$GCC" = yes
-then :
+
+ if test "$GCC" = yes; then
CFLAGS="$CFLAGS -mabi=n32"
LDFLAGS="$LDFLAGS -mabi=n32"
-else case e in #(
- e)
+else
+
case $system in
IRIX-6.3)
# Use to build 6.2 compatible binaries on 6.3.
@@ -6339,9 +7384,9 @@ else case e in #(
;;
esac
LDFLAGS="$LDFLAGS -n32"
- ;;
-esac
+
fi
+
;;
IRIX64-6.*)
SHLIB_CFLAGS=""
@@ -6349,44 +7394,37 @@ fi
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
- case " $LIBOBJS " in
- *" mkstemp.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext"
- ;;
-esac
-
- if test $doRpath = yes
-then :
+ if test $doRpath = yes; then
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
fi
+
# Check to enable 64-bit flags for compiler/linker
- if test "$do64bit" = yes
-then :
+ if test "$do64bit" = yes; then
+
+ if test "$GCC" = yes; then
- if test "$GCC" = yes
-then :
+ { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5
+echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;}
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5
-printf "%s\n" "$as_me: WARNING: 64bit mode not supported by gcc" >&2;}
+else
-else case e in #(
- e)
do64bit_ok=yes
SHLIB_LD="ld -64 -shared -rdata_shared"
CFLAGS="$CFLAGS -64"
LDFLAGS_ARCH="-64"
- ;;
-esac
+
fi
+
fi
+
;;
- Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*)
- SHLIB_CFLAGS="-fPIC -fno-common"
+ Linux*|GNU*|NetBSD-Debian)
+ SHLIB_CFLAGS="-fPIC"
SHLIB_SUFFIX=".so"
CFLAGS_OPTIMIZE="-O2"
@@ -6395,91 +7433,101 @@ fi
# get rid of the warnings.
#CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
- SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared'
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ if test $doRpath = yes; then
- case $system in
- DragonFly-*|FreeBSD-*)
- if test "${TCL_THREADS}" = "1"
-then :
-
- # The -pthread needs to go in the LDFLAGS, not LIBS
- LIBS=`echo $LIBS | sed s/-pthread//`
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
fi
- ;;
- esac
-
- if test $doRpath = yes
-then :
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
-fi
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
- if test "`uname -m`" = "alpha"
-then :
+ if test "`uname -m`" = "alpha"; then
CFLAGS="$CFLAGS -mieee"
fi
- if test $do64bit = yes
-then :
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5
-printf %s "checking if compiler accepts -m64 flag... " >&6; }
-if test ${tcl_cv_cc_m64+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
+ if test $do64bit = yes; then
+
+ echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5
+echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6
+if test "${tcl_cv_cc_m64+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -m64"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
-main (void)
+main ()
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_cc_m64=yes
-else case e in #(
- e) tcl_cv_cc_m64=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_cc_m64=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
- CFLAGS=$hold_cflags ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5
-printf "%s\n" "$tcl_cv_cc_m64" >&6; }
- if test $tcl_cv_cc_m64 = yes
-then :
+echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5
+echo "${ECHO_T}$tcl_cv_cc_m64" >&6
+ if test $tcl_cv_cc_m64 = yes; then
CFLAGS="$CFLAGS -m64"
do64bit_ok=yes
fi
+
fi
+
# The combo of gcc + glibc has a bug related to inlining of
- # functions like strtol()/strtoul(). The -fno-builtin flag should address
+ # functions like strtod(). The -fno-builtin flag should address
# this problem but it does not work. The -fno-inline flag is kind
# of overkill but it works. Disable inlining only when one of the
# files in compat/*.c is being linked in.
- if test x"${USE_COMPAT}" != x
-then :
+ if test x"${USE_COMPAT}" != x; then
CFLAGS="$CFLAGS -fno-inline"
fi
+
;;
Lynx*)
SHLIB_CFLAGS="-fPIC"
@@ -6489,40 +7537,87 @@ fi
DL_OBJS="tclLoadDl.o"
DL_LIBS="-mshared -ldl"
LD_FLAGS="-Wl,--export-dynamic"
- if test $doRpath = yes
-then :
+ if test $doRpath = yes; then
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
- LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
fi
+
+ ;;
+ MP-RAS-02*)
+ SHLIB_CFLAGS="-K PIC"
+ SHLIB_LD='${CC} -G'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ MP-RAS-*)
+ SHLIB_CFLAGS="-K PIC"
+ SHLIB_LD='${CC} -G'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
;;
OpenBSD-*)
arch=`arch -s`
case "$arch" in
- alpha|sparc64)
- SHLIB_CFLAGS="-fPIC"
+ vax)
+ # Equivalent using configure option --disable-load
+ # Step 4 will set the necessary variables
+ DL_OBJS=""
+ SHLIB_LD_LIBS=""
+ LDFLAGS=""
;;
*)
- SHLIB_CFLAGS="-fpic"
+ case "$arch" in
+ alpha|sparc|sparc64)
+ SHLIB_CFLAGS="-fPIC"
+ ;;
+ *)
+ SHLIB_CFLAGS="-fpic"
+ ;;
+ esac
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ if test $doRpath = yes; then
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
+ LDFLAGS="-Wl,-export-dynamic"
;;
esac
- SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- if test $doRpath = yes
-then :
+ case "$arch" in
+ vax)
+ CFLAGS_OPTIMIZE="-O1"
+ ;;
+ sh)
+ CFLAGS_OPTIMIZE="-O0"
+ ;;
+ *)
+ CFLAGS_OPTIMIZE="-O2"
+ ;;
+ esac
+ if test "${TCL_THREADS}" = "1"; then
+
+ # On OpenBSD: Compile with -pthread
+ # Don't link with -lpthread
+ LIBS=`echo $LIBS | sed s/-lpthread//`
+ CFLAGS="$CFLAGS -pthread"
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
fi
- LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
- LDFLAGS="-Wl,-export-dynamic"
- CFLAGS_OPTIMIZE="-O2"
- # On OpenBSD: Compile with -pthread
- # Don't link with -lpthread
- LIBS=`echo $LIBS | sed s/-lpthread//`
- CFLAGS="$CFLAGS -pthread"
+
# OpenBSD doesn't do version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
TCL_LIB_VERSIONS_OK=nodots
@@ -6530,24 +7625,62 @@ fi
NetBSD-*)
# NetBSD has ELF and can use 'cc -shared' to build shared libs
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared'
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS="$LDFLAGS -export-dynamic"
- if test $doRpath = yes
-then :
+ if test $doRpath = yes; then
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
fi
+
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
- # The -pthread needs to go in the CFLAGS, not LIBS
- LIBS=`echo $LIBS | sed s/-pthread//`
- CFLAGS="$CFLAGS -pthread"
- LDFLAGS="$LDFLAGS -pthread"
+ if test "${TCL_THREADS}" = "1"; then
+
+ # The -pthread needs to go in the CFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+
+fi
+
+ ;;
+ FreeBSD-*)
+ # This configuration from FreeBSD Ports.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="${CC} -shared"
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,-soname,\$@"
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ LDFLAGS=""
+ if test $doRpath = yes; then
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+
+ if test "${TCL_THREADS}" = "1"; then
+
+ # The -pthread needs to go in the LDFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
+fi
+
+ case $system in
+ FreeBSD-3.*)
+ # Version numbers are dot-stripped by system policy.
+ TCL_TRIM_DOTS=`echo ${VERSION} | tr -d .`
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ esac
;;
Darwin-*)
- CFLAGS_OPTIMIZE="-O2"
+ CFLAGS_OPTIMIZE="-Os"
SHLIB_CFLAGS="-fno-common"
# To avoid discrepancies between what headers configure sees during
# preprocessing tests and compiling tests, move any -isysroot and
@@ -6558,281 +7691,339 @@ fi
CFLAGS="`echo " ${CFLAGS}" | \
awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`"
- if test $do64bit = yes
-then :
+ if test $do64bit = yes; then
case `arch` in
ppc)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5
-printf %s "checking if compiler accepts -arch ppc64 flag... " >&6; }
-if test ${tcl_cv_cc_arch_ppc64+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
+ echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5
+echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6
+if test "${tcl_cv_cc_arch_ppc64+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
-main (void)
+main ()
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_cc_arch_ppc64=yes
-else case e in #(
- e) tcl_cv_cc_arch_ppc64=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_cc_arch_ppc64=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
- CFLAGS=$hold_cflags ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5
-printf "%s\n" "$tcl_cv_cc_arch_ppc64" >&6; }
- if test $tcl_cv_cc_arch_ppc64 = yes
-then :
+echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5
+echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6
+ if test $tcl_cv_cc_arch_ppc64 = yes; then
CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
do64bit_ok=yes
-fi;;
- i386|x86_64)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5
-printf %s "checking if compiler accepts -arch x86_64 flag... " >&6; }
-if test ${tcl_cv_cc_arch_x86_64+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
+fi
+;;
+ i386)
+ echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5
+echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6
+if test "${tcl_cv_cc_arch_x86_64+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -arch x86_64"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
-main (void)
+main ()
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_cc_arch_x86_64=yes
-else case e in #(
- e) tcl_cv_cc_arch_x86_64=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_cc_arch_x86_64=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
- CFLAGS=$hold_cflags ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5
-printf "%s\n" "$tcl_cv_cc_arch_x86_64" >&6; }
- if test $tcl_cv_cc_arch_x86_64 = yes
-then :
+echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5
+echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6
+ if test $tcl_cv_cc_arch_x86_64 = yes; then
CFLAGS="$CFLAGS -arch x86_64"
do64bit_ok=yes
-fi;;
- arm64)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch arm64 flag" >&5
-printf %s "checking if compiler accepts -arch arm64 flag... " >&6; }
-if test ${tcl_cv_cc_arch_arm64+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- hold_cflags=$CFLAGS
- CFLAGS="$CFLAGS -arch arm64"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main (void)
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- tcl_cv_cc_arch_arm64=yes
-else case e in #(
- e) tcl_cv_cc_arch_arm64=no ;;
-esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
- CFLAGS=$hold_cflags ;;
-esac
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_arm64" >&5
-printf "%s\n" "$tcl_cv_cc_arch_arm64" >&6; }
- if test $tcl_cv_cc_arch_arm64 = yes
-then :
-
- CFLAGS="$CFLAGS -arch arm64"
- do64bit_ok=yes
-
-fi;;
+;;
*)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5
-printf "%s\n" "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};;
+ { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5
+echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};;
esac
-else case e in #(
- e)
+else
+
# Check for combined 32-bit and 64-bit fat build
- if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64|arm64) ' \
- && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '
-then :
+ if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \
+ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then
fat_32_64=yes
fi
- ;;
-esac
+
+
fi
+
SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}'
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ld accepts -single_module flag" >&5
-printf %s "checking if ld accepts -single_module flag... " >&6; }
-if test ${tcl_cv_ld_single_module+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
+ echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5
+echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6
+if test "${tcl_cv_ld_single_module+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
-main (void)
+main ()
{
int i;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_ld_single_module=yes
-else case e in #(
- e) tcl_cv_ld_single_module=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_ld_single_module=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$hold_ldflags ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$hold_ldflags
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_single_module" >&5
-printf "%s\n" "$tcl_cv_ld_single_module" >&6; }
- if test $tcl_cv_ld_single_module = yes
-then :
+echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5
+echo "${ECHO_T}$tcl_cv_ld_single_module" >&6
+ if test $tcl_cv_ld_single_module = yes; then
SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
fi
+
SHLIB_SUFFIX=".dylib"
DL_OBJS="tclLoadDyld.o"
DL_LIBS=""
+ # Don't use -prebind when building for Mac OS X 10.4 or later only:
+ if test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \
+ "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then
+
+ LDFLAGS="$LDFLAGS -prebind"
+fi
+
LDFLAGS="$LDFLAGS -headerpad_max_install_names"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5
-printf %s "checking if ld accepts -search_paths_first flag... " >&6; }
-if test ${tcl_cv_ld_search_paths_first+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
+ echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5
+echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6
+if test "${tcl_cv_ld_search_paths_first+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
-main (void)
+main ()
{
int i;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_ld_search_paths_first=yes
-else case e in #(
- e) tcl_cv_ld_search_paths_first=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_ld_search_paths_first=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$hold_ldflags ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$hold_ldflags
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5
-printf "%s\n" "$tcl_cv_ld_search_paths_first" >&6; }
- if test $tcl_cv_ld_search_paths_first = yes
-then :
+echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5
+echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6
+ if test $tcl_cv_ld_search_paths_first = yes; then
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
fi
- if test "$tcl_cv_cc_visibility_hidden" != yes
-then :
+ if test "$tcl_cv_cc_visibility_hidden" != yes; then
-printf "%s\n" "#define MODULE_SCOPE __private_extern__" >>confdefs.h
- tcl_cv_cc_visibility_hidden=yes
+cat >>confdefs.h <<\_ACEOF
+#define MODULE_SCOPE __private_extern__
+_ACEOF
+
fi
+
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
- LD_LIBRARY_PATH_VAR="DYLD_FALLBACK_LIBRARY_PATH"
+ LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
-printf "%s\n" "#define MAC_OSX_TCL 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define MAC_OSX_TCL 1
+_ACEOF
PLAT_OBJS='${MAC_OSX_OBJS}'
PLAT_SRCS='${MAC_OSX_SRCS}'
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use CoreFoundation" >&5
-printf %s "checking whether to use CoreFoundation... " >&6; }
- # Check whether --enable-corefoundation was given.
-if test ${enable_corefoundation+y}
-then :
- enableval=$enable_corefoundation; tcl_corefoundation=$enableval
-else case e in #(
- e) tcl_corefoundation=yes ;;
-esac
-fi
-
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_corefoundation" >&5
-printf "%s\n" "$tcl_corefoundation" >&6; }
- if test $tcl_corefoundation = yes
-then :
+ echo "$as_me:$LINENO: checking whether to use CoreFoundation" >&5
+echo $ECHO_N "checking whether to use CoreFoundation... $ECHO_C" >&6
+ # Check whether --enable-corefoundation or --disable-corefoundation was given.
+if test "${enable_corefoundation+set}" = set; then
+ enableval="$enable_corefoundation"
+ tcl_corefoundation=$enableval
+else
+ tcl_corefoundation=yes
+fi;
+ echo "$as_me:$LINENO: result: $tcl_corefoundation" >&5
+echo "${ECHO_T}$tcl_corefoundation" >&6
+ if test $tcl_corefoundation = yes; then
+
+ echo "$as_me:$LINENO: checking for CoreFoundation.framework" >&5
+echo $ECHO_N "checking for CoreFoundation.framework... $ECHO_C" >&6
+if test "${tcl_cv_lib_corefoundation+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CoreFoundation.framework" >&5
-printf %s "checking for CoreFoundation.framework... " >&6; }
-if test ${tcl_cv_lib_corefoundation+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
hold_libs=$LIBS
- if test "$fat_32_64" = yes
-then :
+ if test "$fat_32_64" = yes; then
for v in CFLAGS CPPFLAGS LDFLAGS; do
# On Tiger there is no 64-bit CF, so remove 64-bit
@@ -6842,163 +8033,262 @@ then :
eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
done
fi
+
LIBS="$LIBS -framework CoreFoundation"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <CoreFoundation/CoreFoundation.h>
int
-main (void)
+main ()
{
CFBundleRef b = CFBundleGetMainBundle();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_lib_corefoundation=yes
-else case e in #(
- e) tcl_cv_lib_corefoundation=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_lib_corefoundation=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
- if test "$fat_32_64" = yes
-then :
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test "$fat_32_64" = yes; then
for v in CFLAGS CPPFLAGS LDFLAGS; do
eval $v'="$hold_'$v'"'
done
fi
- LIBS=$hold_libs ;;
-esac
+
+ LIBS=$hold_libs
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation" >&5
-printf "%s\n" "$tcl_cv_lib_corefoundation" >&6; }
- if test $tcl_cv_lib_corefoundation = yes
-then :
+echo "$as_me:$LINENO: result: $tcl_cv_lib_corefoundation" >&5
+echo "${ECHO_T}$tcl_cv_lib_corefoundation" >&6
+ if test $tcl_cv_lib_corefoundation = yes; then
LIBS="$LIBS -framework CoreFoundation"
-printf "%s\n" "#define HAVE_COREFOUNDATION 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_COREFOUNDATION 1
+_ACEOF
-else case e in #(
- e) tcl_corefoundation=no ;;
-esac
+else
+ tcl_corefoundation=no
fi
- if test "$fat_32_64" = yes -a $tcl_corefoundation = yes
-then :
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit CoreFoundation" >&5
-printf %s "checking for 64-bit CoreFoundation... " >&6; }
-if test ${tcl_cv_lib_corefoundation_64+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
+ if test "$fat_32_64" = yes -a $tcl_corefoundation = yes; then
+
+ echo "$as_me:$LINENO: checking for 64-bit CoreFoundation" >&5
+echo $ECHO_N "checking for 64-bit CoreFoundation... $ECHO_C" >&6
+if test "${tcl_cv_lib_corefoundation_64+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
for v in CFLAGS CPPFLAGS LDFLAGS; do
eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
done
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <CoreFoundation/CoreFoundation.h>
int
-main (void)
+main ()
{
CFBundleRef b = CFBundleGetMainBundle();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_lib_corefoundation_64=yes
-else case e in #(
- e) tcl_cv_lib_corefoundation_64=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_lib_corefoundation_64=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
for v in CFLAGS CPPFLAGS LDFLAGS; do
eval $v'="$hold_'$v'"'
- done ;;
-esac
+ done
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation_64" >&5
-printf "%s\n" "$tcl_cv_lib_corefoundation_64" >&6; }
- if test $tcl_cv_lib_corefoundation_64 = no
-then :
+echo "$as_me:$LINENO: result: $tcl_cv_lib_corefoundation_64" >&5
+echo "${ECHO_T}$tcl_cv_lib_corefoundation_64" >&6
+ if test $tcl_cv_lib_corefoundation_64 = no; then
-printf "%s\n" "#define NO_COREFOUNDATION_64 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define NO_COREFOUNDATION_64 1
+_ACEOF
LDFLAGS="$LDFLAGS -Wl,-no_arch_warnings"
fi
+
fi
+
fi
+
+ ;;
+ NEXTSTEP-*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD='${CC} -nostdlib -r'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadNext.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
;;
OS/390-*)
SHLIB_LD_LIBS=""
CFLAGS_OPTIMIZE="" # Optimizer is buggy
-printf "%s\n" "#define _OE_SOCKETS 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define _OE_SOCKETS 1
+_ACEOF
+
+ ;;
+ OSF1-1.0|OSF1-1.1|OSF1-1.2)
+ # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
+ SHLIB_CFLAGS=""
+ # Hack: make package name same as library name
+ SHLIB_LD='ld -R -export :'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadOSF.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ OSF1-1.*)
+ # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
+ SHLIB_CFLAGS="-fPIC"
+ if test "$SHARED_BUILD" = 1; then
+ SHLIB_LD="ld -shared"
+else
+
+ SHLIB_LD="ld -non_shared"
+
+fi
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
;;
OSF1-V*)
# Digital OSF/1
SHLIB_CFLAGS=""
- if test "$SHARED_BUILD" = 1
-then :
+ if test "$SHARED_BUILD" = 1; then
- SHLIB_LD='${CC} -shared'
+ SHLIB_LD='ld -shared -expect_unresolved "*"'
+
+else
+
+ SHLIB_LD='ld -non_shared -expect_unresolved "*"'
-else case e in #(
- e)
- SHLIB_LD='${CC} -non_shared'
- ;;
-esac
fi
+
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
- if test $doRpath = yes
-then :
+ if test $doRpath = yes; then
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
fi
- if test "$GCC" = yes
-then :
+
+ if test "$GCC" = yes; then
CFLAGS="$CFLAGS -mieee"
-else case e in #(
- e)
- CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" ;;
-esac
+else
+
+ CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"
fi
+
# see pthread_intro(3) for pthread support on osf1, k.furukawa
- CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
- CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
- LIBS=`echo $LIBS | sed s/-lpthreads//`
- if test "$GCC" = yes
-then :
+ if test "${TCL_THREADS}" = 1; then
+
+ CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
+ CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
+ LIBS=`echo $LIBS | sed s/-lpthreads//`
+ if test "$GCC" = yes; then
+
+ LIBS="$LIBS -lpthread -lmach -lexc"
+
+else
+
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+
+fi
- LIBS="$LIBS -lpthread -lmach -lexc"
-else case e in #(
- e)
- CFLAGS="$CFLAGS -pthread"
- LDFLAGS="$LDFLAGS -pthread"
- ;;
-esac
fi
+
;;
QNX-6*)
# QNX RTP
# This may work for all QNX, but it was only reported for v6.
+ SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
@@ -7012,19 +8302,18 @@ fi
# Note, dlopen is available only on SCO 3.2.5 and greater. However,
# this test works, since "uname -s" was non-standard in 3.2.4 and
# below.
- if test "$GCC" = yes
-then :
+ if test "$GCC" = yes; then
- SHLIB_CFLAGS="-fPIC -melf"
- LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
+ SHLIB_CFLAGS="-fPIC -melf"
+ LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
+
+else
+
+ SHLIB_CFLAGS="-Kpic -belf"
+ LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
-else case e in #(
- e)
- SHLIB_CFLAGS="-Kpic -belf"
- LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
- ;;
-esac
fi
+
SHLIB_LD="ld -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
@@ -7033,6 +8322,35 @@ fi
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
+ SINIX*5.4*)
+ SHLIB_CFLAGS="-K PIC"
+ SHLIB_LD='${CC} -G'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SunOS-4*)
+ SHLIB_CFLAGS="-PIC"
+ SHLIB_LD="ld"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+
+ # SunOS can't handle version numbers with dots in them in library
+ # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it
+ # requires an extra version number at the end of .so file names.
+ # So, the library has to have a name like libtcl75.so.1.0
+
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
SunOS-5.[0-6])
# Careful to not let 5.10+ fall into this case
@@ -7040,100 +8358,100 @@ fi
# won't define thread-safe library routines.
-printf "%s\n" "#define _REENTRANT 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define _REENTRANT 1
+_ACEOF
-printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_PTHREAD_SEMANTICS 1
+_ACEOF
SHLIB_CFLAGS="-KPIC"
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
- if test "$GCC" = yes
-then :
+ if test "$GCC" = yes; then
SHLIB_LD='${CC} -shared'
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
-else case e in #(
- e)
+else
+
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
- ;;
-esac
+
fi
+
;;
SunOS-5*)
# Note: If _REENTRANT isn't defined, then Solaris
# won't define thread-safe library routines.
-printf "%s\n" "#define _REENTRANT 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define _REENTRANT 1
+_ACEOF
-printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_PTHREAD_SEMANTICS 1
+_ACEOF
SHLIB_CFLAGS="-KPIC"
# Check to enable 64-bit flags for compiler/linker
- if test "$do64bit" = yes
-then :
+ if test "$do64bit" = yes; then
arch=`isainfo`
- if test "$arch" = "sparcv9 sparc"
-then :
+ if test "$arch" = "sparcv9 sparc"; then
- if test "$GCC" = yes
-then :
+ if test "$GCC" = yes; then
- if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3
-then :
+ if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5
-printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;}
+ { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5
+echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;}
+
+else
-else case e in #(
- e)
do64bit_ok=yes
CFLAGS="$CFLAGS -m64 -mcpu=v9"
LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
SHLIB_CFLAGS="-fPIC"
- ;;
-esac
+
fi
-else case e in #(
- e)
+
+else
+
do64bit_ok=yes
- if test "$do64bitVIS" = yes
-then :
+ if test "$do64bitVIS" = yes; then
CFLAGS="$CFLAGS -xarch=v9a"
LDFLAGS_ARCH="-xarch=v9a"
-else case e in #(
- e)
+else
+
CFLAGS="$CFLAGS -xarch=v9"
LDFLAGS_ARCH="-xarch=v9"
- ;;
-esac
+
fi
+
# Solaris 64 uses this as well
#LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
- ;;
-esac
+
fi
-else case e in #(
- e) if test "$arch" = "amd64 i386"
-then :
- if test "$GCC" = yes
-then :
+else
+ if test "$arch" = "amd64 i386"; then
+
+ if test "$GCC" = yes; then
case $system in
SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
@@ -7141,12 +8459,12 @@ then :
CFLAGS="$CFLAGS -m64"
LDFLAGS="$LDFLAGS -m64";;
*)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5
-printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};;
+ { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5
+echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};;
esac
-else case e in #(
- e)
+else
+
do64bit_ok=yes
case $system in
SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
@@ -7156,71 +8474,200 @@ else case e in #(
CFLAGS="$CFLAGS -xarch=amd64"
LDFLAGS="$LDFLAGS -xarch=amd64";;
esac
- ;;
-esac
+
fi
-else case e in #(
- e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5
-printf "%s\n" "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} ;;
-esac
-fi ;;
-esac
+
+else
+ { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5
+echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;}
fi
fi
+
+fi
+
+
#--------------------------------------------------------------------
# On Solaris 5.x i386 with the sunpro compiler we need to link
# with sunmath to get floating point rounding control
#--------------------------------------------------------------------
- if test "$GCC" = yes
-then :
+ if test "$GCC" = yes; then
use_sunmath=no
-else case e in #(
- e)
+else
+
arch=`isainfo`
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use -lsunmath for fp rounding control" >&5
-printf %s "checking whether to use -lsunmath for fp rounding control... " >&6; }
- if test "$arch" = "amd64 i386" -o "$arch" = "i386"
-then :
+ echo "$as_me:$LINENO: checking whether to use -lsunmath for fp rounding control" >&5
+echo $ECHO_N "checking whether to use -lsunmath for fp rounding control... $ECHO_C" >&6
+ if test "$arch" = "amd64 i386"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; }
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
MATH_LIBS="-lsunmath $MATH_LIBS"
- ac_fn_c_check_header_compile "$LINENO" "sunmath.h" "ac_cv_header_sunmath_h" "$ac_includes_default"
-if test "x$ac_cv_header_sunmath_h" = xyes
-then :
+ if test "${ac_cv_header_sunmath_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for sunmath.h" >&5
+echo $ECHO_N "checking for sunmath.h... $ECHO_C" >&6
+if test "${ac_cv_header_sunmath_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sunmath_h" >&5
+echo "${ECHO_T}$ac_cv_header_sunmath_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking sunmath.h usability" >&5
+echo $ECHO_N "checking sunmath.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <sunmath.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking sunmath.h presence" >&5
+echo $ECHO_N "checking sunmath.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sunmath.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_header_preproc=no
fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sunmath.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sunmath.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sunmath.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sunmath.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sunmath.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sunmath.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sunmath.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sunmath.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for sunmath.h" >&5
+echo $ECHO_N "checking for sunmath.h... $ECHO_C" >&6
+if test "${ac_cv_header_sunmath_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_sunmath_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sunmath_h" >&5
+echo "${ECHO_T}$ac_cv_header_sunmath_h" >&6
+
+fi
+
use_sunmath=yes
-else case e in #(
- e)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+else
+
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
use_sunmath=no
- ;;
-esac
+
fi
- ;;
-esac
+
+
fi
+
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
- if test "$GCC" = yes
-then :
+ if test "$GCC" = yes; then
SHLIB_LD='${CC} -shared'
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
- if test "$do64bit_ok" = yes
-then :
+ if test "$do64bit_ok" = yes; then
- if test "$arch" = "sparcv9 sparc"
-then :
+ if test "$arch" = "sparcv9 sparc"; then
# We need to specify -static-libgcc or we need to
# add the path to the sparv9 libgcc.
@@ -7230,38 +8677,38 @@ then :
#v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
#CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
-else case e in #(
- e) if test "$arch" = "amd64 i386"
-then :
+else
+ if test "$arch" = "amd64 i386"; then
SHLIB_LD="$SHLIB_LD -m64 -static-libgcc"
-fi ;;
-esac
fi
fi
-else case e in #(
- e)
- if test "$use_sunmath" = yes
-then :
+
+fi
+
+
+else
+
+ if test "$use_sunmath" = yes; then
textmode=textoff
-else case e in #(
- e) textmode=text ;;
-esac
+else
+ textmode=text
fi
+
case $system in
- SunOS-5.[1-9][0-9]*|SunOS-5.[7-9])
+ SunOS-5.[1-9][0-9]*)
SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";;
*)
SHLIB_LD="/usr/ccs/bin/ld -G -z $textmode";;
esac
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
- ;;
-esac
+
fi
+
;;
UNIX_SV* | UnixWare-5*)
SHLIB_CFLAGS="-KPIC"
@@ -7272,93 +8719,116 @@ fi
DL_LIBS="-ldl"
# Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
# that don't grok the -Bexport option. Test that it does.
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld accepts -Bexport flag" >&5
-printf %s "checking for ld accepts -Bexport flag... " >&6; }
-if test ${tcl_cv_ld_Bexport+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
+ echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5
+echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6
+if test "${tcl_cv_ld_Bexport+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-Bexport"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
-main (void)
+main ()
{
int i;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_ld_Bexport=yes
-else case e in #(
- e) tcl_cv_ld_Bexport=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_ld_Bexport=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$hold_ldflags ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$hold_ldflags
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_Bexport" >&5
-printf "%s\n" "$tcl_cv_ld_Bexport" >&6; }
- if test $tcl_cv_ld_Bexport = yes
-then :
+echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5
+echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6
+ if test $tcl_cv_ld_Bexport = yes; then
LDFLAGS="$LDFLAGS -Wl,-Bexport"
fi
+
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
esac
- if test "$do64bit" = yes -a "$do64bit_ok" = no
-then :
+ if test "$do64bit" = yes -a "$do64bit_ok" = no; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5
-printf "%s\n" "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;}
+ { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5
+echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;}
fi
- if test "$do64bit" = yes -a "$do64bit_ok" = yes
-then :
+ if test "$do64bit" = yes -a "$do64bit_ok" = yes; then
-printf "%s\n" "#define TCL_CFG_DO64BIT 1" >>confdefs.h
+
+cat >>confdefs.h <<\_ACEOF
+#define TCL_CFG_DO64BIT 1
+_ACEOF
fi
- # Step 4: disable dynamic loading if requested via a command-line switch.
- # Check whether --enable-load was given.
-if test ${enable_load+y}
-then :
- enableval=$enable_load; tcl_ok=$enableval
-else case e in #(
- e) tcl_ok=yes ;;
-esac
-fi
+ # Step 4: disable dynamic loading if requested via a command-line switch.
- if test "$tcl_ok" = no
-then :
+ # Check whether --enable-load or --disable-load was given.
+if test "${enable_load+set}" = set; then
+ enableval="$enable_load"
+ tcl_ok=$enableval
+else
+ tcl_ok=yes
+fi;
+ if test "$tcl_ok" = no; then
DL_OBJS=""
fi
- if test "x$DL_OBJS" != x
-then :
+
+ if test "x$DL_OBJS" != x; then
BUILD_DLTEST="\$(DLTEST_TARGETS)"
-else case e in #(
- e)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&5
-printf "%s\n" "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&2;}
+else
+
+ { echo "$as_me:$LINENO: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&5
+echo "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&2;}
SHLIB_CFLAGS=""
SHLIB_LD=""
SHLIB_SUFFIX=""
@@ -7368,266 +8838,170 @@ printf "%s\n" "$as_me: WARNING: Can't figure out how to do dynamic loading or sh
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
BUILD_DLTEST=""
- ;;
-esac
+
fi
+
LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
# If we're running gcc, then change the C flags for compiling shared
# libraries to the right flags for gcc, instead of those for the
# standard manufacturer compiler.
- if test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes
-then :
+ if test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes; then
case $system in
AIX-*) ;;
BSD/OS*) ;;
- CYGWIN_*|MINGW32_*|MSYS_*) ;;
- HP-UX*) ;;
- Darwin-*) ;;
+ CYGWIN_*|MINGW32_*) ;;
IRIX*) ;;
- Linux*|GNU*) ;;
- NetBSD-*|OpenBSD-*) ;;
- OSF1-*) ;;
+ NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
+ Darwin-*) ;;
SCO_SV-3.2*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;
esac
fi
- if test "$tcl_cv_cc_visibility_hidden" != yes
-then :
-
-printf "%s\n" "#define MODULE_SCOPE extern" >>confdefs.h
-
-
-fi
-
- if test "$SHARED_LIB_SUFFIX" = ""
-then :
+ if test "$SHARED_LIB_SUFFIX" = ""; then
SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}'
fi
- if test "$UNSHARED_LIB_SUFFIX" = ""
-then :
+
+ if test "$UNSHARED_LIB_SUFFIX" = ""; then
UNSHARED_LIB_SUFFIX='${VERSION}.a'
fi
+
DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)"
- if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""
-then :
+ if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""; then
LIB_SUFFIX=${SHARED_LIB_SUFFIX}
- MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${LDFLAGS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
- if test "${SHLIB_SUFFIX}" = ".dll"
-then :
+ MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
+ if test "${SHLIB_SUFFIX}" = ".dll"; then
- INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"'
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;'
DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)"
-else case e in #(
- e)
+else
+
INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"'
- ;;
-esac
+
fi
-else case e in #(
- e)
+
+else
+
LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}
- if test "$RANLIB" = ""
-then :
+ if test "$RANLIB" = ""; then
MAKE_LIB='$(STLIB_LD) $@ ${OBJS}'
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"'
+
+else
-else case e in #(
- e)
MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@'
- ;;
-esac
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)" ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(LIB_FILE))'
+
fi
- INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"'
- ;;
-esac
+
+
fi
+
# Stub lib does not depend on shared/static configuration
- if test "$RANLIB" = ""
-then :
+ if test "$RANLIB" = ""; then
MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}'
+ INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"'
+
+else
-else case e in #(
- e)
MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@'
- ;;
-esac
+ INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)" ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(STUB_LIB_FILE))'
+
fi
- INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"'
+
# Define TCL_LIBS now that we know what DL_LIBS is.
# The trick here is that we don't want to change the value of TCL_LIBS if
# it is already set when tclConfig.sh had been loaded by Tk.
- if test "x${TCL_LIBS}" = x
-then :
+ if test "x${TCL_LIBS}" = x; then
TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}"
fi
- # See if the compiler supports casting to a union type.
- # This is used to stop gcc from printing a compiler
- # warning when initializing a union member.
-
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5
-printf %s "checking for cast to union support... " >&6; }
-if test ${tcl_cv_cast_to_union+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main (void)
-{
- union foo { int i; double d; };
- union foo f = (union foo) (int) 0;
+ # See if the compiler supports casting to a union type.
+ # This is used to stop gcc from printing a compiler
+ # warning when initializing a union member.
- ;
- return 0;
-}
+ echo "$as_me:$LINENO: checking for cast to union support" >&5
+echo $ECHO_N "checking for cast to union support... $ECHO_C" >&6
+if test "${tcl_cv_cast_to_union+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- tcl_cv_cast_to_union=yes
-else case e in #(
- e) tcl_cv_cast_to_union=no ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- ;;
-esac
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5
-printf "%s\n" "$tcl_cv_cast_to_union" >&6; }
- if test "$tcl_cv_cast_to_union" = "yes"; then
-
-printf "%s\n" "#define HAVE_CAST_TO_UNION 1" >>confdefs.h
-
- fi
- hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working -fno-lto" >&5
-printf %s "checking for working -fno-lto... " >&6; }
-if test ${ac_cv_nolto+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
-main (void)
+main ()
{
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- ac_cv_nolto=yes
-else case e in #(
- e) ac_cv_nolto=no ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- ;;
-esac
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_nolto" >&5
-printf "%s\n" "$ac_cv_nolto" >&6; }
- CFLAGS=$hold_cflags
- if test "$ac_cv_nolto" = "yes" ; then
- CFLAGS_NOLTO="-fno-lto"
- else
- CFLAGS_NOLTO=""
- fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -finput-charset" >&5
-printf %s "checking if the compiler understands -finput-charset... " >&6; }
-if test ${tcl_cv_cc_input_charset+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -finput-charset=UTF-8"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main (void)
-{
+ union foo { int i; double d; };
+ union foo f = (union foo) (int) 0;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- tcl_cv_cc_input_charset=yes
-else case e in #(
- e) tcl_cv_cc_input_charset=no ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- CFLAGS=$hold_cflags ;;
-esac
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_input_charset" >&5
-printf "%s\n" "$tcl_cv_cc_input_charset" >&6; }
- if test $tcl_cv_cc_input_charset = yes; then
- CFLAGS="$CFLAGS -finput-charset=UTF-8"
- fi
-
- ac_fn_c_check_header_compile "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdbool_h" = xyes
-then :
-
-printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h
-
-fi
-
-
- # Check for vfork, posix_spawnp() and friends unconditionally
- ac_fn_c_check_func "$LINENO" "vfork" "ac_cv_func_vfork"
-if test "x$ac_cv_func_vfork" = xyes
-then :
- printf "%s\n" "#define HAVE_VFORK 1" >>confdefs.h
-
-fi
-ac_fn_c_check_func "$LINENO" "posix_spawnp" "ac_cv_func_posix_spawnp"
-if test "x$ac_cv_func_posix_spawnp" = xyes
-then :
- printf "%s\n" "#define HAVE_POSIX_SPAWNP 1" >>confdefs.h
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_cast_to_union=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+tcl_cv_cast_to_union=no
fi
-ac_fn_c_check_func "$LINENO" "posix_spawn_file_actions_adddup2" "ac_cv_func_posix_spawn_file_actions_adddup2"
-if test "x$ac_cv_func_posix_spawn_file_actions_adddup2" = xyes
-then :
- printf "%s\n" "#define HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 1" >>confdefs.h
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-ac_fn_c_check_func "$LINENO" "posix_spawnattr_setflags" "ac_cv_func_posix_spawnattr_setflags"
-if test "x$ac_cv_func_posix_spawnattr_setflags" = xyes
-then :
- printf "%s\n" "#define HAVE_POSIX_SPAWNATTR_SETFLAGS 1" >>confdefs.h
+echo "$as_me:$LINENO: result: $tcl_cv_cast_to_union" >&5
+echo "${ECHO_T}$tcl_cv_cast_to_union" >&6
+ if test "$tcl_cv_cast_to_union" = "yes"; then
-fi
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CAST_TO_UNION 1
+_ACEOF
+ fi
# FIXME: This subst was left in only because the TCL_DL_LIBS
# entry in tclConfig.sh uses it. It is not clear why someone
@@ -7657,9 +9031,9 @@ fi
-
-printf "%s\n" "#define TCL_SHLIB_EXT \"${SHLIB_SUFFIX}\"" >>confdefs.h
-
+cat >>confdefs.h <<_ACEOF
+#define TCL_SHLIB_EXT "${SHLIB_SUFFIX}"
+_ACEOF
@@ -7670,35 +9044,39 @@ printf "%s\n" "#define TCL_SHLIB_EXT \"${SHLIB_SUFFIX}\"" >>confdefs.h
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5
-printf %s "checking for build with symbols... " >&6; }
- # Check whether --enable-symbols was given.
-if test ${enable_symbols+y}
-then :
- enableval=$enable_symbols; tcl_ok=$enableval
-else case e in #(
- e) tcl_ok=no ;;
-esac
-fi
+ echo "$as_me:$LINENO: checking for build with symbols" >&5
+echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6
+ # Check whether --enable-symbols or --disable-symbols was given.
+if test "${enable_symbols+set}" = set; then
+ enableval="$enable_symbols"
+ tcl_ok=$enableval
+else
+ tcl_ok=no
+fi;
# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT.
+ DBGX=""
if test "$tcl_ok" = "no"; then
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
-printf "%s\n" "#define NDEBUG 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define NDEBUG 1
+_ACEOF
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
-printf "%s\n" "#define TCL_CFG_OPTIMIZED 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define TCL_CFG_OPTIMIZED 1
+_ACEOF
else
CFLAGS_DEFAULT='$(CFLAGS_DEBUG)'
LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)'
if test "$tcl_ok" = "yes"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5
-printf "%s\n" "yes (standard debugging)" >&6; }
+ echo "$as_me:$LINENO: result: yes (standard debugging)" >&5
+echo "${ECHO_T}yes (standard debugging)" >&6
fi
fi
@@ -7706,32 +9084,45 @@ printf "%s\n" "yes (standard debugging)" >&6; }
if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
-printf "%s\n" "#define TCL_MEM_DEBUG 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define TCL_MEM_DEBUG 1
+_ACEOF
fi
if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then
-printf "%s\n" "#define TCL_COMPILE_DEBUG 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define TCL_COMPILE_DEBUG 1
+_ACEOF
-printf "%s\n" "#define TCL_COMPILE_STATS 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define TCL_COMPILE_STATS 1
+_ACEOF
fi
if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
if test "$tcl_ok" = "all"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem compile debugging" >&5
-printf "%s\n" "enabled symbols mem compile debugging" >&6; }
+ echo "$as_me:$LINENO: result: enabled symbols mem compile debugging" >&5
+echo "${ECHO_T}enabled symbols mem compile debugging" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5
-printf "%s\n" "enabled $tcl_ok debugging" >&6; }
+ echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5
+echo "${ECHO_T}enabled $tcl_ok debugging" >&6
fi
fi
-printf "%s\n" "#define MP_PREC 4" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define TCL_TOMMATH 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define MP_PREC 4
+_ACEOF
#--------------------------------------------------------------------
@@ -7739,304 +9130,700 @@ printf "%s\n" "#define MP_PREC 4" >>confdefs.h
#--------------------------------------------------------------------
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5
-printf %s "checking for required early compiler flags... " >&6; }
+ echo "$as_me:$LINENO: checking for required early compiler flags" >&5
+echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6
tcl_flags=""
- if test ${tcl_cv_flag__isoc99_source+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ if test "${tcl_cv_flag__isoc99_source+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdlib.h>
int
-main (void)
+main ()
{
char *p = (char *)strtoll; char *q = (char *)strtoull;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_flag__isoc99_source=no
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#define _ISOC99_SOURCE 1
#include <stdlib.h>
int
-main (void)
+main ()
{
char *p = (char *)strtoll; char *q = (char *)strtoull;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_flag__isoc99_source=yes
-else case e in #(
- e) tcl_cv_flag__isoc99_source=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_flag__isoc99_source=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then
-printf "%s\n" "#define _ISOC99_SOURCE 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define _ISOC99_SOURCE 1
+_ACEOF
tcl_flags="$tcl_flags _ISOC99_SOURCE"
fi
- if test ${tcl_cv_flag__largefile64_source+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ if test "${tcl_cv_flag__largefile64_source+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/stat.h>
int
-main (void)
+main ()
{
struct stat64 buf; int i = stat64("/", &buf);
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_flag__largefile64_source=no
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#define _LARGEFILE64_SOURCE 1
#include <sys/stat.h>
int
-main (void)
+main ()
{
struct stat64 buf; int i = stat64("/", &buf);
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_flag__largefile64_source=yes
-else case e in #(
- e) tcl_cv_flag__largefile64_source=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_flag__largefile64_source=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then
-printf "%s\n" "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define _LARGEFILE64_SOURCE 1
+_ACEOF
tcl_flags="$tcl_flags _LARGEFILE64_SOURCE"
fi
+
+ if test "${tcl_cv_flag__largefile_source64+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/stat.h>
+int
+main ()
+{
+char *p = (char *)open64;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_flag__largefile_source64=no
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#define _LARGEFILE_SOURCE64 1
+#include <sys/stat.h>
+int
+main ()
+{
+char *p = (char *)open64;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_flag__largefile_source64=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_flag__largefile_source64=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _LARGEFILE_SOURCE64 1
+_ACEOF
+
+ tcl_flags="$tcl_flags _LARGEFILE_SOURCE64"
+ fi
+
if test "x${tcl_flags}" = "x" ; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5
-printf "%s\n" "none" >&6; }
+ echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5
-printf "%s\n" "${tcl_flags}" >&6; }
+ echo "$as_me:$LINENO: result: ${tcl_flags}" >&5
+echo "${ECHO_T}${tcl_flags}" >&6
fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 'long' and 'long long' have the same size (64-bit)?" >&5
-printf %s "checking if 'long' and 'long long' have the same size (64-bit)?... " >&6; }
- if test ${tcl_cv_type_64bit+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
+ echo "$as_me:$LINENO: checking for 64-bit integer type" >&5
+echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6
+ if test "${tcl_cv_type_64bit+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
tcl_cv_type_64bit=none
- # See if we could use long anyway Note that we substitute in the
+ # See if the compiler knows natively about __int64
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+__int64 value = (__int64) 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_type_64bit=__int64
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_type_64bit="long long"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ # See if we should use long anyway Note that we substitute in the
# type that is our current guess for a 64-bit type inside this check
# program, so it should be modified only carefully...
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
-main (void)
+main ()
{
switch (0) {
- case 1: case (sizeof(long long)==sizeof(long)): ;
+ case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ;
}
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- tcl_cv_type_64bit="long long"
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_type_64bit=${tcl_type_64bit}
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test "${tcl_cv_type_64bit}" = none ; then
-printf "%s\n" "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define TCL_WIDE_INT_IS_LONG 1
+_ACEOF
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; }
+ echo "$as_me:$LINENO: result: using long" >&5
+echo "${ECHO_T}using long" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit}
+_ACEOF
+
+ echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5
+echo "${ECHO_T}${tcl_cv_type_64bit}" >&6
+
# Now check for auxiliary declarations
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5
-printf %s "checking for struct dirent64... " >&6; }
-if test ${tcl_cv_struct_dirent64+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for struct dirent64" >&5
+echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6
+if test "${tcl_cv_struct_dirent64+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <dirent.h>
int
-main (void)
+main ()
{
struct dirent64 p;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_struct_dirent64=yes
-else case e in #(
- e) tcl_cv_struct_dirent64=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_struct_dirent64=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5
-printf "%s\n" "$tcl_cv_struct_dirent64" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5
+echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6
if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
-printf "%s\n" "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRUCT_DIRENT64 1
+_ACEOF
fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DIR64" >&5
-printf %s "checking for DIR64... " >&6; }
-if test ${tcl_cv_DIR64+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for struct stat64" >&5
+echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6
+if test "${tcl_cv_struct_stat64+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <sys/types.h>
-#include <dirent.h>
+#include <sys/stat.h>
int
-main (void)
+main ()
{
-struct dirent64 *p; DIR64 d = opendir64(".");
- p = readdir64(d); rewinddir64(d); closedir64(d);
+struct stat64 p;
+
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- tcl_cv_DIR64=yes
-else case e in #(
- e) tcl_cv_DIR64=no ;;
-esac
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_struct_stat64=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_struct_stat64=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_DIR64" >&5
-printf "%s\n" "$tcl_cv_DIR64" >&6; }
- if test "x${tcl_cv_DIR64}" = "xyes" ; then
+echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5
+echo "${ECHO_T}$tcl_cv_struct_stat64" >&6
+ if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
-printf "%s\n" "#define HAVE_DIR64 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRUCT_STAT64 1
+_ACEOF
fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5
-printf %s "checking for struct stat64... " >&6; }
-if test ${tcl_cv_struct_stat64+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+
+for ac_func in open64 lseek64
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <sys/stat.h>
-int
-main (void)
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
{
-struct stat64 p;
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+int
+main ()
+{
+return f != $ac_func;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- tcl_cv_struct_stat64=yes
-else case e in #(
- e) tcl_cv_struct_stat64=no ;;
-esac
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5
-printf "%s\n" "$tcl_cv_struct_stat64" >&6; }
- if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
-
-printf "%s\n" "#define HAVE_STRUCT_STAT64 1" >>confdefs.h
-
- fi
-
- ac_fn_c_check_func "$LINENO" "open64" "ac_cv_func_open64"
-if test "x$ac_cv_func_open64" = xyes
-then :
- printf "%s\n" "#define HAVE_OPEN64 1" >>confdefs.h
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
fi
-ac_fn_c_check_func "$LINENO" "lseek64" "ac_cv_func_lseek64"
-if test "x$ac_cv_func_lseek64" = xyes
-then :
- printf "%s\n" "#define HAVE_LSEEK64 1" >>confdefs.h
+done
-fi
+ echo "$as_me:$LINENO: checking for off64_t" >&5
+echo $ECHO_N "checking for off64_t... $ECHO_C" >&6
+ if test "${tcl_cv_type_off64_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5
-printf %s "checking for off64_t... " >&6; }
- if test ${tcl_cv_type_off64_t+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
int
-main (void)
+main ()
{
off64_t offset;
@@ -8044,28 +9831,51 @@ off64_t offset;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_type_off64_t=yes
-else case e in #(
- e) tcl_cv_type_off64_t=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_type_off64_t=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test "x${tcl_cv_type_off64_t}" = "xyes" && \
test "x${ac_cv_func_lseek64}" = "xyes" && \
test "x${ac_cv_func_open64}" = "xyes" ; then
-printf "%s\n" "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_TYPE_OFF64_T 1
+_ACEOF
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; }
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
fi
@@ -8075,243 +9885,235 @@ printf "%s\n" "no" >&6; }
# Tcl_UniChar strings to memcmp on big-endian systems.
#--------------------------------------------------------------------
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
-printf %s "checking whether byte ordering is bigendian... " >&6; }
-if test ${ac_cv_c_bigendian+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_cv_c_bigendian=unknown
- # See if we're dealing with a universal compiler.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __APPLE_CC__
- not a universal capable compiler
- #endif
- typedef int dummy;
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-
- # Check for potential -arch flags. It is not universal unless
- # there are at least two -arch flags with different values.
- ac_arch=
- ac_prev=
- for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
- if test -n "$ac_prev"; then
- case $ac_word in
- i?86 | x86_64 | ppc | ppc64)
- if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
- ac_arch=$ac_word
- else
- ac_cv_c_bigendian=universal
- break
- fi
- ;;
- esac
- ac_prev=
- elif test "x$ac_word" = "x-arch"; then
- ac_prev=arch
- fi
- done
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- if test $ac_cv_c_bigendian = unknown; then
- # See if sys/param.h defines the BYTE_ORDER macro.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
+if test "${ac_cv_c_bigendian+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # See if sys/param.h defines the BYTE_ORDER macro.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
- #include <sys/param.h>
+#include <sys/param.h>
int
-main (void)
+main ()
{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\
- && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\
- && LITTLE_ENDIAN)
- bogus endian macros
- #endif
+#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
+ bogus endian macros
+#endif
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
# It does; now see whether it defined to BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
- #include <sys/param.h>
+#include <sys/param.h>
int
-main (void)
+main ()
{
#if BYTE_ORDER != BIG_ENDIAN
- not big endian
- #endif
+ not big endian
+#endif
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_bigendian=yes
-else case e in #(
- e) ac_cv_c_bigendian=no ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- fi
- if test $ac_cv_c_bigendian = unknown; then
- # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <limits.h>
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-int
-main (void)
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
- bogus endian macros
- #endif
+ac_cv_c_bigendian=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- ;
- return 0;
-}
+# It does not; compile a test program.
+if test "$cross_compiling" = yes; then
+ # try to guess the endianness by grepping values into an object file
+ ac_cv_c_bigendian=unknown
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- # It does; now see whether it defined to _BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <limits.h>
-
+short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
+short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
int
-main (void)
+main ()
{
-#ifndef _BIG_ENDIAN
- not big endian
- #endif
-
+ _ascii (); _ebcdic ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
ac_cv_c_bigendian=yes
-else case e in #(
- e) ac_cv_c_bigendian=no ;;
-esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- fi
- if test $ac_cv_c_bigendian = unknown; then
- # Compile a test program.
- if test "$cross_compiling" = yes
-then :
- # Try to guess by grepping values from an object file.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-unsigned short int ascii_mm[] =
- { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
- unsigned short int ascii_ii[] =
- { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
- int use_ascii (int i) {
- return ascii_mm[i] + ascii_ii[i];
- }
- unsigned short int ebcdic_ii[] =
- { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
- unsigned short int ebcdic_mm[] =
- { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
- int use_ebcdic (int i) {
- return ebcdic_mm[i] + ebcdic_ii[i];
- }
- int
- main (int argc, char **argv)
- {
- /* Intimidate the compiler so that it does not
- optimize the arrays away. */
- char *p = argv[0];
- ascii_mm[1] = *p++; ebcdic_mm[1] = *p++;
- ascii_ii[1] = *p++; ebcdic_ii[1] = *p++;
- return use_ascii (argc) == use_ebcdic (*p);
- }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then
- ac_cv_c_bigendian=yes
- fi
- if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then
- if test "$ac_cv_c_bigendian" = unknown; then
- ac_cv_c_bigendian=no
- else
- # finding both strings is unlikely to happen, but who knows?
- ac_cv_c_bigendian=unknown
- fi
- fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_includes_default
int
-main (void)
+main ()
{
-
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long int l;
- char c[sizeof (long int)];
- } u;
- u.l = 1;
- return u.c[sizeof (long int) - 1] == 1;
-
- ;
- return 0;
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long l;
+ char c[sizeof (long)];
+ } u;
+ u.l = 1;
+ exit (u.c[sizeof (long) - 1] == 1);
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"
-then :
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_bigendian=no
-else case e in #(
- e) ac_cv_c_bigendian=yes ;;
-esac
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_bigendian=yes
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+echo "${ECHO_T}$ac_cv_c_bigendian" >&6
+case $ac_cv_c_bigendian in
+ yes)
- fi ;;
+cat >>confdefs.h <<\_ACEOF
+#define WORDS_BIGENDIAN 1
+_ACEOF
+ ;;
+ no)
+ ;;
+ *)
+ { { echo "$as_me:$LINENO: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+echo "$as_me: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+ { (exit 1); exit 1; }; } ;;
esac
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
-printf "%s\n" "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
- yes)
- printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h
-;; #(
- no)
- ;; #(
- universal)
- #
- ;; #(
- *)
- as_fn_error $? "unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
- esac
#--------------------------------------------------------------------
@@ -8321,252 +10123,899 @@ printf "%s\n" "$ac_cv_c_bigendian" >&6; }
# Check if Posix compliant getcwd exists, if not we'll use getwd.
- for ac_func in getcwd
-do :
- ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd"
-if test "x$ac_cv_func_getcwd" = xyes
-then :
- printf "%s\n" "#define HAVE_GETCWD 1" >>confdefs.h
+for ac_func in getcwd
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
-else case e in #(
- e)
-printf "%s\n" "#define USEGETWD 1" >>confdefs.h
- ;;
-esac
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define USEGETWD 1
+_ACEOF
+
+fi
done
+
# Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really
# define USEGETWD even if the posix getcwd exists. Add a test ?
-ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp"
-if test "x$ac_cv_func_mkstemp" = xyes
-then :
- printf "%s\n" "#define HAVE_MKSTEMP 1" >>confdefs.h
-else case e in #(
- e) case " $LIBOBJS " in
- *" mkstemp.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext"
- ;;
-esac
- ;;
-esac
+
+
+for ac_func in opendir strtol waitpid
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
-ac_fn_c_check_func "$LINENO" "waitpid" "ac_cv_func_waitpid"
-if test "x$ac_cv_func_waitpid" = xyes
-then :
- printf "%s\n" "#define HAVE_WAITPID 1" >>confdefs.h
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-else case e in #(
- e) case " $LIBOBJS " in
- *" waitpid.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS waitpid.$ac_objext"
- ;;
-esac
- ;;
+else
+ case $LIBOBJS in
+ "$ac_func.$ac_objext" | \
+ *" $ac_func.$ac_objext" | \
+ "$ac_func.$ac_objext "* | \
+ *" $ac_func.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
esac
+
fi
+done
-ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror"
-if test "x$ac_cv_func_strerror" = xyes
-then :
-else case e in #(
- e)
-printf "%s\n" "#define NO_STRERROR 1" >>confdefs.h
- ;;
-esac
+echo "$as_me:$LINENO: checking for strerror" >&5
+echo $ECHO_N "checking for strerror... $ECHO_C" >&6
+if test "${ac_cv_func_strerror+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define strerror to an innocuous variant, in case <limits.h> declares strerror.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define strerror innocuous_strerror
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char strerror (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef strerror
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strerror ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_strerror) || defined (__stub___strerror)
+choke me
+#else
+char (*f) () = strerror;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != strerror;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_strerror=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_strerror=no
fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_strerror" >&5
+echo "${ECHO_T}$ac_cv_func_strerror" >&6
+if test $ac_cv_func_strerror = yes; then
+ :
+else
-ac_fn_c_check_func "$LINENO" "getwd" "ac_cv_func_getwd"
-if test "x$ac_cv_func_getwd" = xyes
-then :
+cat >>confdefs.h <<\_ACEOF
+#define NO_STRERROR 1
+_ACEOF
-else case e in #(
- e)
-printf "%s\n" "#define NO_GETWD 1" >>confdefs.h
- ;;
-esac
fi
-ac_fn_c_check_func "$LINENO" "wait3" "ac_cv_func_wait3"
-if test "x$ac_cv_func_wait3" = xyes
-then :
+echo "$as_me:$LINENO: checking for getwd" >&5
+echo $ECHO_N "checking for getwd... $ECHO_C" >&6
+if test "${ac_cv_func_getwd+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define getwd to an innocuous variant, in case <limits.h> declares getwd.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define getwd innocuous_getwd
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char getwd (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef getwd
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char getwd ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_getwd) || defined (__stub___getwd)
+choke me
+#else
+char (*f) () = getwd;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != getwd;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_getwd=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_getwd=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_getwd" >&5
+echo "${ECHO_T}$ac_cv_func_getwd" >&6
+if test $ac_cv_func_getwd = yes; then
+ :
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_GETWD 1
+_ACEOF
-else case e in #(
- e)
-printf "%s\n" "#define NO_WAIT3 1" >>confdefs.h
- ;;
-esac
fi
-ac_fn_c_check_func "$LINENO" "fork" "ac_cv_func_fork"
-if test "x$ac_cv_func_fork" = xyes
-then :
+echo "$as_me:$LINENO: checking for wait3" >&5
+echo $ECHO_N "checking for wait3... $ECHO_C" >&6
+if test "${ac_cv_func_wait3+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define wait3 to an innocuous variant, in case <limits.h> declares wait3.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define wait3 innocuous_wait3
-else case e in #(
- e)
-printf "%s\n" "#define NO_FORK 1" >>confdefs.h
- ;;
-esac
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char wait3 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef wait3
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char wait3 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_wait3) || defined (__stub___wait3)
+choke me
+#else
+char (*f) () = wait3;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != wait3;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_wait3=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_wait3=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_func_wait3" >&5
+echo "${ECHO_T}$ac_cv_func_wait3" >&6
+if test $ac_cv_func_wait3 = yes; then
+ :
+else
-ac_fn_c_check_func "$LINENO" "mknod" "ac_cv_func_mknod"
-if test "x$ac_cv_func_mknod" = xyes
-then :
+cat >>confdefs.h <<\_ACEOF
+#define NO_WAIT3 1
+_ACEOF
-else case e in #(
- e)
-printf "%s\n" "#define NO_MKNOD 1" >>confdefs.h
- ;;
-esac
fi
-ac_fn_c_check_func "$LINENO" "tcdrain" "ac_cv_func_tcdrain"
-if test "x$ac_cv_func_tcdrain" = xyes
-then :
+echo "$as_me:$LINENO: checking for uname" >&5
+echo $ECHO_N "checking for uname... $ECHO_C" >&6
+if test "${ac_cv_func_uname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define uname to an innocuous variant, in case <limits.h> declares uname.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define uname innocuous_uname
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char uname (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
-else case e in #(
- e)
-printf "%s\n" "#define NO_TCDRAIN 1" >>confdefs.h
- ;;
-esac
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef uname
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char uname ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_uname) || defined (__stub___uname)
+choke me
+#else
+char (*f) () = uname;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != uname;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_uname=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_uname=no
fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_uname" >&5
+echo "${ECHO_T}$ac_cv_func_uname" >&6
+if test $ac_cv_func_uname = yes; then
+ :
+else
-ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname"
-if test "x$ac_cv_func_uname" = xyes
-then :
+cat >>confdefs.h <<\_ACEOF
+#define NO_UNAME 1
+_ACEOF
-else case e in #(
- e)
-printf "%s\n" "#define NO_UNAME 1" >>confdefs.h
- ;;
-esac
fi
-if test "`uname -s`" = "Darwin" && \
+if test "`uname -s`" = "Darwin" && test "${TCL_THREADS}" = 1 && \
test "`uname -r | awk -F. '{print $1}'`" -lt 7; then
# prior to Darwin 7, realpath is not threadsafe, so don't
# use it when threads are enabled, c.f. bug # 711232
ac_cv_func_realpath=no
fi
-ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath"
-if test "x$ac_cv_func_realpath" = xyes
-then :
+echo "$as_me:$LINENO: checking for realpath" >&5
+echo $ECHO_N "checking for realpath... $ECHO_C" >&6
+if test "${ac_cv_func_realpath+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define realpath to an innocuous variant, in case <limits.h> declares realpath.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define realpath innocuous_realpath
-else case e in #(
- e)
-printf "%s\n" "#define NO_REALPATH 1" >>confdefs.h
- ;;
-esac
-fi
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char realpath (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+#undef realpath
- NEED_FAKE_RFC2553=0
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char realpath ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_realpath) || defined (__stub___realpath)
+choke me
+#else
+char (*f) () = realpath;
+#endif
+#ifdef __cplusplus
+}
+#endif
- for ac_func in getnameinfo getaddrinfo freeaddrinfo gai_strerror
-do :
- as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | sed "$as_sed_sh"`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"
-then :
- cat >>confdefs.h <<_ACEOF
-#define `printf "%s\n" "HAVE_$ac_func" | sed "$as_sed_cpp"` 1
+int
+main ()
+{
+return f != realpath;
+ ;
+ return 0;
+}
_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_realpath=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-else case e in #(
- e) NEED_FAKE_RFC2553=1 ;;
-esac
+ac_cv_func_realpath=no
fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_realpath" >&5
+echo "${ECHO_T}$ac_cv_func_realpath" >&6
+if test $ac_cv_func_realpath = yes; then
+ :
+else
-done
- ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-
-"
-if test "x$ac_cv_type_struct_addrinfo" = xyes
-then :
-
-printf "%s\n" "#define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h
-
+cat >>confdefs.h <<\_ACEOF
+#define NO_REALPATH 1
+_ACEOF
-else case e in #(
- e) NEED_FAKE_RFC2553=1 ;;
-esac
fi
-ac_fn_c_check_type "$LINENO" "struct in6_addr" "ac_cv_type_struct_in6_addr" "
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-"
-if test "x$ac_cv_type_struct_in6_addr" = xyes
-then :
-printf "%s\n" "#define HAVE_STRUCT_IN6_ADDR 1" >>confdefs.h
+echo "$as_me:$LINENO: checking for getaddrinfo" >&5
+echo $ECHO_N "checking for getaddrinfo... $ECHO_C" >&6
+if test "${ac_cv_func_getaddrinfo+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define getaddrinfo to an innocuous variant, in case <limits.h> declares getaddrinfo.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define getaddrinfo innocuous_getaddrinfo
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char getaddrinfo (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
-else case e in #(
- e) NEED_FAKE_RFC2553=1 ;;
-esac
-fi
-ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
-"
-if test "x$ac_cv_type_struct_sockaddr_in6" = xyes
-then :
+#undef getaddrinfo
-printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char getaddrinfo ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_getaddrinfo) || defined (__stub___getaddrinfo)
+choke me
+#else
+char (*f) () = getaddrinfo;
+#endif
+#ifdef __cplusplus
+}
+#endif
+int
+main ()
+{
+return f != getaddrinfo;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_getaddrinfo=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-else case e in #(
- e) NEED_FAKE_RFC2553=1 ;;
-esac
+ac_cv_func_getaddrinfo=no
fi
-ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_getaddrinfo" >&5
+echo "${ECHO_T}$ac_cv_func_getaddrinfo" >&6
+if test $ac_cv_func_getaddrinfo = yes; then
-"
-if test "x$ac_cv_type_struct_sockaddr_storage" = xyes
-then :
+ echo "$as_me:$LINENO: checking for working getaddrinfo" >&5
+echo $ECHO_N "checking for working getaddrinfo... $ECHO_C" >&6
+if test "${tcl_cv_api_getaddrinfo+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
-printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+ #include <netdb.h>
-else case e in #(
- e) NEED_FAKE_RFC2553=1 ;;
-esac
-fi
+int
+main ()
+{
-if test "x$NEED_FAKE_RFC2553" = "x1"; then
+ const char *name, *port;
+ struct addrinfo *aiPtr, hints;
+ (void)getaddrinfo(name,port, &hints, &aiPtr);
+ (void)freeaddrinfo(aiPtr);
-printf "%s\n" "#define NEED_FAKE_RFC2553 1" >>confdefs.h
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_api_getaddrinfo=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- case " $LIBOBJS " in
- *" fake-rfc2553.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS fake-rfc2553.$ac_objext"
- ;;
-esac
+tcl_cv_getaddrinfo=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_api_getaddrinfo" >&5
+echo "${ECHO_T}$tcl_cv_api_getaddrinfo" >&6
+ tcl_ok=$tcl_cv_api_getaddrinfo
+ if test "$tcl_ok" = yes; then
- ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy"
-if test "x$ac_cv_func_strlcpy" = xyes
-then :
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETADDRINFO 1
+_ACEOF
-fi
+ fi
fi
@@ -8575,25 +11024,117 @@ fi
# Look for thread-safe variants of some library functions.
#--------------------------------------------------------------------
-ac_fn_c_check_func "$LINENO" "getpwuid_r" "ac_cv_func_getpwuid_r"
-if test "x$ac_cv_func_getpwuid_r" = xyes
-then :
+if test "${TCL_THREADS}" = 1; then
+ echo "$as_me:$LINENO: checking for getpwuid_r" >&5
+echo $ECHO_N "checking for getpwuid_r... $ECHO_C" >&6
+if test "${ac_cv_func_getpwuid_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define getpwuid_r to an innocuous variant, in case <limits.h> declares getpwuid_r.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define getpwuid_r innocuous_getpwuid_r
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char getpwuid_r (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwuid_r with 5 args" >&5
-printf %s "checking for getpwuid_r with 5 args... " >&6; }
-if test ${tcl_cv_api_getpwuid_r_5+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+#undef getpwuid_r
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char getpwuid_r ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_getpwuid_r) || defined (__stub___getpwuid_r)
+choke me
+#else
+char (*f) () = getpwuid_r;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != getpwuid_r;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_getpwuid_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_getpwuid_r=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_getpwuid_r" >&5
+echo "${ECHO_T}$ac_cv_func_getpwuid_r" >&6
+if test $ac_cv_func_getpwuid_r = yes; then
+
+ echo "$as_me:$LINENO: checking for getpwuid_r with 5 args" >&5
+echo $ECHO_N "checking for getpwuid_r with 5 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getpwuid_r_5+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <pwd.h>
int
-main (void)
+main ()
{
uid_t uid;
@@ -8607,39 +11148,65 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_api_getpwuid_r_5=yes
-else case e in #(
- e) tcl_cv_api_getpwuid_r_5=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_api_getpwuid_r_5=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwuid_r_5" >&5
-printf "%s\n" "$tcl_cv_api_getpwuid_r_5" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_api_getpwuid_r_5" >&5
+echo "${ECHO_T}$tcl_cv_api_getpwuid_r_5" >&6
tcl_ok=$tcl_cv_api_getpwuid_r_5
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETPWUID_R_5 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETPWUID_R_5 1
+_ACEOF
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwuid_r with 4 args" >&5
-printf %s "checking for getpwuid_r with 4 args... " >&6; }
-if test ${tcl_cv_api_getpwuid_r_4+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for getpwuid_r with 4 args" >&5
+echo $ECHO_N "checking for getpwuid_r with 4 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getpwuid_r_4+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <pwd.h>
int
-main (void)
+main ()
{
uid_t uid;
@@ -8653,52 +11220,168 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_api_getpwuid_r_4=yes
-else case e in #(
- e) tcl_cv_api_getpwuid_r_4=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_api_getpwuid_r_4=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwuid_r_4" >&5
-printf "%s\n" "$tcl_cv_api_getpwuid_r_4" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_api_getpwuid_r_4" >&5
+echo "${ECHO_T}$tcl_cv_api_getpwuid_r_4" >&6
tcl_ok=$tcl_cv_api_getpwuid_r_4
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETPWUID_R_4 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETPWUID_R_4 1
+_ACEOF
fi
fi
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETPWUID_R 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETPWUID_R 1
+_ACEOF
fi
fi
-ac_fn_c_check_func "$LINENO" "getpwnam_r" "ac_cv_func_getpwnam_r"
-if test "x$ac_cv_func_getpwnam_r" = xyes
-then :
+ echo "$as_me:$LINENO: checking for getpwnam_r" >&5
+echo $ECHO_N "checking for getpwnam_r... $ECHO_C" >&6
+if test "${ac_cv_func_getpwnam_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define getpwnam_r to an innocuous variant, in case <limits.h> declares getpwnam_r.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define getpwnam_r innocuous_getpwnam_r
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char getpwnam_r (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef getpwnam_r
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char getpwnam_r ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_getpwnam_r) || defined (__stub___getpwnam_r)
+choke me
+#else
+char (*f) () = getpwnam_r;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != getpwnam_r;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_getpwnam_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_getpwnam_r=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_getpwnam_r" >&5
+echo "${ECHO_T}$ac_cv_func_getpwnam_r" >&6
+if test $ac_cv_func_getpwnam_r = yes; then
+
+ echo "$as_me:$LINENO: checking for getpwnam_r with 5 args" >&5
+echo $ECHO_N "checking for getpwnam_r with 5 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getpwnam_r_5+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwnam_r with 5 args" >&5
-printf %s "checking for getpwnam_r with 5 args... " >&6; }
-if test ${tcl_cv_api_getpwnam_r_5+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <pwd.h>
int
-main (void)
+main ()
{
char *name;
@@ -8712,39 +11395,65 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_api_getpwnam_r_5=yes
-else case e in #(
- e) tcl_cv_api_getpwnam_r_5=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_api_getpwnam_r_5=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwnam_r_5" >&5
-printf "%s\n" "$tcl_cv_api_getpwnam_r_5" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_api_getpwnam_r_5" >&5
+echo "${ECHO_T}$tcl_cv_api_getpwnam_r_5" >&6
tcl_ok=$tcl_cv_api_getpwnam_r_5
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETPWNAM_R_5 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETPWNAM_R_5 1
+_ACEOF
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwnam_r with 4 args" >&5
-printf %s "checking for getpwnam_r with 4 args... " >&6; }
-if test ${tcl_cv_api_getpwnam_r_4+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for getpwnam_r with 4 args" >&5
+echo $ECHO_N "checking for getpwnam_r with 4 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getpwnam_r_4+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <pwd.h>
int
-main (void)
+main ()
{
char *name;
@@ -8758,52 +11467,168 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_api_getpwnam_r_4=yes
-else case e in #(
- e) tcl_cv_api_getpwnam_r_4=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_api_getpwnam_r_4=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwnam_r_4" >&5
-printf "%s\n" "$tcl_cv_api_getpwnam_r_4" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_api_getpwnam_r_4" >&5
+echo "${ECHO_T}$tcl_cv_api_getpwnam_r_4" >&6
tcl_ok=$tcl_cv_api_getpwnam_r_4
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETPWNAM_R_4 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETPWNAM_R_4 1
+_ACEOF
fi
fi
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETPWNAM_R 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETPWNAM_R 1
+_ACEOF
fi
fi
-ac_fn_c_check_func "$LINENO" "getgrgid_r" "ac_cv_func_getgrgid_r"
-if test "x$ac_cv_func_getgrgid_r" = xyes
-then :
+ echo "$as_me:$LINENO: checking for getgrgid_r" >&5
+echo $ECHO_N "checking for getgrgid_r... $ECHO_C" >&6
+if test "${ac_cv_func_getgrgid_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define getgrgid_r to an innocuous variant, in case <limits.h> declares getgrgid_r.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define getgrgid_r innocuous_getgrgid_r
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char getgrgid_r (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef getgrgid_r
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char getgrgid_r ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_getgrgid_r) || defined (__stub___getgrgid_r)
+choke me
+#else
+char (*f) () = getgrgid_r;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != getgrgid_r;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_getgrgid_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_getgrgid_r=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_getgrgid_r" >&5
+echo "${ECHO_T}$ac_cv_func_getgrgid_r" >&6
+if test $ac_cv_func_getgrgid_r = yes; then
+
+ echo "$as_me:$LINENO: checking for getgrgid_r with 5 args" >&5
+echo $ECHO_N "checking for getgrgid_r with 5 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getgrgid_r_5+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrgid_r with 5 args" >&5
-printf %s "checking for getgrgid_r with 5 args... " >&6; }
-if test ${tcl_cv_api_getgrgid_r_5+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <grp.h>
int
-main (void)
+main ()
{
gid_t gid;
@@ -8817,39 +11642,65 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_api_getgrgid_r_5=yes
-else case e in #(
- e) tcl_cv_api_getgrgid_r_5=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_api_getgrgid_r_5=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrgid_r_5" >&5
-printf "%s\n" "$tcl_cv_api_getgrgid_r_5" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_api_getgrgid_r_5" >&5
+echo "${ECHO_T}$tcl_cv_api_getgrgid_r_5" >&6
tcl_ok=$tcl_cv_api_getgrgid_r_5
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETGRGID_R_5 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETGRGID_R_5 1
+_ACEOF
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrgid_r with 4 args" >&5
-printf %s "checking for getgrgid_r with 4 args... " >&6; }
-if test ${tcl_cv_api_getgrgid_r_4+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for getgrgid_r with 4 args" >&5
+echo $ECHO_N "checking for getgrgid_r with 4 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getgrgid_r_4+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <grp.h>
int
-main (void)
+main ()
{
gid_t gid;
@@ -8863,52 +11714,168 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_api_getgrgid_r_4=yes
-else case e in #(
- e) tcl_cv_api_getgrgid_r_4=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_api_getgrgid_r_4=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrgid_r_4" >&5
-printf "%s\n" "$tcl_cv_api_getgrgid_r_4" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_api_getgrgid_r_4" >&5
+echo "${ECHO_T}$tcl_cv_api_getgrgid_r_4" >&6
tcl_ok=$tcl_cv_api_getgrgid_r_4
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETGRGID_R_4 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETGRGID_R_4 1
+_ACEOF
fi
fi
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETGRGID_R 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETGRGID_R 1
+_ACEOF
fi
fi
-ac_fn_c_check_func "$LINENO" "getgrnam_r" "ac_cv_func_getgrnam_r"
-if test "x$ac_cv_func_getgrnam_r" = xyes
-then :
+ echo "$as_me:$LINENO: checking for getgrnam_r" >&5
+echo $ECHO_N "checking for getgrnam_r... $ECHO_C" >&6
+if test "${ac_cv_func_getgrnam_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define getgrnam_r to an innocuous variant, in case <limits.h> declares getgrnam_r.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define getgrnam_r innocuous_getgrnam_r
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char getgrnam_r (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef getgrnam_r
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrnam_r with 5 args" >&5
-printf %s "checking for getgrnam_r with 5 args... " >&6; }
-if test ${tcl_cv_api_getgrnam_r_5+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char getgrnam_r ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_getgrnam_r) || defined (__stub___getgrnam_r)
+choke me
+#else
+char (*f) () = getgrnam_r;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != getgrnam_r;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_getgrnam_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_getgrnam_r=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_getgrnam_r" >&5
+echo "${ECHO_T}$ac_cv_func_getgrnam_r" >&6
+if test $ac_cv_func_getgrnam_r = yes; then
+
+ echo "$as_me:$LINENO: checking for getgrnam_r with 5 args" >&5
+echo $ECHO_N "checking for getgrnam_r with 5 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getgrnam_r_5+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <grp.h>
int
-main (void)
+main ()
{
char *name;
@@ -8922,39 +11889,65 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_api_getgrnam_r_5=yes
-else case e in #(
- e) tcl_cv_api_getgrnam_r_5=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_api_getgrnam_r_5=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrnam_r_5" >&5
-printf "%s\n" "$tcl_cv_api_getgrnam_r_5" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_api_getgrnam_r_5" >&5
+echo "${ECHO_T}$tcl_cv_api_getgrnam_r_5" >&6
tcl_ok=$tcl_cv_api_getgrnam_r_5
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETGRNAM_R_5 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETGRNAM_R_5 1
+_ACEOF
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrnam_r with 4 args" >&5
-printf %s "checking for getgrnam_r with 4 args... " >&6; }
-if test ${tcl_cv_api_getgrnam_r_4+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for getgrnam_r with 4 args" >&5
+echo $ECHO_N "checking for getgrnam_r with 4 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getgrnam_r_4+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <grp.h>
int
-main (void)
+main ()
{
char *name;
@@ -8968,100 +11961,200 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_api_getgrnam_r_4=yes
-else case e in #(
- e) tcl_cv_api_getgrnam_r_4=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_api_getgrnam_r_4=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrnam_r_4" >&5
-printf "%s\n" "$tcl_cv_api_getgrnam_r_4" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_api_getgrnam_r_4" >&5
+echo "${ECHO_T}$tcl_cv_api_getgrnam_r_4" >&6
tcl_ok=$tcl_cv_api_getgrnam_r_4
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETGRNAM_R_4 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETGRNAM_R_4 1
+_ACEOF
fi
fi
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETGRNAM_R 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETGRNAM_R 1
+_ACEOF
fi
fi
-if test "`uname -s`" = "Darwin" && \
- test "`uname -r | awk -F. '{print $1}'`" -gt 5; then
- # Starting with Darwin 6 (Mac OSX 10.2), gethostbyX
- # are actually MT-safe as they always return pointers
- # from TSD instead of static storage.
+ if test "`uname -s`" = "Darwin" && \
+ test "`uname -r | awk -F. '{print $1}'`" -gt 5; then
+ # Starting with Darwin 6 (Mac OSX 10.2), gethostbyX
+ # are actually MT-safe as they always return pointers
+ # from TSD instead of static storage.
-printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYNAME 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MTSAFE_GETHOSTBYNAME 1
+_ACEOF
-printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYADDR 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MTSAFE_GETHOSTBYADDR 1
+_ACEOF
-elif test "`uname -s`" = "HP-UX" && \
- test "`uname -r|sed -e 's|B\.||' -e 's|\..*$||'`" -gt 10; then
- # Starting with HPUX 11.00 (we believe), gethostbyX
- # are actually MT-safe as they always return pointers
- # from TSD instead of static storage.
+ elif test "`uname -s`" = "HP-UX" && \
+ test "`uname -r|sed -e 's|B\.||' -e 's|\..*$||'`" -gt 10; then
+ # Starting with HPUX 11.00 (we believe), gethostbyX
+ # are actually MT-safe as they always return pointers
+ # from TSD instead of static storage.
-printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYNAME 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MTSAFE_GETHOSTBYNAME 1
+_ACEOF
-printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYADDR 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MTSAFE_GETHOSTBYADDR 1
+_ACEOF
+ else
+ echo "$as_me:$LINENO: checking for gethostbyname_r" >&5
+echo $ECHO_N "checking for gethostbyname_r... $ECHO_C" >&6
+if test "${ac_cv_func_gethostbyname_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define gethostbyname_r to an innocuous variant, in case <limits.h> declares gethostbyname_r.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define gethostbyname_r innocuous_gethostbyname_r
- # Avoids picking hidden internal symbol from libc
- ac_fn_check_decl "$LINENO" "gethostbyname_r" "ac_cv_have_decl_gethostbyname_r" "#include <netdb.h>
-" "$ac_c_undeclared_builtin_options" "CFLAGS"
-if test "x$ac_cv_have_decl_gethostbyname_r" = xyes
-then :
- ac_have_decl=1
-else case e in #(
- e) ac_have_decl=0 ;;
-esac
-fi
-printf "%s\n" "#define HAVE_DECL_GETHOSTBYNAME_R $ac_have_decl" >>confdefs.h
-if test $ac_have_decl = 1
-then :
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char gethostbyname_r (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
- tcl_cv_api_gethostbyname_r=yes
-else case e in #(
- e) tcl_cv_api_gethostbyname_r=no ;;
-esac
-fi
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef gethostbyname_r
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname_r ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_gethostbyname_r) || defined (__stub___gethostbyname_r)
+choke me
+#else
+char (*f) () = gethostbyname_r;
+#endif
+#ifdef __cplusplus
+}
+#endif
+int
+main ()
+{
+return f != gethostbyname_r;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_gethostbyname_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_func_gethostbyname_r=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5
+echo "${ECHO_T}$ac_cv_func_gethostbyname_r" >&6
+if test $ac_cv_func_gethostbyname_r = yes; then
- if test "$tcl_cv_api_gethostbyname_r" = yes; then
- ac_fn_c_check_func "$LINENO" "gethostbyname_r" "ac_cv_func_gethostbyname_r"
-if test "x$ac_cv_func_gethostbyname_r" = xyes
-then :
+ echo "$as_me:$LINENO: checking for gethostbyname_r with 6 args" >&5
+echo $ECHO_N "checking for gethostbyname_r with 6 args... $ECHO_C" >&6
+if test "${tcl_cv_api_gethostbyname_r_6+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 6 args" >&5
-printf %s "checking for gethostbyname_r with 6 args... " >&6; }
-if test ${tcl_cv_api_gethostbyname_r_6+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <netdb.h>
int
-main (void)
+main ()
{
char *name;
@@ -9076,38 +12169,64 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_api_gethostbyname_r_6=yes
-else case e in #(
- e) tcl_cv_api_gethostbyname_r_6=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_api_gethostbyname_r_6=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyname_r_6" >&5
-printf "%s\n" "$tcl_cv_api_gethostbyname_r_6" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_api_gethostbyname_r_6" >&5
+echo "${ECHO_T}$tcl_cv_api_gethostbyname_r_6" >&6
tcl_ok=$tcl_cv_api_gethostbyname_r_6
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_6 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETHOSTBYNAME_R_6 1
+_ACEOF
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 5 args" >&5
-printf %s "checking for gethostbyname_r with 5 args... " >&6; }
-if test ${tcl_cv_api_gethostbyname_r_5+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for gethostbyname_r with 5 args" >&5
+echo $ECHO_N "checking for gethostbyname_r with 5 args... $ECHO_C" >&6
+if test "${tcl_cv_api_gethostbyname_r_5+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <netdb.h>
int
-main (void)
+main ()
{
char *name;
@@ -9122,38 +12241,64 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_api_gethostbyname_r_5=yes
-else case e in #(
- e) tcl_cv_api_gethostbyname_r_5=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_api_gethostbyname_r_5=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyname_r_5" >&5
-printf "%s\n" "$tcl_cv_api_gethostbyname_r_5" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_api_gethostbyname_r_5" >&5
+echo "${ECHO_T}$tcl_cv_api_gethostbyname_r_5" >&6
tcl_ok=$tcl_cv_api_gethostbyname_r_5
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_5 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETHOSTBYNAME_R_5 1
+_ACEOF
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 3 args" >&5
-printf %s "checking for gethostbyname_r with 3 args... " >&6; }
-if test ${tcl_cv_api_gethostbyname_r_3+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for gethostbyname_r with 3 args" >&5
+echo $ECHO_N "checking for gethostbyname_r with 3 args... $ECHO_C" >&6
+if test "${tcl_cv_api_gethostbyname_r_3+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <netdb.h>
int
-main (void)
+main ()
{
char *name;
@@ -9166,78 +12311,168 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_api_gethostbyname_r_3=yes
-else case e in #(
- e) tcl_cv_api_gethostbyname_r_3=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_api_gethostbyname_r_3=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyname_r_3" >&5
-printf "%s\n" "$tcl_cv_api_gethostbyname_r_3" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_api_gethostbyname_r_3" >&5
+echo "${ECHO_T}$tcl_cv_api_gethostbyname_r_3" >&6
tcl_ok=$tcl_cv_api_gethostbyname_r_3
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_3 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETHOSTBYNAME_R_3 1
+_ACEOF
fi
fi
fi
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETHOSTBYNAME_R 1
+_ACEOF
fi
fi
- fi
+ echo "$as_me:$LINENO: checking for gethostbyaddr_r" >&5
+echo $ECHO_N "checking for gethostbyaddr_r... $ECHO_C" >&6
+if test "${ac_cv_func_gethostbyaddr_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define gethostbyaddr_r to an innocuous variant, in case <limits.h> declares gethostbyaddr_r.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define gethostbyaddr_r innocuous_gethostbyaddr_r
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char gethostbyaddr_r (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
- # Avoids picking hidden internal symbol from libc
- ac_fn_check_decl "$LINENO" "gethostbyaddr_r" "ac_cv_have_decl_gethostbyaddr_r" "#include <netdb.h>
-" "$ac_c_undeclared_builtin_options" "CFLAGS"
-if test "x$ac_cv_have_decl_gethostbyaddr_r" = xyes
-then :
- ac_have_decl=1
-else case e in #(
- e) ac_have_decl=0 ;;
-esac
-fi
-printf "%s\n" "#define HAVE_DECL_GETHOSTBYADDR_R $ac_have_decl" >>confdefs.h
-if test $ac_have_decl = 1
-then :
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
- tcl_cv_api_gethostbyaddr_r=yes
-else case e in #(
- e) tcl_cv_api_gethostbyaddr_r=no ;;
-esac
-fi
+#undef gethostbyaddr_r
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyaddr_r ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_gethostbyaddr_r) || defined (__stub___gethostbyaddr_r)
+choke me
+#else
+char (*f) () = gethostbyaddr_r;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != gethostbyaddr_r;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_gethostbyaddr_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_func_gethostbyaddr_r=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyaddr_r" >&5
+echo "${ECHO_T}$ac_cv_func_gethostbyaddr_r" >&6
+if test $ac_cv_func_gethostbyaddr_r = yes; then
- if test "$tcl_cv_api_gethostbyaddr_r" = yes; then
- ac_fn_c_check_func "$LINENO" "gethostbyaddr_r" "ac_cv_func_gethostbyaddr_r"
-if test "x$ac_cv_func_gethostbyaddr_r" = xyes
-then :
+ echo "$as_me:$LINENO: checking for gethostbyaddr_r with 7 args" >&5
+echo $ECHO_N "checking for gethostbyaddr_r with 7 args... $ECHO_C" >&6
+if test "${tcl_cv_api_gethostbyaddr_r_7+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr_r with 7 args" >&5
-printf %s "checking for gethostbyaddr_r with 7 args... " >&6; }
-if test ${tcl_cv_api_gethostbyaddr_r_7+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <netdb.h>
int
-main (void)
+main ()
{
char *addr;
@@ -9255,38 +12490,64 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_api_gethostbyaddr_r_7=yes
-else case e in #(
- e) tcl_cv_api_gethostbyaddr_r_7=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_api_gethostbyaddr_r_7=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyaddr_r_7" >&5
-printf "%s\n" "$tcl_cv_api_gethostbyaddr_r_7" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_api_gethostbyaddr_r_7" >&5
+echo "${ECHO_T}$tcl_cv_api_gethostbyaddr_r_7" >&6
tcl_ok=$tcl_cv_api_gethostbyaddr_r_7
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETHOSTBYADDR_R_7 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETHOSTBYADDR_R_7 1
+_ACEOF
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr_r with 8 args" >&5
-printf %s "checking for gethostbyaddr_r with 8 args... " >&6; }
-if test ${tcl_cv_api_gethostbyaddr_r_8+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for gethostbyaddr_r with 8 args" >&5
+echo $ECHO_N "checking for gethostbyaddr_r with 8 args... $ECHO_C" >&6
+if test "${tcl_cv_api_gethostbyaddr_r_8+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <netdb.h>
int
-main (void)
+main ()
{
char *addr;
@@ -9304,66 +12565,522 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_api_gethostbyaddr_r_8=yes
-else case e in #(
- e) tcl_cv_api_gethostbyaddr_r_8=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_api_gethostbyaddr_r_8=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyaddr_r_8" >&5
-printf "%s\n" "$tcl_cv_api_gethostbyaddr_r_8" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_api_gethostbyaddr_r_8" >&5
+echo "${ECHO_T}$tcl_cv_api_gethostbyaddr_r_8" >&6
tcl_ok=$tcl_cv_api_gethostbyaddr_r_8
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETHOSTBYADDR_R_8 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETHOSTBYADDR_R_8 1
+_ACEOF
fi
fi
if test "$tcl_ok" = yes; then
-printf "%s\n" "#define HAVE_GETHOSTBYADDR_R 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETHOSTBYADDR_R 1
+_ACEOF
fi
fi
fi
-
fi
#---------------------------------------------------------------------------
-# Check for serial port interface.
-#
-# termios.h is present on all POSIX systems.
-# sys/ioctl.h is almost always present, though what it contains
-# is system-specific.
-# sys/modem.h is needed on HP-UX.
+# Determine which interface to use to talk to the serial port.
+# Note that #include lines must begin in leftmost column for
+# some compilers to recognize them as preprocessor directives.
#---------------------------------------------------------------------------
-ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default"
-if test "x$ac_cv_header_termios_h" = xyes
-then :
- printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h
+
+for ac_header in sys/modem.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ echo "$as_me:$LINENO: checking termios vs. termio vs. sgtty" >&5
+echo $ECHO_N "checking termios vs. termio vs. sgtty... $ECHO_C" >&6
+if test "${tcl_cv_api_serial+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ if test "$cross_compiling" = yes; then
+ tcl_cv_api_serial=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <termios.h>
+
+int main() {
+ struct termios t;
+ if (tcgetattr(0, &t) == 0) {
+ cfsetospeed(&t, 0);
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_api_serial=termios
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+tcl_cv_api_serial=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+ if test $tcl_cv_api_serial = no ; then
+ if test "$cross_compiling" = yes; then
+ tcl_cv_api_serial=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <termio.h>
+
+int main() {
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0) {
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_api_serial=termio
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+tcl_cv_api_serial=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+ fi
+ if test $tcl_cv_api_serial = no ; then
+ if test "$cross_compiling" = yes; then
+ tcl_cv_api_serial=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <sgtty.h>
+
+int main() {
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0) {
+ t.sg_ospeed = 0;
+ t.sg_flags |= ODDP | EVENP | RAW;
+ return 0;
+ }
+ return 1;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_api_serial=sgtty
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+tcl_cv_api_serial=no
fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+ fi
+ if test $tcl_cv_api_serial = no ; then
+ if test "$cross_compiling" = yes; then
+ tcl_cv_api_serial=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <termios.h>
+#include <errno.h>
-ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_ioctl_h" = xyes
-then :
- printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h
+int main() {
+ struct termios t;
+ if (tcgetattr(0, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ cfsetospeed(&t, 0);
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_api_serial=termios
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+( exit $ac_status )
+tcl_cv_api_serial=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
+ fi
+ if test $tcl_cv_api_serial = no; then
+ if test "$cross_compiling" = yes; then
+ tcl_cv_api_serial=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <termio.h>
+#include <errno.h>
+
+int main() {
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+ }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_api_serial=termio
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-ac_fn_c_check_header_compile "$LINENO" "sys/modem.h" "ac_cv_header_sys_modem_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_modem_h" = xyes
-then :
- printf "%s\n" "#define HAVE_SYS_MODEM_H 1" >>confdefs.h
+( exit $ac_status )
+tcl_cv_api_serial=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+ fi
+ if test $tcl_cv_api_serial = no; then
+ if test "$cross_compiling" = yes; then
+ tcl_cv_api_serial=none
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <sgtty.h>
+#include <errno.h>
+
+int main() {
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.sg_ospeed = 0;
+ t.sg_flags |= ODDP | EVENP | RAW;
+ return 0;
+ }
+ return 1;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_api_serial=sgtty
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+( exit $ac_status )
+tcl_cv_api_serial=none
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
+ fi
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_api_serial" >&5
+echo "${ECHO_T}$tcl_cv_api_serial" >&6
+ case $tcl_cv_api_serial in
+ termios)
+cat >>confdefs.h <<\_ACEOF
+#define USE_TERMIOS 1
+_ACEOF
+;;
+ termio)
+cat >>confdefs.h <<\_ACEOF
+#define USE_TERMIO 1
+_ACEOF
+;;
+ sgtty)
+cat >>confdefs.h <<\_ACEOF
+#define USE_SGTTY 1
+_ACEOF
+;;
+ esac
#--------------------------------------------------------------------
@@ -9376,289 +13093,552 @@ fi
# special flag.
#--------------------------------------------------------------------
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fd_set in sys/types" >&5
-printf %s "checking for fd_set in sys/types... " >&6; }
-if test ${tcl_cv_type_fd_set+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+echo "$as_me:$LINENO: checking for fd_set in sys/types" >&5
+echo $ECHO_N "checking for fd_set in sys/types... $ECHO_C" >&6
+if test "${tcl_cv_type_fd_set+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
int
-main (void)
+main ()
{
fd_set readMask, writeMask;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_type_fd_set=yes
-else case e in #(
- e) tcl_cv_type_fd_set=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_type_fd_set=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_type_fd_set" >&5
-printf "%s\n" "$tcl_cv_type_fd_set" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_type_fd_set" >&5
+echo "${ECHO_T}$tcl_cv_type_fd_set" >&6
tcl_ok=$tcl_cv_type_fd_set
if test $tcl_ok = no; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fd_mask in sys/select" >&5
-printf %s "checking for fd_mask in sys/select... " >&6; }
-if test ${tcl_cv_grep_fd_mask+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for fd_mask in sys/select" >&5
+echo $ECHO_N "checking for fd_mask in sys/select... $ECHO_C" >&6
+if test "${tcl_cv_grep_fd_mask+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/select.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP_TRADITIONAL "fd_mask" >/dev/null 2>&1
-then :
+ $EGREP "fd_mask" >/dev/null 2>&1; then
tcl_cv_grep_fd_mask=present
-else case e in #(
- e) tcl_cv_grep_fd_mask=missing ;;
-esac
+else
+ tcl_cv_grep_fd_mask=missing
fi
-rm -rf conftest*
- ;;
-esac
+rm -f conftest*
+
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_grep_fd_mask" >&5
-printf "%s\n" "$tcl_cv_grep_fd_mask" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_grep_fd_mask" >&5
+echo "${ECHO_T}$tcl_cv_grep_fd_mask" >&6
if test $tcl_cv_grep_fd_mask = present; then
-printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SYS_SELECT_H 1
+_ACEOF
tcl_ok=yes
fi
fi
if test $tcl_ok = no; then
-printf "%s\n" "#define NO_FD_SET 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define NO_FD_SET 1
+_ACEOF
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pselect" >&5
-printf %s "checking for pselect... " >&6; }
-if test ${tcl_cv_func_pselect+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+#------------------------------------------------------------------------------
+# Find out all about time handling differences.
+#------------------------------------------------------------------------------
+
+
+
+for ac_header in sys/time.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <sys/types.h>
-int
-main (void)
-{
-void *func = pselect;
- ;
- return 0;
-}
+$ac_includes_default
+#include <$ac_header>
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- tcl_cv_func_pselect=yes
-else case e in #(
- e) tcl_cv_func_pselect=no ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_func_pselect" >&5
-printf "%s\n" "$tcl_cv_func_pselect" >&6; }
-tcl_ok=$tcl_cv_func_pselect
-if test $tcl_ok = yes; then
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-printf "%s\n" "#define HAVE_PSELECT 1" >>confdefs.h
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-#------------------------------------------------------------------------
-# Options for the notifier. Checks for epoll(7) on Linux, and
-# kqueue(2) on {DragonFly,Free,Net,Open}BSD
-#------------------------------------------------------------------------
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for advanced notifier support" >&5
-printf %s "checking for advanced notifier support... " >&6; }
-case x`uname -s` in
- xLinux)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: epoll(7)" >&5
-printf "%s\n" "epoll(7)" >&6; }
- for ac_header in sys/epoll.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_epoll_h" = xyes
-then :
- printf "%s\n" "#define HAVE_SYS_EPOLL_H 1" >>confdefs.h
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-printf "%s\n" "#define NOTIFIER_EPOLL 1" >>confdefs.h
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
fi
done
- for ac_header in sys/eventfd.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "sys/eventfd.h" "ac_cv_header_sys_eventfd_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_eventfd_h" = xyes
-then :
- printf "%s\n" "#define HAVE_SYS_EVENTFD_H 1" >>confdefs.h
-
-printf "%s\n" "#define HAVE_EVENTFD 1" >>confdefs.h
-
-fi
-
-done;;
- xDragonFlyBSD|xFreeBSD|xNetBSD|xOpenBSD)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: kqueue(2)" >&5
-printf "%s\n" "kqueue(2)" >&6; }
- # Messy because we want to check if *all* the headers are present, and not
- # just *any*
- tcl_kqueue_headers=x
- for ac_header in sys/types.h sys/event.h sys/time.h
-do :
- as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | sed "$as_sed_sh"`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"
-then :
- cat >>confdefs.h <<_ACEOF
-#define `printf "%s\n" "HAVE_$ac_header" | sed "$as_sed_cpp"` 1
+
+ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
+if test "${ac_cv_header_time+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
_ACEOF
- tcl_kqueue_headers=${tcl_kqueue_headers}y
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_time=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_time=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6
+if test $ac_cv_header_time = yes; then
-done
- if test $tcl_kqueue_headers = xyyy
-then :
+cat >>confdefs.h <<\_ACEOF
+#define TIME_WITH_SYS_TIME 1
+_ACEOF
+fi
-printf "%s\n" "#define NOTIFIER_KQUEUE 1" >>confdefs.h
-fi;;
- xDarwin)
- # Assume that we've got CoreFoundation present (checked elsewhere because
- # of wider impact).
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OSX" >&5
-printf "%s\n" "OSX" >&6; };;
- *)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5
-printf "%s\n" "none" >&6; };;
-esac
-#------------------------------------------------------------------------------
-# Find out all about time handling differences.
-#------------------------------------------------------------------------------
+for ac_func in gmtime_r localtime_r mktime
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
- ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_time_h" = xyes
-then :
- printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
-fi
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+#undef $ac_func
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
- ac_fn_c_check_func "$LINENO" "gmtime_r" "ac_cv_func_gmtime_r"
-if test "x$ac_cv_func_gmtime_r" = xyes
-then :
- printf "%s\n" "#define HAVE_GMTIME_R 1" >>confdefs.h
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+eval "$as_ac_var=no"
fi
-ac_fn_c_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r"
-if test "x$ac_cv_func_localtime_r" = xyes
-then :
- printf "%s\n" "#define HAVE_LOCALTIME_R 1" >>confdefs.h
-
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-ac_fn_c_check_func "$LINENO" "mktime" "ac_cv_func_mktime"
-if test "x$ac_cv_func_mktime" = xyes
-then :
- printf "%s\n" "#define HAVE_MKTIME 1" >>confdefs.h
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
fi
+done
+
+ echo "$as_me:$LINENO: checking tm_tzadj in struct tm" >&5
+echo $ECHO_N "checking tm_tzadj in struct tm... $ECHO_C" >&6
+if test "${tcl_cv_member_tm_tzadj+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking tm_tzadj in struct tm" >&5
-printf %s "checking tm_tzadj in struct tm... " >&6; }
-if test ${tcl_cv_member_tm_tzadj+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <time.h>
int
-main (void)
+main ()
{
-struct tm tm; (void)tm.tm_tzadj;
+struct tm tm; tm.tm_tzadj;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_member_tm_tzadj=yes
-else case e in #(
- e) tcl_cv_member_tm_tzadj=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_member_tm_tzadj=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_member_tm_tzadj" >&5
-printf "%s\n" "$tcl_cv_member_tm_tzadj" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_member_tm_tzadj" >&5
+echo "${ECHO_T}$tcl_cv_member_tm_tzadj" >&6
if test $tcl_cv_member_tm_tzadj = yes ; then
-printf "%s\n" "#define HAVE_TM_TZADJ 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_TM_TZADJ 1
+_ACEOF
fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking tm_gmtoff in struct tm" >&5
-printf %s "checking tm_gmtoff in struct tm... " >&6; }
-if test ${tcl_cv_member_tm_gmtoff+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking tm_gmtoff in struct tm" >&5
+echo $ECHO_N "checking tm_gmtoff in struct tm... $ECHO_C" >&6
+if test "${tcl_cv_member_tm_gmtoff+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <time.h>
int
-main (void)
+main ()
{
-struct tm tm; (void)tm.tm_gmtoff;
+struct tm tm; tm.tm_gmtoff;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_member_tm_gmtoff=yes
-else case e in #(
- e) tcl_cv_member_tm_gmtoff=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_member_tm_gmtoff=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_member_tm_gmtoff" >&5
-printf "%s\n" "$tcl_cv_member_tm_gmtoff" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_member_tm_gmtoff" >&5
+echo "${ECHO_T}$tcl_cv_member_tm_gmtoff" >&6
if test $tcl_cv_member_tm_gmtoff = yes ; then
-printf "%s\n" "#define HAVE_TM_GMTOFF 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_TM_GMTOFF 1
+_ACEOF
fi
@@ -9666,19 +13646,21 @@ printf "%s\n" "#define HAVE_TM_GMTOFF 1" >>confdefs.h
# Its important to include time.h in this check, as some systems
# (like convex) have timezone functions, etc.
#
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking long timezone variable" >&5
-printf %s "checking long timezone variable... " >&6; }
-if test ${tcl_cv_timezone_long+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking long timezone variable" >&5
+echo $ECHO_N "checking long timezone variable... $ECHO_C" >&6
+if test "${tcl_cv_timezone_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <time.h>
-#include <stdlib.h>
int
-main (void)
+main ()
{
extern long timezone;
timezone += 1;
@@ -9687,39 +13669,64 @@ extern long timezone;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_timezone_long=yes
-else case e in #(
- e) tcl_cv_timezone_long=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_timezone_long=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_timezone_long" >&5
-printf "%s\n" "$tcl_cv_timezone_long" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_timezone_long" >&5
+echo "${ECHO_T}$tcl_cv_timezone_long" >&6
if test $tcl_cv_timezone_long = yes ; then
-printf "%s\n" "#define HAVE_TIMEZONE_VAR 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_TIMEZONE_VAR 1
+_ACEOF
else
#
# On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
#
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking time_t timezone variable" >&5
-printf %s "checking time_t timezone variable... " >&6; }
-if test ${tcl_cv_timezone_time+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ echo "$as_me:$LINENO: checking time_t timezone variable" >&5
+echo $ECHO_N "checking time_t timezone variable... $ECHO_C" >&6
+if test "${tcl_cv_timezone_time+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <time.h>
-#include <stdlib.h>
int
-main (void)
+main ()
{
extern time_t timezone;
timezone += 1;
@@ -9728,21 +13735,44 @@ extern time_t timezone;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_timezone_time=yes
-else case e in #(
- e) tcl_cv_timezone_time=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_timezone_time=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_timezone_time" >&5
-printf "%s\n" "$tcl_cv_timezone_time" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_timezone_time" >&5
+echo "${ECHO_T}$tcl_cv_timezone_time" >&6
if test $tcl_cv_timezone_time = yes ; then
-printf "%s\n" "#define HAVE_TIMEZONE_VAR 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_TIMEZONE_VAR 1
+_ACEOF
fi
fi
@@ -9755,179 +13785,1538 @@ printf "%s\n" "#define HAVE_TIMEZONE_VAR 1" >>confdefs.h
#--------------------------------------------------------------------
if test "$ac_cv_cygwin" != "yes"; then
- ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_blocks" = xyes
-then :
-
-printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLOCKS 1" >>confdefs.h
+echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5
+echo $ECHO_N "checking for struct stat.st_blocks... $ECHO_C" >&6
+if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (ac_aggr.st_blocks)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_stat_st_blocks=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_blocks)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_stat_st_blocks=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_member_struct_stat_st_blocks=no
fi
-ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_blksize" = xyes
-then :
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5
+echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6
+if test $ac_cv_member_struct_stat_st_blocks = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BLOCKS 1
+_ACEOF
+
-printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h
+fi
+echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5
+echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6
+if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (ac_aggr.st_blksize)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_stat_st_blksize=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_blksize)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_stat_st_blksize=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_member_struct_stat_st_blksize=no
fi
-ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_rdev" = xyes
-then :
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5
+echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6
+if test $ac_cv_member_struct_stat_st_blksize = yes; then
-printf "%s\n" "#define HAVE_STRUCT_STAT_ST_RDEV 1" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+_ACEOF
fi
fi
-ac_fn_c_check_type "$LINENO" "blkcnt_t" "ac_cv_type_blkcnt_t" "$ac_includes_default"
-if test "x$ac_cv_type_blkcnt_t" = xyes
-then :
+echo "$as_me:$LINENO: checking for blkcnt_t" >&5
+echo $ECHO_N "checking for blkcnt_t... $ECHO_C" >&6
+if test "${ac_cv_type_blkcnt_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((blkcnt_t *) 0)
+ return 0;
+if (sizeof (blkcnt_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_blkcnt_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_blkcnt_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_blkcnt_t" >&5
+echo "${ECHO_T}$ac_cv_type_blkcnt_t" >&6
+if test $ac_cv_type_blkcnt_t = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_BLKCNT_T 1
+_ACEOF
+
+
+fi
-printf "%s\n" "#define HAVE_BLKCNT_T 1" >>confdefs.h
+echo "$as_me:$LINENO: checking for fstatfs" >&5
+echo $ECHO_N "checking for fstatfs... $ECHO_C" >&6
+if test "${ac_cv_func_fstatfs+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define fstatfs to an innocuous variant, in case <limits.h> declares fstatfs.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define fstatfs innocuous_fstatfs
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char fstatfs (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef fstatfs
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char fstatfs ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_fstatfs) || defined (__stub___fstatfs)
+choke me
+#else
+char (*f) () = fstatfs;
+#endif
+#ifdef __cplusplus
+}
+#endif
+int
+main ()
+{
+return f != fstatfs;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_fstatfs=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_fstatfs=no
fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_fstatfs" >&5
+echo "${ECHO_T}$ac_cv_func_fstatfs" >&6
+if test $ac_cv_func_fstatfs = yes; then
+ :
+else
-ac_fn_c_check_func "$LINENO" "fstatfs" "ac_cv_func_fstatfs"
-if test "x$ac_cv_func_fstatfs" = xyes
-then :
+cat >>confdefs.h <<\_ACEOF
+#define NO_FSTATFS 1
+_ACEOF
-else case e in #(
- e)
-printf "%s\n" "#define NO_FSTATFS 1" >>confdefs.h
- ;;
-esac
fi
#--------------------------------------------------------------------
-# Some system like SunOS 4 and other BSD like systems have no memmove
-# (we assume they have bcopy instead). {The replacement define is in
-# compat/string.h}
+# Some system have no memcmp or it does not work with 8 bit
+# data, this checks it and add memcmp.o to LIBOBJS if needed
#--------------------------------------------------------------------
-ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove"
-if test "x$ac_cv_func_memmove" = xyes
-then :
+echo "$as_me:$LINENO: checking for working memcmp" >&5
+echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6
+if test "${ac_cv_func_memcmp_working+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_memcmp_working=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
-else case e in #(
- e)
+ /* Some versions of memcmp are not 8-bit clean. */
+ char c0 = 0x40, c1 = 0x80, c2 = 0x81;
+ if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
+ exit (1);
-printf "%s\n" "#define NO_MEMMOVE 1" >>confdefs.h
+ /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
+ or more and with at least one buffer not starting on a 4-byte boundary.
+ William Lewis provided this test program. */
+ {
+ char foo[21];
+ char bar[21];
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ char *a = foo + i;
+ char *b = bar + i;
+ strcpy (a, "--------01111111");
+ strcpy (b, "--------10000000");
+ if (memcmp (a, b, 16) >= 0)
+ exit (1);
+ }
+ exit (0);
+ }
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_memcmp_working=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-printf "%s\n" "#define NO_STRING_H 1" >>confdefs.h
- ;;
-esac
+( exit $ac_status )
+ac_cv_func_memcmp_working=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
+echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6
+test $ac_cv_func_memcmp_working = no && case $LIBOBJS in
+ "memcmp.$ac_objext" | \
+ *" memcmp.$ac_objext" | \
+ "memcmp.$ac_objext "* | \
+ *" memcmp.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;;
+esac
+
#--------------------------------------------------------------------
-# Check for various typedefs and provide substitutes if
-# they don't exist.
+# Some system like SunOS 4 and other BSD like systems
+# have no memmove (we assume they have bcopy instead).
+# {The replacement define is in compat/string.h}
#--------------------------------------------------------------------
-ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
-if test "x$ac_cv_type_mode_t" = xyes
-then :
+echo "$as_me:$LINENO: checking for memmove" >&5
+echo $ECHO_N "checking for memmove... $ECHO_C" >&6
+if test "${ac_cv_func_memmove+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define memmove to an innocuous variant, in case <limits.h> declares memmove.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define memmove innocuous_memmove
-else case e in #(
- e)
-printf "%s\n" "#define mode_t int" >>confdefs.h
- ;;
-esac
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char memmove (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef memmove
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char memmove ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_memmove) || defined (__stub___memmove)
+choke me
+#else
+char (*f) () = memmove;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != memmove;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_memmove=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_memmove=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_func_memmove" >&5
+echo "${ECHO_T}$ac_cv_func_memmove" >&6
+if test $ac_cv_func_memmove = yes; then
+ :
+else
- ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default
-"
-if test "x$ac_cv_type_pid_t" = xyes
-then :
+cat >>confdefs.h <<\_ACEOF
+#define NO_MEMMOVE 1
+_ACEOF
+
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >>confdefs.h <<\_ACEOF
+#define NO_STRING_H 1
+_ACEOF
+
+fi
+
+
+#--------------------------------------------------------------------
+# On some systems strstr is broken: it returns a pointer even
+# even if the original string is empty.
+#--------------------------------------------------------------------
+
+
+ echo "$as_me:$LINENO: checking for strstr" >&5
+echo $ECHO_N "checking for strstr... $ECHO_C" >&6
+if test "${ac_cv_func_strstr+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define strstr to an innocuous variant, in case <limits.h> declares strstr.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define strstr innocuous_strstr
- #if defined _WIN64 && !defined __CYGWIN__
- LLP64
- #endif
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char strstr (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef strstr
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strstr ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_strstr) || defined (__stub___strstr)
+choke me
+#else
+char (*f) () = strstr;
+#endif
+#ifdef __cplusplus
+}
+#endif
int
-main (void)
+main ()
+{
+return f != strstr;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_strstr=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_strstr=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_strstr" >&5
+echo "${ECHO_T}$ac_cv_func_strstr" >&6
+if test $ac_cv_func_strstr = yes; then
+ tcl_ok=1
+else
+ tcl_ok=0
+fi
+
+ if test "$tcl_ok" = 1; then
+ echo "$as_me:$LINENO: checking proper strstr implementation" >&5
+echo $ECHO_N "checking proper strstr implementation... $ECHO_C" >&6
+if test "${tcl_cv_strstr_unbroken+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ tcl_cv_strstr_unbroken=unknown
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+int main() {
+ extern int strstr();
+ exit(strstr("\0test", "test") ? 1 : 0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_strstr_unbroken=ok
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+tcl_cv_strstr_unbroken=broken
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_strstr_unbroken" >&5
+echo "${ECHO_T}$tcl_cv_strstr_unbroken" >&6
+ if test "$tcl_cv_strstr_unbroken" = "ok"; then
+ tcl_ok=1
+ else
+ tcl_ok=0
+ fi
+ fi
+ if test "$tcl_ok" = 0; then
+ case $LIBOBJS in
+ "strstr.$ac_objext" | \
+ *" strstr.$ac_objext" | \
+ "strstr.$ac_objext "* | \
+ *" strstr.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strstr.$ac_objext" ;;
+esac
+
+ USE_COMPAT=1
+ fi
+
+
+#--------------------------------------------------------------------
+# Check for strtoul function. This is tricky because under some
+# versions of AIX strtoul returns an incorrect terminator
+# pointer for the string "0".
+#--------------------------------------------------------------------
+
+
+ echo "$as_me:$LINENO: checking for strtoul" >&5
+echo $ECHO_N "checking for strtoul... $ECHO_C" >&6
+if test "${ac_cv_func_strtoul+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define strtoul to an innocuous variant, in case <limits.h> declares strtoul.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define strtoul innocuous_strtoul
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char strtoul (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef strtoul
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strtoul ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_strtoul) || defined (__stub___strtoul)
+choke me
+#else
+char (*f) () = strtoul;
+#endif
+#ifdef __cplusplus
+}
+#endif
+int
+main ()
+{
+return f != strtoul;
;
return 0;
}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_strtoul=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_func_strtoul=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_strtoul" >&5
+echo "${ECHO_T}$ac_cv_func_strtoul" >&6
+if test $ac_cv_func_strtoul = yes; then
+ tcl_ok=1
+else
+ tcl_ok=0
+fi
+
+ if test "$tcl_ok" = 1; then
+ echo "$as_me:$LINENO: checking proper strtoul implementation" >&5
+echo $ECHO_N "checking proper strtoul implementation... $ECHO_C" >&6
+if test "${tcl_cv_strtoul_unbroken+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ tcl_cv_strtoul_unbroken=unknown
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+int main() {
+ extern int strtoul();
+ char *term, *string = "0";
+ exit(strtoul(string,&term,0) != 0 || term != string+1);
+}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- ac_pid_type='int'
-else case e in #(
- e) ac_pid_type='__int64' ;;
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_strtoul_unbroken=ok
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+tcl_cv_strtoul_unbroken=broken
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_strtoul_unbroken" >&5
+echo "${ECHO_T}$tcl_cv_strtoul_unbroken" >&6
+ if test "$tcl_cv_strtoul_unbroken" = "ok"; then
+ tcl_ok=1
+ else
+ tcl_ok=0
+ fi
+ fi
+ if test "$tcl_ok" = 0; then
+ case $LIBOBJS in
+ "strtoul.$ac_objext" | \
+ *" strtoul.$ac_objext" | \
+ "strtoul.$ac_objext "* | \
+ *" strtoul.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strtoul.$ac_objext" ;;
esac
+
+ USE_COMPAT=1
+ fi
+
+
+#--------------------------------------------------------------------
+# Check for the strtod function. This is tricky because in some
+# versions of Linux strtod mis-parses strings starting with "+".
+#--------------------------------------------------------------------
+
+
+ echo "$as_me:$LINENO: checking for strtod" >&5
+echo $ECHO_N "checking for strtod... $ECHO_C" >&6
+if test "${ac_cv_func_strtod+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define strtod to an innocuous variant, in case <limits.h> declares strtod.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define strtod innocuous_strtod
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char strtod (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef strtod
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strtod ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_strtod) || defined (__stub___strtod)
+choke me
+#else
+char (*f) () = strtod;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != strtod;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_strtod=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_strtod=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_strtod" >&5
+echo "${ECHO_T}$ac_cv_func_strtod" >&6
+if test $ac_cv_func_strtod = yes; then
+ tcl_ok=1
+else
+ tcl_ok=0
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h
+ if test "$tcl_ok" = 1; then
+ echo "$as_me:$LINENO: checking proper strtod implementation" >&5
+echo $ECHO_N "checking proper strtod implementation... $ECHO_C" >&6
+if test "${tcl_cv_strtod_unbroken+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ tcl_cv_strtod_unbroken=unknown
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+int main() {
+ extern double strtod();
+ char *term, *string = " +69";
+ exit(strtod(string,&term) != 69 || term != string+4);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_strtod_unbroken=ok
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- ;;
+( exit $ac_status )
+tcl_cv_strtod_unbroken=broken
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_strtod_unbroken" >&5
+echo "${ECHO_T}$tcl_cv_strtod_unbroken" >&6
+ if test "$tcl_cv_strtod_unbroken" = "ok"; then
+ tcl_ok=1
+ else
+ tcl_ok=0
+ fi
+ fi
+ if test "$tcl_ok" = 0; then
+ case $LIBOBJS in
+ "strtod.$ac_objext" | \
+ *" strtod.$ac_objext" | \
+ "strtod.$ac_objext "* | \
+ *" strtod.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strtod.$ac_objext" ;;
esac
+
+ USE_COMPAT=1
+ fi
+
+
+#--------------------------------------------------------------------
+# Under Solaris 2.4, strtod returns the wrong value for the
+# terminating character under some conditions. Check for this
+# and if the problem exists use a substitute procedure
+# "fixstrtod" that corrects the error.
+#--------------------------------------------------------------------
+
+
+ echo "$as_me:$LINENO: checking for strtod" >&5
+echo $ECHO_N "checking for strtod... $ECHO_C" >&6
+if test "${ac_cv_func_strtod+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define strtod to an innocuous variant, in case <limits.h> declares strtod.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define strtod innocuous_strtod
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char strtod (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef strtod
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strtod ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_strtod) || defined (__stub___strtod)
+choke me
+#else
+char (*f) () = strtod;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != strtod;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_strtod=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_strtod=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_strtod" >&5
+echo "${ECHO_T}$ac_cv_func_strtod" >&6
+if test $ac_cv_func_strtod = yes; then
+ tcl_strtod=1
+else
+ tcl_strtod=0
fi
+ if test "$tcl_strtod" = 1; then
+ echo "$as_me:$LINENO: checking for Solaris2.4/Tru64 strtod bugs" >&5
+echo $ECHO_N "checking for Solaris2.4/Tru64 strtod bugs... $ECHO_C" >&6
+if test "${tcl_cv_strtod_buggy+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
-ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes
-then :
+ if test "$cross_compiling" = yes; then
+ tcl_cv_strtod_buggy=buggy
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-else case e in #(
- e)
-printf "%s\n" "#define size_t unsigned int" >>confdefs.h
- ;;
+ extern double strtod();
+ int main() {
+ char *infString="Inf", *nanString="NaN", *spaceString=" ";
+ char *term;
+ double value;
+ value = strtod(infString, &term);
+ if ((term != infString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(nanString, &term);
+ if ((term != nanString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(spaceString, &term);
+ if (term == (spaceString+1)) {
+ exit(1);
+ }
+ exit(0);
+ }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_strtod_buggy=ok
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+tcl_cv_strtod_buggy=buggy
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_strtod_buggy" >&5
+echo "${ECHO_T}$tcl_cv_strtod_buggy" >&6
+ if test "$tcl_cv_strtod_buggy" = buggy; then
+ case $LIBOBJS in
+ "fixstrtod.$ac_objext" | \
+ *" fixstrtod.$ac_objext" | \
+ "fixstrtod.$ac_objext "* | \
+ *" fixstrtod.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS fixstrtod.$ac_objext" ;;
esac
+
+ USE_COMPAT=1
+
+cat >>confdefs.h <<\_ACEOF
+#define strtod fixstrtod
+_ACEOF
+
+ fi
+ fi
+
+
+#--------------------------------------------------------------------
+# Check for various typedefs and provide substitutes if
+# they don't exist.
+#--------------------------------------------------------------------
+
+echo "$as_me:$LINENO: checking for mode_t" >&5
+echo $ECHO_N "checking for mode_t... $ECHO_C" >&6
+if test "${ac_cv_type_mode_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((mode_t *) 0)
+ return 0;
+if (sizeof (mode_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_mode_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_mode_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5
+echo "${ECHO_T}$ac_cv_type_mode_t" >&6
+if test $ac_cv_type_mode_t = yes; then
+ :
+else
-ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default"
-if test "x$ac_cv_type_uid_t" = xyes
-then :
+cat >>confdefs.h <<_ACEOF
+#define mode_t int
+_ACEOF
-else case e in #(
- e)
-printf "%s\n" "#define uid_t int" >>confdefs.h
- ;;
-esac
fi
-ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default"
-if test "x$ac_cv_type_gid_t" = xyes
-then :
+echo "$as_me:$LINENO: checking for pid_t" >&5
+echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
+if test "${ac_cv_type_pid_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((pid_t *) 0)
+ return 0;
+if (sizeof (pid_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_pid_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-else case e in #(
- e)
-printf "%s\n" "#define gid_t int" >>confdefs.h
- ;;
-esac
+ac_cv_type_pid_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+echo "${ECHO_T}$ac_cv_type_pid_t" >&6
+if test $ac_cv_type_pid_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6
+if test "${ac_cv_type_size_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((size_t *) 0)
+ return 0;
+if (sizeof (size_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_size_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_size_t=no
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6
+if test $ac_cv_type_size_t = yes; then
+ :
+else
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned
+_ACEOF
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5
-printf %s "checking for socklen_t... " >&6; }
-if test ${tcl_cv_type_socklen_t+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
+echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6
+if test "${ac_cv_type_uid_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "uid_t" >/dev/null 2>&1; then
+ ac_cv_type_uid_t=yes
+else
+ ac_cv_type_uid_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
+echo "${ECHO_T}$ac_cv_type_uid_t" >&6
+if test $ac_cv_type_uid_t = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define uid_t int
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define gid_t int
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking for socklen_t" >&5
+echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6
+if test "${tcl_cv_type_socklen_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/socket.h>
int
-main (void)
+main ()
{
socklen_t foo;
@@ -9936,44 +15325,423 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_type_socklen_t=yes
-else case e in #(
- e) tcl_cv_type_socklen_t=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_type_socklen_t=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_type_socklen_t" >&5
-printf "%s\n" "$tcl_cv_type_socklen_t" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_type_socklen_t" >&5
+echo "${ECHO_T}$tcl_cv_type_socklen_t" >&6
if test $tcl_cv_type_socklen_t = no; then
-printf "%s\n" "#define socklen_t int" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define socklen_t int
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for intptr_t" >&5
+echo $ECHO_N "checking for intptr_t... $ECHO_C" >&6
+if test "${ac_cv_type_intptr_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((intptr_t *) 0)
+ return 0;
+if (sizeof (intptr_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_intptr_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_intptr_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_intptr_t" >&5
+echo "${ECHO_T}$ac_cv_type_intptr_t" >&6
+if test $ac_cv_type_intptr_t = yes; then
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_INTPTR_T 1
+_ACEOF
+
+else
+
+ echo "$as_me:$LINENO: checking for pointer-size signed integer type" >&5
+echo $ECHO_N "checking for pointer-size signed integer type... $ECHO_C" >&6
+if test "${tcl_cv_intptr_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ for tcl_cv_intptr_t in "int" "long" "long long" none; do
+ if test "$tcl_cv_intptr_t" != none; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($tcl_cv_intptr_t))];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_ok=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_ok=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$tcl_ok" = yes && break; fi
+ done
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_intptr_t" >&5
+echo "${ECHO_T}$tcl_cv_intptr_t" >&6
+ if test "$tcl_cv_intptr_t" != none; then
+
+cat >>confdefs.h <<_ACEOF
+#define intptr_t $tcl_cv_intptr_t
+_ACEOF
+
+ fi
fi
-ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "
-#include <stdint.h>
+echo "$as_me:$LINENO: checking for uintptr_t" >&5
+echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6
+if test "${ac_cv_type_uintptr_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((uintptr_t *) 0)
+ return 0;
+if (sizeof (uintptr_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_uintptr_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_uintptr_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
+echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6
+if test $ac_cv_type_uintptr_t = yes; then
+
-"
-if test "x$ac_cv_type_intptr_t" = xyes
-then :
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UINTPTR_T 1
+_ACEOF
+
+else
+
+ echo "$as_me:$LINENO: checking for pointer-size unsigned integer type" >&5
+echo $ECHO_N "checking for pointer-size unsigned integer type... $ECHO_C" >&6
+if test "${tcl_cv_uintptr_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ for tcl_cv_uintptr_t in "unsigned int" "unsigned long" "unsigned long long" \
+ none; do
+ if test "$tcl_cv_uintptr_t" != none; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($tcl_cv_uintptr_t))];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_ok=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_ok=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$tcl_ok" = yes && break; fi
+ done
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_uintptr_t" >&5
+echo "${ECHO_T}$tcl_cv_uintptr_t" >&6
+ if test "$tcl_cv_uintptr_t" != none; then
-printf "%s\n" "#define HAVE_INTPTR_T 1" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define uintptr_t $tcl_cv_uintptr_t
+_ACEOF
+ fi
fi
-ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "
-#include <stdint.h>
-"
-if test "x$ac_cv_type_uintptr_t" = xyes
-then :
-printf "%s\n" "#define HAVE_UINTPTR_T 1" >>confdefs.h
+#--------------------------------------------------------------------
+# If a system doesn't have an opendir function (man, that's old!)
+# then we have to supply a different version of dirent.h which
+# is compatible with the substitute version of opendir that's
+# provided. This version only works with V7-style directories.
+#--------------------------------------------------------------------
+
+echo "$as_me:$LINENO: checking for opendir" >&5
+echo $ECHO_N "checking for opendir... $ECHO_C" >&6
+if test "${ac_cv_func_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define opendir to an innocuous variant, in case <limits.h> declares opendir.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define opendir innocuous_opendir
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char opendir (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef opendir
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_opendir) || defined (__stub___opendir)
+choke me
+#else
+char (*f) () = opendir;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != opendir;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_opendir=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_opendir=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_opendir" >&5
+echo "${ECHO_T}$ac_cv_func_opendir" >&6
+if test $ac_cv_func_opendir = yes; then
+ :
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_DIRENT2_H 1
+_ACEOF
fi
@@ -9986,19 +15754,22 @@ fi
# the trick.
#--------------------------------------------------------------------
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking union wait" >&5
-printf %s "checking union wait... " >&6; }
-if test ${tcl_cv_union_wait+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+echo "$as_me:$LINENO: checking union wait" >&5
+echo $ECHO_N "checking union wait... $ECHO_C" >&6
+if test "${tcl_cv_union_wait+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/wait.h>
int
-main (void)
+main ()
{
union wait x;
@@ -10009,22 +15780,45 @@ WIFEXITED(x); /* Generates compiler error if WIFEXITED
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_union_wait=yes
-else case e in #(
- e) tcl_cv_union_wait=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_union_wait=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_union_wait" >&5
-printf "%s\n" "$tcl_cv_union_wait" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_union_wait" >&5
+echo "${ECHO_T}$tcl_cv_union_wait" >&6
if test $tcl_cv_union_wait = no; then
-printf "%s\n" "#define NO_UNION_WAIT 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define NO_UNION_WAIT 1
+_ACEOF
fi
@@ -10034,126 +15828,253 @@ fi
# under Sequent Dynix it's in -linet.
#--------------------------------------------------------------------
-ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp"
-if test "x$ac_cv_func_strncasecmp" = xyes
-then :
+echo "$as_me:$LINENO: checking for strncasecmp" >&5
+echo $ECHO_N "checking for strncasecmp... $ECHO_C" >&6
+if test "${ac_cv_func_strncasecmp+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define strncasecmp to an innocuous variant, in case <limits.h> declares strncasecmp.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define strncasecmp innocuous_strncasecmp
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char strncasecmp (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef strncasecmp
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strncasecmp ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_strncasecmp) || defined (__stub___strncasecmp)
+choke me
+#else
+char (*f) () = strncasecmp;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != strncasecmp;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_strncasecmp=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_strncasecmp=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_strncasecmp" >&5
+echo "${ECHO_T}$ac_cv_func_strncasecmp" >&6
+if test $ac_cv_func_strncasecmp = yes; then
tcl_ok=1
-else case e in #(
- e) tcl_ok=0 ;;
-esac
+else
+ tcl_ok=0
fi
if test "$tcl_ok" = 0; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strncasecmp in -lsocket" >&5
-printf %s "checking for strncasecmp in -lsocket... " >&6; }
-if test ${ac_cv_lib_socket_strncasecmp+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
+ echo "$as_me:$LINENO: checking for strncasecmp in -lsocket" >&5
+echo $ECHO_N "checking for strncasecmp in -lsocket... $ECHO_C" >&6
+if test "${ac_cv_lib_socket_strncasecmp+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
-char strncasecmp (void);
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strncasecmp ();
int
-main (void)
+main ()
{
-return strncasecmp ();
+strncasecmp ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_socket_strncasecmp=yes
-else case e in #(
- e) ac_cv_lib_socket_strncasecmp=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_socket_strncasecmp=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_strncasecmp" >&5
-printf "%s\n" "$ac_cv_lib_socket_strncasecmp" >&6; }
-if test "x$ac_cv_lib_socket_strncasecmp" = xyes
-then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_socket_strncasecmp" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_strncasecmp" >&6
+if test $ac_cv_lib_socket_strncasecmp = yes; then
tcl_ok=1
-else case e in #(
- e) tcl_ok=0 ;;
-esac
+else
+ tcl_ok=0
fi
fi
if test "$tcl_ok" = 0; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strncasecmp in -linet" >&5
-printf %s "checking for strncasecmp in -linet... " >&6; }
-if test ${ac_cv_lib_inet_strncasecmp+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
+ echo "$as_me:$LINENO: checking for strncasecmp in -linet" >&5
+echo $ECHO_N "checking for strncasecmp in -linet... $ECHO_C" >&6
+if test "${ac_cv_lib_inet_strncasecmp+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-linet $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
-char strncasecmp (void);
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strncasecmp ();
int
-main (void)
+main ()
{
-return strncasecmp ();
+strncasecmp ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_lib_inet_strncasecmp=yes
-else case e in #(
- e) ac_cv_lib_inet_strncasecmp=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_inet_strncasecmp=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_strncasecmp" >&5
-printf "%s\n" "$ac_cv_lib_inet_strncasecmp" >&6; }
-if test "x$ac_cv_lib_inet_strncasecmp" = xyes
-then :
+echo "$as_me:$LINENO: result: $ac_cv_lib_inet_strncasecmp" >&5
+echo "${ECHO_T}$ac_cv_lib_inet_strncasecmp" >&6
+if test $ac_cv_lib_inet_strncasecmp = yes; then
tcl_ok=1
-else case e in #(
- e) tcl_ok=0 ;;
-esac
+else
+ tcl_ok=0
fi
fi
if test "$tcl_ok" = 0; then
- case " $LIBOBJS " in
+ case $LIBOBJS in
+ "strncasecmp.$ac_objext" | \
+ *" strncasecmp.$ac_objext" | \
+ "strncasecmp.$ac_objext "* | \
*" strncasecmp.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS strncasecmp.$ac_objext"
- ;;
+ *) LIBOBJS="$LIBOBJS strncasecmp.$ac_objext" ;;
esac
USE_COMPAT=1
@@ -10168,48 +16089,139 @@ fi
# declare it.
#--------------------------------------------------------------------
-ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
-if test "x$ac_cv_func_gettimeofday" = xyes
-then :
+echo "$as_me:$LINENO: checking for gettimeofday" >&5
+echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
+if test "${ac_cv_func_gettimeofday+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define gettimeofday to an innocuous variant, in case <limits.h> declares gettimeofday.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define gettimeofday innocuous_gettimeofday
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char gettimeofday (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
-else case e in #(
- e)
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
-printf "%s\n" "#define NO_GETTOD 1" >>confdefs.h
+#undef gettimeofday
- ;;
-esac
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gettimeofday ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
+choke me
+#else
+char (*f) () = gettimeofday;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != gettimeofday;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_gettimeofday=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_gettimeofday=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_func_gettimeofday" >&5
+echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
+if test $ac_cv_func_gettimeofday = yes; then
+ :
+else
+
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_GETTOD 1
+_ACEOF
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettimeofday declaration" >&5
-printf %s "checking for gettimeofday declaration... " >&6; }
-if test ${tcl_cv_grep_gettimeofday+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+fi
+
+echo "$as_me:$LINENO: checking for gettimeofday declaration" >&5
+echo $ECHO_N "checking for gettimeofday declaration... $ECHO_C" >&6
+if test "${tcl_cv_grep_gettimeofday+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/time.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP_TRADITIONAL "gettimeofday" >/dev/null 2>&1
-then :
+ $EGREP "gettimeofday" >/dev/null 2>&1; then
tcl_cv_grep_gettimeofday=present
-else case e in #(
- e) tcl_cv_grep_gettimeofday=missing ;;
-esac
+else
+ tcl_cv_grep_gettimeofday=missing
fi
-rm -rf conftest*
- ;;
-esac
+rm -f conftest*
+
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_grep_gettimeofday" >&5
-printf "%s\n" "$tcl_cv_grep_gettimeofday" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_grep_gettimeofday" >&5
+echo "${ECHO_T}$tcl_cv_grep_gettimeofday" >&6
if test $tcl_cv_grep_gettimeofday = missing ; then
-printf "%s\n" "#define GETTOD_NOT_DECLARED 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define GETTOD_NOT_DECLARED 1
+_ACEOF
fi
@@ -10219,55 +16231,84 @@ fi
# properly generate sign-extended ints from character values.
#--------------------------------------------------------------------
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5
-printf %s "checking whether char is unsigned... " >&6; }
-if test ${ac_cv_c_char_unsigned+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+echo "$as_me:$LINENO: checking whether char is unsigned" >&5
+echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6
+if test "${ac_cv_c_char_unsigned+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
-main (void)
+main ()
{
static int test_array [1 - 2 * !(((char) -1) < 0)];
-test_array [0] = 0;
-return test_array [0];
+test_array [0] = 0
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_char_unsigned=no
-else case e in #(
- e) ac_cv_c_char_unsigned=yes ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_char_unsigned=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5
-printf "%s\n" "$ac_cv_c_char_unsigned" >&6; }
-if test $ac_cv_c_char_unsigned = yes; then
- printf "%s\n" "#define __CHAR_UNSIGNED__ 1" >>confdefs.h
+echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5
+echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6
+if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define __CHAR_UNSIGNED__ 1
+_ACEOF
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking signed char declarations" >&5
-printf %s "checking signed char declarations... " >&6; }
-if test ${tcl_cv_char_signed+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+echo "$as_me:$LINENO: checking signed char declarations" >&5
+echo $ECHO_N "checking signed char declarations... $ECHO_C" >&6
+if test "${tcl_cv_char_signed+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
-main (void)
+main ()
{
signed char *p;
@@ -10277,21 +16318,44 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_char_signed=yes
-else case e in #(
- e) tcl_cv_char_signed=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_char_signed=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_char_signed" >&5
-printf "%s\n" "$tcl_cv_char_signed" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_char_signed" >&5
+echo "${ECHO_T}$tcl_cv_char_signed" >&6
if test $tcl_cv_char_signed = yes; then
-printf "%s\n" "#define HAVE_SIGNED_CHAR 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SIGNED_CHAR 1
+_ACEOF
fi
@@ -10299,22 +16363,23 @@ fi
# Does putenv() copy or not? We need to know to avoid memory leaks.
#--------------------------------------------------------------------
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a putenv() that copies the buffer" >&5
-printf %s "checking for a putenv() that copies the buffer... " >&6; }
-if test ${tcl_cv_putenv_copy+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- if test "$cross_compiling" = yes
-then :
+echo "$as_me:$LINENO: checking for a putenv() that copies the buffer" >&5
+echo $ECHO_N "checking for a putenv() that copies the buffer... $ECHO_C" >&6
+if test "${tcl_cv_putenv_copy+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ if test "$cross_compiling" = yes; then
tcl_cv_putenv_copy=no
-else case e in #(
- e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdlib.h>
- #include <string.h>
#define OURVAR "havecopy=yes"
int main (int argc, char *argv[])
{
@@ -10333,25 +16398,36 @@ else case e in #(
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"
-then :
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_putenv_copy=no
-else case e in #(
- e) tcl_cv_putenv_copy=yes ;;
-esac
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+tcl_cv_putenv_copy=yes
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
- ;;
-esac
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_putenv_copy" >&5
-printf "%s\n" "$tcl_cv_putenv_copy" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_putenv_copy" >&5
+echo "${ECHO_T}$tcl_cv_putenv_copy" >&6
if test $tcl_cv_putenv_copy = yes; then
-printf "%s\n" "#define HAVE_PUTENV_THAT_COPIES 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PUTENV_THAT_COPIES 1
+_ACEOF
fi
@@ -10360,163 +16436,1202 @@ fi
#--------------------------------------------------------------------
- # Check whether --enable-langinfo was given.
-if test ${enable_langinfo+y}
-then :
- enableval=$enable_langinfo; langinfo_ok=$enableval
-else case e in #(
- e) langinfo_ok=yes ;;
-esac
-fi
-
+ # Check whether --enable-langinfo or --disable-langinfo was given.
+if test "${enable_langinfo+set}" = set; then
+ enableval="$enable_langinfo"
+ langinfo_ok=$enableval
+else
+ langinfo_ok=yes
+fi;
HAVE_LANGINFO=0
if test "$langinfo_ok" = "yes"; then
- ac_fn_c_check_header_compile "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default"
-if test "x$ac_cv_header_langinfo_h" = xyes
-then :
- langinfo_ok=yes
-else case e in #(
- e) langinfo_ok=no ;;
+ if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking langinfo.h usability" >&5
+echo $ECHO_N "checking langinfo.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <langinfo.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking langinfo.h presence" >&5
+echo $ECHO_N "checking langinfo.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <langinfo.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: langinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: langinfo.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: langinfo.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: langinfo.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: langinfo.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: langinfo.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: langinfo.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: langinfo.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: langinfo.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
esac
+echo "$as_me:$LINENO: checking for langinfo.h" >&5
+echo $ECHO_N "checking for langinfo.h... $ECHO_C" >&6
+if test "${ac_cv_header_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_langinfo_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_langinfo_h" >&5
+echo "${ECHO_T}$ac_cv_header_langinfo_h" >&6
+
+fi
+if test $ac_cv_header_langinfo_h = yes; then
+ langinfo_ok=yes
+else
+ langinfo_ok=no
fi
+
fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use nl_langinfo" >&5
-printf %s "checking whether to use nl_langinfo... " >&6; }
+ echo "$as_me:$LINENO: checking whether to use nl_langinfo" >&5
+echo $ECHO_N "checking whether to use nl_langinfo... $ECHO_C" >&6
if test "$langinfo_ok" = "yes"; then
- if test ${tcl_cv_langinfo_h+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ if test "${tcl_cv_langinfo_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <langinfo.h>
int
-main (void)
+main ()
{
nl_langinfo(CODESET);
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_langinfo_h=yes
-else case e in #(
- e) tcl_cv_langinfo_h=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_langinfo_h=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_langinfo_h" >&5
-printf "%s\n" "$tcl_cv_langinfo_h" >&6; }
+ echo "$as_me:$LINENO: result: $tcl_cv_langinfo_h" >&5
+echo "${ECHO_T}$tcl_cv_langinfo_h" >&6
if test $tcl_cv_langinfo_h = yes; then
-printf "%s\n" "#define HAVE_LANGINFO 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LANGINFO 1
+_ACEOF
fi
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $langinfo_ok" >&5
-printf "%s\n" "$langinfo_ok" >&6; }
+ echo "$as_me:$LINENO: result: $langinfo_ok" >&5
+echo "${ECHO_T}$langinfo_ok" >&6
fi
#--------------------------------------------------------------------
-# Check for support of cfmakeraw, chflags and mkstemps functions
+# Check for support of chflags function
#--------------------------------------------------------------------
-ac_fn_c_check_func "$LINENO" "cfmakeraw" "ac_cv_func_cfmakeraw"
-if test "x$ac_cv_func_cfmakeraw" = xyes
-then :
- printf "%s\n" "#define HAVE_CFMAKERAW 1" >>confdefs.h
+for ac_func in chflags
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-ac_fn_c_check_func "$LINENO" "chflags" "ac_cv_func_chflags"
-if test "x$ac_cv_func_chflags" = xyes
-then :
- printf "%s\n" "#define HAVE_CHFLAGS 1" >>confdefs.h
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
fi
-ac_fn_c_check_func "$LINENO" "mkstemps" "ac_cv_func_mkstemps"
-if test "x$ac_cv_func_mkstemps" = xyes
-then :
- printf "%s\n" "#define HAVE_MKSTEMPS 1" >>confdefs.h
+done
+
+
+#--------------------------------------------------------------------
+# Check for support of isnan() function or macro
+#--------------------------------------------------------------------
+
+echo "$as_me:$LINENO: checking isnan" >&5
+echo $ECHO_N "checking isnan... $ECHO_C" >&6
+if test "${tcl_cv_isnan+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <math.h>
+int
+main ()
+{
+
+isnan(0.0); /* Generates an error if isnan is missing */
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_isnan=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+tcl_cv_isnan=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $tcl_cv_isnan" >&5
+echo "${ECHO_T}$tcl_cv_isnan" >&6
+if test $tcl_cv_isnan = no; then
+cat >>confdefs.h <<\_ACEOF
+#define NO_ISNAN 1
+_ACEOF
+
+fi
#--------------------------------------------------------------------
# Darwin specific API checks and defines
#--------------------------------------------------------------------
if test "`uname -s`" = "Darwin" ; then
- ac_fn_c_check_func "$LINENO" "getattrlist" "ac_cv_func_getattrlist"
-if test "x$ac_cv_func_getattrlist" = xyes
-then :
- printf "%s\n" "#define HAVE_GETATTRLIST 1" >>confdefs.h
+
+for ac_func in getattrlist
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
fi
+done
+
- ac_fn_c_check_header_compile "$LINENO" "copyfile.h" "ac_cv_header_copyfile_h" "$ac_includes_default"
-if test "x$ac_cv_header_copyfile_h" = xyes
-then :
- printf "%s\n" "#define HAVE_COPYFILE_H 1" >>confdefs.h
+for ac_header in copyfile.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_header_compiler=no
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
- ac_fn_c_check_func "$LINENO" "copyfile" "ac_cv_func_copyfile"
-if test "x$ac_cv_func_copyfile" = xyes
-then :
- printf "%s\n" "#define HAVE_COPYFILE 1" >>confdefs.h
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_header_preproc=no
fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_func in copyfile
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
if test $tcl_corefoundation = yes; then
- ac_fn_c_check_header_compile "$LINENO" "libkern/OSAtomic.h" "ac_cv_header_libkern_OSAtomic_h" "$ac_includes_default"
-if test "x$ac_cv_header_libkern_OSAtomic_h" = xyes
-then :
- printf "%s\n" "#define HAVE_LIBKERN_OSATOMIC_H 1" >>confdefs.h
+for ac_header in libkern/OSAtomic.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_func in OSSpinLockLock
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
- ac_fn_c_check_func "$LINENO" "OSSpinLockLock" "ac_cv_func_OSSpinLockLock"
-if test "x$ac_cv_func_OSSpinLockLock" = xyes
-then :
- printf "%s\n" "#define HAVE_OSSPINLOCKLOCK 1" >>confdefs.h
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
fi
-printf "%s\n" "#define TCL_DEFAULT_ENCODING \"utf-8\"" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define USE_VFORK 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define TCL_DEFAULT_ENCODING "utf-8"
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define TCL_LOAD_FROM_MEMORY 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define TCL_WIDE_CLICKS 1
+_ACEOF
+
+
+for ac_header in AvailabilityMacros.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
-printf "%s\n" "#define TCL_LOAD_FROM_MEMORY 1" >>confdefs.h
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
-printf "%s\n" "#define TCL_WIDE_CLICKS 1" >>confdefs.h
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
- ac_fn_c_check_header_compile "$LINENO" "AvailabilityMacros.h" "ac_cv_header_AvailabilityMacros_h" "$ac_includes_default"
-if test "x$ac_cv_header_AvailabilityMacros_h" = xyes
-then :
- printf "%s\n" "#define HAVE_AVAILABILITYMACROS_H 1" >>confdefs.h
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
fi
+done
+
if test "$ac_cv_header_AvailabilityMacros_h" = yes; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if weak import is available" >&5
-printf %s "checking if weak import is available... " >&6; }
-if test ${tcl_cv_cc_weak_import+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
+ echo "$as_me:$LINENO: checking if weak import is available" >&5
+echo $ECHO_N "checking if weak import is available... $ECHO_C" >&6
+if test "${tcl_cv_cc_weak_import+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
@@ -10529,41 +17644,67 @@ else case e in #(
int rand(void) __attribute__((weak_import));
int
-main (void)
+main ()
{
rand();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_cc_weak_import=yes
-else case e in #(
- e) tcl_cv_cc_weak_import=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_cc_weak_import=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
- CFLAGS=$hold_cflags ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_weak_import" >&5
-printf "%s\n" "$tcl_cv_cc_weak_import" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_cc_weak_import" >&5
+echo "${ECHO_T}$tcl_cv_cc_weak_import" >&6
if test $tcl_cv_cc_weak_import = yes; then
-printf "%s\n" "#define HAVE_WEAK_IMPORT 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WEAK_IMPORT 1
+_ACEOF
fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if Darwin SUSv3 extensions are available" >&5
-printf %s "checking if Darwin SUSv3 extensions are available... " >&6; }
-if test ${tcl_cv_cc_darwin_c_source+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
+ echo "$as_me:$LINENO: checking if Darwin SUSv3 extensions are available" >&5
+echo $ECHO_N "checking if Darwin SUSv3 extensions are available... $ECHO_C" >&6
+if test "${tcl_cv_cc_darwin_c_source+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
@@ -10577,29 +17718,52 @@ else case e in #(
#include <sys/cdefs.h>
int
-main (void)
+main ()
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_cc_darwin_c_source=yes
-else case e in #(
- e) tcl_cv_cc_darwin_c_source=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_cc_darwin_c_source=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- CFLAGS=$hold_cflags ;;
-esac
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS=$hold_cflags
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_darwin_c_source" >&5
-printf "%s\n" "$tcl_cv_cc_darwin_c_source" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_cc_darwin_c_source" >&5
+echo "${ECHO_T}$tcl_cv_cc_darwin_c_source" >&6
if test $tcl_cv_cc_darwin_c_source = yes; then
-printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define _DARWIN_C_SOURCE 1
+_ACEOF
fi
fi
@@ -10612,17 +17776,20 @@ else
fi
#--------------------------------------------------------------------
-# Check for support of fts functions (readdir replacement)
+# Check for support of fts functions (readdir replacement)
#--------------------------------------------------------------------
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fts" >&5
-printf %s "checking for fts... " >&6; }
-if test ${tcl_cv_api_fts+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+echo "$as_me:$LINENO: checking for fts" >&5
+echo $ECHO_N "checking for fts... $ECHO_C" >&6
+if test "${tcl_cv_api_fts+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/param.h>
@@ -10630,7 +17797,7 @@ else case e in #(
#include <fts.h>
int
-main (void)
+main ()
{
char*const p[2] = {"/", NULL};
@@ -10641,152 +17808,476 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_api_fts=yes
-else case e in #(
- e) tcl_cv_api_fts=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_api_fts=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_fts" >&5
-printf "%s\n" "$tcl_cv_api_fts" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_api_fts" >&5
+echo "${ECHO_T}$tcl_cv_api_fts" >&6
if test $tcl_cv_api_fts = yes; then
-printf "%s\n" "#define HAVE_FTS 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_FTS 1
+_ACEOF
fi
#--------------------------------------------------------------------
-# The statements below check for systems where POSIX-style non-blocking
-# I/O (O_NONBLOCK) doesn't work or is unimplemented. On these systems
-# (mostly older ones), use the old BSD-style FIONBIO approach instead.
+# The statements below check for systems where POSIX-style
+# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented.
+# On these systems (mostly older ones), use the old BSD-style
+# FIONBIO approach instead.
#--------------------------------------------------------------------
- ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_ioctl_h" = xyes
-then :
- printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h
+for ac_header in sys/ioctl.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in sys/filio.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
- ac_fn_c_check_header_compile "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_filio_h" = xyes
-then :
- printf "%s\n" "#define HAVE_SYS_FILIO_H 1" >>confdefs.h
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
fi
+done
+
+
+ echo "$as_me:$LINENO: checking system version" >&5
+echo $ECHO_N "checking system version... $ECHO_C" >&6
+if test "${tcl_cv_sys_version+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking system version" >&5
-printf %s "checking system version... " >&6; }
-if test ${tcl_cv_sys_version+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- if test "${TEA_PLATFORM}" = "windows" ; then
- tcl_cv_sys_version=windows
+ if test -f /usr/lib/NextStep/software_version; then
+ tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
else
tcl_cv_sys_version=`uname -s`-`uname -r`
if test "$?" -ne 0 ; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5
-printf "%s\n" "$as_me: WARNING: can't find uname command" >&2;}
+ { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5
+echo "$as_me: WARNING: can't find uname command" >&2;}
tcl_cv_sys_version=unknown
else
+ # Special check for weird MP-RAS system (uname returns weird
+ # results, and the version is kept in special file).
+
+ if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
+ tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid`
+ fi
if test "`uname -s`" = "AIX" ; then
tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
fi
- if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then
- tcl_cv_sys_version=NetBSD-Debian
- fi
fi
fi
- ;;
-esac
+
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5
-printf "%s\n" "$tcl_cv_sys_version" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5
+echo "${ECHO_T}$tcl_cv_sys_version" >&6
system=$tcl_cv_sys_version
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5
-printf %s "checking FIONBIO vs. O_NONBLOCK for nonblocking I/O... " >&6; }
+ echo "$as_me:$LINENO: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5
+echo $ECHO_N "checking FIONBIO vs. O_NONBLOCK for nonblocking I/O... $ECHO_C" >&6
case $system in
+ # There used to be code here to use FIONBIO under AIX. However, it
+ # was reported that FIONBIO doesn't work under AIX 3.2.5. Since
+ # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO
+ # code (JO, 5/31/97).
+
OSF*)
-printf "%s\n" "#define USE_FIONBIO 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define USE_FIONBIO 1
+_ACEOF
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: FIONBIO" >&5
-printf "%s\n" "FIONBIO" >&6; }
+ echo "$as_me:$LINENO: result: FIONBIO" >&5
+echo "${ECHO_T}FIONBIO" >&6
+ ;;
+ SunOS-4*)
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_FIONBIO 1
+_ACEOF
+
+ echo "$as_me:$LINENO: result: FIONBIO" >&5
+echo "${ECHO_T}FIONBIO" >&6
;;
*)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: O_NONBLOCK" >&5
-printf "%s\n" "O_NONBLOCK" >&6; }
+ echo "$as_me:$LINENO: result: O_NONBLOCK" >&5
+echo "${ECHO_T}O_NONBLOCK" >&6
;;
esac
#------------------------------------------------------------------------
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use dll unloading" >&5
-printf %s "checking whether to use dll unloading... " >&6; }
-# Check whether --enable-dll-unloading was given.
-if test ${enable_dll_unloading+y}
-then :
- enableval=$enable_dll_unloading; tcl_ok=$enableval
-else case e in #(
- e) tcl_ok=yes ;;
-esac
-fi
-
+echo "$as_me:$LINENO: checking whether to use dll unloading" >&5
+echo $ECHO_N "checking whether to use dll unloading... $ECHO_C" >&6
+# Check whether --enable-dll-unloading or --disable-dll-unloading was given.
+if test "${enable_dll_unloading+set}" = set; then
+ enableval="$enable_dll_unloading"
+ tcl_ok=$enableval
+else
+ tcl_ok=yes
+fi;
if test $tcl_ok = yes; then
-printf "%s\n" "#define TCL_UNLOAD_DLLS 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define TCL_UNLOAD_DLLS 1
+_ACEOF
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_ok" >&5
-printf "%s\n" "$tcl_ok" >&6; }
+echo "$as_me:$LINENO: result: $tcl_ok" >&5
+echo "${ECHO_T}$tcl_ok" >&6
#------------------------------------------------------------------------
# Check whether the timezone data is supplied by the OS or has
# to be installed by Tcl. The default is autodetection, but can
-# be overridden on the configure command line either way.
+# be overriden on the configure command line either way.
#------------------------------------------------------------------------
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for timezone data" >&5
-printf %s "checking for timezone data... " >&6; }
-
-# Check whether --with-tzdata was given.
-if test ${with_tzdata+y}
-then :
- withval=$with_tzdata; tcl_ok=$withval
-else case e in #(
- e) tcl_ok=auto ;;
-esac
-fi
+echo "$as_me:$LINENO: checking for timezone data" >&5
+echo $ECHO_N "checking for timezone data... $ECHO_C" >&6
+# Check whether --with-tzdata or --without-tzdata was given.
+if test "${with_tzdata+set}" = set; then
+ withval="$with_tzdata"
+ tcl_ok=$withval
+else
+ tcl_ok=auto
+fi;
#
# Any directories that get added here must also be added to the
# search path in ::tcl::clock::Initialize (library/clock.tcl).
#
case $tcl_ok in
no)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: supplied by OS vendor" >&5
-printf "%s\n" "supplied by OS vendor" >&6; }
+ echo "$as_me:$LINENO: result: supplied by OS vendor" >&5
+echo "${ECHO_T}supplied by OS vendor" >&6
;;
yes)
# nothing to do here
;;
auto*)
- if test ${tcl_cv_dir_zoneinfo+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
+ if test "${tcl_cv_dir_zoneinfo+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
for dir in /usr/share/zoneinfo \
/usr/share/lib/zoneinfo \
/usr/lib/zoneinfo
@@ -10796,26 +18287,27 @@ else case e in #(
tcl_cv_dir_zoneinfo="$dir"
break
fi
- done ;;
-esac
+ done
fi
if test -n "$tcl_cv_dir_zoneinfo"; then
tcl_ok=no
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dir" >&5
-printf "%s\n" "$dir" >&6; }
+ echo "$as_me:$LINENO: result: $dir" >&5
+echo "${ECHO_T}$dir" >&6
else
tcl_ok=yes
fi
;;
*)
- as_fn_error $? "invalid argument: $tcl_ok" "$LINENO" 5
+ { { echo "$as_me:$LINENO: error: invalid argument: $tcl_ok" >&5
+echo "$as_me: error: invalid argument: $tcl_ok" >&2;}
+ { (exit 1); exit 1; }; }
;;
esac
if test $tcl_ok = yes
then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: supplied by Tcl" >&5
-printf "%s\n" "supplied by Tcl" >&6; }
+ echo "$as_me:$LINENO: result: supplied by Tcl" >&5
+echo "${ECHO_T}supplied by Tcl" >&6
INSTALL_TZDATA=install-tzdata
fi
@@ -10823,36 +18315,168 @@ fi
# DTrace support
#--------------------------------------------------------------------
-# Check whether --enable-dtrace was given.
-if test ${enable_dtrace+y}
-then :
- enableval=$enable_dtrace; tcl_ok=$enableval
-else case e in #(
- e) tcl_ok=no ;;
+# Check whether --enable-dtrace or --disable-dtrace was given.
+if test "${enable_dtrace+set}" = set; then
+ enableval="$enable_dtrace"
+ tcl_ok=$enableval
+else
+ tcl_ok=no
+fi;
+if test $tcl_ok = yes; then
+ if test "${ac_cv_header_sys_sdt_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for sys/sdt.h" >&5
+echo $ECHO_N "checking for sys/sdt.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_sdt_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_sdt_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_sdt_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking sys/sdt.h usability" >&5
+echo $ECHO_N "checking sys/sdt.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <sys/sdt.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking sys/sdt.h presence" >&5
+echo $ECHO_N "checking sys/sdt.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/sdt.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: sys/sdt.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sys/sdt.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/sdt.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/sdt.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: sys/sdt.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sys/sdt.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/sdt.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/sdt.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/sdt.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/sdt.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/sdt.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/sdt.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/sdt.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/sdt.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/sdt.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/sdt.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------ ##
+## Report this to the tcl lists. ##
+## ------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
esac
+echo "$as_me:$LINENO: checking for sys/sdt.h" >&5
+echo $ECHO_N "checking for sys/sdt.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_sdt_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_sys_sdt_h=$ac_header_preproc
fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_sdt_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_sdt_h" >&6
-if test $tcl_ok = yes; then
- ac_fn_c_check_header_compile "$LINENO" "sys/sdt.h" "ac_cv_header_sys_sdt_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_sdt_h" = xyes
-then :
+fi
+if test $ac_cv_header_sys_sdt_h = yes; then
tcl_ok=yes
-else case e in #(
- e) tcl_ok=no ;;
-esac
+else
+ tcl_ok=no
fi
+
fi
if test $tcl_ok = yes; then
# Extract the first word of "dtrace", so it can be a program name with args.
set dummy dtrace; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_path_DTRACE+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) case $DTRACE in
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_DTRACE+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $DTRACE in
[\\/]* | ?:[\\/]*)
ac_cv_path_DTRACE="$DTRACE" # Let the user override the test with a path.
;;
@@ -10862,43 +18486,39 @@ as_dummy="$PATH:/usr/sbin"
for as_dir in $as_dummy
do
IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
- ac_cv_path_DTRACE="$as_dir$ac_word$ac_exec_ext"
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_DTRACE="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
- done
-IFS=$as_save_IFS
+done
;;
-esac ;;
esac
fi
DTRACE=$ac_cv_path_DTRACE
+
if test -n "$DTRACE"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5
-printf "%s\n" "$DTRACE" >&6; }
+ echo "$as_me:$LINENO: result: $DTRACE" >&5
+echo "${ECHO_T}$DTRACE" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
test -z "$ac_cv_path_DTRACE" && tcl_ok=no
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable DTrace support" >&5
-printf %s "checking whether to enable DTrace support... " >&6; }
+echo "$as_me:$LINENO: checking whether to enable DTrace support" >&5
+echo $ECHO_N "checking whether to enable DTrace support... $ECHO_C" >&6
MAKEFILE_SHELL='/bin/sh'
if test $tcl_ok = yes; then
-printf "%s\n" "#define USE_DTRACE 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define USE_DTRACE 1
+_ACEOF
DTRACE_SRC="\${DTRACE_SRC}"
DTRACE_HDR="\${DTRACE_HDR}"
@@ -10916,25 +18536,101 @@ printf "%s\n" "#define USE_DTRACE 1" >>confdefs.h
fi
fi
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_ok" >&5
-printf "%s\n" "$tcl_ok" >&6; }
+echo "$as_me:$LINENO: result: $tcl_ok" >&5
+echo "${ECHO_T}$tcl_ok" >&6
+
+#--------------------------------------------------------------------
+# Does the C stack grow upwards or downwards? Or cross-compiling?
+#--------------------------------------------------------------------
+
+echo "$as_me:$LINENO: checking if the C stack grows upwards in memory" >&5
+echo $ECHO_N "checking if the C stack grows upwards in memory... $ECHO_C" >&6
+if test "${tcl_cv_stack_grows_up+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ if test "$cross_compiling" = yes; then
+ tcl_cv_stack_grows_up=unknown
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ int StackGrowsUp(int *parent) {
+ int here;
+ volatile int result;
+ if (parent)
+ result = (&here < parent);
+ else
+ result = StackGrowsUp(&here);
+ return result;
+ }
+ int main (int argc, char *argv[]) {
+ return StackGrowsUp(0);
+ }
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_stack_grows_up=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+tcl_cv_stack_grows_up=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_stack_grows_up" >&5
+echo "${ECHO_T}$tcl_cv_stack_grows_up" >&6
+if test $tcl_cv_stack_grows_up = unknown; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TCL_CROSS_COMPILE 1
+_ACEOF
+
+elif test $tcl_cv_stack_grows_up = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TCL_STACK_GROWS_UP 1
+_ACEOF
+
+fi
#--------------------------------------------------------------------
# The check below checks whether the cpuid instruction is usable.
#--------------------------------------------------------------------
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the cpuid instruction is usable" >&5
-printf %s "checking whether the cpuid instruction is usable... " >&6; }
-if test ${tcl_cv_cpuid+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+echo "$as_me:$LINENO: checking whether the cpuid instruction is usable" >&5
+echo $ECHO_N "checking whether the cpuid instruction is usable... $ECHO_C" >&6
+if test "${tcl_cv_cpuid+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
-main (void)
+main ()
{
int index,regsPtr[4];
@@ -10949,22 +18645,45 @@ main (void)
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
tcl_cv_cpuid=yes
-else case e in #(
- e) tcl_cv_cpuid=no ;;
-esac
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_cpuid=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext ;;
-esac
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cpuid" >&5
-printf "%s\n" "$tcl_cv_cpuid" >&6; }
+echo "$as_me:$LINENO: result: $tcl_cv_cpuid" >&5
+echo "${ECHO_T}$tcl_cv_cpuid" >&6
if test $tcl_cv_cpuid = yes; then
-printf "%s\n" "#define HAVE_CPUID 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CPUID 1
+_ACEOF
fi
@@ -10983,7 +18702,7 @@ eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}"
eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
-test -z "$TCL_LIBRARY" && TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)'
+TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)'
PRIVATE_INCLUDE_DIR='$(includedir)'
HTML_DIR='$(DISTDIR)/html'
@@ -10995,40 +18714,38 @@ HTML_DIR='$(DISTDIR)/html'
if test "`uname -s`" = "Darwin" ; then
if test "`uname -s`" = "Darwin" ; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to package libraries" >&5
-printf %s "checking how to package libraries... " >&6; }
- # Check whether --enable-framework was given.
-if test ${enable_framework+y}
-then :
- enableval=$enable_framework; enable_framework=$enableval
-else case e in #(
- e) enable_framework=no ;;
-esac
-fi
-
+ echo "$as_me:$LINENO: checking how to package libraries" >&5
+echo $ECHO_N "checking how to package libraries... $ECHO_C" >&6
+ # Check whether --enable-framework or --disable-framework was given.
+if test "${enable_framework+set}" = set; then
+ enableval="$enable_framework"
+ enable_framework=$enableval
+else
+ enable_framework=no
+fi;
if test $enable_framework = yes; then
if test $SHARED_BUILD = 0; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be built if --enable-shared is yes" >&5
-printf "%s\n" "$as_me: WARNING: Frameworks can only be built if --enable-shared is yes" >&2;}
+ { echo "$as_me:$LINENO: WARNING: Frameworks can only be built if --enable-shared is yes" >&5
+echo "$as_me: WARNING: Frameworks can only be built if --enable-shared is yes" >&2;}
enable_framework=no
fi
if test $tcl_corefoundation = no; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be used when CoreFoundation is available" >&5
-printf "%s\n" "$as_me: WARNING: Frameworks can only be used when CoreFoundation is available" >&2;}
+ { echo "$as_me:$LINENO: WARNING: Frameworks can only be used when CoreFoundation is available" >&5
+echo "$as_me: WARNING: Frameworks can only be used when CoreFoundation is available" >&2;}
enable_framework=no
fi
fi
if test $enable_framework = yes; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: framework" >&5
-printf "%s\n" "framework" >&6; }
+ echo "$as_me:$LINENO: result: framework" >&5
+echo "${ECHO_T}framework" >&6
FRAMEWORK_BUILD=1
else
if test $SHARED_BUILD = 1; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared library" >&5
-printf "%s\n" "shared library" >&6; }
+ echo "$as_me:$LINENO: result: shared library" >&5
+echo "${ECHO_T}shared library" >&6
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static library" >&5
-printf "%s\n" "static library" >&6; }
+ echo "$as_me:$LINENO: result: static library" >&5
+echo "${ECHO_T}static library" >&6
fi
FRAMEWORK_BUILD=0
fi
@@ -11036,29 +18753,26 @@ printf "%s\n" "static library" >&6; }
TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version ${TCL_VERSION}`echo ${TCL_PATCH_LEVEL} | awk '{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}'`"
TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TCL_LIB_FILE}'
- echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xA000000'
+ echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xa000000'
TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tcl-Info.plist'
EXTRA_TCLSH_LIBS='-sectcreate __TEXT __info_plist Tclsh-Info.plist'
- ac_config_files="$ac_config_files Tcl-Info.plist:../macosx/Tcl-Info.plist.in Tclsh-Info.plist:../macosx/Tclsh-Info.plist.in"
+ EXTRA_APP_CC_SWITCHES='-mdynamic-no-pic'
+ ac_config_files="$ac_config_files Tcl-Info.plist:../macosx/Tcl-Info.plist.in Tclsh-Info.plist:../macosx/Tclsh-Info.plist.in"
TCL_YEAR="`date +%Y`"
fi
if test "$FRAMEWORK_BUILD" = "1" ; then
-printf "%s\n" "#define TCL_FRAMEWORK 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define TCL_FRAMEWORK 1
+_ACEOF
# Construct a fake local framework structure to make linking with
# '-framework Tcl' and running of tcltest work
- ac_config_commands="$ac_config_commands Tcl.framework"
+ ac_config_commands="$ac_config_commands Tcl.framework"
LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH"
- # default install directory for bundled packages
- if test "${libdir}" = '${exec_prefix}/lib' -o "`basename ${libdir}`" = 'Frameworks'; then
- PACKAGE_DIR="/Library/Tcl"
- else
- PACKAGE_DIR="$libdir"
- fi
if test "${libdir}" = '${exec_prefix}/lib'; then
# override libdir default
libdir="/Library/Frameworks"
@@ -11073,7 +18787,7 @@ printf "%s\n" "#define TCL_FRAMEWORK 1" >>confdefs.h
PRIVATE_INCLUDE_DIR="${libdir}/PrivateHeaders"
HTML_DIR="${libdir}/Resources/Documentation/Reference/Tcl"
EXTRA_INSTALL="install-private-headers html-tcl"
- EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)/TclTOC.html"'
+ EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)"/TclTOC.html'
EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tcl-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tcl.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tclConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."'
@@ -11085,8 +18799,6 @@ printf "%s\n" "#define TCL_FRAMEWORK 1" >>confdefs.h
else
# libdir must be a fully qualified path and not ${exec_prefix}/lib
eval libdir="$libdir"
- # default install directory for bundled packages
- PACKAGE_DIR="$libdir"
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
TCL_LIB_FLAG="-ltcl${TCL_VERSION}"
else
@@ -11101,213 +18813,6 @@ eval "CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}"
VERSION=${TCL_VERSION}
#--------------------------------------------------------------------
-# Zipfs support - Tip 430
-#--------------------------------------------------------------------
-# Check whether --enable-zipfs was given.
-if test ${enable_zipfs+y}
-then :
- enableval=$enable_zipfs; tcl_ok=$enableval
-else case e in #(
- e) tcl_ok=yes ;;
-esac
-fi
-
-if test "$tcl_ok" = "yes" -a "x$enable_framework" != "xyes"; then
- #
- # Find a native compiler
- #
- # Put a plausible default for CC_FOR_BUILD in Makefile.
- if test -z "$CC_FOR_BUILD"; then
- if test "x$cross_compiling" = "xno"; then
- CC_FOR_BUILD='$(CC)'
- else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gcc" >&5
-printf %s "checking for gcc... " >&6; }
- if test ${ac_cv_path_cc+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- search_path=`echo ${PATH} | sed -e 's/:/ /g'`
- for dir in $search_path ; do
- for j in `ls -r $dir/gcc 2> /dev/null` \
- `ls -r $dir/gcc 2> /dev/null` ; do
- if test x"$ac_cv_path_cc" = x ; then
- if test -f "$j" ; then
- ac_cv_path_cc=$j
- break
- fi
- fi
- done
- done
- ;;
-esac
-fi
-
- fi
- fi
-
- # Also set EXEEXT_FOR_BUILD.
- if test "x$cross_compiling" = "xno"; then
- EXEEXT_FOR_BUILD='$(EXEEXT)'
- OBJEXT_FOR_BUILD='$(OBJEXT)'
- else
- OBJEXT_FOR_BUILD='.no'
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for build system executable suffix" >&5
-printf %s "checking for build system executable suffix... " >&6; }
-if test ${bfd_cv_build_exeext+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) rm -f conftest*
- echo 'int main () { return 0; }' > conftest.c
- bfd_cv_build_exeext=
- ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
- for file in conftest.*; do
- case $file in
- *.c | *.o | *.obj | *.ilk | *.pdb) ;;
- *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
- esac
- done
- rm -f conftest*
- test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no ;;
-esac
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_build_exeext" >&5
-printf "%s\n" "$bfd_cv_build_exeext" >&6; }
- EXEEXT_FOR_BUILD=""
- test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
- fi
-
- #
- # Find a native zip implementation
- #
-
- MACHER_PROG=""
- ZIP_PROG=""
- ZIP_PROG_OPTIONS=""
- ZIP_PROG_VFSSEARCH=""
- ZIP_INSTALL_OBJS=""
-
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for macher" >&5
-printf %s "checking for macher... " >&6; }
- if test ${ac_cv_path_macher+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- search_path=`echo ${PATH} | sed -e 's/:/ /g'`
- for dir in $search_path ; do
- for j in `ls -r $dir/macher 2> /dev/null` \
- `ls -r $dir/macher 2> /dev/null` ; do
- if test x"$ac_cv_path_macher" = x ; then
- if test -f "$j" ; then
- ac_cv_path_macher=$j
- break
- fi
- fi
- done
- done
- ;;
-esac
-fi
-
- if test -f "$ac_cv_path_macher" ; then
- MACHER_PROG="$ac_cv_path_macher"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MACHER_PROG" >&5
-printf "%s\n" "$MACHER_PROG" >&6; }
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Found macher in environment" >&5
-printf "%s\n" "Found macher in environment" >&6; }
- fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zip" >&5
-printf %s "checking for zip... " >&6; }
- if test ${ac_cv_path_zip+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e)
- search_path=`echo ${PATH} | sed -e 's/:/ /g'`
- for dir in $search_path ; do
- for j in `ls -r $dir/zip 2> /dev/null` \
- `ls -r $dir/zip 2> /dev/null` ; do
- if test x"$ac_cv_path_zip" = x ; then
- if test -f "$j" ; then
- ac_cv_path_zip=$j
- break
- fi
- fi
- done
- done
- ;;
-esac
-fi
-
- if test -f "$ac_cv_path_zip" ; then
- ZIP_PROG="$ac_cv_path_zip"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ZIP_PROG" >&5
-printf "%s\n" "$ZIP_PROG" >&6; }
- ZIP_PROG_OPTIONS="-rq"
- ZIP_PROG_VFSSEARCH="*"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Found INFO Zip in environment" >&5
-printf "%s\n" "Found INFO Zip in environment" >&6; }
- # Use standard arguments for zip
- else
- # It is not an error if an installed version of Zip can't be located.
- # We can use the locally distributed minizip instead
- ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}"
- ZIP_PROG_OPTIONS="-o -r"
- ZIP_PROG_VFSSEARCH="*"
- ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: No zip found on PATH. Building minizip" >&5
-printf "%s\n" "No zip found on PATH. Building minizip" >&6; }
- fi
-
-
-
-
-
-
- ZIPFS_BUILD=1
- TCL_ZIP_FILE=libtcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}.zip
-else
- ZIPFS_BUILD=0
- TCL_ZIP_FILE=
-fi
-# Do checking message here to not mess up interleaved configure output
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for building with zipfs" >&5
-printf %s "checking for building with zipfs... " >&6; }
-if test "${ZIPFS_BUILD}" = 1; then
- if test "${SHARED_BUILD}" = 0; then
- ZIPFS_BUILD=2;
-
-printf "%s\n" "#define ZIPFS_BUILD 2" >>confdefs.h
-
- else
-
-printf "%s\n" "#define ZIPFS_BUILD 1" >>confdefs.h
-\
- fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; }
-else
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
-INSTALL_LIBRARIES=install-libraries
-INSTALL_MSGS=install-msgs
-fi
-
-# Point to tcl script library if we are not embedding it.
-if test "${ZIPFS_BUILD}" = 0; then
-TCL_BUILDTIME_LIBRARY=${TCL_SRC_DIR}/library
-fi
-
-
-
-
-
-
-
-#--------------------------------------------------------------------
# The statements below define the symbol TCL_PACKAGE_PATH, which
# gives a list of directories that may contain packages. The list
# consists of one directory for machine-dependent binaries and
@@ -11316,13 +18821,13 @@ fi
if test "$FRAMEWORK_BUILD" = "1" ; then
test -z "$TCL_PACKAGE_PATH" && \
- TCL_PACKAGE_PATH="~/Library/Tcl:/Library/Tcl:~/Library/Frameworks:/Library/Frameworks"
+ TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl /System/Library/Tcl ~/Library/Frameworks /Library/Frameworks /System/Library/Frameworks"
test -z "$TCL_MODULE_PATH" && \
- TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl"
+ TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl /System/Library/Tcl"
elif test "$prefix/lib" != "$libdir"; then
- test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="${libdir}:${prefix}/lib"
+ TCL_PACKAGE_PATH="${libdir} ${prefix}/lib ${TCL_PACKAGE_PATH}"
else
- test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="${prefix}/lib"
+ TCL_PACKAGE_PATH="${prefix}/lib ${TCL_PACKAGE_PATH}"
fi
#--------------------------------------------------------------------
@@ -11335,7 +18840,7 @@ fi
#
eval "TCL_STUB_LIB_FILE=libtclstub${TCL_UNSHARED_LIB_SUFFIX}"
eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
-eval "TCL_STUB_LIB_DIR=\"${libdir}\""
+eval "TCL_STUB_LIB_DIR=${libdir}"
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
TCL_STUB_LIB_FLAG="-ltclstub${TCL_VERSION}"
@@ -11415,10 +18920,7 @@ TCL_SHARED_BUILD=${SHARED_BUILD}
-
-
-
-ac_config_files="$ac_config_files Makefile:../unix/Makefile.in dltest/Makefile:../unix/dltest/Makefile.in tclConfig.sh:../unix/tclConfig.sh.in tcl.pc:../unix/tcl.pc.in"
+ ac_config_files="$ac_config_files Makefile:../unix/Makefile.in dltest/Makefile:../unix/dltest/Makefile.in tclConfig.sh:../unix/tclConfig.sh.in tcl.pc:../unix/tcl.pc.in"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -11430,78 +18932,47 @@ cat >confcache <<\_ACEOF
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
-# 'ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* 'ac_cv_foo' will be assigned the
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.
_ACEOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
+# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
-
+{
(set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # 'set' does not quote correctly, so add quotes: double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \.
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
+ ;;
*)
- # 'set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
- esac |
- sort
-) |
+ esac;
+} |
sed '
- /^ac_cv_env_/b end
t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- if test "x$cache_file" != "x/dev/null"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-printf "%s\n" "$as_me: updating cache $cache_file" >&6;}
- if test ! -f "$cache_file" || test -h "$cache_file"; then
- cat confcache >"$cache_file"
- else
- case $cache_file in #(
- */* | ?:*)
- mv -f confcache "$cache_file"$$ &&
- mv -f "$cache_file"$$ "$cache_file" ;; #(
- *)
- mv -f confcache "$cache_file" ;;
- esac
- fi
- fi
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;}
+ echo "not updating unwritable cache $cache_file"
fi
fi
rm -f confcache
@@ -11510,53 +18981,63 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
+fi
+
# Transform confdefs.h into DEFS.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
#
# If the first sed substitution is executed (which looks for macros that
-# take arguments), then branch to the quote section. Otherwise,
+# take arguments), then we branch to the quote section. Otherwise,
# look for a macro that doesn't take arguments.
-ac_script='
-:mline
-/\\$/{
- N
- s,\\\n,,
- b mline
-}
+cat >confdef2opt.sed <<\_ACEOF
t clear
-:clear
-s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
t quote
-s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
t quote
-b any
-:quote
-s/[][ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
-s/\$/$$/g
-H
-:any
-${
- g
- s/^\n//
- s/\n/ /g
- p
-}
-'
-DEFS=`sed -n "$ac_script" confdefs.h`
+d
+: quote
+s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output. A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
+: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
@@ -11566,237 +19047,81 @@ cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
debug=false
ac_cs_recheck=false
ac_cs_silent=false
-
SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
-then :
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else case e in #(
- e) case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac ;;
-esac
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
fi
+DUALCASE=1; export DUALCASE # for MKS sh
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
-# Reset variables that may have inherited troublesome values from
-# the environment.
-
-# IFS needs to be set, to space, tab, and newline, in precisely that order.
-# (If _AS_PATH_WALK were called with IFS unset, it would have the
-# side effect of setting IFS to empty, thus disabling word splitting.)
-# Quoting is to prevent editors from complaining about space-tab.
-as_nl='
-'
-export as_nl
-IFS=" "" $as_nl"
-
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
PS1='$ '
PS2='> '
PS4='+ '
-# Ensure predictable behavior from utilities with locale-dependent output.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# We cannot yet rely on "unset" to work, but we need these variables
-# to be unset--not just set to an empty or harmless value--now, to
-# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
-# also avoids known problems related to "unset" and subshell syntax
-# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
-for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
-do eval test \${$as_var+y} \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-
-# Ensure that fds 0, 1, and 2 are open.
-if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
-if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
-if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
-
-# The user is always right.
-if ${PATH_SEPARATOR+false} :; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
do
- IFS=$as_save_IFS
- case $as_dir in #(((
- '') as_dir=./ ;;
- */) ;;
- *) as_dir=$as_dir/ ;;
- esac
- test -r "$as_dir$0" && as_myself=$as_dir$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as 'sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
fi
- printf "%s\n" "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
-then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else case e in #(
- e) as_fn_append ()
- {
- eval $1=\$$1\$2
- } ;;
-esac
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
-then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else case e in #(
- e) as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- } ;;
-esac
-fi # as_fn_arith
-
+done
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
as_expr=expr
else
as_expr=false
fi
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-as_me=`$as_basename -- "$0" ||
+# Name of the executable.
+as_me=`$as_basename "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-printf "%s\n" X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+# PATH needs CR, and LINENO needs CR and PATH.
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -11804,145 +19129,181 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
-# Determine whether it's possible to make 'echo' print without a newline.
-# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
-# for compatibility with existing Makefiles.
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-# For backward compatibility with old third-party macros, we provide
-# the shell variables $as_echo and $as_echo_n. New code should use
-# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
-as_echo='printf %s\n'
-as_echo_n='printf %s'
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
+ as_expr=false
fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable.
- # In both cases, we have to default to 'cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
else
- as_ln_s='cp -pR'
+ as_ln_s='ln -s'
fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
else
- as_ln_s='cp -pR'
+ as_ln_s='cp -p'
fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-printf "%s\n" X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
+rm -f conf$$ conf$$.exe conf$$.file
-} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
+ as_mkdir_p=:
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
+as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
-as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
-as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
-as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
-as_tr_sh="eval sed '$as_sed_sh'" # deprecated
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by tcl $as_me 8.7, which was
-generated by GNU Autoconf 2.72. Invocation command line was
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by tcl $as_me 8.5, which was
+generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -11950,41 +19311,43 @@ generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
_ACEOF
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_commands="$ac_config_commands"
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
-_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
-'$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
+\`$as_me' instantiates files from templates according to the
+current configuration.
-Usage: $0 [OPTION]... [TAG]...
+Usage: $0 [OPTIONS] [FILE]...
-h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
- -q, --quiet, --silent
- do not print progress messages
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
Configuration files:
$config_files
@@ -11992,80 +19355,83 @@ $config_files
Configuration commands:
$config_commands
-Report bugs to the package provider."
-
+Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
-ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`
-ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"`
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config='$ac_cs_config_escaped'
+
+cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-tcl config.status 8.7
-configured by $0, generated by GNU Autoconf 2.72,
- with options \\"\$ac_cs_config\\"
+tcl config.status 8.5
+configured by $0, generated by GNU Autoconf 2.59,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-Copyright (C) 2023 Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-test -n "\$AWK" || AWK=awk
+srcdir=$srcdir
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
ac_need_defaults=:
while test $# != 0
do
case $1 in
- --*=?*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
ac_shift=:
;;
- *)
+ -*)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
esac
case $ac_option in
# Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- printf "%s\n" "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- printf "%s\n" "$ac_cs_config"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
ac_need_defaults=false;;
- --he | --h | --help | --hel | -h )
- printf "%s\n" "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
- -*) as_fn_error $? "unrecognized option: '$1'
-Try '$0 --help' for more information." ;;
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
- *) as_fn_append ac_config_targets " $1"
- ac_need_defaults=false ;;
+ *) ac_config_targets="$ac_config_targets $1" ;;
esac
shift
@@ -12079,486 +19445,574 @@ if $ac_cs_silent; then
fi
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>$CONFIG_STATUS <<_ACEOF
if \$ac_cs_recheck; then
- set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
- shift
- \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6
- CONFIG_SHELL='$SHELL'
- export CONFIG_SHELL
- exec "\$@"
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
fi
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- printf "%s\n" "$ac_log"
-} >&5
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>$CONFIG_STATUS <<_ACEOF
#
-# INIT-COMMANDS
+# INIT-COMMANDS section.
#
+
VERSION=${TCL_VERSION}
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Handling of arguments.
+
+cat >>$CONFIG_STATUS <<\_ACEOF
for ac_config_target in $ac_config_targets
do
- case $ac_config_target in
- "Tcl-Info.plist") CONFIG_FILES="$CONFIG_FILES Tcl-Info.plist:../macosx/Tcl-Info.plist.in" ;;
- "Tclsh-Info.plist") CONFIG_FILES="$CONFIG_FILES Tclsh-Info.plist:../macosx/Tclsh-Info.plist.in" ;;
- "Tcl.framework") CONFIG_COMMANDS="$CONFIG_COMMANDS Tcl.framework" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:../unix/Makefile.in" ;;
- "dltest/Makefile") CONFIG_FILES="$CONFIG_FILES dltest/Makefile:../unix/dltest/Makefile.in" ;;
- "tclConfig.sh") CONFIG_FILES="$CONFIG_FILES tclConfig.sh:../unix/tclConfig.sh.in" ;;
- "tcl.pc") CONFIG_FILES="$CONFIG_FILES tcl.pc:../unix/tcl.pc.in" ;;
-
- *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;;
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Tcl-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Tcl-Info.plist:../macosx/Tcl-Info.plist.in" ;;
+ "Tclsh-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Tclsh-Info.plist:../macosx/Tclsh-Info.plist.in" ;;
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile:../unix/Makefile.in" ;;
+ "dltest/Makefile" ) CONFIG_FILES="$CONFIG_FILES dltest/Makefile:../unix/dltest/Makefile.in" ;;
+ "tclConfig.sh" ) CONFIG_FILES="$CONFIG_FILES tclConfig.sh:../unix/tclConfig.sh.in" ;;
+ "tcl.pc" ) CONFIG_FILES="$CONFIG_FILES tcl.pc:../unix/tcl.pc.in" ;;
+ "Tcl.framework" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Tcl.framework" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
esac
done
-
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
- test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files
- test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
fi
# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
+# simply because there is no reason to put it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to '$tmp'.
+# Create a temporary directory, and hook for its removal unless debugging.
$debug ||
{
- tmp= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
}
+
# Create a (secure) tmp directory for tmp files.
{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
} ||
{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with './config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
-else
- ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
{
- echo "cat >conf$$subs.awk <<_ACEOF" &&
- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
- echo "_ACEOF"
-} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- . ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
- ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
- if test $ac_delim_n = $ac_delim_num; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
- N
- s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-}
-{
- line = $ 0
- nfields = split(line, field, "@")
- substed = 0
- len = length(field[1])
- for (i = 2; i < nfields; i++) {
- key = field[i]
- keylen = length(key)
- if (S_is_set[key]) {
- value = S[key]
- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
- len += length(value) + length(field[++i])
- substed = 1
- } else
- len += 1 + keylen
- }
-
- print line
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
}
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
- cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# CONFIG_FILES section.
+#
-eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@MAN_FLAGS@,$MAN_FLAGS,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@TCL_THREADS@,$TCL_THREADS,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@AR@,$AR,;t t
+s,@ac_ct_AR@,$ac_ct_AR,;t t
+s,@TCL_LIBS@,$TCL_LIBS,;t t
+s,@DL_LIBS@,$DL_LIBS,;t t
+s,@DL_OBJS@,$DL_OBJS,;t t
+s,@PLAT_OBJS@,$PLAT_OBJS,;t t
+s,@PLAT_SRCS@,$PLAT_SRCS,;t t
+s,@LDAIX_SRC@,$LDAIX_SRC,;t t
+s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t
+s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t
+s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t
+s,@LDFLAGS_DEBUG@,$LDFLAGS_DEBUG,;t t
+s,@LDFLAGS_OPTIMIZE@,$LDFLAGS_OPTIMIZE,;t t
+s,@CC_SEARCH_FLAGS@,$CC_SEARCH_FLAGS,;t t
+s,@LD_SEARCH_FLAGS@,$LD_SEARCH_FLAGS,;t t
+s,@STLIB_LD@,$STLIB_LD,;t t
+s,@SHLIB_LD@,$SHLIB_LD,;t t
+s,@TCL_SHLIB_LD_EXTRAS@,$TCL_SHLIB_LD_EXTRAS,;t t
+s,@TK_SHLIB_LD_EXTRAS@,$TK_SHLIB_LD_EXTRAS,;t t
+s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t
+s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t
+s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t
+s,@MAKE_LIB@,$MAKE_LIB,;t t
+s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t
+s,@INSTALL_LIB@,$INSTALL_LIB,;t t
+s,@DLL_INSTALL_DIR@,$DLL_INSTALL_DIR,;t t
+s,@INSTALL_STUB_LIB@,$INSTALL_STUB_LIB,;t t
+s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t
+s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@DTRACE@,$DTRACE,;t t
+s,@TCL_VERSION@,$TCL_VERSION,;t t
+s,@TCL_MAJOR_VERSION@,$TCL_MAJOR_VERSION,;t t
+s,@TCL_MINOR_VERSION@,$TCL_MINOR_VERSION,;t t
+s,@TCL_PATCH_LEVEL@,$TCL_PATCH_LEVEL,;t t
+s,@TCL_YEAR@,$TCL_YEAR,;t t
+s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t
+s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t
+s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t
+s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t
+s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t
+s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t
+s,@TCL_STUB_LIB_PATH@,$TCL_STUB_LIB_PATH,;t t
+s,@TCL_INCLUDE_SPEC@,$TCL_INCLUDE_SPEC,;t t
+s,@TCL_BUILD_STUB_LIB_SPEC@,$TCL_BUILD_STUB_LIB_SPEC,;t t
+s,@TCL_BUILD_STUB_LIB_PATH@,$TCL_BUILD_STUB_LIB_PATH,;t t
+s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t
+s,@CFG_TCL_SHARED_LIB_SUFFIX@,$CFG_TCL_SHARED_LIB_SUFFIX,;t t
+s,@CFG_TCL_UNSHARED_LIB_SUFFIX@,$CFG_TCL_UNSHARED_LIB_SUFFIX,;t t
+s,@TCL_SHARED_BUILD@,$TCL_SHARED_BUILD,;t t
+s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t
+s,@TCL_BUILD_LIB_SPEC@,$TCL_BUILD_LIB_SPEC,;t t
+s,@TCL_LIB_VERSIONS_OK@,$TCL_LIB_VERSIONS_OK,;t t
+s,@TCL_SHARED_LIB_SUFFIX@,$TCL_SHARED_LIB_SUFFIX,;t t
+s,@TCL_UNSHARED_LIB_SUFFIX@,$TCL_UNSHARED_LIB_SUFFIX,;t t
+s,@TCL_HAS_LONGLONG@,$TCL_HAS_LONGLONG,;t t
+s,@INSTALL_TZDATA@,$INSTALL_TZDATA,;t t
+s,@DTRACE_SRC@,$DTRACE_SRC,;t t
+s,@DTRACE_HDR@,$DTRACE_HDR,;t t
+s,@DTRACE_OBJ@,$DTRACE_OBJ,;t t
+s,@MAKEFILE_SHELL@,$MAKEFILE_SHELL,;t t
+s,@BUILD_DLTEST@,$BUILD_DLTEST,;t t
+s,@TCL_PACKAGE_PATH@,$TCL_PACKAGE_PATH,;t t
+s,@TCL_MODULE_PATH@,$TCL_MODULE_PATH,;t t
+s,@TCL_LIBRARY@,$TCL_LIBRARY,;t t
+s,@PRIVATE_INCLUDE_DIR@,$PRIVATE_INCLUDE_DIR,;t t
+s,@HTML_DIR@,$HTML_DIR,;t t
+s,@EXTRA_CC_SWITCHES@,$EXTRA_CC_SWITCHES,;t t
+s,@EXTRA_APP_CC_SWITCHES@,$EXTRA_APP_CC_SWITCHES,;t t
+s,@EXTRA_INSTALL@,$EXTRA_INSTALL,;t t
+s,@EXTRA_INSTALL_BINARIES@,$EXTRA_INSTALL_BINARIES,;t t
+s,@EXTRA_BUILD_HTML@,$EXTRA_BUILD_HTML,;t t
+s,@EXTRA_TCLSH_LIBS@,$EXTRA_TCLSH_LIBS,;t t
+s,@DLTEST_LD@,$DLTEST_LD,;t t
+s,@DLTEST_SUFFIX@,$DLTEST_SUFFIX,;t t
+CEOF
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain ':'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
- done
+_ACEOF
- # Let's still pretend it is 'configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input='Generated from '`
- printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
- `' by configure.'
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-printf "%s\n" "$as_me: creating $ac_file" >&6;}
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
fi
- # Neutralize special characters interpreted by sed in replacement strings.
- case $configure_input in #(
- *\&* | *\|* | *\\* )
- ac_sed_conf_input=`printf "%s\n" "$configure_input" |
- sed 's/[\\\\&|]/\\\\&/g'`;; #(
- *) ac_sed_conf_input=$configure_input;;
- esac
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+ fi
+fi # test -n "$CONFIG_FILES"
- case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
esac
- ac_dir=`$as_dirname -- "$ac_file" ||
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-printf "%s\n" X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir="$ac_dir"; as_fn_mkdir_p
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
ac_builddir=.
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
case $srcdir in
- .) # We are building in place.
+ .) # No --srcdir option. We are building in place.
ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
esac
-_ACEOF
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
-# Neutralize VPATH when '$srcdir' = '.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
+
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
$extrasub
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+cat >>$CONFIG_STATUS <<\_ACEOF
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
-printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
-
- rm -f "$ac_tmp/stdin"
- case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
- :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-printf "%s\n" "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
- case $ac_file$ac_mode in
- "Tcl.framework":C) n=Tcl &&
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ Tcl.framework ) n=Tcl &&
f=$n.framework && v=Versions/$VERSION &&
rm -rf $f && mkdir -p $f/$v/Resources &&
ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v &&
ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist &&
unset n f v
;;
-
esac
-done # for ac_tag
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
-as_fn_exit 0
+{ (exit 0); exit 0; }
_ACEOF
+chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save
-test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
@@ -12578,12 +20032,6 @@ if test "$no_create" != yes; then
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
+ $ac_cs_success || { (exit 1); exit 1; }
fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
-
diff --git a/unix/configure.ac b/unix/configure.in
index a74d494..6c7cc09 100644
--- a/unix/configure.ac
+++ b/unix/configure.in
@@ -3,8 +3,8 @@ dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tcl installation
dnl to configure the system for the local environment.
-AC_INIT([tcl],[8.7])
-AC_PREREQ([2.69])
+AC_INIT([tcl],[8.5])
+AC_PREREQ(2.59)
dnl This is only used when included from macosx/configure.ac
m4_ifdef([SC_USE_CONFIG_HEADERS], [
@@ -17,43 +17,17 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [
/* Undef unused package specific autoheader defines so that we can
* include both tclConfig.h and tkConfig.h at the same time: */
/* override */ #undef PACKAGE_NAME
- /* override */ #undef PACKAGE_TARNAME
- /* override */ #undef PACKAGE_VERSION
/* override */ #undef PACKAGE_STRING
+ /* override */ #undef PACKAGE_TARNAME
#endif /* _TCLCONFIG */])
])
-TCL_VERSION=8.7
+TCL_VERSION=8.5
TCL_MAJOR_VERSION=8
-TCL_MINOR_VERSION=7
-TCL_PATCH_LEVEL="b1"
+TCL_MINOR_VERSION=5
+TCL_PATCH_LEVEL=".18"
VERSION=${TCL_VERSION}
-EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"}
-EXTRA_BUILD_HTML=${EXTRA_BUILD_HTML:-"@:"}
-
-#------------------------------------------------------------------------
-# Setup configure arguments for bundled packages
-#------------------------------------------------------------------------
-
-PKG_CFG_ARGS="$ac_configure_args ${PKG_CFG_ARGS}"
-
-if test -r "$cache_file" -a -f "$cache_file"; then
- case $cache_file in
- [[\\/]]* | ?:[[\\/]]* ) pkg_cache_file=$cache_file ;;
- *) pkg_cache_file=../../$cache_file ;;
- esac
- PKG_CFG_ARGS="${PKG_CFG_ARGS} --cache-file=$pkg_cache_file"
-fi
-
-#------------------------------------------------------------------------
-# Empty slate for bundled packages, to avoid stale configuration
-#------------------------------------------------------------------------
-#rm -Rf pkgs
-if test -f Makefile; then
- make distclean-packages
-fi
-
#------------------------------------------------------------------------
# Handle the --prefix=... option
#------------------------------------------------------------------------
@@ -87,11 +61,10 @@ fi
AC_PROG_CC
AC_C_INLINE
-
#--------------------------------------------------------------------
# Supply substitutes for missing POSIX header files. Special notes:
-# - stdlib.h doesn't define strtol or strtoul in some versions
-# of SunOS
+# - stdlib.h doesn't define strtol, strtoul, or
+# strtod insome versions of SunOS
# - some versions of string.h don't declare procedures such
# as strstr
# Do this early, otherwise an autoconf bug throws errors on configure
@@ -99,12 +72,6 @@ AC_C_INLINE
SC_MISSING_POSIX_HEADERS
-#--------------------------------------------------------------------
-# Determines the correct executable file extension (.exe)
-#--------------------------------------------------------------------
-
-AC_EXEEXT
-
#------------------------------------------------------------------------
# If we're using GCC, see if the compiler understands -pipe. If so, use it.
# It makes compiling go faster. (This is only a performance feature.)
@@ -114,7 +81,7 @@ if test -z "$no_pipe" && test -n "$GCC"; then
AC_CACHE_CHECK([if the compiler understands -pipe],
tcl_cv_cc_pipe, [
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_cc_pipe=yes],[tcl_cv_cc_pipe=no])
+ AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no)
CFLAGS=$hold_cflags])
if test $tcl_cv_cc_pipe = yes; then
CFLAGS="$CFLAGS -pipe"
@@ -122,6 +89,12 @@ if test -z "$no_pipe" && test -n "$GCC"; then
fi
#------------------------------------------------------------------------
+# Threads support
+#------------------------------------------------------------------------
+
+SC_ENABLE_THREADS
+
+#------------------------------------------------------------------------
# Embedded configuration information, encoding to use for the values, TIP #59
#------------------------------------------------------------------------
@@ -139,62 +112,6 @@ LIBS="$LIBS$THREADS_LIBS"
SC_ENABLE_SHARED
#--------------------------------------------------------------------
-# Look for a native installed tclsh binary (if available)
-# If one cannot be found then use the binary we build (fails for
-# cross compiling). This is used for NATIVE_TCLSH in Makefile.
-#--------------------------------------------------------------------
-
-SC_PROG_TCLSH
-if test "$TCLSH_PROG" = ""; then
- TCLSH_PROG='./${TCL_EXE}'
-fi
-
-#------------------------------------------------------------------------
-# Add stuff for zlib
-#------------------------------------------------------------------------
-
-zlib_ok=yes
-AC_CHECK_HEADER([zlib.h],[
- AC_CHECK_TYPE([gz_header],[],[zlib_ok=no],[#include <zlib.h>])],[
- zlib_ok=no])
-AS_IF([test $zlib_ok = yes], [
- AC_SEARCH_LIBS([deflateSetHeader],[z],[],[
- zlib_ok=no
- ])])
-AS_IF([test $zlib_ok = no], [
- AC_SUBST(ZLIB_OBJS,[\${ZLIB_OBJS}])
- AC_SUBST(ZLIB_SRCS,[\${ZLIB_SRCS}])
- AC_SUBST(ZLIB_INCLUDE,[-I\${ZLIB_DIR}])
-])
-AC_DEFINE(HAVE_ZLIB, 1, [Is there an installed zlib?])
-
-#------------------------------------------------------------------------
-# Add stuff for libtommath
-
-libtommath_ok=yes
-AC_ARG_WITH(system-libtommath,
-AS_HELP_STRING([--with-system-libtommath],
- [use external libtommath (default: true if available, false otherwise)]),
- [libtommath_ok=${withval}])
-if test x"${libtommath_ok}" = x -o x"${libtommath_ok}" != xno; then
- AC_CHECK_HEADER([tommath.h],[
- AC_CHECK_TYPE([mp_int],[],[libtommath_ok=no],[#include <tommath.h>])],[
- libtommath_ok=no])
- AS_IF([test $libtommath_ok = yes], [
- AC_CHECK_LIB([tommath],[mp_log_u32],[MATH_LIBS="$MATH_LIBS -ltommath"],[
- libtommath_ok=no])])
-fi
-AS_IF([test $libtommath_ok = yes], [
- AC_SUBST(TCL_PC_REQUIRES_PRIVATE, ['libtommath >= 1.2.0,'])
- AC_SUBST(TCL_PC_CFLAGS, ['-DTCL_WITH_EXTERNAL_TOMMATH'])
- AC_DEFINE(TCL_WITH_EXTERNAL_TOMMATH, 1, [Tcl with external libtommath])
-], [
- AC_SUBST(TOMMATH_OBJS,[\${TOMMATH_OBJS}])
- AC_SUBST(TOMMATH_SRCS,[\${TOMMATH_SRCS}])
- AC_SUBST(TOMMATH_INCLUDE,[-I\${TOMMATH_DIR}])
-])
-
-#--------------------------------------------------------------------
# The statements below define a collection of compile flags. This
# macro depends on the value of SHARED_BUILD, and should be called
# after SC_ENABLE_SHARED checks the configure switches.
@@ -204,6 +121,7 @@ SC_CONFIG_CFLAGS
SC_ENABLE_SYMBOLS(bccdebug)
+AC_DEFINE(TCL_TOMMATH, 1, [Build libtommath?])
AC_DEFINE(MP_PREC, 4, [Default libtommath precision.])
#--------------------------------------------------------------------
@@ -219,7 +137,7 @@ SC_TCL_64BIT_FLAGS
# Tcl_UniChar strings to memcmp on big-endian systems.
#--------------------------------------------------------------------
-AC_C_BIGENDIAN(,,,[#])
+AC_C_BIGENDIAN
#--------------------------------------------------------------------
# Supply substitutes for missing POSIX library procedures, or
@@ -231,16 +149,13 @@ AC_CHECK_FUNCS(getcwd, , [AC_DEFINE(USEGETWD, 1, [Is getcwd Posix-compliant?])])
# Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really
# define USEGETWD even if the posix getcwd exists. Add a test ?
-AC_REPLACE_FUNCS(mkstemp waitpid)
+AC_REPLACE_FUNCS(opendir strtol waitpid)
AC_CHECK_FUNC(strerror, , [AC_DEFINE(NO_STRERROR, 1, [Do we have strerror()])])
AC_CHECK_FUNC(getwd, , [AC_DEFINE(NO_GETWD, 1, [Do we have getwd()])])
AC_CHECK_FUNC(wait3, , [AC_DEFINE(NO_WAIT3, 1, [Do we have wait3()])])
-AC_CHECK_FUNC(fork, , [AC_DEFINE(NO_FORK, 1, [Do we have fork()])])
-AC_CHECK_FUNC(mknod, , [AC_DEFINE(NO_MKNOD, 1, [Do we have mknod()])])
-AC_CHECK_FUNC(tcdrain, , [AC_DEFINE(NO_TCDRAIN, 1, [Do we have tcdrain()])])
AC_CHECK_FUNC(uname, , [AC_DEFINE(NO_UNAME, 1, [Do we have uname()])])
-if test "`uname -s`" = "Darwin" && \
+if test "`uname -s`" = "Darwin" && test "${TCL_THREADS}" = 1 && \
test "`uname -r | awk -F. '{print [$]1}'`" -lt 7; then
# prior to Darwin 7, realpath is not threadsafe, so don't
# use it when threads are enabled, c.f. bug # 711232
@@ -248,53 +163,50 @@ if test "`uname -s`" = "Darwin" && \
fi
AC_CHECK_FUNC(realpath, , [AC_DEFINE(NO_REALPATH, 1, [Do we have realpath()])])
-SC_TCL_IPV6
+SC_TCL_GETADDRINFO
#--------------------------------------------------------------------
# Look for thread-safe variants of some library functions.
#--------------------------------------------------------------------
-SC_TCL_GETPWUID_R
-SC_TCL_GETPWNAM_R
-SC_TCL_GETGRGID_R
-SC_TCL_GETGRNAM_R
-if test "`uname -s`" = "Darwin" && \
- test "`uname -r | awk -F. '{print [$]1}'`" -gt 5; then
- # Starting with Darwin 6 (Mac OSX 10.2), gethostbyX
- # are actually MT-safe as they always return pointers
- # from TSD instead of static storage.
- AC_DEFINE(HAVE_MTSAFE_GETHOSTBYNAME, 1,
- [Do we have MT-safe gethostbyname() ?])
- AC_DEFINE(HAVE_MTSAFE_GETHOSTBYADDR, 1,
- [Do we have MT-safe gethostbyaddr() ?])
-
-elif test "`uname -s`" = "HP-UX" && \
- test "`uname -r|sed -e 's|B\.||' -e 's|\..*$||'`" -gt 10; then
- # Starting with HPUX 11.00 (we believe), gethostbyX
- # are actually MT-safe as they always return pointers
- # from TSD instead of static storage.
- AC_DEFINE(HAVE_MTSAFE_GETHOSTBYNAME, 1,
- [Do we have MT-safe gethostbyname() ?])
- AC_DEFINE(HAVE_MTSAFE_GETHOSTBYADDR, 1,
- [Do we have MT-safe gethostbyaddr() ?])
+if test "${TCL_THREADS}" = 1; then
+ SC_TCL_GETPWUID_R
+ SC_TCL_GETPWNAM_R
+ SC_TCL_GETGRGID_R
+ SC_TCL_GETGRNAM_R
+ if test "`uname -s`" = "Darwin" && \
+ test "`uname -r | awk -F. '{print [$]1}'`" -gt 5; then
+ # Starting with Darwin 6 (Mac OSX 10.2), gethostbyX
+ # are actually MT-safe as they always return pointers
+ # from TSD instead of static storage.
+ AC_DEFINE(HAVE_MTSAFE_GETHOSTBYNAME, 1,
+ [Do we have MT-safe gethostbyname() ?])
+ AC_DEFINE(HAVE_MTSAFE_GETHOSTBYADDR, 1,
+ [Do we have MT-safe gethostbyaddr() ?])
+
+ elif test "`uname -s`" = "HP-UX" && \
+ test "`uname -r|sed -e 's|B\.||' -e 's|\..*$||'`" -gt 10; then
+ # Starting with HPUX 11.00 (we believe), gethostbyX
+ # are actually MT-safe as they always return pointers
+ # from TSD instead of static storage.
+ AC_DEFINE(HAVE_MTSAFE_GETHOSTBYNAME, 1,
+ [Do we have MT-safe gethostbyname() ?])
+ AC_DEFINE(HAVE_MTSAFE_GETHOSTBYADDR, 1,
+ [Do we have MT-safe gethostbyaddr() ?])
-else
- SC_TCL_GETHOSTBYNAME_R
- SC_TCL_GETHOSTBYADDR_R
+ else
+ SC_TCL_GETHOSTBYNAME_R
+ SC_TCL_GETHOSTBYADDR_R
+ fi
fi
#---------------------------------------------------------------------------
-# Check for serial port interface.
-#
-# termios.h is present on all POSIX systems.
-# sys/ioctl.h is almost always present, though what it contains
-# is system-specific.
-# sys/modem.h is needed on HP-UX.
+# Determine which interface to use to talk to the serial port.
+# Note that #include lines must begin in leftmost column for
+# some compilers to recognize them as preprocessor directives.
#---------------------------------------------------------------------------
-AC_CHECK_HEADERS(termios.h)
-AC_CHECK_HEADERS(sys/ioctl.h)
-AC_CHECK_HEADERS(sys/modem.h)
+SC_SERIAL_PORT
#--------------------------------------------------------------------
# Include sys/select.h if it exists and if it supplies things
@@ -307,8 +219,8 @@ AC_CHECK_HEADERS(sys/modem.h)
#--------------------------------------------------------------------
AC_CACHE_CHECK([for fd_set in sys/types], tcl_cv_type_fd_set, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]], [[fd_set readMask, writeMask;]])],
- [tcl_cv_type_fd_set=yes],[tcl_cv_type_fd_set=no])])
+ AC_TRY_COMPILE([#include <sys/types.h>],[fd_set readMask, writeMask;],
+ tcl_cv_type_fd_set=yes, tcl_cv_type_fd_set=no)])
tcl_ok=$tcl_cv_type_fd_set
if test $tcl_ok = no; then
AC_CACHE_CHECK([for fd_mask in sys/select], tcl_cv_grep_fd_mask, [
@@ -323,43 +235,6 @@ if test $tcl_ok = no; then
AC_DEFINE(NO_FD_SET, 1, [Do we have fd_set?])
fi
-AC_CACHE_CHECK([for pselect], tcl_cv_func_pselect, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]], [[void *func = pselect;]])],[tcl_cv_func_pselect=yes],[tcl_cv_func_pselect=no])])
-tcl_ok=$tcl_cv_func_pselect
-if test $tcl_ok = yes; then
- AC_DEFINE(HAVE_PSELECT, 1, [Should we use pselect()?])
-fi
-
-#------------------------------------------------------------------------
-# Options for the notifier. Checks for epoll(7) on Linux, and
-# kqueue(2) on {DragonFly,Free,Net,Open}BSD
-#------------------------------------------------------------------------
-
-AC_MSG_CHECKING([for advanced notifier support])
-case x`uname -s` in
- xLinux)
- AC_MSG_RESULT([epoll(7)])
- AC_CHECK_HEADERS([sys/epoll.h],
- [AC_DEFINE(NOTIFIER_EPOLL, [1], [Is epoll(7) supported?])])
- AC_CHECK_HEADERS([sys/eventfd.h],
- [AC_DEFINE(HAVE_EVENTFD, [1], [Is eventfd(2) supported?])]);;
- xDragonFlyBSD|xFreeBSD|xNetBSD|xOpenBSD)
- AC_MSG_RESULT([kqueue(2)])
- # Messy because we want to check if *all* the headers are present, and not
- # just *any*
- tcl_kqueue_headers=x
- AC_CHECK_HEADERS([sys/types.h sys/event.h sys/time.h],
- [tcl_kqueue_headers=${tcl_kqueue_headers}y])
- AS_IF([test $tcl_kqueue_headers = xyyy], [
- AC_DEFINE(NOTIFIER_KQUEUE, [1], [Is kqueue(2) supported?])]);;
- xDarwin)
- # Assume that we've got CoreFoundation present (checked elsewhere because
- # of wider impact).
- AC_MSG_RESULT([OSX]);;
- *)
- AC_MSG_RESULT([none]);;
-esac
-
#------------------------------------------------------------------------------
# Find out all about time handling differences.
#------------------------------------------------------------------------------
@@ -373,15 +248,22 @@ SC_TIME_HANDLER
#--------------------------------------------------------------------
if test "$ac_cv_cygwin" != "yes"; then
- AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_blksize, struct stat.st_rdev])
+AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_blksize])
fi
AC_CHECK_TYPES([blkcnt_t])
AC_CHECK_FUNC(fstatfs, , [AC_DEFINE(NO_FSTATFS, 1, [Do we have fstatfs()?])])
#--------------------------------------------------------------------
-# Some system like SunOS 4 and other BSD like systems have no memmove
-# (we assume they have bcopy instead). {The replacement define is in
-# compat/string.h}
+# Some system have no memcmp or it does not work with 8 bit
+# data, this checks it and add memcmp.o to LIBOBJS if needed
+#--------------------------------------------------------------------
+
+AC_FUNC_MEMCMP
+
+#--------------------------------------------------------------------
+# Some system like SunOS 4 and other BSD like systems
+# have no memmove (we assume they have bcopy instead).
+# {The replacement define is in compat/string.h}
#--------------------------------------------------------------------
AC_CHECK_FUNC(memmove, , [
@@ -389,6 +271,48 @@ AC_CHECK_FUNC(memmove, , [
AC_DEFINE(NO_STRING_H, 1, [Do we have <string.h>?]) ])
#--------------------------------------------------------------------
+# On some systems strstr is broken: it returns a pointer even
+# even if the original string is empty.
+#--------------------------------------------------------------------
+
+SC_TCL_CHECK_BROKEN_FUNC(strstr, [
+ extern int strstr();
+ exit(strstr("\0test", "test") ? 1 : 0);
+])
+
+#--------------------------------------------------------------------
+# Check for strtoul function. This is tricky because under some
+# versions of AIX strtoul returns an incorrect terminator
+# pointer for the string "0".
+#--------------------------------------------------------------------
+
+SC_TCL_CHECK_BROKEN_FUNC(strtoul, [
+ extern int strtoul();
+ char *term, *string = "0";
+ exit(strtoul(string,&term,0) != 0 || term != string+1);
+])
+
+#--------------------------------------------------------------------
+# Check for the strtod function. This is tricky because in some
+# versions of Linux strtod mis-parses strings starting with "+".
+#--------------------------------------------------------------------
+
+SC_TCL_CHECK_BROKEN_FUNC(strtod, [
+ extern double strtod();
+ char *term, *string = " +69";
+ exit(strtod(string,&term) != 69 || term != string+4);
+])
+
+#--------------------------------------------------------------------
+# Under Solaris 2.4, strtod returns the wrong value for the
+# terminating character under some conditions. Check for this
+# and if the problem exists use a substitute procedure
+# "fixstrtod" that corrects the error.
+#--------------------------------------------------------------------
+
+SC_BUGGY_STRTOD
+
+#--------------------------------------------------------------------
# Check for various typedefs and provide substitutes if
# they don't exist.
#--------------------------------------------------------------------
@@ -399,19 +323,56 @@ AC_TYPE_SIZE_T
AC_TYPE_UID_T
AC_CACHE_CHECK([for socklen_t], tcl_cv_type_socklen_t, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
- ]], [[
+ ],[
socklen_t foo;
- ]])],[tcl_cv_type_socklen_t=yes],[tcl_cv_type_socklen_t=no])])
+ ],[tcl_cv_type_socklen_t=yes],[tcl_cv_type_socklen_t=no])])
if test $tcl_cv_type_socklen_t = no; then
AC_DEFINE(socklen_t, int, [Define as int if socklen_t is not available])
fi
-AC_CHECK_TYPES([intptr_t, uintptr_t],,,[[
-#include <stdint.h>
-]])
+AC_CHECK_TYPE([intptr_t], [
+ AC_DEFINE([HAVE_INTPTR_T], 1, [Do we have the intptr_t type?])], [
+ AC_CACHE_CHECK([for pointer-size signed integer type], tcl_cv_intptr_t, [
+ for tcl_cv_intptr_t in "int" "long" "long long" none; do
+ if test "$tcl_cv_intptr_t" != none; then
+ AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT],
+ [[sizeof (void *) <= sizeof ($tcl_cv_intptr_t)]])],
+ [tcl_ok=yes], [tcl_ok=no])
+ test "$tcl_ok" = yes && break; fi
+ done])
+ if test "$tcl_cv_intptr_t" != none; then
+ AC_DEFINE_UNQUOTED([intptr_t], [$tcl_cv_intptr_t], [Signed integer
+ type wide enough to hold a pointer.])
+ fi
+])
+AC_CHECK_TYPE([uintptr_t], [
+ AC_DEFINE([HAVE_UINTPTR_T], 1, [Do we have the uintptr_t type?])], [
+ AC_CACHE_CHECK([for pointer-size unsigned integer type], tcl_cv_uintptr_t, [
+ for tcl_cv_uintptr_t in "unsigned int" "unsigned long" "unsigned long long" \
+ none; do
+ if test "$tcl_cv_uintptr_t" != none; then
+ AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT],
+ [[sizeof (void *) <= sizeof ($tcl_cv_uintptr_t)]])],
+ [tcl_ok=yes], [tcl_ok=no])
+ test "$tcl_ok" = yes && break; fi
+ done])
+ if test "$tcl_cv_uintptr_t" != none; then
+ AC_DEFINE_UNQUOTED([uintptr_t], [$tcl_cv_uintptr_t], [Unsigned integer
+ type wide enough to hold a pointer.])
+ fi
+])
+
+#--------------------------------------------------------------------
+# If a system doesn't have an opendir function (man, that's old!)
+# then we have to supply a different version of dirent.h which
+# is compatible with the substitute version of opendir that's
+# provided. This version only works with V7-style directories.
+#--------------------------------------------------------------------
+
+AC_CHECK_FUNC(opendir, , [AC_DEFINE(USE_DIRENT2_H, 1, [May we include <dirent2.h>?])])
#--------------------------------------------------------------------
# The check below checks whether <sys/wait.h> defines the type
@@ -422,12 +383,12 @@ AC_CHECK_TYPES([intptr_t, uintptr_t],,,[[
#--------------------------------------------------------------------
AC_CACHE_CHECK([union wait], tcl_cv_union_wait, [
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
-#include <sys/wait.h>]], [[
+ AC_TRY_LINK([#include <sys/types.h>
+#include <sys/wait.h>], [
union wait x;
WIFEXITED(x); /* Generates compiler error if WIFEXITED
* uses an int. */
- ]])],[tcl_cv_union_wait=yes],[tcl_cv_union_wait=no])])
+ ], tcl_cv_union_wait=yes, tcl_cv_union_wait=no)])
if test $tcl_cv_union_wait = no; then
AC_DEFINE(NO_UNION_WAIT, 1, [Do we have a usable 'union wait'?])
fi
@@ -477,10 +438,10 @@ fi
AC_C_CHAR_UNSIGNED
AC_CACHE_CHECK([signed char declarations], tcl_cv_char_signed, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+ AC_TRY_COMPILE(, [
signed char *p;
p = 0;
- ]])],[tcl_cv_char_signed=yes],[tcl_cv_char_signed=no])])
+ ], tcl_cv_char_signed=yes, tcl_cv_char_signed=no)])
if test $tcl_cv_char_signed = yes; then
AC_DEFINE(HAVE_SIGNED_CHAR, 1, [Are characters signed?])
fi
@@ -490,9 +451,8 @@ fi
#--------------------------------------------------------------------
AC_CACHE_CHECK([for a putenv() that copies the buffer], tcl_cv_putenv_copy, [
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ AC_TRY_RUN([
#include <stdlib.h>
- #include <string.h>
#define OURVAR "havecopy=yes"
int main (int argc, char *argv[])
{
@@ -509,10 +469,10 @@ AC_CACHE_CHECK([for a putenv() that copies the buffer], tcl_cv_putenv_copy, [
return 1;
}
}
- ]])],
- [tcl_cv_putenv_copy=no],
- [tcl_cv_putenv_copy=yes],
- [tcl_cv_putenv_copy=no])])
+ ],
+ tcl_cv_putenv_copy=no,
+ tcl_cv_putenv_copy=yes,
+ tcl_cv_putenv_copy=no)])
if test $tcl_cv_putenv_copy = yes; then
AC_DEFINE(HAVE_PUTENV_THAT_COPIES, 1,
[Does putenv() copy strings or incorporate them by reference?])
@@ -525,10 +485,22 @@ fi
SC_ENABLE_LANGINFO
#--------------------------------------------------------------------
-# Check for support of cfmakeraw, chflags and mkstemps functions
+# Check for support of chflags function
#--------------------------------------------------------------------
-AC_CHECK_FUNCS(cfmakeraw chflags mkstemps)
+AC_CHECK_FUNCS(chflags)
+
+#--------------------------------------------------------------------
+# Check for support of isnan() function or macro
+#--------------------------------------------------------------------
+
+AC_CACHE_CHECK([isnan], tcl_cv_isnan, [
+ AC_TRY_LINK([#include <math.h>], [
+isnan(0.0); /* Generates an error if isnan is missing */
+], tcl_cv_isnan=yes, tcl_cv_isnan=no)])
+if test $tcl_cv_isnan = no; then
+ AC_DEFINE(NO_ISNAN, 1, [Do we have a usable 'isnan'?])
+fi
#--------------------------------------------------------------------
# Darwin specific API checks and defines
@@ -542,6 +514,7 @@ if test "`uname -s`" = "Darwin" ; then
AC_CHECK_HEADERS(libkern/OSAtomic.h)
AC_CHECK_FUNCS(OSSpinLockLock)
fi
+ AC_DEFINE(USE_VFORK, 1, [Should we use vfork() instead of fork()?])
AC_DEFINE(TCL_DEFAULT_ENCODING, "utf-8",
[Are we to override what our default encoding is?])
AC_DEFINE(TCL_LOAD_FROM_MEMORY, 1,
@@ -552,7 +525,7 @@ if test "`uname -s`" = "Darwin" ; then
if test "$ac_cv_header_AvailabilityMacros_h" = yes; then
AC_CACHE_CHECK([if weak import is available], tcl_cv_cc_weak_import, [
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_LINK([
#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020
#error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020
@@ -561,8 +534,8 @@ if test "`uname -s`" = "Darwin" ; then
#error MAC_OS_X_VERSION_MIN_REQUIRED < 1020
#endif
int rand(void) __attribute__((weak_import));
- ]], [[rand();]])],
- [tcl_cv_cc_weak_import=yes],[tcl_cv_cc_weak_import=no])
+ ], [rand();],
+ tcl_cv_cc_weak_import=yes, tcl_cv_cc_weak_import=no)
CFLAGS=$hold_cflags])
if test $tcl_cv_cc_weak_import = yes; then
AC_DEFINE(HAVE_WEAK_IMPORT, 1, [Is weak import available?])
@@ -570,7 +543,7 @@ if test "`uname -s`" = "Darwin" ; then
AC_CACHE_CHECK([if Darwin SUSv3 extensions are available],
tcl_cv_cc_darwin_c_source, [
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050
#error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050
@@ -580,7 +553,7 @@ if test "`uname -s`" = "Darwin" ; then
#endif
#define _DARWIN_C_SOURCE 1
#include <sys/cdefs.h>
- ]], [[]])],[tcl_cv_cc_darwin_c_source=yes],[tcl_cv_cc_darwin_c_source=no])
+ ],,tcl_cv_cc_darwin_c_source=yes, tcl_cv_cc_darwin_c_source=no)
CFLAGS=$hold_cflags])
if test $tcl_cv_cc_darwin_c_source = yes; then
AC_DEFINE(_DARWIN_C_SOURCE, 1,
@@ -596,27 +569,28 @@ else
fi
#--------------------------------------------------------------------
-# Check for support of fts functions (readdir replacement)
+# Check for support of fts functions (readdir replacement)
#--------------------------------------------------------------------
AC_CACHE_CHECK([for fts], tcl_cv_api_fts, [
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_LINK([
#include <sys/param.h>
#include <sys/stat.h>
#include <fts.h>
- ]], [[
+ ], [
char*const p[2] = {"/", NULL};
FTS *f = fts_open(p, FTS_PHYSICAL|FTS_NOCHDIR|FTS_NOSTAT, NULL);
FTSENT *e = fts_read(f); fts_close(f);
- ]])],[tcl_cv_api_fts=yes],[tcl_cv_api_fts=no])])
+ ], tcl_cv_api_fts=yes, tcl_cv_api_fts=no)])
if test $tcl_cv_api_fts = yes; then
AC_DEFINE(HAVE_FTS, 1, [Do we have fts functions?])
fi
#--------------------------------------------------------------------
-# The statements below check for systems where POSIX-style non-blocking
-# I/O (O_NONBLOCK) doesn't work or is unimplemented. On these systems
-# (mostly older ones), use the old BSD-style FIONBIO approach instead.
+# The statements below check for systems where POSIX-style
+# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented.
+# On these systems (mostly older ones), use the old BSD-style
+# FIONBIO approach instead.
#--------------------------------------------------------------------
SC_BLOCKING_STYLE
@@ -625,7 +599,7 @@ SC_BLOCKING_STYLE
AC_MSG_CHECKING([whether to use dll unloading])
AC_ARG_ENABLE(dll-unloading,
- AS_HELP_STRING([--enable-dll-unloading],
+ AC_HELP_STRING([--enable-dll-unloading],
[enable the 'unload' command (default: on)]),
[tcl_ok=$enableval], [tcl_ok=yes])
if test $tcl_ok = yes; then
@@ -636,12 +610,12 @@ AC_MSG_RESULT([$tcl_ok])
#------------------------------------------------------------------------
# Check whether the timezone data is supplied by the OS or has
# to be installed by Tcl. The default is autodetection, but can
-# be overridden on the configure command line either way.
+# be overriden on the configure command line either way.
#------------------------------------------------------------------------
AC_MSG_CHECKING([for timezone data])
AC_ARG_WITH(tzdata,
- AS_HELP_STRING([--with-tzdata],
+ AC_HELP_STRING([--with-tzdata],
[install timezone data (default: autodetect)]),
[tcl_ok=$withval], [tcl_ok=auto])
#
@@ -689,7 +663,7 @@ fi
#--------------------------------------------------------------------
AC_ARG_ENABLE(dtrace,
- AS_HELP_STRING([--enable-dtrace],
+ AC_HELP_STRING([--enable-dtrace],
[build with DTrace support (default: off)]),
[tcl_ok=$enableval], [tcl_ok=no])
if test $tcl_ok = yes; then
@@ -722,11 +696,37 @@ fi
AC_MSG_RESULT([$tcl_ok])
#--------------------------------------------------------------------
+# Does the C stack grow upwards or downwards? Or cross-compiling?
+#--------------------------------------------------------------------
+
+AC_CACHE_CHECK([if the C stack grows upwards in memory], tcl_cv_stack_grows_up, [
+ AC_TRY_RUN([
+ int StackGrowsUp(int *parent) {
+ int here;
+ volatile int result;
+ if (parent)
+ result = (&here < parent);
+ else
+ result = StackGrowsUp(&here);
+ return result;
+ }
+ int main (int argc, char *argv[]) {
+ return StackGrowsUp(0);
+ }
+ ], tcl_cv_stack_grows_up=yes, tcl_cv_stack_grows_up=no,
+ tcl_cv_stack_grows_up=unknown)])
+if test $tcl_cv_stack_grows_up = unknown; then
+ AC_DEFINE(TCL_CROSS_COMPILE, 1, [Are we cross-compiling?])
+elif test $tcl_cv_stack_grows_up = yes; then
+ AC_DEFINE(TCL_STACK_GROWS_UP, 1, [The C stack grows upwards in memory.])
+fi
+
+#--------------------------------------------------------------------
# The check below checks whether the cpuid instruction is usable.
#--------------------------------------------------------------------
AC_CACHE_CHECK([whether the cpuid instruction is usable], tcl_cv_cpuid, [
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
+ AC_TRY_LINK(, [
int index,regsPtr[4];
__asm__ __volatile__("mov %%ebx, %%edi \n\t"
"cpuid \n\t"
@@ -734,7 +734,7 @@ AC_CACHE_CHECK([whether the cpuid instruction is usable], tcl_cv_cpuid, [
"mov %%edi, %%ebx \n\t"
: "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3])
: "a"(index) : "edi");
- ]])],[tcl_cv_cpuid=yes],[tcl_cv_cpuid=no])])
+ ], tcl_cv_cpuid=yes, tcl_cv_cpuid=no)])
if test $tcl_cv_cpuid = yes; then
AC_DEFINE(HAVE_CPUID, 1, [Is the cpuid instruction usable?])
fi
@@ -754,7 +754,7 @@ eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}"
eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
-test -z "$TCL_LIBRARY" && TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)'
+TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)'
PRIVATE_INCLUDE_DIR='$(includedir)'
HTML_DIR='$(DISTDIR)/html'
@@ -767,9 +767,10 @@ if test "`uname -s`" = "Darwin" ; then
SC_ENABLE_FRAMEWORK
TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version ${TCL_VERSION}`echo ${TCL_PATCH_LEVEL} | awk ['{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}']`"
TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TCL_LIB_FILE}'
- echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xA000000'
+ echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xa000000'
TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tcl-Info.plist'
EXTRA_TCLSH_LIBS='-sectcreate __TEXT __info_plist Tclsh-Info.plist'
+ EXTRA_APP_CC_SWITCHES='-mdynamic-no-pic'
AC_CONFIG_FILES([Tcl-Info.plist:../macosx/Tcl-Info.plist.in Tclsh-Info.plist:../macosx/Tclsh-Info.plist.in])
TCL_YEAR="`date +%Y`"
fi
@@ -786,12 +787,6 @@ if test "$FRAMEWORK_BUILD" = "1" ; then
unset n f v
], VERSION=${TCL_VERSION})
LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH"
- # default install directory for bundled packages
- if test "${libdir}" = '${exec_prefix}/lib' -o "`basename ${libdir}`" = 'Frameworks'; then
- PACKAGE_DIR="/Library/Tcl"
- else
- PACKAGE_DIR="$libdir"
- fi
if test "${libdir}" = '${exec_prefix}/lib'; then
# override libdir default
libdir="/Library/Frameworks"
@@ -806,7 +801,7 @@ if test "$FRAMEWORK_BUILD" = "1" ; then
PRIVATE_INCLUDE_DIR="${libdir}/PrivateHeaders"
HTML_DIR="${libdir}/Resources/Documentation/Reference/Tcl"
EXTRA_INSTALL="install-private-headers html-tcl"
- EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)/TclTOC.html"'
+ EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)"/TclTOC.html'
EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tcl-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tcl.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tclConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."'
@@ -818,8 +813,6 @@ if test "$FRAMEWORK_BUILD" = "1" ; then
else
# libdir must be a fully qualified path and not ${exec_prefix}/lib
eval libdir="$libdir"
- # default install directory for bundled packages
- PACKAGE_DIR="$libdir"
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
TCL_LIB_FLAG="-ltcl${TCL_VERSION}"
else
@@ -834,55 +827,6 @@ eval "CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}"
VERSION=${TCL_VERSION}
#--------------------------------------------------------------------
-# Zipfs support - Tip 430
-#--------------------------------------------------------------------
-AC_ARG_ENABLE(zipfs,
- AS_HELP_STRING([--enable-zipfs],
- [build with Zipfs support (default: on)]),
- [tcl_ok=$enableval], [tcl_ok=yes])
-if test "$tcl_ok" = "yes" -a "x$enable_framework" != "xyes"; then
- #
- # Find a native compiler
- #
- AX_CC_FOR_BUILD
- #
- # Find a native zip implementation
- #
- SC_ZIPFS_SUPPORT
- ZIPFS_BUILD=1
- TCL_ZIP_FILE=libtcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}.zip
-else
- ZIPFS_BUILD=0
- TCL_ZIP_FILE=
-fi
-# Do checking message here to not mess up interleaved configure output
-AC_MSG_CHECKING([for building with zipfs])
-if test "${ZIPFS_BUILD}" = 1; then
- if test "${SHARED_BUILD}" = 0; then
- ZIPFS_BUILD=2;
- AC_DEFINE(ZIPFS_BUILD, 2, [Are we building with zipfs enabled?])
- else
- AC_DEFINE(ZIPFS_BUILD, 1, [Are we building with zipfs enabled?])\
- fi
- AC_MSG_RESULT([yes])
-else
-AC_MSG_RESULT([no])
-INSTALL_LIBRARIES=install-libraries
-INSTALL_MSGS=install-msgs
-fi
-
-# Point to tcl script library if we are not embedding it.
-if test "${ZIPFS_BUILD}" = 0; then
-TCL_BUILDTIME_LIBRARY=${TCL_SRC_DIR}/library
-fi
-
-AC_SUBST(ZIPFS_BUILD)
-AC_SUBST(TCL_ZIP_FILE)
-AC_SUBST(INSTALL_LIBRARIES)
-AC_SUBST(INSTALL_MSGS)
-AC_SUBST(TCL_BUILDTIME_LIBRARY)
-
-#--------------------------------------------------------------------
# The statements below define the symbol TCL_PACKAGE_PATH, which
# gives a list of directories that may contain packages. The list
# consists of one directory for machine-dependent binaries and
@@ -891,13 +835,13 @@ AC_SUBST(TCL_BUILDTIME_LIBRARY)
if test "$FRAMEWORK_BUILD" = "1" ; then
test -z "$TCL_PACKAGE_PATH" && \
- TCL_PACKAGE_PATH="~/Library/Tcl:/Library/Tcl:~/Library/Frameworks:/Library/Frameworks"
+ TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl /System/Library/Tcl ~/Library/Frameworks /Library/Frameworks /System/Library/Frameworks"
test -z "$TCL_MODULE_PATH" && \
- TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl"
+ TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl /System/Library/Tcl"
elif test "$prefix/lib" != "$libdir"; then
- test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="${libdir}:${prefix}/lib"
+ TCL_PACKAGE_PATH="${libdir} ${prefix}/lib ${TCL_PACKAGE_PATH}"
else
- test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="${prefix}/lib"
+ TCL_PACKAGE_PATH="${prefix}/lib ${TCL_PACKAGE_PATH}"
fi
#--------------------------------------------------------------------
@@ -910,7 +854,7 @@ fi
#
eval "TCL_STUB_LIB_FILE=libtclstub${TCL_UNSHARED_LIB_SUFFIX}"
eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
-eval "TCL_STUB_LIB_DIR=\"${libdir}\""
+eval "TCL_STUB_LIB_DIR=${libdir}"
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
TCL_STUB_LIB_FLAG="-ltclstub${TCL_VERSION}"
@@ -937,9 +881,7 @@ AC_SUBST(TCL_MAJOR_VERSION)
AC_SUBST(TCL_MINOR_VERSION)
AC_SUBST(TCL_PATCH_LEVEL)
AC_SUBST(TCL_YEAR)
-AC_SUBST(PKG_CFG_ARGS)
-AC_SUBST(TCL_ZIP_FILE)
AC_SUBST(TCL_LIB_FILE)
AC_SUBST(TCL_LIB_FLAG)
AC_SUBST(TCL_LIB_SPEC)
@@ -980,7 +922,6 @@ AC_SUBST(TCL_MODULE_PATH)
AC_SUBST(TCL_LIBRARY)
AC_SUBST(PRIVATE_INCLUDE_DIR)
AC_SUBST(HTML_DIR)
-AC_SUBST(PACKAGE_DIR)
AC_SUBST(EXTRA_CC_SWITCHES)
AC_SUBST(EXTRA_APP_CC_SWITCHES)
@@ -1002,7 +943,3 @@ AC_CONFIG_FILES([
tcl.pc:../unix/tcl.pc.in
])
AC_OUTPUT
-
-dnl Local Variables:
-dnl mode: autoconf
-dnl End:
diff --git a/unix/dltest/Makefile.in b/unix/dltest/Makefile.in
index 9a01875..01589d9 100644
--- a/unix/dltest/Makefile.in
+++ b/unix/dltest/Makefile.in
@@ -17,23 +17,19 @@ TCL_VERSION= @TCL_VERSION@
CFLAGS_DEBUG = @CFLAGS_DEBUG@
CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@
-CFLAGS = @CFLAGS_DEFAULT@ @CFLAGS@ -DTCL_NO_DEPRECATED=1 -Wall -Wextra -Wc++-compat -Wconversion -Werror
+CFLAGS = @CFLAGS_DEFAULT@ @CFLAGS@
LDFLAGS_DEBUG = @LDFLAGS_DEBUG@
LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@
LDFLAGS = @LDFLAGS_DEFAULT@ @LDFLAGS@
-CC_SWITCHES = $(CFLAGS) -I${SRC_DIR}/../../generic \
+CC_SWITCHES = $(CFLAGS) -I${SRC_DIR}/../../generic -I${BUILD_DIR}/.. -DTCL_MEM_DEBUG \
${SHLIB_CFLAGS} -DUSE_TCL_STUBS ${AC_FLAGS}
-all: pkga${SHLIB_SUFFIX} pkgb${SHLIB_SUFFIX} pkgc${SHLIB_SUFFIX} \
- pkgd${SHLIB_SUFFIX} pkge${SHLIB_SUFFIX} pkgt${SHLIB_SUFFIX} pkgua${SHLIB_SUFFIX} \
- pkgooa${SHLIB_SUFFIX}
+all: pkga${SHLIB_SUFFIX} pkgb${SHLIB_SUFFIX} pkgc${SHLIB_SUFFIX} pkgd${SHLIB_SUFFIX} pkge${SHLIB_SUFFIX} pkgua${SHLIB_SUFFIX}
@if test -n "$(DLTEST_SUFFIX)"; then $(MAKE) dltest_suffix; fi
@touch ../dltest.marker
-dltest_suffix: pkga${DLTEST_SUFFIX} pkgb${DLTEST_SUFFIX} pkgc${DLTEST_SUFFIX} \
- pkgd${DLTEST_SUFFIX} pkge${DLTEST_SUFFIX} pkgt${DLTEST_SUFFIX} pkgua${DLTEST_SUFFIX} \
- pkgooa${DLTEST_SUFFIX}
+dltest_suffix: pkga${DLTEST_SUFFIX} pkgb${DLTEST_SUFFIX} pkgc${DLTEST_SUFFIX} pkgd${DLTEST_SUFFIX} pkge${DLTEST_SUFFIX} pkgua${DLTEST_SUFFIX}
@touch ../dltest.marker
pkga.o: $(SRC_DIR)/pkga.c
@@ -51,65 +47,47 @@ pkgd.o: $(SRC_DIR)/pkgd.c
pkge.o: $(SRC_DIR)/pkge.c
$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkge.c
-pkgt.o: $(SRC_DIR)/pkgt.c
- $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgt.c
-
pkgua.o: $(SRC_DIR)/pkgua.c
$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgua.c
-pkgooa.o: $(SRC_DIR)/pkgooa.c
- $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgooa.c
-
pkga${SHLIB_SUFFIX}: pkga.o
- ${SHLIB_LD} -o $@ pkga.o ${SHLIB_LD_LIBS}
+ ${SHLIB_LD} -o pkga${SHLIB_SUFFIX} pkga.o ${SHLIB_LD_LIBS}
pkgb${SHLIB_SUFFIX}: pkgb.o
- ${SHLIB_LD} -o $@ pkgb.o ${SHLIB_LD_LIBS}
+ ${SHLIB_LD} -o pkgb${SHLIB_SUFFIX} pkgb.o ${SHLIB_LD_LIBS}
pkgc${SHLIB_SUFFIX}: pkgc.o
- ${SHLIB_LD} -o $@ pkgc.o ${SHLIB_LD_LIBS}
+ ${SHLIB_LD} -o pkgc${SHLIB_SUFFIX} pkgc.o ${SHLIB_LD_LIBS}
pkgd${SHLIB_SUFFIX}: pkgd.o
- ${SHLIB_LD} -o $@ pkgd.o ${SHLIB_LD_LIBS}
+ ${SHLIB_LD} -o pkgd${SHLIB_SUFFIX} pkgd.o ${SHLIB_LD_LIBS}
pkge${SHLIB_SUFFIX}: pkge.o
- ${SHLIB_LD} -o $@ pkge.o ${SHLIB_LD_LIBS}
-
-pkgt${SHLIB_SUFFIX}: pkgt.o
- ${SHLIB_LD} -o $@ pkgt.o ${SHLIB_LD_LIBS}
+ ${SHLIB_LD} -o pkge${SHLIB_SUFFIX} pkge.o ${SHLIB_LD_LIBS}
pkgua${SHLIB_SUFFIX}: pkgua.o
- ${SHLIB_LD} -o $@ pkgua.o ${SHLIB_LD_LIBS}
-
-pkgooa${SHLIB_SUFFIX}: pkgooa.o
- ${SHLIB_LD} -o $@ pkgooa.o ${SHLIB_LD_LIBS}
+ ${SHLIB_LD} -o pkgua${SHLIB_SUFFIX} pkgua.o ${SHLIB_LD_LIBS}
pkga${DLTEST_SUFFIX}: pkga.o
- ${DLTEST_LD} -o $@ pkga.o ${SHLIB_LD_LIBS}
+ ${DLTEST_LD} -o pkga${DLTEST_SUFFIX} pkga.o ${SHLIB_LD_LIBS}
pkgb${DLTEST_SUFFIX}: pkgb.o
- ${DLTEST_LD} -o $@ pkgb.o ${SHLIB_LD_LIBS}
+ ${DLTEST_LD} -o pkgb${DLTEST_SUFFIX} pkgb.o ${SHLIB_LD_LIBS}
pkgc${DLTEST_SUFFIX}: pkgc.o
- ${DLTEST_LD} -o $@ pkgc.o ${SHLIB_LD_LIBS}
+ ${DLTEST_LD} -o pkgc${DLTEST_SUFFIX} pkgc.o ${SHLIB_LD_LIBS}
pkgd${DLTEST_SUFFIX}: pkgd.o
- ${DLTEST_LD} -o $@ pkgd.o ${SHLIB_LD_LIBS}
+ ${DLTEST_LD} -o pkgd${DLTEST_SUFFIX} pkgd.o ${SHLIB_LD_LIBS}
pkge${DLTEST_SUFFIX}: pkge.o
- ${DLTEST_LD} -o $@ pkge.o ${SHLIB_LD_LIBS}
-
-pkgt${DLTEST_SUFFIX}: pkgt.o
- ${DLTEST_LD} -o $@ pkgt.o ${SHLIB_LD_LIBS}
+ ${DLTEST_LD} -o pkge${DLTEST_SUFFIX} pkge.o ${SHLIB_LD_LIBS}
pkgua${DLTEST_SUFFIX}: pkgua.o
- ${DLTEST_LD} -o $@ pkgua.o ${SHLIB_LD_LIBS}
-
-pkgooa${DLTEST_SUFFIX}: pkgooa.o
- ${DLTEST_LD} -o $@ pkgooa.o ${SHLIB_LD_LIBS}
+ ${DLTEST_LD} -o pkgua${DLTEST_SUFFIX} pkgua.o ${SHLIB_LD_LIBS}
clean:
- rm -f embtest *.o lib.exp ../dltest.marker
+ rm -f *.o lib.exp ../dltest.marker
@if test "$(SHLIB_SUFFIX)" != ""; then \
echo "rm -f *${SHLIB_SUFFIX}" ; \
rm -f *${SHLIB_SUFFIX} ; \
diff --git a/unix/dltest/pkga.c b/unix/dltest/pkga.c
index f249b1d..f001cdf 100644
--- a/unix/dltest/pkga.c
+++ b/unix/dltest/pkga.c
@@ -4,16 +4,24 @@
* This file contains a simple Tcl package "pkga" that is intended for
* testing the Tcl dynamic loading facilities.
*
- * Copyright © 1995 Sun Microsystems, Inc.
+ * Copyright (c) 1995 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
/*
+ * Prototypes for procedures defined later in this file:
+ */
+
+static int Pkga_EqObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+static int Pkga_QuoteObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+
+/*
*----------------------------------------------------------------------
*
* Pkga_EqObjCmd --
@@ -33,15 +41,14 @@
static int
Pkga_EqObjCmd(
- void *dummy, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
int result;
- const char *str1, *str2;
+ CONST char *str1, *str2;
int len1, len2;
- (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string1 string2");
@@ -50,10 +57,8 @@ Pkga_EqObjCmd(
str1 = Tcl_GetStringFromObj(objv[1], &len1);
str2 = Tcl_GetStringFromObj(objv[2], &len2);
- len1 = Tcl_NumUtfChars(str1, len1);
- len2 = Tcl_NumUtfChars(str2, len2);
if (len1 == len2) {
- result = (Tcl_UtfNcmp(str1, str2, (size_t)len1) == 0);
+ result = (Tcl_UtfNcmp(str1, str2, len1) == 0);
} else {
result = 0;
}
@@ -80,13 +85,11 @@ Pkga_EqObjCmd(
static int
Pkga_QuoteObjCmd(
- void *dummy, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument strings. */
+ Tcl_Obj *CONST objv[]) /* Argument strings. */
{
- (void)dummy;
-
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "value");
return TCL_ERROR;
@@ -112,22 +115,23 @@ Pkga_QuoteObjCmd(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkga_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
int code;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "pkga", "1.0");
+ code = Tcl_PkgProvide(interp, "Pkga", "1.0");
if (code != TCL_OK) {
return code;
}
- Tcl_CreateObjCommand(interp, "pkga_eq", Pkga_EqObjCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "pkga_quote", Pkga_QuoteObjCmd, NULL,
- NULL);
+ Tcl_CreateObjCommand(interp, "pkga_eq", Pkga_EqObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+ Tcl_CreateObjCommand(interp, "pkga_quote", Pkga_QuoteObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
diff --git a/unix/dltest/pkgb.c b/unix/dltest/pkgb.c
index 165c5e3..4d8cdab 100644
--- a/unix/dltest/pkgb.c
+++ b/unix/dltest/pkgb.c
@@ -5,19 +5,24 @@
* testing the Tcl dynamic loading facilities. It can be used in both
* safe and unsafe interpreters.
*
- * Copyright © 1995 Sun Microsystems, Inc.
+ * Copyright (c) 1995 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
-#if defined(_WIN32) && defined(_MSC_VER)
-# define snprintf _snprintf
-#endif
/*
+ * Prototypes for procedures defined later in this file:
+ */
+
+static int Pkgb_SubObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+static int Pkgb_UnsafeObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+
+/*
*----------------------------------------------------------------------
*
* Pkgb_SubObjCmd --
@@ -40,13 +45,12 @@
static int
Pkgb_SubObjCmd(
- void *dummy, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
int first, second;
- (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "num num");
@@ -55,8 +59,8 @@ Pkgb_SubObjCmd(
if ((Tcl_GetIntFromObj(interp, objv[1], &first) != TCL_OK)
|| (Tcl_GetIntFromObj(interp, objv[2], &second) != TCL_OK)) {
char buf[TCL_INTEGER_SPACE];
- snprintf(buf, sizeof(buf), "%d", Tcl_GetErrorLine(interp));
- Tcl_AppendResult(interp, " in line: ", buf, (void *)NULL);
+ sprintf(buf, "%d", Tcl_GetErrorLine(interp));
+ Tcl_AppendResult(interp, " in line: ", buf, NULL);
return TCL_ERROR;
}
Tcl_SetObjResult(interp, Tcl_NewIntObj(first - second));
@@ -82,40 +86,13 @@ Pkgb_SubObjCmd(
static int
Pkgb_UnsafeObjCmd(
- void *dummy, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
- (void)dummy;
- (void)objc;
- (void)objv;
-
return Tcl_EvalEx(interp, "list unsafe command invoked", -1, TCL_EVAL_GLOBAL);
}
-
-static int
-Pkgb_DemoObjCmd(
- void *dummy, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
-{
- Tcl_WideInt numChars;
- int result;
- (void)dummy;
-
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 1, objv, "arg1 arg2 num");
- return TCL_ERROR;
- }
- if (Tcl_GetWideIntFromObj(interp, objv[3], &numChars) != TCL_OK) {
- return TCL_ERROR;
- }
- result = Tcl_UtfNcmp(Tcl_GetString(objv[1]), Tcl_GetString(objv[2]), (size_t)numChars);
- Tcl_SetObjResult(interp, Tcl_NewIntObj(result));
- return TCL_OK;
-}
/*
*----------------------------------------------------------------------
@@ -141,16 +118,20 @@ Pkgb_Init(
{
int code;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
- return TCL_ERROR;
+ if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.4-", 0) == NULL) {
+ return TCL_ERROR;
+ }
+ Tcl_ResetResult(interp);
}
- code = Tcl_PkgProvide(interp, "pkgb", "2.3");
+ code = Tcl_PkgProvide(interp, "Pkgb", "2.3");
if (code != TCL_OK) {
return code;
}
- Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "pkgb_unsafe", Pkgb_UnsafeObjCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "pkgb_demo", Pkgb_DemoObjCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+ Tcl_CreateObjCommand(interp, "pkgb_unsafe", Pkgb_UnsafeObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
@@ -178,13 +159,17 @@ Pkgb_SafeInit(
{
int code;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
- return TCL_ERROR;
+ if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.4-", 0) == NULL) {
+ return TCL_ERROR;
+ }
+ Tcl_ResetResult(interp);
}
- code = Tcl_PkgProvide(interp, "pkgb", "2.3");
+ code = Tcl_PkgProvide(interp, "Pkgb", "2.3");
if (code != TCL_OK) {
return code;
}
- Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, (ClientData) 0,
+ (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
diff --git a/unix/dltest/pkgc.c b/unix/dltest/pkgc.c
index 8e9c829..6ad5ab4 100644
--- a/unix/dltest/pkgc.c
+++ b/unix/dltest/pkgc.c
@@ -5,16 +5,24 @@
* testing the Tcl dynamic loading facilities. It can be used in both
* safe and unsafe interpreters.
*
- * Copyright © 1995 Sun Microsystems, Inc.
+ * Copyright (c) 1995 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
/*
+ * Prototypes for procedures defined later in this file:
+ */
+
+static int Pkgc_SubObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+static int Pkgc_UnsafeObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+
+/*
*----------------------------------------------------------------------
*
* Pkgc_SubObjCmd --
@@ -33,13 +41,12 @@
static int
Pkgc_SubObjCmd(
- void *dummy, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
int first, second;
- (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "num num");
@@ -72,15 +79,11 @@ Pkgc_SubObjCmd(
static int
Pkgc_UnsafeObjCmd(
- void *dummy, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
- (void)dummy;
- (void)objc;
- (void)objv;
-
Tcl_SetObjResult(interp, Tcl_NewStringObj("unsafe command invoked", -1));
return TCL_OK;
}
@@ -102,23 +105,24 @@ Pkgc_UnsafeObjCmd(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgc_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
int code;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "pkgc", "1.7.2");
+ code = Tcl_PkgProvide(interp, "Pkgc", "1.7.2");
if (code != TCL_OK) {
return code;
}
- Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "pkgc_unsafe", Pkgc_UnsafeObjCmd, NULL,
- NULL);
+ Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+ Tcl_CreateObjCommand(interp, "pkgc_unsafe", Pkgc_UnsafeObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
@@ -139,20 +143,21 @@ Pkgc_Init(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgc_SafeInit(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
int code;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "pkgc", "1.7.2");
+ code = Tcl_PkgProvide(interp, "Pkgc", "1.7.2");
if (code != TCL_OK) {
return code;
}
- Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, (ClientData) 0,
+ (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
diff --git a/unix/dltest/pkgd.c b/unix/dltest/pkgd.c
index 172d579..7fe7c49 100644
--- a/unix/dltest/pkgd.c
+++ b/unix/dltest/pkgd.c
@@ -5,16 +5,24 @@
* testing the Tcl dynamic loading facilities. It can be used in both
* safe and unsafe interpreters.
*
- * Copyright © 1995 Sun Microsystems, Inc.
+ * Copyright (c) 1995 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
/*
+ * Prototypes for procedures defined later in this file:
+ */
+
+static int Pkgd_SubObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+static int Pkgd_UnsafeObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+
+/*
*----------------------------------------------------------------------
*
* Pkgd_SubObjCmd --
@@ -33,13 +41,12 @@
static int
Pkgd_SubObjCmd(
- void *dummy, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
int first, second;
- (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "num num");
@@ -72,15 +79,11 @@ Pkgd_SubObjCmd(
static int
Pkgd_UnsafeObjCmd(
- void *dummy, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
- (void)dummy;
- (void)objc;
- (void)objv;
-
Tcl_SetObjResult(interp, Tcl_NewStringObj("unsafe command invoked", -1));
return TCL_OK;
}
@@ -102,23 +105,24 @@ Pkgd_UnsafeObjCmd(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgd_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
int code;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "pkgd", "7.3");
+ code = Tcl_PkgProvide(interp, "Pkgd", "7.3");
if (code != TCL_OK) {
return code;
}
- Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "pkgd_unsafe", Pkgd_UnsafeObjCmd, NULL,
- NULL);
+ Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+ Tcl_CreateObjCommand(interp, "pkgd_unsafe", Pkgd_UnsafeObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
@@ -139,20 +143,21 @@ Pkgd_Init(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgd_SafeInit(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
int code;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "pkgd", "7.3");
+ code = Tcl_PkgProvide(interp, "Pkgd", "7.3");
if (code != TCL_OK) {
return code;
}
- Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, (ClientData) 0,
+ (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
diff --git a/unix/dltest/pkge.c b/unix/dltest/pkge.c
index 26a4b79..abd2359 100644
--- a/unix/dltest/pkge.c
+++ b/unix/dltest/pkge.c
@@ -5,14 +5,14 @@
* testing the Tcl dynamic loading facilities. Its Init procedure returns
* an error in order to test how this is handled.
*
- * Copyright © 1995 Sun Microsystems, Inc.
+ * Copyright (c) 1995 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
+
/*
*----------------------------------------------------------------------
@@ -31,15 +31,15 @@
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkge_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
- static const char script[] = "if 44 {open non_existent}";
+ static char script[] = "if 44 {open non_existent}";
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
- return Tcl_EvalEx(interp, script, -1, 0);
+ return Tcl_Eval(interp, script);
}
diff --git a/unix/dltest/pkgooa.c b/unix/dltest/pkgooa.c
deleted file mode 100644
index 60e3864..0000000
--- a/unix/dltest/pkgooa.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * pkgooa.c --
- *
- * This file contains a simple Tcl package "pkgooa" that is intended for
- * testing the Tcl dynamic loading facilities.
- *
- * Copyright © 1995 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
- */
-
-#undef STATIC_BUILD
-#include "tclOO.h"
-#include <string.h>
-
-/*
- *----------------------------------------------------------------------
- *
- * Pkgooa_StubsOKObjCmd --
- *
- * This procedure is invoked to process the "pkgooa_stubsok" Tcl command.
- * It gives 1 if stubs are used correctly, 0 if stubs are not OK.
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * See the user documentation.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-Pkgooa_StubsOKObjCmd(
- void *dummy, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
-{
- (void)dummy;
-
- if (objc != 1) {
- Tcl_WrongNumArgs(interp, 1, objv, "");
- return TCL_ERROR;
- }
- Tcl_SetObjResult(interp, Tcl_NewIntObj(
- Tcl_CopyObjectInstance == tclOOStubsPtr->tcl_CopyObjectInstance));
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * Pkgooa_Init --
- *
- * This is a package initialization procedure, which is called by Tcl
- * when this package is to be added to an interpreter.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-extern void *tclOOIntStubsPtr;
-
-static TclOOStubs stubsCopy = {
- TCL_STUB_MAGIC,
- NULL,
- /* It doesn't really matter what implementation of
- * Tcl_CopyObjectInstance is put in the "pseudo"
- * stub table, since the test-case never actually
- * calls this function. All that matters is that it's
- * a function with a different memory address than
- * the real Tcl_CopyObjectInstance function in Tcl. */
- (Tcl_Object (*) (Tcl_Interp *, Tcl_Object, const char *,
- const char *t))(void *)Pkgooa_StubsOKObjCmd,
- /* More entries could be here, but those are not used
- * for this test-case. So, being NULL is OK. */
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL
-};
-
-DLLEXPORT int
-Pkgooa_Init(
- Tcl_Interp *interp) /* Interpreter in which the package is to be
- * made available. */
-{
- int code;
-
- /* Any TclOO extension which uses stubs, calls
- * both Tcl_InitStubs and Tcl_OOInitStubs() and
- * does not use any Tcl 8.6 features should be
- * loadable in Tcl 8.5 as well, provided the
- * TclOO extension (for Tcl 8.5) is installed.
- * This worked in Tcl 8.6.0, and is expected
- * to keep working in all future Tcl 8.x releases.
- */
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
- return TCL_ERROR;
- }
- if (tclStubsPtr == NULL) {
- Tcl_AppendResult(interp, "Tcl stubs are not initialized, "
- "did you compile using -DUSE_TCL_STUBS? ", (void *)NULL);
- return TCL_ERROR;
- }
- if (Tcl_OOInitStubs(interp) == NULL) {
- return TCL_ERROR;
- }
- if (tclOOStubsPtr == NULL) {
- Tcl_AppendResult(interp, "TclOO stubs are not initialized", (void *)NULL);
- return TCL_ERROR;
- }
- if (tclOOIntStubsPtr == NULL) {
- Tcl_AppendResult(interp, "TclOO internal stubs are not initialized", (void *)NULL);
- return TCL_ERROR;
- }
-
- /* Test case for Bug [f51efe99a7].
- *
- * Let tclOOStubsPtr point to an alternate stub table
- * (with only a single function, that's enough for
- * this test). This way, the function "pkgooa_stubsok"
- * can check whether the TclOO function calls really
- * use the stub table, or only pretend to.
- *
- * On platforms without backlinking (Windows, Cygwin,
- * AIX), this code doesn't even compile without using
- * stubs, but on UNIX ELF systems, the problem is
- * less visible.
- */
-
- tclOOStubsPtr = &stubsCopy;
-
- code = Tcl_PkgProvide(interp, "pkgooa", "1.0");
- if (code != TCL_OK) {
- return code;
- }
- Tcl_CreateObjCommand(interp, "pkgooa_stubsok", Pkgooa_StubsOKObjCmd, NULL, NULL);
- return TCL_OK;
-}
diff --git a/unix/dltest/pkgt.c b/unix/dltest/pkgt.c
deleted file mode 100644
index 158bd9e..0000000
--- a/unix/dltest/pkgt.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * pkgt.c --
- *
- * This file contains a simple Tcl package "pkgt" that is intended for
- * testing the Tcl dynamic loading facilities.
- *
- * Copyright © 1995 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
- */
-
-#undef STATIC_BUILD
-#include "tcl.h"
-
-static int TraceProc2 (
- void *clientData,
- Tcl_Interp *interp,
- Tcl_Size level,
- const char *command,
- Tcl_Command commandInfo,
- Tcl_Size objc,
- struct Tcl_Obj *const *objv)
-{
- (void)clientData;
- (void)interp;
- (void)level;
- (void)command;
- (void)commandInfo;
- (void)objc;
- (void)objv;
-
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * Pkgt_EqObjCmd2 --
- *
- * This procedure is invoked to process the "pkgt_eq" Tcl command. It
- * expects two arguments and returns 1 if they are the same, 0 if they
- * are different.
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * See the user documentation.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-Pkgt_EqObjCmd2(
- void *dummy, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter. */
- Tcl_Size objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
-{
- Tcl_WideInt result;
- const char *str1, *str2;
- Tcl_Size len1, len2;
- (void)dummy;
-
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "string1 string2");
- return TCL_ERROR;
- }
-
- str1 = Tcl_GetStringFromObj(objv[1], &len1);
- str2 = Tcl_GetStringFromObj(objv[2], &len2);
- len1 = Tcl_NumUtfChars(str1, len1);
- len2 = Tcl_NumUtfChars(str2, len2);
- if (len1 == len2) {
- result = (Tcl_UtfNcmp(str1, str2, (size_t)len1) == 0);
- } else {
- result = 0;
- }
- Tcl_SetObjResult(interp, Tcl_NewWideIntObj(result));
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * Pkgt_Init --
- *
- * This is a package initialization procedure, which is called by Tcl
- * when this package is to be added to an interpreter.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-DLLEXPORT int
-Pkgt_Init(
- Tcl_Interp *interp) /* Interpreter in which the package is to be
- * made available. */
-{
- int code;
-
- if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) {
- return TCL_ERROR;
- }
- code = Tcl_PkgProvide(interp, "pkgt", "1.0");
- if (code != TCL_OK) {
- return code;
- }
- Tcl_CreateObjCommand2(interp, "pkgt_eq", Pkgt_EqObjCmd2, NULL, NULL);
- Tcl_CreateObjTrace2(interp, 0, 0, TraceProc2, NULL, NULL);
- return TCL_OK;
-}
diff --git a/unix/dltest/pkgua.c b/unix/dltest/pkgua.c
index 6d56ec1..9c36e88 100644
--- a/unix/dltest/pkgua.c
+++ b/unix/dltest/pkgua.c
@@ -4,8 +4,8 @@
* This file contains a simple Tcl package "pkgua" that is intended for
* testing the Tcl dynamic unloading facilities.
*
- * Copyright © 1995 Sun Microsystems, Inc.
- * Copyright © 2004 Georgios Petasis
+ * Copyright (c) 1995 Sun Microsystems, Inc.
+ * Copyright (c) 2004 Georgios Petasis
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -14,6 +14,15 @@
#include "tcl.h"
/*
+ * Prototypes for procedures defined later in this file:
+ */
+
+static int PkguaEqObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+static int PkguaQuoteObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+
+/*
* In the following hash table we are going to store a struct that holds all
* the command tokens created by Tcl_CreateObjCommand in an interpreter,
* indexed by the interpreter. In this way, we can find which command tokens
@@ -21,46 +30,36 @@
* need to keep the various command tokens we have registered, as they are the
* only safe way to unregister our registered commands, even if they have been
* renamed.
+ *
+ * Note that this code is utterly single-threaded.
*/
-typedef struct ThreadSpecificData {
- int interpTokenMapInitialised;
- Tcl_HashTable interpTokenMap;
-} ThreadSpecificData;
-static Tcl_ThreadDataKey dataKey;
+static Tcl_HashTable interpTokenMap;
+static int interpTokenMapInitialised = 0;
#define MAX_REGISTERED_COMMANDS 2
-static void
-CommandDeleted(void *clientData)
-{
- Tcl_Command *cmdToken = (Tcl_Command *)clientData;
- *cmdToken = NULL;
-}
static void
PkguaInitTokensHashTable(void)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)Tcl_GetThreadData((&dataKey), sizeof(ThreadSpecificData));
-
- if (tsdPtr->interpTokenMapInitialised) {
+ if (interpTokenMapInitialised) {
return;
}
- Tcl_InitHashTable(&tsdPtr->interpTokenMap, TCL_ONE_WORD_KEYS);
- tsdPtr->interpTokenMapInitialised = 1;
+ Tcl_InitHashTable(&interpTokenMap, TCL_ONE_WORD_KEYS);
+ interpTokenMapInitialised = 1;
}
-static void
+void
PkguaFreeTokensHashTable(void)
{
Tcl_HashSearch search;
Tcl_HashEntry *entryPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)Tcl_GetThreadData((&dataKey), sizeof(ThreadSpecificData));
- for (entryPtr = Tcl_FirstHashEntry(&tsdPtr->interpTokenMap, &search);
+ for (entryPtr = Tcl_FirstHashEntry(&interpTokenMap, &search);
entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&search)) {
Tcl_Free((char *) Tcl_GetHashValue(entryPtr));
}
- tsdPtr->interpTokenMapInitialised = 0;
+ interpTokenMapInitialised = 0;
}
static Tcl_Command *
@@ -69,17 +68,16 @@ PkguaInterpToTokens(
{
int newEntry;
Tcl_Command *cmdTokens;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)Tcl_GetThreadData((&dataKey), sizeof(ThreadSpecificData));
Tcl_HashEntry *entryPtr =
- Tcl_CreateHashEntry(&tsdPtr->interpTokenMap, (char *) interp, &newEntry);
+ Tcl_CreateHashEntry(&interpTokenMap, (char *) interp, &newEntry);
if (newEntry) {
cmdTokens = (Tcl_Command *)
- Tcl_Alloc(sizeof(Tcl_Command) * (MAX_REGISTERED_COMMANDS));
- for (newEntry=0 ; newEntry<MAX_REGISTERED_COMMANDS ; ++newEntry) {
+ Tcl_Alloc(sizeof(Tcl_Command) * (MAX_REGISTERED_COMMANDS+1));
+ for (newEntry=0 ; newEntry<MAX_REGISTERED_COMMANDS+1 ; ++newEntry) {
cmdTokens[newEntry] = NULL;
}
- Tcl_SetHashValue(entryPtr, cmdTokens);
+ Tcl_SetHashValue(entryPtr, (ClientData) cmdTokens);
} else {
cmdTokens = (Tcl_Command *) Tcl_GetHashValue(entryPtr);
}
@@ -90,9 +88,8 @@ static void
PkguaDeleteTokens(
Tcl_Interp *interp)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)Tcl_GetThreadData((&dataKey), sizeof(ThreadSpecificData));
Tcl_HashEntry *entryPtr =
- Tcl_FindHashEntry(&tsdPtr->interpTokenMap, (char *) interp);
+ Tcl_FindHashEntry(&interpTokenMap, (char *) interp);
if (entryPtr) {
Tcl_Free((char *) Tcl_GetHashValue(entryPtr));
@@ -120,15 +117,14 @@ PkguaDeleteTokens(
static int
PkguaEqObjCmd(
- void *dummy, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
int result;
- const char *str1, *str2;
+ CONST char *str1, *str2;
int len1, len2;
- (void)dummy;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string1 string2");
@@ -137,10 +133,8 @@ PkguaEqObjCmd(
str1 = Tcl_GetStringFromObj(objv[1], &len1);
str2 = Tcl_GetStringFromObj(objv[2], &len2);
- len1 = Tcl_NumUtfChars(str1, len1);
- len2 = Tcl_NumUtfChars(str2, len2);
if (len1 == len2) {
- result = (Tcl_UtfNcmp(str1, str2, (size_t)len1) == 0);
+ result = (Tcl_UtfNcmp(str1, str2, len1) == 0);
} else {
result = 0;
}
@@ -167,13 +161,11 @@ PkguaEqObjCmd(
static int
PkguaQuoteObjCmd(
- void *dummy, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument strings. */
+ Tcl_Obj *CONST objv[]) /* Argument strings. */
{
- (void)dummy;
-
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "value");
return TCL_ERROR;
@@ -199,39 +191,39 @@ PkguaQuoteObjCmd(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgua_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
- int code;
+ int code, cmdIndex = 0;
Tcl_Command *cmdTokens;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
/*
- * Initialize our Hash table, where we store the registered command tokens
+ * Initialise our Hash table, where we store the registered command tokens
* for each interpreter.
*/
PkguaInitTokensHashTable();
- code = Tcl_PkgProvide(interp, "pkgua", "1.0");
+ code = Tcl_PkgProvide(interp, "Pkgua", "1.0");
if (code != TCL_OK) {
return code;
}
- Tcl_SetVar2(interp, "::pkgua_loaded", NULL, ".", TCL_APPEND_VALUE);
+ Tcl_SetVar(interp, "::pkgua_loaded", ".", TCL_APPEND_VALUE);
cmdTokens = PkguaInterpToTokens(interp);
- cmdTokens[0] =
- Tcl_CreateObjCommand(interp, "pkgua_eq", PkguaEqObjCmd, &cmdTokens[0],
- CommandDeleted);
- cmdTokens[1] =
+ cmdTokens[cmdIndex++] =
+ Tcl_CreateObjCommand(interp, "pkgua_eq", PkguaEqObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+ cmdTokens[cmdIndex++] =
Tcl_CreateObjCommand(interp, "pkgua_quote", PkguaQuoteObjCmd,
- &cmdTokens[1], CommandDeleted);
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
@@ -252,7 +244,7 @@ Pkgua_Init(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgua_SafeInit(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
@@ -277,7 +269,7 @@ Pkgua_SafeInit(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgua_Unload(
Tcl_Interp *interp, /* Interpreter from which the package is to be
* unloaded. */
@@ -298,7 +290,7 @@ Pkgua_Unload(
PkguaDeleteTokens(interp);
- Tcl_SetVar2(interp, "::pkgua_detached", NULL, ".", TCL_APPEND_VALUE);
+ Tcl_SetVar(interp, "::pkgua_detached", ".", TCL_APPEND_VALUE);
if (flags == TCL_UNLOAD_DETACH_FROM_PROCESS) {
/*
@@ -308,7 +300,7 @@ Pkgua_Unload(
*/
PkguaFreeTokensHashTable();
- Tcl_SetVar2(interp, "::pkgua_unloaded", NULL, ".", TCL_APPEND_VALUE);
+ Tcl_SetVar(interp, "::pkgua_unloaded", ".", TCL_APPEND_VALUE);
}
return TCL_OK;
}
@@ -330,7 +322,7 @@ Pkgua_Unload(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgua_SafeUnload(
Tcl_Interp *interp, /* Interpreter from which the package is to be
* unloaded. */
diff --git a/unix/install-sh b/unix/install-sh
index ec298b5..7c34c3f 100755
--- a/unix/install-sh
+++ b/unix/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2020-11-14.01; # UTC
+scriptversion=2011-04-20.01; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,21 +35,25 @@ scriptversion=2020-11-14.01; # UTC
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
-# 'make' implicit rules from creating a file called install from it
+# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
-tab=' '
nl='
'
-IFS=" $tab$nl"
+IFS=" "" $nl"
-# Set DOITPROG to "echo" to test this script.
+# set DOITPROG to echo to test this script
+# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
-doit_exec=${doit:-exec}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
@@ -64,16 +68,22 @@ mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
posix_mkdir=
# Desired mode of installed file.
mode=0755
-# Create dirs (including intermediate dirs) using mode 755.
-# This is like GNU 'install' as of coreutils 8.32 (2020).
-mkdir_umask=22
-
-backupsuffix=
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
@@ -87,7 +97,7 @@ dir_arg=
dst_arg=
copy_on_change=false
-is_target_a_directory=possibly
+no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -104,28 +114,19 @@ Options:
--version display version info and exit.
-c (ignored)
- -C install only if different (preserve data modification time)
+ -C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
- -p pass -p to $cpprog.
-s $stripprog installed files.
- -S SUFFIX attempt to back up existing files, with suffix SUFFIX.
+ -S $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
-
-By default, rm is invoked with -f; when overridden with RMPROG,
-it's up to you to specify -f if you want it.
-
-If -S is not specified, no backups are attempted.
-
-Email bug reports to bug-automake@gnu.org.
-Automake home page: https://www.gnu.org/software/automake/
"
while test $# -ne 0; do
@@ -137,62 +138,45 @@ while test $# -ne 0; do
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
- shift;;
+ shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
- case $mode in
- *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- shift;;
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
-o) chowncmd="$chownprog $2"
- shift;;
-
- -p) cpprog="$cpprog -p";;
+ shift;;
-s) stripcmd=$stripprog;;
- -S) backupsuffix="$2"
- shift;;
+ -S) stripcmd="$stripprog $2"
+ shift;;
- -t)
- is_target_a_directory=always
- dst_arg=$2
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- shift;;
+ -t) dst_arg=$2
+ shift;;
- -T) is_target_a_directory=never;;
+ -T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
- --) shift
- break;;
+ --) shift
+ break;;
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
*) break;;
esac
shift
done
-# We allow the use of options -d and -T together, by making -d
-# take the precedence; this is for compatibility with GNU install.
-
-if test -n "$dir_arg"; then
- if test -n "$dst_arg"; then
- echo "$0: target directory not allowed when installing a directory." >&2
- exit 1
- fi
-fi
-
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
@@ -206,10 +190,6 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
fi
shift # arg
dst_arg=$arg
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
done
fi
@@ -218,21 +198,12 @@ if test $# -eq 0; then
echo "$0: no input file specified." >&2
exit 1
fi
- # It's OK to call 'install-sh -d' without argument.
+ # It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
- if test $# -gt 1 || test "$is_target_a_directory" = always; then
- if test ! -d "$dst_arg"; then
- echo "$0: $dst_arg: Is not a directory." >&2
- exit 1
- fi
- fi
-fi
-
-if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
@@ -248,16 +219,16 @@ if test -z "$dir_arg"; then
*[0-7])
if test -z "$stripcmd"; then
- u_plus_rw=
+ u_plus_rw=
else
- u_plus_rw='% 200'
+ u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
- u_plus_rw=
+ u_plus_rw=
else
- u_plus_rw=,u+rw
+ u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
@@ -265,9 +236,9 @@ fi
for src
do
- # Protect names problematic for 'test' and other utilities.
+ # Protect names starting with `-'.
case $src in
- -* | [=\(\)!]) src=./$src;;
+ -*) src=./$src;;
esac
if test -n "$dir_arg"; then
@@ -275,10 +246,6 @@ do
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
- # Don't chown directories that already exist.
- if test $dstdir_status = 0; then
- chowncmd=""
- fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@@ -293,150 +260,185 @@ do
echo "$0: no destination specified." >&2
exit 1
fi
+
dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
- # If destination is a directory, append the input filename.
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
if test -d "$dst"; then
- if test "$is_target_a_directory" = never; then
- echo "$0: $dst_arg: Is a directory" >&2
- exit 1
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
fi
dstdir=$dst
- dstbase=`basename "$src"`
- case $dst in
- */) dst=$dst$dstbase;;
- *) dst=$dst/$dstbase;;
- esac
+ dst=$dstdir/`basename "$src"`
dstdir_status=0
else
- dstdir=`dirname "$dst"`
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
test -d "$dstdir"
dstdir_status=$?
fi
fi
- case $dstdir in
- */) dstdirslash=$dstdir;;
- *) dstdirslash=$dstdir/;;
- esac
-
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
- else
- mkdir_mode=
- fi
-
- posix_mkdir=false
- # The $RANDOM variable is not portable (e.g., dash). Use it
- # here however when possible just to lower collision chance.
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-
- trap '
- ret=$?
- rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
- exit $ret
- ' 0
-
- # Because "mkdir -p" follows existing symlinks and we likely work
- # directly in world-writeable /tmp, make sure that the '$tmpdir'
- # directory is successfully created first before we actually test
- # 'mkdir -p'.
- if (umask $mkdir_umask &&
- $mkdirprog $mkdir_mode "$tmpdir" &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- test_tmpdir="$tmpdir/a"
- ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
+ mkdir_mode=
fi
- trap '' 0;;
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
esac
if
$posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
- # mkdir does not conform to POSIX,
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
- /*) prefix='/';;
- [-=\(\)!]*) prefix='./';;
- *) prefix='';;
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
esac
+ eval "$initialize_posix_glob"
+
oIFS=$IFS
IFS=/
- set -f
+ $posix_glob set -f
set fnord $dstdir
shift
- set +f
+ $posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
- test X"$d" = X && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
done
if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
fi
fi
fi
@@ -449,25 +451,14 @@ do
else
# Make a couple of temp file names in the proper directory.
- dsttmp=${dstdirslash}_inst.$$_
- rmtmp=${dstdirslash}_rm.$$_
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
- (umask $cp_umask &&
- { test -z "$stripcmd" || {
- # Create $dsttmp read-write so that cp doesn't create it read-only,
- # which would cause strip to fail.
- if test -z "$doit"; then
- : >"$dsttmp" # No need to fork-exec 'touch'.
- else
- $doit touch "$dsttmp"
- fi
- }
- } &&
- $doit_exec $cpprog "$src" "$dsttmp") &&
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
@@ -482,24 +473,20 @@ do
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
- old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
- set -f &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
- set +f &&
+ $posix_glob set +f &&
+
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
- # If $backupsuffix is set, and the file being installed
- # already exists, attempt a backup. Don't worry if it fails,
- # e.g., if mv doesn't support -f.
- if test -n "$backupsuffix" && test -f "$dst"; then
- $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
- fi
-
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
@@ -507,24 +494,24 @@ do
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- test ! -f "$dst" ||
- $doit $rmcmd "$dst" 2>/dev/null ||
- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
- } ||
- { echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
@@ -533,9 +520,9 @@ do
done
# Local variables:
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC0"
+# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
diff --git a/unix/installManPage b/unix/installManPage
index 3d5fa7b..6bdccf0 100755
--- a/unix/installManPage
+++ b/unix/installManPage
@@ -5,14 +5,13 @@
###
Gzip=:
-Sym=""
-Loc=""
+SymOrLoc=""
Gz=""
Suffix=""
while true; do
case $1 in
- -s | --symlinks ) Sym="-s " ;;
+ -s | --symlinks ) SymOrLoc="-s " ;;
-z | --compress ) Gzip=$2; shift ;;
-e | --extension ) Gz=$2; shift ;;
-x | --suffix ) Suffix=$2; shift ;;
@@ -44,11 +43,11 @@ if test -f $ManPage ; then : ; else
echo "source manual page file must exist"
exit 1
fi
-if test -d "$Dir" ; then : ; else
+if test -d $Dir ; then : ; else
echo "target directory must exist"
exit 1
fi
-test -z "$Sym" && Loc="$Dir/"
+test -z "$SymOrLoc" && SymOrLoc="$Dir/"
########################################################################
### Extract Target Names from Manual Page
@@ -60,36 +59,20 @@ test -z "$Sym" && Loc="$Dir/"
# backticks which doesn't pass backslashes literally.
#
Names=`sed -n '
-# Look for a line that starts with .SH NAME
- /^\.SH NAME/,/^\./{
-
-
- /^\./!{
-
- # Remove all commas...
- s/,//g
-
- # ... and backslash-escaped spaces.
- s/\\\ //g
-
- /\\\-.*/{
- # Delete from \- to the end of line
- s/ \\\-.*//
- h
- s/.*/./
- x
- }
-
- # Convert all non-space non-alphanum sequences
- # to single underscores.
- s/[^ A-Za-z0-9][^ A-Za-z0-9]*/_/g
- p
- g
- /^\./{
- q
- }
- }
-
+# Look for a line, that starts with .SH NAME
+# optionally allow NAME to be surrounded
+# by quotes.
+ /^\.SH NAME/{
+# Read next line
+ n
+# Remove all commas ...
+ s/,//g
+# ... and backslash-escaped spaces.
+ s/\\\ //g
+# Delete from \- to the end of line
+ s/ \\\-.*//
+# print the result and exit
+ p;q
}' $ManPage`
if test -z "$Names" ; then
@@ -108,32 +91,24 @@ case $ManPage in
exit 2 ;;
esac
-Name=`basename $ManPage .$Section`
SrcDir=`dirname $ManPage`
########################################################################
### Process Page to Create Target Pages
###
-Specials="DString Thread Notifier RegExp library packagens pkgMkIndex safesock FindPhoto FontId MeasureChar"
-for n in $Specials; do
- if [ "$Name" = "$n" ] ; then
- Names="$n $Names"
- fi
-done
-
First=""
for Target in $Names; do
Target=$Target.$Section$Suffix
- rm -f "$Dir/$Target" "$Dir/$Target.*"
+ rm -f $Dir/$Target $Dir/$Target.*
if test -z "$First" ; then
First=$Target
sed -e "/man\.macros/r $SrcDir/man.macros" -e "/man\.macros/d" \
- $ManPage > "$Dir/$First"
- chmod 644 "$Dir/$First"
- $Gzip "$Dir/$First"
+ $ManPage > $Dir/$First
+ chmod 444 $Dir/$First
+ $Gzip $Dir/$First
else
- ln $Sym"$Loc$First$Gz" "$Dir/$Target$Gz"
+ ln $SymOrLoc$First$Gz $Dir/$Target$Gz
fi
done
diff --git a/unix/ldAix b/unix/ldAix
index f115ea8..51b2995 100755
--- a/unix/ldAix
+++ b/unix/ldAix
@@ -1,5 +1,5 @@
#!/bin/sh
-#
+#
# ldAix ldCmd ldArg ldArg ...
#
# This shell script provides a wrapper for ld under AIX in order to
@@ -40,8 +40,8 @@ rm -f lib.exp
echo "#! $outputFile" >lib.exp
/usr/ccs/bin/nm $nmopts $ofiles | sed -e '/:$/d' -e '/ U /d' -e 's/^\.//' -e 's/[ |].*//' | sort | uniq >>lib.exp
-# If we're linking a .a file, then link all the objects together into a
-# single file "shr.o" and then put that into the archive. Otherwise link
+# If we're linking a .a file, then link all the objects together into a
+# single file "shr.o" and then put that into the archive. Otherwise link
# the object files directly into the .a file.
noDotA=`echo $outputFile | sed -e '/\.a$/d'`
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 68048f4..a7faae5 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -28,9 +28,9 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
# we reset no_tcl in case something fails here
no_tcl=true
AC_ARG_WITH(tcl,
- AS_HELP_STRING([--with-tcl],
+ AC_HELP_STRING([--with-tcl],
[directory containing tcl configuration (tclConfig.sh)]),
- [with_tclconfig="${withval}"])
+ with_tclconfig="${withval}")
AC_MSG_CHECKING([for Tcl configuration])
AC_CACHE_VAL(ac_cv_c_tclconfig,[
@@ -77,6 +77,7 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
`ls -d /Library/Frameworks 2>/dev/null` \
`ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
; do
if test -f "$i/Tcl.framework/tclConfig.sh" ; then
ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`"
@@ -92,12 +93,8 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
`ls -d ${prefix}/lib 2>/dev/null` \
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
- `ls -d /usr/pkg/lib 2>/dev/null` \
- `ls -d /usr/lib/tcl8.7 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
- `ls -d /usr/local/lib/tcl8.7 2>/dev/null` \
- `ls -d /usr/local/lib/tcl/tcl8.7 2>/dev/null` \
; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig="`(cd $i; pwd)`"
@@ -114,9 +111,9 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
if test -f "$i/unix/tclConfig.sh" ; then
- ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
- break
- fi
+ ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
done
fi
])
@@ -161,9 +158,9 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
# we reset no_tk in case something fails here
no_tk=true
AC_ARG_WITH(tk,
- AS_HELP_STRING([--with-tk],
+ AC_HELP_STRING([--with-tk],
[directory containing tk configuration (tkConfig.sh)]),
- [with_tkconfig="${withval}"])
+ with_tkconfig="${withval}")
AC_MSG_CHECKING([for Tk configuration])
AC_CACHE_VAL(ac_cv_c_tkconfig,[
@@ -210,6 +207,7 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
`ls -d /Library/Frameworks 2>/dev/null` \
`ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
; do
if test -f "$i/Tk.framework/tkConfig.sh" ; then
ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`"
@@ -225,12 +223,8 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
`ls -d ${prefix}/lib 2>/dev/null` \
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
- `ls -d /usr/pkg/lib 2>/dev/null` \
- `ls -d /usr/lib/tk8.7 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
- `ls -d /usr/local/lib/tk8.7 2>/dev/null` \
- `ls -d /usr/local/lib/tcl/tk8.7 2>/dev/null` \
; do
if test -f "$i/tkConfig.sh" ; then
ac_cv_c_tkconfig="`(cd $i; pwd)`"
@@ -277,10 +271,11 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
#
# Results:
#
-# Substitutes the following vars:
+# Subst the following vars:
# TCL_BIN_DIR
# TCL_SRC_DIR
# TCL_LIB_FILE
+#
#------------------------------------------------------------------------
AC_DEFUN([SC_LOAD_TCLCONFIG], [
@@ -293,6 +288,10 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [
AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
fi
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+ eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
+
# If the TCL_BIN_DIR is the build directory (not the install directory),
# then set the common variable name to the value of the build variables.
# For example, the variable TCL_LIB_SPEC will be set to the value
@@ -326,6 +325,12 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [
esac
fi
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
+ eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
+ eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
+ eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
+
AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_PATCH_LEVEL)
AC_SUBST(TCL_BIN_DIR)
@@ -366,6 +371,10 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [
AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
fi
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
+ eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
+
# If the TK_BIN_DIR is the build directory (not the install directory),
# then set the common variable name to the value of the build variables.
# For example, the variable TK_LIB_SPEC will be set to the value
@@ -399,6 +408,12 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [
esac
fi
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
+ eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
+ eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
+ eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
+
AC_SUBST(TK_VERSION)
AC_SUBST(TK_BIN_DIR)
AC_SUBST(TK_SRC_DIR)
@@ -424,11 +439,11 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [
# extension can't assume that an executable Tcl shell exists at
# build time.
#
-# Arguments:
+# Arguments
# none
#
-# Results:
-# Substitutes the following vars:
+# Results
+# Subst's the following values:
# TCLSH_PROG
#------------------------------------------------------------------------
@@ -469,11 +484,11 @@ AC_DEFUN([SC_PROG_TCLSH], [
# when running tests from an extension build directory. It is not
# correct to use the TCLSH_PROG in cases like this.
#
-# Arguments:
+# Arguments
# none
#
-# Results:
-# Substitutes the following values:
+# Results
+# Subst's the following values:
# BUILD_TCLSH
#------------------------------------------------------------------------
@@ -508,9 +523,17 @@ AC_DEFUN([SC_BUILD_TCLSH], [
AC_DEFUN([SC_ENABLE_SHARED], [
AC_MSG_CHECKING([how to build libraries])
AC_ARG_ENABLE(shared,
- AS_HELP_STRING([--enable-shared],
+ AC_HELP_STRING([--enable-shared],
[build and link with shared libraries (default: on)]),
[tcl_ok=$enableval], [tcl_ok=yes])
+
+ if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ tcl_ok=$enableval
+ else
+ tcl_ok=yes
+ fi
+
if test "$tcl_ok" = "yes" ; then
AC_MSG_RESULT([shared])
SHARED_BUILD=1
@@ -519,7 +542,6 @@ AC_DEFUN([SC_ENABLE_SHARED], [
SHARED_BUILD=0
AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?])
fi
- AC_SUBST(SHARED_BUILD)
])
#------------------------------------------------------------------------
@@ -543,7 +565,7 @@ AC_DEFUN([SC_ENABLE_FRAMEWORK], [
if test "`uname -s`" = "Darwin" ; then
AC_MSG_CHECKING([how to package libraries])
AC_ARG_ENABLE(framework,
- AS_HELP_STRING([--enable-framework],
+ AC_HELP_STRING([--enable-framework],
[package shared libraries in MacOSX frameworks (default: off)]),
[enable_framework=$enableval], [enable_framework=no])
if test $enable_framework = yes; then
@@ -571,6 +593,147 @@ AC_DEFUN([SC_ENABLE_FRAMEWORK], [
])
#------------------------------------------------------------------------
+# SC_ENABLE_THREADS --
+#
+# Specify if thread support should be enabled
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-threads
+#
+# Sets the following vars:
+# THREADS_LIBS Thread library(s)
+#
+# Defines the following vars:
+# TCL_THREADS
+# _REENTRANT
+# _THREAD_SAFE
+#
+#------------------------------------------------------------------------
+
+AC_DEFUN([SC_ENABLE_THREADS], [
+ AC_ARG_ENABLE(threads,
+ AC_HELP_STRING([--enable-threads],
+ [build with threads (default: off)]),
+ [tcl_ok=$enableval], [tcl_ok=no])
+
+ if test "${TCL_THREADS}" = 1; then
+ tcl_threaded_core=1;
+ fi
+
+ if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
+ TCL_THREADS=1
+ # USE_THREAD_ALLOC tells us to try the special thread-based
+ # allocator that significantly reduces lock contention
+ AC_DEFINE(USE_THREAD_ALLOC, 1,
+ [Do we want to use the threaded memory allocator?])
+ AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
+ if test "`uname -s`" = "SunOS" ; then
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
+ [Do we really want to follow the standard? Yes we do!])
+ fi
+ AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
+ AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
+ if test "$tcl_ok" = "no"; then
+ # Check a little harder for __pthread_mutex_init in the same
+ # library, as some systems hide it there until pthread.h is
+ # defined. We could alternatively do an AC_TRY_COMPILE with
+ # pthread.h, but that will work with libpthread really doesn't
+ # exist, like AIX 4.2. [Bug: 4359]
+ AC_CHECK_LIB(pthread, __pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ fi
+
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthread"
+ else
+ AC_CHECK_LIB(pthreads, pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthreads"
+ else
+ AC_CHECK_LIB(c, pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = "no"; then
+ AC_CHECK_LIB(c_r, pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -pthread"
+ else
+ TCL_THREADS=0
+ AC_MSG_WARN([Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...])
+ fi
+ fi
+ fi
+ fi
+
+ # Does the pthread-implementation provide
+ # 'pthread_attr_setstacksize' ?
+
+ ac_saved_libs=$LIBS
+ LIBS="$LIBS $THREADS_LIBS"
+ AC_CHECK_FUNCS(pthread_attr_setstacksize pthread_atfork)
+ AC_CHECK_FUNC(pthread_attr_get_np,tcl_ok=yes,tcl_ok=no)
+ if test $tcl_ok = yes ; then
+ AC_DEFINE(HAVE_PTHREAD_ATTR_GET_NP, 1,
+ [Do we want a BSD-like thread-attribute interface?])
+ AC_CACHE_CHECK([for pthread_attr_get_np declaration],
+ tcl_cv_grep_pthread_attr_get_np, [
+ AC_EGREP_HEADER(pthread_attr_get_np, pthread.h,
+ tcl_cv_grep_pthread_attr_get_np=present,
+ tcl_cv_grep_pthread_attr_get_np=missing)])
+ if test $tcl_cv_grep_pthread_attr_get_np = missing ; then
+ AC_DEFINE(ATTRGETNP_NOT_DECLARED, 1,
+ [Is pthread_attr_get_np() declared in <pthread.h>?])
+ fi
+ else
+ AC_CHECK_FUNC(pthread_getattr_np,tcl_ok=yes,tcl_ok=no)
+ if test $tcl_ok = yes ; then
+ AC_DEFINE(HAVE_PTHREAD_GETATTR_NP, 1,
+ [Do we want a Linux-like thread-attribute interface?])
+ AC_CACHE_CHECK([for pthread_getattr_np declaration],
+ tcl_cv_grep_pthread_getattr_np, [
+ AC_EGREP_HEADER(pthread_getattr_np, pthread.h,
+ tcl_cv_grep_pthread_getattr_np=present,
+ tcl_cv_grep_pthread_getattr_np=missing)])
+ if test $tcl_cv_grep_pthread_getattr_np = missing ; then
+ AC_DEFINE(GETATTRNP_NOT_DECLARED, 1,
+ [Is pthread_getattr_np declared in <pthread.h>?])
+ fi
+ fi
+ fi
+ if test $tcl_ok = no; then
+ # Darwin thread stacksize API
+ AC_CHECK_FUNCS(pthread_get_stacksize_np)
+ fi
+ LIBS=$ac_saved_libs
+ else
+ TCL_THREADS=0
+ fi
+ # Do checking message here to not mess up interleaved configure output
+ AC_MSG_CHECKING([for building with threads])
+ if test "${TCL_THREADS}" = 1; then
+ AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?])
+ if test "${tcl_threaded_core}" = 1; then
+ AC_MSG_RESULT([yes (threaded core)])
+ else
+ AC_MSG_RESULT([yes])
+ fi
+ else
+ AC_MSG_RESULT([no (default)])
+ fi
+
+ AC_SUBST(TCL_THREADS)
+])
+
+#------------------------------------------------------------------------
# SC_ENABLE_SYMBOLS --
#
# Specify if debugging symbols should be used.
@@ -596,15 +759,19 @@ AC_DEFUN([SC_ENABLE_FRAMEWORK], [
# Sets to $(CFLAGS_OPTIMIZE) if false
# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true
# Sets to $(LDFLAGS_OPTIMIZE) if false
+# DBGX Formerly used as debug library extension;
+# always blank now.
+#
#------------------------------------------------------------------------
AC_DEFUN([SC_ENABLE_SYMBOLS], [
AC_MSG_CHECKING([for build with symbols])
AC_ARG_ENABLE(symbols,
- AS_HELP_STRING([--enable-symbols],
+ AC_HELP_STRING([--enable-symbols],
[build with debugging symbols (default: off)]),
[tcl_ok=$enableval], [tcl_ok=no])
# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT.
+ DBGX=""
if test "$tcl_ok" = "no"; then
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
@@ -656,11 +823,12 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [
#
# Defines the following vars:
# HAVE_LANGINFO Triggers use of nl_langinfo if defined.
+#
#------------------------------------------------------------------------
AC_DEFUN([SC_ENABLE_LANGINFO], [
AC_ARG_ENABLE(langinfo,
- AS_HELP_STRING([--enable-langinfo],
+ AC_HELP_STRING([--enable-langinfo],
[use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]),
[langinfo_ok=$enableval], [langinfo_ok=yes])
@@ -671,8 +839,8 @@ AC_DEFUN([SC_ENABLE_LANGINFO], [
AC_MSG_CHECKING([whether to use nl_langinfo])
if test "$langinfo_ok" = "yes"; then
AC_CACHE_VAL(tcl_cv_langinfo_h, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[nl_langinfo(CODESET);]])],
- [tcl_cv_langinfo_h=yes], [tcl_cv_langinfo_h=no])])
+ AC_TRY_COMPILE([#include <langinfo.h>], [nl_langinfo(CODESET);],
+ [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])])
AC_MSG_RESULT([$tcl_cv_langinfo_h])
if test $tcl_cv_langinfo_h = yes; then
AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?])
@@ -712,22 +880,22 @@ AC_DEFUN([SC_ENABLE_LANGINFO], [
AC_DEFUN([SC_CONFIG_MANPAGES], [
AC_MSG_CHECKING([whether to use symlinks for manpages])
AC_ARG_ENABLE(man-symlinks,
- AS_HELP_STRING([--enable-man-symlinks],
+ AC_HELP_STRING([--enable-man-symlinks],
[use symlinks for the manpages (default: off)]),
- [test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks"],
- [enableval="no"])
+ test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks",
+ enableval="no")
AC_MSG_RESULT([$enableval])
AC_MSG_CHECKING([whether to compress the manpages])
AC_ARG_ENABLE(man-compression,
- AS_HELP_STRING([--enable-man-compression=PROG],
+ AC_HELP_STRING([--enable-man-compression=PROG],
[compress the manpages with PROG (default: off)]),
[case $enableval in
yes) AC_MSG_ERROR([missing argument to --enable-man-compression]);;
no) ;;
*) MAN_FLAGS="$MAN_FLAGS --compress $enableval";;
esac],
- [enableval="no"])
+ enableval="no")
AC_MSG_RESULT([$enableval])
if test "$enableval" != "no"; then
AC_MSG_CHECKING([for compressed file suffix])
@@ -741,14 +909,14 @@ AC_DEFUN([SC_CONFIG_MANPAGES], [
AC_MSG_CHECKING([whether to add a package name suffix for the manpages])
AC_ARG_ENABLE(man-suffix,
- AS_HELP_STRING([--enable-man-suffix=STRING],
+ AC_HELP_STRING([--enable-man-suffix=STRING],
[use STRING as a suffix to manpage file names (default: no, AC_PACKAGE_NAME if enabled without specifying STRING)]),
[case $enableval in
yes) enableval="AC_PACKAGE_NAME" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";;
no) ;;
*) MAN_FLAGS="$MAN_FLAGS --suffix $enableval";;
esac],
- [enableval="no"])
+ enableval="no")
AC_MSG_RESULT([$enableval])
AC_SUBST(MAN_FLAGS)
@@ -759,7 +927,8 @@ AC_DEFUN([SC_CONFIG_MANPAGES], [
#
# Determine what the system is (some things cannot be easily checked
# on a feature-driven basis, alas). This can usually be done via the
-# "uname" command.
+# "uname" command, but there are a few systems, like Next, where
+# this doesn't work.
#
# Arguments:
# none
@@ -773,20 +942,23 @@ AC_DEFUN([SC_CONFIG_MANPAGES], [
AC_DEFUN([SC_CONFIG_SYSTEM], [
AC_CACHE_CHECK([system version], tcl_cv_sys_version, [
- if test "${TEA_PLATFORM}" = "windows" ; then
- tcl_cv_sys_version=windows
+ if test -f /usr/lib/NextStep/software_version; then
+ tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
else
tcl_cv_sys_version=`uname -s`-`uname -r`
if test "$?" -ne 0 ; then
AC_MSG_WARN([can't find uname command])
tcl_cv_sys_version=unknown
else
+ # Special check for weird MP-RAS system (uname returns weird
+ # results, and the version is kept in special file).
+
+ if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
+ tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid`
+ fi
if test "`uname -s`" = "AIX" ; then
tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
fi
- if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then
- tcl_cv_sys_version=NetBSD-Debian
- fi
fi
fi
])
@@ -840,11 +1012,11 @@ AC_DEFUN([SC_CONFIG_SYSTEM], [
# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
# creating shared libraries. This symbol typically
# goes at the end of the "ld" commands that build
-# shared libraries. The value of the symbol defaults to
+# shared libraries. The value of the symbol is
# "${LIBS}" if all of the dependent libraries should
# be specified when creating a shared library. If
-# dependent libraries should not be specified (as on some
-# SunOS systems, where they cause the link to fail, or in
+# dependent libraries should not be specified (as on
+# SunOS 4.x, where they cause the link to fail, or in
# general if Tcl and Tk aren't themselves shared
# libraries), then this symbol has an empty string
# as its value.
@@ -885,7 +1057,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_MSG_CHECKING([if 64bit support is requested])
AC_ARG_ENABLE(64bit,
- AS_HELP_STRING([--enable-64bit],
+ AC_HELP_STRING([--enable-64bit],
[enable 64bit support (default: off)]),
[do64bit=$enableval], [do64bit=no])
AC_MSG_RESULT([$do64bit])
@@ -894,7 +1066,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_MSG_CHECKING([if 64bit Sparc VIS support is requested])
AC_ARG_ENABLE(64bit-vis,
- AS_HELP_STRING([--enable-64bit-vis],
+ AC_HELP_STRING([--enable-64bit-vis],
[enable 64bit Sparc VIS support (default: off)]),
[do64bitVIS=$enableval], [do64bitVIS=no])
AC_MSG_RESULT([$do64bitVIS])
@@ -907,24 +1079,22 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CACHE_CHECK([if compiler supports visibility "hidden"],
tcl_cv_cc_visibility_hidden, [
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_LINK([
extern __attribute__((__visibility__("hidden"))) void f(void);
- void f(void) {}]], [[f();]])],
- [tcl_cv_cc_visibility_hidden=yes],
- [tcl_cv_cc_visibility_hidden=no])
+ void f(void) {}], [f();], tcl_cv_cc_visibility_hidden=yes,
+ tcl_cv_cc_visibility_hidden=no)
CFLAGS=$hold_cflags])
AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
AC_DEFINE(MODULE_SCOPE,
[extern __attribute__((__visibility__("hidden")))],
[Compiler support for module scope symbols])
- AC_DEFINE(HAVE_HIDDEN, [1], [Compiler support for module scope symbols])
])
# Step 0.d: Disable -rpath support?
AC_MSG_CHECKING([if rpath support is requested])
AC_ARG_ENABLE(rpath,
- AS_HELP_STRING([--disable-rpath],
+ AC_HELP_STRING([--disable-rpath],
[disable rpath support (default: on)]),
[doRpath=$enableval], [doRpath=yes])
AC_MSG_RESULT([$doRpath])
@@ -940,6 +1110,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
# Require ranlib early so we can override it in special cases below.
+ AS_IF([test x"${SHLIB_VERSION}" = x], [SHLIB_VERSION="1.0"])
AC_REQUIRE([AC_PROG_RANLIB])
@@ -958,31 +1129,19 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
ECHO_VERSION='`echo ${VERSION}`'
TCL_LIB_VERSIONS_OK=ok
CFLAGS_DEBUG=-g
+ CFLAGS_OPTIMIZE=-O
AS_IF([test "$GCC" = yes], [
- CFLAGS_OPTIMIZE=-O2
- CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith"
- case "${CC}" in
- *++|*++-*)
- ;;
- *)
- CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers"
- ;;
- esac
-
- ], [
- CFLAGS_OPTIMIZE=-O
- CFLAGS_WARNING=""
- ])
+ CFLAGS_WARNING="-Wall"
+ ], [CFLAGS_WARNING=""])
AC_CHECK_TOOL(AR, ar)
STLIB_LD='${AR} cr'
LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
PLAT_OBJS=""
PLAT_SRCS=""
LDAIX_SRC=""
- AS_IF([test "x${SHLIB_VERSION}" = x], [SHLIB_VERSION="1.0"])
case $system in
AIX-*)
- AS_IF([test "$GCC" != "yes"], [
+ AS_IF([test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"], [
# AIX requires the _r compiler when gcc isn't being used
case "${CC}" in
*_r|*_r\ *)
@@ -1077,34 +1236,38 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
- CYGWIN_*|MINGW32_*|MSYS_*)
- SHLIB_CFLAGS="-fno-common"
+ CYGWIN_*|MINGW32*)
+ SHLIB_CFLAGS=""
SHLIB_LD='${CC} -shared'
SHLIB_SUFFIX=".dll"
- DL_OBJS="tclLoadDl.o"
- PLAT_OBJS='${CYGWIN_OBJS}'
- PLAT_SRCS='${CYGWIN_SRCS}'
+ DL_OBJS="tclLoadDl.o tclWinError.o"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
+ TCL_NEEDS_EXP_FILE=1
+ TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a'
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$[@].a"
AC_CACHE_CHECK(for Cygwin version of gcc,
ac_cv_cygwin,
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#ifdef __CYGWIN__
#error cygwin
#endif
- ]], [[]])],
- [ac_cv_cygwin=no],
- [ac_cv_cygwin=yes])
+ ], [],
+ ac_cv_cygwin=no,
+ ac_cv_cygwin=yes)
)
if test "$ac_cv_cygwin" = "no"; then
AC_MSG_ERROR([${CC} is not a cygwin compiler.])
fi
+ if test "x${TCL_THREADS}" = "x0"; then
+ AC_MSG_ERROR([CYGWIN compile is only supported with --enable-threads])
+ fi
do64bit_ok=yes
if test "x${SHARED_BUILD}" = "x1"; then
- echo "running cd ../win; ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32"
+ echo "running cd ${TCL_SRC_DIR}/win; ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args"
# The eval makes quoting arguments work.
- if cd ../win; eval ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32; cd ../unix
+ if cd ${TCL_SRC_DIR}/win; eval ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args; cd ../unix
then :
else
{ echo "configure: error: configure failed for ../win" 1>&2; exit 1; }
@@ -1125,7 +1288,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
SHLIB_CFLAGS="-fPIC"
SHLIB_SUFFIX=".so"
- SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared'
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
DL_OBJS="tclLoadDl.o"
DL_LIBS="-lroot"
AC_CHECK_LIB(network, inet_ntoa, [LIBS="$LIBS -lnetwork"])
@@ -1155,8 +1318,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AS_IF([test "$GCC" = yes], [
SHLIB_LD='${CC} -shared'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
- ], [
- CFLAGS="$CFLAGS -z"
])
# Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
@@ -1171,7 +1332,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
do64bit_ok=yes
SHLIB_LD='${CC} -shared'
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
;;
*)
@@ -1204,9 +1365,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
- AC_LIBOBJ(mkstemp)
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
;;
IRIX-6.*)
@@ -1215,9 +1375,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
- AC_LIBOBJ(mkstemp)
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
AS_IF([test "$GCC" = yes], [
CFLAGS="$CFLAGS -mabi=n32"
@@ -1241,9 +1400,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
- AC_LIBOBJ(mkstemp)
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
# Check to enable 64-bit flags for compiler/linker
@@ -1259,8 +1417,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
])
])
;;
- Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*)
- SHLIB_CFLAGS="-fPIC -fno-common"
+ Linux*|GNU*|NetBSD-Debian)
+ SHLIB_CFLAGS="-fPIC"
SHLIB_SUFFIX=".so"
CFLAGS_OPTIMIZE="-O2"
@@ -1269,31 +1427,19 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
# get rid of the warnings.
#CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
- SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared'
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
-
- case $system in
- DragonFly-*|FreeBSD-*)
- AS_IF([test "${TCL_THREADS}" = "1"], [
- # The -pthread needs to go in the LDFLAGS, not LIBS
- LIBS=`echo $LIBS | sed s/-pthread//`
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- LDFLAGS="$LDFLAGS $PTHREAD_LIBS"])
- ;;
- esac
-
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"])
AS_IF([test $do64bit = yes], [
AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -m64"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
- [tcl_cv_cc_m64=yes],[tcl_cv_cc_m64=no])
+ AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no)
CFLAGS=$hold_cflags])
AS_IF([test $tcl_cv_cc_m64 = yes], [
CFLAGS="$CFLAGS -m64"
@@ -1302,7 +1448,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
])
# The combo of gcc + glibc has a bug related to inlining of
- # functions like strtol()/strtoul(). The -fno-builtin flag should address
+ # functions like strtod(). The -fno-builtin flag should address
# this problem but it does not work. The -fno-inline flag is kind
# of overkill but it works. Disable inlining only when one of the
# files in compat/*.c is being linked in.
@@ -1318,33 +1464,77 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_LIBS="-mshared -ldl"
LD_FLAGS="-Wl,--export-dynamic"
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
- LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ ;;
+ MP-RAS-02*)
+ SHLIB_CFLAGS="-K PIC"
+ SHLIB_LD='${CC} -G'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ MP-RAS-*)
+ SHLIB_CFLAGS="-K PIC"
+ SHLIB_LD='${CC} -G'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
;;
OpenBSD-*)
arch=`arch -s`
case "$arch" in
- alpha|sparc64)
- SHLIB_CFLAGS="-fPIC"
+ vax)
+ # Equivalent using configure option --disable-load
+ # Step 4 will set the necessary variables
+ DL_OBJS=""
+ SHLIB_LD_LIBS=""
+ LDFLAGS=""
;;
*)
- SHLIB_CFLAGS="-fpic"
+ case "$arch" in
+ alpha|sparc|sparc64)
+ SHLIB_CFLAGS="-fPIC"
+ ;;
+ *)
+ SHLIB_CFLAGS="-fpic"
+ ;;
+ esac
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
+ LDFLAGS="-Wl,-export-dynamic"
;;
esac
- SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
- LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
- LDFLAGS="-Wl,-export-dynamic"
- CFLAGS_OPTIMIZE="-O2"
- # On OpenBSD: Compile with -pthread
- # Don't link with -lpthread
- LIBS=`echo $LIBS | sed s/-lpthread//`
- CFLAGS="$CFLAGS -pthread"
+ case "$arch" in
+ vax)
+ CFLAGS_OPTIMIZE="-O1"
+ ;;
+ sh)
+ CFLAGS_OPTIMIZE="-O0"
+ ;;
+ *)
+ CFLAGS_OPTIMIZE="-O2"
+ ;;
+ esac
+ AS_IF([test "${TCL_THREADS}" = "1"], [
+ # On OpenBSD: Compile with -pthread
+ # Don't link with -lpthread
+ LIBS=`echo $LIBS | sed s/-lpthread//`
+ CFLAGS="$CFLAGS -pthread"
+ ])
# OpenBSD doesn't do version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
TCL_LIB_VERSIONS_OK=nodots
@@ -1352,21 +1542,50 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
NetBSD-*)
# NetBSD has ELF and can use 'cc -shared' to build shared libs
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared'
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS="$LDFLAGS -export-dynamic"
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
- # The -pthread needs to go in the CFLAGS, not LIBS
- LIBS=`echo $LIBS | sed s/-pthread//`
- CFLAGS="$CFLAGS -pthread"
- LDFLAGS="$LDFLAGS -pthread"
+ AS_IF([test "${TCL_THREADS}" = "1"], [
+ # The -pthread needs to go in the CFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+ ])
+ ;;
+ FreeBSD-*)
+ # This configuration from FreeBSD Ports.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="${CC} -shared"
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,-soname,\$[@]"
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ LDFLAGS=""
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ AS_IF([test "${TCL_THREADS}" = "1"], [
+ # The -pthread needs to go in the LDFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"])
+ case $system in
+ FreeBSD-3.*)
+ # Version numbers are dot-stripped by system policy.
+ TCL_TRIM_DOTS=`echo ${VERSION} | tr -d .`
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ esac
;;
Darwin-*)
- CFLAGS_OPTIMIZE="-O2"
+ CFLAGS_OPTIMIZE="-Os"
SHLIB_CFLAGS="-fno-common"
# To avoid discrepancies between what headers configure sees during
# preprocessing tests and compiling tests, move any -isysroot and
@@ -1384,43 +1603,31 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
tcl_cv_cc_arch_ppc64, [
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
- [tcl_cv_cc_arch_ppc64=yes],[tcl_cv_cc_arch_ppc64=no])
+ AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes,
+ tcl_cv_cc_arch_ppc64=no)
CFLAGS=$hold_cflags])
AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [
CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
do64bit_ok=yes
]);;
- i386|x86_64)
+ i386)
AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag],
tcl_cv_cc_arch_x86_64, [
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -arch x86_64"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
- [tcl_cv_cc_arch_x86_64=yes],[tcl_cv_cc_arch_x86_64=no])
+ AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes,
+ tcl_cv_cc_arch_x86_64=no)
CFLAGS=$hold_cflags])
AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [
CFLAGS="$CFLAGS -arch x86_64"
do64bit_ok=yes
]);;
- arm64)
- AC_CACHE_CHECK([if compiler accepts -arch arm64 flag],
- tcl_cv_cc_arch_arm64, [
- hold_cflags=$CFLAGS
- CFLAGS="$CFLAGS -arch arm64"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
- [tcl_cv_cc_arch_arm64=yes],[tcl_cv_cc_arch_arm64=no])
- CFLAGS=$hold_cflags])
- AS_IF([test $tcl_cv_cc_arch_arm64 = yes], [
- CFLAGS="$CFLAGS -arch arm64"
- do64bit_ok=yes
- ]);;
*)
AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);;
esac
], [
# Check for combined 32-bit and 64-bit fat build
- AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64|arm64) ' \
+ AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \
&& echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '], [
fat_32_64=yes])
])
@@ -1428,8 +1635,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])],[tcl_cv_ld_single_module=yes],
- [tcl_cv_ld_single_module=no])
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no)
LDFLAGS=$hold_ldflags])
AS_IF([test $tcl_cv_ld_single_module = yes], [
SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
@@ -1437,14 +1643,17 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
SHLIB_SUFFIX=".dylib"
DL_OBJS="tclLoadDyld.o"
DL_LIBS=""
+ # Don't use -prebind when building for Mac OS X 10.4 or later only:
+ AS_IF([test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \
+ "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4], [
+ LDFLAGS="$LDFLAGS -prebind"])
LDFLAGS="$LDFLAGS -headerpad_max_install_names"
AC_CACHE_CHECK([if ld accepts -search_paths_first flag],
tcl_cv_ld_search_paths_first, [
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])],
- [tcl_cv_ld_search_paths_first=yes],
- [tcl_cv_ld_search_paths_first=no])
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes,
+ tcl_cv_ld_search_paths_first=no)
LDFLAGS=$hold_ldflags])
AS_IF([test $tcl_cv_ld_search_paths_first = yes], [
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
@@ -1452,17 +1661,16 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
AC_DEFINE(MODULE_SCOPE, [__private_extern__],
[Compiler support for module scope symbols])
- tcl_cv_cc_visibility_hidden=yes
])
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
- LD_LIBRARY_PATH_VAR="DYLD_FALLBACK_LIBRARY_PATH"
+ LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
AC_DEFINE(MAC_OSX_TCL, 1, [Is this a Mac I see before me?])
PLAT_OBJS='${MAC_OSX_OBJS}'
PLAT_SRCS='${MAC_OSX_SRCS}'
AC_MSG_CHECKING([whether to use CoreFoundation])
AC_ARG_ENABLE(corefoundation,
- AS_HELP_STRING([--enable-corefoundation],
+ AC_HELP_STRING([--enable-corefoundation],
[use CoreFoundation API on MacOSX (default: on)]),
[tcl_corefoundation=$enableval], [tcl_corefoundation=yes])
AC_MSG_RESULT([$tcl_corefoundation])
@@ -1479,10 +1687,10 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
done])
LIBS="$LIBS -framework CoreFoundation"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <CoreFoundation/CoreFoundation.h>]],
- [[CFBundleRef b = CFBundleGetMainBundle();]])],
- [tcl_cv_lib_corefoundation=yes],
- [tcl_cv_lib_corefoundation=no])
+ AC_TRY_LINK([#include <CoreFoundation/CoreFoundation.h>],
+ [CFBundleRef b = CFBundleGetMainBundle();],
+ tcl_cv_lib_corefoundation=yes,
+ tcl_cv_lib_corefoundation=no)
AS_IF([test "$fat_32_64" = yes], [
for v in CFLAGS CPPFLAGS LDFLAGS; do
eval $v'="$hold_'$v'"'
@@ -1499,10 +1707,10 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
for v in CFLAGS CPPFLAGS LDFLAGS; do
eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
done
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <CoreFoundation/CoreFoundation.h>]],
- [[CFBundleRef b = CFBundleGetMainBundle();]])],
- [tcl_cv_lib_corefoundation_64=yes],
- [tcl_cv_lib_corefoundation_64=no])
+ AC_TRY_LINK([#include <CoreFoundation/CoreFoundation.h>],
+ [CFBundleRef b = CFBundleGetMainBundle();],
+ tcl_cv_lib_corefoundation_64=yes,
+ tcl_cv_lib_corefoundation_64=no)
for v in CFLAGS CPPFLAGS LDFLAGS; do
eval $v'="$hold_'$v'"'
done])
@@ -1514,42 +1722,80 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
])
])
;;
+ NEXTSTEP-*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD='${CC} -nostdlib -r'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadNext.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
OS/390-*)
SHLIB_LD_LIBS=""
CFLAGS_OPTIMIZE="" # Optimizer is buggy
AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h
[Should OS/390 do the right thing with sockets?])
;;
+ OSF1-1.0|OSF1-1.1|OSF1-1.2)
+ # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
+ SHLIB_CFLAGS=""
+ # Hack: make package name same as library name
+ SHLIB_LD='ld -R -export $@:'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadOSF.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ OSF1-1.*)
+ # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
+ SHLIB_CFLAGS="-fPIC"
+ AS_IF([test "$SHARED_BUILD" = 1], [SHLIB_LD="ld -shared"], [
+ SHLIB_LD="ld -non_shared"
+ ])
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
OSF1-V*)
# Digital OSF/1
SHLIB_CFLAGS=""
AS_IF([test "$SHARED_BUILD" = 1], [
- SHLIB_LD='${CC} -shared'
+ SHLIB_LD='ld -shared -expect_unresolved "*"'
], [
- SHLIB_LD='${CC} -non_shared'
+ SHLIB_LD='ld -non_shared -expect_unresolved "*"'
])
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [
CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"])
# see pthread_intro(3) for pthread support on osf1, k.furukawa
- CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
- CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
- LIBS=`echo $LIBS | sed s/-lpthreads//`
- AS_IF([test "$GCC" = yes], [
- LIBS="$LIBS -lpthread -lmach -lexc"
- ], [
- CFLAGS="$CFLAGS -pthread"
- LDFLAGS="$LDFLAGS -pthread"
+ AS_IF([test "${TCL_THREADS}" = 1], [
+ CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
+ CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
+ LIBS=`echo $LIBS | sed s/-lpthreads//`
+ AS_IF([test "$GCC" = yes], [
+ LIBS="$LIBS -lpthread -lmach -lexc"
+ ], [
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+ ])
])
;;
QNX-6*)
# QNX RTP
# This may work for all QNX, but it was only reported for v6.
+ SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
@@ -1564,11 +1810,11 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
# this test works, since "uname -s" was non-standard in 3.2.4 and
# below.
AS_IF([test "$GCC" = yes], [
- SHLIB_CFLAGS="-fPIC -melf"
- LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
+ SHLIB_CFLAGS="-fPIC -melf"
+ LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
], [
- SHLIB_CFLAGS="-Kpic -belf"
- LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
+ SHLIB_CFLAGS="-Kpic -belf"
+ LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
])
SHLIB_LD="ld -G"
SHLIB_LD_LIBS=""
@@ -1578,6 +1824,35 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
+ SINIX*5.4*)
+ SHLIB_CFLAGS="-K PIC"
+ SHLIB_LD='${CC} -G'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SunOS-4*)
+ SHLIB_CFLAGS="-PIC"
+ SHLIB_LD="ld"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+
+ # SunOS can't handle version numbers with dots in them in library
+ # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it
+ # requires an extra version number at the end of .so file names.
+ # So, the library has to have a name like libtcl75.so.1.0
+
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
SunOS-5.[[0-6]])
# Careful to not let 5.10+ fall into this case
@@ -1668,7 +1943,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AS_IF([test "$GCC" = yes],[use_sunmath=no],[
arch=`isainfo`
AC_MSG_CHECKING([whether to use -lsunmath for fp rounding control])
- AS_IF([test "$arch" = "amd64 i386" -o "$arch" = "i386"], [
+ AS_IF([test "$arch" = "amd64 i386"], [
AC_MSG_RESULT([yes])
MATH_LIBS="-lsunmath $MATH_LIBS"
AC_CHECK_HEADER(sunmath.h)
@@ -1701,7 +1976,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
], [
AS_IF([test "$use_sunmath" = yes], [textmode=textoff],[textmode=text])
case $system in
- SunOS-5.[[1-9]][[0-9]]*|SunOS-5.[[7-9]])
+ SunOS-5.[[1-9]][[0-9]]*)
SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";;
*)
SHLIB_LD="/usr/ccs/bin/ld -G -z $textmode";;
@@ -1722,7 +1997,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-Bexport"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])],[tcl_cv_ld_Bexport=yes],[tcl_cv_ld_Bexport=no])
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no)
LDFLAGS=$hold_ldflags])
AS_IF([test $tcl_cv_ld_Bexport = yes], [
LDFLAGS="$LDFLAGS -Wl,-Bexport"
@@ -1749,7 +2024,7 @@ dnl # preprocessing tests use only CPPFLAGS.
# Step 4: disable dynamic loading if requested via a command-line switch.
AC_ARG_ENABLE(load,
- AS_HELP_STRING([--enable-load],
+ AC_HELP_STRING([--enable-load],
[allow dynamic loading and "load" command (default: on)]),
[tcl_ok=$enableval], [tcl_ok=yes])
AS_IF([test "$tcl_ok" = no], [DL_OBJS=""])
@@ -1776,22 +2051,14 @@ dnl # preprocessing tests use only CPPFLAGS.
case $system in
AIX-*) ;;
BSD/OS*) ;;
- CYGWIN_*|MINGW32_*|MSYS_*) ;;
- HP-UX*) ;;
- Darwin-*) ;;
+ CYGWIN_*|MINGW32_*) ;;
IRIX*) ;;
- Linux*|GNU*) ;;
- NetBSD-*|OpenBSD-*) ;;
- OSF1-*) ;;
+ NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
+ Darwin-*) ;;
SCO_SV-3.2*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;
esac])
- AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
- AC_DEFINE(MODULE_SCOPE, [extern],
- [No Compiler support for module scope symbols])
- ])
-
AS_IF([test "$SHARED_LIB_SUFFIX" = ""], [
SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}'])
AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [
@@ -1800,9 +2067,9 @@ dnl # preprocessing tests use only CPPFLAGS.
AS_IF([test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""], [
LIB_SUFFIX=${SHARED_LIB_SUFFIX}
- MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${LDFLAGS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
+ MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
AS_IF([test "${SHLIB_SUFFIX}" = ".dll"], [
- INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"'
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;'
DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)"
], [
INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"'
@@ -1812,19 +2079,21 @@ dnl # preprocessing tests use only CPPFLAGS.
AS_IF([test "$RANLIB" = ""], [
MAKE_LIB='$(STLIB_LD) [$]@ ${OBJS}'
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"'
], [
MAKE_LIB='${STLIB_LD} [$]@ ${OBJS} ; ${RANLIB} [$]@'
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)" ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(LIB_FILE))'
])
- INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"'
])
# Stub lib does not depend on shared/static configuration
AS_IF([test "$RANLIB" = ""], [
MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS}'
+ INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"'
], [
MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS} ; ${RANLIB} [$]@'
+ INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)" ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(STUB_LIB_FILE))'
])
- INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"'
# Define TCL_LIBS now that we know what DL_LIBS is.
# The trick here is that we don't want to change the value of TCL_LIBS if
@@ -1833,49 +2102,24 @@ dnl # preprocessing tests use only CPPFLAGS.
TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}"])
AC_SUBST(TCL_LIBS)
- # See if the compiler supports casting to a union type.
- # This is used to stop gcc from printing a compiler
- # warning when initializing a union member.
-
- AC_CACHE_CHECK(for cast to union support,
- tcl_cv_cast_to_union,
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
- union foo { int i; double d; };
- union foo f = (union foo) (int) 0;
- ]])],
- [tcl_cv_cast_to_union=yes],
- [tcl_cv_cast_to_union=no])
- )
- if test "$tcl_cv_cast_to_union" = "yes"; then
- AC_DEFINE(HAVE_CAST_TO_UNION, 1,
- [Defined when compiler supports casting to union type.])
- fi
- hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto"
- AC_CACHE_CHECK(for working -fno-lto,
- ac_cv_nolto,
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
- [ac_cv_nolto=yes],
- [ac_cv_nolto=no])
- )
- CFLAGS=$hold_cflags
- if test "$ac_cv_nolto" = "yes" ; then
- CFLAGS_NOLTO="-fno-lto"
- else
- CFLAGS_NOLTO=""
- fi
- AC_CACHE_CHECK([if the compiler understands -finput-charset],
- tcl_cv_cc_input_charset, [
- hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -finput-charset=UTF-8"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_cc_input_charset=yes],[tcl_cv_cc_input_charset=no])
- CFLAGS=$hold_cflags])
- if test $tcl_cv_cc_input_charset = yes; then
- CFLAGS="$CFLAGS -finput-charset=UTF-8"
- fi
-
- AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H, 1, [Do we have <stdbool.h>?])],)
-
- # Check for vfork, posix_spawnp() and friends unconditionally
- AC_CHECK_FUNCS(vfork posix_spawnp posix_spawn_file_actions_adddup2 posix_spawnattr_setflags)
+ # See if the compiler supports casting to a union type.
+ # This is used to stop gcc from printing a compiler
+ # warning when initializing a union member.
+
+ AC_CACHE_CHECK(for cast to union support,
+ tcl_cv_cast_to_union,
+ AC_TRY_COMPILE([],
+ [
+ union foo { int i; double d; };
+ union foo f = (union foo) (int) 0;
+ ],
+ tcl_cv_cast_to_union=yes,
+ tcl_cv_cast_to_union=no)
+ )
+ if test "$tcl_cv_cast_to_union" = "yes"; then
+ AC_DEFINE(HAVE_CAST_TO_UNION, 1,
+ [Defined when compiler supports casting to union type.])
+ fi
# FIXME: This subst was left in only because the TCL_DL_LIBS
# entry in tclConfig.sh uses it. It is not clear why someone
@@ -1890,7 +2134,6 @@ dnl # preprocessing tests use only CPPFLAGS.
AC_SUBST(CFLAGS_DEBUG)
AC_SUBST(CFLAGS_OPTIMIZE)
AC_SUBST(CFLAGS_WARNING)
- AC_SUBST(CFLAGS_NOLTO)
AC_SUBST(LDFLAGS)
AC_SUBST(LDFLAGS_DEBUG)
@@ -1917,12 +2160,130 @@ dnl # preprocessing tests use only CPPFLAGS.
])
#--------------------------------------------------------------------
+# SC_SERIAL_PORT
+#
+# Determine which interface to use to talk to the serial port.
+# Note that #include lines must begin in leftmost column for
+# some compilers to recognize them as preprocessor directives,
+# and some build environments have stdin not pointing at a
+# pseudo-terminal (usually /dev/null instead.)
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines only one of the following vars:
+# HAVE_SYS_MODEM_H
+# USE_TERMIOS
+# USE_TERMIO
+# USE_SGTTY
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_SERIAL_PORT], [
+ AC_CHECK_HEADERS(sys/modem.h)
+ AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [
+ AC_TRY_RUN([
+#include <termios.h>
+
+int main() {
+ struct termios t;
+ if (tcgetattr(0, &t) == 0) {
+ cfsetospeed(&t, 0);
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <termio.h>
+
+int main() {
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0) {
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <sgtty.h>
+
+int main() {
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0) {
+ t.sg_ospeed = 0;
+ t.sg_flags |= ODDP | EVENP | RAW;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <termios.h>
+#include <errno.h>
+
+int main() {
+ struct termios t;
+ if (tcgetattr(0, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ cfsetospeed(&t, 0);
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no; then
+ AC_TRY_RUN([
+#include <termio.h>
+#include <errno.h>
+
+int main() {
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+ }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no; then
+ AC_TRY_RUN([
+#include <sgtty.h>
+#include <errno.h>
+
+int main() {
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.sg_ospeed = 0;
+ t.sg_flags |= ODDP | EVENP | RAW;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none)
+ fi])
+ case $tcl_cv_api_serial in
+ termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);;
+ termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);;
+ sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);;
+ esac
+])
+
+#--------------------------------------------------------------------
# SC_MISSING_POSIX_HEADERS
#
# Supply substitutes for missing POSIX header files. Special
# notes:
-# - stdlib.h doesn't define strtol or strtoul in some
-# versions of SunOS
+# - stdlib.h doesn't define strtol, strtoul, or
+# strtod insome versions of SunOS
# - some versions of string.h don't declare procedures such
# as strstr
#
@@ -1932,15 +2293,58 @@ dnl # preprocessing tests use only CPPFLAGS.
# Results:
#
# Defines some of the following vars:
+# NO_DIRENT_H
+# NO_VALUES_H
+# HAVE_LIMITS_H or NO_LIMITS_H
+# NO_STDLIB_H
# NO_STRING_H
# NO_SYS_WAIT_H
# NO_DLFCN_H
# HAVE_SYS_PARAM_H
+#
# HAVE_STRING_H ?
#
#--------------------------------------------------------------------
AC_DEFUN([SC_MISSING_POSIX_HEADERS], [
+ AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [
+ AC_TRY_LINK([#include <sys/types.h>
+#include <dirent.h>], [
+#ifndef _POSIX_SOURCE
+# ifdef __Lynx__
+ /*
+ * Generate compilation error to make the test fail: Lynx headers
+ * are only valid if really in the POSIX environment.
+ */
+
+ missing_procedure();
+# endif
+#endif
+DIR *d;
+struct dirent *entryPtr;
+char *p;
+d = opendir("foobar");
+entryPtr = readdir(d);
+p = entryPtr->d_name;
+closedir(d);
+], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)])
+
+ if test $tcl_cv_dirent_h = no; then
+ AC_DEFINE(NO_DIRENT_H, 1, [Do we have <dirent.h>?])
+ fi
+
+ AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have <float.h>?])])
+ AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have <values.h>?])])
+ AC_CHECK_HEADER(limits.h,
+ [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have <limits.h>?])],
+ [AC_DEFINE(NO_LIMITS_H, 1, [Do we have <limits.h>?])])
+ AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
+ AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0)
+ AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0)
+ AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0)
+ if test $tcl_ok = 0; then
+ AC_DEFINE(NO_STDLIB_H, 1, [Do we have <stdlib.h>?])
+ fi
AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0)
AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0)
AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0)
@@ -1956,7 +2360,7 @@ AC_DEFUN([SC_MISSING_POSIX_HEADERS], [
AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have <dlfcn.h>?])])
# OS/390 lacks sys/param.h (and doesn't need it, by chance).
- AC_CHECK_HEADERS([sys/param.h])
+ AC_HAVE_HEADERS(sys/param.h)
])
#--------------------------------------------------------------------
@@ -1985,7 +2389,7 @@ AC_DEFUN([SC_PATH_X], [
not_really_there=""
if test "$no_x" = ""; then
if test "$x_includes" = ""; then
- AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <X11/Xlib.h>]])],[],[not_really_there="yes"])
+ AC_TRY_CPP([#include <X11/Xlib.h>], , not_really_there="yes")
else
if test ! -r $x_includes/X11/Xlib.h; then
not_really_there="yes"
@@ -1995,7 +2399,7 @@ AC_DEFUN([SC_PATH_X], [
if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
AC_MSG_CHECKING([for X11 header files])
found_xincludes="no"
- AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <X11/Xlib.h>]])],[found_xincludes="yes"],[found_xincludes="no"])
+ AC_TRY_CPP([#include <X11/Xlib.h>], found_xincludes="yes", found_xincludes="no")
if test "$found_xincludes" = "no"; then
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"
for i in $dirs ; do
@@ -2072,10 +2476,19 @@ AC_DEFUN([SC_BLOCKING_STYLE], [
SC_CONFIG_SYSTEM
AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O])
case $system in
+ # There used to be code here to use FIONBIO under AIX. However, it
+ # was reported that FIONBIO doesn't work under AIX 3.2.5. Since
+ # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO
+ # code (JO, 5/31/97).
+
OSF*)
AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
AC_MSG_RESULT([FIONBIO])
;;
+ SunOS-4*)
+ AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
+ AC_MSG_RESULT([FIONBIO])
+ ;;
*)
AC_MSG_RESULT([O_NONBLOCK])
;;
@@ -2103,22 +2516,20 @@ AC_DEFUN([SC_BLOCKING_STYLE], [
AC_DEFUN([SC_TIME_HANDLER], [
AC_CHECK_HEADERS(sys/time.h)
- AC_CHECK_HEADERS_ONCE([sys/time.h])
+ AC_HEADER_TIME
AC_CHECK_FUNCS(gmtime_r localtime_r mktime)
AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm tm; (void)tm.tm_tzadj;]])],
- [tcl_cv_member_tm_tzadj=yes],
- [tcl_cv_member_tm_tzadj=no])])
+ AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;],
+ tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)])
if test $tcl_cv_member_tm_tzadj = yes ; then
AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?])
fi
AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm tm; (void)tm.tm_gmtoff;]])],
- [tcl_cv_member_tm_gmtoff=yes],
- [tcl_cv_member_tm_gmtoff=no])])
+ AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
+ tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)])
if test $tcl_cv_member_tm_gmtoff = yes ; then
AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?])
fi
@@ -2128,12 +2539,11 @@ AC_DEFUN([SC_TIME_HANDLER], [
# (like convex) have timezone functions, etc.
#
AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>
-#include <stdlib.h>]],
- [[extern long timezone;
+ AC_TRY_COMPILE([#include <time.h>],
+ [extern long timezone;
timezone += 1;
- exit (0);]])],
- [tcl_cv_timezone_long=yes], [tcl_cv_timezone_long=no])])
+ exit (0);],
+ tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)])
if test $tcl_cv_timezone_long = yes ; then
AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
else
@@ -2141,12 +2551,11 @@ AC_DEFUN([SC_TIME_HANDLER], [
# On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
#
AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>
-#include <stdlib.h>]],
- [[extern time_t timezone;
+ AC_TRY_COMPILE([#include <time.h>],
+ [extern time_t timezone;
timezone += 1;
- exit (0);]])],
- [tcl_cv_timezone_time=yes], [tcl_cv_timezone_time=no])])
+ exit (0);],
+ tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)])
if test $tcl_cv_timezone_time = yes ; then
AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
fi
@@ -2154,25 +2563,70 @@ AC_DEFUN([SC_TIME_HANDLER], [
])
#--------------------------------------------------------------------
+# SC_BUGGY_STRTOD
+#
+# Under Solaris 2.4, strtod returns the wrong value for the
+# terminating character under some conditions. Check for this
+# and if the problem exists use a substitute procedure
+# "fixstrtod" (provided by Tcl) that corrects the error.
+# Also, on Compaq's Tru64 Unix 5.0,
+# strtod(" ") returns 0.0 instead of a failure to convert.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Might defines some of the following vars:
+# strtod (=fixstrtod)
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_BUGGY_STRTOD], [
+ AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0)
+ if test "$tcl_strtod" = 1; then
+ AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
+ AC_TRY_RUN([
+ extern double strtod();
+ int main() {
+ char *infString="Inf", *nanString="NaN", *spaceString=" ";
+ char *term;
+ double value;
+ value = strtod(infString, &term);
+ if ((term != infString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(nanString, &term);
+ if ((term != nanString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(spaceString, &term);
+ if (term == (spaceString+1)) {
+ exit(1);
+ }
+ exit(0);
+ }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy,
+ tcl_cv_strtod_buggy=buggy)])
+ if test "$tcl_cv_strtod_buggy" = buggy; then
+ AC_LIBOBJ([fixstrtod])
+ USE_COMPAT=1
+ AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?])
+ fi
+ fi
+])
+
+#--------------------------------------------------------------------
# SC_TCL_LINK_LIBS
#
# Search for the libraries needed to link the Tcl shell.
-# Things like the math library (-lm), socket stuff (-lsocket vs.
-# -lnsl), zlib (-lz) and libtommath (-ltommath) or thread library
-# (-lpthread) are dealt with here.
+# Things like the math library (-lm) and socket stuff (-lsocket vs.
+# -lnsl) are dealt with here.
#
# Arguments:
# None.
#
# Results:
#
-# Sets the following vars:
-# THREADS_LIBS Thread library(s)
-#
-# Defines the following vars:
-# _REENTRANT
-# _THREAD_SAFE
-#
# Might append to the following vars:
# LIBS
# MATH_LIBS
@@ -2186,9 +2640,12 @@ AC_DEFUN([SC_TCL_LINK_LIBS], [
#--------------------------------------------------------------------
# On a few very rare systems, all of the libm.a stuff is
# already in libc.a. Set compiler flags accordingly.
+ # Also, Linux requires the "ieee" library for math to work
+ # right (and it must appear before "-lm").
#--------------------------------------------------------------------
AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm")
+ AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
#--------------------------------------------------------------------
# Interactive UNIX requires -linet instead of -lsocket, plus it
@@ -2230,55 +2687,6 @@ AC_DEFUN([SC_TCL_LINK_LIBS], [
fi
AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname,
[LIBS="$LIBS -lnsl"])])
-
- AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
- AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
- AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
- if test "$tcl_ok" = "no"; then
- # Check a little harder for __pthread_mutex_init in the same
- # library, as some systems hide it there until pthread.h is
- # defined. We could alternatively do an AC_TRY_COMPILE with
- # pthread.h, but that will work with libpthread really doesn't
- # exist, like AIX 4.2. [Bug: 4359]
- AC_CHECK_LIB(pthread, __pthread_mutex_init,
- tcl_ok=yes, tcl_ok=no)
- fi
-
- if test "$tcl_ok" = "yes"; then
- # The space is needed
- THREADS_LIBS=" -lpthread"
- else
- AC_CHECK_LIB(pthreads, pthread_mutex_init,
- _ok=yes, tcl_ok=no)
- if test "$tcl_ok" = "yes"; then
- # The space is needed
- THREADS_LIBS=" -lpthreads"
- else
- AC_CHECK_LIB(c, pthread_mutex_init,
- tcl_ok=yes, tcl_ok=no)
- if test "$tcl_ok" = "no"; then
- AC_CHECK_LIB(c_r, pthread_mutex_init,
- tcl_ok=yes, tcl_ok=no)
- if test "$tcl_ok" = "yes"; then
- # The space is needed
- THREADS_LIBS=" -pthread"
- else
- AC_MSG_WARN([Don't know how to find pthread lib on your system - you must edit the LIBS in the Makefile...])
- fi
- fi
- fi
- fi
-
- # Does the pthread-implementation provide
- # 'pthread_attr_setstacksize' ?
-
- ac_saved_libs=$LIBS
- LIBS="$LIBS $THREADS_LIBS"
- AC_CHECK_FUNCS(pthread_attr_setstacksize pthread_atfork)
- LIBS=$ac_saved_libs
-
- # TIP #509
- AC_CHECK_DECLS([PTHREAD_MUTEX_RECURSIVE],tcl_ok=yes,tcl_ok=no, [[#include <pthread.h>]])
])
#--------------------------------------------------------------------
@@ -2295,18 +2703,19 @@ AC_DEFUN([SC_TCL_LINK_LIBS], [
# Might define the following vars:
# _ISOC99_SOURCE
# _LARGEFILE64_SOURCE
+# _LARGEFILE_SOURCE64
#
#--------------------------------------------------------------------
AC_DEFUN([SC_TCL_EARLY_FLAG],[
AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])],
- [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[[#define ]$1[ ]m4_default([$4],[1])[
-]$2]], [[$3]])],
- [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
- [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)]))
+ AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,
+ AC_TRY_COMPILE([[#define ]$1[ 1
+]$2], $3,
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)))
if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
- AC_DEFINE($1, m4_default([$4],[1]), [Add the ]$1[ flag when building])
+ AC_DEFINE($1, 1, [Add the ]$1[ flag when building])
tcl_flags="$tcl_flags $1"
fi
])
@@ -2318,6 +2727,8 @@ AC_DEFUN([SC_TCL_EARLY_FLAGS],[
[char *p = (char *)strtoll; char *q = (char *)strtoull;])
SC_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include <sys/stat.h>],
[struct stat64 buf; int i = stat64("/", &buf);])
+ SC_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include <sys/stat.h>],
+ [char *p = (char *)open64;])
if test "x${tcl_flags}" = "x" ; then
AC_MSG_RESULT([none])
else
@@ -2337,49 +2748,47 @@ AC_DEFUN([SC_TCL_EARLY_FLAGS],[
#
# Might define the following vars:
# TCL_WIDE_INT_IS_LONG
-# HAVE_STRUCT_DIRENT64, HAVE_DIR64
+# TCL_WIDE_INT_TYPE
+# HAVE_STRUCT_DIRENT64
# HAVE_STRUCT_STAT64
# HAVE_TYPE_OFF64_T
#
#--------------------------------------------------------------------
AC_DEFUN([SC_TCL_64BIT_FLAGS], [
- AC_MSG_CHECKING([if 'long' and 'long long' have the same size (64-bit)?])
+ AC_MSG_CHECKING([for 64-bit integer type])
AC_CACHE_VAL(tcl_cv_type_64bit,[
tcl_cv_type_64bit=none
- # See if we could use long anyway Note that we substitute in the
+ # See if the compiler knows natively about __int64
+ AC_TRY_COMPILE(,[__int64 value = (__int64) 0;],
+ tcl_type_64bit=__int64, tcl_type_64bit="long long")
+ # See if we should use long anyway Note that we substitute in the
# type that is our current guess for a 64-bit type inside this check
# program, so it should be modified only carefully...
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[switch (0) {
- case 1: case (sizeof(long long)==sizeof(long)): ;
- }]])],[tcl_cv_type_64bit="long long"],[])])
+ AC_TRY_COMPILE(,[switch (0) {
+ case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ;
+ }],tcl_cv_type_64bit=${tcl_type_64bit})])
if test "${tcl_cv_type_64bit}" = none ; then
- AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Do 'long' and 'long long' have the same size (64-bit)?])
- AC_MSG_RESULT([yes])
+ AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?])
+ AC_MSG_RESULT([using long])
else
- AC_MSG_RESULT([no])
+ AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit},
+ [What type should be used to define wide integers?])
+ AC_MSG_RESULT([${tcl_cv_type_64bit}])
+
# Now check for auxiliary declarations
AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
-#include <dirent.h>]], [[struct dirent64 p;]])],
- [tcl_cv_struct_dirent64=yes],[tcl_cv_struct_dirent64=no])])
+ AC_TRY_COMPILE([#include <sys/types.h>
+#include <dirent.h>],[struct dirent64 p;],
+ tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)])
if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in <sys/types.h>?])
fi
- AC_CACHE_CHECK([for DIR64], tcl_cv_DIR64,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
-#include <dirent.h>]], [[struct dirent64 *p; DIR64 d = opendir64(".");
- p = readdir64(d); rewinddir64(d); closedir64(d);]])],
- [tcl_cv_DIR64=yes], [tcl_cv_DIR64=no])])
- if test "x${tcl_cv_DIR64}" = "xyes" ; then
- AC_DEFINE(HAVE_DIR64, 1, [Is 'DIR64' in <sys/types.h>?])
- fi
-
AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[struct stat64 p;
-]])],
- [tcl_cv_struct_stat64=yes], [tcl_cv_struct_stat64=no])])
+ AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
+],
+ tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)])
if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in <sys/stat.h>?])
fi
@@ -2387,9 +2796,9 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [
AC_CHECK_FUNCS(open64 lseek64)
AC_MSG_CHECKING([for off64_t])
AC_CACHE_VAL(tcl_cv_type_off64_t,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]], [[off64_t offset;
-]])],
- [tcl_cv_type_off64_t=yes], [tcl_cv_type_off64_t=no])])
+ AC_TRY_COMPILE([#include <sys/types.h>],[off64_t offset;
+],
+ tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)])
dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the
dnl functions lseek64 and open64 are defined.
if test "x${tcl_cv_type_off64_t}" = "xyes" && \
@@ -2422,15 +2831,15 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [
AC_DEFUN([SC_TCL_CFG_ENCODING], [
AC_ARG_WITH(encoding,
- AS_HELP_STRING([--with-encoding],
- [encoding for configuration values (default: utf-8)]),
- [with_tcencoding=${withval}])
+ AC_HELP_STRING([--with-encoding],
+ [encoding for configuration values (default: iso8859-1)]),
+ with_tcencoding=${withval})
if test x"${with_tcencoding}" != x ; then
AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}",
[What encoding should be used for embedded configuration info?])
else
- AC_DEFINE(TCL_CFGVAL_ENCODING,"utf-8",
+ AC_DEFINE(TCL_CFGVAL_ENCODING,"iso8859-1",
[What encoding should be used for embedded configuration info?])
fi
])
@@ -2445,7 +2854,7 @@ AC_DEFUN([SC_TCL_CFG_ENCODING], [
# advancedTest - the advanced test to run if the function is present
#
# Results:
-# Might cause compatibility versions of the function to be used.
+# Might cause compatability versions of the function to be used.
# Might affect the following vars:
# USE_COMPAT (implicit)
#
@@ -2455,11 +2864,8 @@ AC_DEFUN([SC_TCL_CHECK_BROKEN_FUNC],[
AC_CHECK_FUNC($1, tcl_ok=1, tcl_ok=0)
if test ["$tcl_ok"] = 1; then
AC_CACHE_CHECK([proper ]$1[ implementation], [tcl_cv_]$1[_unbroken],
- AC_RUN_IFELSE([AC_LANG_SOURCE([[[
-#include <stdlib.h>
-#include <string.h>
-int main() {]$2[}]]])],[tcl_cv_$1_unbroken=ok],
- [tcl_cv_$1_unbroken=broken],[tcl_cv_$1_unbroken=unknown]))
+ AC_TRY_RUN([[int main() {]$2[}]],[tcl_cv_]$1[_unbroken]=ok,
+ [tcl_cv_]$1[_unbroken]=broken,[tcl_cv_]$1[_unbroken]=unknown))
if test ["$tcl_cv_]$1[_unbroken"] = "ok"; then
tcl_ok=1
else
@@ -2489,24 +2895,11 @@ int main() {]$2[}]]])],[tcl_cv_$1_unbroken=ok],
#
#--------------------------------------------------------------------
-AC_DEFUN([SC_TCL_GETHOSTBYADDR_R], [
- # Avoids picking hidden internal symbol from libc
- SC_TCL_GETHOSTBYADDR_R_DECL
-
- if test "$tcl_cv_api_gethostbyaddr_r" = yes; then
- SC_TCL_GETHOSTBYADDR_R_TYPE
- fi
-])
-
-AC_DEFUN([SC_TCL_GETHOSTBYADDR_R_DECL], [AC_CHECK_DECLS(gethostbyaddr_r, [
- tcl_cv_api_gethostbyaddr_r=yes],[tcl_cv_api_gethostbyaddr_r=no],[#include <netdb.h>])
-])
-
-AC_DEFUN([SC_TCL_GETHOSTBYADDR_R_TYPE], [AC_CHECK_FUNC(gethostbyaddr_r, [
+AC_DEFUN([SC_TCL_GETHOSTBYADDR_R], [AC_CHECK_FUNC(gethostbyaddr_r, [
AC_CACHE_CHECK([for gethostbyaddr_r with 7 args], tcl_cv_api_gethostbyaddr_r_7, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#include <netdb.h>
- ]], [[
+ ], [
char *addr;
int length;
int type;
@@ -2517,16 +2910,16 @@ AC_DEFUN([SC_TCL_GETHOSTBYADDR_R_TYPE], [AC_CHECK_FUNC(gethostbyaddr_r, [
(void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
&h_errnop);
- ]])],[tcl_cv_api_gethostbyaddr_r_7=yes],[tcl_cv_api_gethostbyaddr_r_7=no])])
+ ], tcl_cv_api_gethostbyaddr_r_7=yes, tcl_cv_api_gethostbyaddr_r_7=no)])
tcl_ok=$tcl_cv_api_gethostbyaddr_r_7
if test "$tcl_ok" = yes; then
AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1,
[Define to 1 if gethostbyaddr_r takes 7 args.])
else
AC_CACHE_CHECK([for gethostbyaddr_r with 8 args], tcl_cv_api_gethostbyaddr_r_8, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#include <netdb.h>
- ]], [[
+ ], [
char *addr;
int length;
int type;
@@ -2537,7 +2930,7 @@ AC_DEFUN([SC_TCL_GETHOSTBYADDR_R_TYPE], [AC_CHECK_FUNC(gethostbyaddr_r, [
(void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
&resultp, &h_errnop);
- ]])],[tcl_cv_api_gethostbyaddr_r_8=yes],[tcl_cv_api_gethostbyaddr_r_8=no])])
+ ], tcl_cv_api_gethostbyaddr_r_8=yes, tcl_cv_api_gethostbyaddr_r_8=no)])
tcl_ok=$tcl_cv_api_gethostbyaddr_r_8
if test "$tcl_ok" = yes; then
AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1,
@@ -2563,31 +2956,18 @@ AC_DEFUN([SC_TCL_GETHOSTBYADDR_R_TYPE], [AC_CHECK_FUNC(gethostbyaddr_r, [
# Results:
#
# Might define the following vars:
-# HAVE_GETHOSTBYNAME_R
-# HAVE_GETHOSTBYNAME_R_3
-# HAVE_GETHOSTBYNAME_R_5
-# HAVE_GETHOSTBYNAME_R_6
+# HAVE_GETHOSTBYADDR_R
+# HAVE_GETHOSTBYADDR_R_3
+# HAVE_GETHOSTBYADDR_R_5
+# HAVE_GETHOSTBYADDR_R_6
#
#--------------------------------------------------------------------
-AC_DEFUN([SC_TCL_GETHOSTBYNAME_R], [
- # Avoids picking hidden internal symbol from libc
- SC_TCL_GETHOSTBYNAME_R_DECL
-
- if test "$tcl_cv_api_gethostbyname_r" = yes; then
- SC_TCL_GETHOSTBYNAME_R_TYPE
- fi
-])
-
-AC_DEFUN([SC_TCL_GETHOSTBYNAME_R_DECL], [AC_CHECK_DECLS(gethostbyname_r, [
- tcl_cv_api_gethostbyname_r=yes],[tcl_cv_api_gethostbyname_r=no],[#include <netdb.h>])
-])
-
-AC_DEFUN([SC_TCL_GETHOSTBYNAME_R_TYPE], [AC_CHECK_FUNC(gethostbyname_r, [
+AC_DEFUN([SC_TCL_GETHOSTBYNAME_R], [AC_CHECK_FUNC(gethostbyname_r, [
AC_CACHE_CHECK([for gethostbyname_r with 6 args], tcl_cv_api_gethostbyname_r_6, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#include <netdb.h>
- ]], [[
+ ], [
char *name;
struct hostent *he, *res;
char buffer[2048];
@@ -2595,16 +2975,16 @@ AC_DEFUN([SC_TCL_GETHOSTBYNAME_R_TYPE], [AC_CHECK_FUNC(gethostbyname_r, [
int h_errnop;
(void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop);
- ]])],[tcl_cv_api_gethostbyname_r_6=yes],[tcl_cv_api_gethostbyname_r_6=no])])
+ ], tcl_cv_api_gethostbyname_r_6=yes, tcl_cv_api_gethostbyname_r_6=no)])
tcl_ok=$tcl_cv_api_gethostbyname_r_6
if test "$tcl_ok" = yes; then
AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1,
[Define to 1 if gethostbyname_r takes 6 args.])
else
AC_CACHE_CHECK([for gethostbyname_r with 5 args], tcl_cv_api_gethostbyname_r_5, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#include <netdb.h>
- ]], [[
+ ], [
char *name;
struct hostent *he;
char buffer[2048];
@@ -2612,22 +2992,22 @@ AC_DEFUN([SC_TCL_GETHOSTBYNAME_R_TYPE], [AC_CHECK_FUNC(gethostbyname_r, [
int h_errnop;
(void) gethostbyname_r(name, he, buffer, buflen, &h_errnop);
- ]])],[tcl_cv_api_gethostbyname_r_5=yes],[tcl_cv_api_gethostbyname_r_5=no])])
+ ], tcl_cv_api_gethostbyname_r_5=yes, tcl_cv_api_gethostbyname_r_5=no)])
tcl_ok=$tcl_cv_api_gethostbyname_r_5
if test "$tcl_ok" = yes; then
AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1,
[Define to 1 if gethostbyname_r takes 5 args.])
else
AC_CACHE_CHECK([for gethostbyname_r with 3 args], tcl_cv_api_gethostbyname_r_3, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#include <netdb.h>
- ]], [[
+ ], [
char *name;
struct hostent *he;
struct hostent_data data;
(void) gethostbyname_r(name, he, &data);
- ]])],[tcl_cv_api_gethostbyname_r_3=yes],[tcl_cv_api_gethostbyname_r_3=no])])
+ ], tcl_cv_api_gethostbyname_r_3=yes, tcl_cv_api_gethostbyname_r_3=no)])
tcl_ok=$tcl_cv_api_gethostbyname_r_3
if test "$tcl_ok" = yes; then
AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1,
@@ -2642,6 +3022,37 @@ AC_DEFUN([SC_TCL_GETHOSTBYNAME_R_TYPE], [AC_CHECK_FUNC(gethostbyname_r, [
])])
#--------------------------------------------------------------------
+# SC_TCL_GETADDRINFO
+#
+# Check if we have 'getaddrinfo'
+#
+# Arguments:
+# None
+#
+# Results:
+# Might define the following vars:
+# HAVE_GETADDRINFO
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_TCL_GETADDRINFO], [AC_CHECK_FUNC(getaddrinfo, [
+ AC_CACHE_CHECK([for working getaddrinfo], tcl_cv_api_getaddrinfo, [
+ AC_TRY_COMPILE([
+ #include <netdb.h>
+ ], [
+ const char *name, *port;
+ struct addrinfo *aiPtr, hints;
+ (void)getaddrinfo(name,port, &hints, &aiPtr);
+ (void)freeaddrinfo(aiPtr);
+ ], tcl_cv_api_getaddrinfo=yes, tcl_cv_getaddrinfo=no)])
+ tcl_ok=$tcl_cv_api_getaddrinfo
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETADDRINFO, 1,
+ [Define to 1 if getaddrinfo is available.])
+ fi
+])])
+
+#--------------------------------------------------------------------
# SC_TCL_GETPWUID_R
#
# Check if we have MT-safe variant of getpwuid() and if yes,
@@ -2661,34 +3072,34 @@ AC_DEFUN([SC_TCL_GETHOSTBYNAME_R_TYPE], [AC_CHECK_FUNC(gethostbyname_r, [
AC_DEFUN([SC_TCL_GETPWUID_R], [AC_CHECK_FUNC(getpwuid_r, [
AC_CACHE_CHECK([for getpwuid_r with 5 args], tcl_cv_api_getpwuid_r_5, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#include <sys/types.h>
#include <pwd.h>
- ]], [[
+ ], [
uid_t uid;
struct passwd pw, *pwp;
char buf[512];
int buflen = 512;
(void) getpwuid_r(uid, &pw, buf, buflen, &pwp);
- ]])],[tcl_cv_api_getpwuid_r_5=yes],[tcl_cv_api_getpwuid_r_5=no])])
+ ], tcl_cv_api_getpwuid_r_5=yes, tcl_cv_api_getpwuid_r_5=no)])
tcl_ok=$tcl_cv_api_getpwuid_r_5
if test "$tcl_ok" = yes; then
AC_DEFINE(HAVE_GETPWUID_R_5, 1,
[Define to 1 if getpwuid_r takes 5 args.])
else
AC_CACHE_CHECK([for getpwuid_r with 4 args], tcl_cv_api_getpwuid_r_4, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#include <sys/types.h>
#include <pwd.h>
- ]], [[
+ ], [
uid_t uid;
struct passwd pw;
char buf[512];
int buflen = 512;
(void)getpwnam_r(uid, &pw, buf, buflen);
- ]])],[tcl_cv_api_getpwuid_r_4=yes],[tcl_cv_api_getpwuid_r_4=no])])
+ ], tcl_cv_api_getpwuid_r_4=yes, tcl_cv_api_getpwuid_r_4=no)])
tcl_ok=$tcl_cv_api_getpwuid_r_4
if test "$tcl_ok" = yes; then
AC_DEFINE(HAVE_GETPWUID_R_4, 1,
@@ -2721,34 +3132,34 @@ AC_DEFUN([SC_TCL_GETPWUID_R], [AC_CHECK_FUNC(getpwuid_r, [
AC_DEFUN([SC_TCL_GETPWNAM_R], [AC_CHECK_FUNC(getpwnam_r, [
AC_CACHE_CHECK([for getpwnam_r with 5 args], tcl_cv_api_getpwnam_r_5, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#include <sys/types.h>
#include <pwd.h>
- ]], [[
+ ], [
char *name;
struct passwd pw, *pwp;
char buf[512];
int buflen = 512;
(void) getpwnam_r(name, &pw, buf, buflen, &pwp);
- ]])],[tcl_cv_api_getpwnam_r_5=yes],[tcl_cv_api_getpwnam_r_5=no])])
+ ], tcl_cv_api_getpwnam_r_5=yes, tcl_cv_api_getpwnam_r_5=no)])
tcl_ok=$tcl_cv_api_getpwnam_r_5
if test "$tcl_ok" = yes; then
AC_DEFINE(HAVE_GETPWNAM_R_5, 1,
[Define to 1 if getpwnam_r takes 5 args.])
else
AC_CACHE_CHECK([for getpwnam_r with 4 args], tcl_cv_api_getpwnam_r_4, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#include <sys/types.h>
#include <pwd.h>
- ]], [[
+ ], [
char *name;
struct passwd pw;
char buf[512];
int buflen = 512;
(void)getpwnam_r(name, &pw, buf, buflen);
- ]])],[tcl_cv_api_getpwnam_r_4=yes],[tcl_cv_api_getpwnam_r_4=no])])
+ ], tcl_cv_api_getpwnam_r_4=yes, tcl_cv_api_getpwnam_r_4=no)])
tcl_ok=$tcl_cv_api_getpwnam_r_4
if test "$tcl_ok" = yes; then
AC_DEFINE(HAVE_GETPWNAM_R_4, 1,
@@ -2781,34 +3192,34 @@ AC_DEFUN([SC_TCL_GETPWNAM_R], [AC_CHECK_FUNC(getpwnam_r, [
AC_DEFUN([SC_TCL_GETGRGID_R], [AC_CHECK_FUNC(getgrgid_r, [
AC_CACHE_CHECK([for getgrgid_r with 5 args], tcl_cv_api_getgrgid_r_5, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#include <sys/types.h>
#include <grp.h>
- ]], [[
+ ], [
gid_t gid;
struct group gr, *grp;
char buf[512];
int buflen = 512;
(void) getgrgid_r(gid, &gr, buf, buflen, &grp);
- ]])],[tcl_cv_api_getgrgid_r_5=yes],[tcl_cv_api_getgrgid_r_5=no])])
+ ], tcl_cv_api_getgrgid_r_5=yes, tcl_cv_api_getgrgid_r_5=no)])
tcl_ok=$tcl_cv_api_getgrgid_r_5
if test "$tcl_ok" = yes; then
AC_DEFINE(HAVE_GETGRGID_R_5, 1,
[Define to 1 if getgrgid_r takes 5 args.])
else
AC_CACHE_CHECK([for getgrgid_r with 4 args], tcl_cv_api_getgrgid_r_4, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#include <sys/types.h>
#include <grp.h>
- ]], [[
+ ], [
gid_t gid;
struct group gr;
char buf[512];
int buflen = 512;
(void)getgrgid_r(gid, &gr, buf, buflen);
- ]])],[tcl_cv_api_getgrgid_r_4=yes],[tcl_cv_api_getgrgid_r_4=no])])
+ ], tcl_cv_api_getgrgid_r_4=yes, tcl_cv_api_getgrgid_r_4=no)])
tcl_ok=$tcl_cv_api_getgrgid_r_4
if test "$tcl_ok" = yes; then
AC_DEFINE(HAVE_GETGRGID_R_4, 1,
@@ -2841,34 +3252,34 @@ AC_DEFUN([SC_TCL_GETGRGID_R], [AC_CHECK_FUNC(getgrgid_r, [
AC_DEFUN([SC_TCL_GETGRNAM_R], [AC_CHECK_FUNC(getgrnam_r, [
AC_CACHE_CHECK([for getgrnam_r with 5 args], tcl_cv_api_getgrnam_r_5, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#include <sys/types.h>
#include <grp.h>
- ]], [[
+ ], [
char *name;
struct group gr, *grp;
char buf[512];
int buflen = 512;
(void) getgrnam_r(name, &gr, buf, buflen, &grp);
- ]])],[tcl_cv_api_getgrnam_r_5=yes],[tcl_cv_api_getgrnam_r_5=no])])
+ ], tcl_cv_api_getgrnam_r_5=yes, tcl_cv_api_getgrnam_r_5=no)])
tcl_ok=$tcl_cv_api_getgrnam_r_5
if test "$tcl_ok" = yes; then
AC_DEFINE(HAVE_GETGRNAM_R_5, 1,
[Define to 1 if getgrnam_r takes 5 args.])
else
AC_CACHE_CHECK([for getgrnam_r with 4 args], tcl_cv_api_getgrnam_r_4, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#include <sys/types.h>
#include <grp.h>
- ]], [[
+ ], [
char *name;
struct group gr;
char buf[512];
int buflen = 512;
(void)getgrnam_r(name, &gr, buf, buflen);
- ]])],[tcl_cv_api_getgrnam_r_4=yes],[tcl_cv_api_getgrnam_r_4=no])])
+ ], tcl_cv_api_getgrnam_r_4=yes, tcl_cv_api_getgrnam_r_4=no)])
tcl_ok=$tcl_cv_api_getgrnam_r_4
if test "$tcl_ok" = yes; then
AC_DEFINE(HAVE_GETGRNAM_R_4, 1,
@@ -2881,172 +3292,6 @@ AC_DEFUN([SC_TCL_GETGRNAM_R], [AC_CHECK_FUNC(getgrnam_r, [
fi
])])
-AC_DEFUN([SC_TCL_IPV6],[
- NEED_FAKE_RFC2553=0
- AC_CHECK_FUNCS(getnameinfo getaddrinfo freeaddrinfo gai_strerror,,[NEED_FAKE_RFC2553=1])
- AC_CHECK_TYPES([
- struct addrinfo,
- struct in6_addr,
- struct sockaddr_in6,
- struct sockaddr_storage],,[NEED_FAKE_RFC2553=1],[[
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-]])
-if test "x$NEED_FAKE_RFC2553" = "x1"; then
- AC_DEFINE([NEED_FAKE_RFC2553], 1,
- [Use compat implementation of getaddrinfo() and friends])
- AC_LIBOBJ([fake-rfc2553])
- AC_CHECK_FUNC(strlcpy)
-fi
-])
-
-#------------------------------------------------------------------------
-# SC_CC_FOR_BUILD
-# For cross compiles, locate a C compiler that can generate native binaries.
-#
-# Arguments:
-# none
-#
-# Results:
-# Substitutes the following vars:
-# CC_FOR_BUILD
-# EXEEXT_FOR_BUILD
-#------------------------------------------------------------------------
-
-dnl Get a default for CC_FOR_BUILD to put into Makefile.
-AC_DEFUN([AX_CC_FOR_BUILD],[# Put a plausible default for CC_FOR_BUILD in Makefile.
- if test -z "$CC_FOR_BUILD"; then
- if test "x$cross_compiling" = "xno"; then
- CC_FOR_BUILD='$(CC)'
- else
- AC_MSG_CHECKING([for gcc])
- AC_CACHE_VAL(ac_cv_path_cc, [
- search_path=`echo ${PATH} | sed -e 's/:/ /g'`
- for dir in $search_path ; do
- for j in `ls -r $dir/gcc 2> /dev/null` \
- `ls -r $dir/gcc 2> /dev/null` ; do
- if test x"$ac_cv_path_cc" = x ; then
- if test -f "$j" ; then
- ac_cv_path_cc=$j
- break
- fi
- fi
- done
- done
- ])
- fi
- fi
- AC_SUBST(CC_FOR_BUILD)
- # Also set EXEEXT_FOR_BUILD.
- if test "x$cross_compiling" = "xno"; then
- EXEEXT_FOR_BUILD='$(EXEEXT)'
- OBJEXT_FOR_BUILD='$(OBJEXT)'
- else
- OBJEXT_FOR_BUILD='.no'
- AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
- [rm -f conftest*
- echo 'int main () { return 0; }' > conftest.c
- bfd_cv_build_exeext=
- ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
- for file in conftest.*; do
- case $file in
- *.c | *.o | *.obj | *.ilk | *.pdb) ;;
- *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
- esac
- done
- rm -f conftest*
- test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
- EXEEXT_FOR_BUILD=""
- test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
- fi
- AC_SUBST(EXEEXT_FOR_BUILD)])dnl
- AC_SUBST(OBJEXT_FOR_BUILD)])dnl
-])
-
-
-#------------------------------------------------------------------------
-# SC_ZIPFS_SUPPORT
-# Locate a zip encoder installed on the system path, or none.
-#
-# Arguments:
-# none
-#
-# Results:
-# Substitutes the following vars:
-# MACHER_PROG
-# ZIP_PROG
-# ZIP_PROG_OPTIONS
-# ZIP_PROG_VFSSEARCH
-# ZIP_INSTALL_OBJS
-#------------------------------------------------------------------------
-
-AC_DEFUN([SC_ZIPFS_SUPPORT], [
- MACHER_PROG=""
- ZIP_PROG=""
- ZIP_PROG_OPTIONS=""
- ZIP_PROG_VFSSEARCH=""
- ZIP_INSTALL_OBJS=""
-
- AC_MSG_CHECKING([for macher])
- AC_CACHE_VAL(ac_cv_path_macher, [
- search_path=`echo ${PATH} | sed -e 's/:/ /g'`
- for dir in $search_path ; do
- for j in `ls -r $dir/macher 2> /dev/null` \
- `ls -r $dir/macher 2> /dev/null` ; do
- if test x"$ac_cv_path_macher" = x ; then
- if test -f "$j" ; then
- ac_cv_path_macher=$j
- break
- fi
- fi
- done
- done
- ])
- if test -f "$ac_cv_path_macher" ; then
- MACHER_PROG="$ac_cv_path_macher"
- AC_MSG_RESULT([$MACHER_PROG])
- AC_MSG_RESULT([Found macher in environment])
- fi
- AC_MSG_CHECKING([for zip])
- AC_CACHE_VAL(ac_cv_path_zip, [
- search_path=`echo ${PATH} | sed -e 's/:/ /g'`
- for dir in $search_path ; do
- for j in `ls -r $dir/zip 2> /dev/null` \
- `ls -r $dir/zip 2> /dev/null` ; do
- if test x"$ac_cv_path_zip" = x ; then
- if test -f "$j" ; then
- ac_cv_path_zip=$j
- break
- fi
- fi
- done
- done
- ])
- if test -f "$ac_cv_path_zip" ; then
- ZIP_PROG="$ac_cv_path_zip"
- AC_MSG_RESULT([$ZIP_PROG])
- ZIP_PROG_OPTIONS="-rq"
- ZIP_PROG_VFSSEARCH="*"
- AC_MSG_RESULT([Found INFO Zip in environment])
- # Use standard arguments for zip
- else
- # It is not an error if an installed version of Zip can't be located.
- # We can use the locally distributed minizip instead
- ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}"
- ZIP_PROG_OPTIONS="-o -r"
- ZIP_PROG_VFSSEARCH="*"
- ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}"
- AC_MSG_RESULT([No zip found on PATH. Building minizip])
- fi
- AC_SUBST(MACHER_PROG)
- AC_SUBST(ZIP_PROG)
- AC_SUBST(ZIP_PROG_OPTIONS)
- AC_SUBST(ZIP_PROG_VFSSEARCH)
- AC_SUBST(ZIP_INSTALL_OBJS)
-])
-
# Local Variables:
# mode: autoconf
# End:
diff --git a/unix/tcl.pc.in b/unix/tcl.pc.in
index 9c6da82..b750300 100644
--- a/unix/tcl.pc.in
+++ b/unix/tcl.pc.in
@@ -4,13 +4,11 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
-libfile=@TCL_LIB_FILE@
Name: Tool Command Language
Description: Tcl is a powerful, easy-to-learn dynamic programming language, suitable for a wide range of uses.
-URL: https://www.tcl-lang.org/
+URL: http://www.tcl.tk/
Version: @TCL_VERSION@@TCL_PATCH_LEVEL@
-Requires.private: @TCL_PC_REQUIRES_PRIVATE@ zlib >= 1.2.3
-Libs: -L${libdir} @TCL_LIB_FLAG@ @TCL_STUB_LIB_FLAG@
+Libs: -L${libdir} @TCL_LIB_FLAG@
Libs.private: @TCL_LIBS@
-Cflags: -I${includedir} @TCL_PC_CFLAGS@
+Cflags: -I${includedir}
diff --git a/unix/tcl.spec b/unix/tcl.spec
index 1351b38..76ab925 100644
--- a/unix/tcl.spec
+++ b/unix/tcl.spec
@@ -4,12 +4,12 @@
Name: tcl
Summary: Tcl scripting language development environment
-Version: 8.7b1
+Version: 8.5.18
Release: 2
License: BSD
Group: Development/Languages
Source: http://prdownloads.sourceforge.net/tcl/tcl%{version}-src.tar.gz
-URL: https://www.tcl-lang.org/
+URL: http://www.tcl.tk/
Buildroot: /var/tmp/%{name}%{version}
%description
diff --git a/unix/tclAppInit.c b/unix/tclAppInit.c
index 04ae564..dac782b 100644
--- a/unix/tclAppInit.c
+++ b/unix/tclAppInit.c
@@ -2,60 +2,32 @@
* tclAppInit.c --
*
* Provides a default version of the main program and Tcl_AppInit
- * procedure for tclsh and other Tcl-based applications (without Tk).
+ * function for Tcl applications (without Tk).
*
* Copyright (c) 1993 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
- * Copyright (c) 1998-1999 Scriptics Corporation.
+ * Copyright (c) 1998-1999 by Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tcl.h"
-#if TCL_MAJOR_VERSION < 9
-# if defined(USE_TCL_STUBS)
-# error "Don't build with USE_TCL_STUBS!"
-# endif
-# if TCL_MINOR_VERSION < 7
-# define Tcl_LibraryInitProc Tcl_PackageInitProc
-# define Tcl_StaticLibrary Tcl_StaticPackage
-# endif
-#endif
#ifdef TCL_TEST
-extern Tcl_LibraryInitProc Tcltest_Init;
-extern Tcl_LibraryInitProc Tcltest_SafeInit;
-#endif /* TCL_TEST */
-#ifdef TCL_XT_TEST
-extern void XtToolkitInitialize(void);
-extern Tcl_LibraryInitProc Tclxttest_Init;
-#endif /* TCL_XT_TEST */
+#include "tclInt.h"
-/*
- * The following #if block allows you to change the AppInit function by using
- * a #define of TCL_LOCAL_APPINIT instead of rewriting this entire file. The
- * #if checks for that #define and uses Tcl_AppInit if it does not exist.
- */
-
-#ifndef TCL_LOCAL_APPINIT
-#define TCL_LOCAL_APPINIT Tcl_AppInit
-#endif
-#ifndef MODULE_SCOPE
-# define MODULE_SCOPE extern
-#endif
-MODULE_SCOPE int TCL_LOCAL_APPINIT(Tcl_Interp *);
-MODULE_SCOPE int main(int, char **);
+extern Tcl_PackageInitProc Procbodytest_Init;
+extern Tcl_PackageInitProc Procbodytest_SafeInit;
+extern Tcl_PackageInitProc TclObjTest_Init;
+extern Tcl_PackageInitProc Tcltest_Init;
-/*
- * The following #if block allows you to change how Tcl finds the startup
- * script, prime the library or encoding paths, fiddle with the argv, etc.,
- * without needing to rewrite Tcl_Main()
- */
+#endif /* TCL_TEST */
-#ifdef TCL_LOCAL_MAIN_HOOK
-MODULE_SCOPE int TCL_LOCAL_MAIN_HOOK(int *argc, char ***argv);
+#ifdef TCL_XT_TEST
+extern void XtToolkitInitialize (void);
+extern int Tclxttest_Init (Tcl_Interp *interp);
#endif
/*
@@ -66,11 +38,11 @@ MODULE_SCOPE int TCL_LOCAL_MAIN_HOOK(int *argc, char ***argv);
* This is the main program for the application.
*
* Results:
- * None: Tcl_Main never returns here, so this procedure never returns
+ * None: Tcl_Main never returns here, so this function never returns
* either.
*
* Side effects:
- * Just about anything, since from here we call arbitrary Tcl code.
+ * Whatever the application does.
*
*----------------------------------------------------------------------
*/
@@ -78,20 +50,40 @@ MODULE_SCOPE int TCL_LOCAL_MAIN_HOOK(int *argc, char ***argv);
int
main(
int argc, /* Number of command-line arguments. */
- char *argv[]) /* Values of command-line arguments. */
+ char **argv) /* Values of command-line arguments. */
{
+ /*
+ * The following #if block allows you to change the AppInit function by
+ * using a #define of TCL_LOCAL_APPINIT instead of rewriting this entire
+ * file. The #if checks for that #define and uses Tcl_AppInit if it does
+ * not exist.
+ */
+
+#ifndef TCL_LOCAL_APPINIT
+#define TCL_LOCAL_APPINIT Tcl_AppInit
+#endif
+ extern int TCL_LOCAL_APPINIT (Tcl_Interp *interp);
+
+ /*
+ * The following #if block allows you to change how Tcl finds the startup
+ * script, prime the library or encoding paths, fiddle with the argv,
+ * etc., without needing to rewrite Tcl_Main()
+ */
+
+#ifdef TCL_LOCAL_MAIN_HOOK
+ extern int TCL_LOCAL_MAIN_HOOK (int *argc, char ***argv);
+#endif
+
#ifdef TCL_XT_TEST
XtToolkitInitialize();
#endif
#ifdef TCL_LOCAL_MAIN_HOOK
TCL_LOCAL_MAIN_HOOK(&argc, &argv);
-#elif (TCL_MAJOR_VERSION > 8 || TCL_MINOR_VERSION > 6) && (!defined(_WIN32) || defined(UNICODE))
- /* New in Tcl 8.7. This doesn't work on Windows without UNICODE */
- TclZipfs_AppHook(&argc, &argv);
#endif
Tcl_Main(argc, argv, TCL_LOCAL_APPINIT);
+
return 0; /* Needed only to prevent compiler warning. */
}
@@ -100,9 +92,9 @@ main(
*
* Tcl_AppInit --
*
- * This procedure performs application-specific initialization. Most
+ * This function performs application-specific initialization. Most
* applications, especially those that incorporate additional packages,
- * will have their own version of this procedure.
+ * will have their own version of this function.
*
* Results:
* Returns a standard Tcl completion code, and leaves an error message in
@@ -122,21 +114,29 @@ Tcl_AppInit(
return TCL_ERROR;
}
+#ifdef TCL_TEST
#ifdef TCL_XT_TEST
if (Tclxttest_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
#endif
-
-#ifdef TCL_TEST
if (Tcltest_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
- Tcl_StaticLibrary(interp, "Tcltest", Tcltest_Init, Tcltest_SafeInit);
+ Tcl_StaticPackage(interp, "Tcltest", Tcltest_Init,
+ (Tcl_PackageInitProc *) NULL);
+ if (TclObjTest_Init(interp) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ if (Procbodytest_Init(interp) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ Tcl_StaticPackage(interp, "procbodytest", Procbodytest_Init,
+ Procbodytest_SafeInit);
#endif /* TCL_TEST */
/*
- * Call the init procedures for included packages. Each call should look
+ * Call the init functions for included packages. Each call should look
* like this:
*
* if (Mod_Init(interp) == TCL_ERROR) {
@@ -148,23 +148,21 @@ Tcl_AppInit(
*/
/*
- * Call Tcl_CreateObjCommand for application-specific commands, if they
- * weren't already created by the init procedures called above.
+ * Call Tcl_CreateCommand for application-specific commands, if they
+ * weren't already created by the init functions called above.
*/
/*
* Specify a user-specific startup file to invoke if the application is
* run interactively. Typically the startup file is "~/.apprc" where "app"
- * is the name of the application. If this line is deleted then no
- * user-specific startup file will be run under any conditions.
+ * is the name of the application. If this line is deleted then no user-
+ * specific startup file will be run under any conditions.
*/
#ifdef DJGPP
- Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_rcFileName", TCL_INDEX_NONE), NULL,
- Tcl_NewStringObj("~/tclsh.rc", TCL_INDEX_NONE), TCL_GLOBAL_ONLY);
+ Tcl_SetVar(interp, "tcl_rcFileName", "~/tclsh.rc", TCL_GLOBAL_ONLY);
#else
- Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_rcFileName", TCL_INDEX_NONE), NULL,
- Tcl_NewStringObj("~/.tclshrc", TCL_INDEX_NONE), TCL_GLOBAL_ONLY);
+ Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY);
#endif
return TCL_OK;
diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in
index cc75c29..710949f 100644
--- a/unix/tclConfig.h.in
+++ b/unix/tclConfig.h.in
@@ -4,25 +4,31 @@
#ifndef _TCLCONFIG
#define _TCLCONFIG
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* Is pthread_attr_get_np() declared in <pthread.h>? */
+#undef ATTRGETNP_NOT_DECLARED
+
+/* Is pthread_getattr_np declared in <pthread.h>? */
+#undef GETATTRNP_NOT_DECLARED
+
/* Is gettimeofday() actually declared in <sys/time.h>? */
#undef GETTOD_NOT_DECLARED
/* Define to 1 if you have the <AvailabilityMacros.h> header file. */
#undef HAVE_AVAILABILITYMACROS_H
-/* Define to 1 if the system has the type 'blkcnt_t'. */
+/* Define to 1 if the system has the type `blkcnt_t'. */
#undef HAVE_BLKCNT_T
/* Defined when compiler supports casting to union type. */
#undef HAVE_CAST_TO_UNION
-/* Define to 1 if you have the 'cfmakeraw' function. */
-#undef HAVE_CFMAKERAW
-
-/* Define to 1 if you have the 'chflags' function. */
+/* Define to 1 if you have the `chflags' function. */
#undef HAVE_CHFLAGS
-/* Define to 1 if you have the 'copyfile' function. */
+/* Define to 1 if you have the `copyfile' function. */
#undef HAVE_COPYFILE
/* Define to 1 if you have the <copyfile.h> header file. */
@@ -34,40 +40,16 @@
/* Is the cpuid instruction usable? */
#undef HAVE_CPUID
-/* Define to 1 if you have the declaration of 'gethostbyaddr_r', and to 0 if
- you don't. */
-#undef HAVE_DECL_GETHOSTBYADDR_R
-
-/* Define to 1 if you have the declaration of 'gethostbyname_r', and to 0 if
- you don't. */
-#undef HAVE_DECL_GETHOSTBYNAME_R
-
-/* Define to 1 if you have the declaration of 'PTHREAD_MUTEX_RECURSIVE', and
- to 0 if you don't. */
-#undef HAVE_DECL_PTHREAD_MUTEX_RECURSIVE
-
-/* Is 'DIR64' in <sys/types.h>? */
-#undef HAVE_DIR64
-
-/* Is eventfd(2) supported? */
-#undef HAVE_EVENTFD
-
-/* Define to 1 if you have the 'freeaddrinfo' function. */
-#undef HAVE_FREEADDRINFO
-
/* Do we have fts functions? */
#undef HAVE_FTS
-/* Define to 1 if you have the 'gai_strerror' function. */
-#undef HAVE_GAI_STRERROR
-
-/* Define to 1 if you have the 'getaddrinfo' function. */
+/* Define to 1 if getaddrinfo is available. */
#undef HAVE_GETADDRINFO
-/* Define to 1 if you have the 'getattrlist' function. */
+/* Define to 1 if you have the `getattrlist' function. */
#undef HAVE_GETATTRLIST
-/* Define to 1 if you have the 'getcwd' function. */
+/* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD
/* Define to 1 if getgrgid_r is available. */
@@ -109,9 +91,6 @@
/* Define to 1 if gethostbyname_r takes 6 args. */
#undef HAVE_GETHOSTBYNAME_R_6
-/* Define to 1 if you have the 'getnameinfo' function. */
-#undef HAVE_GETNAMEINFO
-
/* Define to 1 if getpwnam_r is available. */
#undef HAVE_GETPWNAM_R
@@ -130,13 +109,10 @@
/* Define to 1 if getpwuid_r takes 5 args. */
#undef HAVE_GETPWUID_R_5
-/* Define to 1 if you have the 'gmtime_r' function. */
+/* Define to 1 if you have the `gmtime_r' function. */
#undef HAVE_GMTIME_R
-/* Compiler support for module scope symbols */
-#undef HAVE_HIDDEN
-
-/* Define to 1 if the system has the type 'intptr_t'. */
+/* Do we have the intptr_t type? */
#undef HAVE_INTPTR_T
/* Define to 1 if you have the <inttypes.h> header file. */
@@ -148,19 +124,19 @@
/* Define to 1 if you have the <libkern/OSAtomic.h> header file. */
#undef HAVE_LIBKERN_OSATOMIC_H
-/* Define to 1 if you have the 'localtime_r' function. */
+/* Do we have <limits.h>? */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the `localtime_r' function. */
#undef HAVE_LOCALTIME_R
-/* Define to 1 if you have the 'lseek64' function. */
+/* Define to 1 if you have the `lseek64' function. */
#undef HAVE_LSEEK64
-/* Define to 1 if you have the 'mkstemp' function. */
-#undef HAVE_MKSTEMP
-
-/* Define to 1 if you have the 'mkstemps' function. */
-#undef HAVE_MKSTEMPS
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
-/* Define to 1 if you have the 'mktime' function. */
+/* Define to 1 if you have the `mktime' function. */
#undef HAVE_MKTIME
/* Do we have MT-safe gethostbyaddr() ? */
@@ -172,29 +148,29 @@
/* Do we have <net/errno.h>? */
#undef HAVE_NET_ERRNO_H
-/* Define to 1 if you have the 'open64' function. */
+/* Define to 1 if you have the `open64' function. */
#undef HAVE_OPEN64
-/* Define to 1 if you have the 'OSSpinLockLock' function. */
-#undef HAVE_OSSPINLOCKLOCK
+/* Define to 1 if you have the `opendir' function. */
+#undef HAVE_OPENDIR
-/* Define to 1 if you have the 'posix_spawnattr_setflags' function. */
-#undef HAVE_POSIX_SPAWNATTR_SETFLAGS
+/* Define to 1 if you have the `OSSpinLockLock' function. */
+#undef HAVE_OSSPINLOCKLOCK
-/* Define to 1 if you have the 'posix_spawnp' function. */
-#undef HAVE_POSIX_SPAWNP
+/* Define to 1 if you have the `pthread_atfork' function. */
+#undef HAVE_PTHREAD_ATFORK
-/* Define to 1 if you have the 'posix_spawn_file_actions_adddup2' function. */
-#undef HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
+/* Do we want a BSD-like thread-attribute interface? */
+#undef HAVE_PTHREAD_ATTR_GET_NP
-/* Should we use pselect()? */
-#undef HAVE_PSELECT
+/* Define to 1 if you have the `pthread_attr_setstacksize' function. */
+#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE
-/* Define to 1 if you have the 'pthread_atfork' function. */
-#undef HAVE_PTHREAD_ATFORK
+/* Do we want a Linux-like thread-attribute interface? */
+#undef HAVE_PTHREAD_GETATTR_NP
-/* Define to 1 if you have the 'pthread_attr_setstacksize' function. */
-#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE
+/* Define to 1 if you have the `pthread_get_stacksize_np' function. */
+#undef HAVE_PTHREAD_GET_STACKSIZE_NP
/* Does putenv() copy strings or incorporate them by reference? */
#undef HAVE_PUTENV_THAT_COPIES
@@ -202,15 +178,9 @@
/* Are characters signed? */
#undef HAVE_SIGNED_CHAR
-/* Do we have <stdbool.h>? */
-#undef HAVE_STDBOOL_H
-
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
-/* Define to 1 if you have the <stdio.h> header file. */
-#undef HAVE_STDIO_H
-
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
@@ -220,42 +190,21 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
-/* Define to 1 if the system has the type 'struct addrinfo'. */
-#undef HAVE_STRUCT_ADDRINFO
+/* Define to 1 if you have the `strtol' function. */
+#undef HAVE_STRTOL
/* Is 'struct dirent64' in <sys/types.h>? */
#undef HAVE_STRUCT_DIRENT64
-/* Define to 1 if the system has the type 'struct in6_addr'. */
-#undef HAVE_STRUCT_IN6_ADDR
-
-/* Define to 1 if the system has the type 'struct sockaddr_in6'. */
-#undef HAVE_STRUCT_SOCKADDR_IN6
-
-/* Define to 1 if the system has the type 'struct sockaddr_storage'. */
-#undef HAVE_STRUCT_SOCKADDR_STORAGE
-
/* Is 'struct stat64' in <sys/stat.h>? */
#undef HAVE_STRUCT_STAT64
-/* Define to 1 if 'st_blksize' is a member of 'struct stat'. */
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
-/* Define to 1 if 'st_blocks' is a member of 'struct stat'. */
+/* Define to 1 if `st_blocks' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLOCKS
-/* Define to 1 if 'st_rdev' is a member of 'struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_RDEV
-
-/* Define to 1 if you have the <sys/epoll.h> header file. */
-#undef HAVE_SYS_EPOLL_H
-
-/* Define to 1 if you have the <sys/eventfd.h> header file. */
-#undef HAVE_SYS_EVENTFD_H
-
-/* Define to 1 if you have the <sys/event.h> header file. */
-#undef HAVE_SYS_EVENT_H
-
/* Define to 1 if you have the <sys/filio.h> header file. */
#undef HAVE_SYS_FILIO_H
@@ -280,9 +229,6 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
-/* Define to 1 if you have the <termios.h> header file. */
-#undef HAVE_TERMIOS_H
-
/* Should we use the global timezone variable? */
#undef HAVE_TIMEZONE_VAR
@@ -295,28 +241,22 @@
/* Is off64_t in <sys/types.h>? */
#undef HAVE_TYPE_OFF64_T
-/* Define to 1 if the system has the type 'uintptr_t'. */
+/* Do we have the uintptr_t type? */
#undef HAVE_UINTPTR_T
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define to 1 if you have the 'vfork' function. */
-#undef HAVE_VFORK
-
-/* Define to 1 if you have the 'waitpid' function. */
+/* Define to 1 if you have the `waitpid' function. */
#undef HAVE_WAITPID
/* Is weak import available? */
#undef HAVE_WEAK_IMPORT
-/* Is there an installed zlib? */
-#undef HAVE_ZLIB
-
/* Is this a Mac I see before me? */
#undef MAC_OSX_TCL
-/* No Compiler support for module scope symbols */
+/* Compiler support for module scope symbols */
#undef MODULE_SCOPE
/* Default libtommath precision. */
@@ -325,26 +265,20 @@
/* Is no debugging enabled? */
#undef NDEBUG
-/* Use compat implementation of getaddrinfo() and friends */
-#undef NEED_FAKE_RFC2553
-
-/* Is epoll(7) supported? */
-#undef NOTIFIER_EPOLL
-
-/* Is kqueue(2) supported? */
-#undef NOTIFIER_KQUEUE
-
/* Is Darwin CoreFoundation unavailable for 64-bit? */
#undef NO_COREFOUNDATION_64
+/* Do we have <dirent.h>? */
+#undef NO_DIRENT_H
+
/* Do we have <dlfcn.h>? */
#undef NO_DLFCN_H
/* Do we have fd_set? */
#undef NO_FD_SET
-/* Do we have fork() */
-#undef NO_FORK
+/* Do we have <float.h>? */
+#undef NO_FLOAT_H
/* Do we have fstatfs()? */
#undef NO_FSTATFS
@@ -355,15 +289,21 @@
/* Do we have getwd() */
#undef NO_GETWD
+/* Do we have a usable 'isnan'? */
+#undef NO_ISNAN
+
+/* Do we have <limits.h>? */
+#undef NO_LIMITS_H
+
/* Do we have memmove()? */
#undef NO_MEMMOVE
-/* Do we have mknod() */
-#undef NO_MKNOD
-
/* Do we have realpath() */
#undef NO_REALPATH
+/* Do we have <stdlib.h>? */
+#undef NO_STDLIB_H
+
/* Do we have strerror() */
#undef NO_STRERROR
@@ -373,15 +313,15 @@
/* Do we have <sys/wait.h>? */
#undef NO_SYS_WAIT_H
-/* Do we have tcdrain() */
-#undef NO_TCDRAIN
-
/* Do we have uname() */
#undef NO_UNAME
/* Do we have a usable 'union wait'? */
#undef NO_UNION_WAIT
+/* Do we have <values.h>? */
+#undef NO_VALUES_H
+
/* Do we have wait3() */
#undef NO_WAIT3
@@ -406,9 +346,7 @@
/* Is this a static build? */
#undef STATIC_BUILD
-/* Define to 1 if all of the C89 standard headers exist (not just the ones
- required in a freestanding environment). This macro is provided for
- backward compatibility; new code need not use it. */
+/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* What encoding should be used for embedded configuration info? */
@@ -426,6 +364,9 @@
/* Are bytecode statistics enabled? */
#undef TCL_COMPILE_STATS
+/* Are we cross-compiling? */
+#undef TCL_CROSS_COMPILE
+
/* Are we to override what our default encoding is? */
#undef TCL_DEFAULT_ENCODING
@@ -441,27 +382,57 @@
/* What is the default extension for shared libraries? */
#undef TCL_SHLIB_EXT
+/* The C stack grows upwards in memory. */
+#undef TCL_STACK_GROWS_UP
+
+/* Are we building with threads enabled? */
+#undef TCL_THREADS
+
+/* Build libtommath? */
+#undef TCL_TOMMATH
+
/* Do we allow unloading of shared libraries? */
#undef TCL_UNLOAD_DLLS
/* Does this platform have wide high-resolution clicks? */
#undef TCL_WIDE_CLICKS
-/* Do 'long' and 'long long' have the same size (64-bit)? */
+/* Are wide integers to be implemented with C 'long's? */
#undef TCL_WIDE_INT_IS_LONG
-/* Tcl with external libtommath */
-#undef TCL_WITH_EXTERNAL_TOMMATH
+/* What type should be used to define wide integers? */
+#undef TCL_WIDE_INT_TYPE
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
/* Is getcwd Posix-compliant? */
#undef USEGETWD
+/* May we include <dirent2.h>? */
+#undef USE_DIRENT2_H
+
/* Are we building with DTrace support? */
#undef USE_DTRACE
/* Should we use FIONBIO? */
#undef USE_FIONBIO
+/* Use the sgtty API for serial lines */
+#undef USE_SGTTY
+
+/* Use the termio API for serial lines */
+#undef USE_TERMIO
+
+/* Use the termios API for serial lines */
+#undef USE_TERMIOS
+
+/* Do we want to use the threaded memory allocator? */
+#undef USE_THREAD_ALLOC
+
+/* Should we use vfork() instead of fork()? */
+#undef USE_VFORK
+
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
@@ -474,9 +445,6 @@
# endif
#endif
-/* Are we building with zipfs enabled? */
-#undef ZIPFS_BUILD
-
/* Are Darwin SUSv3 extensions available? */
#undef _DARWIN_C_SOURCE
@@ -486,6 +454,9 @@
/* Add the _LARGEFILE64_SOURCE flag when building */
#undef _LARGEFILE64_SOURCE
+/* Add the _LARGEFILE_SOURCE64 flag when building */
+#undef _LARGEFILE_SOURCE64
+
/* # needed in sys/socket.h Should OS/390 do the right thing with sockets? */
#undef _OE_SOCKETS
@@ -504,41 +475,48 @@
/* Do we want to use the XOPEN network library? */
#undef _XOPEN_SOURCE_EXTENDED
-/* Define to 1 if type 'char' is unsigned and your compiler does not
- predefine this macro. */
+/* Define to 1 if type `char' is unsigned and you are not using gcc. */
#ifndef __CHAR_UNSIGNED__
# undef __CHAR_UNSIGNED__
#endif
-/* Define as 'int' if <sys/types.h> doesn't define. */
+/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
-/* Define to '__inline__' or '__inline' if that's what the C compiler
+/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
-/* Define to 'int' if <sys/types.h> does not define. */
+/* Signed integer type wide enough to hold a pointer. */
+#undef intptr_t
+
+/* Define to `int' if <sys/types.h> does not define. */
#undef mode_t
-/* Define as a signed integer type capable of holding a process identifier. */
+/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
-/* Define as 'unsigned int' if <stddef.h> doesn't define. */
+/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* Define as int if socklen_t is not available */
#undef socklen_t
-/* Define as 'int' if <sys/types.h> doesn't define. */
+/* Do we want to use the strtod() in compat? */
+#undef strtod
+
+/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
+/* Unsigned integer type wide enough to hold a pointer. */
+#undef uintptr_t
+
/* Undef unused package specific autoheader defines so that we can
* include both tclConfig.h and tkConfig.h at the same time: */
/* override */ #undef PACKAGE_NAME
- /* override */ #undef PACKAGE_TARNAME
- /* override */ #undef PACKAGE_VERSION
/* override */ #undef PACKAGE_STRING
+ /* override */ #undef PACKAGE_TARNAME
#endif /* _TCLCONFIG */
diff --git a/unix/tclConfig.sh.in b/unix/tclConfig.sh.in
index f2ac768..b58e9fd 100644
--- a/unix/tclConfig.sh.in
+++ b/unix/tclConfig.sh.in
@@ -23,8 +23,7 @@ TCL_DEFS='@DEFS@'
# TCL_DBGX used to be used to distinguish debug vs. non-debug builds.
# This was a righteous pain so the core doesn't do that any more.
-# DEPRECATED, will be removed in Tcl 9!
-TCL_DBGX=''
+TCL_DBGX=
# Default flags used in an optimized and debuggable build, respectively.
TCL_CFLAGS_DEBUG='@CFLAGS_DEBUG@'
@@ -40,9 +39,6 @@ TCL_SHARED_BUILD=@TCL_SHARED_BUILD@
# The name of the Tcl library (may be either a .a file or a shared library):
TCL_LIB_FILE='@TCL_LIB_FILE@'
-# The name of a zip containing the /library and /encodings (may be either a .zip file or a shared library):
-TCL_ZIP_FILE='@TCL_ZIP_FILE@'
-
# Additional libraries to use when linking Tcl.
TCL_LIBS='@TCL_LIBS@'
@@ -70,7 +66,7 @@ TCL_SHLIB_LD='@SHLIB_LD@'
TCL_STLIB_LD='@STLIB_LD@'
# Either '$LIBS' (if dependent libraries should be included when linking
-# shared libraries) or an empty string. See Tcl's configure.ac for more
+# shared libraries) or an empty string. See Tcl's configure.in for more
# explanation.
TCL_SHLIB_LD_LIBS='@SHLIB_LD_LIBS@'
@@ -85,7 +81,7 @@ TCL_DL_LIBS='@DL_LIBS@'
# an executable tclsh or tcltest binary.
TCL_LD_FLAGS='@LDFLAGS@'
-# Flags to pass to cc/ld, such as "-R /usr/local/tcl/lib", that tell the
+# Flags to pass to ld, such as "-R /usr/local/tcl/lib", that tell the
# run-time dynamic linker where to look for shared libraries such as
# libtcl.so. Used when linking applications. Only works if there
# is a variable "LIB_RUNTIME_DIR" defined in the Makefile.
@@ -168,3 +164,6 @@ TCL_BUILD_STUB_LIB_PATH='@TCL_BUILD_STUB_LIB_PATH@'
# Path to the Tcl stub library in the install directory.
TCL_STUB_LIB_PATH='@TCL_STUB_LIB_PATH@'
+
+# Flag, 1: we built Tcl with threads enabled, 0 we didn't
+TCL_THREADS=@TCL_THREADS@
diff --git a/unix/tclEpollNotfy.c b/unix/tclEpollNotfy.c
deleted file mode 100644
index 563a30b..0000000
--- a/unix/tclEpollNotfy.c
+++ /dev/null
@@ -1,844 +0,0 @@
-/*
- * tclEpollNotfy.c --
- *
- * This file contains the implementation of the epoll()-based
- * Linux-specific notifier, which is the lowest-level part of the Tcl
- * event loop. This file works together with generic/tclNotify.c.
- *
- * Copyright © 1995-1997 Sun Microsystems, Inc.
- * Copyright © 2016 Lucio Andrés Illanes Albornoz <l.illanes@gmx.de>
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- */
-
-#include "tclInt.h"
-#ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is
- * in tclMacOSXNotify.c */
-#if defined(NOTIFIER_EPOLL) && TCL_THREADS
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE /* For pipe2(2) */
-#endif
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/epoll.h>
-#ifdef HAVE_EVENTFD
-#include <sys/eventfd.h>
-#endif /* HAVE_EVENTFD */
-#include <sys/queue.h>
-
-/*
- * This structure is used to keep track of the notifier info for a registered
- * file.
- */
-
-struct PlatformEventData;
-typedef struct FileHandler {
- int fd;
- int mask; /* Mask of desired events: TCL_READABLE,
- * etc. */
- int readyMask; /* Mask of events that have been seen since
- * the last time file handlers were invoked
- * for this file. */
- Tcl_FileProc *proc; /* Function to call, in the style of
- * Tcl_CreateFileHandler. */
- void *clientData; /* Argument to pass to proc. */
- struct FileHandler *nextPtr;/* Next in list of all files we care about. */
- LIST_ENTRY(FileHandler) readyNode;
- /* Next/previous in list of FileHandlers asso-
- * ciated with regular files (S_IFREG) that are
- * ready for I/O. */
- struct PlatformEventData *pedPtr;
- /* Pointer to PlatformEventData associating this
- * FileHandler with epoll(7) events. */
-} FileHandler;
-
-/*
- * The following structure associates a FileHandler and the thread that owns
- * it with the file descriptors of interest and their event masks passed to
- * epoll_ctl(2) and their corresponding event(s) returned by epoll_wait(2).
- */
-
-struct ThreadSpecificData;
-struct PlatformEventData {
- FileHandler *filePtr;
- struct ThreadSpecificData *tsdPtr;
-};
-
-/*
- * The following structure is what is added to the Tcl event queue when file
- * handlers are ready to fire.
- */
-
-typedef struct {
- Tcl_Event header; /* Information that is standard for all
- * events. */
- int fd; /* File descriptor that is ready. Used to find
- * the FileHandler structure for the file
- * (can't point directly to the FileHandler
- * structure because it could go away while
- * the event is queued). */
-} FileHandlerEvent;
-
-/*
- * The following static structure contains the state information for the
- * epoll based implementation of the Tcl notifier. One of these structures is
- * created for each thread that is using the notifier.
- */
-
-LIST_HEAD(PlatformReadyFileHandlerList, FileHandler);
-typedef struct ThreadSpecificData {
- FileHandler *triggerFilePtr;
- FileHandler *firstFileHandlerPtr;
- /* Pointer to head of file handler list. */
- struct PlatformReadyFileHandlerList firstReadyFileHandlerPtr;
- /* Pointer to head of list of FileHandlers
- * associated with regular files (S_IFREG)
- * that are ready for I/O. */
- pthread_mutex_t notifierMutex;
- /* Mutex protecting notifier termination in
- * TclpFinalizeNotifier. */
-#ifdef HAVE_EVENTFD
- int triggerEventFd; /* eventfd(2) used by other threads to wake
- * up this thread for inter-thread IPC. */
-#else
- int triggerPipe[2]; /* pipe(2) used by other threads to wake
- * up this thread for inter-thread IPC. */
-#endif /* HAVE_EVENTFD */
- int eventsFd; /* epoll(7) file descriptor used to wait for
- * fds */
- struct epoll_event *readyEvents;
- /* Pointer to at most maxReadyEvents events
- * returned by epoll_wait(2). */
- size_t maxReadyEvents; /* Count of epoll_events in readyEvents. */
- int asyncPending; /* True when signal triggered thread. */
-} ThreadSpecificData;
-
-static Tcl_ThreadDataKey dataKey;
-
-/*
- * Forward declarations.
- */
-
-static void PlatformEventsControl(FileHandler *filePtr,
- ThreadSpecificData *tsdPtr, int op, int isNew);
-static void PlatformEventsInit(void);
-static int PlatformEventsTranslate(struct epoll_event *event);
-static int PlatformEventsWait(struct epoll_event *events,
- size_t numEvents, struct timeval *timePtr);
-
-/*
- * Incorporate the base notifier implementation.
- */
-
-#include "tclUnixNotfy.c"
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpInitNotifier --
- *
- * Initializes the platform specific notifier state.
- *
- * Results:
- * Returns a handle to the notifier state for this thread.
- *
- * Side effects:
- * If no initNotifierProc notifier hook exists, PlatformEventsInit is
- * called.
- *
- *----------------------------------------------------------------------
- */
-
-void *
-TclpInitNotifier(void)
-{
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
-
- PlatformEventsInit();
- return tsdPtr;
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * PlatformEventsControl --
- *
- * This function registers interest for the file descriptor and the mask
- * of TCL_* bits associated with filePtr on the epoll file descriptor
- * associated with tsdPtr.
- *
- * Future calls to epoll_wait will return filePtr and tsdPtr alongside
- * with the event registered here via the PlatformEventData struct.
- *
- * Results:
- * None.
- *
- * Side effects:
- * - If adding a new file descriptor, a PlatformEventData struct will be
- * allocated and associated with filePtr.
- * - fstat is called on the file descriptor; if it is associated with a
- * regular file (S_IFREG,) filePtr is considered to be ready for I/O
- * and added to or deleted from the corresponding list in tsdPtr.
- * - If it is not associated with a regular file, the file descriptor is
- * added, modified concerning its mask of events of interest, or
- * deleted from the epoll file descriptor of the calling thread.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-PlatformEventsControl(
- FileHandler *filePtr,
- ThreadSpecificData *tsdPtr,
- int op,
- int isNew)
-{
- struct epoll_event newEvent;
- struct PlatformEventData *newPedPtr;
- Tcl_StatBuf fdStat;
-
- newEvent.events = 0;
- if (filePtr->mask & (TCL_READABLE | TCL_EXCEPTION)) {
- newEvent.events |= EPOLLIN;
- }
- if (filePtr->mask & TCL_WRITABLE) {
- newEvent.events |= EPOLLOUT;
- }
- if (isNew) {
- newPedPtr = (struct PlatformEventData *)
- ckalloc(sizeof(struct PlatformEventData));
- newPedPtr->filePtr = filePtr;
- newPedPtr->tsdPtr = tsdPtr;
- filePtr->pedPtr = newPedPtr;
- }
- newEvent.data.ptr = filePtr->pedPtr;
-
- /*
- * N.B. As discussed in Tcl_WaitForEvent(), epoll(7) does not support
- * regular files (S_IFREG). Therefore, filePtr is in these cases simply
- * added or deleted from the list of FileHandlers associated with regular
- * files belonging to tsdPtr.
- */
-
- if (TclOSfstat(filePtr->fd, &fdStat) == -1) {
- Tcl_Panic("fstat: %s", strerror(errno));
- }
-
- if (epoll_ctl(tsdPtr->eventsFd, op, filePtr->fd, &newEvent) == -1) {
- switch (errno) {
- case EPERM:
- switch (op) {
- case EPOLL_CTL_ADD:
- if (isNew) {
- LIST_INSERT_HEAD(&tsdPtr->firstReadyFileHandlerPtr, filePtr,
- readyNode);
- }
- break;
- case EPOLL_CTL_DEL:
- LIST_REMOVE(filePtr, readyNode);
- break;
-
- }
- break;
- default:
- Tcl_Panic("epoll_ctl: %s", strerror(errno));
- }
- }
- return;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpFinalizeNotifier --
- *
- * This function closes the eventfd and the epoll file descriptor and
- * frees the epoll_event structs owned by the thread of the caller. The
- * above operations are protected by tsdPtr->notifierMutex, which is
- * destroyed thereafter.
- *
- * Results:
- * None.
- *
- * Side effects:
- * While tsdPtr->notifierMutex is held:
- * - The per-thread eventfd(2) is closed, if non-zero, and set to -1.
- * - The per-thread epoll(7) fd is closed, if non-zero, and set to 0.
- * - The per-thread epoll_event structs are freed, if any, and set to 0.
- *
- * tsdPtr->notifierMutex is destroyed.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpFinalizeNotifier(
- TCL_UNUSED(void *))
-{
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
-
- pthread_mutex_lock(&tsdPtr->notifierMutex);
-#ifdef HAVE_EVENTFD
- if (tsdPtr->triggerEventFd) {
- close(tsdPtr->triggerEventFd);
- tsdPtr->triggerEventFd = -1;
- }
-#else /* !HAVE_EVENTFD */
- if (tsdPtr->triggerPipe[0]) {
- close(tsdPtr->triggerPipe[0]);
- tsdPtr->triggerPipe[0] = -1;
- }
- if (tsdPtr->triggerPipe[1]) {
- close(tsdPtr->triggerPipe[1]);
- tsdPtr->triggerPipe[1] = -1;
- }
-#endif /* HAVE_EVENTFD */
- ckfree(tsdPtr->triggerFilePtr->pedPtr);
- ckfree(tsdPtr->triggerFilePtr);
- if (tsdPtr->eventsFd > 0) {
- close(tsdPtr->eventsFd);
- tsdPtr->eventsFd = 0;
- }
- if (tsdPtr->readyEvents) {
- ckfree(tsdPtr->readyEvents);
- tsdPtr->maxReadyEvents = 0;
- }
- pthread_mutex_unlock(&tsdPtr->notifierMutex);
- if ((errno = pthread_mutex_destroy(&tsdPtr->notifierMutex))) {
- Tcl_Panic("pthread_mutex_destroy: %s", strerror(errno));
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * PlatformEventsInit --
- *
- * This function abstracts creating a kqueue fd via the epoll_create
- * system call and allocating memory for the epoll_event structs in
- * tsdPtr for the thread of the caller.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The following per-thread entities are initialised:
- * - notifierMutex is initialised.
- * - The eventfd(2) is created w/ EFD_CLOEXEC and EFD_NONBLOCK.
- * - The epoll(7) fd is created w/ EPOLL_CLOEXEC.
- * - A FileHandler struct is allocated and initialised for the
- * eventfd(2), registering interest for TCL_READABLE on it via
- * PlatformEventsControl().
- * - readyEvents and maxReadyEvents are initialised with 512
- * epoll_events.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-PlatformEventsInit(void)
-{
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- FileHandler *filePtr;
-
- errno = pthread_mutex_init(&tsdPtr->notifierMutex, NULL);
- if (errno) {
- Tcl_Panic("Tcl_InitNotifier: %s", "could not create mutex");
- }
- filePtr = (FileHandler *) ckalloc(sizeof(FileHandler));
-#ifdef HAVE_EVENTFD
- tsdPtr->triggerEventFd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
- if (tsdPtr->triggerEventFd <= 0) {
- Tcl_Panic("Tcl_InitNotifier: %s", "could not create trigger eventfd");
- }
- filePtr->fd = tsdPtr->triggerEventFd;
-#else /* !HAVE_EVENTFD */
- if (pipe2(tsdPtr->triggerPipe, O_CLOEXEC | O_NONBLOCK) != 0) {
- Tcl_Panic("Tcl_InitNotifier: %s", "could not create trigger pipe");
- }
- filePtr->fd = tsdPtr->triggerPipe[0];
-#endif /* HAVE_EVENTFD */
- tsdPtr->triggerFilePtr = filePtr;
- if ((tsdPtr->eventsFd = epoll_create1(EPOLL_CLOEXEC)) == -1) {
- Tcl_Panic("epoll_create1: %s", strerror(errno));
- }
- filePtr->mask = TCL_READABLE;
- PlatformEventsControl(filePtr, tsdPtr, EPOLL_CTL_ADD, 1);
- if (!tsdPtr->readyEvents) {
- tsdPtr->maxReadyEvents = 512;
- tsdPtr->readyEvents = (struct epoll_event *) ckalloc(
- tsdPtr->maxReadyEvents * sizeof(tsdPtr->readyEvents[0]));
- }
- LIST_INIT(&tsdPtr->firstReadyFileHandlerPtr);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * PlatformEventsTranslate --
- *
- * This function translates the platform-specific mask of returned events
- * in eventPtr to a mask of TCL_* bits.
- *
- * Results:
- * Returns the translated mask.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-PlatformEventsTranslate(
- struct epoll_event *eventPtr)
-{
- int mask;
-
- mask = 0;
- if (eventPtr->events & (EPOLLIN | EPOLLHUP)) {
- mask |= TCL_READABLE;
- }
- if (eventPtr->events & EPOLLOUT) {
- mask |= TCL_WRITABLE;
- }
- if (eventPtr->events & EPOLLERR) {
- mask |= TCL_EXCEPTION;
- }
- return mask;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * PlatformEventsWait --
- *
- * This function abstracts waiting for I/O events via epoll_wait.
- *
- * Results:
- * Returns -1 if epoll_wait failed. Returns 0 if polling and if no events
- * became available whilst polling. Returns a pointer to and the count of
- * all returned events in all other cases.
- *
- * Side effects:
- * gettimeofday(2), epoll_wait(2), and gettimeofday(2) are called, in the
- * specified order.
- * If timePtr specifies a positive value, it is updated to reflect the
- * amount of time that has passed; if its value would {under, over}flow,
- * it is set to zero.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-PlatformEventsWait(
- struct epoll_event *events,
- size_t numEvents,
- struct timeval *timePtr)
-{
- int numFound;
- struct timeval tv0, tv1, tv_delta;
- int timeout;
-
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
-
- /*
- * If timePtr is NULL, epoll_wait(2) will wait indefinitely. If it
- * specifies a timeout of {0,0}, epoll_wait(2) will poll. Otherwise, the
- * timeout will simply be converted to milliseconds.
- */
-
- if (!timePtr) {
- timeout = -1;
- } else if (!timePtr->tv_sec && !timePtr->tv_usec) {
- timeout = 0;
- } else {
- timeout = (int) timePtr->tv_sec * 1000;
- if (timePtr->tv_usec) {
- timeout += (int) timePtr->tv_usec / 1000;
- }
- }
-
- /*
- * Call (and possibly block on) epoll_wait(2) and substract the delta of
- * gettimeofday(2) before and after the call from timePtr if the latter is
- * not NULL. Return the number of events returned by epoll_wait(2).
- */
-
- gettimeofday(&tv0, NULL);
- numFound = epoll_wait(tsdPtr->eventsFd, events, (int) numEvents, timeout);
- gettimeofday(&tv1, NULL);
- if (timePtr && (timePtr->tv_sec && timePtr->tv_usec)) {
- timersub(&tv1, &tv0, &tv_delta);
- if (!timercmp(&tv_delta, timePtr, >)) {
- timersub(timePtr, &tv_delta, timePtr);
- } else {
- timePtr->tv_sec = 0;
- timePtr->tv_usec = 0;
- }
- }
- if (tsdPtr->asyncPending) {
- tsdPtr->asyncPending = 0;
- TclAsyncMarkFromNotifier();
- }
- return numFound;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpCreateFileHandler --
- *
- * This function registers a file handler with the epoll notifier of the
- * thread of the caller.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Creates a new file handler structure.
- * PlatformEventsControl() is called for the new file handler structure.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpCreateFileHandler(
- int fd, /* Handle of stream to watch. */
- int mask, /* OR'ed combination of TCL_READABLE,
- * TCL_WRITABLE, and TCL_EXCEPTION: indicates
- * conditions under which proc should be
- * called. */
- Tcl_FileProc *proc, /* Function to call for each selected
- * event. */
- void *clientData) /* Arbitrary data to pass to proc. */
-{
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- FileHandler *filePtr = LookUpFileHandler(tsdPtr, fd, NULL);
- int isNew = (filePtr == NULL);
-
- if (isNew) {
- filePtr = (FileHandler *) ckalloc(sizeof(FileHandler));
- filePtr->fd = fd;
- filePtr->readyMask = 0;
- filePtr->nextPtr = tsdPtr->firstFileHandlerPtr;
- tsdPtr->firstFileHandlerPtr = filePtr;
- }
- filePtr->proc = proc;
- filePtr->clientData = clientData;
- filePtr->mask = mask;
-
- PlatformEventsControl(filePtr, tsdPtr,
- isNew ? EPOLL_CTL_ADD : EPOLL_CTL_MOD, isNew);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpDeleteFileHandler --
- *
- * Cancel a previously-arranged callback arrangement for a file on the
- * epoll file descriptor of the thread of the caller.
- *
- * Results:
- * None.
- *
- * Side effects:
- * If a callback was previously registered on file, remove it.
- * PlatformEventsControl() is called for the file handler structure.
- * The PlatformEventData struct associated with the new file handler
- * structure is freed.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpDeleteFileHandler(
- int fd) /* Stream id for which to remove callback
- * function. */
-{
- FileHandler *filePtr, *prevPtr;
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
-
- /*
- * Find the entry for the given file (and return if there isn't one).
- */
-
- filePtr = LookUpFileHandler(tsdPtr, fd, &prevPtr);
- if (filePtr == NULL) {
- return;
- }
-
- /*
- * Update the check masks for this file.
- */
-
- PlatformEventsControl(filePtr, tsdPtr, EPOLL_CTL_DEL, 0);
- if (filePtr->pedPtr) {
- ckfree(filePtr->pedPtr);
- }
-
- /*
- * Clean up information in the callback record.
- */
-
- if (prevPtr == NULL) {
- tsdPtr->firstFileHandlerPtr = filePtr->nextPtr;
- } else {
- prevPtr->nextPtr = filePtr->nextPtr;
- }
- ckfree(filePtr);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpWaitForEvent --
- *
- * This function is called by Tcl_DoOneEvent to wait for new events on
- * the message queue. If the block time is 0, then TclpWaitForEvent just
- * polls without blocking.
- *
- * The waiting logic is implemented in PlatformEventsWait.
- *
- * Results:
- * Returns -1 if PlatformEventsWait() would block forever, otherwise
- * returns 0.
- *
- * Side effects:
- * Queues file events that are detected by PlatformEventsWait().
- *
- *----------------------------------------------------------------------
- */
-
-int
-TclpWaitForEvent(
- const Tcl_Time *timePtr) /* Maximum block time, or NULL. */
-{
- FileHandler *filePtr;
- Tcl_Time vTime;
- struct timeval timeout, *timeoutPtr;
- /* Impl. notes: timeout & timeoutPtr are used
- * if, and only if threads are not enabled.
- * They are the arguments for the regular
- * epoll_wait() used when the core is not
- * thread-enabled. */
- int mask, numFound, numEvent;
- struct PlatformEventData *pedPtr;
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- int numQueued;
- ssize_t i;
-
- /*
- * Set up the timeout structure. Note that if there are no events to check
- * for, we return with a negative result rather than blocking forever.
- */
-
- if (timePtr != NULL) {
- /*
- * TIP #233 (Virtualized Time). Is virtual time in effect? And do we
- * actually have something to scale? If yes to both then we call the
- * handler to do this scaling.
- */
-
- if (timePtr->sec != 0 || timePtr->usec != 0) {
- vTime = *timePtr;
- TclScaleTime(&vTime);
- timePtr = &vTime;
- }
- timeout.tv_sec = timePtr->sec;
- timeout.tv_usec = timePtr->usec;
- timeoutPtr = &timeout;
- } else {
- timeoutPtr = NULL;
- }
-
- /*
- * Walk the list of FileHandlers associated with regular files (S_IFREG)
- * belonging to tsdPtr, queue Tcl events for them, and update their mask
- * of events of interest.
- *
- * As epoll(7) does not support regular files, the behaviour of
- * {select,poll}(2) is simply simulated here: fds associated with regular
- * files are added to this list by PlatformEventsControl() and processed
- * here before calling (and possibly blocking) on PlatformEventsWait().
- */
-
- numQueued = 0;
- LIST_FOREACH(filePtr, &tsdPtr->firstReadyFileHandlerPtr, readyNode) {
- mask = 0;
- if (filePtr->mask & TCL_READABLE) {
- mask |= TCL_READABLE;
- }
- if (filePtr->mask & TCL_WRITABLE) {
- mask |= TCL_WRITABLE;
- }
-
- /*
- * Don't bother to queue an event if the mask was previously non-zero
- * since an event must still be on the queue.
- */
-
- if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
- ckalloc(sizeof(FileHandlerEvent));
-
- fileEvPtr->header.proc = FileHandlerEventProc;
- fileEvPtr->fd = filePtr->fd;
- Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL);
- numQueued++;
- }
- filePtr->readyMask = mask;
- }
-
- /*
- * If any events were queued in the above loop, force PlatformEventsWait()
- * to poll as there already are events that need to be processed at this
- * point.
- */
-
- if (numQueued) {
- timeout.tv_sec = 0;
- timeout.tv_usec = 0;
- timeoutPtr = &timeout;
- }
-
- /*
- * Wait or poll for new events, queue Tcl events for the FileHandlers
- * corresponding to them, and update the FileHandlers' mask of events of
- * interest registered by the last call to Tcl_CreateFileHandler().
- *
- * Events for the eventfd(2)/trigger pipe are processed here in order to
- * facilitate inter-thread IPC. If another thread intends to wake up this
- * thread whilst it's blocking on PlatformEventsWait(), it write(2)s to
- * the eventfd(2)/trigger pipe (see Tcl_AlertNotifier(),) which in turn
- * will cause PlatformEventsWait() to return immediately.
- */
-
- numFound = PlatformEventsWait(tsdPtr->readyEvents,
- tsdPtr->maxReadyEvents, timeoutPtr);
- for (numEvent = 0; numEvent < numFound; numEvent++) {
- pedPtr = (struct PlatformEventData *)
- tsdPtr->readyEvents[numEvent].data.ptr;
- filePtr = pedPtr->filePtr;
- mask = PlatformEventsTranslate(&tsdPtr->readyEvents[numEvent]);
-#ifdef HAVE_EVENTFD
- if (filePtr->fd == tsdPtr->triggerEventFd) {
- uint64_t eventFdVal;
-
- i = read(tsdPtr->triggerEventFd, &eventFdVal, sizeof(eventFdVal));
- if ((i != sizeof(eventFdVal)) && (errno != EAGAIN)) {
- Tcl_Panic("%s: read from %p->triggerEventFd: %s",
- "Tcl_WaitForEvent", (void *) tsdPtr, strerror(errno));
- }
- continue;
- }
-#else /* !HAVE_EVENTFD */
- if (filePtr->fd == tsdPtr->triggerPipe[0]) {
- char triggerPipeVal;
-
- i = read(tsdPtr->triggerPipe[0], &triggerPipeVal,
- sizeof(triggerPipeVal));
- if ((i != sizeof(triggerPipeVal)) && (errno != EAGAIN)) {
- Tcl_Panic("%s: read from %p->triggerPipe[0]: %s",
- "Tcl_WaitForEvent", (void *) tsdPtr, strerror(errno));
- }
- continue;
- }
-#endif /* HAVE_EVENTFD */
- if (!mask) {
- continue;
- }
-
- /*
- * Don't bother to queue an event if the mask was previously non-zero
- * since an event must still be on the queue.
- */
-
- if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
- ckalloc(sizeof(FileHandlerEvent));
-
- fileEvPtr->header.proc = FileHandlerEventProc;
- fileEvPtr->fd = filePtr->fd;
- Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL);
- }
- filePtr->readyMask = mask;
- }
- return 0;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclAsyncNotifier --
- *
- * This procedure sets the async mark of an async handler to a
- * given value, if it is called from the target thread.
- *
- * Result:
- * True, when the handler will be marked, false otherwise.
- *
- * Side effects:
- * The signal may be resent to the target thread.
- *
- *----------------------------------------------------------------------
- */
-
-int
-TclAsyncNotifier(
- int sigNumber, /* Signal number. */
- Tcl_ThreadId threadId, /* Target thread. */
- void *clientData, /* Notifier data. */
- int *flagPtr, /* Flag to mark. */
- int value) /* Value of mark. */
-{
-#if TCL_THREADS
- /*
- * WARNING:
- * This code most likely runs in a signal handler. Thus,
- * only few async-signal-safe system calls are allowed,
- * e.g. pthread_self(), sem_post(), write().
- */
-
- if (pthread_equal(pthread_self(), (pthread_t) threadId)) {
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData;
-
- *flagPtr = value;
- if (tsdPtr != NULL && !tsdPtr->asyncPending) {
- tsdPtr->asyncPending = 1;
- TclpAlertNotifier(tsdPtr);
- return 1;
- }
- return 0;
- }
-
- /*
- * Re-send the signal to the proper target thread.
- */
-
- pthread_kill((pthread_t) threadId, sigNumber);
-#else
- (void)sigNumber;
- (void)threadId;
- (void)clientData;
- (void)flagPtr;
- (void)value;
-#endif
- return 0;
-}
-
-#endif /* NOTIFIER_EPOLL && TCL_THREADS */
-#else
-TCL_MAC_EMPTY_FILE(unix_tclEpollNotfy_c)
-#endif /* !HAVE_COREFOUNDATION */
-
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 4
- * fill-column: 78
- * End:
- */
diff --git a/unix/tclKqueueNotfy.c b/unix/tclKqueueNotfy.c
deleted file mode 100644
index 627fa6e..0000000
--- a/unix/tclKqueueNotfy.c
+++ /dev/null
@@ -1,840 +0,0 @@
-/*
- * tclKqueueNotfy.c --
- *
- * This file contains the implementation of the kqueue()-based
- * DragonFly/Free/Net/OpenBSD-specific notifier, which is the lowest-
- * level part of the Tcl event loop. This file works together with
- * generic/tclNotify.c.
- *
- * Copyright © 1995-1997 Sun Microsystems, Inc.
- * Copyright © 2016 Lucio Andrés Illanes Albornoz <l.illanes@gmx.de>
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- */
-
-#include "tclInt.h"
-#ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is
- * in tclMacOSXNotify.c */
-#if defined(NOTIFIER_KQUEUE) && TCL_THREADS
-
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/event.h>
-#include <sys/queue.h>
-#include <sys/time.h>
-
-/*
- * This structure is used to keep track of the notifier info for a registered
- * file.
- */
-
-struct PlatformEventData;
-typedef struct FileHandler {
- int fd; /* File descriptor that this is describing a
- * handler for. */
- int mask; /* Mask of desired events: TCL_READABLE,
- * etc. */
- int readyMask; /* Mask of events that have been seen since
- * the last time file handlers were invoked
- * for this file. */
- Tcl_FileProc *proc; /* Function to call, in the style of
- * Tcl_CreateFileHandler. */
- void *clientData; /* Argument to pass to proc. */
- struct FileHandler *nextPtr;/* Next in list of all files we care about. */
- LIST_ENTRY(FileHandler) readyNode;
- /* Next/previous in list of FileHandlers asso-
- * ciated with regular files (S_IFREG) that are
- * ready for I/O. */
- struct PlatformEventData *pedPtr;
- /* Pointer to PlatformEventData associating this
- * FileHandler with kevent(2) events. */
-} FileHandler;
-
-/*
- * The following structure associates a FileHandler and the thread that owns
- * it with the file descriptors of interest and their event masks passed to
- * kevent(2) and their corresponding event(s) returned by kevent(2).
- */
-
-struct ThreadSpecificData;
-struct PlatformEventData {
- FileHandler *filePtr;
- struct ThreadSpecificData *tsdPtr;
-};
-
-/*
- * The following structure is what is added to the Tcl event queue when file
- * handlers are ready to fire.
- */
-
-typedef struct {
- Tcl_Event header; /* Information that is standard for all
- * events. */
- int fd; /* File descriptor that is ready. Used to find
- * the FileHandler structure for the file
- * (can't point directly to the FileHandler
- * structure because it could go away while
- * the event is queued). */
-} FileHandlerEvent;
-
-/*
- * The following static structure contains the state information for the
- * kqueue based implementation of the Tcl notifier. One of these structures is
- * created for each thread that is using the notifier.
- */
-
-LIST_HEAD(PlatformReadyFileHandlerList, FileHandler);
-typedef struct ThreadSpecificData {
- FileHandler *firstFileHandlerPtr;
- /* Pointer to head of file handler list. */
- struct PlatformReadyFileHandlerList firstReadyFileHandlerPtr;
- /* Pointer to head of list of FileHandlers
- * associated with regular files (S_IFREG)
- * that are ready for I/O. */
- pthread_mutex_t notifierMutex;
- /* Mutex protecting notifier termination in
- * TclpFinalizeNotifier. */
- int triggerPipe[2]; /* pipe(2) used by other threads to wake
- * up this thread for inter-thread IPC. */
- int eventsFd; /* kqueue(2) file descriptor used to wait for
- * fds. */
- struct kevent *readyEvents; /* Pointer to at most maxReadyEvents events
- * returned by kevent(2). */
- size_t maxReadyEvents; /* Count of kevents in readyEvents. */
- int asyncPending; /* True when signal triggered thread. */
-} ThreadSpecificData;
-
-static Tcl_ThreadDataKey dataKey;
-
-/*
- * Forward declarations of internal functions.
- */
-
-static void PlatformEventsControl(FileHandler *filePtr,
- ThreadSpecificData *tsdPtr, int op, int isNew);
-static int PlatformEventsTranslate(struct kevent *eventPtr);
-static int PlatformEventsWait(struct kevent *events,
- size_t numEvents, struct timeval *timePtr);
-
-/*
- * Incorporate the base notifier implementation.
- */
-
-#include "tclUnixNotfy.c"
-
-/*
- *----------------------------------------------------------------------
- *
- * PlatformEventsControl --
- *
- * This function registers interest for the file descriptor and the mask
- * of TCL_* bits associated with filePtr on the kqueue file descriptor
- * associated with tsdPtr.
- *
- * Future calls to kevent will return filePtr and tsdPtr alongside with
- * the event registered here via the PlatformEventData struct.
- *
- * Results:
- * None.
- *
- * Side effects:
- * - If adding a new file descriptor, a PlatformEventData struct will be
- * allocated and associated with filePtr.
- * - fstat is called on the file descriptor; if it is associated with
- * a regular file (S_IFREG,) filePtr is considered to be ready for I/O
- * and added to or deleted from the corresponding list in tsdPtr.
- * - If it is not associated with a regular file, the file descriptor is
- * added, modified concerning its mask of events of interest, or
- * deleted from the epoll file descriptor of the calling thread.
- * - If deleting a file descriptor, kevent(2) is called twice specifying
- * EVFILT_READ first and then EVFILT_WRITE (see note below.)
- *
- *----------------------------------------------------------------------
- */
-
-static void
-PlatformEventsControl(
- FileHandler *filePtr,
- ThreadSpecificData *tsdPtr,
- int op,
- int isNew)
-{
- int numChanges;
- struct kevent changeList[2];
- struct PlatformEventData *newPedPtr;
- Tcl_StatBuf fdStat;
-
- if (isNew) {
- newPedPtr = (struct PlatformEventData *)
- ckalloc(sizeof(struct PlatformEventData));
- newPedPtr->filePtr = filePtr;
- newPedPtr->tsdPtr = tsdPtr;
- filePtr->pedPtr = newPedPtr;
- }
-
- /*
- * N.B. As discussed in Tcl_WaitForEvent(), kqueue(2) does not reproduce
- * the `always ready' {select,poll}(2) behaviour for regular files
- * (S_IFREG) prior to FreeBSD 11.0-RELEASE. Therefore, filePtr is in these
- * cases simply added or deleted from the list of FileHandlers associated
- * with regular files belonging to tsdPtr.
- */
-
- if (TclOSfstat(filePtr->fd, &fdStat) == -1) {
- Tcl_Panic("fstat: %s", strerror(errno));
- } else if ((fdStat.st_mode & S_IFMT) == S_IFREG
- || (fdStat.st_mode & S_IFMT) == S_IFDIR
- || (fdStat.st_mode & S_IFMT) == S_IFLNK
- ) {
- switch (op) {
- case EV_ADD:
- if (isNew) {
- LIST_INSERT_HEAD(&tsdPtr->firstReadyFileHandlerPtr, filePtr,
- readyNode);
- }
- break;
- case EV_DELETE:
- LIST_REMOVE(filePtr, readyNode);
- break;
- }
- return;
- }
-
- numChanges = 0;
- switch (op) {
- case EV_ADD:
- if (filePtr->mask & (TCL_READABLE | TCL_EXCEPTION)) {
- EV_SET(&changeList[numChanges], (uintptr_t) filePtr->fd,
- EVFILT_READ, op, 0, 0, filePtr->pedPtr);
- numChanges++;
- }
- if (filePtr->mask & TCL_WRITABLE) {
- EV_SET(&changeList[numChanges], (uintptr_t) filePtr->fd,
- EVFILT_WRITE, op, 0, 0, filePtr->pedPtr);
- numChanges++;
- }
- if (numChanges) {
- if (kevent(tsdPtr->eventsFd, changeList, numChanges, NULL, 0,
- NULL) == -1) {
- Tcl_Panic("kevent: %s", strerror(errno));
- }
- }
- break;
- case EV_DELETE:
- /*
- * N.B. kqueue(2) has separate filters for readability and writability
- * fd events. We therefore need to ensure that fds are ompletely
- * removed from the kqueue(2) fd when deleting. This is exacerbated
- * by changes to filePtr->mask w/o calls to PlatforEventsControl()
- * after e.g. an exec(3) in a child process.
- *
- * As one of these calls can fail, two separate kevent(2) calls are
- * made for EVFILT_{READ,WRITE}.
- */
- EV_SET(&changeList[0], (uintptr_t) filePtr->fd, EVFILT_READ, op, 0, 0,
- NULL);
- if ((kevent(tsdPtr->eventsFd, changeList, 1, NULL, 0, NULL) == -1)
- && (errno != ENOENT)) {
- Tcl_Panic("kevent: %s", strerror(errno));
- }
- EV_SET(&changeList[0], (uintptr_t) filePtr->fd, EVFILT_WRITE, op, 0, 0,
- NULL);
- if ((kevent(tsdPtr->eventsFd, changeList, 1, NULL, 0, NULL) == -1)
- && (errno != ENOENT)) {
- Tcl_Panic("kevent: %s", strerror(errno));
- }
- break;
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpFinalizeNotifier --
- *
- * This function closes the pipe and the kqueue file descriptors and
- * frees the kevent structs owned by the thread of the caller. The above
- * operations are protected by tsdPtr->notifierMutex, which is destroyed
- * thereafter.
- *
- * Results:
- * None.
- *
- * Side effects:
- * While tsdPtr->notifierMutex is held:
- * The per-thread pipe(2) fds are closed, if non-zero, and set to -1.
- * The per-thread kqueue(2) fd is closed, if non-zero, and set to 0.
- * The per-thread kevent structs are freed, if any, and set to 0.
- *
- * tsdPtr->notifierMutex is destroyed.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpFinalizeNotifier(
- TCL_UNUSED(void *))
-{
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
-
- pthread_mutex_lock(&tsdPtr->notifierMutex);
- if (tsdPtr->triggerPipe[0]) {
- close(tsdPtr->triggerPipe[0]);
- tsdPtr->triggerPipe[0] = -1;
- }
- if (tsdPtr->triggerPipe[1]) {
- close(tsdPtr->triggerPipe[1]);
- tsdPtr->triggerPipe[1] = -1;
- }
- if (tsdPtr->eventsFd > 0) {
- close(tsdPtr->eventsFd);
- tsdPtr->eventsFd = 0;
- }
- if (tsdPtr->readyEvents) {
- ckfree(tsdPtr->readyEvents);
- tsdPtr->maxReadyEvents = 0;
- }
- pthread_mutex_unlock(&tsdPtr->notifierMutex);
- if ((errno = pthread_mutex_destroy(&tsdPtr->notifierMutex))) {
- Tcl_Panic("pthread_mutex_destroy: %s", strerror(errno));
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpInitNotifier --
- *
- * Initializes the platform specific notifier state.
- *
- * This function abstracts creating a kqueue fd via the kqueue system
- * call and allocating memory for the kevents structs in tsdPtr for the
- * thread of the caller.
- *
- * Results:
- * Returns a handle to the notifier state for this thread.
- *
- * Side effects:
- * The following per-thread entities are initialised:
- * - notifierMutex is initialised.
- * - The pipe(2) is created; fcntl(2) is called on both fds to set
- * FD_CLOEXEC and O_NONBLOCK.
- * - The kqueue(2) fd is created; fcntl(2) is called on it to set
- * FD_CLOEXEC.
- * - A FileHandler struct is allocated and initialised for the event-
- * fd(2), registering interest for TCL_READABLE on it via Platform-
- * EventsControl().
- * - readyEvents and maxReadyEvents are initialised with 512 kevents.
- *
- *----------------------------------------------------------------------
- */
-
-void *
-TclpInitNotifier(void)
-{
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- int i, fdFl;
- FileHandler *filePtr;
-
- errno = pthread_mutex_init(&tsdPtr->notifierMutex, NULL);
- if (errno) {
- Tcl_Panic("Tcl_InitNotifier: %s", "could not create mutex");
- }
- if (pipe(tsdPtr->triggerPipe) != 0) {
- Tcl_Panic("Tcl_InitNotifier: %s", "could not create trigger pipe");
- } else for (i = 0; i < 2; i++) {
- if (fcntl(tsdPtr->triggerPipe[i], F_SETFD, FD_CLOEXEC) == -1) {
- Tcl_Panic("fcntl: %s", strerror(errno));
- } else {
- fdFl = fcntl(tsdPtr->triggerPipe[i], F_GETFL);
- fdFl |= O_NONBLOCK;
- }
- if (fcntl(tsdPtr->triggerPipe[i], F_SETFL, fdFl) == -1) {
- Tcl_Panic("fcntl: %s", strerror(errno));
- }
- }
- if ((tsdPtr->eventsFd = kqueue()) == -1) {
- Tcl_Panic("kqueue: %s", strerror(errno));
- } else if (fcntl(tsdPtr->eventsFd, F_SETFD, FD_CLOEXEC) == -1) {
- Tcl_Panic("fcntl: %s", strerror(errno));
- }
- filePtr = (FileHandler *) ckalloc(sizeof(FileHandler));
- filePtr->fd = tsdPtr->triggerPipe[0];
- filePtr->mask = TCL_READABLE;
- PlatformEventsControl(filePtr, tsdPtr, EV_ADD, 1);
- if (!tsdPtr->readyEvents) {
- tsdPtr->maxReadyEvents = 512;
- tsdPtr->readyEvents = (struct kevent *) ckalloc(
- tsdPtr->maxReadyEvents * sizeof(tsdPtr->readyEvents[0]));
- }
- LIST_INIT(&tsdPtr->firstReadyFileHandlerPtr);
-
- return tsdPtr;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * PlatformEventsTranslate --
- *
- * This function translates the platform-specific mask of returned
- * events in eventPtr to a mask of TCL_* bits.
- *
- * Results:
- * Returns the translated mask.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-PlatformEventsTranslate(
- struct kevent *eventPtr)
-{
- int mask;
-
- mask = 0;
- if (eventPtr->filter == EVFILT_READ) {
- mask |= TCL_READABLE;
- if (eventPtr->flags & EV_ERROR) {
- mask |= TCL_EXCEPTION;
- }
- }
- if (eventPtr->filter == EVFILT_WRITE) {
- mask |= TCL_WRITABLE;
- if (eventPtr->flags & EV_ERROR) {
- mask |= TCL_EXCEPTION;
- }
- }
- return mask;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * PlatformEventsWait --
- *
- * This function abstracts waiting for I/O events via the kevent system
- * call.
- *
- * Results:
- * Returns -1 if kevent failed. Returns 0 if polling and if no events
- * became available whilst polling. Returns a pointer to and the count of
- * all returned events in all other cases.
- *
- * Side effects:
- * gettimeofday(2), kevent(2), and gettimeofday(2) are called, in the
- * specified order.
- * If timePtr specifies a positive value, it is updated to reflect the
- * amount of time that has passed; if its value would {under, over}flow,
- * it is set to zero.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-PlatformEventsWait(
- struct kevent *events,
- size_t numEvents,
- struct timeval *timePtr)
-{
- int numFound;
- struct timeval tv0, tv1, tv_delta;
- struct timespec timeout, *timeoutPtr;
-
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
-
- /*
- * If timePtr is NULL, kevent(2) will wait indefinitely. If it specifies a
- * timeout of {0,0}, kevent(2) will poll. Otherwise, the timeout will
- * simply be converted to a timespec.
- */
-
- if (!timePtr) {
- timeoutPtr = NULL;
- } else if (!timePtr->tv_sec && !timePtr->tv_usec) {
- timeout.tv_sec = 0;
- timeout.tv_nsec = 0;
- timeoutPtr = &timeout;
- } else {
- timeout.tv_sec = timePtr->tv_sec;
- timeout.tv_nsec = timePtr->tv_usec * 1000;
- timeoutPtr = &timeout;
- }
-
- /*
- * Call (and possibly block on) kevent(2) and substract the delta of
- * gettimeofday(2) before and after the call from timePtr if the latter is
- * not NULL. Return the number of events returned by kevent(2).
- */
-
- gettimeofday(&tv0, NULL);
- numFound = kevent(tsdPtr->eventsFd, NULL, 0, events, (int) numEvents,
- timeoutPtr);
- gettimeofday(&tv1, NULL);
- if (timePtr && (timePtr->tv_sec && timePtr->tv_usec)) {
- timersub(&tv1, &tv0, &tv_delta);
- if (!timercmp(&tv_delta, timePtr, >)) {
- timersub(timePtr, &tv_delta, timePtr);
- } else {
- timePtr->tv_sec = 0;
- timePtr->tv_usec = 0;
- }
- }
- if (tsdPtr->asyncPending) {
- tsdPtr->asyncPending = 0;
- TclAsyncMarkFromNotifier();
- }
- return numFound;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpCreateFileHandler --
- *
- * This function registers a file handler with the kqueue notifier
- * of the thread of the caller.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Creates a new file handler structure.
- * PlatformEventsControl() is called for the new file handler structure.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpCreateFileHandler(
- int fd, /* Handle of stream to watch. */
- int mask, /* OR'ed combination of TCL_READABLE,
- * TCL_WRITABLE, and TCL_EXCEPTION: indicates
- * conditions under which proc should be
- * called. */
- Tcl_FileProc *proc, /* Function to call for each selected
- * event. */
- void *clientData) /* Arbitrary data to pass to proc. */
-{
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- FileHandler *filePtr = LookUpFileHandler(tsdPtr, fd, NULL);
- int isNew = (filePtr == NULL);
-
- if (isNew) {
- filePtr = (FileHandler *) ckalloc(sizeof(FileHandler));
- filePtr->fd = fd;
- filePtr->readyMask = 0;
- filePtr->nextPtr = tsdPtr->firstFileHandlerPtr;
- tsdPtr->firstFileHandlerPtr = filePtr;
- }
- filePtr->proc = proc;
- filePtr->clientData = clientData;
- filePtr->mask = mask;
-
- PlatformEventsControl(filePtr, tsdPtr, EV_ADD, isNew);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpDeleteFileHandler --
- *
- * Cancel a previously-arranged callback arrangement for a file on the
- * kqueue of the thread of the caller.
- *
- * Results:
- * None.
- *
- * Side effects:
- * If a callback was previously registered on file, remove it.
- * PlatformEventsControl() is called for the file handler structure.
- * The PlatformEventData struct associated with the new file handler
- * structure is freed.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpDeleteFileHandler(
- int fd) /* Stream id for which to remove callback
- * function. */
-{
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- FileHandler *filePtr, *prevPtr;
-
- /*
- * Find the entry for the given file (and return if there isn't one).
- */
-
- filePtr = LookUpFileHandler(tsdPtr, fd, &prevPtr);
- if (filePtr == NULL) {
- return;
- }
-
- /*
- * Update the check masks for this file.
- */
-
- PlatformEventsControl(filePtr, tsdPtr, EV_DELETE, 0);
- if (filePtr->pedPtr) {
- ckfree(filePtr->pedPtr);
- }
-
- /*
- * Clean up information in the callback record.
- */
-
- if (prevPtr == NULL) {
- tsdPtr->firstFileHandlerPtr = filePtr->nextPtr;
- } else {
- prevPtr->nextPtr = filePtr->nextPtr;
- }
- ckfree(filePtr);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpWaitForEvent --
- *
- * This function is called by Tcl_DoOneEvent to wait for new events on
- * the message queue. If the block time is 0, then TclpWaitForEvent just
- * polls without blocking.
- *
- * The waiting logic is implemented in PlatformEventsWait.
- *
- * Results:
- * Returns -1 if PlatformEventsWait() would block forever, otherwise
- * returns 0.
- *
- * Side effects:
- * Queues file events that are detected by PlatformEventsWait().
- *
- *----------------------------------------------------------------------
- */
-
-int
-TclpWaitForEvent(
- const Tcl_Time *timePtr) /* Maximum block time, or NULL. */
-{
- FileHandler *filePtr;
- int mask;
- Tcl_Time vTime;
- struct timeval timeout, *timeoutPtr;
- /* Impl. notes: timeout & timeoutPtr are used
- * if, and only if threads are not enabled.
- * They are the arguments for the regular
- * epoll_wait() used when the core is not
- * thread-enabled. */
- int numFound, numEvent;
- struct PlatformEventData *pedPtr;
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- int numQueued;
- ssize_t i;
- char buf[1];
-
- /*
- * Set up the timeout structure. Note that if there are no events to check
- * for, we return with a negative result rather than blocking forever.
- */
-
- if (timePtr != NULL) {
- /*
- * TIP #233 (Virtualized Time). Is virtual time in effect? And do we
- * actually have something to scale? If yes to both then we call the
- * handler to do this scaling.
- */
-
- if (timePtr->sec != 0 || timePtr->usec != 0) {
- vTime = *timePtr;
- TclScaleTime(&vTime);
- timePtr = &vTime;
- }
- timeout.tv_sec = timePtr->sec;
- timeout.tv_usec = timePtr->usec;
- timeoutPtr = &timeout;
- } else {
- timeoutPtr = NULL;
- }
-
- /*
- * Walk the list of FileHandlers associated with regular files (S_IFREG)
- * belonging to tsdPtr, queue Tcl events for them, and update their mask
- * of events of interest.
- *
- * kqueue(2), unlike epoll(7), does support regular files, but EVFILT_READ
- * only `[r]eturns when the file pointer is not at the end of file' as
- * opposed to unconditionally. While FreeBSD 11.0-RELEASE adds support for
- * this mode (NOTE_FILE_POLL,) this is not used for reasons of
- * compatibility.
- *
- * Therefore, the behaviour of {select,poll}(2) is simply simulated here:
- * fds associated with regular files are added to this list by
- * PlatformEventsControl() and processed here before calling (and possibly
- * blocking) on PlatformEventsWait().
- */
-
- numQueued = 0;
- LIST_FOREACH(filePtr, &tsdPtr->firstReadyFileHandlerPtr, readyNode) {
- mask = 0;
- if (filePtr->mask & TCL_READABLE) {
- mask |= TCL_READABLE;
- }
- if (filePtr->mask & TCL_WRITABLE) {
- mask |= TCL_WRITABLE;
- }
-
- /*
- * Don't bother to queue an event if the mask was previously non-zero
- * since an event must still be on the queue.
- */
-
- if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
- ckalloc(sizeof(FileHandlerEvent));
-
- fileEvPtr->header.proc = FileHandlerEventProc;
- fileEvPtr->fd = filePtr->fd;
- Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL);
- numQueued++;
- }
- filePtr->readyMask = mask;
- }
-
- /*
- * If any events were queued in the above loop, force PlatformEventsWait()
- * to poll as there already are events that need to be processed at this
- * point.
- */
-
- if (numQueued) {
- timeout.tv_sec = 0;
- timeout.tv_usec = 0;
- timeoutPtr = &timeout;
- }
-
- /*
- * Wait or poll for new events, queue Tcl events for the FileHandlers
- * corresponding to them, and update the FileHandlers' mask of events of
- * interest registered by the last call to Tcl_CreateFileHandler().
- *
- * Events for the trigger pipe are processed here in order to facilitate
- * inter-thread IPC. If another thread intends to wake up this thread
- * whilst it's blocking on PlatformEventsWait(), it write(2)s to the other
- * end of the pipe (see Tcl_AlertNotifier(),) which in turn will cause
- * PlatformEventsWait() to return immediately.
- */
-
- numFound = PlatformEventsWait(tsdPtr->readyEvents,
- tsdPtr->maxReadyEvents, timeoutPtr);
- for (numEvent = 0; numEvent < numFound; numEvent++) {
- pedPtr = (struct PlatformEventData *)
- tsdPtr->readyEvents[numEvent].udata;
- filePtr = pedPtr->filePtr;
- mask = PlatformEventsTranslate(&tsdPtr->readyEvents[numEvent]);
- if (filePtr->fd == tsdPtr->triggerPipe[0]) {
- i = read(tsdPtr->triggerPipe[0], buf, 1);
- if ((i == -1) && (errno != EAGAIN)) {
- Tcl_Panic("Tcl_WaitForEvent: read from %p->triggerPipe: %s",
- (void *) tsdPtr, strerror(errno));
- }
- continue;
- }
- if (!mask) {
- continue;
- }
-
- /*
- * Don't bother to queue an event if the mask was previously non-zero
- * since an event must still be on the queue.
- */
-
- if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr = (FileHandlerEvent *)
- ckalloc(sizeof(FileHandlerEvent));
-
- fileEvPtr->header.proc = FileHandlerEventProc;
- fileEvPtr->fd = filePtr->fd;
- Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL);
- }
- filePtr->readyMask |= mask;
- }
- return 0;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclAsyncNotifier --
- *
- * This procedure sets the async mark of an async handler to a
- * given value, if it is called from the target thread.
- *
- * Result:
- * True, when the handler will be marked, false otherwise.
- *
- * Side effects:
- * The signal may be resent to the target thread.
- *
- *----------------------------------------------------------------------
- */
-
-int
-TclAsyncNotifier(
- int sigNumber, /* Signal number. */
- Tcl_ThreadId threadId, /* Target thread. */
- void *clientData, /* Notifier data. */
- int *flagPtr, /* Flag to mark. */
- int value) /* Value of mark. */
-{
-#if TCL_THREADS
- /*
- * WARNING:
- * This code most likely runs in a signal handler. Thus,
- * only few async-signal-safe system calls are allowed,
- * e.g. pthread_self(), sem_post(), write().
- */
-
- if (pthread_equal(pthread_self(), (pthread_t) threadId)) {
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData;
-
- *flagPtr = value;
- if (tsdPtr != NULL && !tsdPtr->asyncPending) {
- tsdPtr->asyncPending = 1;
- TclpAlertNotifier(tsdPtr);
- return 1;
- }
- return 0;
- }
-
- /*
- * Re-send the signal to the proper target thread.
- */
-
- pthread_kill((pthread_t) threadId, sigNumber);
-#else
- (void)sigNumber;
- (void)threadId;
- (void)clientData;
- (void)flagPtr;
- (void)value;
-#endif
- return 0;
-}
-
-#endif /* NOTIFIER_KQUEUE && TCL_THREADS */
-#else
-TCL_MAC_EMPTY_FILE(unix_tclKqueueNotfy_c)
-#endif /* !HAVE_COREFOUNDATION */
-
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 4
- * fill-column: 78
- * End:
- */
diff --git a/unix/tclLoadAix.c b/unix/tclLoadAix.c
index 17fca04..59bccbf 100644
--- a/unix/tclLoadAix.c
+++ b/unix/tclLoadAix.c
@@ -9,7 +9,7 @@
* different from the notice used elsewhere in Tcl. The file has been
* modified to incorporate the file dlfcn.h in-line.
*
- * Copyright © 1992,1993,1995,1996, Jens-Uwe Mager, Helios Software GmbH
+ * Copyright (c) 1992,1993,1995,1996, Jens-Uwe Mager, Helios Software GmbH
* Not derived from licensed software.
*
* Permission is granted to freely use, copy, modify, and redistribute
@@ -23,7 +23,7 @@
/*
* @(#)dlfcn.c 1.7 revision of 95/08/14 19:08:38
- * This is an unpublished work copyright © 1992 HELIOS Software GmbH
+ * This is an unpublished work copyright (c) 1992 HELIOS Software GmbH
* 30159 Hannover, Germany
*/
@@ -98,7 +98,7 @@ dlopen(
const char *path,
int mode)
{
- ModulePtr mp;
+ register ModulePtr mp;
static void *mainModule;
/*
@@ -134,7 +134,7 @@ dlopen(
return NULL;
}
- mp->name = malloc(strlen(path) + 1);
+ mp->name = malloc((unsigned) (strlen(path) + 1));
strcpy(mp->name, path);
/*
@@ -191,7 +191,7 @@ dlopen(
*/
if (mode & RTLD_GLOBAL) {
- ModulePtr mp1;
+ register ModulePtr mp1;
for (mp1 = mp->next; mp1; mp1 = mp1->next) {
if (loadbind(0, mp1->entry, mp->entry) == -1) {
@@ -211,7 +211,7 @@ dlopen(
if (mp->info = (struct dl_info *)dlsym(mp, "dl_info")) {
if (mp->info->init) {
- mp->info->init();
+ (*mp->info->init)();
}
} else {
errvalid = 0;
@@ -224,7 +224,7 @@ dlopen(
if (mp->cdtors = (CdtorPtr) dlsym(mp, "__cdtors")) {
while (mp->cdtors->init) {
- mp->cdtors->init();
+ (*mp->cdtors->init)();
mp->cdtors++;
}
} else {
@@ -243,7 +243,7 @@ static void
caterr(
char *s)
{
- char *p = s;
+ register char *p = s;
while (*p >= '0' && *p <= '9') {
p++;
@@ -282,9 +282,9 @@ dlsym(
void *handle,
const char *symbol)
{
- ModulePtr mp = (ModulePtr)handle;
- ExportPtr ep;
- int i;
+ register ModulePtr mp = (ModulePtr)handle;
+ register ExportPtr ep;
+ register int i;
/*
* Could speed up the search, but I assume that one assigns the result to
@@ -317,21 +317,21 @@ int
dlclose(
void *handle)
{
- ModulePtr mp = (ModulePtr)handle;
+ register ModulePtr mp = (ModulePtr)handle;
int result;
- ModulePtr mp1;
+ register ModulePtr mp1;
if (--mp->refCnt > 0) {
return 0;
}
if (mp->info && mp->info->fini) {
- mp->info->fini();
+ (*mp->info->fini)();
}
if (mp->cdtors) {
while (mp->cdtors->term) {
- mp->cdtors->term();
+ (*mp->cdtors->term)();
mp->cdtors++;
}
}
@@ -343,8 +343,8 @@ dlclose(
}
if (mp->exports) {
- ExportPtr ep;
- int i;
+ register ExportPtr ep;
+ register int i;
for (ep = mp->exports, i = mp->nExports; i; i--, ep++) {
if (ep->name) {
free(ep->name);
@@ -541,7 +541,7 @@ readExports(
tmpsym[SYMNMLEN] = '\0';
symname = tmpsym;
}
- ep->name = malloc(strlen(symname) + 1);
+ ep->name = malloc((unsigned) (strlen(symname) + 1));
strcpy(ep->name, symname);
ep->addr = (void *)((unsigned long)
mp->entry + ls->l_value - shdata.s_vaddr);
diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c
index 13b183b..e38c280 100644
--- a/unix/tclLoadDl.c
+++ b/unix/tclLoadDl.c
@@ -4,10 +4,10 @@
* This procedure provides a version of the TclLoadFile that works with
* the "dlopen" and "dlsym" library procedures for dynamic loading.
*
- * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tclInt.h"
@@ -33,14 +33,6 @@
#endif
/*
- * Static procedures defined within this file.
- */
-
-static void * FindSymbol(Tcl_Interp *interp,
- Tcl_LoadHandle loadHandle, const char *symbol);
-static void UnloadFile(Tcl_LoadHandle loadHandle);
-
-/*
*---------------------------------------------------------------------------
*
* TclpDlopen --
@@ -66,16 +58,13 @@ TclpDlopen(
Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded
* file which will be passed back to
* (*unloadProcPtr)() to unload the file. */
- Tcl_FSUnloadFileProc **unloadProcPtr,
+ Tcl_FSUnloadFileProc **unloadProcPtr)
/* Filled with address of Tcl_FSUnloadFileProc
* function which should be used for this
* file. */
- int flags)
{
void *handle;
- Tcl_LoadHandle newHandle;
- const char *native;
- int dlopenflags = 0;
+ CONST char *native;
/*
* First try the full path the user gave us. This is particularly
@@ -83,21 +72,11 @@ TclpDlopen(
* relative path.
*/
- native = (const char *)Tcl_FSGetNativePath(pathPtr);
+ native = Tcl_FSGetNativePath(pathPtr);
/*
- * Use (RTLD_NOW|RTLD_LOCAL) as default, see [Bug #3216070]
+ * Use (RTLD_NOW|RTLD_LOCAL) always, see [Bug #3216070]
*/
- if (flags & TCL_LOAD_GLOBAL) {
- dlopenflags |= RTLD_GLOBAL;
- } else {
- dlopenflags |= RTLD_LOCAL;
- }
- if (flags & TCL_LOAD_LAZY) {
- dlopenflags |= RTLD_LAZY;
- } else {
- dlopenflags |= RTLD_NOW;
- }
- handle = dlopen(native, dlopenflags);
+ handle = dlopen(native, RTLD_NOW | RTLD_LOCAL);
if (handle == NULL) {
/*
* Let the OS loader examine the binary search path for whatever
@@ -106,13 +85,13 @@ TclpDlopen(
*/
Tcl_DString ds;
- const char *fileName = Tcl_GetString(pathPtr);
+ char *fileName = Tcl_GetString(pathPtr);
- native = Tcl_UtfToExternalDString(NULL, fileName, TCL_INDEX_NONE, &ds);
+ native = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds);
/*
- * Use (RTLD_NOW|RTLD_LOCAL) as default, see [Bug #3216070]
+ * Use (RTLD_NOW|RTLD_LOCAL) always, see [Bug #3216070]
*/
- handle = dlopen(native, dlopenflags);
+ handle = dlopen(native, RTLD_NOW | RTLD_LOCAL);
Tcl_DStringFree(&ds);
}
@@ -124,27 +103,20 @@ TclpDlopen(
const char *errorStr = dlerror();
- if (interp) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't load file \"%s\": %s",
- Tcl_GetString(pathPtr), errorStr));
- }
+ Tcl_AppendResult(interp, "couldn't load file \"",
+ Tcl_GetString(pathPtr), "\": ", errorStr, NULL);
return TCL_ERROR;
}
- newHandle = (Tcl_LoadHandle)ckalloc(sizeof(*newHandle));
- newHandle->clientData = handle;
- newHandle->findSymbolProcPtr = &FindSymbol;
- newHandle->unloadFileProcPtr = &UnloadFile;
- *unloadProcPtr = &UnloadFile;
- *loadHandle = newHandle;
+ *unloadProcPtr = &TclpUnloadFile;
+ *loadHandle = (Tcl_LoadHandle) handle;
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
- * FindSymbol --
+ * TclpFindSymbol --
*
* Looks up a symbol, by name, through a handle associated with a
* previously loaded piece of code (shared library).
@@ -157,21 +129,16 @@ TclpDlopen(
*----------------------------------------------------------------------
*/
-static void *
-FindSymbol(
+Tcl_PackageInitProc *
+TclpFindSymbol(
Tcl_Interp *interp, /* Place to put error messages. */
Tcl_LoadHandle loadHandle, /* Value from TcpDlopen(). */
- const char *symbol) /* Symbol to look up. */
+ CONST char *symbol) /* Symbol to look up. */
{
- const char *native; /* Name of the library to be loaded, in
- * system encoding */
- Tcl_DString newName, ds; /* Buffers for converting the name to
- * system encoding and prepending an
- * underscore*/
- void *handle = (void *) loadHandle->clientData;
- /* Native handle to the loaded library */
- void *proc; /* Address corresponding to the resolved
- * symbol */
+ CONST char *native;
+ Tcl_DString newName, ds;
+ VOID *handle = (VOID*)loadHandle;
+ Tcl_PackageInitProc *proc;
/*
* Some platforms still add an underscore to the beginning of symbol
@@ -179,84 +146,80 @@ FindSymbol(
* the underscore.
*/
- native = Tcl_UtfToExternalDString(NULL, symbol, TCL_INDEX_NONE, &ds);
- proc = dlsym(handle, native); /* INTL: Native. */
- if (proc == NULL) {
- Tcl_DStringInit(&newName);
- TclDStringAppendLiteral(&newName, "_");
- native = Tcl_DStringAppend(&newName, native, TCL_INDEX_NONE);
- proc = dlsym(handle, native); /* INTL: Native. */
- Tcl_DStringFree(&newName);
- }
-#ifdef __cplusplus
+ native = Tcl_UtfToExternalDString(NULL, symbol, -1, &ds);
+ proc = (Tcl_PackageInitProc *) dlsym(handle, /* INTL: Native. */
+ native);
if (proc == NULL) {
- char buf[32];
- snprintf(buf, sizeof(buf), "%d", Tcl_DStringLength(&ds));
Tcl_DStringInit(&newName);
- TclDStringAppendLiteral(&newName, "__Z");
- Tcl_DStringAppend(&newName, buf, TCL_INDEX_NONE);
- Tcl_DStringAppend(&newName, Tcl_DStringValue(&ds), TCL_INDEX_NONE);
- TclDStringAppendLiteral(&newName, "P10Tcl_Interp");
- native = Tcl_DStringValue(&newName);
- proc = dlsym(handle, native + 1); /* INTL: Native. */
- if (proc == NULL) {
- proc = dlsym(handle, native); /* INTL: Native. */
- }
- if (proc == NULL) {
- TclDStringAppendLiteral(&newName, "i");
- native = Tcl_DStringValue(&newName);
- proc = dlsym(handle, native + 1); /* INTL: Native. */
- }
- if (proc == NULL) {
- proc = dlsym(handle, native); /* INTL: Native. */
- }
+ Tcl_DStringAppend(&newName, "_", 1);
+ native = Tcl_DStringAppend(&newName, native, -1);
+ proc = (Tcl_PackageInitProc *) dlsym(handle, /* INTL: Native. */
+ native);
Tcl_DStringFree(&newName);
}
-#endif
Tcl_DStringFree(&ds);
- if (proc == NULL) {
- const char *errorStr = dlerror();
- if (interp) {
- if (!errorStr) {
- errorStr = "unknown";
- }
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "cannot find symbol \"%s\": %s", symbol, errorStr));
- Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol,
- (void *)NULL);
- }
- }
return proc;
}
/*
*----------------------------------------------------------------------
*
- * UnloadFile --
+ * TclpUnloadFile --
*
- * Unloads a dynamic shared object, after which all pointers to functions
- * in the formerly-loaded object are no longer valid.
+ * Unloads a dynamically loaded binary code file from memory. Code
+ * pointers in the formerly loaded file are no longer valid after calling
+ * this function.
*
* Results:
* None.
*
* Side effects:
- * Memory for the loaded object is deallocated.
+ * Code removed from memory.
*
*----------------------------------------------------------------------
*/
-static void
-UnloadFile(
+void
+TclpUnloadFile(
Tcl_LoadHandle loadHandle) /* loadHandle returned by a previous call to
* TclpDlopen(). The loadHandle is a token
* that represents the loaded file. */
{
- void *handle = loadHandle->clientData;
+ void *handle;
+ handle = (void *) loadHandle;
dlclose(handle);
- ckfree(loadHandle);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclGuessPackageName --
+ *
+ * If the "load" command is invoked without providing a package name,
+ * this procedure is invoked to try to figure it out.
+ *
+ * Results:
+ * Always returns 0 to indicate that we couldn't figure out a package
+ * name; generic code will then try to guess the package from the file
+ * name. A return value of 1 would have meant that we figured out the
+ * package name and put it in bufPtr.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclGuessPackageName(
+ CONST char *fileName, /* Name of file containing package (already
+ * translated to local form if needed). */
+ Tcl_DString *bufPtr) /* Initialized empty dstring. Append package
+ * name to this if possible. */
+{
+ return 0;
}
/*
diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c
index 375771c..0a36215 100644
--- a/unix/tclLoadDyld.c
+++ b/unix/tclLoadDyld.c
@@ -6,8 +6,8 @@
* Original version of his file (superseded long ago) provided by
* Wilfredo Sanchez (wsanchez@apple.com).
*
- * Copyright © 1995 Apple Computer, Inc.
- * Copyright © 2001-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright (c) 1995 Apple Computer, Inc.
+ * Copyright (c) 2001-2007 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -16,74 +16,83 @@
#include "tclInt.h"
#ifndef MODULE_SCOPE
-# define MODULE_SCOPE extern
+#define MODULE_SCOPE extern
#endif
+#ifndef TCL_DYLD_USE_DLFCN
/*
* Use preferred dlfcn API on 10.4 and later
*/
-
-#ifndef TCL_DYLD_USE_DLFCN
-# ifdef NO_DLFCN_H
-# define TCL_DYLD_USE_DLFCN 0
-# else
+# if !defined(NO_DLFCN_H) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
# define TCL_DYLD_USE_DLFCN 1
+# else
+# define TCL_DYLD_USE_DLFCN 0
# endif
#endif
-
+#ifndef TCL_DYLD_USE_NSMODULE
/*
* Use deprecated NSModule API only to support 10.3 and earlier:
*/
-
-#ifndef TCL_DYLD_USE_NSMODULE
-# define TCL_DYLD_USE_NSMODULE 0
+# if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
+# define TCL_DYLD_USE_NSMODULE 1
+# else
+# define TCL_DYLD_USE_NSMODULE 0
+# endif
#endif
+#if TCL_DYLD_USE_DLFCN
+#include <dlfcn.h>
+#if defined(HAVE_WEAK_IMPORT) && MAC_OS_X_VERSION_MIN_REQUIRED < 1040
/*
- * Use includes for the API we're using.
+ * Support for weakly importing dlfcn API.
*/
-
-#if TCL_DYLD_USE_DLFCN
-# include <dlfcn.h>
-#endif /* TCL_DYLD_USE_DLFCN */
+extern void *dlopen(const char *path, int mode) WEAK_IMPORT_ATTRIBUTE;
+extern void *dlsym(void *handle, const char *symbol) WEAK_IMPORT_ATTRIBUTE;
+extern int dlclose(void *handle) WEAK_IMPORT_ATTRIBUTE;
+extern char *dlerror(void) WEAK_IMPORT_ATTRIBUTE;
+#endif
+#endif
#if TCL_DYLD_USE_NSMODULE || defined(TCL_LOAD_FROM_MEMORY)
-#if defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5))))
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif
#include <mach-o/dyld.h>
#include <mach-o/fat.h>
#include <mach-o/swap.h>
#include <mach-o/arch.h>
#include <libkern/OSByteOrder.h>
#include <mach/mach.h>
+#include <stdbool.h>
typedef struct Tcl_DyldModuleHandle {
struct Tcl_DyldModuleHandle *nextPtr;
NSModule module;
} Tcl_DyldModuleHandle;
-#endif /* TCL_DYLD_USE_NSMODULE || TCL_LOAD_FROM_MEMORY */
+#endif /* TCL_DYLD_USE_NSMODULE */
-typedef struct {
+typedef struct Tcl_DyldLoadHandle {
+#if TCL_DYLD_USE_DLFCN
void *dlHandle;
+#endif
#if TCL_DYLD_USE_NSMODULE || defined(TCL_LOAD_FROM_MEMORY)
const struct mach_header *dyldLibHeader;
Tcl_DyldModuleHandle *modulePtr;
#endif
} Tcl_DyldLoadHandle;
-#if TCL_DYLD_USE_DLFCN || defined(TCL_LOAD_FROM_MEMORY)
-MODULE_SCOPE long tclMacOSXDarwinRelease;
+#if (TCL_DYLD_USE_DLFCN && MAC_OS_X_VERSION_MIN_REQUIRED < 1040) || \
+ defined(TCL_LOAD_FROM_MEMORY)
+MODULE_SCOPE long tclMacOSXDarwinRelease;
#endif
-/*
- * Static functions defined in this file.
- */
-
-static void * FindSymbol(Tcl_Interp *interp,
- Tcl_LoadHandle loadHandle, const char *symbol);
-static void UnloadFile(Tcl_LoadHandle handle);
+#ifdef TCL_DEBUG_LOAD
+#define TclLoadDbgMsg(m, ...) do { \
+ fprintf(stderr, "%s:%d: %s(): " m ".\n", \
+ strrchr(__FILE__, '/')+1, __LINE__, __func__, ##__VA_ARGS__); \
+ } while (0)
+#else
+#define TclLoadDbgMsg(m, ...)
+#endif
+#if TCL_DYLD_USE_NSMODULE || defined(TCL_LOAD_FROM_MEMORY)
/*
*----------------------------------------------------------------------
*
@@ -101,8 +110,7 @@ static void UnloadFile(Tcl_LoadHandle handle);
*----------------------------------------------------------------------
*/
-#if TCL_DYLD_USE_NSMODULE || defined(TCL_LOAD_FROM_MEMORY)
-static const char *
+static CONST char*
DyldOFIErrorMsg(
int err)
{
@@ -123,7 +131,7 @@ DyldOFIErrorMsg(
return "unknown error";
}
}
-#endif /* TCL_DYLD_USE_NSMODULE || TCL_LOAD_FROM_MEMORY */
+#endif /* TCL_DYLD_USE_NSMODULE */
/*
*----------------------------------------------------------------------
@@ -151,15 +159,15 @@ TclpDlopen(
Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded
* file which will be passed back to
* (*unloadProcPtr)() to unload the file. */
- Tcl_FSUnloadFileProc **unloadProcPtr,
+ Tcl_FSUnloadFileProc **unloadProcPtr)
/* Filled with address of Tcl_FSUnloadFileProc
* function which should be used for this
* file. */
- int flags)
{
Tcl_DyldLoadHandle *dyldLoadHandle;
- Tcl_LoadHandle newHandle;
+#if TCL_DYLD_USE_DLFCN
void *dlHandle = NULL;
+#endif
#if TCL_DYLD_USE_NSMODULE || defined(TCL_LOAD_FROM_MEMORY)
const struct mach_header *dyldLibHeader = NULL;
Tcl_DyldModuleHandle *modulePtr = NULL;
@@ -168,14 +176,12 @@ TclpDlopen(
NSLinkEditErrors editError;
int errorNumber;
const char *errorName, *objFileImageErrMsg = NULL;
-#endif /* TCL_DYLD_USE_NSMODULE */
+#endif
const char *errMsg = NULL;
int result;
Tcl_DString ds;
+ char *fileName = NULL;
const char *nativePath, *nativeFileName = NULL;
-#if TCL_DYLD_USE_DLFCN
- int dlopenflags = 0;
-#endif /* TCL_DYLD_USE_DLFCN */
/*
* First try the full path the user gave us. This is particularly
@@ -183,45 +189,47 @@ TclpDlopen(
* relative path.
*/
- nativePath = (const char *)Tcl_FSGetNativePath(pathPtr);
- nativeFileName = Tcl_UtfToExternalDString(NULL, Tcl_GetString(pathPtr),
- TCL_INDEX_NONE, &ds);
+ nativePath = Tcl_FSGetNativePath(pathPtr);
#if TCL_DYLD_USE_DLFCN
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
+ if (tclMacOSXDarwinRelease >= 8)
+#endif
+ {
/*
- * Use (RTLD_NOW|RTLD_LOCAL) as default, see [Bug #3216070]
+ * Use (RTLD_NOW|RTLD_LOCAL) always, see [Bug #3216070]
*/
-
- if (flags & TCL_LOAD_GLOBAL) {
- dlopenflags |= RTLD_GLOBAL;
- } else {
- dlopenflags |= RTLD_LOCAL;
- }
- if (flags & TCL_LOAD_LAZY) {
- dlopenflags |= RTLD_LAZY;
- } else {
- dlopenflags |= RTLD_NOW;
- }
- dlHandle = dlopen(nativePath, dlopenflags);
- if (!dlHandle) {
- /*
- * Let the OS loader examine the binary search path for whatever string
- * the user gave us which hopefully refers to a file on the binary
- * path.
- */
-
- dlHandle = dlopen(nativeFileName, dlopenflags);
+ dlHandle = dlopen(nativePath, RTLD_NOW | RTLD_LOCAL);
if (!dlHandle) {
+ /*
+ * Let the OS loader examine the binary search path for whatever
+ * string the user gave us which hopefully refers to a file on the
+ * binary path.
+ */
+
+ fileName = Tcl_GetString(pathPtr);
+ nativeFileName = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds);
+ /*
+ * Use (RTLD_NOW|RTLD_LOCAL) always, see [Bug #3216070]
+ */
+ dlHandle = dlopen(nativeFileName, RTLD_NOW | RTLD_LOCAL);
+ }
+ if (dlHandle) {
+ TclLoadDbgMsg("dlopen() successful");
+ } else {
errMsg = dlerror();
+ TclLoadDbgMsg("dlopen() failed: %s", errMsg);
}
}
+ if (!dlHandle)
#endif /* TCL_DYLD_USE_DLFCN */
-
- if (!dlHandle) {
+ {
#if TCL_DYLD_USE_NSMODULE
dyldLibHeader = NSAddImage(nativePath,
NSADDIMAGE_OPTION_RETURN_ON_ERROR);
- if (!dyldLibHeader) {
+ if (dyldLibHeader) {
+ TclLoadDbgMsg("NSAddImage() successful");
+ } else {
NSLinkEditError(&editError, &errorNumber, &errorName, &errMsg);
if (editError == NSLinkEditFileAccessError) {
/*
@@ -230,12 +238,20 @@ TclpDlopen(
* which hopefully refers to a file on the binary path.
*/
+ if (!fileName) {
+ fileName = Tcl_GetString(pathPtr);
+ nativeFileName = Tcl_UtfToExternalDString(NULL, fileName,
+ -1, &ds);
+ }
dyldLibHeader = NSAddImage(nativeFileName,
NSADDIMAGE_OPTION_WITH_SEARCHING |
NSADDIMAGE_OPTION_RETURN_ON_ERROR);
- if (!dyldLibHeader) {
+ if (dyldLibHeader) {
+ TclLoadDbgMsg("NSAddImage() successful");
+ } else {
NSLinkEditError(&editError, &errorNumber, &errorName,
&errMsg);
+ TclLoadDbgMsg("NSAddImage() failed: %s", errMsg);
}
} else if ((editError == NSLinkEditFileFormatError
&& errorNumber == EBADMACHO)
@@ -252,75 +268,72 @@ TclpDlopen(
err = NSCreateObjectFileImageFromFile(nativePath,
&dyldObjFileImage);
if (err == NSObjectFileImageSuccess && dyldObjFileImage) {
- int nsflags = NSLINKMODULE_OPTION_RETURN_ON_ERROR;
- if (!(flags & 1)) {
- nsflags |= NSLINKMODULE_OPTION_PRIVATE;
- }
- if (!(flags & 2)) {
- nsflags |= NSLINKMODULE_OPTION_BINDNOW;
- }
- module = NSLinkModule(dyldObjFileImage, nativePath, nsflags);
+ TclLoadDbgMsg("NSCreateObjectFileImageFromFile() "
+ "successful");
+ module = NSLinkModule(dyldObjFileImage, nativePath,
+ NSLINKMODULE_OPTION_BINDNOW
+ | NSLINKMODULE_OPTION_RETURN_ON_ERROR);
NSDestroyObjectFileImage(dyldObjFileImage);
if (module) {
- modulePtr = (Tcl_DyldModuleHandle *)ckalloc(sizeof(Tcl_DyldModuleHandle));
+ modulePtr = (Tcl_DyldModuleHandle *)
+ ckalloc(sizeof(Tcl_DyldModuleHandle));
modulePtr->module = module;
modulePtr->nextPtr = NULL;
+ TclLoadDbgMsg("NSLinkModule() successful");
} else {
NSLinkEditError(&editError, &errorNumber, &errorName,
&errMsg);
+ TclLoadDbgMsg("NSLinkModule() failed: %s", errMsg);
}
} else {
objFileImageErrMsg = DyldOFIErrorMsg(err);
+ TclLoadDbgMsg("NSCreateObjectFileImageFromFile() failed: "
+ "%s", objFileImageErrMsg);
}
}
}
#endif /* TCL_DYLD_USE_NSMODULE */
}
-
- if (dlHandle
+ if (0
+#if TCL_DYLD_USE_DLFCN
+ || dlHandle
+#endif
#if TCL_DYLD_USE_NSMODULE
|| dyldLibHeader || modulePtr
-#endif /* TCL_DYLD_USE_NSMODULE */
+#endif
) {
- dyldLoadHandle = (Tcl_DyldLoadHandle *)ckalloc(sizeof(Tcl_DyldLoadHandle));
+ dyldLoadHandle = (Tcl_DyldLoadHandle *)
+ ckalloc(sizeof(Tcl_DyldLoadHandle));
+#if TCL_DYLD_USE_DLFCN
dyldLoadHandle->dlHandle = dlHandle;
+#endif
#if TCL_DYLD_USE_NSMODULE || defined(TCL_LOAD_FROM_MEMORY)
dyldLoadHandle->dyldLibHeader = dyldLibHeader;
dyldLoadHandle->modulePtr = modulePtr;
-#endif /* TCL_DYLD_USE_NSMODULE || TCL_LOAD_FROM_MEMORY */
- newHandle = (Tcl_LoadHandle)ckalloc(sizeof(*newHandle));
- newHandle->clientData = dyldLoadHandle;
- newHandle->findSymbolProcPtr = &FindSymbol;
- newHandle->unloadFileProcPtr = &UnloadFile;
- *unloadProcPtr = &UnloadFile;
- *loadHandle = newHandle;
+#endif
+ *loadHandle = (Tcl_LoadHandle) dyldLoadHandle;
+ *unloadProcPtr = &TclpUnloadFile;
result = TCL_OK;
} else {
- Tcl_Obj *errObj;
-
- TclNewObj(errObj);
- if (errMsg != NULL) {
- Tcl_AppendToObj(errObj, errMsg, TCL_INDEX_NONE);
- }
+ Tcl_AppendResult(interp, errMsg, NULL);
#if TCL_DYLD_USE_NSMODULE
if (objFileImageErrMsg) {
- Tcl_AppendPrintfToObj(errObj,
- "\nNSCreateObjectFileImageFromFile() error: %s",
- objFileImageErrMsg);
+ Tcl_AppendResult(interp, "\nNSCreateObjectFileImageFromFile() "
+ "error: ", objFileImageErrMsg, NULL);
}
-#endif /* TCL_DYLD_USE_NSMODULE */
- Tcl_SetObjResult(interp, errObj);
+#endif
result = TCL_ERROR;
}
-
- Tcl_DStringFree(&ds);
+ if(fileName) {
+ Tcl_DStringFree(&ds);
+ }
return result;
}
/*
*----------------------------------------------------------------------
*
- * FindSymbol --
+ * TclpFindSymbol --
*
* Looks up a symbol, by name, through a handle associated with a
* previously loaded piece of code (shared library).
@@ -333,27 +346,31 @@ TclpDlopen(
*----------------------------------------------------------------------
*/
-static void *
-FindSymbol(
+MODULE_SCOPE Tcl_PackageInitProc *
+TclpFindSymbol(
Tcl_Interp *interp, /* For error reporting. */
Tcl_LoadHandle loadHandle, /* Handle from TclpDlopen. */
- const char *symbol) /* Symbol name to look up. */
+ CONST char *symbol) /* Symbol name to look up. */
{
- Tcl_DyldLoadHandle *dyldLoadHandle = (Tcl_DyldLoadHandle *)loadHandle->clientData;
- Tcl_LibraryInitProc *proc = NULL;
+ Tcl_DyldLoadHandle *dyldLoadHandle = (Tcl_DyldLoadHandle *) loadHandle;
+ Tcl_PackageInitProc *proc = NULL;
const char *errMsg = NULL;
Tcl_DString ds;
const char *native;
- native = Tcl_UtfToExternalDString(NULL, symbol, TCL_INDEX_NONE, &ds);
- if (dyldLoadHandle->dlHandle) {
+ native = Tcl_UtfToExternalDString(NULL, symbol, -1, &ds);
#if TCL_DYLD_USE_DLFCN
- proc = (Tcl_LibraryInitProc *)dlsym(dyldLoadHandle->dlHandle, native);
- if (!proc) {
+ if (dyldLoadHandle->dlHandle) {
+ proc = dlsym(dyldLoadHandle->dlHandle, native);
+ if (proc) {
+ TclLoadDbgMsg("dlsym() successful");
+ } else {
errMsg = dlerror();
+ TclLoadDbgMsg("dlsym() failed: %s", errMsg);
}
+ } else
#endif /* TCL_DYLD_USE_DLFCN */
- } else {
+ {
#if TCL_DYLD_USE_NSMODULE || defined(TCL_LOAD_FROM_MEMORY)
NSSymbol nsSymbol = NULL;
Tcl_DString newName;
@@ -363,19 +380,20 @@ FindSymbol(
*/
Tcl_DStringInit(&newName);
- TclDStringAppendLiteral(&newName, "_");
- native = Tcl_DStringAppend(&newName, native, TCL_INDEX_NONE);
+ Tcl_DStringAppend(&newName, "_", 1);
+ native = Tcl_DStringAppend(&newName, native, -1);
if (dyldLoadHandle->dyldLibHeader) {
nsSymbol = NSLookupSymbolInImage(dyldLoadHandle->dyldLibHeader,
native, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW |
NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
if (nsSymbol) {
+ TclLoadDbgMsg("NSLookupSymbolInImage() successful");
+#ifdef DYLD_SUPPORTS_DYLIB_UNLOADING
/*
* Until dyld supports unloading of MY_DYLIB binaries, the
* following is not needed.
*/
-#ifdef DYLD_SUPPORTS_DYLIB_UNLOADING
NSModule module = NSModuleForSymbol(nsSymbol);
Tcl_DyldModuleHandle *modulePtr = dyldLoadHandle->modulePtr;
@@ -386,7 +404,8 @@ FindSymbol(
modulePtr = modulePtr->nextPtr;
}
if (modulePtr == NULL) {
- modulePtr = (Tcl_DyldModuleHandle *)ckalloc(sizeof(Tcl_DyldModuleHandle));
+ modulePtr = (Tcl_DyldModuleHandle *)
+ ckalloc(sizeof(Tcl_DyldModuleHandle));
modulePtr->module = module;
modulePtr->nextPtr = dyldLoadHandle->modulePtr;
dyldLoadHandle->modulePtr = modulePtr;
@@ -398,31 +417,39 @@ FindSymbol(
const char *errorName;
NSLinkEditError(&editError, &errorNumber, &errorName, &errMsg);
+ TclLoadDbgMsg("NSLookupSymbolInImage() failed: %s", errMsg);
}
} else if (dyldLoadHandle->modulePtr) {
nsSymbol = NSLookupSymbolInModule(
dyldLoadHandle->modulePtr->module, native);
+ if (nsSymbol) {
+ TclLoadDbgMsg("NSLookupSymbolInModule() successful");
+ } else {
+ TclLoadDbgMsg("NSLookupSymbolInModule() failed");
+ }
}
if (nsSymbol) {
- proc = (Tcl_LibraryInitProc *)NSAddressOfSymbol(nsSymbol);
+ proc = NSAddressOfSymbol(nsSymbol);
+ if (proc) {
+ TclLoadDbgMsg("NSAddressOfSymbol() successful");
+ } else {
+ TclLoadDbgMsg("NSAddressOfSymbol() failed");
+ }
}
Tcl_DStringFree(&newName);
#endif /* TCL_DYLD_USE_NSMODULE */
}
Tcl_DStringFree(&ds);
- if (errMsg && (interp != NULL)) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "cannot find symbol \"%s\": %s", symbol, errMsg));
- Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol,
- (void *)NULL);
+ if (errMsg) {
+ Tcl_AppendResult(interp, errMsg, NULL);
}
- return (void *)proc;
+ return proc;
}
/*
*----------------------------------------------------------------------
*
- * UnloadFile --
+ * TclpUnloadFile --
*
* Unloads a dynamically loaded binary code file from memory. Code
* pointers in the formerly loaded file are no longer valid after calling
@@ -439,36 +466,81 @@ FindSymbol(
*----------------------------------------------------------------------
*/
-static void
-UnloadFile(
+MODULE_SCOPE void
+TclpUnloadFile(
Tcl_LoadHandle loadHandle) /* loadHandle returned by a previous call to
* TclpDlopen(). The loadHandle is a token
* that represents the loaded file. */
{
- Tcl_DyldLoadHandle *dyldLoadHandle = (Tcl_DyldLoadHandle *)loadHandle->clientData;
+ Tcl_DyldLoadHandle *dyldLoadHandle = (Tcl_DyldLoadHandle *) loadHandle;
- if (dyldLoadHandle->dlHandle) {
#if TCL_DYLD_USE_DLFCN
- (void) dlclose(dyldLoadHandle->dlHandle);
+ if (dyldLoadHandle->dlHandle) {
+ int result;
+
+ result = dlclose(dyldLoadHandle->dlHandle);
+ if (!result) {
+ TclLoadDbgMsg("dlclose() successful");
+ } else {
+ TclLoadDbgMsg("dlclose() failed: %s", dlerror());
+ }
+ } else
#endif /* TCL_DYLD_USE_DLFCN */
- } else {
+ {
#if TCL_DYLD_USE_NSMODULE || defined(TCL_LOAD_FROM_MEMORY)
Tcl_DyldModuleHandle *modulePtr = dyldLoadHandle->modulePtr;
while (modulePtr != NULL) {
- void *ptr = modulePtr;
+ void *ptr;
+ bool result;
- (void) NSUnLinkModule(modulePtr->module,
+ result = NSUnLinkModule(modulePtr->module,
NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES);
+ if (result) {
+ TclLoadDbgMsg("NSUnLinkModule() successful");
+ } else {
+ TclLoadDbgMsg("NSUnLinkModule() failed");
+ }
+ ptr = modulePtr;
modulePtr = modulePtr->nextPtr;
ckfree(ptr);
}
#endif /* TCL_DYLD_USE_NSMODULE */
}
- ckfree(dyldLoadHandle);
- ckfree(loadHandle);
+ ckfree((char*) dyldLoadHandle);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclGuessPackageName --
+ *
+ * If the "load" command is invoked without providing a package name,
+ * this procedure is invoked to try to figure it out.
+ *
+ * Results:
+ * Always returns 0 to indicate that we couldn't figure out a package
+ * name; generic code will then try to guess the package from the file
+ * name. A return value of 1 would have meant that we figured out the
+ * package name and put it in bufPtr.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclGuessPackageName(
+ CONST char *fileName, /* Name of file containing package (already
+ * translated to local form if needed). */
+ Tcl_DString *bufPtr) /* Initialized empty dstring. Append package
+ * name to this if possible. */
+{
+ return 0;
}
+#ifdef TCL_LOAD_FROM_MEMORY
/*
*----------------------------------------------------------------------
*
@@ -485,10 +557,9 @@ UnloadFile(
*----------------------------------------------------------------------
*/
-#ifdef TCL_LOAD_FROM_MEMORY
MODULE_SCOPE void *
TclpLoadMemoryGetBuffer(
- TCL_UNUSED(Tcl_Interp *),
+ Tcl_Interp *interp, /* Used for error reporting. */
int size) /* Size of desired buffer. */
{
void *buffer = NULL;
@@ -510,7 +581,6 @@ TclpLoadMemoryGetBuffer(
}
return buffer;
}
-#endif /* TCL_LOAD_FROM_MEMORY */
/*
*----------------------------------------------------------------------
@@ -530,7 +600,6 @@ TclpLoadMemoryGetBuffer(
*----------------------------------------------------------------------
*/
-#ifdef TCL_LOAD_FROM_MEMORY
MODULE_SCOPE int
TclpLoadMemory(
Tcl_Interp *interp, /* Used for error reporting. */
@@ -543,19 +612,16 @@ TclpLoadMemory(
Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded
* file which will be passed back to
* (*unloadProcPtr)() to unload the file. */
- Tcl_FSUnloadFileProc **unloadProcPtr,
+ Tcl_FSUnloadFileProc **unloadProcPtr)
/* Filled with address of Tcl_FSUnloadFileProc
* function which should be used for this
* file. */
- int flags)
{
- Tcl_LoadHandle newHandle;
Tcl_DyldLoadHandle *dyldLoadHandle;
NSObjectFileImage dyldObjFileImage = NULL;
Tcl_DyldModuleHandle *modulePtr;
NSModule module;
const char *objFileImageErrMsg = NULL;
- int nsflags = NSLINKMODULE_OPTION_RETURN_ON_ERROR;
/*
* Try to create an object file image that we can load from.
@@ -563,19 +629,19 @@ TclpLoadMemory(
if (codeSize >= 0) {
NSObjectFileImageReturnCode err = NSObjectFileImageSuccess;
- const struct fat_header *fh = (const struct fat_header *)buffer;
+ const struct fat_header *fh = buffer;
uint32_t ms = 0;
#ifndef __LP64__
const struct mach_header *mh = NULL;
-# define mh_size sizeof(struct mach_header)
-# define mh_magic MH_MAGIC
-# define arch_abi 0
+ #define mh_size sizeof(struct mach_header)
+ #define mh_magic MH_MAGIC
+ #define arch_abi 0
#else
const struct mach_header_64 *mh = NULL;
-# define mh_size sizeof(struct mach_header_64)
-# define mh_magic MH_MAGIC_64
-# define arch_abi CPU_ARCH_ABI64
-#endif /* __LP64__ */
+ #define mh_size sizeof(struct mach_header_64)
+ #define mh_magic MH_MAGIC_64
+ #define arch_abi CPU_ARCH_ABI64
+#endif
if ((size_t) codeSize >= sizeof(struct fat_header)
&& fh->magic == OSSwapHostToBigInt32(FAT_MAGIC)) {
@@ -585,6 +651,7 @@ TclpLoadMemory(
* Fat binary, try to find mach_header for our architecture
*/
+ TclLoadDbgMsg("Fat binary, %d archs", fh_nfat_arch);
if ((size_t) codeSize >= sizeof(struct fat_header) +
fh_nfat_arch * sizeof(struct fat_arch)) {
void *fatarchs = (char*)buffer + sizeof(struct fat_header);
@@ -592,20 +659,27 @@ TclpLoadMemory(
struct fat_arch *fa;
if (fh->magic != FAT_MAGIC) {
- swap_fat_arch((struct fat_arch *)fatarchs, fh_nfat_arch, arch->byteorder);
+ swap_fat_arch(fatarchs, fh_nfat_arch, arch->byteorder);
}
fa = NXFindBestFatArch(arch->cputype | arch_abi,
- arch->cpusubtype, (struct fat_arch *)fatarchs, fh_nfat_arch);
+ arch->cpusubtype, fatarchs, fh_nfat_arch);
if (fa) {
- mh = (const struct mach_header_64 *)((char *) buffer + fa->offset);
+ TclLoadDbgMsg("NXFindBestFatArch() successful: "
+ "local cputype %d subtype %d, "
+ "fat cputype %d subtype %d",
+ arch->cputype | arch_abi, arch->cpusubtype,
+ fa->cputype, fa->cpusubtype);
+ mh = (void*)((char*)buffer + fa->offset);
ms = fa->size;
} else {
+ TclLoadDbgMsg("NXFindBestFatArch() failed");
err = NSObjectFileImageInappropriateFile;
}
if (fh->magic != FAT_MAGIC) {
- swap_fat_arch((struct fat_arch *)fatarchs, fh_nfat_arch, arch->byteorder);
+ swap_fat_arch(fatarchs, fh_nfat_arch, arch->byteorder);
}
} else {
+ TclLoadDbgMsg("Fat binary header failure");
err = NSObjectFileImageInappropriateFile;
}
} else {
@@ -613,18 +687,26 @@ TclpLoadMemory(
* Thin binary
*/
- mh = (const struct mach_header_64 *)buffer;
+ TclLoadDbgMsg("Thin binary");
+ mh = buffer;
ms = codeSize;
}
if (ms && !(ms >= mh_size && mh->magic == mh_magic &&
mh->filetype == MH_BUNDLE)) {
+ TclLoadDbgMsg("Inappropriate file: magic %x filetype %d",
+ mh->magic, mh->filetype);
err = NSObjectFileImageInappropriateFile;
}
if (err == NSObjectFileImageSuccess) {
err = NSCreateObjectFileImageFromMemory(buffer, codeSize,
&dyldObjFileImage);
- if (err != NSObjectFileImageSuccess) {
+ if (err == NSObjectFileImageSuccess) {
+ TclLoadDbgMsg("NSCreateObjectFileImageFromMemory() "
+ "successful");
+ } else {
objFileImageErrMsg = DyldOFIErrorMsg(err);
+ TclLoadDbgMsg("NSCreateObjectFileImageFromMemory() failed: %s",
+ objFileImageErrMsg);
}
} else {
objFileImageErrMsg = DyldOFIErrorMsg(err);
@@ -639,9 +721,8 @@ TclpLoadMemory(
if (dyldObjFileImage == NULL) {
vm_deallocate(mach_task_self(), (vm_address_t) buffer, size);
if (objFileImageErrMsg != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "NSCreateObjectFileImageFromMemory() error: %s",
- objFileImageErrMsg));
+ Tcl_AppendResult(interp, "NSCreateObjectFileImageFromMemory() "
+ "error: ", objFileImageErrMsg, NULL);
}
return TCL_ERROR;
}
@@ -650,21 +731,19 @@ TclpLoadMemory(
* Extract the module we want from the image of the object file.
*/
- if (!(flags & 1)) {
- nsflags |= NSLINKMODULE_OPTION_PRIVATE;
- }
- if (!(flags & 2)) {
- nsflags |= NSLINKMODULE_OPTION_BINDNOW;
- }
- module = NSLinkModule(dyldObjFileImage, "[Memory Based Bundle]", nsflags);
+ module = NSLinkModule(dyldObjFileImage, "[Memory Based Bundle]",
+ NSLINKMODULE_OPTION_BINDNOW | NSLINKMODULE_OPTION_RETURN_ON_ERROR);
NSDestroyObjectFileImage(dyldObjFileImage);
- if (!module) {
+ if (module) {
+ TclLoadDbgMsg("NSLinkModule() successful");
+ } else {
NSLinkEditErrors editError;
int errorNumber;
const char *errorName, *errMsg;
NSLinkEditError(&editError, &errorNumber, &errorName, &errMsg);
- Tcl_SetObjResult(interp, Tcl_NewStringObj(errMsg, TCL_INDEX_NONE));
+ TclLoadDbgMsg("NSLinkModule() failed: %s", errMsg);
+ Tcl_AppendResult(interp, errMsg, NULL);
return TCL_ERROR;
}
@@ -672,19 +751,18 @@ TclpLoadMemory(
* Stash the module reference within the load handle we create and return.
*/
- modulePtr = (Tcl_DyldModuleHandle *)ckalloc(sizeof(Tcl_DyldModuleHandle));
+ modulePtr = (Tcl_DyldModuleHandle *) ckalloc(sizeof(Tcl_DyldModuleHandle));
modulePtr->module = module;
modulePtr->nextPtr = NULL;
- dyldLoadHandle = (Tcl_DyldLoadHandle *)ckalloc(sizeof(Tcl_DyldLoadHandle));
+ dyldLoadHandle = (Tcl_DyldLoadHandle *)
+ ckalloc(sizeof(Tcl_DyldLoadHandle));
+#if TCL_DYLD_USE_DLFCN
dyldLoadHandle->dlHandle = NULL;
+#endif
dyldLoadHandle->dyldLibHeader = NULL;
dyldLoadHandle->modulePtr = modulePtr;
- newHandle = (Tcl_LoadHandle)ckalloc(sizeof(*newHandle));
- newHandle->clientData = dyldLoadHandle;
- newHandle->findSymbolProcPtr = &FindSymbol;
- newHandle->unloadFileProcPtr = &UnloadFile;
- *loadHandle = newHandle;
- *unloadProcPtr = &UnloadFile;
+ *loadHandle = (Tcl_LoadHandle) dyldLoadHandle;
+ *unloadProcPtr = &TclpUnloadFile;
return TCL_OK;
}
#endif /* TCL_LOAD_FROM_MEMORY */
diff --git a/unix/tclLoadNext.c b/unix/tclLoadNext.c
index b52fa2a..3de3cf1 100644
--- a/unix/tclLoadNext.c
+++ b/unix/tclLoadNext.c
@@ -4,21 +4,15 @@
* This procedure provides a version of the TclLoadFile that works with
* NeXTs rld_* dynamic loading. This file provided by Pedja Bogdanovich.
*
- * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tclInt.h"
#include <mach-o/rld.h>
#include <streams/streams.h>
-
-/* Static procedures defined within this file */
-
-static void * FindSymbol(Tcl_Interp *interp,
- Tcl_LoadHandle loadHandle, const char* symbol);
-static void UnloadFile(Tcl_LoadHandle loadHandle);
/*
*----------------------------------------------------------------------
@@ -46,17 +40,15 @@ TclpDlopen(
Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded
* file which will be passed back to
* (*unloadProcPtr)() to unload the file. */
- Tcl_FSUnloadFileProc **unloadProcPtr,
+ Tcl_FSUnloadFileProc **unloadProcPtr)
/* Filled with address of Tcl_FSUnloadFileProc
* function which should be used for this
* file. */
- int flags)
{
- Tcl_LoadHandle newHandle;
struct mach_header *header;
char *fileName;
char *files[2];
- const char *native;
+ CONST char *native;
int result = 1;
NXStream *errorStream = NXOpenMemory(0,0,NX_READWRITE);
@@ -83,7 +75,7 @@ TclpDlopen(
Tcl_DString ds;
- native = Tcl_UtfToExternalDString(NULL, fileName, TCL_INDEX_NONE, &ds);
+ native = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds);
files = {native,NULL};
result = rld_load(errorStream, &header, files, NULL);
Tcl_DStringFree(&ds);
@@ -93,20 +85,16 @@ TclpDlopen(
char *data;
int len, maxlen;
- NXGetMemoryBuffer(errorStream, &data, &len, &maxlen);
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't load file \"%s\": %s", fileName, data));
+ NXGetMemoryBuffer(errorStream,&data,&len,&maxlen);
+ Tcl_AppendResult(interp, "couldn't load file \"", fileName, "\": ",
+ data, NULL);
NXCloseMemory(errorStream, NX_FREEBUFFER);
return TCL_ERROR;
}
NXCloseMemory(errorStream, NX_FREEBUFFER);
- newHandle = (Tcl_LoadHandle) ckalloc(sizeof(*newHandle));
- newHandle->clientData = INT2PTR(1);
- newHandle->findSymbolProcPtr = &FindSymbol;
- newHandle->unloadFileProcPtr = &UnloadFile;
- *loadHandle = newHandle;
- *unloadProcPtr = &UnloadFile;
+ *loadHandle = (Tcl_LoadHandle)1; /* A dummy non-NULL value */
+ *unloadProcPtr = &TclpUnloadFile;
return TCL_OK;
}
@@ -114,7 +102,7 @@ TclpDlopen(
/*
*----------------------------------------------------------------------
*
- * FindSymbol --
+ * TclpFindSymbol --
*
* Looks up a symbol, by name, through a handle associated with a
* previously loaded piece of code (shared library).
@@ -127,26 +115,20 @@ TclpDlopen(
*----------------------------------------------------------------------
*/
-static void *
-FindSymbol(
+Tcl_PackageInitProc *
+TclpFindSymbol(
Tcl_Interp *interp,
Tcl_LoadHandle loadHandle,
- const char *symbol)
+ CONST char *symbol)
{
- Tcl_LibraryInitProc *proc = NULL;
-
+ Tcl_PackageInitProc *proc = NULL;
if (symbol) {
char sym[strlen(symbol) + 2];
sym[0] = '_';
sym[1] = 0;
strcat(sym, symbol);
- rld_lookup(NULL, sym, (unsigned long *) &proc);
- }
- if (proc == NULL && interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "cannot find symbol \"%s\"", symbol));
- Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, (void *)NULL);
+ rld_lookup(NULL, sym, (unsigned long *)&proc);
}
return proc;
}
@@ -154,7 +136,7 @@ FindSymbol(
/*
*----------------------------------------------------------------------
*
- * UnloadFile --
+ * TclpUnloadFile --
*
* Unloads a dynamically loaded binary code file from memory. Code
* pointers in the formerly loaded file are no longer valid after calling
@@ -170,12 +152,41 @@ FindSymbol(
*/
void
-UnloadFile(
+TclpUnloadFile(
Tcl_LoadHandle loadHandle) /* loadHandle returned by a previous call to
* TclpDlopen(). The loadHandle is a token
* that represents the loaded file. */
{
- ckfree(loadHandle);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclGuessPackageName --
+ *
+ * If the "load" command is invoked without providing a package name,
+ * this procedure is invoked to try to figure it out.
+ *
+ * Results:
+ * Always returns 0 to indicate that we couldn't figure out a package
+ * name; generic code will then try to guess the package from the file
+ * name. A return value of 1 would have meant that we figured out the
+ * package name and put it in bufPtr.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclGuessPackageName(
+ CONST char *fileName, /* Name of file containing package (already
+ * translated to local form if needed). */
+ Tcl_DString *bufPtr) /* Initialized empty dstring. Append package
+ * name to this if possible. */
+{
+ return 0;
}
/*
diff --git a/unix/tclLoadOSF.c b/unix/tclLoadOSF.c
index 81468b8..37536cf 100644
--- a/unix/tclLoadOSF.c
+++ b/unix/tclLoadOSF.c
@@ -26,7 +26,7 @@
*
* John Robert LoVerso <loverso@freebsd.osf.org>
*
- * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -35,14 +35,6 @@
#include "tclInt.h"
#include <sys/types.h>
#include <loader.h>
-
-/*
- * Static functions defined within this file.
- */
-
-static void * FindSymbol(Tcl_Interp *interp,
- Tcl_LoadHandle loadHandle, const char* symbol);
-static void UnloadFile(Tcl_LoadHandle handle);
/*
*----------------------------------------------------------------------
@@ -70,17 +62,15 @@ TclpDlopen(
Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded
* file which will be passed back to
* (*unloadProcPtr)() to unload the file. */
- Tcl_FSUnloadFileProc **unloadProcPtr,
+ Tcl_FSUnloadFileProc **unloadProcPtr)
/* Filled with address of Tcl_FSUnloadFileProc
* function which should be used for this
* file. */
- int flags)
{
- Tcl_LoadHandle newHandle;
ldr_module_t lm;
char *pkg;
char *fileName = Tcl_GetString(pathPtr);
- const char *native;
+ CONST char *native;
/*
* First try the full path the user gave us. This is particularly
@@ -89,7 +79,7 @@ TclpDlopen(
*/
native = Tcl_FSGetNativePath(pathPtr);
- lm = (Tcl_LibraryInitProc *) load(native, LDR_NOFLAGS);
+ lm = (Tcl_PackageInitProc *) load(native, LDR_NOFLAGS);
if (lm == LDR_NULL_MODULE) {
/*
@@ -100,15 +90,14 @@ TclpDlopen(
Tcl_DString ds;
- native = Tcl_UtfToExternalDString(NULL, fileName, TCL_INDEX_NONE, &ds);
- lm = (Tcl_LibraryInitProc *) load(native, LDR_NOFLAGS);
+ native = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds);
+ lm = (Tcl_PackageInitProc *) load(native, LDR_NOFLAGS);
Tcl_DStringFree(&ds);
}
if (lm == LDR_NULL_MODULE) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't load file \"%s\": %s",
- fileName, Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, "couldn't load file \"", fileName, "\": ",
+ Tcl_PosixError(interp), NULL);
return TCL_ERROR;
}
@@ -128,19 +117,15 @@ TclpDlopen(
} else {
pkg++;
}
- newHandle = (Tcl_LoadHandle)ckalloc(sizeof(*newHandle));
- newHandle->clientData = pkg;
- newHandle->findSymbolProcPtr = &FindSymbol;
- newHandle->unloadFileProcPtr = &UnloadFile;
- *loadHandle = newHandle;
- *unloadProcPtr = &UnloadFile;
+ *loadHandle = pkg;
+ *unloadProcPtr = &TclpUnloadFile;
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
- * FindSymbol --
+ * TclpFindSymbol --
*
* Looks up a symbol, by name, through a handle associated with a
* previously loaded piece of code (shared library).
@@ -153,26 +138,19 @@ TclpDlopen(
*----------------------------------------------------------------------
*/
-static void *
-FindSymbol(
+Tcl_PackageInitProc *
+TclpFindSymbol(
Tcl_Interp *interp,
Tcl_LoadHandle loadHandle,
- const char *symbol)
+ CONST char *symbol)
{
- void *retval = ldr_lookup_package((char *) loadHandle, symbol);
-
- if (retval == NULL && interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "cannot find symbol \"%s\"", symbol));
- Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, (void *)NULL);
- }
- return retval;
+ return ldr_lookup_package((char *)loadHandle, symbol);
}
/*
*----------------------------------------------------------------------
*
- * UnloadFile --
+ * TclpUnloadFile --
*
* Unloads a dynamically loaded binary code file from memory. Code
* pointers in the formerly loaded file are no longer valid after calling
@@ -187,13 +165,42 @@ FindSymbol(
*----------------------------------------------------------------------
*/
-static void
-UnloadFile(
+void
+TclpUnloadFile(
Tcl_LoadHandle loadHandle) /* loadHandle returned by a previous call to
* TclpDlopen(). The loadHandle is a token
* that represents the loaded file. */
{
- ckfree(loadHandle);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclGuessPackageName --
+ *
+ * If the "load" command is invoked without providing a package name,
+ * this function is invoked to try to figure it out.
+ *
+ * Results:
+ * Always returns 0 to indicate that we couldn't figure out a package
+ * name; generic code will then try to guess the package from the file
+ * name. A return value of 1 would have meant that we figured out the
+ * package name and put it in bufPtr.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclGuessPackageName(
+ CONST char *fileName, /* Name of file containing package (already
+ * translated to local form if needed). */
+ Tcl_DString *bufPtr) /* Initialized empty dstring. Append package
+ * name to this if possible. */
+{
+ return 0;
}
/*
diff --git a/unix/tclLoadShl.c b/unix/tclLoadShl.c
index 5cde183..8aaefda 100644
--- a/unix/tclLoadShl.c
+++ b/unix/tclLoadShl.c
@@ -5,7 +5,7 @@
* the "shl_load" and "shl_findsym" library procedures for dynamic
* loading (e.g. for HP machines).
*
- * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -13,14 +13,6 @@
#include <dl.h>
#include "tclInt.h"
-
-/*
- * Static functions defined within this file.
- */
-
-static void * FindSymbol(Tcl_Interp *interp,
- Tcl_LoadHandle loadHandle, const char *symbol);
-static void UnloadFile(Tcl_LoadHandle handle);
/*
*----------------------------------------------------------------------
@@ -48,15 +40,13 @@ TclpDlopen(
Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded
* file which will be passed back to
* (*unloadProcPtr)() to unload the file. */
- Tcl_FSUnloadFileProc **unloadProcPtr,
+ Tcl_FSUnloadFileProc **unloadProcPtr)
/* Filled with address of Tcl_FSUnloadFileProc
* function which should be used for this
* file. */
- int flags)
{
shl_t handle;
- Tcl_LoadHandle newHandle;
- const char *native;
+ CONST char *native;
char *fileName = Tcl_GetString(pathPtr);
/*
@@ -86,29 +76,25 @@ TclpDlopen(
Tcl_DString ds;
- native = Tcl_UtfToExternalDString(NULL, fileName, TCL_INDEX_NONE, &ds);
+ native = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds);
handle = shl_load(native, BIND_DEFERRED|BIND_VERBOSE|DYNAMIC_PATH, 0L);
Tcl_DStringFree(&ds);
}
if (handle == NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't load file \"%s\": %s",
- fileName, Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, "couldn't load file \"", fileName, "\": ",
+ Tcl_PosixError(interp), (char *) NULL);
return TCL_ERROR;
}
- newHandle = (Tcl_LoadHandle)ckalloc(sizeof(*newHandle));
- newHandle->clientData = handle;
- newHandle->findSymbolProcPtr = &FindSymbol;
- newHandle->unloadFileProcPtr = *unloadProcPtr = &UnloadFile;
- *loadHandle = newHandle;
+ *loadHandle = (Tcl_LoadHandle) handle;
+ *unloadProcPtr = &TclpUnloadFile;
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
- * Tcl_FindSymbol --
+ * TclpFindSymbol --
*
* Looks up a symbol, by name, through a handle associated with a
* previously loaded piece of code (shared library).
@@ -121,15 +107,15 @@ TclpDlopen(
*----------------------------------------------------------------------
*/
-static void*
-FindSymbol(
+Tcl_PackageInitProc *
+TclpFindSymbol(
Tcl_Interp *interp,
Tcl_LoadHandle loadHandle,
- const char *symbol)
+ CONST char *symbol)
{
Tcl_DString newName;
- Tcl_LibraryInitProc *proc = NULL;
- shl_t handle = (shl_t) loadHandle->clientData;
+ Tcl_PackageInitProc *proc = NULL;
+ shl_t handle = (shl_t)loadHandle;
/*
* Some versions of the HP system software still use "_" at the beginning
@@ -139,26 +125,21 @@ FindSymbol(
if (shl_findsym(&handle, symbol, (short) TYPE_PROCEDURE,
(void *) &proc) != 0) {
Tcl_DStringInit(&newName);
- TclDStringAppendLiteral(&newName, "_");
- Tcl_DStringAppend(&newName, symbol, TCL_INDEX_NONE);
+ Tcl_DStringAppend(&newName, "_", 1);
+ Tcl_DStringAppend(&newName, symbol, -1);
if (shl_findsym(&handle, Tcl_DStringValue(&newName),
(short) TYPE_PROCEDURE, (void *) &proc) != 0) {
proc = NULL;
}
Tcl_DStringFree(&newName);
}
- if (proc == NULL && interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "cannot find symbol \"%s\": %s",
- symbol, Tcl_PosixError(interp)));
- }
return proc;
}
/*
*----------------------------------------------------------------------
*
- * UnloadFile --
+ * TclpUnloadFile --
*
* Unloads a dynamically loaded binary code file from memory. Code
* pointers in the formerly loaded file are no longer valid after calling
@@ -173,16 +154,46 @@ FindSymbol(
*----------------------------------------------------------------------
*/
-static void
-UnloadFile(
+void
+TclpUnloadFile(
Tcl_LoadHandle loadHandle) /* loadHandle returned by a previous call to
* TclpDlopen(). The loadHandle is a token
* that represents the loaded file. */
{
- shl_t handle = (shl_t) loadHandle->clientData;
+ shl_t handle;
+ handle = (shl_t) loadHandle;
shl_unload(handle);
- ckfree(loadHandle);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclGuessPackageName --
+ *
+ * If the "load" command is invoked without providing a package name,
+ * this procedure is invoked to try to figure it out.
+ *
+ * Results:
+ * Always returns 0 to indicate that we couldn't figure out a package
+ * name; generic code will then try to guess the package from the file
+ * name. A return value of 1 would have meant that we figured out the
+ * package name and put it in bufPtr.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclGuessPackageName(
+ CONST char *fileName, /* Name of file containing package (already
+ * translated to local form if needed). */
+ Tcl_DString *bufPtr) /* Initialized empty dstring. Append package
+ * name to this if possible. */
+{
+ return 0;
}
/*
diff --git a/unix/tclSelectNotfy.c b/unix/tclSelectNotfy.c
deleted file mode 100644
index e41cefa..0000000
--- a/unix/tclSelectNotfy.c
+++ /dev/null
@@ -1,1233 +0,0 @@
-/*
- * tclSelectNotfy.c --
- *
- * This file contains the implementation of the select()-based generic
- * Unix notifier, which is the lowest-level part of the Tcl event loop.
- * This file works together with generic/tclNotify.c.
- *
- * Copyright © 1995-1997 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- */
-
-#include "tclInt.h"
-#ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is
- * in tclMacOSXNotify.c */
-#if (!defined(NOTIFIER_EPOLL) && !defined(NOTIFIER_KQUEUE)) || !TCL_THREADS
-
-#include <signal.h>
-
-/*
- * This structure is used to keep track of the notifier info for a registered
- * file.
- */
-
-typedef struct FileHandler {
- int fd;
- int mask; /* Mask of desired events: TCL_READABLE,
- * etc. */
- int readyMask; /* Mask of events that have been seen since
- * the last time file handlers were invoked
- * for this file. */
- Tcl_FileProc *proc; /* Function to call, in the style of
- * Tcl_CreateFileHandler. */
- void *clientData; /* Argument to pass to proc. */
- struct FileHandler *nextPtr;/* Next in list of all files we care about. */
-} FileHandler;
-
-/*
- * The following structure contains a set of select() masks to track readable,
- * writable, and exception conditions.
- */
-
-typedef struct {
- fd_set readable;
- fd_set writable;
- fd_set exception;
-} SelectMasks;
-
-/*
- * The following structure is what is added to the Tcl event queue when file
- * handlers are ready to fire.
- */
-
-typedef struct {
- Tcl_Event header; /* Information that is standard for all
- * events. */
- int fd; /* File descriptor that is ready. Used to find
- * the FileHandler structure for the file
- * (can't point directly to the FileHandler
- * structure because it could go away while
- * the event is queued). */
-} FileHandlerEvent;
-
-/*
- * The following static structure contains the state information for the
- * select based implementation of the Tcl notifier. One of these structures is
- * created for each thread that is using the notifier.
- */
-
-typedef struct ThreadSpecificData {
- FileHandler *firstFileHandlerPtr;
- /* Pointer to head of file handler list. */
- SelectMasks checkMasks; /* This structure is used to build up the
- * masks to be used in the next call to
- * select. Bits are set in response to calls
- * to Tcl_CreateFileHandler. */
- SelectMasks readyMasks; /* This array reflects the readable/writable
- * conditions that were found to exist by the
- * last call to select. */
- int numFdBits; /* Number of valid bits in checkMasks (one
- * more than highest fd for which
- * Tcl_WatchFile has been called). */
-#if TCL_THREADS
- int onList; /* True if it is in this list */
- unsigned int pollState; /* pollState is used to implement a polling
- * handshake between each thread and the
- * notifier thread. Bits defined below. */
- struct ThreadSpecificData *nextPtr, *prevPtr;
- /* All threads that are currently waiting on
- * an event have their ThreadSpecificData
- * structure on a doubly-linked listed formed
- * from these pointers. You must hold the
- * notifierMutex lock before accessing these
- * fields. */
-#ifdef __CYGWIN__
- void *event; /* Any other thread alerts a notifier that an
- * event is ready to be processed by sending
- * this event. */
- void *hwnd; /* Messaging window. */
-#else /* !__CYGWIN__ */
- pthread_cond_t waitCV; /* Any other thread alerts a notifier that an
- * event is ready to be processed by signaling
- * this condition variable. */
-#endif /* __CYGWIN__ */
- int waitCVinitialized; /* Variable to flag initialization of the
- * structure. */
- int eventReady; /* True if an event is ready to be processed.
- * Used as condition flag together with waitCV
- * above. */
-#endif /* TCL_THREADS */
-} ThreadSpecificData;
-
-static Tcl_ThreadDataKey dataKey;
-
-#if TCL_THREADS
-/*
- * The following static indicates the number of threads that have initialized
- * notifiers.
- *
- * You must hold the notifierMutex lock before accessing this variable.
- */
-
-static int notifierCount = 0;
-
-/*
- * The following variable points to the head of a doubly-linked list of
- * ThreadSpecificData structures for all threads that are currently waiting on
- * an event.
- *
- * You must hold the notifierMutex lock before accessing this list.
- */
-
-static ThreadSpecificData *waitingListPtr = NULL;
-
-/*
- * The notifier thread spends all its time in select() waiting for a file
- * descriptor associated with one of the threads on the waitingListPtr list to
- * do something interesting. But if the contents of the waitingListPtr list
- * ever changes, we need to wake up and restart the select() system call. You
- * can wake up the notifier thread by writing a single byte to the file
- * descriptor defined below. This file descriptor is the input-end of a pipe
- * and the notifier thread is listening for data on the output-end of the same
- * pipe. Hence writing to this file descriptor will cause the select() system
- * call to return and wake up the notifier thread.
- *
- * You must hold the notifierMutex lock before writing to the pipe.
- */
-
-static int triggerPipe = -1;
-static int otherPipe = -1;
-
-/*
- * The notifierMutex locks access to all of the global notifier state.
- */
-
-static pthread_mutex_t notifierInitMutex = PTHREAD_MUTEX_INITIALIZER;
-static pthread_mutex_t notifierMutex = PTHREAD_MUTEX_INITIALIZER;
-/*
- * The following static indicates if the notifier thread is running.
- *
- * You must hold the notifierInitMutex before accessing this variable.
- */
-
-static int notifierThreadRunning = 0;
-
-/*
- * The following static flag indicates that async handlers are pending.
- */
-
-static int asyncPending = 0;
-
-/*
- * The notifier thread signals the notifierCV when it has finished
- * initializing the triggerPipe and right before the notifier thread
- * terminates. This condition is used to deal with the signal mask, too.
- */
-
-static pthread_cond_t notifierCV = PTHREAD_COND_INITIALIZER;
-
-/*
- * The pollState bits:
- *
- * POLL_WANT is set by each thread before it waits on its condition variable.
- * It is checked by the notifier before it does select.
- *
- * POLL_DONE is set by the notifier if it goes into select after seeing
- * POLL_WANT. The idea is to ensure it tries a select with the same bits
- * the initial thread had set.
- */
-
-#define POLL_WANT 0x1
-#define POLL_DONE 0x2
-
-/*
- * This is the thread ID of the notifier thread that does select.
- */
-
-static Tcl_ThreadId notifierThread;
-
-/*
- * Signal mask information for notifier thread.
- */
-
-static sigset_t notifierSigMask;
-#ifndef HAVE_PSELECT
-static sigset_t allSigMask;
-#endif /* HAVE_PSELECT */
-
-#endif /* TCL_THREADS */
-
-/*
- * Static routines defined in this file.
- */
-
-#if TCL_THREADS
-static TCL_NORETURN void NotifierThreadProc(void *clientData);
-#if defined(HAVE_PTHREAD_ATFORK)
-static int atForkInit = 0;
-static void AtForkChild(void);
-#endif /* HAVE_PTHREAD_ATFORK */
-#endif /* TCL_THREADS */
-static int FileHandlerEventProc(Tcl_Event *evPtr, int flags);
-
-/*
- * Import of critical bits of Windows API when building threaded with Cygwin.
- */
-
-#if defined(__CYGWIN__)
-#ifdef __cplusplus
-extern "C" {
-#endif
-typedef struct {
- void *hwnd; /* Messaging window. */
- unsigned int *message; /* Message payload. */
- size_t wParam; /* Event-specific "word" parameter. */
- size_t lParam; /* Event-specific "long" parameter. */
- int time; /* Event timestamp. */
- int x; /* Event location (where meaningful). */
- int y;
- int lPrivate;
-} MSG;
-
-typedef struct {
- unsigned int style;
- void *lpfnWndProc;
- int cbClsExtra;
- int cbWndExtra;
- void *hInstance;
- void *hIcon;
- void *hCursor;
- void *hbrBackground;
- const void *lpszMenuName;
- const void *lpszClassName;
-} WNDCLASSW;
-
-#ifdef __clang__
-#pragma clang diagnostic ignored "-Wignored-attributes"
-#endif
-extern void __stdcall CloseHandle(void *);
-extern void *__stdcall CreateEventW(void *, unsigned char, unsigned char,
- void *);
-extern void *__stdcall CreateWindowExW(void *, const void *, const void *,
- unsigned int, int, int, int, int, void *, void *,
- void *, void *);
-extern unsigned int __stdcall DefWindowProcW(void *, int, void *, void *);
-extern unsigned char __stdcall DestroyWindow(void *);
-extern int __stdcall DispatchMessageW(const MSG *);
-extern unsigned char __stdcall GetMessageW(MSG *, void *, int, int);
-extern void __stdcall MsgWaitForMultipleObjects(unsigned int, void *,
- unsigned char, unsigned int, unsigned int);
-extern unsigned char __stdcall PeekMessageW(MSG *, void *, int, int, int);
-extern unsigned char __stdcall PostMessageW(void *, unsigned int, void *,
- void *);
-extern void __stdcall PostQuitMessage(int);
-extern void *__stdcall RegisterClassW(const WNDCLASSW *);
-extern unsigned char __stdcall ResetEvent(void *);
-extern unsigned char __stdcall TranslateMessage(const MSG *);
-
-/*
- * Threaded-cygwin specific constants and functions in this file:
- */
-
-#if TCL_THREADS && defined(__CYGWIN__)
-static const wchar_t className[] = L"TclNotifier";
-static unsigned int __stdcall NotifierProc(void *hwnd, unsigned int message,
- void *wParam, void *lParam);
-#endif /* TCL_THREADS && defined(__CYGWIN__) */
-#ifdef __cplusplus
-}
-#endif
-#endif /* TCL_THREADS && __CYGWIN__ */
-
-/*
- * Incorporate the base notifier implementation.
- */
-
-#include "tclUnixNotfy.c"
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpInitNotifier --
- *
- * Initializes the platform specific notifier state.
- *
- * Results:
- * Returns a handle to the notifier state for this thread.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-ClientData
-TclpInitNotifier(void)
-{
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
-
-#if TCL_THREADS
- tsdPtr->eventReady = 0;
-
- /*
- * Initialize thread specific condition variable for this thread.
- */
-
- if (tsdPtr->waitCVinitialized == 0) {
-#ifdef __CYGWIN__
- WNDCLASSW clazz;
-
- clazz.style = 0;
- clazz.cbClsExtra = 0;
- clazz.cbWndExtra = 0;
- clazz.hInstance = TclWinGetTclInstance();
- clazz.hbrBackground = NULL;
- clazz.lpszMenuName = NULL;
- clazz.lpszClassName = className;
- clazz.lpfnWndProc = (void *) NotifierProc;
- clazz.hIcon = NULL;
- clazz.hCursor = NULL;
-
- RegisterClassW(&clazz);
- tsdPtr->hwnd = CreateWindowExW(NULL, clazz.lpszClassName,
- clazz.lpszClassName, 0, 0, 0, 0, 0, NULL, NULL,
- clazz.hInstance, NULL);
- tsdPtr->event = CreateEventW(NULL, 1 /* manual */,
- 0 /* !signaled */, NULL);
-#else /* !__CYGWIN__ */
- pthread_cond_init(&tsdPtr->waitCV, NULL);
-#endif /* __CYGWIN__ */
- tsdPtr->waitCVinitialized = 1;
- }
-
- pthread_mutex_lock(&notifierInitMutex);
-#if defined(HAVE_PTHREAD_ATFORK)
- /*
- * Install pthread_atfork handlers to clean up the notifier in the child
- * of a fork.
- */
-
- if (!atForkInit) {
- int result = pthread_atfork(NULL, NULL, AtForkChild);
-
- if (result) {
- Tcl_Panic("Tcl_InitNotifier: %s", "pthread_atfork failed");
- }
- atForkInit = 1;
- }
-#endif /* HAVE_PTHREAD_ATFORK */
-
- notifierCount++;
- pthread_mutex_unlock(&notifierInitMutex);
-#endif /* TCL_THREADS */
-
- return tsdPtr;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpFinalizeNotifier --
- *
- * This function is called to cleanup the notifier state before a thread
- * is terminated.
- *
- * Results:
- * None.
- *
- * Side effects:
- * May terminate the background notifier thread if this is the last
- * notifier instance.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpFinalizeNotifier(
- TCL_UNUSED(void *))
-{
-#if TCL_THREADS
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
-
- pthread_mutex_lock(&notifierInitMutex);
- notifierCount--;
-
- /*
- * If this is the last thread to use the notifier, close the notifier pipe
- * and wait for the background thread to terminate.
- */
-
- if (notifierCount == 0 && triggerPipe != -1) {
- if (write(triggerPipe, "q", 1) != 1) {
- Tcl_Panic("Tcl_FinalizeNotifier: %s",
- "unable to write 'q' to triggerPipe");
- }
- close(triggerPipe);
- pthread_mutex_lock(&notifierMutex);
- while(triggerPipe != -1) {
- pthread_cond_wait(&notifierCV, &notifierMutex);
- }
- pthread_mutex_unlock(&notifierMutex);
- if (notifierThreadRunning) {
- int result = pthread_join((pthread_t) notifierThread, NULL);
-
- if (result) {
- Tcl_Panic("Tcl_FinalizeNotifier: %s",
- "unable to join notifier thread");
- }
- notifierThreadRunning = 0;
-
- /*
- * If async marks are outstanding, perform actions now.
- */
- if (asyncPending) {
- asyncPending = 0;
- TclAsyncMarkFromNotifier();
- }
- }
- }
-
- /*
- * Clean up any synchronization objects in the thread local storage.
- */
-
-#ifdef __CYGWIN__
- DestroyWindow(tsdPtr->hwnd);
- CloseHandle(tsdPtr->event);
-#else /* !__CYGWIN__ */
- pthread_cond_destroy(&tsdPtr->waitCV);
-#endif /* __CYGWIN__ */
- tsdPtr->waitCVinitialized = 0;
-
- pthread_mutex_unlock(&notifierInitMutex);
-#endif /* TCL_THREADS */
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpCreateFileHandler --
- *
- * This function registers a file handler with the select notifier.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Creates a new file handler structure.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpCreateFileHandler(
- int fd, /* Handle of stream to watch. */
- int mask, /* OR'ed combination of TCL_READABLE,
- * TCL_WRITABLE, and TCL_EXCEPTION: indicates
- * conditions under which proc should be
- * called. */
- Tcl_FileProc *proc, /* Function to call for each selected
- * event. */
- void *clientData) /* Arbitrary data to pass to proc. */
-{
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- FileHandler *filePtr = LookUpFileHandler(tsdPtr, fd, NULL);
-
- if (filePtr == NULL) {
- filePtr = (FileHandler *) ckalloc(sizeof(FileHandler));
- filePtr->fd = fd;
- filePtr->readyMask = 0;
- filePtr->nextPtr = tsdPtr->firstFileHandlerPtr;
- tsdPtr->firstFileHandlerPtr = filePtr;
- }
- filePtr->proc = proc;
- filePtr->clientData = clientData;
- filePtr->mask = mask;
-
- /*
- * Update the check masks for this file.
- */
-
- if (mask & TCL_READABLE) {
- FD_SET(fd, &tsdPtr->checkMasks.readable);
- } else {
- FD_CLR(fd, &tsdPtr->checkMasks.readable);
- }
- if (mask & TCL_WRITABLE) {
- FD_SET(fd, &tsdPtr->checkMasks.writable);
- } else {
- FD_CLR(fd, &tsdPtr->checkMasks.writable);
- }
- if (mask & TCL_EXCEPTION) {
- FD_SET(fd, &tsdPtr->checkMasks.exception);
- } else {
- FD_CLR(fd, &tsdPtr->checkMasks.exception);
- }
- if (tsdPtr->numFdBits <= fd) {
- tsdPtr->numFdBits = fd + 1;
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpDeleteFileHandler --
- *
- * Cancel a previously-arranged callback arrangement for a file.
- *
- * Results:
- * None.
- *
- * Side effects:
- * If a callback was previously registered on file, remove it.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpDeleteFileHandler(
- int fd) /* Stream id for which to remove callback
- * function. */
-{
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- FileHandler *filePtr, *prevPtr;
- int i;
-
- /*
- * Find the entry for the given file (and return if there isn't one).
- */
-
- filePtr = LookUpFileHandler(tsdPtr, fd, &prevPtr);
- if (filePtr == NULL) {
- return;
- }
-
- /*
- * Update the check masks for this file.
- */
-
- if (filePtr->mask & TCL_READABLE) {
- FD_CLR(fd, &tsdPtr->checkMasks.readable);
- }
- if (filePtr->mask & TCL_WRITABLE) {
- FD_CLR(fd, &tsdPtr->checkMasks.writable);
- }
- if (filePtr->mask & TCL_EXCEPTION) {
- FD_CLR(fd, &tsdPtr->checkMasks.exception);
- }
-
- /*
- * Find current max fd.
- */
-
- if (fd + 1 == tsdPtr->numFdBits) {
- int numFdBits = 0;
-
- for (i = fd - 1; i >= 0; i--) {
- if (FD_ISSET(i, &tsdPtr->checkMasks.readable)
- || FD_ISSET(i, &tsdPtr->checkMasks.writable)
- || FD_ISSET(i, &tsdPtr->checkMasks.exception)) {
- numFdBits = i + 1;
- break;
- }
- }
- tsdPtr->numFdBits = numFdBits;
- }
-
- /*
- * Clean up information in the callback record.
- */
-
- if (prevPtr == NULL) {
- tsdPtr->firstFileHandlerPtr = filePtr->nextPtr;
- } else {
- prevPtr->nextPtr = filePtr->nextPtr;
- }
- ckfree(filePtr);
-}
-
-#if TCL_THREADS && defined(__CYGWIN__)
-
-static unsigned int __stdcall
-NotifierProc(
- void *hwnd,
- unsigned int message,
- void *wParam,
- void *lParam)
-{
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
-
- if (message != 1024) {
- return DefWindowProcW(hwnd, message, wParam, lParam);
- }
-
- /*
- * Process all of the runnable events.
- */
-
- tsdPtr->eventReady = 1;
- Tcl_ServiceAll();
- return 0;
-}
-#endif /* TCL_THREADS && __CYGWIN__ */
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpWaitForEvent --
- *
- * This function is called by Tcl_DoOneEvent to wait for new events on
- * the message queue. If the block time is 0, then Tcl_WaitForEvent just
- * polls without blocking.
- *
- * Results:
- * Returns -1 if the select would block forever, otherwise returns 0.
- *
- * Side effects:
- * Queues file events that are detected by the select.
- *
- *----------------------------------------------------------------------
- */
-
-int
-TclpWaitForEvent(
- const Tcl_Time *timePtr) /* Maximum block time, or NULL. */
-{
- FileHandler *filePtr;
- int mask;
- Tcl_Time vTime;
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
-#if TCL_THREADS
- int waitForFiles;
-# ifdef __CYGWIN__
- MSG msg;
-# endif /* __CYGWIN__ */
-#else /* !TCL_THREADS */
- /*
- * Impl. notes: timeout & timeoutPtr are used if, and only if threads are
- * not enabled. They are the arguments for the regular select() used when
- * the core is not thread-enabled.
- */
-
- struct timeval timeout, *timeoutPtr;
- int numFound;
-#endif /* TCL_THREADS */
-
- /*
- * Set up the timeout structure. Note that if there are no events to check
- * for, we return with a negative result rather than blocking forever.
- */
-
- if (timePtr != NULL) {
- /*
- * TIP #233 (Virtualized Time). Is virtual time in effect? And do we
- * actually have something to scale? If yes to both then we call the
- * handler to do this scaling.
- */
-
- if (timePtr->sec != 0 || timePtr->usec != 0) {
- vTime = *timePtr;
- TclScaleTime(&vTime);
- timePtr = &vTime;
- }
-#if !TCL_THREADS
- timeout.tv_sec = timePtr->sec;
- timeout.tv_usec = timePtr->usec;
- timeoutPtr = &timeout;
- } else if (tsdPtr->numFdBits == 0) {
- /*
- * If there are no threads, no timeout, and no fds registered, then
- * there are no events possible and we must avoid deadlock. Note that
- * this is not entirely correct because there might be a signal that
- * could interrupt the select call, but we don't handle that case if
- * we aren't using threads.
- */
-
- return -1;
- } else {
- timeoutPtr = NULL;
-#endif /* !TCL_THREADS */
- }
-
-#if TCL_THREADS
- /*
- * Start notifier thread and place this thread on the list of interested
- * threads, signal the notifier thread, and wait for a response or a
- * timeout.
- */
-
- StartNotifierThread("Tcl_WaitForEvent");
-
- pthread_mutex_lock(&notifierMutex);
-
- if (timePtr != NULL && timePtr->sec == 0 && (timePtr->usec == 0
-#if defined(__APPLE__) && defined(__LP64__)
- /*
- * On 64-bit Darwin, pthread_cond_timedwait() appears to have a
- * bug that causes it to wait forever when passed an absolute time
- * which has already been exceeded by the system time; as a
- * workaround, when given a very brief timeout, just do a poll.
- * [Bug 1457797]
- */
- || timePtr->usec < 10
-#endif /* __APPLE__ && __LP64__ */
- )) {
- /*
- * Cannot emulate a polling select with a polling condition variable.
- * Instead, pretend to wait for files and tell the notifier thread
- * what we are doing. The notifier thread makes sure it goes through
- * select with its select mask in the same state as ours currently is.
- * We block until that happens.
- */
-
- waitForFiles = 1;
- tsdPtr->pollState = POLL_WANT;
- timePtr = NULL;
- } else {
- waitForFiles = (tsdPtr->numFdBits > 0);
- tsdPtr->pollState = 0;
- }
-
- if (waitForFiles) {
- /*
- * Add the ThreadSpecificData structure of this thread to the list of
- * ThreadSpecificData structures of all threads that are waiting on
- * file events.
- */
-
- tsdPtr->nextPtr = waitingListPtr;
- if (waitingListPtr) {
- waitingListPtr->prevPtr = tsdPtr;
- }
- tsdPtr->prevPtr = 0;
- waitingListPtr = tsdPtr;
- tsdPtr->onList = 1;
-
- if ((write(triggerPipe, "", 1) == -1) && (errno != EAGAIN)) {
- Tcl_Panic("Tcl_WaitForEvent: %s",
- "unable to write to triggerPipe");
- }
- }
-
- FD_ZERO(&tsdPtr->readyMasks.readable);
- FD_ZERO(&tsdPtr->readyMasks.writable);
- FD_ZERO(&tsdPtr->readyMasks.exception);
-
- if (!tsdPtr->eventReady) {
-#ifdef __CYGWIN__
- if (!PeekMessageW(&msg, NULL, 0, 0, 0)) {
- unsigned int timeout;
-
- if (timePtr) {
- timeout = timePtr->sec * 1000 + timePtr->usec / 1000;
- } else {
- timeout = 0xFFFFFFFF;
- }
- pthread_mutex_unlock(&notifierMutex);
- MsgWaitForMultipleObjects(1, &tsdPtr->event, 0, timeout, 1279);
- pthread_mutex_lock(&notifierMutex);
- }
-#else /* !__CYGWIN__ */
- if (timePtr != NULL) {
- Tcl_Time now;
- struct timespec ptime;
-
- Tcl_GetTime(&now);
- ptime.tv_sec = timePtr->sec + now.sec +
- (timePtr->usec + now.usec) / 1000000;
- ptime.tv_nsec = 1000 * ((timePtr->usec + now.usec) % 1000000);
-
- pthread_cond_timedwait(&tsdPtr->waitCV, &notifierMutex, &ptime);
- } else {
- pthread_cond_wait(&tsdPtr->waitCV, &notifierMutex);
- }
-#endif /* __CYGWIN__ */
- }
- tsdPtr->eventReady = 0;
-
-#ifdef __CYGWIN__
- while (PeekMessageW(&msg, NULL, 0, 0, 0)) {
- /*
- * Retrieve and dispatch the message.
- */
-
- unsigned int result = GetMessageW(&msg, NULL, 0, 0);
-
- if (result == 0) {
- PostQuitMessage(msg.wParam);
- /* What to do here? */
- } else if (result != (unsigned int) -1) {
- TranslateMessage(&msg);
- DispatchMessageW(&msg);
- }
- }
- ResetEvent(tsdPtr->event);
-#endif /* __CYGWIN__ */
-
- if (waitForFiles && tsdPtr->onList) {
- /*
- * Remove the ThreadSpecificData structure of this thread from the
- * waiting list. Alert the notifier thread to recompute its select
- * masks - skipping this caused a hang when trying to close a pipe
- * which the notifier thread was still doing a select on.
- */
-
- if (tsdPtr->prevPtr) {
- tsdPtr->prevPtr->nextPtr = tsdPtr->nextPtr;
- } else {
- waitingListPtr = tsdPtr->nextPtr;
- }
- if (tsdPtr->nextPtr) {
- tsdPtr->nextPtr->prevPtr = tsdPtr->prevPtr;
- }
- tsdPtr->nextPtr = tsdPtr->prevPtr = NULL;
- tsdPtr->onList = 0;
- if ((write(triggerPipe, "", 1) == -1) && (errno != EAGAIN)) {
- Tcl_Panic("Tcl_WaitForEvent: %s",
- "unable to write to triggerPipe");
- }
- }
-#else /* !TCL_THREADS */
- tsdPtr->readyMasks = tsdPtr->checkMasks;
- numFound = select(tsdPtr->numFdBits, &tsdPtr->readyMasks.readable,
- &tsdPtr->readyMasks.writable, &tsdPtr->readyMasks.exception,
- timeoutPtr);
-
- /*
- * Some systems don't clear the masks after an error, so we have to do it
- * here.
- */
-
- if (numFound == -1) {
- FD_ZERO(&tsdPtr->readyMasks.readable);
- FD_ZERO(&tsdPtr->readyMasks.writable);
- FD_ZERO(&tsdPtr->readyMasks.exception);
- }
-#endif /* TCL_THREADS */
-
- /*
- * Queue all detected file events before returning.
- */
-
- for (filePtr = tsdPtr->firstFileHandlerPtr; (filePtr != NULL);
- filePtr = filePtr->nextPtr) {
- mask = 0;
- if (FD_ISSET(filePtr->fd, &tsdPtr->readyMasks.readable)) {
- mask |= TCL_READABLE;
- }
- if (FD_ISSET(filePtr->fd, &tsdPtr->readyMasks.writable)) {
- mask |= TCL_WRITABLE;
- }
- if (FD_ISSET(filePtr->fd, &tsdPtr->readyMasks.exception)) {
- mask |= TCL_EXCEPTION;
- }
-
- if (!mask) {
- continue;
- }
-
- /*
- * Don't bother to queue an event if the mask was previously non-zero
- * since an event must still be on the queue.
- */
-
- if (filePtr->readyMask == 0) {
- FileHandlerEvent *fileEvPtr =
- (FileHandlerEvent *) ckalloc(sizeof(FileHandlerEvent));
-
- fileEvPtr->header.proc = FileHandlerEventProc;
- fileEvPtr->fd = filePtr->fd;
- Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL);
- }
- filePtr->readyMask = mask;
- }
-#if TCL_THREADS
- pthread_mutex_unlock(&notifierMutex);
-#endif /* TCL_THREADS */
- return 0;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclAsyncNotifier --
- *
- * This procedure sets the async mark of an async handler to a
- * given value, if it is called from the notifier thread.
- *
- * Result:
- * True, when the handler will be marked, false otherwise.
- *
- * Side effetcs:
- * The trigger pipe is written when called from the notifier
- * thread.
- *
- *----------------------------------------------------------------------
- */
-
-int
-TclAsyncNotifier(
- int sigNumber, /* Signal number. */
- TCL_UNUSED(Tcl_ThreadId), /* Target thread. */
- TCL_UNUSED(ClientData), /* Notifier data. */
- int *flagPtr, /* Flag to mark. */
- int value) /* Value of mark. */
-{
-#if TCL_THREADS
- /*
- * WARNING:
- * This code most likely runs in a signal handler. Thus,
- * only few async-signal-safe system calls are allowed,
- * e.g. pthread_self(), sem_post(), write().
- */
-
- if (pthread_equal(pthread_self(), (pthread_t) notifierThread)) {
- if (notifierThreadRunning) {
- *flagPtr = value;
- if (!asyncPending) {
- asyncPending = 1;
- if (write(triggerPipe, "S", 1) != 1) {
- asyncPending = 0;
- return 0;
- };
- }
- return 1;
- }
- return 0;
- }
-
- /*
- * Re-send the signal to the notifier thread.
- */
-
- pthread_kill((pthread_t) notifierThread, sigNumber);
-#else
- (void)sigNumber;
- (void)flagPtr;
- (void)value;
-#endif
- return 0;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * NotifierThreadProc --
- *
- * This routine is the initial (and only) function executed by the
- * special notifier thread. Its job is to wait for file descriptors to
- * become readable or writable or to have an exception condition and then
- * to notify other threads who are interested in this information by
- * signalling a condition variable. Other threads can signal this
- * notifier thread of a change in their interests by writing a single
- * byte to a special pipe that the notifier thread is monitoring.
- *
- * Result:
- * None. Once started, this routine normally never exits and usually dies
- * with the overall process, but it can be shut down if the Tcl library
- * is finalized.
- *
- * Side effects:
- * The trigger pipe used to signal the notifier thread is created when
- * the notifier thread first starts.
- *
- *----------------------------------------------------------------------
- */
-
-#if TCL_THREADS
-static TCL_NORETURN void
-NotifierThreadProc(
- TCL_UNUSED(ClientData))
-{
- ThreadSpecificData *tsdPtr;
- fd_set readableMask;
- fd_set writableMask;
- fd_set exceptionMask;
- int i, fds[2], receivePipe, ret;
- long found;
- struct timeval poll = {0, 0}, *timePtr;
- char buf[2];
- int numFdBits = 0;
-
- if (pipe(fds) != 0) {
- Tcl_Panic("NotifierThreadProc: %s", "could not create trigger pipe");
- }
-
- /*
- * Ticket [c6897e6e6a].
- */
-
- if (fds[0] >= FD_SETSIZE || fds[1] >= FD_SETSIZE) {
- Tcl_Panic("NotifierThreadProc: %s", "too many open files");
- }
-
- receivePipe = fds[0];
-
- if (TclUnixSetBlockingMode(receivePipe, TCL_MODE_NONBLOCKING) < 0) {
- Tcl_Panic("NotifierThreadProc: %s",
- "could not make receive pipe non blocking");
- }
- if (TclUnixSetBlockingMode(fds[1], TCL_MODE_NONBLOCKING) < 0) {
- Tcl_Panic("NotifierThreadProc: %s",
- "could not make trigger pipe non blocking");
- }
- if (fcntl(receivePipe, F_SETFD, FD_CLOEXEC) < 0) {
- Tcl_Panic("NotifierThreadProc: %s",
- "could not make receive pipe close-on-exec");
- }
- if (fcntl(fds[1], F_SETFD, FD_CLOEXEC) < 0) {
- Tcl_Panic("NotifierThreadProc: %s",
- "could not make trigger pipe close-on-exec");
- }
-
- /*
- * Install the write end of the pipe into the global variable.
- */
-
- pthread_mutex_lock(&notifierMutex);
- triggerPipe = fds[1];
- otherPipe = fds[0];
-
- /*
- * Signal any threads that are waiting.
- */
-
- pthread_cond_broadcast(&notifierCV);
- pthread_mutex_unlock(&notifierMutex);
-
- /*
- * Look for file events and report them to interested threads.
- */
-
- while (1) {
- FD_ZERO(&readableMask);
- FD_ZERO(&writableMask);
- FD_ZERO(&exceptionMask);
-
- /*
- * Compute the logical OR of the masks from all the waiting
- * notifiers.
- */
-
- pthread_mutex_lock(&notifierMutex);
- timePtr = NULL;
- for (tsdPtr = waitingListPtr; tsdPtr; tsdPtr = tsdPtr->nextPtr) {
- for (i = tsdPtr->numFdBits-1; i >= 0; --i) {
- if (FD_ISSET(i, &tsdPtr->checkMasks.readable)) {
- FD_SET(i, &readableMask);
- }
- if (FD_ISSET(i, &tsdPtr->checkMasks.writable)) {
- FD_SET(i, &writableMask);
- }
- if (FD_ISSET(i, &tsdPtr->checkMasks.exception)) {
- FD_SET(i, &exceptionMask);
- }
- }
- if (tsdPtr->numFdBits > numFdBits) {
- numFdBits = tsdPtr->numFdBits;
- }
- if (tsdPtr->pollState & POLL_WANT) {
- /*
- * Here we make sure we go through select() with the same mask
- * bits that were present when the thread tried to poll.
- */
-
- tsdPtr->pollState |= POLL_DONE;
- timePtr = &poll;
- }
- }
- pthread_mutex_unlock(&notifierMutex);
-
- /*
- * Set up the mask to include the receive pipe.
- */
-
- if (receivePipe >= numFdBits) {
- numFdBits = receivePipe + 1;
- }
- FD_SET(receivePipe, &readableMask);
-
- /*
- * Signals are unblocked only during select().
- */
-
-#ifdef HAVE_PSELECT
- {
- struct timespec tspec, *tspecPtr;
-
- if (timePtr == NULL) {
- tspecPtr = NULL;
- } else {
- tspecPtr = &tspec;
- tspecPtr->tv_sec = timePtr->tv_sec;
- tspecPtr->tv_nsec = timePtr->tv_usec * 1000;
- }
- ret = pselect(numFdBits, &readableMask, &writableMask,
- &exceptionMask, tspecPtr, &notifierSigMask);
- }
-#else
- pthread_sigmask(SIG_SETMASK, &notifierSigMask, NULL);
- ret = select(numFdBits, &readableMask, &writableMask, &exceptionMask,
- timePtr);
- pthread_sigmask(SIG_BLOCK, &allSigMask, NULL);
-#endif
-
- if (ret == -1) {
- /*
- * In case a signal was caught during select(),
- * perform work on async handlers now.
- */
- if (errno == EINTR && asyncPending) {
- asyncPending = 0;
- TclAsyncMarkFromNotifier();
- }
-
- /*
- * Try again immediately on select() error.
- */
- continue;
- }
-
- /*
- * Alert any threads that are waiting on a ready file descriptor.
- */
-
- pthread_mutex_lock(&notifierMutex);
- for (tsdPtr = waitingListPtr; tsdPtr; tsdPtr = tsdPtr->nextPtr) {
- found = 0;
-
- for (i = tsdPtr->numFdBits - 1; i >= 0; --i) {
- if (FD_ISSET(i, &tsdPtr->checkMasks.readable)
- && FD_ISSET(i, &readableMask)) {
- FD_SET(i, &tsdPtr->readyMasks.readable);
- found = 1;
- }
- if (FD_ISSET(i, &tsdPtr->checkMasks.writable)
- && FD_ISSET(i, &writableMask)) {
- FD_SET(i, &tsdPtr->readyMasks.writable);
- found = 1;
- }
- if (FD_ISSET(i, &tsdPtr->checkMasks.exception)
- && FD_ISSET(i, &exceptionMask)) {
- FD_SET(i, &tsdPtr->readyMasks.exception);
- found = 1;
- }
- }
-
- if (found || (tsdPtr->pollState & POLL_DONE)) {
- AlertSingleThread(tsdPtr);
- }
- }
- pthread_mutex_unlock(&notifierMutex);
-
- /*
- * Consume the next byte from the notifier pipe if the pipe was
- * readable. Note that there may be multiple bytes pending, but to
- * avoid a race condition we only read one at a time.
- */
-
- do {
- i = read(receivePipe, buf, 1);
- if (i <= 0) {
- break;
- } else if ((i == 0) || ((i == 1) && (buf[0] == 'q'))) {
- /*
- * Someone closed the write end of the pipe or sent us a Quit
- * message [Bug: 4139] and then closed the write end of the
- * pipe so we need to shut down the notifier thread.
- */
-
- break;
- }
- } while (1);
-
- if (asyncPending) {
- asyncPending = 0;
- TclAsyncMarkFromNotifier();
- }
-
- if ((i == 0) || (buf[0] == 'q')) {
- break;
- }
- }
-
- /*
- * Clean up the read end of the pipe and signal any threads waiting on
- * termination of the notifier thread.
- */
-
- close(receivePipe);
- pthread_mutex_lock(&notifierMutex);
- triggerPipe = -1;
- otherPipe = -1;
- pthread_cond_broadcast(&notifierCV);
- pthread_mutex_unlock(&notifierMutex);
-
- TclpThreadExit(0);
-}
-#endif /* TCL_THREADS */
-
-#endif /* (!NOTIFIER_EPOLL && !NOTIFIER_KQUEUE) || !TCL_THREADS */
-#else
-TCL_MAC_EMPTY_FILE(unix_tclSelectNotfy_c)
-#endif /* !HAVE_COREFOUNDATION */
-
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 4
- * fill-column: 78
- * End:
- */
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index 806d6fb..8448b77 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -4,19 +4,26 @@
* Common channel driver for Unix channels based on files, command pipes
* and TCP sockets.
*
- * Copyright © 1995-1997 Sun Microsystems, Inc.
- * Copyright © 1998-1999 Scriptics Corporation.
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright (c) 1998-1999 by Scriptics Corporation.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tclInt.h" /* Internal definitions for Tcl. */
#include "tclIO.h" /* To get Channel type declaration. */
-#undef SUPPORTS_TTY
-#if defined(HAVE_TERMIOS_H)
-# define SUPPORTS_TTY 1
+#define SUPPORTS_TTY
+
+#undef DIRECT_BAUD
+#ifdef B4800
+# if (B4800 == 4800)
+# define DIRECT_BAUD
+# endif /* B4800 == 4800 */
+#endif /* B4800 */
+
+#ifdef USE_TERMIOS
# include <termios.h>
# ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
@@ -24,39 +31,60 @@
# ifdef HAVE_SYS_MODEM_H
# include <sys/modem.h>
# endif /* HAVE_SYS_MODEM_H */
+# define IOSTATE struct termios
+# define GETIOSTATE(fd, statePtr) tcgetattr((fd), (statePtr))
+# define SETIOSTATE(fd, statePtr) tcsetattr((fd), TCSADRAIN, (statePtr))
+# define GETCONTROL(fd, intPtr) ioctl((fd), TIOCMGET, (intPtr))
+# define SETCONTROL(fd, intPtr) ioctl((fd), TIOCMSET, (intPtr))
# ifdef FIONREAD
# define GETREADQUEUE(fd, int) ioctl((fd), FIONREAD, &(int))
# elif defined(FIORDCHK)
# define GETREADQUEUE(fd, int) int = ioctl((fd), FIORDCHK, NULL)
-# else
-# define GETREADQUEUE(fd, int) int = 0
-# endif
-
+# endif /* FIONREAD */
# ifdef TIOCOUTQ
# define GETWRITEQUEUE(fd, int) ioctl((fd), TIOCOUTQ, &(int))
-# else
-# define GETWRITEQUEUE(fd, int) int = 0
-# endif
+# endif /* TIOCOUTQ */
+# if defined(TIOCSBRK) && defined(TIOCCBRK)
+/*
+ * Can't use ?: operator below because that messes up types on either Linux or
+ * Solaris (the two are mutually exclusive!)
+ */
+
+# define SETBREAK(fd, flag) \
+ if (flag) { \
+ ioctl((fd), TIOCSBRK, NULL); \
+ } else { \
+ ioctl((fd), TIOCCBRK, NULL); \
+ }
+# endif /* TIOCSBRK&TIOCCBRK */
# if !defined(CRTSCTS) && defined(CNEW_RTSCTS)
# define CRTSCTS CNEW_RTSCTS
# endif /* !CRTSCTS&CNEW_RTSCTS */
# if !defined(PAREXT) && defined(CMSPAR)
# define PAREXT CMSPAR
# endif /* !PAREXT&&CMSPAR */
-
-#endif /* HAVE_TERMIOS_H */
-
-/*
- * The bits supported for describing the closeMode field of TtyState.
- */
-
-enum CloseModeBits {
- CLOSE_DEFAULT,
- CLOSE_DRAIN,
- CLOSE_DISCARD
-};
+#else /* !USE_TERMIOS */
+
+#ifdef USE_TERMIO
+# include <termio.h>
+# define IOSTATE struct termio
+# define GETIOSTATE(fd, statePtr) ioctl((fd), TCGETA, (statePtr))
+# define SETIOSTATE(fd, statePtr) ioctl((fd), TCSETAW, (statePtr))
+#else /* !USE_TERMIO */
+
+#ifdef USE_SGTTY
+# include <sgtty.h>
+# define IOSTATE struct sgttyb
+# define GETIOSTATE(fd, statePtr) ioctl((fd), TIOCGETP, (statePtr))
+# define SETIOSTATE(fd, statePtr) ioctl((fd), TIOCSETP, (statePtr))
+#else /* !USE_SGTTY */
+# undef SUPPORTS_TTY
+#endif /* !USE_SGTTY */
+
+#endif /* !USE_TERMIO */
+#endif /* !USE_TERMIOS */
/*
* Helper macros to make parts of this file clearer. The macros do exactly
@@ -68,11 +96,10 @@ enum CloseModeBits {
#define CLEAR_BITS(var, bits) ((var) &= ~(bits))
/*
- * These structures describe per-instance state of file-based and serial-based
- * channels.
+ * This structure describes per-instance state of a file based channel.
*/
-typedef struct {
+typedef struct FileState {
Tcl_Channel channel; /* Channel associated with this file. */
int fd; /* File handle. */
int validMask; /* OR'ed combination of TCL_READABLE,
@@ -80,111 +107,172 @@ typedef struct {
* which operations are valid on the file. */
} FileState;
-typedef struct {
- FileState fileState;
#ifdef SUPPORTS_TTY
- int closeMode; /* One of CLOSE_DEFAULT, CLOSE_DRAIN or
- * CLOSE_DISCARD. */
- int doReset; /* Whether we should do a terminal reset on
- * close. */
- struct termios initState; /* The state of the terminal when it was
- * opened. */
-#endif /* SUPPORTS_TTY */
-} TtyState;
-#ifdef SUPPORTS_TTY
+/*
+ * The following structure describes per-instance state of a tty-based
+ * channel.
+ */
+
+typedef struct TtyState {
+ FileState fs; /* Per-instance state of the file descriptor.
+ * Must be the first field. */
+ IOSTATE savedState; /* Initial state of device. Used to reset
+ * state when device closed. */
+} TtyState;
/*
* The following structure is used to set or get the serial port attributes in
- * a platform-independent manner.
+ * a platform-independant manner.
*/
-typedef struct {
+typedef struct TtyAttrs {
int baud;
int parity;
int data;
int stop;
} TtyAttrs;
-#endif /* SUPPORTS_TTY */
+#endif /* !SUPPORTS_TTY */
#define UNSUPPORTED_OPTION(detail) \
- if (interp) { \
- Tcl_SetObjResult(interp, Tcl_ObjPrintf( \
- "%s not supported for this platform", (detail))); \
- Tcl_SetErrorCode(interp, "TCL", "UNSUPPORTED", (char *)NULL); \
+ if (interp) { \
+ Tcl_AppendResult(interp, (detail), \
+ " not supported for this platform", NULL); \
}
/*
+ * This structure describes per-instance state of a tcp based channel.
+ */
+
+typedef struct TcpState {
+ Tcl_Channel channel; /* Channel associated with this file. */
+ int fd; /* The socket itself. */
+ int flags; /* ORed combination of the bitfields defined
+ * below. */
+ int interest; /* Events types of interest. */
+ Tcl_TcpAcceptProc *acceptProc;
+ /* Proc to call on accept. */
+ ClientData acceptProcData; /* The data for the accept proc. */
+} TcpState;
+
+/*
+ * These bits may be ORed together into the "flags" field of a TcpState
+ * structure.
+ */
+
+#define TCP_ASYNC_SOCKET (1<<0) /* Asynchronous socket. */
+#define TCP_ASYNC_CONNECT (1<<1) /* Async connect in progress. */
+
+/*
+ * The following defines the maximum length of the listen queue. This is the
+ * number of outstanding yet-to-be-serviced requests for a connection on a
+ * server socket, more than this number of outstanding requests and the
+ * connection request will fail.
+ */
+
+#ifndef SOMAXCONN
+# define SOMAXCONN 100
+#endif /* SOMAXCONN */
+
+#if (SOMAXCONN < 100)
+# undef SOMAXCONN
+# define SOMAXCONN 100
+#endif /* SOMAXCONN < 100 */
+
+/*
+ * The following defines how much buffer space the kernel should maintain for
+ * a socket.
+ */
+
+#define SOCKET_BUFSIZE 4096
+
+/*
* Static routines for this file:
*/
-static int FileBlockModeProc(void *instanceData, int mode);
-static int FileCloseProc(void *instanceData,
- Tcl_Interp *interp, int flags);
-static int FileGetHandleProc(void *instanceData,
- int direction, void **handlePtr);
-static int FileGetOptionProc(void *instanceData,
+static TcpState * CreateSocket(Tcl_Interp *interp, int port,
+ const char *host, int server, const char *myaddr,
+ int myport, int async);
+static int CreateSocketAddress(struct sockaddr_in *sockaddrPtr,
+ const char *host, int port, int willBind,
+ const char **errorMsgPtr);
+static int FileBlockModeProc(ClientData instanceData, int mode);
+static int FileCloseProc(ClientData instanceData,
+ Tcl_Interp *interp);
+static int FileGetHandleProc(ClientData instanceData,
+ int direction, ClientData *handlePtr);
+static int FileInputProc(ClientData instanceData, char *buf,
+ int toRead, int *errorCode);
+static int FileOutputProc(ClientData instanceData,
+ const char *buf, int toWrite, int *errorCode);
+static int FileSeekProc(ClientData instanceData, long offset,
+ int mode, int *errorCode);
+static int FileTruncateProc(ClientData instanceData,
+ Tcl_WideInt length);
+static Tcl_WideInt FileWideSeekProc(ClientData instanceData,
+ Tcl_WideInt offset, int mode, int *errorCode);
+static void FileWatchProc(ClientData instanceData, int mask);
+static void TcpAccept(ClientData data, int mask);
+static int TcpBlockModeProc(ClientData data, int mode);
+static int TcpCloseProc(ClientData instanceData,
+ Tcl_Interp *interp);
+static int TcpGetHandleProc(ClientData instanceData,
+ int direction, ClientData *handlePtr);
+static int TcpGetOptionProc(ClientData instanceData,
Tcl_Interp *interp, const char *optionName,
Tcl_DString *dsPtr);
-static int FileInputProc(void *instanceData, char *buf,
+static int TcpInputProc(ClientData instanceData, char *buf,
int toRead, int *errorCode);
-static int FileOutputProc(void *instanceData,
+static int TcpOutputProc(ClientData instanceData,
const char *buf, int toWrite, int *errorCode);
-#ifndef TCL_NO_DEPRECATED
-static int FileSeekProc(void *instanceData, long offset,
- int mode, int *errorCode);
-#endif
-static int FileTruncateProc(void *instanceData,
- long long length);
-static long long FileWideSeekProc(void *instanceData,
- long long offset, int mode, int *errorCode);
-static void FileWatchProc(void *instanceData, int mask);
+static void TcpWatchProc(ClientData instanceData, int mask);
#ifdef SUPPORTS_TTY
-static int TtyCloseProc(void *instanceData,
- Tcl_Interp *interp, int flags);
static void TtyGetAttributes(int fd, TtyAttrs *ttyPtr);
-static int TtyGetOptionProc(void *instanceData,
+static int TtyGetOptionProc(ClientData instanceData,
Tcl_Interp *interp, const char *optionName,
Tcl_DString *dsPtr);
-static int TtyGetBaud(speed_t speed);
-static speed_t TtyGetSpeed(int baud);
-static void TtyInit(int fd);
+#ifndef DIRECT_BAUD
+static int TtyGetBaud(unsigned long speed);
+static unsigned long TtyGetSpeed(int baud);
+#endif /* DIRECT_BAUD */
+static FileState * TtyInit(int fd, int initialize);
static void TtyModemStatusStr(int status, Tcl_DString *dsPtr);
static int TtyParseMode(Tcl_Interp *interp, const char *mode,
- TtyAttrs *ttyPtr);
+ int *speedPtr, int *parityPtr, int *dataPtr,
+ int *stopPtr);
static void TtySetAttributes(int fd, TtyAttrs *ttyPtr);
-static int TtySetOptionProc(void *instanceData,
+static int TtySetOptionProc(ClientData instanceData,
Tcl_Interp *interp, const char *optionName,
const char *value);
#endif /* SUPPORTS_TTY */
+static int WaitForConnect(TcpState *statePtr, int *errorCodePtr);
+static Tcl_Channel MakeTcpClientChannelMode(ClientData tcpSocket,
+ int mode);
+static void WrapNotify(ClientData clientData, int mask);
/*
* This structure describes the channel type structure for file based IO:
*/
-static const Tcl_ChannelType fileChannelType = {
+static Tcl_ChannelType fileChannelType = {
"file", /* Type name. */
TCL_CHANNEL_VERSION_5, /* v5 channel */
- TCL_CLOSE2PROC, /* Close proc. */
+ FileCloseProc, /* Close proc. */
FileInputProc, /* Input proc. */
FileOutputProc, /* Output proc. */
-#ifndef TCL_NO_DEPRECATED
FileSeekProc, /* Seek proc. */
-#else
- NULL,
-#endif
NULL, /* Set option proc. */
- FileGetOptionProc, /* Get option proc. */
+ NULL, /* Get option proc. */
FileWatchProc, /* Initialize notifier. */
FileGetHandleProc, /* Get OS handles out of channel. */
- FileCloseProc, /* close2proc. */
+ NULL, /* close2proc. */
FileBlockModeProc, /* Set blocking or non-blocking mode.*/
NULL, /* flush proc. */
NULL, /* handler proc. */
FileWideSeekProc, /* wide seek proc. */
NULL,
- FileTruncateProc /* truncate proc. */
+ FileTruncateProc, /* truncate proc. */
};
#ifdef SUPPORTS_TTY
@@ -193,10 +281,10 @@ static const Tcl_ChannelType fileChannelType = {
* Note that this type is a subclass of the "file" type.
*/
-static const Tcl_ChannelType ttyChannelType = {
+static Tcl_ChannelType ttyChannelType = {
"tty", /* Type name. */
TCL_CHANNEL_VERSION_5, /* v5 channel */
- TCL_CLOSE2PROC, /* Close proc. */
+ FileCloseProc, /* Close proc. */
FileInputProc, /* Input proc. */
FileOutputProc, /* Output proc. */
NULL, /* Seek proc. */
@@ -204,15 +292,40 @@ static const Tcl_ChannelType ttyChannelType = {
TtyGetOptionProc, /* Get option proc. */
FileWatchProc, /* Initialize notifier. */
FileGetHandleProc, /* Get OS handles out of channel. */
- TtyCloseProc, /* close2proc. */
+ NULL, /* close2proc. */
FileBlockModeProc, /* Set blocking or non-blocking mode.*/
NULL, /* flush proc. */
NULL, /* handler proc. */
NULL, /* wide seek proc. */
NULL, /* thread action proc. */
- NULL /* truncate proc. */
+ NULL, /* truncate proc. */
};
#endif /* SUPPORTS_TTY */
+
+/*
+ * This structure describes the channel type structure for TCP socket
+ * based IO:
+ */
+
+static Tcl_ChannelType tcpChannelType = {
+ "tcp", /* Type name. */
+ TCL_CHANNEL_VERSION_5, /* v5 channel */
+ TcpCloseProc, /* Close proc. */
+ TcpInputProc, /* Input proc. */
+ TcpOutputProc, /* Output proc. */
+ NULL, /* Seek proc. */
+ NULL, /* Set option proc. */
+ TcpGetOptionProc, /* Get option proc. */
+ TcpWatchProc, /* Initialize notifier. */
+ TcpGetHandleProc, /* Get OS handles out of channel. */
+ NULL, /* close2proc. */
+ TcpBlockModeProc, /* Set blocking or non-blocking mode.*/
+ NULL, /* flush proc. */
+ NULL, /* handler proc. */
+ NULL, /* wide seek proc. */
+ NULL, /* thread action proc. */
+ NULL, /* truncate proc. */
+};
/*
*----------------------------------------------------------------------
@@ -231,13 +344,15 @@ static const Tcl_ChannelType ttyChannelType = {
*----------------------------------------------------------------------
*/
+ /* ARGSUSED */
static int
FileBlockModeProc(
- void *instanceData, /* File state. */
- int mode) /* The mode to set. Can be TCL_MODE_BLOCKING
- * or TCL_MODE_NONBLOCKING. */
+ ClientData instanceData, /* File state. */
+ int mode) /* The mode to set. Can be one of
+ * TCL_MODE_BLOCKING or
+ * TCL_MODE_NONBLOCKING. */
{
- FileState *fsPtr = (FileState *)instanceData;
+ FileState *fsPtr = (FileState *) instanceData;
if (TclUnixSetBlockingMode(fsPtr->fd, mode) < 0) {
return errno;
@@ -266,13 +381,13 @@ FileBlockModeProc(
static int
FileInputProc(
- void *instanceData, /* File state. */
+ ClientData instanceData, /* File state. */
char *buf, /* Where to store data read. */
int toRead, /* How much space is available in the
* buffer? */
int *errorCodePtr) /* Where to store error code. */
{
- FileState *fsPtr = (FileState *)instanceData;
+ FileState *fsPtr = (FileState *) instanceData;
int bytesRead; /* How many bytes were actually read from the
* input device? */
@@ -285,15 +400,12 @@ FileInputProc(
* nonblocking, the read will never block.
*/
- do {
- bytesRead = read(fsPtr->fd, buf, toRead);
- } while ((bytesRead < 0) && (errno == EINTR));
-
- if (bytesRead < 0) {
- *errorCodePtr = errno;
- return -1;
+ bytesRead = read(fsPtr->fd, buf, (size_t) toRead);
+ if (bytesRead > -1) {
+ return bytesRead;
}
- return bytesRead;
+ *errorCodePtr = errno;
+ return -1;
}
/*
@@ -316,12 +428,12 @@ FileInputProc(
static int
FileOutputProc(
- void *instanceData, /* File state. */
+ ClientData instanceData, /* File state. */
const char *buf, /* The data buffer. */
int toWrite, /* How many bytes to write? */
int *errorCodePtr) /* Where to store error code. */
{
- FileState *fsPtr = (FileState *)instanceData;
+ FileState *fsPtr = (FileState *) instanceData;
int written;
*errorCodePtr = 0;
@@ -335,8 +447,8 @@ FileOutputProc(
return 0;
}
- written = write(fsPtr->fd, buf, toWrite);
- if (written >= 0) {
+ written = write(fsPtr->fd, buf, (size_t) toWrite);
+ if (written > -1) {
return written;
}
*errorCodePtr = errno;
@@ -346,11 +458,10 @@ FileOutputProc(
/*
*----------------------------------------------------------------------
*
- * FileCloseProc, TtyCloseProc --
+ * FileCloseProc --
*
- * These functions are called from the generic IO level to perform
- * channel-type-specific cleanup when a file- or tty-based channel is
- * closed.
+ * This function is called from the generic IO level to perform
+ * channel-type-specific cleanup when a file based channel is closed.
*
* Results:
* 0 if successful, errno if failed.
@@ -363,17 +474,12 @@ FileOutputProc(
static int
FileCloseProc(
- void *instanceData, /* File state. */
- TCL_UNUSED(Tcl_Interp *),
- int flags)
+ ClientData instanceData, /* File state. */
+ Tcl_Interp *interp) /* For error reporting - unused. */
{
- FileState *fsPtr = (FileState *)instanceData;
+ FileState *fsPtr = (FileState *) instanceData;
int errorCode = 0;
- if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) != 0) {
- return EINVAL;
- }
-
Tcl_DeleteFileHandler(fsPtr->fd);
/*
@@ -386,53 +492,9 @@ FileCloseProc(
errorCode = errno;
}
}
- ckfree(fsPtr);
+ ckfree((char *) fsPtr);
return errorCode;
}
-
-#ifdef SUPPORTS_TTY
-static int
-TtyCloseProc(
- void *instanceData,
- Tcl_Interp *interp,
- int flags)
-{
- TtyState *ttyPtr = (TtyState*)instanceData;
-
- if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) != 0) {
- return EINVAL;
- }
- /*
- * If we've been asked by the user to drain or flush, do so now.
- */
-
- switch (ttyPtr->closeMode) {
- case CLOSE_DRAIN:
- tcdrain(ttyPtr->fileState.fd);
- break;
- case CLOSE_DISCARD:
- tcflush(ttyPtr->fileState.fd, TCIOFLUSH);
- break;
- default:
- /* Do nothing */
- break;
- }
-
- /*
- * If we've had our state changed from the default, reset now.
- */
-
- if (ttyPtr->doReset) {
- tcsetattr(ttyPtr->fileState.fd, TCSANOW, &ttyPtr->initState);
- }
-
- /*
- * Delegate to close for files.
- */
-
- return FileCloseProc(instanceData, interp, flags);
-}
-#endif /* SUPPORTS_TTY */
/*
*----------------------------------------------------------------------
@@ -452,24 +514,24 @@ TtyCloseProc(
*
*----------------------------------------------------------------------
*/
-#ifndef TCL_NO_DEPRECATED
+
static int
FileSeekProc(
- void *instanceData, /* File state. */
+ ClientData instanceData, /* File state. */
long offset, /* Offset to seek to. */
int mode, /* Relative to where should we seek? Can be
* one of SEEK_START, SEEK_SET or SEEK_END. */
int *errorCodePtr) /* To store error code. */
{
- FileState *fsPtr = (FileState *)instanceData;
- long long oldLoc, newLoc;
+ FileState *fsPtr = (FileState *) instanceData;
+ Tcl_WideInt oldLoc, newLoc;
/*
* Save our current place in case we need to roll-back the seek.
*/
oldLoc = TclOSseek(fsPtr->fd, (Tcl_SeekOffset) 0, SEEK_CUR);
- if (oldLoc == -1) {
+ if (oldLoc == Tcl_LongAsWide(-1)) {
/*
* Bad things are happening. Error out...
*/
@@ -484,16 +546,15 @@ FileSeekProc(
* Check for expressability in our return type, and roll-back otherwise.
*/
- if (newLoc > INT_MAX) {
+ if (newLoc > Tcl_LongAsWide(INT_MAX)) {
*errorCodePtr = EOVERFLOW;
TclOSseek(fsPtr->fd, (Tcl_SeekOffset) oldLoc, SEEK_SET);
return -1;
} else {
- *errorCodePtr = (newLoc == -1) ? errno : 0;
+ *errorCodePtr = (newLoc == Tcl_LongAsWide(-1)) ? errno : 0;
}
- return (int) newLoc;
+ return (int) Tcl_WideAsLong(newLoc);
}
-#endif
/*
*----------------------------------------------------------------------
@@ -515,16 +576,16 @@ FileSeekProc(
*----------------------------------------------------------------------
*/
-static long long
+static Tcl_WideInt
FileWideSeekProc(
- void *instanceData, /* File state. */
- long long offset, /* Offset to seek to. */
+ ClientData instanceData, /* File state. */
+ Tcl_WideInt offset, /* Offset to seek to. */
int mode, /* Relative to where should we seek? Can be
* one of SEEK_START, SEEK_CUR or SEEK_END. */
int *errorCodePtr) /* To store error code. */
{
- FileState *fsPtr = (FileState *)instanceData;
- long long newLoc;
+ FileState *fsPtr = (FileState *) instanceData;
+ Tcl_WideInt newLoc;
newLoc = TclOSseek(fsPtr->fd, (Tcl_SeekOffset) offset, mode);
@@ -549,37 +610,26 @@ FileWideSeekProc(
*----------------------------------------------------------------------
*/
-/*
- * Bug ad5a57f2f271: Tcl_NotifyChannel is not a Tcl_FileProc,
- * so do not pass it to directly to Tcl_CreateFileHandler.
- * Instead, pass a wrapper which is a Tcl_FileProc.
- */
-static void
-FileWatchNotifyChannelWrapper(
- void *clientData,
- int mask)
-{
- Tcl_Channel channel = (Tcl_Channel)clientData;
- Tcl_NotifyChannel(channel, mask);
-}
-
static void
FileWatchProc(
- void *instanceData, /* The file state. */
+ ClientData instanceData, /* The file state. */
int mask) /* Events of interest; an OR-ed combination of
* TCL_READABLE, TCL_WRITABLE and
* TCL_EXCEPTION. */
{
- FileState *fsPtr = (FileState *)instanceData;
+ FileState *fsPtr = (FileState *) instanceData;
/*
- * Make sure we only register for events that are valid on this file.
+ * Make sure we only register for events that are valid on this file. Note
+ * that we are passing Tcl_NotifyChannel directly to Tcl_CreateFileHandler
+ * with the channel pointer as the client data.
*/
mask &= fsPtr->validMask;
if (mask) {
Tcl_CreateFileHandler(fsPtr->fd, mask,
- FileWatchNotifyChannelWrapper, fsPtr->channel);
+ (Tcl_FileProc *) Tcl_NotifyChannel,
+ (ClientData) fsPtr->channel);
} else {
Tcl_DeleteFileHandler(fsPtr->fd);
}
@@ -605,190 +655,21 @@ FileWatchProc(
static int
FileGetHandleProc(
- void *instanceData, /* The file state. */
+ ClientData instanceData, /* The file state. */
int direction, /* TCL_READABLE or TCL_WRITABLE */
- void **handlePtr) /* Where to store the handle. */
+ ClientData *handlePtr) /* Where to store the handle. */
{
- FileState *fsPtr = (FileState *)instanceData;
+ FileState *fsPtr = (FileState *) instanceData;
if (direction & fsPtr->validMask) {
- *handlePtr = INT2PTR(fsPtr->fd);
+ *handlePtr = (ClientData) INT2PTR(fsPtr->fd);
return TCL_OK;
}
return TCL_ERROR;
}
-/*
- *----------------------------------------------------------------------
- *
- * FileGetOptionProc --
- *
- * Gets an option associated with an open file. If the optionName arg is
- * non-NULL, retrieves the value of that option. If the optionName arg is
- * NULL, retrieves a list of alternating option names and values for the
- * given channel.
- *
- * Results:
- * A standard Tcl result. Also sets the supplied DString to the string
- * value of the option(s) returned. Sets error message if needed
- * (by calling Tcl_BadChannelOption).
- *
- *----------------------------------------------------------------------
- */
-
-static inline void
-StoreElementInDict(
- Tcl_Obj *dictObj,
- const char *name,
- Tcl_Obj *valueObj)
-{
- /*
- * We assume that the dict is being built fresh and that there's never any
- * duplicate keys.
- */
-
- Tcl_Obj *nameObj = Tcl_NewStringObj(name, -1);
- Tcl_DictObjPut(NULL, dictObj, nameObj, valueObj);
-}
-
-static inline const char *
-GetTypeFromMode(
- int mode)
-{
- /*
- * TODO: deduplicate with tclCmdAH.c
- */
-
- if (S_ISREG(mode)) {
- return "file";
- } else if (S_ISDIR(mode)) {
- return "directory";
- } else if (S_ISCHR(mode)) {
- return "characterSpecial";
- } else if (S_ISBLK(mode)) {
- return "blockSpecial";
- } else if (S_ISFIFO(mode)) {
- return "fifo";
-#ifdef S_ISLNK
- } else if (S_ISLNK(mode)) {
- return "link";
-#endif
-#ifdef S_ISSOCK
- } else if (S_ISSOCK(mode)) {
- return "socket";
-#endif
- }
- return "unknown";
-}
-
-static Tcl_Obj *
-StatOpenFile(
- FileState *fsPtr)
-{
- Tcl_StatBuf statBuf; /* Not allocated on heap; we're definitely
- * API-synchronized with how Tcl is built! */
- Tcl_Obj *dictObj;
- unsigned short mode;
-
- if (TclOSfstat(fsPtr->fd, &statBuf) < 0) {
- return NULL;
- }
-
- /*
- * TODO: merge with TIP 594 implementation (it's silly to have a
- * duplicate!)
- */
-
- TclNewObj(dictObj);
-#define STORE_ELEM(name, value) StoreElementInDict(dictObj, name, value)
-
- STORE_ELEM("dev", Tcl_NewWideIntObj((long) statBuf.st_dev));
- STORE_ELEM("ino", Tcl_NewWideIntObj((Tcl_WideInt) statBuf.st_ino));
- STORE_ELEM("nlink", Tcl_NewWideIntObj((long) statBuf.st_nlink));
- STORE_ELEM("uid", Tcl_NewWideIntObj((long) statBuf.st_uid));
- STORE_ELEM("gid", Tcl_NewWideIntObj((long) statBuf.st_gid));
- STORE_ELEM("size", Tcl_NewWideIntObj((Tcl_WideInt) statBuf.st_size));
-#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
- STORE_ELEM("blocks", Tcl_NewWideIntObj((Tcl_WideInt) statBuf.st_blocks));
-#endif
-#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
- STORE_ELEM("blksize", Tcl_NewWideIntObj((long) statBuf.st_blksize));
-#endif
-#ifdef HAVE_STRUCT_STAT_ST_RDEV
- if (S_ISCHR(statBuf.st_mode) || S_ISBLK(statBuf.st_mode)) {
- STORE_ELEM("rdev", Tcl_NewWideIntObj((long) statBuf.st_rdev));
- }
-#endif
- STORE_ELEM("atime", Tcl_NewWideIntObj(
- Tcl_GetAccessTimeFromStat(&statBuf)));
- STORE_ELEM("mtime", Tcl_NewWideIntObj(
- Tcl_GetModificationTimeFromStat(&statBuf)));
- STORE_ELEM("ctime", Tcl_NewWideIntObj(
- Tcl_GetChangeTimeFromStat(&statBuf)));
- mode = (unsigned short) statBuf.st_mode;
- STORE_ELEM("mode", Tcl_NewWideIntObj(mode));
- STORE_ELEM("type", Tcl_NewStringObj(GetTypeFromMode(mode), -1));
-#undef STORE_ELEM
-
- return dictObj;
-}
-
-static int
-FileGetOptionProc(
- void *instanceData,
- Tcl_Interp *interp,
- const char *optionName,
- Tcl_DString *dsPtr)
-{
- FileState *fsPtr = (FileState *)instanceData;
- int valid = 0; /* Flag if valid option parsed. */
- int len;
-
- if (optionName == NULL) {
- len = 0;
- valid = 1;
- } else {
- len = strlen(optionName);
- }
-
- /*
- * Get option -stat
- * Option is readonly and returned by [fconfigure chan -stat] but not
- * returned by [fconfigure chan] without explicit option name.
- */
-
- if ((len > 1) && (strncmp(optionName, "-stat", len) == 0)) {
- Tcl_Obj *dictObj = StatOpenFile(fsPtr);
- const char *dictContents;
- Tcl_Size dictLength;
-
- if (dictObj == NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't read file channel status: %s",
- Tcl_PosixError(interp)));
- return TCL_ERROR;
- }
-
- /*
- * Transfer dictionary to the DString. Note that we don't do this as
- * an element as this is an option that can't be retrieved with a
- * general probe.
- */
-
- dictContents = TclGetStringFromObj(dictObj, &dictLength);
- Tcl_DStringAppend(dsPtr, dictContents, dictLength);
- Tcl_DecrRefCount(dictObj);
- return TCL_OK;
- }
-
- if (valid) {
- return TCL_OK;
- }
- return Tcl_BadChannelOption(interp, optionName,
- "stat");
-}
-
#ifdef SUPPORTS_TTY
+#ifdef USE_TERMIOS
/*
*----------------------------------------------------------------------
*
@@ -821,6 +702,7 @@ TtyModemStatusStr(
Tcl_DStringAppendElement(dsPtr, (status & TIOCM_CD) ? "1" : "0");
#endif /* TIOCM_CD */
}
+#endif /* USE_TERMIOS */
/*
*----------------------------------------------------------------------
@@ -842,17 +724,19 @@ TtyModemStatusStr(
static int
TtySetOptionProc(
- void *instanceData, /* File state. */
+ ClientData instanceData, /* File state. */
Tcl_Interp *interp, /* For error reporting - can be NULL. */
const char *optionName, /* Which option to set? */
const char *value) /* New value for option. */
{
- TtyState *fsPtr = (TtyState *)instanceData;
- size_t len, vlen;
+ FileState *fsPtr = (FileState *) instanceData;
+ unsigned int len, vlen;
TtyAttrs tty;
- Tcl_Size argc;
+#ifdef USE_TERMIOS
+ int flag, control, argc;
const char **argv;
- struct termios iostate;
+ IOSTATE iostate;
+#endif /* USE_TERMIOS */
len = strlen(optionName);
vlen = strlen(value);
@@ -860,9 +744,9 @@ TtySetOptionProc(
/*
* Option -mode baud,parity,databits,stopbits
*/
-
if ((len > 2) && (strncmp(optionName, "-mode", len) == 0)) {
- if (TtyParseMode(interp, value, &tty) != TCL_OK) {
+ if (TtyParseMode(interp, value, &tty.baud, &tty.parity, &tty.data,
+ &tty.stop) != TCL_OK) {
return TCL_ERROR;
}
@@ -870,10 +754,12 @@ TtySetOptionProc(
* system calls results should be checked there. - dl
*/
- TtySetAttributes(fsPtr->fileState.fd, &tty);
+ TtySetAttributes(fsPtr->fd, &tty);
return TCL_OK;
}
+#ifdef USE_TERMIOS
+
/*
* Option -handshake none|xonxoff|rtscts|dtrdsr
*/
@@ -883,15 +769,13 @@ TtySetOptionProc(
* Reset all handshake options. DTR and RTS are ON by default.
*/
- tcgetattr(fsPtr->fileState.fd, &iostate);
+ GETIOSTATE(fsPtr->fd, &iostate);
CLEAR_BITS(iostate.c_iflag, IXON | IXOFF | IXANY);
#ifdef CRTSCTS
CLEAR_BITS(iostate.c_cflag, CRTSCTS);
#endif /* CRTSCTS */
if (strncasecmp(value, "NONE", vlen) == 0) {
- /*
- * Leave all handshake options disabled.
- */
+ /* leave all handshake options disabled */
} else if (strncasecmp(value, "XONXOFF", vlen) == 0) {
SET_BITS(iostate.c_iflag, IXON | IXOFF | IXANY);
} else if (strncasecmp(value, "RTSCTS", vlen) == 0) {
@@ -906,15 +790,13 @@ TtySetOptionProc(
return TCL_ERROR;
} else {
if (interp) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "bad value for -handshake: must be one of"
- " xonxoff, rtscts, dtrdsr or none", -1));
- Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE",
- "VALUE", (char *)NULL);
+ Tcl_AppendResult(interp, "bad value for -handshake: "
+ "must be one of xonxoff, rtscts, dtrdsr or none",
+ NULL);
}
return TCL_ERROR;
}
- tcsetattr(fsPtr->fileState.fd, TCSADRAIN, &iostate);
+ SETIOSTATE(fsPtr->fd, &iostate);
return TCL_OK;
}
@@ -923,42 +805,31 @@ TtySetOptionProc(
*/
if ((len > 1) && (strncmp(optionName, "-xchar", len) == 0)) {
+ GETIOSTATE(fsPtr->fd, &iostate);
if (Tcl_SplitList(interp, value, &argc, &argv) == TCL_ERROR) {
return TCL_ERROR;
- } else if (argc != 2) {
- badXchar:
- if (interp) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "bad value for -xchar: should be a list of"
- " two elements with each a single 8-bit character", -1));
- Tcl_SetErrorCode(interp, "TCL", "VALUE", "XCHAR", (char *)NULL);
- }
- ckfree(argv);
- return TCL_ERROR;
}
+ if (argc == 2) {
+ Tcl_DString ds;
+ Tcl_DStringInit(&ds);
- tcgetattr(fsPtr->fileState.fd, &iostate);
+ Tcl_UtfToExternalDString(NULL, argv[0], -1, &ds);
+ iostate.c_cc[VSTART] = *(const cc_t *) Tcl_DStringValue(&ds);
+ Tcl_DStringSetLength(&ds, 0);
- iostate.c_cc[VSTART] = argv[0][0];
- iostate.c_cc[VSTOP] = argv[1][0];
- if (argv[0][0] & 0x80 || argv[1][0] & 0x80) {
- Tcl_UniChar character = 0;
- int charLen;
-
- charLen = TclUtfToUniChar(argv[0], &character);
- if ((character > 0xFF) || argv[0][charLen]) {
- goto badXchar;
- }
- iostate.c_cc[VSTART] = character;
- charLen = TclUtfToUniChar(argv[1], &character);
- if ((character > 0xFF) || argv[1][charLen]) {
- goto badXchar;
+ Tcl_UtfToExternalDString(NULL, argv[1], -1, &ds);
+ iostate.c_cc[VSTOP] = *(const cc_t *) Tcl_DStringValue(&ds);
+ Tcl_DStringFree(&ds);
+ } else {
+ if (interp) {
+ Tcl_AppendResult(interp, "bad value for -xchar: "
+ "should be a list of two elements", NULL);
}
- iostate.c_cc[VSTOP] = character;
+ ckfree((char *) argv);
+ return TCL_ERROR;
}
- ckfree(argv);
-
- tcsetattr(fsPtr->fileState.fd, TCSADRAIN, &iostate);
+ SETIOSTATE(fsPtr->fd, &iostate);
+ ckfree((char *) argv);
return TCL_OK;
}
@@ -969,13 +840,13 @@ TtySetOptionProc(
if ((len > 2) && (strncmp(optionName, "-timeout", len) == 0)) {
int msec;
- tcgetattr(fsPtr->fileState.fd, &iostate);
+ GETIOSTATE(fsPtr->fd, &iostate);
if (Tcl_GetInt(interp, value, &msec) != TCL_OK) {
return TCL_ERROR;
}
iostate.c_cc[VMIN] = 0;
iostate.c_cc[VTIME] = (msec==0) ? 0 : (msec<100) ? 1 : (msec+50)/100;
- tcsetattr(fsPtr->fileState.fd, TCSADRAIN, &iostate);
+ SETIOSTATE(fsPtr->fd, &iostate);
return TCL_OK;
}
@@ -984,182 +855,80 @@ TtySetOptionProc(
*/
if ((len > 4) && (strncmp(optionName, "-ttycontrol", len) == 0)) {
-#if defined(TIOCMGET) && defined(TIOCMSET)
- int control, flag;
- Tcl_Size i;
+ int i;
if (Tcl_SplitList(interp, value, &argc, &argv) == TCL_ERROR) {
return TCL_ERROR;
}
if ((argc % 2) == 1) {
if (interp) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "bad value for -ttycontrol: should be a list of"
- " signal,value pairs", -1));
- Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE",
- "VALUE", (char *)NULL);
+ Tcl_AppendResult(interp, "bad value for -ttycontrol: "
+ "should be a list of signal,value pairs", NULL);
}
- ckfree(argv);
+ ckfree((char *) argv);
return TCL_ERROR;
}
- ioctl(fsPtr->fileState.fd, TIOCMGET, &control);
+ GETCONTROL(fsPtr->fd, &control);
for (i = 0; i < argc-1; i += 2) {
if (Tcl_GetBoolean(interp, argv[i+1], &flag) == TCL_ERROR) {
- ckfree(argv);
+ ckfree((char *) argv);
return TCL_ERROR;
}
if (strncasecmp(argv[i], "DTR", strlen(argv[i])) == 0) {
+#ifdef TIOCM_DTR
if (flag) {
SET_BITS(control, TIOCM_DTR);
} else {
CLEAR_BITS(control, TIOCM_DTR);
}
+#else /* !TIOCM_DTR */
+ UNSUPPORTED_OPTION("-ttycontrol DTR");
+ ckfree((char *) argv);
+ return TCL_ERROR;
+#endif /* TIOCM_DTR */
} else if (strncasecmp(argv[i], "RTS", strlen(argv[i])) == 0) {
+#ifdef TIOCM_RTS
if (flag) {
SET_BITS(control, TIOCM_RTS);
} else {
CLEAR_BITS(control, TIOCM_RTS);
}
+#else /* !TIOCM_RTS*/
+ UNSUPPORTED_OPTION("-ttycontrol RTS");
+ ckfree((char *) argv);
+ return TCL_ERROR;
+#endif /* TIOCM_RTS*/
} else if (strncasecmp(argv[i], "BREAK", strlen(argv[i])) == 0) {
-#if defined(TIOCSBRK) && defined(TIOCCBRK)
- if (flag) {
- ioctl(fsPtr->fileState.fd, TIOCSBRK, NULL);
- } else {
- ioctl(fsPtr->fileState.fd, TIOCCBRK, NULL);
- }
-#else /* TIOCSBRK & TIOCCBRK */
+#ifdef SETBREAK
+ SETBREAK(fsPtr->fd, flag);
+#else /* !SETBREAK */
UNSUPPORTED_OPTION("-ttycontrol BREAK");
- ckfree(argv);
+ ckfree((char *) argv);
return TCL_ERROR;
-#endif /* TIOCSBRK & TIOCCBRK */
+#endif /* SETBREAK */
} else {
if (interp) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "bad signal \"%s\" for -ttycontrol: must be"
- " DTR, RTS or BREAK", argv[i]));
- Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE",
- "VALUE", (char *)NULL);
+ Tcl_AppendResult(interp, "bad signal \"", argv[i],
+ "\" for -ttycontrol: must be "
+ "DTR, RTS or BREAK", NULL);
}
- ckfree(argv);
+ ckfree((char *) argv);
return TCL_ERROR;
}
} /* -ttycontrol options loop */
- ioctl(fsPtr->fileState.fd, TIOCMSET, &control);
- ckfree(argv);
- return TCL_OK;
-#else /* TIOCMGET&TIOCMSET */
- UNSUPPORTED_OPTION("-ttycontrol");
-#endif /* TIOCMGET&TIOCMSET */
- }
-
- /*
- * Option -closemode drain|discard
- */
-
- if ((len > 2) && (strncmp(optionName, "-closemode", len) == 0)) {
- if (strncasecmp(value, "DEFAULT", vlen) == 0) {
- fsPtr->closeMode = CLOSE_DEFAULT;
- } else if (strncasecmp(value, "DRAIN", vlen) == 0) {
- fsPtr->closeMode = CLOSE_DRAIN;
- } else if (strncasecmp(value, "DISCARD", vlen) == 0) {
- fsPtr->closeMode = CLOSE_DISCARD;
- } else {
- if (interp) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "bad mode \"%s\" for -closemode: must be"
- " default, discard, or drain", value));
- Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE",
- "VALUE", (char *)NULL);
- }
- return TCL_ERROR;
- }
- return TCL_OK;
- }
-
- /*
- * Option -inputmode normal|password|raw
- */
-
- if ((len > 2) && (strncmp(optionName, "-inputmode", len) == 0)) {
- if (tcgetattr(fsPtr->fileState.fd, &iostate) < 0) {
- if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't read serial terminal control state: %s",
- Tcl_PosixError(interp)));
- }
- return TCL_ERROR;
- }
- if (strncasecmp(value, "NORMAL", vlen) == 0) {
- SET_BITS(iostate.c_iflag, BRKINT | IGNPAR | ISTRIP | ICRNL | IXON);
- SET_BITS(iostate.c_oflag, OPOST);
- SET_BITS(iostate.c_lflag, ECHO | ECHONL | ICANON | ISIG);
- } else if (strncasecmp(value, "PASSWORD", vlen) == 0) {
- SET_BITS(iostate.c_iflag, BRKINT | IGNPAR | ISTRIP | ICRNL | IXON);
- SET_BITS(iostate.c_oflag, OPOST);
- CLEAR_BITS(iostate.c_lflag, ECHO);
- /*
- * Note: password input turns out to be best if you echo the
- * newline that the user types. Theoretically we could get users
- * to do the processing of this in their scripts, but it always
- * feels highly unnatural to do so in practice.
- */
- SET_BITS(iostate.c_lflag, ECHONL | ICANON | ISIG);
- } else if (strncasecmp(value, "RAW", vlen) == 0) {
-#ifdef HAVE_CFMAKERAW
- cfmakeraw(&iostate);
-#else /* !HAVE_CFMAKERAW */
- CLEAR_BITS(iostate.c_iflag, IGNBRK | BRKINT | PARMRK | ISTRIP
- | INLCR | IGNCR | ICRNL | IXON);
- CLEAR_BITS(iostate.c_oflag, OPOST);
- CLEAR_BITS(iostate.c_lflag, ECHO | ECHONL | ICANON | ISIG | IEXTEN);
- CLEAR_BITS(iostate.c_cflag, CSIZE | PARENB);
- SET_BITS(iostate.c_cflag, CS8);
-#endif /* HAVE_CFMAKERAW */
- } else if (strncasecmp(value, "RESET", vlen) == 0) {
- /*
- * Reset to the initial state, whatever that is.
- */
-
- memcpy(&iostate, &fsPtr->initState, sizeof(struct termios));
- } else {
- if (interp) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "bad mode \"%s\" for -inputmode: must be"
- " normal, password, raw, or reset", value));
- Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE",
- "VALUE", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (tcsetattr(fsPtr->fileState.fd, TCSADRAIN, &iostate) < 0) {
- if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't update serial terminal control state: %s",
- Tcl_PosixError(interp)));
- }
- return TCL_ERROR;
- }
-
- /*
- * If we've changed the state from default, schedule a reset later.
- * Note that this specifically does not detect changes made by calling
- * an external stty program; that is deliberate, as it maintains
- * compatibility with existing code!
- *
- * This mechanism in Tcl is not intended to be a full replacement for
- * what stty does; it just handles a few common cases and tries not to
- * leave things in a broken state.
- */
-
- fsPtr->doReset = (memcmp(&iostate, &fsPtr->initState,
- sizeof(struct termios)) != 0);
+ SETCONTROL(fsPtr->fd, &control);
+ ckfree((char *) argv);
return TCL_OK;
}
return Tcl_BadChannelOption(interp, optionName,
- "closemode inputmode mode handshake timeout ttycontrol xchar");
+ "mode handshake timeout ttycontrol xchar");
+
+#else /* !USE_TERMIOS */
+ return Tcl_BadChannelOption(interp, optionName, "mode");
+#endif /* USE_TERMIOS */
}
/*
@@ -1174,87 +943,33 @@ TtySetOptionProc(
*
* Results:
* A standard Tcl result. Also sets the supplied DString to the string
- * value of the option(s) returned. Sets error message if needed
- * (by calling Tcl_BadChannelOption).
+ * value of the option(s) returned.
+ *
+ * Side effects:
+ * The string returned by this function is in static storage and may be
+ * reused at any time subsequent to the call. Sets error message if
+ * needed (by calling Tcl_BadChannelOption).
*
*----------------------------------------------------------------------
*/
static int
TtyGetOptionProc(
- void *instanceData, /* File state. */
+ ClientData instanceData, /* File state. */
Tcl_Interp *interp, /* For error reporting - can be NULL. */
const char *optionName, /* Option to get. */
Tcl_DString *dsPtr) /* Where to store value(s). */
{
- TtyState *fsPtr = (TtyState *)instanceData;
- size_t len;
+ FileState *fsPtr = (FileState *) instanceData;
+ unsigned int len;
char buf[3*TCL_INTEGER_SPACE + 16];
int valid = 0; /* Flag if valid option parsed. */
- struct termios iostate;
if (optionName == NULL) {
len = 0;
} else {
len = strlen(optionName);
}
-
- /*
- * Get option -closemode
- */
-
- if (len == 0) {
- Tcl_DStringAppendElement(dsPtr, "-closemode");
- }
- if (len==0 || (len>1 && strncmp(optionName, "-closemode", len)==0)) {
- switch (fsPtr->closeMode) {
- case CLOSE_DRAIN:
- Tcl_DStringAppendElement(dsPtr, "drain");
- break;
- case CLOSE_DISCARD:
- Tcl_DStringAppendElement(dsPtr, "discard");
- break;
- default:
- Tcl_DStringAppendElement(dsPtr, "default");
- break;
- }
- }
-
- /*
- * Get option -inputmode
- *
- * This is a great simplification of the underlying reality, but actually
- * represents what almost all scripts really want to know.
- */
-
- if (len == 0) {
- Tcl_DStringAppendElement(dsPtr, "-inputmode");
- }
- if (len==0 || (len>1 && strncmp(optionName, "-inputmode", len)==0)) {
- valid = 1;
- if (tcgetattr(fsPtr->fileState.fd, &iostate) < 0) {
- if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't read serial terminal control state: %s",
- Tcl_PosixError(interp)));
- }
- return TCL_ERROR;
- }
- if (iostate.c_lflag & ICANON) {
- if (iostate.c_lflag & ECHO) {
- Tcl_DStringAppendElement(dsPtr, "normal");
- } else {
- Tcl_DStringAppendElement(dsPtr, "password");
- }
- } else {
- Tcl_DStringAppendElement(dsPtr, "raw");
- }
- }
-
- /*
- * Get option -mode
- */
-
if (len == 0) {
Tcl_DStringAppendElement(dsPtr, "-mode");
}
@@ -1262,11 +977,12 @@ TtyGetOptionProc(
TtyAttrs tty;
valid = 1;
- TtyGetAttributes(fsPtr->fileState.fd, &tty);
- snprintf(buf, sizeof(buf), "%d,%c,%d,%d", tty.baud, tty.parity, tty.data, tty.stop);
+ TtyGetAttributes(fsPtr->fd, &tty);
+ sprintf(buf, "%d,%c,%d,%d", tty.baud, tty.parity, tty.data, tty.stop);
Tcl_DStringAppendElement(dsPtr, buf);
}
+#ifdef USE_TERMIOS
/*
* Get option -xchar
*/
@@ -1276,18 +992,19 @@ TtyGetOptionProc(
Tcl_DStringStartSublist(dsPtr);
}
if (len==0 || (len>1 && strncmp(optionName, "-xchar", len)==0)) {
+ IOSTATE iostate;
Tcl_DString ds;
-
valid = 1;
- tcgetattr(fsPtr->fileState.fd, &iostate);
+
+ GETIOSTATE(fsPtr->fd, &iostate);
Tcl_DStringInit(&ds);
- Tcl_ExternalToUtfDString(NULL, (char *) &iostate.c_cc[VSTART], 1, &ds);
- Tcl_DStringAppendElement(dsPtr, Tcl_DStringValue(&ds));
- TclDStringClear(&ds);
+ Tcl_ExternalToUtfDString(NULL, (const char *) &iostate.c_cc[VSTART], 1, &ds);
+ Tcl_DStringAppendElement(dsPtr, (const char *) Tcl_DStringValue(&ds));
+ Tcl_DStringSetLength(&ds, 0);
- Tcl_ExternalToUtfDString(NULL, (char *) &iostate.c_cc[VSTOP], 1, &ds);
- Tcl_DStringAppendElement(dsPtr, Tcl_DStringValue(&ds));
+ Tcl_ExternalToUtfDString(NULL, (const char *) &iostate.c_cc[VSTOP], 1, &ds);
+ Tcl_DStringAppendElement(dsPtr, (const char *) Tcl_DStringValue(&ds));
Tcl_DStringFree(&ds);
}
if (len == 0) {
@@ -1304,67 +1021,51 @@ TtyGetOptionProc(
int inQueue=0, outQueue=0, inBuffered, outBuffered;
valid = 1;
- GETREADQUEUE(fsPtr->fileState.fd, inQueue);
- GETWRITEQUEUE(fsPtr->fileState.fd, outQueue);
- inBuffered = Tcl_InputBuffered(fsPtr->fileState.channel);
- outBuffered = Tcl_OutputBuffered(fsPtr->fileState.channel);
-
- snprintf(buf, sizeof(buf), "%d", inBuffered+inQueue);
+#ifdef GETREADQUEUE
+ GETREADQUEUE(fsPtr->fd, inQueue);
+#endif /* GETREADQUEUE */
+#ifdef GETWRITEQUEUE
+ GETWRITEQUEUE(fsPtr->fd, outQueue);
+#endif /* GETWRITEQUEUE */
+ inBuffered = Tcl_InputBuffered(fsPtr->channel);
+ outBuffered = Tcl_OutputBuffered(fsPtr->channel);
+
+ sprintf(buf, "%d", inBuffered+inQueue);
Tcl_DStringAppendElement(dsPtr, buf);
- snprintf(buf, sizeof(buf), "%d", outBuffered+outQueue);
+ sprintf(buf, "%d", outBuffered+outQueue);
Tcl_DStringAppendElement(dsPtr, buf);
}
-#if defined(TIOCMGET)
/*
* Get option -ttystatus
* Option is readonly and returned by [fconfigure chan -ttystatus] but not
* returned by unnamed [fconfigure chan].
*/
-
if ((len > 4) && (strncmp(optionName, "-ttystatus", len) == 0)) {
int status;
valid = 1;
- ioctl(fsPtr->fileState.fd, TIOCMGET, &status);
+ GETCONTROL(fsPtr->fd, &status);
TtyModemStatusStr(status, dsPtr);
}
-#endif /* TIOCMGET */
-
-#if defined(TIOCGWINSZ)
- /*
- * Get option -winsize
- * Option is readonly and returned by [fconfigure chan -winsize] but not
- * returned by [fconfigure chan] without explicit option name.
- */
-
- if ((len > 1) && (strncmp(optionName, "-winsize", len) == 0)) {
- struct winsize ws;
-
- valid = 1;
- if (ioctl(fsPtr->fileState.fd, TIOCGWINSZ, &ws) < 0) {
- if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't read terminal size: %s",
- Tcl_PosixError(interp)));
- }
- return TCL_ERROR;
- }
- snprintf(buf, sizeof(buf), "%d", ws.ws_col);
- Tcl_DStringAppendElement(dsPtr, buf);
- snprintf(buf, sizeof(buf), "%d", ws.ws_row);
- Tcl_DStringAppendElement(dsPtr, buf);
- }
-#endif /* TIOCGWINSZ */
+#endif /* USE_TERMIOS */
if (valid) {
return TCL_OK;
}
- return Tcl_BadChannelOption(interp, optionName,
- "closemode inputmode mode queue ttystatus winsize xchar");
+ return Tcl_BadChannelOption(interp, optionName, "mode"
+#ifdef USE_TERMIOS
+ " queue ttystatus xchar"
+#endif /* USE_TERMIOS */
+ );
}
-static const struct {int baud; speed_t speed;} speeds[] = {
+#ifdef DIRECT_BAUD
+# define TtyGetSpeed(baud) ((unsigned) (baud))
+# define TtyGetBaud(speed) ((int) (speed))
+#else /* !DIRECT_BAUD */
+
+static CONST struct {int baud; unsigned long speed;} speeds[] = {
#ifdef B0
{0, B0},
#endif
@@ -1487,22 +1188,26 @@ static const struct {int baud; speed_t speed;} speeds[] = {
#endif
{-1, 0}
};
-
+
/*
*---------------------------------------------------------------------------
*
* TtyGetSpeed --
*
- * Given an integer baud rate, get the speed_t value that should be
- * used to select that baud rate.
+ * Given a baud rate, get the mask value that should be stored in the
+ * termios, termio, or sgttyb structure in order to select that baud
+ * rate.
*
* Results:
* As above.
*
+ * Side effects:
+ * None.
+ *
*---------------------------------------------------------------------------
*/
-static speed_t
+static unsigned long
TtyGetSpeed(
int baud) /* The baud rate to look up. */
{
@@ -1535,17 +1240,21 @@ TtyGetSpeed(
*
* TtyGetBaud --
*
- * Return the integer baud rate corresponding to a given speed_t value.
+ * Given a speed mask value from a termios, termio, or sgttyb structure,
+ * get the baus rate that corresponds to that mask value.
*
* Results:
* As above. If the mask value was not recognized, 0 is returned.
*
+ * Side effects:
+ * None.
+ *
*---------------------------------------------------------------------------
*/
static int
TtyGetBaud(
- speed_t speed) /* Speed mask value to look up. */
+ unsigned long speed) /* Speed mask value to look up. */
{
int i;
@@ -1556,6 +1265,7 @@ TtyGetBaud(
}
return 0;
}
+#endif /* !DIRECT_BAUD */
/*
*---------------------------------------------------------------------------
@@ -1580,11 +1290,12 @@ TtyGetAttributes(
TtyAttrs *ttyPtr) /* Buffer filled with serial port
* attributes. */
{
- struct termios iostate;
+ IOSTATE iostate;
int baud, parity, data, stop;
- tcgetattr(fd, &iostate);
+ GETIOSTATE(fd, &iostate);
+#ifdef USE_TERMIOS
baud = TtyGetBaud(cfgetospeed(&iostate));
parity = 'n';
@@ -1600,12 +1311,45 @@ TtyGetAttributes(
case PARENB : parity = 'e'; break;
case PARENB | PARODD : parity = 'o'; break;
}
-#endif /* PAREXT */
+#endif /* !PAREXT */
+
+ data = iostate.c_cflag & CSIZE;
+ data = (data == CS5) ? 5 : (data == CS6) ? 6 : (data == CS7) ? 7 : 8;
+
+ stop = (iostate.c_cflag & CSTOPB) ? 2 : 1;
+#endif /* USE_TERMIOS */
+
+#ifdef USE_TERMIO
+ baud = TtyGetBaud(iostate.c_cflag & CBAUD);
+
+ parity = 'n';
+ switch (iostate.c_cflag & (PARENB | PARODD | PAREXT)) {
+ case PARENB : parity = 'e'; break;
+ case PARENB | PARODD : parity = 'o'; break;
+ case PARENB | PAREXT : parity = 's'; break;
+ case PARENB | PARODD | PAREXT : parity = 'm'; break;
+ }
data = iostate.c_cflag & CSIZE;
data = (data == CS5) ? 5 : (data == CS6) ? 6 : (data == CS7) ? 7 : 8;
stop = (iostate.c_cflag & CSTOPB) ? 2 : 1;
+#endif /* USE_TERMIO */
+
+#ifdef USE_SGTTY
+ baud = TtyGetBaud(iostate.sg_ospeed);
+
+ parity = 'n';
+ if (iostate.sg_flags & EVENP) {
+ parity = 'e';
+ } else if (iostate.sg_flags & ODDP) {
+ parity = 'o';
+ }
+
+ data = (iostate.sg_flags & (EVENP | ODDP)) ? 7 : 8;
+
+ stop = 1;
+#endif /* USE_SGTTY */
ttyPtr->baud = baud;
ttyPtr->parity = parity;
@@ -1636,10 +1380,12 @@ TtySetAttributes(
TtyAttrs *ttyPtr) /* Buffer containing new attributes for serial
* port. */
{
- struct termios iostate;
+ IOSTATE iostate;
+
+#ifdef USE_TERMIOS
int parity, data, flag;
- tcgetattr(fd, &iostate);
+ GETIOSTATE(fd, &iostate);
cfsetospeed(&iostate, TtyGetSpeed(ttyPtr->baud));
cfsetispeed(&iostate, TtyGetSpeed(ttyPtr->baud));
@@ -1669,7 +1415,58 @@ TtySetAttributes(
CLEAR_BITS(iostate.c_cflag, PARENB | PARODD | CSIZE | CSTOPB);
SET_BITS(iostate.c_cflag, flag);
- tcsetattr(fd, TCSADRAIN, &iostate);
+#endif /* USE_TERMIOS */
+
+#ifdef USE_TERMIO
+ int parity, data, flag;
+
+ GETIOSTATE(fd, &iostate);
+ CLEAR_BITS(iostate.c_cflag, CBAUD);
+ SET_BITS(iostate.c_cflag, TtyGetSpeed(ttyPtr->baud));
+
+ flag = 0;
+ parity = ttyPtr->parity;
+ if (parity != 'n') {
+ SET_BITS(flag, PARENB);
+ if ((parity == 'm') || (parity == 's')) {
+ SET_BITS(flag, PAREXT);
+ }
+ if ((parity == 'm') || (parity == 'o')) {
+ SET_BITS(flag, PARODD);
+ }
+ }
+ data = ttyPtr->data;
+ SET_BITS(flag,
+ (data == 5) ? CS5 :
+ (data == 6) ? CS6 :
+ (data == 7) ? CS7 : CS8);
+ if (ttyPtr->stop == 2) {
+ SET_BITS(flag, CSTOPB);
+ }
+
+ CLEAR_BITS(iostate.c_cflag, PARENB | PARODD | PAREXT | CSIZE | CSTOPB);
+ SET_BITS(iostate.c_cflag, flag);
+
+#endif /* USE_TERMIO */
+
+#ifdef USE_SGTTY
+ int parity;
+
+ GETIOSTATE(fd, &iostate);
+ iostate.sg_ospeed = TtyGetSpeed(ttyPtr->baud);
+ iostate.sg_ispeed = TtyGetSpeed(ttyPtr->baud);
+
+ parity = ttyPtr->parity;
+ if (parity == 'e') {
+ CLEAR_BITS(iostate.sg_flags, ODDP);
+ SET_BITS(iostate.sg_flags, EVENP);
+ } else if (parity == 'o') {
+ CLEAR_BITS(iostate.sg_flags, EVENP);
+ SET_BITS(iostate.sg_flags, ODDP);
+ }
+#endif /* USE_SGTTY */
+
+ SETIOSTATE(fd, &iostate);
}
/*
@@ -1685,6 +1482,9 @@ TtySetAttributes(
* TCL_ERROR otherwise. If TCL_ERROR is returned, an error message is
* left in the interp's result (if interp is non-NULL).
*
+ * Side effects:
+ * None.
+ *
*---------------------------------------------------------------------------
*/
@@ -1692,22 +1492,21 @@ static int
TtyParseMode(
Tcl_Interp *interp, /* If non-NULL, interp for error return. */
const char *mode, /* Mode string to be parsed. */
- TtyAttrs *ttyPtr) /* Filled with data from mode string */
+ int *speedPtr, /* Filled with baud rate from mode string. */
+ int *parityPtr, /* Filled with parity from mode string. */
+ int *dataPtr, /* Filled with data bits from mode string. */
+ int *stopPtr) /* Filled with stop bits from mode string. */
{
int i, end;
char parity;
- const char *bad = "bad value for -mode";
+ static const char *bad = "bad value for -mode";
- i = sscanf(mode, "%d,%c,%d,%d%n",
- &ttyPtr->baud,
- &parity,
- &ttyPtr->data,
- &ttyPtr->stop, &end);
+ i = sscanf(mode, "%d,%c,%d,%d%n", speedPtr, &parity, dataPtr,
+ stopPtr, &end);
if ((i != 4) || (mode[end] != '\0')) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "%s: should be baud,parity,data,stop", bad));
- Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", (char *)NULL);
+ Tcl_AppendResult(interp, bad, ": should be baud,parity,data,stop",
+ NULL);
}
return TCL_ERROR;
}
@@ -1715,46 +1514,35 @@ TtyParseMode(
/*
* Only allow setting mark/space parity on platforms that support it Make
* sure to allow for the case where strchr is a macro. [Bug: 5089]
- *
- * We cannot if/else/endif the strchr arguments, it has to be the whole
- * function. On AIX this function is apparently a macro, and macros do
- * not allow preprocessor directives in their arguments.
*/
- if (
-#if defined(PAREXT)
- strchr("noems", parity)
+#if defined(PAREXT) || defined(USE_TERMIO)
+ if (strchr("noems", parity) == NULL) {
#else
- strchr("noe", parity)
-#endif /* PAREXT */
- == NULL) {
+ if (strchr("noe", parity) == NULL) {
+#endif /* PAREXT|USE_TERMIO */
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "%s parity: should be %s", bad,
-#if defined(PAREXT)
- "n, o, e, m, or s"
+ Tcl_AppendResult(interp, bad, " parity: should be ",
+#if defined(PAREXT) || defined(USE_TERMIO)
+ "n, o, e, m, or s",
#else
- "n, o, or e"
-#endif /* PAREXT */
- ));
- Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", (char *)NULL);
+ "n, o, or e",
+#endif /* PAREXT|USE_TERMIO */
+ NULL);
}
return TCL_ERROR;
}
- ttyPtr->parity = parity;
- if ((ttyPtr->data < 5) || (ttyPtr->data > 8)) {
+ *parityPtr = parity;
+ if ((*dataPtr < 5) || (*dataPtr > 8)) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "%s data: should be 5, 6, 7, or 8", bad));
- Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", (char *)NULL);
+ Tcl_AppendResult(interp, bad, " data: should be 5, 6, 7, or 8",
+ NULL);
}
return TCL_ERROR;
}
- if ((ttyPtr->stop < 0) || (ttyPtr->stop > 2)) {
+ if ((*stopPtr < 0) || (*stopPtr > 2)) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "%s stop: should be 1 or 2", bad));
- Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", (char *)NULL);
+ Tcl_AppendResult(interp, bad, " stop: should be 1 or 2", NULL);
}
return TCL_ERROR;
}
@@ -1768,38 +1556,72 @@ TtyParseMode(
*
* Given file descriptor that refers to a serial port, initialize the
* serial port to a set of sane values so that Tcl can talk to a device
- * located on the serial port.
+ * located on the serial port. Note that no initialization happens if the
+ * initialize flag is not set; this is necessary for the correct handling
+ * of UNIX console TTYs at startup.
+ *
+ * Results:
+ * A pointer to a FileState suitable for use with Tcl_CreateChannel and
+ * the ttyChannelType structure.
*
* Side effects:
* Serial device initialized to non-blocking raw mode, similar to sockets
- * All other modes can be simulated on top of this in Tcl.
+ * (if initialize flag is non-zero.) All other modes can be simulated on
+ * top of this in Tcl.
*
*---------------------------------------------------------------------------
*/
-static void
+static FileState *
TtyInit(
- int fd) /* Open file descriptor for serial port to be
+ int fd, /* Open file descriptor for serial port to be
* initialized. */
+ int initialize)
{
- struct termios iostate;
- tcgetattr(fd, &iostate);
-
- if (iostate.c_iflag != IGNBRK
- || iostate.c_oflag != 0
- || iostate.c_lflag != 0
- || iostate.c_cflag & CREAD
- || iostate.c_cc[VMIN] != 1
- || iostate.c_cc[VTIME] != 0) {
+ TtyState *ttyPtr;
+ int stateUpdated = 0;
+
+ ttyPtr = (TtyState *) ckalloc((unsigned) sizeof(TtyState));
+ GETIOSTATE(fd, &ttyPtr->savedState);
+ if (initialize) {
+ IOSTATE iostate = ttyPtr->savedState;
+
+#if defined(USE_TERMIOS) || defined(USE_TERMIO)
+ if (iostate.c_iflag != IGNBRK ||
+ iostate.c_oflag != 0 ||
+ iostate.c_lflag != 0 ||
+ iostate.c_cflag & CREAD ||
+ iostate.c_cc[VMIN] != 1 ||
+ iostate.c_cc[VTIME] != 0) {
+ stateUpdated = 1;
+ }
iostate.c_iflag = IGNBRK;
iostate.c_oflag = 0;
iostate.c_lflag = 0;
- iostate.c_cflag |= CREAD;
+ SET_BITS(iostate.c_cflag, CREAD);
iostate.c_cc[VMIN] = 1;
iostate.c_cc[VTIME] = 0;
+#endif /* USE_TERMIOS|USE_TERMIO */
+
+#ifdef USE_SGTTY
+ if ((iostate.sg_flags & (EVENP | ODDP)) ||
+ !(iostate.sg_flags & RAW)) {
+ ttyPtr->stateUpdated = 1;
+ }
+ iostate.sg_flags &= EVENP | ODDP;
+ SET_BITS(iostate.sg_flags, RAW);
+#endif /* USE_SGTTY */
+
+ /*
+ * Only update if we're changing anything to avoid possible blocking.
+ */
- tcsetattr(fd, TCSADRAIN, &iostate);
+ if (stateUpdated) {
+ SETIOSTATE(fd, &iostate);
+ }
}
+
+ return &ttyPtr->fs;
}
#endif /* SUPPORTS_TTY */
@@ -1832,10 +1654,10 @@ TclpOpenFileChannel(
* what modes to create it? */
{
int fd, channelPermissions;
- TtyState *fsPtr;
+ FileState *fsPtr;
const char *native, *translation;
char channelName[16 + TCL_INTEGER_SPACE];
- const Tcl_ChannelType *channelTypePtr;
+ Tcl_ChannelType *channelTypePtr;
switch (mode & (O_RDONLY | O_WRONLY | O_RDWR)) {
case O_RDONLY:
@@ -1856,12 +1678,12 @@ TclpOpenFileChannel(
return NULL;
}
- native = (const char *)Tcl_FSGetNativePath(pathPtr);
+ native = Tcl_FSGetNativePath(pathPtr);
if (native == NULL) {
if (interp != (Tcl_Interp *) NULL) {
Tcl_AppendResult(interp, "couldn't open \"",
TclGetString(pathPtr), "\": filename is invalid on this platform",
- (char *)NULL);
+ NULL);
}
return NULL;
}
@@ -1874,9 +1696,8 @@ TclpOpenFileChannel(
if (fd < 0) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't open \"%s\": %s",
- TclGetString(pathPtr), Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, "couldn't open \"", TclGetString(pathPtr),
+ "\": ", Tcl_PosixError(interp), NULL);
}
return NULL;
}
@@ -1888,6 +1709,8 @@ TclpOpenFileChannel(
fcntl(fd, F_SETFD, FD_CLOEXEC);
+ sprintf(channelName, "file%d", fd);
+
#ifdef SUPPORTS_TTY
if (strcmp(native, "/dev/tty") != 0 && isatty(fd)) {
/*
@@ -1906,29 +1729,20 @@ TclpOpenFileChannel(
translation = "auto crlf";
channelTypePtr = &ttyChannelType;
- TtyInit(fd);
- snprintf(channelName, sizeof(channelName), "serial%d", fd);
+ fsPtr = TtyInit(fd, 1);
} else
#endif /* SUPPORTS_TTY */
{
translation = NULL;
channelTypePtr = &fileChannelType;
- snprintf(channelName, sizeof(channelName), "file%d", fd);
+ fsPtr = (FileState *) ckalloc((unsigned) sizeof(FileState));
}
- fsPtr = (TtyState *)ckalloc(sizeof(TtyState));
- fsPtr->fileState.validMask = channelPermissions | TCL_EXCEPTION;
- fsPtr->fileState.fd = fd;
-#ifdef SUPPORTS_TTY
- if (channelTypePtr == &ttyChannelType) {
- fsPtr->closeMode = CLOSE_DEFAULT;
- fsPtr->doReset = 0;
- tcgetattr(fsPtr->fileState.fd, &fsPtr->initState);
- }
-#endif /* SUPPORTS_TTY */
+ fsPtr->validMask = channelPermissions | TCL_EXCEPTION;
+ fsPtr->fd = fd;
- fsPtr->fileState.channel = Tcl_CreateChannel(channelTypePtr, channelName,
- fsPtr, channelPermissions);
+ fsPtr->channel = Tcl_CreateChannel(channelTypePtr, channelName,
+ (ClientData) fsPtr, channelPermissions);
if (translation != NULL) {
/*
@@ -1939,14 +1753,14 @@ TclpOpenFileChannel(
* reports that the serial port isn't working.
*/
- if (Tcl_SetChannelOption(interp, fsPtr->fileState.channel,
- "-translation", translation) != TCL_OK) {
- Tcl_Close(NULL, fsPtr->fileState.channel);
+ if (Tcl_SetChannelOption(interp, fsPtr->channel, "-translation",
+ translation) != TCL_OK) {
+ Tcl_Close(NULL, fsPtr->channel);
return NULL;
}
}
- return fsPtr->fileState.channel;
+ return fsPtr->channel;
}
/*
@@ -1967,56 +1781,1126 @@ TclpOpenFileChannel(
Tcl_Channel
Tcl_MakeFileChannel(
- void *handle, /* OS level handle. */
- int mode) /* OR'ed combination of TCL_READABLE and
+ ClientData handle, /* OS level handle. */
+ int mode) /* ORed combination of TCL_READABLE and
* TCL_WRITABLE to indicate file mode. */
{
- TtyState *fsPtr;
+ FileState *fsPtr;
char channelName[16 + TCL_INTEGER_SPACE];
int fd = PTR2INT(handle);
- const Tcl_ChannelType *channelTypePtr;
- Tcl_StatBuf buf;
+ Tcl_ChannelType *channelTypePtr;
+ struct sockaddr sockaddr;
+ socklen_t sockaddrLen = sizeof(sockaddr);
if (mode == 0) {
return NULL;
}
+ sockaddr.sa_family = AF_UNSPEC;
+
#ifdef SUPPORTS_TTY
if (isatty(fd)) {
+ fsPtr = TtyInit(fd, 0);
channelTypePtr = &ttyChannelType;
- snprintf(channelName, sizeof(channelName), "serial%d", fd);
- goto final;
+ sprintf(channelName, "serial%d", fd);
} else
#endif /* SUPPORTS_TTY */
- if (TclOSfstat(fd, &buf) == 0 && S_ISSOCK(buf.st_mode)) {
- struct sockaddr sockaddr;
- socklen_t sockaddrLen = sizeof(sockaddr);
-
- sockaddr.sa_family = AF_UNSPEC;
- if ((getsockname(fd, (struct sockaddr *)&sockaddr, &sockaddrLen) == 0)
- && (sockaddrLen > 0)
- && (sockaddr.sa_family == AF_INET
- || sockaddr.sa_family == AF_INET6)) {
- return (Tcl_Channel)TclpMakeTcpClientChannelMode(INT2PTR(fd), mode);
+ if (getsockname(fd, (struct sockaddr *)&sockaddr, &sockaddrLen) == 0
+ && sockaddrLen > 0
+ && sockaddr.sa_family == AF_INET) {
+ return MakeTcpClientChannelMode((ClientData) INT2PTR(fd), mode);
+ } else {
+ channelTypePtr = &fileChannelType;
+ fsPtr = (FileState *) ckalloc((unsigned) sizeof(FileState));
+ sprintf(channelName, "file%d", fd);
+ }
+
+ fsPtr->fd = fd;
+ fsPtr->validMask = mode | TCL_EXCEPTION;
+ fsPtr->channel = Tcl_CreateChannel(channelTypePtr, channelName,
+ (ClientData) fsPtr, mode);
+
+ return fsPtr->channel;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TcpBlockModeProc --
+ *
+ * This function is invoked by the generic IO level to set blocking and
+ * nonblocking mode on a TCP socket based channel.
+ *
+ * Results:
+ * 0 if successful, errno when failed.
+ *
+ * Side effects:
+ * Sets the device into blocking or nonblocking mode.
+ *
+ *----------------------------------------------------------------------
+ */
+
+ /* ARGSUSED */
+static int
+TcpBlockModeProc(
+ ClientData instanceData, /* Socket state. */
+ int mode) /* The mode to set. Can be one of
+ * TCL_MODE_BLOCKING or
+ * TCL_MODE_NONBLOCKING. */
+{
+ TcpState *statePtr = (TcpState *) instanceData;
+
+ if (mode == TCL_MODE_BLOCKING) {
+ CLEAR_BITS(statePtr->flags, TCP_ASYNC_SOCKET);
+ } else {
+ SET_BITS(statePtr->flags, TCP_ASYNC_SOCKET);
+ }
+ if (TclUnixSetBlockingMode(statePtr->fd, mode) < 0) {
+ return errno;
+ }
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WaitForConnect --
+ *
+ * Waits for a connection on an asynchronously opened socket to be
+ * completed.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The socket is connected after this function returns.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+WaitForConnect(
+ TcpState *statePtr, /* State of the socket. */
+ int *errorCodePtr) /* Where to store errors? */
+{
+ int timeOut; /* How long to wait. */
+ int state; /* Of calling TclWaitForFile. */
+
+ /*
+ * If an asynchronous connect is in progress, attempt to wait for it to
+ * complete before reading.
+ */
+
+ if (statePtr->flags & TCP_ASYNC_CONNECT) {
+ if (statePtr->flags & TCP_ASYNC_SOCKET) {
+ timeOut = 0;
+ } else {
+ timeOut = -1;
+ }
+ errno = 0;
+ state = TclUnixWaitForFile(statePtr->fd,
+ TCL_WRITABLE | TCL_EXCEPTION, timeOut);
+ if (!(statePtr->flags & TCP_ASYNC_SOCKET)) {
+ (void) TclUnixSetBlockingMode(statePtr->fd, TCL_MODE_BLOCKING);
+ }
+ if (state & TCL_EXCEPTION) {
+ return -1;
+ }
+ if (state & TCL_WRITABLE) {
+ CLEAR_BITS(statePtr->flags, TCP_ASYNC_CONNECT);
+ } else if (timeOut == 0) {
+ *errorCodePtr = errno = EWOULDBLOCK;
+ return -1;
}
}
- channelTypePtr = &fileChannelType;
- snprintf(channelName, sizeof(channelName), "file%d", fd);
-final:
- fsPtr = (TtyState *)ckalloc(sizeof(TtyState));
- fsPtr->fileState.fd = fd;
- fsPtr->fileState.validMask = mode | TCL_EXCEPTION;
- fsPtr->fileState.channel = Tcl_CreateChannel(channelTypePtr, channelName,
- fsPtr, mode);
-#ifdef SUPPORTS_TTY
- if (channelTypePtr == &ttyChannelType) {
- fsPtr->closeMode = CLOSE_DEFAULT;
- fsPtr->doReset = 0;
- tcgetattr(fsPtr->fileState.fd, &fsPtr->initState);
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TcpInputProc --
+ *
+ * This function is invoked by the generic IO level to read input from a
+ * TCP socket based channel.
+ *
+ * NOTE: We cannot share code with FilePipeInputProc because here we must
+ * use recv to obtain the input from the channel, not read.
+ *
+ * Results:
+ * The number of bytes read is returned or -1 on error. An output
+ * argument contains the POSIX error code on error, or zero if no error
+ * occurred.
+ *
+ * Side effects:
+ * Reads input from the input device of the channel.
+ *
+ *----------------------------------------------------------------------
+ */
+
+ /* ARGSUSED */
+static int
+TcpInputProc(
+ ClientData instanceData, /* Socket state. */
+ char *buf, /* Where to store data read. */
+ int bufSize, /* How much space is available in the
+ * buffer? */
+ int *errorCodePtr) /* Where to store error code. */
+{
+ TcpState *statePtr = (TcpState *) instanceData;
+ int bytesRead, state;
+
+ *errorCodePtr = 0;
+ state = WaitForConnect(statePtr, errorCodePtr);
+ if (state != 0) {
+ return -1;
}
-#endif /* SUPPORTS_TTY */
+ bytesRead = recv(statePtr->fd, buf, (size_t) bufSize, 0);
+ if (bytesRead > -1) {
+ return bytesRead;
+ }
+ if (errno == ECONNRESET) {
+ /*
+ * Turn ECONNRESET into a soft EOF condition.
+ */
+
+ return 0;
+ }
+ *errorCodePtr = errno;
+ return -1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TcpOutputProc --
+ *
+ * This function is invoked by the generic IO level to write output to a
+ * TCP socket based channel.
+ *
+ * NOTE: We cannot share code with FilePipeOutputProc because here we
+ * must use send, not write, to get reliable error reporting.
+ *
+ * Results:
+ * The number of bytes written is returned. An output argument is set to
+ * a POSIX error code if an error occurred, or zero.
+ *
+ * Side effects:
+ * Writes output on the output device of the channel.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+TcpOutputProc(
+ ClientData instanceData, /* Socket state. */
+ const char *buf, /* The data buffer. */
+ int toWrite, /* How many bytes to write? */
+ int *errorCodePtr) /* Where to store error code. */
+{
+ TcpState *statePtr = (TcpState *) instanceData;
+ int written;
+ int state; /* Of waiting for connection. */
+
+ *errorCodePtr = 0;
+ state = WaitForConnect(statePtr, errorCodePtr);
+ if (state != 0) {
+ return -1;
+ }
+ written = send(statePtr->fd, buf, (size_t) toWrite, 0);
+ if (written > -1) {
+ return written;
+ }
+ *errorCodePtr = errno;
+ return -1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TcpCloseProc --
+ *
+ * This function is invoked by the generic IO level to perform
+ * channel-type-specific cleanup when a TCP socket based channel is
+ * closed.
+ *
+ * Results:
+ * 0 if successful, the value of errno if failed.
+ *
+ * Side effects:
+ * Closes the socket of the channel.
+ *
+ *----------------------------------------------------------------------
+ */
+
+ /* ARGSUSED */
+static int
+TcpCloseProc(
+ ClientData instanceData, /* The socket to close. */
+ Tcl_Interp *interp) /* For error reporting - unused. */
+{
+ TcpState *statePtr = (TcpState *) instanceData;
+ int errorCode = 0;
+
+ /*
+ * Delete a file handler that may be active for this socket if this is a
+ * server socket - the file handler was created automatically by Tcl as
+ * part of the mechanism to accept new client connections. Channel
+ * handlers are already deleted in the generic IO channel closing code
+ * that called this function, so we do not have to delete them here.
+ */
+
+ Tcl_DeleteFileHandler(statePtr->fd);
+
+ if (close(statePtr->fd) < 0) {
+ errorCode = errno;
+ }
+ ckfree((char *) statePtr);
+
+ return errorCode;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TcpGetOptionProc --
+ *
+ * Computes an option value for a TCP socket based channel, or a list of
+ * all options and their values.
+ *
+ * Note: This code is based on code contributed by John Haxby.
+ *
+ * Results:
+ * A standard Tcl result. The value of the specified option or a list of
+ * all options and their values is returned in the supplied DString. Sets
+ * Error message if needed.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+TcpGetOptionProc(
+ ClientData instanceData, /* Socket state. */
+ Tcl_Interp *interp, /* For error reporting - can be NULL. */
+ const char *optionName, /* Name of the option to retrieve the value
+ * for, or NULL to get all options and their
+ * values. */
+ Tcl_DString *dsPtr) /* Where to store the computed value;
+ * initialized by caller. */
+{
+ TcpState *statePtr = (TcpState *) instanceData;
+ struct sockaddr_in sockname;
+ struct sockaddr_in peername;
+ struct hostent *hostEntPtr;
+ socklen_t size = sizeof(struct sockaddr_in);
+ size_t len = 0;
+ char buf[TCL_INTEGER_SPACE];
+
+ if (optionName != NULL) {
+ len = strlen(optionName);
+ }
+
+ if ((len > 1) && (optionName[1] == 'e') &&
+ (strncmp(optionName, "-error", len) == 0)) {
+ socklen_t optlen = sizeof(int);
+ int err, ret;
+
+ ret = getsockopt(statePtr->fd, SOL_SOCKET, SO_ERROR,
+ (char *)&err, &optlen);
+ if (ret < 0) {
+ err = errno;
+ }
+ if (err != 0) {
+ Tcl_DStringAppend(dsPtr, Tcl_ErrnoMsg(err), -1);
+ }
+ return TCL_OK;
+ }
+
+ if ((len == 0) ||
+ ((len > 1) && (optionName[1] == 'p') &&
+ (strncmp(optionName, "-peername", len) == 0))) {
+ if (getpeername(statePtr->fd, (struct sockaddr *) &peername,
+ &size) >= 0) {
+ if (len == 0) {
+ Tcl_DStringAppendElement(dsPtr, "-peername");
+ Tcl_DStringStartSublist(dsPtr);
+ }
+ Tcl_DStringAppendElement(dsPtr, inet_ntoa(peername.sin_addr));
+ hostEntPtr = TclpGetHostByAddr( /* INTL: Native. */
+ (char *) &peername.sin_addr,
+ sizeof(peername.sin_addr), AF_INET);
+ if (hostEntPtr != NULL) {
+ Tcl_DString ds;
+
+ Tcl_ExternalToUtfDString(NULL, hostEntPtr->h_name, -1, &ds);
+ Tcl_DStringAppendElement(dsPtr, Tcl_DStringValue(&ds));
+ Tcl_DStringFree(&ds);
+ } else {
+ Tcl_DStringAppendElement(dsPtr, inet_ntoa(peername.sin_addr));
+ }
+ TclFormatInt(buf, ntohs(peername.sin_port));
+ Tcl_DStringAppendElement(dsPtr, buf);
+ if (len == 0) {
+ Tcl_DStringEndSublist(dsPtr);
+ } else {
+ return TCL_OK;
+ }
+ } else {
+ /*
+ * getpeername failed - but if we were asked for all the options
+ * (len==0), don't flag an error at that point because it could be
+ * an fconfigure request on a server socket (which have no peer).
+ * Same must be done on win&mac.
+ */
+
+ if (len) {
+ if (interp) {
+ Tcl_AppendResult(interp, "can't get peername: ",
+ Tcl_PosixError(interp), NULL);
+ }
+ return TCL_ERROR;
+ }
+ }
+ }
+
+ if ((len == 0) ||
+ ((len > 1) && (optionName[1] == 's') &&
+ (strncmp(optionName, "-sockname", len) == 0))) {
+ if (getsockname(statePtr->fd, (struct sockaddr *) &sockname,
+ &size) >= 0) {
+ if (len == 0) {
+ Tcl_DStringAppendElement(dsPtr, "-sockname");
+ Tcl_DStringStartSublist(dsPtr);
+ }
+ Tcl_DStringAppendElement(dsPtr, inet_ntoa(sockname.sin_addr));
+ if (sockname.sin_addr.s_addr == INADDR_ANY) {
+ /*
+ * We don't want to resolve INADDR_ANY; it can sometimes cause
+ * problems (and never has a name).
+ */
+
+ hostEntPtr = NULL;
+ } else {
+ hostEntPtr = TclpGetHostByAddr( /* INTL: Native. */
+ (char *) &sockname.sin_addr,
+ sizeof(sockname.sin_addr), AF_INET);
+ }
+ if (hostEntPtr != NULL) {
+ Tcl_DString ds;
+
+ Tcl_ExternalToUtfDString(NULL, hostEntPtr->h_name, -1, &ds);
+ Tcl_DStringAppendElement(dsPtr, Tcl_DStringValue(&ds));
+ Tcl_DStringFree(&ds);
+ } else {
+ Tcl_DStringAppendElement(dsPtr, inet_ntoa(sockname.sin_addr));
+ }
+ TclFormatInt(buf, ntohs(sockname.sin_port));
+ Tcl_DStringAppendElement(dsPtr, buf);
+ if (len == 0) {
+ Tcl_DStringEndSublist(dsPtr);
+ } else {
+ return TCL_OK;
+ }
+ } else {
+ if (interp) {
+ Tcl_AppendResult(interp, "can't get sockname: ",
+ Tcl_PosixError(interp), NULL);
+ }
+ return TCL_ERROR;
+ }
+ }
+
+ if (len > 0) {
+ return Tcl_BadChannelOption(interp, optionName, "peername sockname");
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TcpWatchProc --
+ *
+ * Initialize the notifier to watch the fd from this channel.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Sets up the notifier so that a future event on the channel will be
+ * seen by Tcl.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+WrapNotify(
+ ClientData clientData,
+ int mask)
+{
+ TcpState *statePtr = (TcpState *) clientData;
+ int newmask = mask & statePtr->interest;
+
+ if (newmask == 0) {
+ /*
+ * There was no overlap between the states the channel is
+ * interested in notifications for, and the states that are
+ * reported present on the file descriptor by select(). The
+ * only way that can happen is when the channel is interested
+ * in a writable condition, and only a readable state is reported
+ * present (see TcpWatchProc() below). In that case, signal back
+ * to the caller the writable state, which is really an error
+ * condition. As an extra check on that assumption, check for
+ * a non-zero value of errno before reporting an artificial
+ * writable state.
+ */
+ if (errno == 0) {
+ return;
+ }
+ newmask = TCL_WRITABLE;
+ }
+ Tcl_NotifyChannel(statePtr->channel, newmask);
+}
+
+static void
+TcpWatchProc(
+ ClientData instanceData, /* The socket state. */
+ int mask) /* Events of interest; an OR-ed combination of
+ * TCL_READABLE, TCL_WRITABLE and
+ * TCL_EXCEPTION. */
+{
+ TcpState *statePtr = (TcpState *) instanceData;
+
+ /*
+ * Make sure we don't mess with server sockets since they will never be
+ * readable or writable at the Tcl level. This keeps Tcl scripts from
+ * interfering with the -accept behavior.
+ */
+
+ if (!statePtr->acceptProc) {
+ if (mask) {
+
+ /*
+ * Whether it is a bug or feature or otherwise, it is a fact
+ * of life that on at least some Linux kernels select() fails
+ * to report that a socket file descriptor is writable when
+ * the other end of the socket is closed. This is in contrast
+ * to the guarantees Tcl makes that its channels become
+ * writable and fire writable events on an error conditon.
+ * This has caused a leak of file descriptors in a state of
+ * background flushing. See Tcl ticket 1758a0b603.
+ *
+ * As a workaround, when our caller indicates an interest in
+ * writable notifications, we must tell the notifier built
+ * around select() that we are interested in the readable state
+ * of the file descriptor as well, as that is the only reliable
+ * means to get notified of error conditions. Then it is the
+ * task of WrapNotify() above to untangle the meaning of these
+ * channel states and report the chan events as best it can.
+ * We save a copy of the mask passed in to assist with that.
+ */
+
+ statePtr->interest = mask;
+ Tcl_CreateFileHandler(statePtr->fd, mask|TCL_READABLE,
+ (Tcl_FileProc *) WrapNotify, (ClientData) statePtr);
+ } else {
+ Tcl_DeleteFileHandler(statePtr->fd);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TcpGetHandleProc --
+ *
+ * Called from Tcl_GetChannelHandle to retrieve OS handles from inside a
+ * TCP socket based channel.
+ *
+ * Results:
+ * Returns TCL_OK with the fd in handlePtr, or TCL_ERROR if there is no
+ * handle for the specified direction.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+ /* ARGSUSED */
+static int
+TcpGetHandleProc(
+ ClientData instanceData, /* The socket state. */
+ int direction, /* Not used. */
+ ClientData *handlePtr) /* Where to store the handle. */
+{
+ TcpState *statePtr = (TcpState *) instanceData;
+
+ *handlePtr = (ClientData) INT2PTR(statePtr->fd);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * CreateSocket --
+ *
+ * This function opens a new socket in client or server mode and
+ * initializes the TcpState structure.
+ *
+ * Results:
+ * Returns a new TcpState, or NULL with an error in the interp's result,
+ * if interp is not NULL.
+ *
+ * Side effects:
+ * Opens a socket.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static TcpState *
+CreateSocket(
+ Tcl_Interp *interp, /* For error reporting; can be NULL. */
+ int port, /* Port number to open. */
+ const char *host, /* Name of host on which to open port. NULL
+ * implies INADDR_ANY */
+ int server, /* 1 if socket should be a server socket, else
+ * 0 for a client socket. */
+ const char *myaddr, /* Optional client-side address */
+ int myport, /* Optional client-side port */
+ int async) /* If nonzero and creating a client socket,
+ * attempt to do an async connect. Otherwise
+ * do a synchronous connect or bind. */
+{
+ int status, sock, asyncConnect, curState;
+ struct sockaddr_in sockaddr; /* socket address */
+ struct sockaddr_in mysockaddr; /* Socket address for client */
+ TcpState *statePtr;
+ const char *errorMsg = NULL;
+
+ sock = -1;
+ if (!CreateSocketAddress(&sockaddr, host, port, 0, &errorMsg)) {
+ goto addressError;
+ }
+ if ((myaddr != NULL || myport != 0) &&
+ !CreateSocketAddress(&mysockaddr, myaddr, myport, 1, &errorMsg)) {
+ goto addressError;
+ }
+
+ sock = socket(AF_INET, SOCK_STREAM, 0);
+ if (sock < 0) {
+ goto addressError;
+ }
+
+ /*
+ * Set the close-on-exec flag so that the socket will not get inherited by
+ * child processes.
+ */
+
+ fcntl(sock, F_SETFD, FD_CLOEXEC);
+
+ /*
+ * Set kernel space buffering
+ */
+
+ TclSockMinimumBuffers(sock, SOCKET_BUFSIZE);
+
+ asyncConnect = 0;
+ status = 0;
+ if (server) {
+ /*
+ * Set up to reuse server addresses automatically and bind to the
+ * specified port.
+ */
+
+ status = 1;
+ (void) setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &status,
+ sizeof(status));
+ status = bind(sock, (struct sockaddr *) &sockaddr,
+ sizeof(struct sockaddr));
+ if (status != -1) {
+ status = listen(sock, SOMAXCONN);
+ }
+ } else {
+ if (myaddr != NULL || myport != 0) {
+ curState = 1;
+ (void) setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
+ (char *) &curState, sizeof(curState));
+ status = bind(sock, (struct sockaddr *) &mysockaddr,
+ sizeof(struct sockaddr));
+ if (status < 0) {
+ goto bindError;
+ }
+ }
+
+ /*
+ * Attempt to connect. The connect may fail at present with an
+ * EINPROGRESS but at a later time it will complete. The caller will
+ * set up a file handler on the socket if she is interested in being
+ * informed when the connect completes.
+ */
+
+ if (async) {
+ status = TclUnixSetBlockingMode(sock, TCL_MODE_NONBLOCKING);
+ } else {
+ status = 0;
+ }
+ if (status > -1) {
+ status = connect(sock, (struct sockaddr *) &sockaddr,
+ sizeof(sockaddr));
+ if (status < 0) {
+ if (errno == EINPROGRESS) {
+ asyncConnect = 1;
+ status = 0;
+ }
+ } else {
+ /*
+ * Here we are if the connect succeeds. In case of an
+ * asynchronous connect we have to reset the channel to
+ * blocking mode. This appears to happen not very often, but
+ * e.g. on a HP 9000/800 under HP-UX B.11.00 we enter this
+ * stage. [Bug: 4388]
+ */
+
+ if (async) {
+ status = TclUnixSetBlockingMode(sock, TCL_MODE_BLOCKING);
+ }
+ }
+ }
+ }
+
+ bindError:
+ if (status < 0) {
+ if (interp != NULL) {
+ Tcl_AppendResult(interp, "couldn't open socket: ",
+ Tcl_PosixError(interp), NULL);
+ }
+ if (sock != -1) {
+ close(sock);
+ }
+ return NULL;
+ }
+
+ /*
+ * Allocate a new TcpState for this socket.
+ */
+
+ statePtr = (TcpState *) ckalloc((unsigned) sizeof(TcpState));
+ statePtr->flags = 0;
+ if (asyncConnect) {
+ statePtr->flags = TCP_ASYNC_CONNECT;
+ }
+ statePtr->interest = 0;
+ statePtr->fd = sock;
+
+ return statePtr;
+
+ addressError:
+ if (sock != -1) {
+ close(sock);
+ }
+ if (interp != NULL) {
+ Tcl_AppendResult(interp, "couldn't open socket: ",
+ Tcl_PosixError(interp), NULL);
+ if (errorMsg != NULL) {
+ Tcl_AppendResult(interp, " (", errorMsg, ")", NULL);
+ }
+ }
+ return NULL;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * CreateSocketAddress --
+ *
+ * This function initializes a sockaddr structure for a host and port.
+ *
+ * Results:
+ * 1 if the host was valid, 0 if the host could not be converted to an IP
+ * address.
+ *
+ * Side effects:
+ * Fills in the *sockaddrPtr structure.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+CreateSocketAddress(
+ struct sockaddr_in *sockaddrPtr, /* Socket address */
+ const char *host, /* Host. NULL implies INADDR_ANY */
+ int port, /* Port number */
+ int willBind, /* Is this an address to bind() to or
+ * to connect() to? */
+ const char **errorMsgPtr) /* Place to store the error message
+ * detail, if available. */
+{
+#ifdef HAVE_GETADDRINFO
+ struct addrinfo hints, *resPtr = NULL;
+ char *native;
+ Tcl_DString ds;
+ int result;
+
+ if (host == NULL) {
+ sockaddrPtr->sin_family = AF_INET;
+ sockaddrPtr->sin_addr.s_addr = INADDR_ANY;
+ addPort:
+ sockaddrPtr->sin_port = htons((unsigned short) (port & 0xFFFF));
+ return 1;
+ }
+
+ (void) memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = AF_INET;
+ hints.ai_socktype = SOCK_STREAM;
+ if (willBind) {
+ hints.ai_flags |= AI_PASSIVE;
+ }
+
+ /*
+ * Note that getaddrinfo() *is* thread-safe. If a platform doesn't get
+ * that right, it shouldn't use this part of the code.
+ */
+
+ native = Tcl_UtfToExternalDString(NULL, host, -1, &ds);
+ result = getaddrinfo(native, NULL, &hints, &resPtr);
+ Tcl_DStringFree(&ds);
+ if (result == 0) {
+ memcpy(sockaddrPtr, resPtr->ai_addr, sizeof(struct sockaddr_in));
+ freeaddrinfo(resPtr);
+ goto addPort;
+ }
+
+ /*
+ * Ought to use gai_strerror() here...
+ */
+
+ switch (result) {
+ case EAI_NONAME:
+ case EAI_SERVICE:
+#if defined(EAI_ADDRFAMILY) && EAI_ADDRFAMILY != EAI_NONAME
+ case EAI_ADDRFAMILY:
+#endif
+#if defined(EAI_NODATA) && EAI_NODATA != EAI_NONAME
+ case EAI_NODATA:
+#endif
+ *errorMsgPtr = gai_strerror(result);
+ errno = EHOSTUNREACH;
+ return 0;
+ case EAI_SYSTEM:
+ return 0;
+ default:
+ *errorMsgPtr = gai_strerror(result);
+ errno = ENXIO;
+ return 0;
+ }
+#else /* !HAVE_GETADDRINFO */
+ struct in_addr addr; /* For 64/32 bit madness */
+
+ (void) memset(sockaddrPtr, '\0', sizeof(struct sockaddr_in));
+ sockaddrPtr->sin_family = AF_INET;
+ sockaddrPtr->sin_port = htons((unsigned short) (port & 0xFFFF));
+ if (host == NULL) {
+ addr.s_addr = INADDR_ANY;
+ } else {
+ struct hostent *hostent; /* Host database entry */
+ Tcl_DString ds;
+ const char *native;
+
+ if (host == NULL) {
+ native = NULL;
+ } else {
+ native = Tcl_UtfToExternalDString(NULL, host, -1, &ds);
+ }
+ addr.s_addr = inet_addr(native); /* INTL: Native. */
+
+ /*
+ * This is 0xFFFFFFFF to ensure that it compares as a 32bit -1 on
+ * either 32 or 64 bits systems.
+ */
+
+ if (addr.s_addr == 0xFFFFFFFF) {
+ hostent = TclpGetHostByName(native); /* INTL: Native. */
+ if (hostent != NULL) {
+ memcpy(&addr, hostent->h_addr_list[0],
+ (size_t) hostent->h_length);
+ } else {
+#ifdef EHOSTUNREACH
+ errno = EHOSTUNREACH;
+#else /* !EHOSTUNREACH */
+#ifdef ENXIO
+ errno = ENXIO;
+#endif /* ENXIO */
+#endif /* EHOSTUNREACH */
+ if (native != NULL) {
+ Tcl_DStringFree(&ds);
+ }
+ return 0; /* Error. */
+ }
+ }
+ if (native != NULL) {
+ Tcl_DStringFree(&ds);
+ }
+ }
+
+ /*
+ * NOTE: On 64 bit machines the assignment below is rumored to not do the
+ * right thing. Please report errors related to this if you observe
+ * incorrect behavior on 64 bit machines such as DEC Alphas. Should we
+ * modify this code to do an explicit memcpy?
+ */
+
+ sockaddrPtr->sin_addr.s_addr = addr.s_addr;
+ return 1; /* Success. */
+#endif /* HAVE_GETADDRINFO */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_OpenTcpClient --
+ *
+ * Opens a TCP client socket and creates a channel around it.
+ *
+ * Results:
+ * The channel or NULL if failed. An error message is returned in the
+ * interpreter on failure.
+ *
+ * Side effects:
+ * Opens a client socket and creates a new channel.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Tcl_Channel
+Tcl_OpenTcpClient(
+ Tcl_Interp *interp, /* For error reporting; can be NULL. */
+ int port, /* Port number to open. */
+ const char *host, /* Host on which to open port. */
+ const char *myaddr, /* Client-side address */
+ int myport, /* Client-side port */
+ int async) /* If nonzero, attempt to do an asynchronous
+ * connect. Otherwise we do a blocking
+ * connect. */
+{
+ TcpState *statePtr;
+ char channelName[16 + TCL_INTEGER_SPACE];
+
+ /*
+ * Create a new client socket and wrap it in a channel.
+ */
+
+ statePtr = CreateSocket(interp, port, host, 0, myaddr, myport, async);
+ if (statePtr == NULL) {
+ return NULL;
+ }
+
+ statePtr->acceptProc = NULL;
+ statePtr->acceptProcData = NULL;
+
+ sprintf(channelName, "sock%d", statePtr->fd);
+
+ statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName,
+ (ClientData) statePtr, (TCL_READABLE | TCL_WRITABLE));
+ if (Tcl_SetChannelOption(interp, statePtr->channel, "-translation",
+ "auto crlf") == TCL_ERROR) {
+ Tcl_Close(NULL, statePtr->channel);
+ return NULL;
+ }
+ return statePtr->channel;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_MakeTcpClientChannel --
+ *
+ * Creates a Tcl_Channel from an existing client TCP socket.
+ *
+ * Results:
+ * The Tcl_Channel wrapped around the preexisting TCP socket.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Tcl_Channel
+Tcl_MakeTcpClientChannel(
+ ClientData sock) /* The socket to wrap up into a channel. */
+{
+ return MakeTcpClientChannelMode(sock, (TCL_READABLE | TCL_WRITABLE));
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MakeTcpClientChannelMode --
+ *
+ * Creates a Tcl_Channel from an existing client TCP socket
+ * with given mode.
+ *
+ * Results:
+ * The Tcl_Channel wrapped around the preexisting TCP socket.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static Tcl_Channel
+MakeTcpClientChannelMode(
+ ClientData sock, /* The socket to wrap up into a channel. */
+ int mode) /* ORed combination of TCL_READABLE and
+ * TCL_WRITABLE to indicate file mode. */
+{
+ TcpState *statePtr;
+ char channelName[16 + TCL_INTEGER_SPACE];
+
+ statePtr = (TcpState *) ckalloc((unsigned) sizeof(TcpState));
+ statePtr->fd = PTR2INT(sock);
+ statePtr->flags = 0;
+ statePtr->interest = 0;
+ statePtr->acceptProc = NULL;
+ statePtr->acceptProcData = NULL;
+
+ sprintf(channelName, "sock%d", statePtr->fd);
+
+ statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName,
+ (ClientData) statePtr, mode);
+ if (Tcl_SetChannelOption(NULL, statePtr->channel, "-translation",
+ "auto crlf") == TCL_ERROR) {
+ Tcl_Close(NULL, statePtr->channel);
+ return NULL;
+ }
+ return statePtr->channel;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_OpenTcpServer --
+ *
+ * Opens a TCP server socket and creates a channel around it.
+ *
+ * Results:
+ * The channel or NULL if failed. If an error occurred, an error message
+ * is left in the interp's result if interp is not NULL.
+ *
+ * Side effects:
+ * Opens a server socket and creates a new channel.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Tcl_Channel
+Tcl_OpenTcpServer(
+ Tcl_Interp *interp, /* For error reporting - may be NULL. */
+ int port, /* Port number to open. */
+ const char *myHost, /* Name of local host. */
+ Tcl_TcpAcceptProc *acceptProc,
+ /* Callback for accepting connections from new
+ * clients. */
+ ClientData acceptProcData) /* Data for the callback. */
+{
+ TcpState *statePtr;
+ char channelName[16 + TCL_INTEGER_SPACE];
+
+ /*
+ * Create a new client socket and wrap it in a channel.
+ */
- return fsPtr->fileState.channel;
+ statePtr = CreateSocket(interp, port, myHost, 1, NULL, 0, 0);
+ if (statePtr == NULL) {
+ return NULL;
+ }
+
+ statePtr->acceptProc = acceptProc;
+ statePtr->acceptProcData = acceptProcData;
+
+ /*
+ * Set up the callback mechanism for accepting connections from new
+ * clients.
+ */
+
+ Tcl_CreateFileHandler(statePtr->fd, TCL_READABLE, TcpAccept,
+ (ClientData) statePtr);
+ sprintf(channelName, "sock%d", statePtr->fd);
+ statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName,
+ (ClientData) statePtr, 0);
+ return statePtr->channel;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TcpAccept --
+ * Accept a TCP socket connection. This is called by the event loop.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Creates a new connection socket. Calls the registered callback for the
+ * connection acceptance mechanism.
+ *
+ *----------------------------------------------------------------------
+ */
+
+ /* ARGSUSED */
+static void
+TcpAccept(
+ ClientData data, /* Callback token. */
+ int mask) /* Not used. */
+{
+ TcpState *sockState; /* Client data of server socket. */
+ int newsock; /* The new client socket */
+ TcpState *newSockState; /* State for new socket. */
+ struct sockaddr_in addr; /* The remote address */
+ socklen_t len; /* For accept interface */
+ char channelName[16 + TCL_INTEGER_SPACE];
+
+ sockState = (TcpState *) data;
+
+ len = sizeof(struct sockaddr_in);
+ newsock = accept(sockState->fd, (struct sockaddr *) &addr, &len);
+ if (newsock < 0) {
+ return;
+ }
+
+ /*
+ * Set close-on-exec flag to prevent the newly accepted socket from being
+ * inherited by child processes.
+ */
+
+ (void) fcntl(newsock, F_SETFD, FD_CLOEXEC);
+
+ newSockState = (TcpState *) ckalloc((unsigned) sizeof(TcpState));
+
+ newSockState->flags = 0;
+ newSockState->interest = 0;
+ newSockState->fd = newsock;
+ newSockState->acceptProc = NULL;
+ newSockState->acceptProcData = NULL;
+
+ sprintf(channelName, "sock%d", newsock);
+ newSockState->channel = Tcl_CreateChannel(&tcpChannelType, channelName,
+ (ClientData) newSockState, (TCL_READABLE | TCL_WRITABLE));
+
+ Tcl_SetChannelOption(NULL, newSockState->channel, "-translation",
+ "auto crlf");
+
+ if (sockState->acceptProc != NULL) {
+ (*sockState->acceptProc)(sockState->acceptProcData,
+ newSockState->channel, inet_ntoa(addr.sin_addr),
+ ntohs(addr.sin_port));
+ }
}
/*
@@ -2049,11 +2933,12 @@ TclpGetDefaultStdChannel(
* Some #def's to make the code a little clearer!
*/
+#define ZERO_OFFSET ((Tcl_SeekOffset) 0)
#define ERROR_OFFSET ((Tcl_SeekOffset) -1)
switch (type) {
case TCL_STDIN:
- if ((TclOSseek(0, 0, SEEK_CUR) == ERROR_OFFSET)
+ if ((TclOSseek(0, ZERO_OFFSET, SEEK_CUR) == ERROR_OFFSET)
&& (errno == EBADF)) {
return NULL;
}
@@ -2062,7 +2947,7 @@ TclpGetDefaultStdChannel(
bufMode = "line";
break;
case TCL_STDOUT:
- if ((TclOSseek(1, 0, SEEK_CUR) == ERROR_OFFSET)
+ if ((TclOSseek(1, ZERO_OFFSET, SEEK_CUR) == ERROR_OFFSET)
&& (errno == EBADF)) {
return NULL;
}
@@ -2071,7 +2956,7 @@ TclpGetDefaultStdChannel(
bufMode = "line";
break;
case TCL_STDERR:
- if ((TclOSseek(2, 0, SEEK_CUR) == ERROR_OFFSET)
+ if ((TclOSseek(2, ZERO_OFFSET, SEEK_CUR) == ERROR_OFFSET)
&& (errno == EBADF)) {
return NULL;
}
@@ -2084,9 +2969,10 @@ TclpGetDefaultStdChannel(
break;
}
+#undef ZERO_OFFSET
#undef ERROR_OFFSET
- channel = Tcl_MakeFileChannel(INT2PTR(fd), mode);
+ channel = Tcl_MakeFileChannel((ClientData) INT2PTR(fd), mode);
if (channel == NULL) {
return NULL;
}
@@ -2132,33 +3018,30 @@ Tcl_GetOpenFile(
const char *chanID, /* String that identifies file. */
int forWriting, /* 1 means the file is going to be used for
* writing, 0 means for reading. */
- TCL_UNUSED(int), /* Obsolete argument.
- * Ignored, we always check that
+ int checkUsage, /* 1 means verify that the file was opened in
+ * a mode that allows the access specified by
+ * "forWriting". Ignored, we always check that
* the channel is open for the requested
* mode. */
- void **filePtr) /* Store pointer to FILE structure here. */
+ ClientData *filePtr) /* Store pointer to FILE structure here. */
{
Tcl_Channel chan;
int chanMode, fd;
const Tcl_ChannelType *chanTypePtr;
- void *data;
+ ClientData data;
FILE *f;
chan = Tcl_GetChannel(interp, chanID, &chanMode);
- if (chan == NULL) {
+ if (chan == (Tcl_Channel) NULL) {
return TCL_ERROR;
}
- if (forWriting && !(chanMode & TCL_WRITABLE)) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "\"%s\" wasn't opened for writing", chanID));
- Tcl_SetErrorCode(interp, "TCL", "VALUE", "CHANNEL", "NOT_WRITABLE",
- (char *)NULL);
+ if ((forWriting) && ((chanMode & TCL_WRITABLE) == 0)) {
+ Tcl_AppendResult(interp, "\"", chanID, "\" wasn't opened for writing",
+ NULL);
return TCL_ERROR;
- } else if (!forWriting && !(chanMode & TCL_READABLE)) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "\"%s\" wasn't opened for reading", chanID));
- Tcl_SetErrorCode(interp, "TCL", "VALUE", "CHANNEL", "NOT_READABLE",
- (char *)NULL);
+ } else if ((!forWriting) && ((chanMode & TCL_READABLE) == 0)) {
+ Tcl_AppendResult(interp, "\"", chanID, "\" wasn't opened for reading",
+ NULL);
return TCL_ERROR;
}
@@ -2173,10 +3056,11 @@ Tcl_GetOpenFile(
#ifdef SUPPORTS_TTY
|| (chanTypePtr == &ttyChannelType)
#endif /* SUPPORTS_TTY */
- || (strcmp(chanTypePtr->typeName, "tcp") == 0)
+ || (chanTypePtr == &tcpChannelType)
|| (strcmp(chanTypePtr->typeName, "pipe") == 0)) {
if (Tcl_GetChannelHandle(chan,
- (forWriting ? TCL_WRITABLE : TCL_READABLE), &data) == TCL_OK) {
+ (forWriting ? TCL_WRITABLE : TCL_READABLE),
+ (ClientData*) &data) == TCL_OK) {
fd = PTR2INT(data);
/*
@@ -2187,24 +3071,180 @@ Tcl_GetOpenFile(
f = fdopen(fd, (forWriting ? "w" : "r"));
if (f == NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "cannot get a FILE * for \"%s\"", chanID));
- Tcl_SetErrorCode(interp, "TCL", "VALUE", "CHANNEL",
- "FILE_FAILURE", (char *)NULL);
+ Tcl_AppendResult(interp, "cannot get a FILE * for \"", chanID,
+ "\"", NULL);
return TCL_ERROR;
}
- *filePtr = f;
+ *filePtr = (ClientData) f;
return TCL_OK;
}
}
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "\"%s\" cannot be used to get a FILE *", chanID));
- Tcl_SetErrorCode(interp, "TCL", "VALUE", "CHANNEL", "NO_DESCRIPTOR",
- (char *)NULL);
+ Tcl_AppendResult(interp, "\"", chanID,
+ "\" cannot be used to get a FILE *", NULL);
return TCL_ERROR;
}
+#ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is
+ * in tclMacOSXNotify.c */
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclUnixWaitForFile --
+ *
+ * This function waits synchronously for a file to become readable or
+ * writable, with an optional timeout.
+ *
+ * Results:
+ * The return value is an OR'ed combination of TCL_READABLE,
+ * TCL_WRITABLE, and TCL_EXCEPTION, indicating the conditions that are
+ * present on file at the time of the return. This function will not
+ * return until either "timeout" milliseconds have elapsed or at least
+ * one of the conditions given by mask has occurred for file (a return
+ * value of 0 means that a timeout occurred). No normal events will be
+ * serviced during the execution of this function.
+ *
+ * Side effects:
+ * Time passes.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclUnixWaitForFile(
+ int fd, /* Handle for file on which to wait. */
+ int mask, /* What to wait for: OR'ed combination of
+ * TCL_READABLE, TCL_WRITABLE, and
+ * TCL_EXCEPTION. */
+ int timeout) /* Maximum amount of time to wait for one of
+ * the conditions in mask to occur, in
+ * milliseconds. A value of 0 means don't wait
+ * at all, and a value of -1 means wait
+ * forever. */
+{
+ Tcl_Time abortTime = {0, 0}, now; /* silence gcc 4 warning */
+ struct timeval blockTime, *timeoutPtr;
+ int numFound, result = 0;
+ fd_set readableMask;
+ fd_set writableMask;
+ fd_set exceptionalMask;
+
+#ifndef _DARWIN_C_SOURCE
+ /*
+ * Sanity check fd.
+ */
+
+ if (fd >= FD_SETSIZE) {
+ Tcl_Panic("TclUnixWaitForFile can't handle file id %d", fd);
+ /* must never get here, or select masks overrun will occur below */
+ }
+#endif
+
+ /*
+ * If there is a non-zero finite timeout, compute the time when we give
+ * up.
+ */
+
+ if (timeout > 0) {
+ Tcl_GetTime(&now);
+ abortTime.sec = now.sec + timeout/1000;
+ abortTime.usec = now.usec + (timeout%1000)*1000;
+ if (abortTime.usec >= 1000000) {
+ abortTime.usec -= 1000000;
+ abortTime.sec += 1;
+ }
+ timeoutPtr = &blockTime;
+ } else if (timeout == 0) {
+ timeoutPtr = &blockTime;
+ blockTime.tv_sec = 0;
+ blockTime.tv_usec = 0;
+ } else {
+ timeoutPtr = NULL;
+ }
+
+ /*
+ * Initialize the select masks.
+ */
+
+ FD_ZERO(&readableMask);
+ FD_ZERO(&writableMask);
+ FD_ZERO(&exceptionalMask);
+
+ /*
+ * Loop in a mini-event loop of our own, waiting for either the file to
+ * become ready or a timeout to occur.
+ */
+
+ while (1) {
+ if (timeout > 0) {
+ blockTime.tv_sec = abortTime.sec - now.sec;
+ blockTime.tv_usec = abortTime.usec - now.usec;
+ if (blockTime.tv_usec < 0) {
+ blockTime.tv_sec -= 1;
+ blockTime.tv_usec += 1000000;
+ }
+ if (blockTime.tv_sec < 0) {
+ blockTime.tv_sec = 0;
+ blockTime.tv_usec = 0;
+ }
+ }
+
+ /*
+ * Setup the select masks for the fd.
+ */
+
+ if (mask & TCL_READABLE) {
+ FD_SET(fd, &readableMask);
+ }
+ if (mask & TCL_WRITABLE) {
+ FD_SET(fd, &writableMask);
+ }
+ if (mask & TCL_EXCEPTION) {
+ FD_SET(fd, &exceptionalMask);
+ }
+
+ /*
+ * Wait for the event or a timeout.
+ */
+
+ numFound = select(fd + 1, &readableMask, &writableMask,
+ &exceptionalMask, timeoutPtr);
+ if (numFound == 1) {
+ if (FD_ISSET(fd, &readableMask)) {
+ SET_BITS(result, TCL_READABLE);
+ }
+ if (FD_ISSET(fd, &writableMask)) {
+ SET_BITS(result, TCL_WRITABLE);
+ }
+ if (FD_ISSET(fd, &exceptionalMask)) {
+ SET_BITS(result, TCL_EXCEPTION);
+ }
+ result &= mask;
+ if (result) {
+ break;
+ }
+ }
+ if (timeout == 0) {
+ break;
+ }
+ if (timeout < 0) {
+ continue;
+ }
+
+ /*
+ * The select returned early, so we need to recompute the timeout.
+ */
+
+ Tcl_GetTime(&now);
+ if ((abortTime.sec < now.sec)
+ || (abortTime.sec==now.sec && abortTime.usec<=now.usec)) {
+ break;
+ }
+ }
+ return result;
+}
+#endif /* HAVE_COREFOUNDATION */
+
/*
*----------------------------------------------------------------------
*
@@ -2226,10 +3266,10 @@ Tcl_GetOpenFile(
static int
FileTruncateProc(
- void *instanceData,
- long long length)
+ ClientData instanceData,
+ Tcl_WideInt length)
{
- FileState *fsPtr = (FileState *)instanceData;
+ FileState *fsPtr = (FileState *) instanceData;
int result;
#ifdef HAVE_TYPE_OFF64_T
@@ -2252,5 +3292,7 @@ FileTruncateProc(
* mode: c
* c-basic-offset: 4
* fill-column: 78
+ * tab-width: 8
+ * indent-tabs-mode: nil
* End:
*/
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
index 2a92031..3d2b7b8 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -36,10 +36,10 @@
* 'length' stay aligned.
*/
-#define PadBuffer(buffer, length, size) \
- if (((length) % (size))) { \
- (buffer) += ((size) - ((length) % (size))); \
- (length) += ((size) - ((length) % (size))); \
+#define PadBuffer(buffer, length, size) \
+ if (((length) % (size))) { \
+ (buffer) += ((size) - ((length) % (size))); \
+ (length) += ((size) - ((length) % (size))); \
}
/*
@@ -47,9 +47,9 @@
* library calls.
*/
-#if TCL_THREADS
+#ifdef TCL_THREADS
-typedef struct {
+typedef struct ThreadSpecificData {
struct passwd pwd;
#if defined(HAVE_GETPWNAM_R_5) || defined(HAVE_GETPWUID_R_5)
#define NEED_PW_CLEANER 1
@@ -118,10 +118,10 @@ static int CopyString(const char *src, char *buf, int buflen);
#endif
#ifdef NEED_PW_CLEANER
-static void FreePwBuf(void *dummy);
+static void FreePwBuf(ClientData ignored);
#endif
#ifdef NEED_GR_CLEANER
-static void FreeGrBuf(void *dummy);
+static void FreeGrBuf(ClientData ignored);
#endif
#endif /* TCL_THREADS */
@@ -182,7 +182,7 @@ struct passwd *
TclpGetPwNam(
const char *name)
{
-#if !TCL_THREADS
+#if !defined(TCL_THREADS)
return getpwnam(name);
#else
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -201,7 +201,7 @@ TclpGetPwNam(
if (tsdPtr->pbuflen < 1) {
tsdPtr->pbuflen = 1024;
}
- tsdPtr->pbuf = (char *)ckalloc(tsdPtr->pbuflen);
+ tsdPtr->pbuf = ckalloc(tsdPtr->pbuflen);
Tcl_CreateThreadExitHandler(FreePwBuf, NULL);
}
while (1) {
@@ -214,7 +214,7 @@ TclpGetPwNam(
return NULL;
}
tsdPtr->pbuflen *= 2;
- tsdPtr->pbuf = (char *)ckrealloc(tsdPtr->pbuf, tsdPtr->pbuflen);
+ tsdPtr->pbuf = ckrealloc(tsdPtr->pbuf, tsdPtr->pbuflen);
}
return (pwPtr != NULL ? &tsdPtr->pwd : NULL);
@@ -262,7 +262,7 @@ struct passwd *
TclpGetPwUid(
uid_t uid)
{
-#if !TCL_THREADS
+#if !defined(TCL_THREADS)
return getpwuid(uid);
#else
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -281,7 +281,7 @@ TclpGetPwUid(
if (tsdPtr->pbuflen < 1) {
tsdPtr->pbuflen = 1024;
}
- tsdPtr->pbuf = (char *)ckalloc(tsdPtr->pbuflen);
+ tsdPtr->pbuf = ckalloc(tsdPtr->pbuflen);
Tcl_CreateThreadExitHandler(FreePwBuf, NULL);
}
while (1) {
@@ -294,7 +294,7 @@ TclpGetPwUid(
return NULL;
}
tsdPtr->pbuflen *= 2;
- tsdPtr->pbuf = (char *)ckrealloc(tsdPtr->pbuf, tsdPtr->pbuflen);
+ tsdPtr->pbuf = ckrealloc(tsdPtr->pbuf, tsdPtr->pbuflen);
}
return (pwPtr != NULL ? &tsdPtr->pwd : NULL);
@@ -336,7 +336,7 @@ TclpGetPwUid(
#ifdef NEED_PW_CLEANER
static void
FreePwBuf(
- TCL_UNUSED(void *))
+ ClientData ignored)
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -365,7 +365,7 @@ struct group *
TclpGetGrNam(
const char *name)
{
-#if !TCL_THREADS
+#if !defined(TCL_THREADS)
return getgrnam(name);
#else
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -384,7 +384,7 @@ TclpGetGrNam(
if (tsdPtr->gbuflen < 1) {
tsdPtr->gbuflen = 1024;
}
- tsdPtr->gbuf = (char *)ckalloc(tsdPtr->gbuflen);
+ tsdPtr->gbuf = ckalloc(tsdPtr->gbuflen);
Tcl_CreateThreadExitHandler(FreeGrBuf, NULL);
}
while (1) {
@@ -397,7 +397,7 @@ TclpGetGrNam(
return NULL;
}
tsdPtr->gbuflen *= 2;
- tsdPtr->gbuf = (char *)ckrealloc(tsdPtr->gbuf, tsdPtr->gbuflen);
+ tsdPtr->gbuf = ckrealloc(tsdPtr->gbuf, tsdPtr->gbuflen);
}
return (grPtr != NULL ? &tsdPtr->grp : NULL);
@@ -445,7 +445,7 @@ struct group *
TclpGetGrGid(
gid_t gid)
{
-#if !TCL_THREADS
+#if !defined(TCL_THREADS)
return getgrgid(gid);
#else
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -464,7 +464,7 @@ TclpGetGrGid(
if (tsdPtr->gbuflen < 1) {
tsdPtr->gbuflen = 1024;
}
- tsdPtr->gbuf = (char *)ckalloc(tsdPtr->gbuflen);
+ tsdPtr->gbuf = ckalloc(tsdPtr->gbuflen);
Tcl_CreateThreadExitHandler(FreeGrBuf, NULL);
}
while (1) {
@@ -477,7 +477,7 @@ TclpGetGrGid(
return NULL;
}
tsdPtr->gbuflen *= 2;
- tsdPtr->gbuf = (char *)ckrealloc(tsdPtr->gbuf, tsdPtr->gbuflen);
+ tsdPtr->gbuf = ckrealloc(tsdPtr->gbuf, tsdPtr->gbuflen);
}
return (grPtr != NULL ? &tsdPtr->grp : NULL);
@@ -519,7 +519,7 @@ TclpGetGrGid(
#ifdef NEED_GR_CLEANER
static void
FreeGrBuf(
- TCL_UNUSED(void *))
+ ClientData ignored)
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -548,23 +548,23 @@ struct hostent *
TclpGetHostByName(
const char *name)
{
-#if !TCL_THREADS || defined(HAVE_MTSAFE_GETHOSTBYNAME)
+#if !defined(TCL_THREADS) || defined(HAVE_MTSAFE_GETHOSTBYNAME)
return gethostbyname(name);
#else
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
#if defined(HAVE_GETHOSTBYNAME_R_5)
- int local_errno;
+ int h_errno;
return gethostbyname_r(name, &tsdPtr->hent, tsdPtr->hbuf,
- sizeof(tsdPtr->hbuf), &local_errno);
+ sizeof(tsdPtr->hbuf), &h_errno);
#elif defined(HAVE_GETHOSTBYNAME_R_6)
struct hostent *hePtr = NULL;
- int local_errno, result;
+ int h_errno, result;
result = gethostbyname_r(name, &tsdPtr->hent, tsdPtr->hbuf,
- sizeof(tsdPtr->hbuf), &hePtr, &local_errno);
+ sizeof(tsdPtr->hbuf), &hePtr, &h_errno);
return (result == 0) ? hePtr : NULL;
#elif defined(HAVE_GETHOSTBYNAME_R_3)
@@ -618,23 +618,23 @@ TclpGetHostByAddr(
int length,
int type)
{
-#if !TCL_THREADS || defined(HAVE_MTSAFE_GETHOSTBYADDR)
+#if !defined(TCL_THREADS) || defined(HAVE_MTSAFE_GETHOSTBYADDR)
return gethostbyaddr(addr, length, type);
#else
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
#if defined(HAVE_GETHOSTBYADDR_R_7)
- int local_errno;
+ int h_errno;
return gethostbyaddr_r(addr, length, type, &tsdPtr->hent, tsdPtr->hbuf,
- sizeof(tsdPtr->hbuf), &local_errno);
+ sizeof(tsdPtr->hbuf), &h_errno);
#elif defined(HAVE_GETHOSTBYADDR_R_8)
struct hostent *hePtr;
- int local_errno;
+ int h_errno;
return (gethostbyaddr_r(addr, length, type, &tsdPtr->hent, tsdPtr->hbuf,
- sizeof(tsdPtr->hbuf), &hePtr, &local_errno) == 0)
+ sizeof(tsdPtr->hbuf), &hePtr, &h_errno) == 0)
? &tsdPtr->hent : NULL;
#else
#define NEED_COPYHOSTENT 1
@@ -685,8 +685,8 @@ CopyGrp(
char *buf,
int buflen)
{
- char *p = buf;
- int copied, len = 0;
+ register char *p = buf;
+ register int copied, len = 0;
/*
* Copy username.
@@ -736,7 +736,7 @@ CopyGrp(
*
* CopyHostent --
*
- * Copies string fields of the hostent structure to the private buffer,
+ * Copies string fields of the hostnent structure to the private buffer,
* honouring the size of the buffer.
*
* Results:
@@ -887,7 +887,7 @@ CopyArray(
int buflen) /* Size of buffer. */
{
int i, j, len = 0;
- char *p, **newBuffer;
+ char *p, **new;
if (src == NULL) {
return 0;
@@ -903,7 +903,7 @@ CopyArray(
return -1;
}
- newBuffer = (char **)buf;
+ new = (char **) buf;
p = buf + len;
for (j = 0; j < i; j++) {
@@ -914,10 +914,10 @@ CopyArray(
return -1;
}
memcpy(p, src[j], sz);
- newBuffer[j] = p;
+ new[j] = p;
p = buf + len;
}
- newBuffer[j] = NULL;
+ new[j] = NULL;
return len;
}
@@ -962,14 +962,6 @@ CopyString(
#endif /* NEED_COPYSTRING */
/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 4
- * fill-column: 78
- * End:
- */
-
-/*
*------------------------------------------------------------------------
*
* TclWinCPUID --
@@ -988,33 +980,31 @@ CopyString(
int
TclWinCPUID(
- int index, /* Which CPUID value to retrieve. */
- int *regsPtr) /* Registers after the CPUID. */
+ unsigned int index, /* Which CPUID value to retrieve. */
+ unsigned int *regsPtr) /* Registers after the CPUID. */
{
int status = TCL_ERROR;
/* See: <http://en.wikipedia.org/wiki/CPUID> */
+#if defined(HAVE_CPUID)
#if defined(__x86_64__) || defined(_M_AMD64) || defined (_M_X64)
__asm__ __volatile__("movq %%rbx, %%rsi \n\t" /* save %rbx */
"cpuid \n\t"
"xchgq %%rsi, %%rbx \n\t" /* restore the old %rbx */
: "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3])
: "a"(index));
- status = TCL_OK;
-#elif defined(__i386__) || defined(_M_IX86)
+#else
__asm__ __volatile__("mov %%ebx, %%esi \n\t" /* save %ebx */
"cpuid \n\t"
"xchg %%esi, %%ebx \n\t" /* restore the old %ebx */
: "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3])
: "a"(index));
+#endif
status = TCL_OK;
-#else
- (void)index;
- (void)regsPtr;
#endif
return status;
}
-
+
/*
* Local Variables:
* mode: c
diff --git a/unix/tclUnixEvent.c b/unix/tclUnixEvent.c
index 0047dd9..e4d922d 100644
--- a/unix/tclUnixEvent.c
+++ b/unix/tclUnixEvent.c
@@ -3,7 +3,7 @@
*
* This file implements Unix specific event related routines.
*
- * Copyright © 1997 Sun Microsystems, Inc.
+ * Copyright (c) 1997 by Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -64,7 +64,7 @@ Tcl_Sleep(
}
if ((vdelay.sec != 0) || (vdelay.usec != 0)) {
- TclScaleTime(&vdelay);
+ (*tclScaleTimeProcPtr) (&vdelay, tclTimeClientData);
}
delay.tv_sec = vdelay.sec;
@@ -85,8 +85,6 @@ Tcl_Sleep(
}
}
-#else
-TCL_MAC_EMPTY_FILE(unix_tclUnixEvent_c)
#endif /* HAVE_COREFOUNDATION */
/*
* Local Variables:
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index cc8af05..b5450b1 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -1,11 +1,11 @@
/*
* tclUnixFCmd.c
*
- * This file implements the Unix specific portion of file manipulation
+ * This file implements the unix specific portion of file manipulation
* subcommands of the "file" command. All filename arguments should
* already be translated to native format.
*
- * Copyright © 1996-1998 Sun Microsystems, Inc.
+ * Copyright (c) 1996-1998 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -13,7 +13,7 @@
* Portions of this code were derived from NetBSD source code which has the
* following copyright notice:
*
- * Copyright © 1988, 1993, 1994
+ * Copyright (c) 1988, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,7 @@
#ifndef NO_FSTATFS
#include <sys/statfs.h>
#endif
-#endif /* !HAVE_STRUCT_STAT_ST_BLKSIZE */
+#endif
#ifdef HAVE_FTS
#include <fts.h>
#endif
@@ -62,16 +62,6 @@
#define DOTREE_F 3 /* regular file */
/*
- * Fallback temporary file location the temporary file generation code. Can be
- * overridden at compile time for when it is known that temp files can't be
- * written to /tmp (hello, iOS!).
- */
-
-#ifndef TCL_TEMPORARY_FILE_DIRECTORY
-#define TCL_TEMPORARY_FILE_DIRECTORY "/tmp"
-#endif
-
-/*
* Callbacks for file attributes code.
*/
@@ -90,11 +80,11 @@ static int SetPermissionsAttribute(Tcl_Interp *interp,
int objIndex, Tcl_Obj *fileName,
Tcl_Obj *attributePtr);
static int GetModeFromPermString(Tcl_Interp *interp,
- const char *modeStringPtr, mode_t *modePtr);
-#if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE) || defined(__CYGWIN__)
-static int GetUnixFileAttributes(Tcl_Interp *interp, int objIndex,
+ char *modeStringPtr, mode_t *modePtr);
+#if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE)
+static int GetReadOnlyAttribute(Tcl_Interp *interp, int objIndex,
Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr);
-static int SetUnixFileAttributes(Tcl_Interp *interp, int objIndex,
+static int SetReadOnlyAttribute(Tcl_Interp *interp, int objIndex,
Tcl_Obj *fileName, Tcl_Obj *attributePtr);
#endif
@@ -103,7 +93,7 @@ static int SetUnixFileAttributes(Tcl_Interp *interp, int objIndex,
*/
typedef int (TraversalProc)(Tcl_DString *srcPtr, Tcl_DString *dstPtr,
- const Tcl_StatBuf *statBufPtr, int type, Tcl_DString *errorPtr);
+ CONST Tcl_StatBuf *statBufPtr, int type, Tcl_DString *errorPtr);
/*
* Constants and variables necessary for file attributes subcommand.
@@ -113,66 +103,47 @@ typedef int (TraversalProc)(Tcl_DString *srcPtr, Tcl_DString *dstPtr,
* elsewhere in Tcl's core.
*/
-#ifndef DJGPP
+#ifdef DJGPP
+/*
+ * See contrib/djgpp/tclDjgppFCmd.c for definition.
+ */
+
+extern TclFileAttrProcs tclpFileAttrProcs[];
+extern char *tclpFileAttrStrings[];
+
+#else
enum {
-#if defined(__CYGWIN__)
- UNIX_ARCHIVE_ATTRIBUTE,
-#endif
- UNIX_GROUP_ATTRIBUTE,
-#if defined(__CYGWIN__)
- UNIX_HIDDEN_ATTRIBUTE,
-#endif
- UNIX_OWNER_ATTRIBUTE, UNIX_PERMISSIONS_ATTRIBUTE,
-#if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE) || defined(__CYGWIN__)
+ UNIX_GROUP_ATTRIBUTE, UNIX_OWNER_ATTRIBUTE, UNIX_PERMISSIONS_ATTRIBUTE,
+#if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE)
UNIX_READONLY_ATTRIBUTE,
#endif
-#if defined(__CYGWIN__)
- UNIX_SYSTEM_ATTRIBUTE,
-#endif
#ifdef MAC_OSX_TCL
MACOSX_CREATOR_ATTRIBUTE, MACOSX_TYPE_ATTRIBUTE, MACOSX_HIDDEN_ATTRIBUTE,
MACOSX_RSRCLENGTH_ATTRIBUTE,
#endif
- UNIX_INVALID_ATTRIBUTE
+ UNIX_INVALID_ATTRIBUTE /* lint - last enum value needs no trailing , */
};
-const char *const tclpFileAttrStrings[] = {
-#if defined(__CYGWIN__)
- "-archive",
-#endif
- "-group",
-#if defined(__CYGWIN__)
- "-hidden",
-#endif
- "-owner", "-permissions",
-#if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE) || defined(__CYGWIN__)
+MODULE_SCOPE CONST char *tclpFileAttrStrings[];
+CONST char *tclpFileAttrStrings[] = {
+ "-group", "-owner", "-permissions",
+#if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE)
"-readonly",
#endif
-#if defined(__CYGWIN__)
- "-system",
-#endif
#ifdef MAC_OSX_TCL
"-creator", "-type", "-hidden", "-rsrclength",
#endif
NULL
};
-const TclFileAttrProcs tclpFileAttrProcs[] = {
-#if defined(__CYGWIN__)
- {GetUnixFileAttributes, SetUnixFileAttributes},
-#endif
+MODULE_SCOPE CONST TclFileAttrProcs tclpFileAttrProcs[];
+CONST TclFileAttrProcs tclpFileAttrProcs[] = {
{GetGroupAttribute, SetGroupAttribute},
-#if defined(__CYGWIN__)
- {GetUnixFileAttributes, SetUnixFileAttributes},
-#endif
{GetOwnerAttribute, SetOwnerAttribute},
{GetPermissionsAttribute, SetPermissionsAttribute},
-#if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE) || defined(__CYGWIN__)
- {GetUnixFileAttributes, SetUnixFileAttributes},
-#endif
-#if defined(__CYGWIN__)
- {GetUnixFileAttributes, SetUnixFileAttributes},
+#if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE)
+ {GetReadOnlyAttribute, SetReadOnlyAttribute},
#endif
#ifdef MAC_OSX_TCL
{TclMacOSXGetFileAttribute, TclMacOSXSetFileAttribute},
@@ -181,7 +152,7 @@ const TclFileAttrProcs tclpFileAttrProcs[] = {
{TclMacOSXGetFileAttribute, TclMacOSXSetFileAttribute},
#endif
};
-#endif /* DJGPP */
+#endif
/*
* This is the maximum number of consecutive readdir/unlink calls that can be
@@ -202,23 +173,20 @@ const TclFileAttrProcs tclpFileAttrProcs[] = {
* Declarations for local procedures defined in this file:
*/
-static int CopyFileAtts(const char *src,
- const char *dst, const Tcl_StatBuf *statBufPtr);
-static const char * DefaultTempDir(void);
-static int DoCopyFile(const char *srcPtr, const char *dstPtr,
- const Tcl_StatBuf *statBufPtr);
-static int DoCreateDirectory(const char *pathPtr);
+static int CopyFileAtts(CONST char *src,
+ CONST char *dst, CONST Tcl_StatBuf *statBufPtr);
+static int DoCopyFile(CONST char *srcPtr, CONST char *dstPtr,
+ CONST Tcl_StatBuf *statBufPtr);
+static int DoCreateDirectory(CONST char *pathPtr);
static int DoRemoveDirectory(Tcl_DString *pathPtr,
int recursive, Tcl_DString *errorPtr);
-static int DoRenameFile(const char *src, const char *dst);
+static int DoRenameFile(CONST char *src, CONST char *dst);
static int TraversalCopy(Tcl_DString *srcPtr,
- Tcl_DString *dstPtr,
- const Tcl_StatBuf *statBufPtr, int type,
- Tcl_DString *errorPtr);
+ Tcl_DString *dstPtr, CONST Tcl_StatBuf *statBufPtr,
+ int type, Tcl_DString *errorPtr);
static int TraversalDelete(Tcl_DString *srcPtr,
- Tcl_DString *dstPtr,
- const Tcl_StatBuf *statBufPtr, int type,
- Tcl_DString *errorPtr);
+ Tcl_DString *dstPtr, CONST Tcl_StatBuf *statBufPtr,
+ int type, Tcl_DString *errorPtr);
static int TraverseUnixTree(TraversalProc *traversalProc,
Tcl_DString *sourcePtr, Tcl_DString *destPtr,
Tcl_DString *errorPtr, int doRewind);
@@ -231,22 +199,22 @@ static int TraverseUnixTree(TraversalProc *traversalProc,
* passing the standard MAXPATHLEN size resolved arg.
*/
-static char * Realpath(const char *path, char *resolved);
+static char * Realpath(CONST char *path, char *resolved);
char *
Realpath(
- const char *path,
+ CONST char *path,
char *resolved)
{
memset(resolved, 0, MAXPATHLEN);
return realpath(path, resolved);
}
#else
-# define Realpath realpath
-#endif /* PURIFY */
+#define Realpath realpath
+#endif
#ifndef NO_REALPATH
-#if defined(__APPLE__) && TCL_THREADS && \
+#if defined(__APPLE__) && defined(TCL_THREADS) && \
defined(MAC_OS_X_VERSION_MIN_REQUIRED) && \
MAC_OS_X_VERSION_MIN_REQUIRED < 1030
/*
@@ -256,16 +224,16 @@ Realpath(
*/
MODULE_SCOPE long tclMacOSXDarwinRelease;
-# define haveRealpath (tclMacOSXDarwinRelease >= 7)
+#define haveRealpath (tclMacOSXDarwinRelease >= 7)
#else
-# define haveRealpath 1
+#define haveRealpath 1
#endif
#endif /* NO_REALPATH */
#ifdef HAVE_FTS
#if defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
/* fts doesn't do stat64 */
-# define noFtsStat 1
+#define noFtsStat 1
#elif defined(__APPLE__) && defined(__LP64__) && \
defined(MAC_OS_X_VERSION_MIN_REQUIRED) && \
MAC_OS_X_VERSION_MIN_REQUIRED < 1050
@@ -276,9 +244,9 @@ MODULE_SCOPE long tclMacOSXDarwinRelease;
*/
MODULE_SCOPE long tclMacOSXDarwinRelease;
-# define noFtsStat (tclMacOSXDarwinRelease < 9)
+#define noFtsStat (tclMacOSXDarwinRelease < 9)
#else
-# define noFtsStat 0
+#define noFtsStat 0
#endif
#endif /* HAVE_FTS */
@@ -321,15 +289,15 @@ TclpObjRenameFile(
Tcl_Obj *srcPathPtr,
Tcl_Obj *destPathPtr)
{
- return DoRenameFile((const char *)Tcl_FSGetNativePath(srcPathPtr),
- (const char *)Tcl_FSGetNativePath(destPathPtr));
+ return DoRenameFile(Tcl_FSGetNativePath(srcPathPtr),
+ Tcl_FSGetNativePath(destPathPtr));
}
static int
DoRenameFile(
- const char *src, /* Pathname of file or dir to be renamed
+ CONST char *src, /* Pathname of file or dir to be renamed
* (native). */
- const char *dst) /* New pathname of file or directory
+ CONST char *dst) /* New pathname of file or directory
* (native). */
{
if (rename(src, dst) == 0) { /* INTL: Native. */
@@ -340,7 +308,7 @@ DoRenameFile(
}
/*
- * IRIX returns EIO when you attempt to move a directory into itself. We
+ * IRIX returns EIO when you attept to move a directory into itself. We
* just map EIO to EINVAL get the right message on SGI. Most platforms
* don't return EIO except in really strange cases.
*/
@@ -359,13 +327,13 @@ DoRenameFile(
if (errno == EINVAL && haveRealpath) {
char srcPath[MAXPATHLEN], dstPath[MAXPATHLEN];
- TclDIR *dirPtr;
+ DIR *dirPtr;
Tcl_DirEntry *dirEntPtr;
if ((Realpath((char *) src, srcPath) != NULL) /* INTL: Native. */
&& (Realpath((char *) dst, dstPath) != NULL) /* INTL: Native */
&& (strncmp(srcPath, dstPath, strlen(srcPath)) != 0)) {
- dirPtr = TclOSopendir(dst); /* INTL: Native. */
+ dirPtr = opendir(dst); /* INTL: Native. */
if (dirPtr != NULL) {
while (1) {
dirEntPtr = TclOSreaddir(dirPtr); /* INTL: Native. */
@@ -375,11 +343,11 @@ DoRenameFile(
if ((strcmp(dirEntPtr->d_name, ".") != 0) &&
(strcmp(dirEntPtr->d_name, "..") != 0)) {
errno = EEXIST;
- TclOSclosedir(dirPtr);
+ closedir(dirPtr);
return TCL_ERROR;
}
}
- TclOSclosedir(dirPtr);
+ closedir(dirPtr);
}
}
errno = EINVAL;
@@ -437,21 +405,21 @@ TclpObjCopyFile(
Tcl_Obj *srcPathPtr,
Tcl_Obj *destPathPtr)
{
- const char *src = (const char *)Tcl_FSGetNativePath(srcPathPtr);
+ CONST char *src = Tcl_FSGetNativePath(srcPathPtr);
Tcl_StatBuf srcStatBuf;
if (TclOSlstat(src, &srcStatBuf) != 0) { /* INTL: Native. */
return TCL_ERROR;
}
- return DoCopyFile(src, (const char *)Tcl_FSGetNativePath(destPathPtr), &srcStatBuf);
+ return DoCopyFile(src, Tcl_FSGetNativePath(destPathPtr), &srcStatBuf);
}
static int
DoCopyFile(
- const char *src, /* Pathname of file to be copied (native). */
- const char *dst, /* Pathname of file to copy to (native). */
- const Tcl_StatBuf *statBufPtr)
+ CONST char *src, /* Pathname of file to be copied (native). */
+ CONST char *dst, /* Pathname of file to copy to (native). */
+ CONST Tcl_StatBuf *statBufPtr)
/* Used to determine filetype. */
{
Tcl_StatBuf dstStatBuf;
@@ -481,15 +449,15 @@ DoCopyFile(
switch ((int) (statBufPtr->st_mode & S_IFMT)) {
#ifndef DJGPP
case S_IFLNK: {
- char linkBuf[MAXPATHLEN+1];
+ char link[MAXPATHLEN];
int length;
- length = readlink(src, linkBuf, MAXPATHLEN); /* INTL: Native. */
+ length = readlink(src, link, sizeof(link)); /* INTL: Native. */
if (length == -1) {
return TCL_ERROR;
}
- linkBuf[length] = '\0';
- if (symlink(linkBuf, dst) < 0) { /* INTL: Native. */
+ link[length] = '\0';
+ if (symlink(link, dst) < 0) { /* INTL: Native. */
return TCL_ERROR;
}
#ifdef MAC_OSX_TCL
@@ -497,7 +465,7 @@ DoCopyFile(
#endif
break;
}
-#endif /* !DJGPP */
+#endif
case S_IFBLK:
case S_IFCHR:
if (mknod(dst, statBufPtr->st_mode, /* INTL: Native. */
@@ -535,10 +503,10 @@ DoCopyFile(
int
TclUnixCopyFile(
- const char *src, /* Pathname of file to copy (native). */
- const char *dst, /* Pathname of file to create/overwrite
+ CONST char *src, /* Pathname of file to copy (native). */
+ CONST char *dst, /* Pathname of file to create/overwrite
* (native). */
- const Tcl_StatBuf *statBufPtr,
+ CONST Tcl_StatBuf *statBufPtr,
/* Used to determine mode and blocksize. */
int dontCopyAtts) /* If flag set, don't copy attributes. */
{
@@ -551,9 +519,7 @@ TclUnixCopyFile(
#define BINMODE |O_BINARY
#else
#define BINMODE
-#endif /* DJGPP */
-
-#define DEFAULT_COPY_BLOCK_SIZE 4096
+#endif
if ((srcFd = TclOSopen(src, O_RDONLY BINMODE, 0)) < 0) { /* INTL: Native */
return TCL_ERROR;
@@ -581,11 +547,11 @@ TclUnixCopyFile(
if (fstatfs(srcFd, &fs) == 0) {
blockSize = fs.f_bsize;
} else {
- blockSize = DEFAULT_COPY_BLOCK_SIZE;
+ blockSize = 4096;
}
}
#else
- blockSize = DEFAULT_COPY_BLOCK_SIZE;
+ blockSize = 4096;
#endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */
/*
@@ -597,9 +563,9 @@ TclUnixCopyFile(
*/
if (blockSize <= 0) {
- blockSize = DEFAULT_COPY_BLOCK_SIZE;
+ blockSize = 4096;
}
- buffer = (char *)ckalloc(blockSize);
+ buffer = ckalloc(blockSize);
while (1) {
nread = (size_t) read(srcFd, buffer, blockSize);
if ((nread == (size_t) -1) || (nread == 0)) {
@@ -660,9 +626,9 @@ TclpObjDeleteFile(
int
TclpDeleteFile(
- const void *path) /* Pathname of file to be removed (native). */
+ CONST char *path) /* Pathname of file to be removed (native). */
{
- if (unlink((const char *)path) != 0) {
+ if (unlink(path) != 0) { /* INTL: Native. */
return TCL_ERROR;
}
return TCL_OK;
@@ -698,12 +664,12 @@ int
TclpObjCreateDirectory(
Tcl_Obj *pathPtr)
{
- return DoCreateDirectory((const char *)Tcl_FSGetNativePath(pathPtr));
+ return DoCreateDirectory(Tcl_FSGetNativePath(pathPtr));
}
static int
DoCreateDirectory(
- const char *path) /* Pathname of directory to create (native). */
+ CONST char *path) /* Pathname of directory to create (native). */
{
mode_t mode;
@@ -729,7 +695,7 @@ DoCreateDirectory(
*
* Recursively copies a directory. The target directory dst must not
* already exist. Note that this function does not merge two directory
- * hierarchies, even if the target directory is an empty directory.
+ * hierarchies, even if the target directory is an an empty directory.
*
* Results:
* If the directory was successfully copied, returns TCL_OK. Otherwise
@@ -778,7 +744,7 @@ TclpObjCopyDirectory(
Tcl_DStringFree(&dstString);
if (ret != TCL_OK) {
- *errorPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), TCL_INDEX_NONE);
+ *errorPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), -1);
Tcl_DStringFree(&ds);
Tcl_IncrRefCount(*errorPtr);
}
@@ -832,7 +798,7 @@ TclpObjRemoveDirectory(
Tcl_DStringFree(&pathString);
if (ret != TCL_OK) {
- *errorPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), TCL_INDEX_NONE);
+ *errorPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), -1);
Tcl_DStringFree(&ds);
Tcl_IncrRefCount(*errorPtr);
}
@@ -850,7 +816,7 @@ DoRemoveDirectory(
* filled with UTF-8 name of file causing
* error. */
{
- const char *path;
+ CONST char *path;
mode_t oldPerm = 0;
int result;
@@ -882,7 +848,7 @@ DoRemoveDirectory(
result = TCL_OK;
if ((errno != EEXIST) || (recursive == 0)) {
if (errorPtr != NULL) {
- Tcl_ExternalToUtfDString(NULL, path, TCL_INDEX_NONE, errorPtr);
+ Tcl_ExternalToUtfDString(NULL, path, -1, errorPtr);
}
result = TCL_ERROR;
}
@@ -948,22 +914,22 @@ TraverseUnixTree(
* files. */
{
Tcl_StatBuf statBuf;
- const char *source, *errfile;
+ CONST char *source, *errfile;
int result, sourceLen;
int targetLen;
#ifndef HAVE_FTS
int numProcessed = 0;
Tcl_DirEntry *dirEntPtr;
- TclDIR *dirPtr;
+ DIR *dirPtr;
#else
- const char *paths[2] = {NULL, NULL};
+ CONST char *paths[2] = {NULL, NULL};
FTS *fts = NULL;
FTSENT *ent;
#endif
errfile = NULL;
result = TCL_OK;
- targetLen = 0;
+ targetLen = 0; /* lint. */
source = Tcl_DStringValue(sourcePtr);
if (TclOSlstat(source, &statBuf) != 0) { /* INTL: Native. */
@@ -975,11 +941,11 @@ TraverseUnixTree(
* Process the regular file
*/
- return traverseProc(sourcePtr, targetPtr, &statBuf, DOTREE_F,
+ return (*traverseProc)(sourcePtr, targetPtr, &statBuf, DOTREE_F,
errorPtr);
}
#ifndef HAVE_FTS
- dirPtr = TclOSopendir(source); /* INTL: Native. */
+ dirPtr = opendir(source); /* INTL: Native. */
if (dirPtr == NULL) {
/*
* Can't read directory
@@ -988,18 +954,18 @@ TraverseUnixTree(
errfile = source;
goto end;
}
- result = traverseProc(sourcePtr, targetPtr, &statBuf, DOTREE_PRED,
+ result = (*traverseProc)(sourcePtr, targetPtr, &statBuf, DOTREE_PRED,
errorPtr);
if (result != TCL_OK) {
- TclOSclosedir(dirPtr);
+ closedir(dirPtr);
return result;
}
- TclDStringAppendLiteral(sourcePtr, "/");
+ Tcl_DStringAppend(sourcePtr, "/", 1);
sourceLen = Tcl_DStringLength(sourcePtr);
if (targetPtr != NULL) {
- TclDStringAppendLiteral(targetPtr, "/");
+ Tcl_DStringAppend(targetPtr, "/", 1);
targetLen = Tcl_DStringLength(targetPtr);
}
@@ -1014,9 +980,9 @@ TraverseUnixTree(
* Append name after slash, and recurse on the file.
*/
- Tcl_DStringAppend(sourcePtr, dirEntPtr->d_name, TCL_INDEX_NONE);
+ Tcl_DStringAppend(sourcePtr, dirEntPtr->d_name, -1);
if (targetPtr != NULL) {
- Tcl_DStringAppend(targetPtr, dirEntPtr->d_name, TCL_INDEX_NONE);
+ Tcl_DStringAppend(targetPtr, dirEntPtr->d_name, -1);
}
result = TraverseUnixTree(traverseProc, sourcePtr, targetPtr,
errorPtr, doRewind);
@@ -1041,11 +1007,11 @@ TraverseUnixTree(
* NULL-return that may a symptom of a buggy readdir.
*/
- TclOSrewinddir(dirPtr);
+ rewinddir(dirPtr);
numProcessed = 0;
}
}
- TclOSclosedir(dirPtr);
+ closedir(dirPtr);
/*
* Strip off the trailing slash we added
@@ -1062,12 +1028,12 @@ TraverseUnixTree(
* that directory.
*/
- result = traverseProc(sourcePtr, targetPtr, &statBuf, DOTREE_POSTD,
+ result = (*traverseProc)(sourcePtr, targetPtr, &statBuf, DOTREE_POSTD,
errorPtr);
}
#else /* HAVE_FTS */
paths[0] = source;
- fts = fts_open((char **) paths, FTS_PHYSICAL | FTS_NOCHDIR |
+ fts = fts_open((char**)paths, FTS_PHYSICAL | FTS_NOCHDIR |
(noFtsStat || doRewind ? FTS_NOSTAT : 0), NULL);
if (fts == NULL) {
errfile = source;
@@ -1085,7 +1051,7 @@ TraverseUnixTree(
unsigned short pathlen = ent->fts_pathlen - sourceLen;
int type;
Tcl_StatBuf *statBufPtr = NULL;
-
+
if (info == FTS_DNR || info == FTS_ERR || info == FTS_NS) {
errfile = ent->fts_path;
break;
@@ -1116,7 +1082,7 @@ TraverseUnixTree(
statBufPtr = (Tcl_StatBuf *) ent->fts_statp;
}
}
- result = traverseProc(sourcePtr, targetPtr, statBufPtr, type,
+ result = (*traverseProc)(sourcePtr, targetPtr, statBufPtr, type,
errorPtr);
if (result != TCL_OK) {
break;
@@ -1126,12 +1092,12 @@ TraverseUnixTree(
Tcl_DStringSetLength(targetPtr, targetLen);
}
}
-#endif /* !HAVE_FTS */
+#endif /* HAVE_FTS */
end:
if (errfile != NULL) {
if (errorPtr != NULL) {
- Tcl_ExternalToUtfDString(NULL, errfile, TCL_INDEX_NONE, errorPtr);
+ Tcl_ExternalToUtfDString(NULL, errfile, -1, errorPtr);
}
result = TCL_ERROR;
}
@@ -1166,7 +1132,7 @@ static int
TraversalCopy(
Tcl_DString *srcPtr, /* Source pathname to copy (native). */
Tcl_DString *dstPtr, /* Destination pathname of copy (native). */
- const Tcl_StatBuf *statBufPtr,
+ CONST Tcl_StatBuf *statBufPtr,
/* Stat info for file specified by srcPtr. */
int type, /* Reason for call - see TraverseUnixTree(). */
Tcl_DString *errorPtr) /* If non-NULL, uninitialized or free DString
@@ -1229,14 +1195,14 @@ TraversalCopy(
static int
TraversalDelete(
Tcl_DString *srcPtr, /* Source pathname (native). */
- TCL_UNUSED(Tcl_DString *),
- TCL_UNUSED(const Tcl_StatBuf *),
+ Tcl_DString *ignore, /* Destination pathname (not used). */
+ CONST Tcl_StatBuf *statBufPtr,
+ /* Stat info for file specified by srcPtr. */
int type, /* Reason for call - see TraverseUnixTree(). */
Tcl_DString *errorPtr) /* If non-NULL, uninitialized or free DString
* filled with UTF-8 name of file causing
* error. */
{
-
switch (type) {
case DOTREE_F:
if (TclpDeleteFile(Tcl_DStringValue(srcPtr)) == 0) {
@@ -1278,13 +1244,9 @@ TraversalDelete(
static int
CopyFileAtts(
-#ifdef MAC_OSX_TCL
- const char *src, /* Path name of source file (native). */
-#else
- TCL_UNUSED(const char *) /*src*/,
-#endif
- const char *dst, /* Path name of target file (native). */
- const Tcl_StatBuf *statBufPtr)
+ CONST char *src, /* Path name of source file (native). */
+ CONST char *dst, /* Path name of target file (native). */
+ CONST Tcl_StatBuf *statBufPtr)
/* Stat info for source file */
{
struct utimbuf tval;
@@ -1308,8 +1270,8 @@ CopyFileAtts(
}
}
- tval.actime = Tcl_GetAccessTimeFromStat(statBufPtr);
- tval.modtime = Tcl_GetModificationTimeFromStat(statBufPtr);
+ tval.actime = statBufPtr->st_atime;
+ tval.modtime = statBufPtr->st_mtime;
if (utime(dst, &tval)) { /* INTL: Native. */
return TCL_ERROR;
@@ -1340,7 +1302,7 @@ CopyFileAtts(
static int
GetGroupAttribute(
Tcl_Interp *interp, /* The interp we are using for errors. */
- TCL_UNUSED(int) /*objIndex*/,
+ int objIndex, /* The index of the attribute. */
Tcl_Obj *fileName, /* The name of the file (UTF-8). */
Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */
{
@@ -1352,9 +1314,9 @@ GetGroupAttribute(
if (result != 0) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "could not read \"%s\": %s",
- TclGetString(fileName), Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, "could not read \"",
+ TclGetString(fileName), "\": ",
+ Tcl_PosixError(interp), NULL);
}
return TCL_ERROR;
}
@@ -1362,13 +1324,13 @@ GetGroupAttribute(
groupPtr = TclpGetGrGid(statBuf.st_gid);
if (groupPtr == NULL) {
- TclNewIntObj(*attributePtrPtr, statBuf.st_gid);
+ *attributePtrPtr = Tcl_NewIntObj((int) statBuf.st_gid);
} else {
Tcl_DString ds;
- const char *utf;
+ CONST char *utf;
- utf = Tcl_ExternalToUtfDString(NULL, groupPtr->gr_name, TCL_INDEX_NONE, &ds);
- *attributePtrPtr = Tcl_NewStringObj(utf, TCL_INDEX_NONE);
+ utf = Tcl_ExternalToUtfDString(NULL, groupPtr->gr_name, -1, &ds);
+ *attributePtrPtr = Tcl_NewStringObj(utf, -1);
Tcl_DStringFree(&ds);
}
return TCL_OK;
@@ -1394,7 +1356,7 @@ GetGroupAttribute(
static int
GetOwnerAttribute(
Tcl_Interp *interp, /* The interp we are using for errors. */
- TCL_UNUSED(int) /*objIndex*/,
+ int objIndex, /* The index of the attribute. */
Tcl_Obj *fileName, /* The name of the file (UTF-8). */
Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */
{
@@ -1406,9 +1368,9 @@ GetOwnerAttribute(
if (result != 0) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "could not read \"%s\": %s",
- TclGetString(fileName), Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, "could not read \"",
+ TclGetString(fileName), "\": ",
+ Tcl_PosixError(interp), NULL);
}
return TCL_ERROR;
}
@@ -1416,12 +1378,14 @@ GetOwnerAttribute(
pwPtr = TclpGetPwUid(statBuf.st_uid);
if (pwPtr == NULL) {
- TclNewIntObj(*attributePtrPtr, statBuf.st_uid);
+ *attributePtrPtr = Tcl_NewIntObj((int) statBuf.st_uid);
} else {
Tcl_DString ds;
+ CONST char *utf;
- (void) Tcl_ExternalToUtfDString(NULL, pwPtr->pw_name, TCL_INDEX_NONE, &ds);
- *attributePtrPtr = Tcl_DStringToObj(&ds);
+ utf = Tcl_ExternalToUtfDString(NULL, pwPtr->pw_name, -1, &ds);
+ *attributePtrPtr = Tcl_NewStringObj(utf, Tcl_DStringLength(&ds));
+ Tcl_DStringFree(&ds);
}
return TCL_OK;
}
@@ -1446,7 +1410,7 @@ GetOwnerAttribute(
static int
GetPermissionsAttribute(
Tcl_Interp *interp, /* The interp we are using for errors. */
- TCL_UNUSED(int) /*objIndex*/,
+ int objIndex, /* The index of the attribute. */
Tcl_Obj *fileName, /* The name of the file (UTF-8). */
Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */
{
@@ -1457,15 +1421,15 @@ GetPermissionsAttribute(
if (result != 0) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "could not read \"%s\": %s",
- TclGetString(fileName), Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, "could not read \"",
+ TclGetString(fileName), "\": ",
+ Tcl_PosixError(interp), NULL);
}
return TCL_ERROR;
}
*attributePtrPtr = Tcl_ObjPrintf(
- "%0#5o", ((int)statBuf.st_mode & 0x7FFF));
+ "%0#5lo", (long) (statBuf.st_mode & 0x00007FFF));
return TCL_OK;
}
@@ -1488,47 +1452,45 @@ GetPermissionsAttribute(
static int
SetGroupAttribute(
Tcl_Interp *interp, /* The interp for error reporting. */
- TCL_UNUSED(int) /*objIndex*/,
+ int objIndex, /* The index of the attribute. */
Tcl_Obj *fileName, /* The name of the file (UTF-8). */
Tcl_Obj *attributePtr) /* New group for file. */
{
- Tcl_WideInt gid;
+ long gid;
int result;
- const char *native;
+ CONST char *native;
- if (Tcl_GetWideIntFromObj(NULL, attributePtr, &gid) != TCL_OK) {
+ if (Tcl_GetLongFromObj(NULL, attributePtr, &gid) != TCL_OK) {
Tcl_DString ds;
struct group *groupPtr = NULL;
- const char *string;
+ CONST char *string;
+ int length;
- string = TclGetString(attributePtr);
+ string = Tcl_GetStringFromObj(attributePtr, &length);
- native = Tcl_UtfToExternalDString(NULL, string, attributePtr->length, &ds);
+ native = Tcl_UtfToExternalDString(NULL, string, length, &ds);
groupPtr = TclpGetGrNam(native); /* INTL: Native. */
Tcl_DStringFree(&ds);
if (groupPtr == NULL) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "could not set group for file \"%s\":"
- " group \"%s\" does not exist",
- TclGetString(fileName), string));
- Tcl_SetErrorCode(interp, "TCL", "OPERATION", "SETGRP",
- "NO_GROUP", (char *)NULL);
+ Tcl_AppendResult(interp, "could not set group for file \"",
+ TclGetString(fileName), "\": group \"", string,
+ "\" does not exist", NULL);
}
return TCL_ERROR;
}
gid = groupPtr->gr_gid;
}
- native = (const char *)Tcl_FSGetNativePath(fileName);
+ native = Tcl_FSGetNativePath(fileName);
result = chown(native, (uid_t) -1, (gid_t) gid); /* INTL: Native. */
if (result != 0) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "could not set group for file \"%s\": %s",
- TclGetString(fileName), Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, "could not set group for file \"",
+ TclGetString(fileName), "\": ", Tcl_PosixError(interp),
+ NULL);
}
return TCL_ERROR;
}
@@ -1554,47 +1516,45 @@ SetGroupAttribute(
static int
SetOwnerAttribute(
Tcl_Interp *interp, /* The interp for error reporting. */
- TCL_UNUSED(int) /*objIndex*/,
+ int objIndex, /* The index of the attribute. */
Tcl_Obj *fileName, /* The name of the file (UTF-8). */
Tcl_Obj *attributePtr) /* New owner for file. */
{
- Tcl_WideInt uid;
+ long uid;
int result;
- const char *native;
+ CONST char *native;
- if (Tcl_GetWideIntFromObj(NULL, attributePtr, &uid) != TCL_OK) {
+ if (Tcl_GetLongFromObj(NULL, attributePtr, &uid) != TCL_OK) {
Tcl_DString ds;
struct passwd *pwPtr = NULL;
- const char *string;
+ CONST char *string;
+ int length;
- string = TclGetString(attributePtr);
+ string = Tcl_GetStringFromObj(attributePtr, &length);
- native = Tcl_UtfToExternalDString(NULL, string, attributePtr->length, &ds);
+ native = Tcl_UtfToExternalDString(NULL, string, length, &ds);
pwPtr = TclpGetPwNam(native); /* INTL: Native. */
Tcl_DStringFree(&ds);
if (pwPtr == NULL) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "could not set owner for file \"%s\":"
- " user \"%s\" does not exist",
- TclGetString(fileName), string));
- Tcl_SetErrorCode(interp, "TCL", "OPERATION", "SETOWN",
- "NO_USER", (char *)NULL);
+ Tcl_AppendResult(interp, "could not set owner for file \"",
+ TclGetString(fileName), "\": user \"", string,
+ "\" does not exist", NULL);
}
return TCL_ERROR;
}
uid = pwPtr->pw_uid;
}
- native = (const char *)Tcl_FSGetNativePath(fileName);
+ native = Tcl_FSGetNativePath(fileName);
result = chown(native, (uid_t) uid, (gid_t) -1); /* INTL: Native. */
if (result != 0) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "could not set owner for file \"%s\": %s",
- TclGetString(fileName), Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, "could not set owner for file \"",
+ TclGetString(fileName), "\": ", Tcl_PosixError(interp),
+ NULL);
}
return TCL_ERROR;
}
@@ -1620,15 +1580,15 @@ SetOwnerAttribute(
static int
SetPermissionsAttribute(
Tcl_Interp *interp, /* The interp we are using for errors. */
- TCL_UNUSED(int) /*objIndex*/,
+ int objIndex, /* The index of the attribute. */
Tcl_Obj *fileName, /* The name of the file (UTF-8). */
Tcl_Obj *attributePtr) /* The attribute to set. */
{
- Tcl_WideInt mode;
+ long mode;
mode_t newMode;
int result = TCL_ERROR;
- const char *native;
- const char *modeStringPtr = TclGetString(attributePtr);
+ CONST char *native;
+ char *modeStringPtr = TclGetString(attributePtr);
int scanned = TclParseAllWhiteSpace(modeStringPtr, -1);
/*
@@ -1643,11 +1603,11 @@ SetPermissionsAttribute(
TclNewLiteralStringObj(modeObj, "0o");
Tcl_AppendToObj(modeObj, modeStringPtr+scanned+1, -1);
- result = Tcl_GetWideIntFromObj(NULL, modeObj, &mode);
+ result = Tcl_GetLongFromObj(NULL, modeObj, &mode);
Tcl_DecrRefCount(modeObj);
}
if (result == TCL_OK
- || Tcl_GetWideIntFromObj(NULL, attributePtr, &mode) == TCL_OK) {
+ || Tcl_GetLongFromObj(NULL, attributePtr, &mode) == TCL_OK) {
newMode = (mode_t) (mode & 0x00007FFF);
} else {
Tcl_StatBuf buf;
@@ -1662,9 +1622,9 @@ SetPermissionsAttribute(
result = TclpObjStat(fileName, &buf);
if (result != 0) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "could not read \"%s\": %s",
- TclGetString(fileName), Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, "could not read \"",
+ TclGetString(fileName), "\": ",
+ Tcl_PosixError(interp), NULL);
}
return TCL_ERROR;
}
@@ -1672,22 +1632,20 @@ SetPermissionsAttribute(
if (GetModeFromPermString(NULL, modeStringPtr, &newMode) != TCL_OK) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "unknown permission string format \"%s\"",
- modeStringPtr));
- Tcl_SetErrorCode(interp, "TCL", "VALUE", "PERMISSION", (char *)NULL);
+ Tcl_AppendResult(interp, "unknown permission string format \"",
+ modeStringPtr, "\"", NULL);
}
return TCL_ERROR;
}
}
- native = (const char *)Tcl_FSGetNativePath(fileName);
+ native = Tcl_FSGetNativePath(fileName);
result = chmod(native, newMode); /* INTL: Native. */
if (result != 0) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "could not set permissions for file \"%s\": %s",
- TclGetString(fileName), Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, "could not set permissions for file \"",
+ TclGetString(fileName), "\": ",
+ Tcl_PosixError(interp), NULL);
}
return TCL_ERROR;
}
@@ -1714,8 +1672,7 @@ SetPermissionsAttribute(
Tcl_Obj *
TclpObjListVolumes(void)
{
- Tcl_Obj *resultPtr;
- TclNewLiteralStringObj(resultPtr, "/");
+ Tcl_Obj *resultPtr = Tcl_NewStringObj("/", 1);
Tcl_IncrRefCount(resultPtr);
return resultPtr;
@@ -1742,8 +1699,8 @@ TclpObjListVolumes(void)
static int
GetModeFromPermString(
- TCL_UNUSED(Tcl_Interp *),
- const char *modeStringPtr, /* Permissions string */
+ Tcl_Interp *interp, /* The interp we are using for errors. */
+ char *modeStringPtr, /* Permissions string */
mode_t *modePtr) /* pointer to the mode value */
{
mode_t newMode;
@@ -1762,7 +1719,7 @@ GetModeFromPermString(
newMode = 0;
for (i = 0; i < 9; i++) {
- switch (modeStringPtr[i]) {
+ switch (*(modeStringPtr+i)) {
case 'r':
if ((i%3) != 0) {
goto chmodStyleCheck;
@@ -1824,15 +1781,15 @@ GetModeFromPermString(
* We now check for an "ugoa+-=rwxst" style permissions string
*/
- for (n = 0 ; modeStringPtr[n] != '\0' ; n += i) {
+ for (n = 0 ; *(modeStringPtr+n) != '\0' ; n = n + i) {
oldMode = *modePtr;
who = op = what = op_found = who_found = 0;
- for (i = 0 ; modeStringPtr[n + i] != '\0' ; i++ ) {
+ for (i = 0 ; *(modeStringPtr+n+i) != '\0' ; i++ ) {
if (!who_found) {
/* who */
- switch (modeStringPtr[n + i]) {
+ switch (*(modeStringPtr+n+i)) {
case 'u':
- who |= 0x9C0;
+ who |= 0x9c0;
continue;
case 'g':
who |= 0x438;
@@ -1841,17 +1798,17 @@ GetModeFromPermString(
who |= 0x207;
continue;
case 'a':
- who |= 0xFFF;
+ who |= 0xfff;
continue;
}
}
who_found = 1;
if (who == 0) {
- who = 0xFFF;
+ who = 0xfff;
}
if (!op_found) {
/* op */
- switch (modeStringPtr[n + i]) {
+ switch (*(modeStringPtr+n+i)) {
case '+':
op = 1;
op_found = 1;
@@ -1869,7 +1826,7 @@ GetModeFromPermString(
}
}
/* what */
- switch (modeStringPtr[n + i]) {
+ switch (*(modeStringPtr+n+i)) {
case 'r':
what |= 0x124;
continue;
@@ -1880,7 +1837,7 @@ GetModeFromPermString(
what |= 0x49;
continue;
case 's':
- what |= 0xC00;
+ what |= 0xc00;
continue;
case 't':
what |= 0x200;
@@ -1890,7 +1847,7 @@ GetModeFromPermString(
default:
return TCL_ERROR;
}
- if (modeStringPtr[n + i] == ',') {
+ if (*(modeStringPtr+n+i) == ',') {
i++;
break;
}
@@ -1915,52 +1872,55 @@ GetModeFromPermString(
*
* TclpObjNormalizePath --
*
- * Replaces each component except that last one in a pathname that is a
- * symbolic link with the fully resolved target of that link.
+ * This function scans through a path specification and replaces it, in
+ * place, with a normalized version. A normalized version is one in which
+ * all symlinks in the path are replaced with their expanded form (except
+ * a symlink at the very end of the path).
*
* Results:
- * Stores the resulting path in pathPtr and returns the offset of the last
- * byte processed to obtain the resulting path.
+ * The new 'nextCheckpoint' value, giving as far as we could understand
+ * in the path.
*
* Side effects:
+ * The pathPtr string, is modified.
*
*---------------------------------------------------------------------------
*/
int
TclpObjNormalizePath(
- TCL_UNUSED(Tcl_Interp *),
- Tcl_Obj *pathPtr, /* An unshared object containing the path to
- * normalize. */
- int nextCheckpoint) /* offset to start at in pathPtr. Must either
- * be 0 or the offset of a directory separator
- * at the end of a path part that is already
- * normalized. I.e. this is not the index of
- * the byte just after the separator. */
-
+ Tcl_Interp *interp,
+ Tcl_Obj *pathPtr,
+ int nextCheckpoint)
{
- const char *currentPathEndPosition;
+ char *currentPathEndPosition;
+ int pathLen;
char cur;
- const char *path = TclGetString(pathPtr);
- size_t pathLen = pathPtr->length;
- Tcl_DString ds;
- const char *nativePath;
+ char *path = Tcl_GetStringFromObj(pathPtr, &pathLen);
#ifndef NO_REALPATH
char normPath[MAXPATHLEN];
+ Tcl_DString ds;
+ CONST char *nativePath;
#endif
+ /*
+ * We add '1' here because if nextCheckpoint is zero we know that '/'
+ * exists, and if it isn't zero, it must point at a directory separator
+ * which we also know exists.
+ */
+
currentPathEndPosition = path + nextCheckpoint;
if (*currentPathEndPosition == '/') {
currentPathEndPosition++;
}
#ifndef NO_REALPATH
- if (nextCheckpoint == 0 && haveRealpath) {
- /*
- * Try to get the entire path in one go
- */
+ /*
+ * For speed, try to get the entire path in one go.
+ */
- const char *lastDir = strrchr(currentPathEndPosition, '/');
+ if (nextCheckpoint == 0 && haveRealpath) {
+ char *lastDir = strrchr(currentPathEndPosition, '/');
if (lastDir != NULL) {
nativePath = Tcl_UtfToExternalDString(NULL, path,
@@ -1968,13 +1928,8 @@ TclpObjNormalizePath(
if (Realpath(nativePath, normPath) != NULL) {
if (*nativePath != '/' && *normPath == '/') {
/*
- * realpath transformed a relative path into an
- * absolute path. Fall back to the long way.
- */
-
- /*
- * To do: This logic seems to be out of date. This whole
- * routine should be reviewed and cleaed up.
+ * realpath has transformed a relative path into an
+ * absolute path, we do not know how to handle this.
*/
} else {
nextCheckpoint = lastDir - path;
@@ -1997,6 +1952,8 @@ TclpObjNormalizePath(
* Reached directory separator.
*/
+ Tcl_DString ds;
+ CONST char *nativePath;
int accessOk;
nativePath = Tcl_UtfToExternalDString(NULL, path,
@@ -2013,13 +1970,13 @@ TclpObjNormalizePath(
}
/*
- * Assign the end of the current component to nextCheckpoint
+ * Update the acceptable point.
*/
nextCheckpoint = currentPathEndPosition - path;
} else if (cur == 0) {
/*
- * The end of the string.
+ * Reached end of string.
*/
break;
@@ -2028,23 +1985,26 @@ TclpObjNormalizePath(
}
/*
- * Call 'realpath' to obtain a canonical path.
+ * We should really now convert this to a canonical path. We do that with
+ * 'realpath' if we have it available. Otherwise we could step through
+ * every single path component, checking whether it is a symlink, but that
+ * would be a lot of work, and most modern OSes have 'realpath'.
*/
#ifndef NO_REALPATH
if (haveRealpath) {
- if (nextCheckpoint == 0) {
- /*
- * The path contains at most one component, e.g. '/foo' or '/', so
- * so there is nothing to resolve. Also, on some platforms
- * 'Realpath' transforms an empty string into the normalized pwd,
- * which is the wrong answer.
- */
+ /*
+ * If we only had '/foo' or '/' then we never increment nextCheckpoint
+ * and we don't need or want to go through 'Realpath'. Also, on some
+ * platforms, passing an empty string to 'Realpath' will give us the
+ * normalized pwd, which is not what we want at all!
+ */
+ if (nextCheckpoint == 0) {
return 0;
}
- nativePath = Tcl_UtfToExternalDString(NULL, path,nextCheckpoint, &ds);
+ nativePath = Tcl_UtfToExternalDString(NULL, path, nextCheckpoint, &ds);
if (Realpath(nativePath, normPath) != NULL) {
int newNormLen;
@@ -2053,19 +2013,18 @@ TclpObjNormalizePath(
if ((newNormLen == Tcl_DStringLength(&ds))
&& (strcmp(normPath, nativePath) == 0)) {
/*
- * The original path is unchanged.
+ * String is unchanged.
*/
Tcl_DStringFree(&ds);
/*
- * Uncommenting this would mean that this native filesystem
- * routine claims the path is normalized if the file exists,
- * which would permit the caller to avoid iterating through
- * other filesystems filesystems. Saving lots of calls is
- * probably worth the extra access() time, but in the common
- * case that no other filesystems are registered this is an
- * unnecessary expense.
+ * Enable this to have the native FS claim normalization of
+ * the whole path for existing files. That would permit the
+ * caller to declare normalization complete without calls to
+ * additional filesystems. Saving lots of calls is probably
+ * worth the extra access() time here. When no other FS's are
+ * registered though, things are less clear.
*
if (0 == access(normPath, F_OK)) {
return pathLen;
@@ -2076,7 +2035,8 @@ TclpObjNormalizePath(
}
/*
- * Free the original path and replace it with the normalized path.
+ * Free up the native path and put in its place the converted,
+ * normalized path.
*/
Tcl_DStringFree(&ds);
@@ -2084,7 +2044,7 @@ TclpObjNormalizePath(
if (path[nextCheckpoint] != '\0') {
/*
- * Append the remaining path components.
+ * Not at end, append remaining path.
*/
int normLen = Tcl_DStringLength(&ds);
@@ -2093,8 +2053,7 @@ TclpObjNormalizePath(
pathLen - nextCheckpoint);
/*
- * characters up to and including the directory separator have
- * been processed
+ * We recognise up to and including the directory separator.
*/
nextCheckpoint = normLen + 1;
@@ -2106,6 +2065,10 @@ TclpObjNormalizePath(
nextCheckpoint = Tcl_DStringLength(&ds);
}
+ /*
+ * Overwrite with the normalized path.
+ */
+
Tcl_SetStringObj(pathPtr, Tcl_DStringValue(&ds),
Tcl_DStringLength(&ds));
}
@@ -2116,366 +2079,11 @@ TclpObjNormalizePath(
return nextCheckpoint;
}
+#if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE)
/*
*----------------------------------------------------------------------
*
- * TclpOpenTemporaryFile, TclUnixOpenTemporaryFile --
- *
- * Creates a temporary file, possibly based on the supplied bits and
- * pieces of template supplied in the first three arguments. If the
- * fourth argument is non-NULL, it contains a Tcl_Obj to store the name
- * of the temporary file in (and it is caller's responsibility to clean
- * up). If the fourth argument is NULL, try to arrange for the temporary
- * file to go away once it is no longer needed.
- *
- * Results:
- * A read-write Tcl Channel open on the file for TclpOpenTemporaryFile,
- * or a file descriptor (or -1 on failure) for TclUnixOpenTemporaryFile.
- *
- * Side effects:
- * Accesses the filesystem. Will set the contents of the Tcl_Obj fourth
- * argument (if that is non-NULL).
- *
- *----------------------------------------------------------------------
- */
-
-Tcl_Channel
-TclpOpenTemporaryFile(
- Tcl_Obj *dirObj,
- Tcl_Obj *basenameObj,
- Tcl_Obj *extensionObj,
- Tcl_Obj *resultingNameObj)
-{
- int fd = TclUnixOpenTemporaryFile(dirObj, basenameObj, extensionObj,
- resultingNameObj);
-
- if (fd == -1) {
- return NULL;
- }
- return Tcl_MakeFileChannel(INT2PTR(fd), TCL_READABLE|TCL_WRITABLE);
-}
-
-int
-TclUnixOpenTemporaryFile(
- Tcl_Obj *dirObj,
- Tcl_Obj *basenameObj,
- Tcl_Obj *extensionObj,
- Tcl_Obj *resultingNameObj)
-{
- Tcl_DString templ, tmp;
- const char *string;
- int fd;
-
- /*
- * We should also check against making more then TMP_MAX of these.
- */
-
- if (dirObj) {
- string = TclGetString(dirObj);
- Tcl_UtfToExternalDString(NULL, string, dirObj->length, &templ);
- } else {
- Tcl_DStringInit(&templ);
- Tcl_DStringAppend(&templ, DefaultTempDir(), TCL_INDEX_NONE); /* INTL: native */
- }
-
- TclDStringAppendLiteral(&templ, "/");
-
- if (basenameObj) {
- string = TclGetString(basenameObj);
- Tcl_UtfToExternalDString(NULL, string, basenameObj->length, &tmp);
- TclDStringAppendDString(&templ, &tmp);
- Tcl_DStringFree(&tmp);
- } else {
- TclDStringAppendLiteral(&templ, "tcl");
- }
-
- TclDStringAppendLiteral(&templ, "_XXXXXX");
-
-#ifdef HAVE_MKSTEMPS
- if (extensionObj) {
- string = TclGetString(extensionObj);
- Tcl_UtfToExternalDString(NULL, string, extensionObj->length, &tmp);
- TclDStringAppendDString(&templ, &tmp);
- fd = mkstemps(Tcl_DStringValue(&templ), Tcl_DStringLength(&tmp));
- Tcl_DStringFree(&tmp);
- } else
-#endif
- {
- fd = mkstemp(Tcl_DStringValue(&templ));
- }
-
- if (fd == -1) {
- Tcl_DStringFree(&templ);
- return -1;
- }
-
- if (resultingNameObj) {
- Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&templ),
- Tcl_DStringLength(&templ), &tmp);
- Tcl_SetStringObj(resultingNameObj, Tcl_DStringValue(&tmp),
- Tcl_DStringLength(&tmp));
- Tcl_DStringFree(&tmp);
- } else {
- /*
- * Try to delete the file immediately since we're not reporting the
- * name to anyone. Note that we're *not* handling any errors from
- * this!
- */
-
- unlink(Tcl_DStringValue(&templ));
- errno = 0;
- }
- Tcl_DStringFree(&templ);
-
- return fd;
-}
-
-/*
- * Helper that does *part* of what tempnam() does.
- */
-
-static const char *
-DefaultTempDir(void)
-{
- const char *dir;
- Tcl_StatBuf buf;
-
- dir = getenv("TMPDIR");
- if (dir && dir[0] && TclOSstat(dir, &buf) == 0 && S_ISDIR(buf.st_mode)
- && access(dir, W_OK) == 0) {
- return dir;
- }
-
-#ifdef P_tmpdir
- dir = P_tmpdir;
- if (TclOSstat(dir, &buf)==0 && S_ISDIR(buf.st_mode) && access(dir, W_OK)==0) {
- return dir;
- }
-#endif
-
- /*
- * Assume that the default location ("/tmp" if not overridden) is always
- * an existing writable directory; we've no recovery mechanism if it
- * isn't.
- */
-
- return TCL_TEMPORARY_FILE_DIRECTORY;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpCreateTemporaryDirectory --
- *
- * Creates a temporary directory, possibly based on the supplied bits and
- * pieces of template supplied in the arguments.
- *
- * Results:
- * An object (refcount 0) containing the name of the newly-created
- * directory, or NULL on failure.
- *
- * Side effects:
- * Accesses the native filesystem. Makes a directory.
- *
- *----------------------------------------------------------------------
- */
-
-Tcl_Obj *
-TclpCreateTemporaryDirectory(
- Tcl_Obj *dirObj,
- Tcl_Obj *basenameObj)
-{
- Tcl_DString templ, tmp;
- const char *string;
-
-#define DEFAULT_TEMP_DIR_PREFIX "tcl"
-
- /*
- * Build the template in writable memory from the user-supplied pieces and
- * some defaults.
- */
-
- if (dirObj) {
- string = TclGetString(dirObj);
- Tcl_UtfToExternalDString(NULL, string, dirObj->length, &templ);
- } else {
- Tcl_DStringInit(&templ);
- Tcl_DStringAppend(&templ, DefaultTempDir(), TCL_INDEX_NONE); /* INTL: native */
- }
-
- if (Tcl_DStringValue(&templ)[Tcl_DStringLength(&templ) - 1] != '/') {
- TclDStringAppendLiteral(&templ, "/");
- }
-
- if (basenameObj) {
- string = TclGetString(basenameObj);
- if (basenameObj->length) {
- Tcl_UtfToExternalDString(NULL, string, basenameObj->length, &tmp);
- TclDStringAppendDString(&templ, &tmp);
- Tcl_DStringFree(&tmp);
- } else {
- TclDStringAppendLiteral(&templ, DEFAULT_TEMP_DIR_PREFIX);
- }
- } else {
- TclDStringAppendLiteral(&templ, DEFAULT_TEMP_DIR_PREFIX);
- }
-
- TclDStringAppendLiteral(&templ, "_XXXXXX");
-
- /*
- * Make the temporary directory.
- */
-
- if (mkdtemp(Tcl_DStringValue(&templ)) == NULL) {
- Tcl_DStringFree(&templ);
- return NULL;
- }
-
- /*
- * The template has been updated. Tell the caller what it was.
- */
-
- Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&templ),
- Tcl_DStringLength(&templ), &tmp);
- Tcl_DStringFree(&templ);
- return Tcl_DStringToObj(&tmp);
-}
-
-#if defined(__CYGWIN__)
-
-static void
-StatError(
- Tcl_Interp *interp, /* The interp that has the error */
- Tcl_Obj *fileName) /* The name of the file which caused the
- * error. */
-{
- Tcl_WinConvertError(GetLastError());
- Tcl_SetObjResult(interp, Tcl_ObjPrintf("could not read \"%s\": %s",
- TclGetString(fileName), Tcl_PosixError(interp)));
-}
-
-static WCHAR *
-winPathFromObj(
- Tcl_Obj *fileName)
-{
- int size;
- const char *native = (const char *)Tcl_FSGetNativePath(fileName);
- WCHAR *winPath;
-
- size = cygwin_conv_path(1, native, NULL, 0);
- winPath = (WCHAR *)ckalloc(size);
- cygwin_conv_path(1, native, winPath, size);
-
- return winPath;
-}
-
-static const int attributeArray[] = {
- 0x20, 0, 2, 0, 0, 1, 4
-};
-
-/*
- *----------------------------------------------------------------------
- *
- * GetUnixFileAttributes
- *
- * Gets an attribute of a file.
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * If there is no error assigns to *attributePtrPtr the address of a new
- * Tcl_Obj having a refCount of zero and containing the value of the
- * specified attribute.
- *
- *
- *----------------------------------------------------------------------
- */
-
-static int
-GetUnixFileAttributes(
- Tcl_Interp *interp, /* The interp to report errors to. */
- int objIndex, /* The index of the attribute. */
- Tcl_Obj *fileName, /* The pathname of the file (UTF-8). */
- Tcl_Obj **attributePtrPtr) /* Where to store the result. */
-{
- int fileAttributes;
- WCHAR *winPath = winPathFromObj(fileName);
-
- fileAttributes = GetFileAttributesW(winPath);
- ckfree(winPath);
-
- if (fileAttributes == -1) {
- StatError(interp, fileName);
- return TCL_ERROR;
- }
-
- TclNewIntObj(*attributePtrPtr,
- (fileAttributes & attributeArray[objIndex]) != 0);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetUnixFileAttributes
- *
- * Sets the readonly attribute of a file.
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * The readonly attribute of the file is changed.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-SetUnixFileAttributes(
- Tcl_Interp *interp, /* The interp we are using for errors. */
- int objIndex, /* The index of the attribute. */
- Tcl_Obj *fileName, /* The name of the file (UTF-8). */
- Tcl_Obj *attributePtr) /* The attribute to set. */
-{
- int yesNo, fileAttributes, old;
- WCHAR *winPath;
-
- if (Tcl_GetBooleanFromObj(interp, attributePtr, &yesNo) != TCL_OK) {
- return TCL_ERROR;
- }
-
- winPath = winPathFromObj(fileName);
-
- fileAttributes = old = GetFileAttributesW(winPath);
-
- if (fileAttributes == -1) {
- ckfree(winPath);
- StatError(interp, fileName);
- return TCL_ERROR;
- }
-
- if (yesNo) {
- fileAttributes |= attributeArray[objIndex];
- } else {
- fileAttributes &= ~attributeArray[objIndex];
- }
-
- if ((fileAttributes != old)
- && !SetFileAttributesW(winPath, fileAttributes)) {
- ckfree(winPath);
- StatError(interp, fileName);
- return TCL_ERROR;
- }
-
- ckfree(winPath);
- return TCL_OK;
-}
-#elif defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE)
-/*
- *----------------------------------------------------------------------
- *
- * GetUnixFileAttributes
+ * GetReadOnlyAttribute
*
* Gets the readonly attribute (user immutable flag) of a file.
*
@@ -2490,9 +2098,9 @@ SetUnixFileAttributes(
*/
static int
-GetUnixFileAttributes(
+GetReadOnlyAttribute(
Tcl_Interp *interp, /* The interp we are using for errors. */
- TCL_UNUSED(int) /*objIndex*/,
+ int objIndex, /* The index of the attribute. */
Tcl_Obj *fileName, /* The name of the file (UTF-8). */
Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */
{
@@ -2503,21 +2111,22 @@ GetUnixFileAttributes(
if (result != 0) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "could not read \"%s\": %s",
- TclGetString(fileName), Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, "could not read \"",
+ TclGetString(fileName), "\": ", Tcl_PosixError(interp),
+ NULL);
}
return TCL_ERROR;
}
- TclNewIntObj(*attributePtrPtr, (statBuf.st_flags & UF_IMMUTABLE) != 0);
+ *attributePtrPtr = Tcl_NewBooleanObj((statBuf.st_flags&UF_IMMUTABLE) != 0);
+
return TCL_OK;
}
/*
*---------------------------------------------------------------------------
*
- * SetUnixFileAttributes
+ * SetReadOnlyAttribute
*
* Sets the readonly attribute (user immutable flag) of a file.
*
@@ -2531,15 +2140,16 @@ GetUnixFileAttributes(
*/
static int
-SetUnixFileAttributes(
+SetReadOnlyAttribute(
Tcl_Interp *interp, /* The interp we are using for errors. */
- TCL_UNUSED(int) /*objIndex*/,
+ int objIndex, /* The index of the attribute. */
Tcl_Obj *fileName, /* The name of the file (UTF-8). */
Tcl_Obj *attributePtr) /* The attribute to set. */
{
Tcl_StatBuf statBuf;
- int result, readonly;
- const char *native;
+ int result;
+ int readonly;
+ CONST char *native;
if (Tcl_GetBooleanFromObj(interp, attributePtr, &readonly) != TCL_OK) {
return TCL_ERROR;
@@ -2549,9 +2159,9 @@ SetUnixFileAttributes(
if (result != 0) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "could not read \"%s\": %s",
- TclGetString(fileName), Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, "could not read \"",
+ TclGetString(fileName), "\": ", Tcl_PosixError(interp),
+ NULL);
}
return TCL_ERROR;
}
@@ -2562,13 +2172,13 @@ SetUnixFileAttributes(
statBuf.st_flags &= ~UF_IMMUTABLE;
}
- native = (const char *)Tcl_FSGetNativePath(fileName);
+ native = Tcl_FSGetNativePath(fileName);
result = chflags(native, statBuf.st_flags); /* INTL: Native. */
if (result != 0) {
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "could not set flags for file \"%s\": %s",
- TclGetString(fileName), Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, "could not set flags for file \"",
+ TclGetString(fileName), "\": ", Tcl_PosixError(interp),
+ NULL);
}
return TCL_ERROR;
}
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index 80ef634..0a2099c 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -4,17 +4,17 @@
* This file contains wrappers around UNIX file handling functions.
* These wrappers mask differences between Windows and UNIX.
*
- * Copyright © 1995-1998 Sun Microsystems, Inc.
+ * Copyright (c) 1995-1998 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tclInt.h"
#include "tclFileSystem.h"
-static int NativeMatchType(Tcl_Interp *interp, const char* nativeEntry,
- const char* nativeName, Tcl_GlobTypeData *types);
+static int NativeMatchType(Tcl_Interp *interp, CONST char* nativeEntry,
+ CONST char* nativeName, Tcl_GlobTypeData *types);
/*
*---------------------------------------------------------------------------
@@ -34,36 +34,30 @@ static int NativeMatchType(Tcl_Interp *interp, const char* nativeEntry,
*---------------------------------------------------------------------------
*/
-#ifdef __CYGWIN__
void
TclpFindExecutable(
- TCL_UNUSED(const char *) /*argv0*/)
+ CONST char *argv0) /* The value of the application's argv[0]
+ * (native). */
{
- size_t length;
- wchar_t buf[PATH_MAX] = L"";
- char name[PATH_MAX * 3 + 1];
-
+ Tcl_Encoding encoding;
+#ifdef __CYGWIN__
+ int length;
+ char buf[PATH_MAX * 2];
+ char name[PATH_MAX * TCL_UTF_MAX + 1];
GetModuleFileNameW(NULL, buf, PATH_MAX);
- cygwin_conv_path(3, buf, name, sizeof(name));
+ cygwin_conv_path(3, buf, name, PATH_MAX);
length = strlen(name);
if ((length > 4) && !strcasecmp(name + length - 4, ".exe")) {
/* Strip '.exe' part. */
length -= 4;
}
+ encoding = Tcl_GetEncoding(NULL, NULL);
TclSetObjNameOfExecutable(
- Tcl_NewStringObj(name, length), NULL);
-}
+ Tcl_NewStringObj(name, length), encoding);
#else
-void
-TclpFindExecutable(
- const char *argv0) /* The value of the application's argv[0]
- * (native). */
-{
- Tcl_Encoding encoding;
const char *name, *p;
Tcl_StatBuf statBuf;
Tcl_DString buffer, nameString, cwd, utfName;
- Tcl_Obj *obj;
if (argv0 == NULL) {
return;
@@ -104,21 +98,21 @@ TclpFindExecutable(
*/
while (1) {
- while (TclIsSpaceProcM(*p)) {
+ while (TclIsSpaceProc(*p)) {
p++;
}
name = p;
while ((*p != ':') && (*p != 0)) {
p++;
}
- TclDStringClear(&buffer);
+ Tcl_DStringSetLength(&buffer, 0);
if (p != name) {
Tcl_DStringAppend(&buffer, name, p - name);
if (p[-1] != '/') {
- TclDStringAppendLiteral(&buffer, "/");
+ Tcl_DStringAppend(&buffer, "/", 1);
}
}
- name = Tcl_DStringAppend(&buffer, argv0, TCL_INDEX_NONE);
+ name = Tcl_DStringAppend(&buffer, argv0, -1);
/*
* INTL: The following calls to access() and stat() should not be
@@ -131,16 +125,15 @@ TclpFindExecutable(
&& S_ISREG(statBuf.st_mode)) {
goto gotName;
}
- if (p[0] == '\0') {
+ if (*p == '\0') {
break;
- } else if (p[1] == 0) {
+ } else if (*(p+1) == 0) {
p = "./";
} else {
p++;
}
}
- TclNewObj(obj);
- TclSetObjNameOfExecutable(obj, NULL);
+ TclSetObjNameOfExecutable(Tcl_NewObj(), NULL);
goto done;
/*
@@ -155,16 +148,15 @@ TclpFindExecutable(
#endif
{
encoding = Tcl_GetEncoding(NULL, NULL);
- Tcl_ExternalToUtfDString(encoding, name, TCL_INDEX_NONE, &utfName);
+ Tcl_ExternalToUtfDString(encoding, name, -1, &utfName);
TclSetObjNameOfExecutable(
- Tcl_NewStringObj(Tcl_DStringValue(&utfName), TCL_INDEX_NONE), encoding);
+ Tcl_NewStringObj(Tcl_DStringValue(&utfName), -1), encoding);
Tcl_DStringFree(&utfName);
goto done;
}
if (TclpGetCwd(NULL, &cwd) == NULL) {
- TclNewObj(obj);
- TclSetObjNameOfExecutable(obj, NULL);
+ TclSetObjNameOfExecutable(Tcl_NewObj(), NULL);
goto done;
}
@@ -179,29 +171,30 @@ TclpFindExecutable(
}
Tcl_DStringInit(&nameString);
- Tcl_DStringAppend(&nameString, name, TCL_INDEX_NONE);
+ Tcl_DStringAppend(&nameString, name, -1);
Tcl_DStringFree(&buffer);
Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&cwd),
Tcl_DStringLength(&cwd), &buffer);
if (Tcl_DStringValue(&cwd)[Tcl_DStringLength(&cwd) -1] != '/') {
- TclDStringAppendLiteral(&buffer, "/");
+ Tcl_DStringAppend(&buffer, "/", 1);
}
Tcl_DStringFree(&cwd);
- TclDStringAppendDString(&buffer, &nameString);
+ Tcl_DStringAppend(&buffer, Tcl_DStringValue(&nameString),
+ Tcl_DStringLength(&nameString));
Tcl_DStringFree(&nameString);
encoding = Tcl_GetEncoding(NULL, NULL);
- Tcl_ExternalToUtfDString(encoding, Tcl_DStringValue(&buffer), TCL_INDEX_NONE,
+ Tcl_ExternalToUtfDString(encoding, Tcl_DStringValue(&buffer), -1,
&utfName);
TclSetObjNameOfExecutable(
- Tcl_NewStringObj(Tcl_DStringValue(&utfName), TCL_INDEX_NONE), encoding);
+ Tcl_NewStringObj(Tcl_DStringValue(&utfName), -1), encoding);
Tcl_DStringFree(&utfName);
done:
Tcl_DStringFree(&buffer);
-}
#endif
+}
/*
*----------------------------------------------------------------------
@@ -227,12 +220,12 @@ TclpMatchInDirectory(
Tcl_Interp *interp, /* Interpreter to receive errors. */
Tcl_Obj *resultPtr, /* List object to lappend results. */
Tcl_Obj *pathPtr, /* Contains path to directory to search. */
- const char *pattern, /* Pattern to match against. */
+ CONST char *pattern, /* Pattern to match against. */
Tcl_GlobTypeData *types) /* Object containing list of acceptable types.
* May be NULL. In particular the directory
* flag is very important. */
{
- const char *native;
+ CONST char *native;
Tcl_Obj *fileNamePtr;
int matchResult = 0;
@@ -253,13 +246,12 @@ TclpMatchInDirectory(
/*
* Match a file directly.
*/
-
Tcl_Obj *tailPtr;
- const char *nativeTail;
+ CONST char *nativeTail;
- native = (const char *)Tcl_FSGetNativePath(pathPtr);
+ native = (CONST char*) Tcl_FSGetNativePath(pathPtr);
tailPtr = TclPathPart(interp, pathPtr, TCL_PATH_TAIL);
- nativeTail = (const char *)Tcl_FSGetNativePath(tailPtr);
+ nativeTail = (CONST char*) Tcl_FSGetNativePath(tailPtr);
matchResult = NativeMatchType(interp, native, nativeTail, types);
if (matchResult == 1) {
Tcl_ListObjAppendElement(interp, resultPtr, pathPtr);
@@ -267,23 +259,23 @@ TclpMatchInDirectory(
Tcl_DecrRefCount(tailPtr);
Tcl_DecrRefCount(fileNamePtr);
} else {
- TclDIR *d;
+ DIR *d;
Tcl_DirEntry *entryPtr;
- const char *dirName;
- size_t dirLength, nativeDirLen;
+ CONST char *dirName;
+ int dirLength;
int matchHidden, matchHiddenPat;
+ int nativeDirLen;
Tcl_StatBuf statBuf;
Tcl_DString ds; /* native encoding of dir */
Tcl_DString dsOrig; /* utf-8 encoding of dir */
Tcl_DStringInit(&dsOrig);
- dirName = TclGetString(fileNamePtr);
- dirLength = fileNamePtr->length;
+ dirName = Tcl_GetStringFromObj(fileNamePtr, &dirLength);
Tcl_DStringAppend(&dsOrig, dirName, dirLength);
/*
* Make sure that the directory part of the name really is a
- * directory. If the directory name is "", use the name "." instead,
+ * directory. If the directory name is "", use the name "." instead,
* because some UNIX systems don't treat "" like "." automatically.
* Keep the "" for use in generating file names, otherwise "glob
* foo.c" would return "./foo.c".
@@ -299,7 +291,7 @@ TclpMatchInDirectory(
*/
if (dirName[dirLength-1] != '/') {
- dirName = TclDStringAppendLiteral(&dsOrig, "/");
+ dirName = Tcl_DStringAppend(&dsOrig, "/", 1);
dirLength++;
}
}
@@ -308,7 +300,7 @@ TclpMatchInDirectory(
* Now open the directory for reading and iterate over the contents.
*/
- native = Tcl_UtfToExternalDString(NULL, dirName, TCL_INDEX_NONE, &ds);
+ native = Tcl_UtfToExternalDString(NULL, dirName, -1, &ds);
if ((TclOSstat(native, &statBuf) != 0) /* INTL: Native. */
|| !S_ISDIR(statBuf.st_mode)) {
@@ -318,13 +310,14 @@ TclpMatchInDirectory(
return TCL_OK;
}
- d = TclOSopendir(native); /* INTL: Native. */
+ d = opendir(native); /* INTL: Native. */
if (d == NULL) {
Tcl_DStringFree(&ds);
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't read directory \"%s\": %s",
- Tcl_DStringValue(&dsOrig), Tcl_PosixError(interp)));
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "couldn't read directory \"",
+ Tcl_DStringValue(&dsOrig), "\": ",
+ Tcl_PosixError(interp), (char *) NULL);
}
Tcl_DStringFree(&dsOrig);
Tcl_DecrRefCount(fileNamePtr);
@@ -339,11 +332,11 @@ TclpMatchInDirectory(
matchHiddenPat = (pattern[0] == '.')
|| ((pattern[0] == '\\') && (pattern[1] == '.'));
- matchHidden = matchHiddenPat
+ matchHidden = matchHiddenPat
|| (types && (types->perm & TCL_GLOB_PERM_HIDDEN));
while ((entryPtr = TclOSreaddir(d)) != NULL) { /* INTL: Native. */
Tcl_DString utfDs;
- const char *utfname;
+ CONST char *utfname;
/*
* Skip this file if it doesn't agree with the hidden parameters
@@ -351,19 +344,13 @@ TclpMatchInDirectory(
*/
if (*entryPtr->d_name == '.') {
- if (!matchHidden) {
- continue;
- }
+ if (!matchHidden) continue;
} else {
#ifdef MAC_OSX_TCL
- if (matchHiddenPat) {
- continue;
- }
+ if (matchHiddenPat) continue;
/* Also need to check HFS hidden flag in TclMacOSXMatchType. */
#else
- if (matchHidden) {
- continue;
- }
+ if (matchHidden) continue;
#endif
}
@@ -372,14 +359,14 @@ TclpMatchInDirectory(
* and pattern. If so, add the file to the result.
*/
- utfname = Tcl_ExternalToUtfDString(NULL, entryPtr->d_name, TCL_INDEX_NONE,
+ utfname = Tcl_ExternalToUtfDString(NULL, entryPtr->d_name, -1,
&utfDs);
if (Tcl_StringCaseMatch(utfname, pattern, 0)) {
int typeOk = 1;
if (types != NULL) {
Tcl_DStringSetLength(&ds, nativeDirLen);
- native = Tcl_DStringAppend(&ds, entryPtr->d_name, TCL_INDEX_NONE);
+ native = Tcl_DStringAppend(&ds, entryPtr->d_name, -1);
matchResult = NativeMatchType(interp, native,
entryPtr->d_name, types);
typeOk = (matchResult == 1);
@@ -396,15 +383,16 @@ TclpMatchInDirectory(
}
}
- TclOSclosedir(d);
+ closedir(d);
Tcl_DStringFree(&ds);
Tcl_DStringFree(&dsOrig);
Tcl_DecrRefCount(fileNamePtr);
}
if (matchResult < 0) {
return TCL_ERROR;
+ } else {
+ return TCL_OK;
}
- return TCL_OK;
}
/*
@@ -412,13 +400,13 @@ TclpMatchInDirectory(
*
* NativeMatchType --
*
- * This routine is used by the globbing code to check if a file matches a
- * given type description.
+ * This routine is used by the globbing code to check if a file
+ * matches a given type description.
*
* Results:
- * The return value is 1, 0 or -1 indicating whether the file matches the
- * given criteria, does not match them, or an error occurred (in which
- * case an error is left in interp).
+ * The return value is 1, 0 or -1 indicating whether the file
+ * matches the given criteria, does not match them, or an error
+ * occurred (in wich case an error is left in interp).
*
* Side effects:
* None.
@@ -429,12 +417,11 @@ TclpMatchInDirectory(
static int
NativeMatchType(
Tcl_Interp *interp, /* Interpreter to receive errors. */
- const char *nativeEntry, /* Native path to check. */
- const char *nativeName, /* Native filename to check. */
+ CONST char *nativeEntry, /* Native path to check. */
+ CONST char *nativeName, /* Native filename to check. */
Tcl_GlobTypeData *types) /* Type description to match against. */
{
Tcl_StatBuf buf;
-
if (types == NULL) {
/*
* Simply check for the file's existence, but do it with lstat, in
@@ -445,128 +432,124 @@ NativeMatchType(
if (TclOSlstat(nativeEntry, &buf) != 0) {
return 0;
}
- return 1;
- }
+ } else {
+ if (types->perm != 0) {
+ if (TclOSstat(nativeEntry, &buf) != 0) {
+ /*
+ * Either the file has disappeared between the 'readdir' call
+ * and the 'stat' call, or the file is a link to a file which
+ * doesn't exist (which we could ascertain with lstat), or
+ * there is some other strange problem. In all these cases, we
+ * define this to mean the file does not match any defined
+ * permission, and therefore it is not added to the list of
+ * files to return.
+ */
+
+ return 0;
+ }
- if (types->perm != 0) {
- if (TclOSstat(nativeEntry, &buf) != 0) {
/*
- * Either the file has disappeared between the 'readdir' call and
- * the 'stat' call, or the file is a link to a file which doesn't
- * exist (which we could ascertain with lstat), or there is some
- * other strange problem. In all these cases, we define this to
- * mean the file does not match any defined permission, and
- * therefore it is not added to the list of files to return.
+ * readonly means that there are NO write permissions (even for
+ * user), but execute is OK for anybody OR that the user immutable
+ * flag is set (where supported).
*/
- return 0;
- }
-
- /*
- * readonly means that there are NO write permissions (even for user),
- * but execute is OK for anybody OR that the user immutable flag is
- * set (where supported).
- */
-
- if (((types->perm & TCL_GLOB_PERM_RONLY) &&
+ if (((types->perm & TCL_GLOB_PERM_RONLY) &&
#if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE)
- !(buf.st_flags & UF_IMMUTABLE) &&
+ !(buf.st_flags & UF_IMMUTABLE) &&
#endif
- (buf.st_mode & (S_IWOTH|S_IWGRP|S_IWUSR))) ||
- ((types->perm & TCL_GLOB_PERM_R) &&
- (access(nativeEntry, R_OK) != 0)) ||
- ((types->perm & TCL_GLOB_PERM_W) &&
- (access(nativeEntry, W_OK) != 0)) ||
- ((types->perm & TCL_GLOB_PERM_X) &&
- (access(nativeEntry, X_OK) != 0))
+ (buf.st_mode & (S_IWOTH|S_IWGRP|S_IWUSR))) ||
+ ((types->perm & TCL_GLOB_PERM_R) &&
+ (access(nativeEntry, R_OK) != 0)) ||
+ ((types->perm & TCL_GLOB_PERM_W) &&
+ (access(nativeEntry, W_OK) != 0)) ||
+ ((types->perm & TCL_GLOB_PERM_X) &&
+ (access(nativeEntry, X_OK) != 0))
#ifndef MAC_OSX_TCL
- || ((types->perm & TCL_GLOB_PERM_HIDDEN) &&
- (*nativeName != '.'))
-#endif /* MAC_OSX_TCL */
+ || ((types->perm & TCL_GLOB_PERM_HIDDEN) &&
+ (*nativeName != '.'))
+#endif
) {
- return 0;
+ return 0;
+ }
}
- }
- if (types->type != 0) {
- if (types->perm == 0) {
- /*
- * We haven't yet done a stat on the file.
- */
-
- if (TclOSstat(nativeEntry, &buf) != 0) {
+ if (types->type != 0) {
+ if (types->perm == 0) {
/*
- * Posix error occurred. The only ok case is if this is a link
- * to a nonexistent file, and the user did 'glob -l'. So we
- * check that here:
+ * We haven't yet done a stat on the file.
*/
- if ((types->type & TCL_GLOB_TYPE_LINK)
- && (TclOSlstat(nativeEntry, &buf) == 0)
- && S_ISLNK(buf.st_mode)) {
- return 1;
+ if (TclOSstat(nativeEntry, &buf) != 0) {
+ /*
+ * Posix error occurred. The only ok case is if this is a
+ * link to a nonexistent file, and the user did 'glob -l'.
+ * So we check that here:
+ */
+
+ if (types->type & TCL_GLOB_TYPE_LINK) {
+ if (TclOSlstat(nativeEntry, &buf) == 0) {
+ if (S_ISLNK(buf.st_mode)) {
+ return 1;
+ }
+ }
+ }
+ return 0;
}
- return 0;
}
- }
- /*
- * In order bcdpsfl as in 'find -t'
- */
+ /*
+ * In order bcdpfls as in 'find -t'
+ */
- if ( ((types->type & TCL_GLOB_TYPE_BLOCK)&& S_ISBLK(buf.st_mode)) ||
+ if (((types->type & TCL_GLOB_TYPE_BLOCK)&& S_ISBLK(buf.st_mode)) ||
((types->type & TCL_GLOB_TYPE_CHAR) && S_ISCHR(buf.st_mode)) ||
((types->type & TCL_GLOB_TYPE_DIR) && S_ISDIR(buf.st_mode)) ||
((types->type & TCL_GLOB_TYPE_PIPE) && S_ISFIFO(buf.st_mode))||
+ ((types->type & TCL_GLOB_TYPE_FILE) && S_ISREG(buf.st_mode))
#ifdef S_ISSOCK
- ((types->type & TCL_GLOB_TYPE_SOCK) && S_ISSOCK(buf.st_mode))||
+ ||((types->type & TCL_GLOB_TYPE_SOCK) && S_ISSOCK(buf.st_mode))
#endif /* S_ISSOCK */
- ((types->type & TCL_GLOB_TYPE_FILE) && S_ISREG(buf.st_mode))) {
- /*
- * Do nothing - this file is ok.
- */
- } else {
+ ) {
+ /*
+ * Do nothing - this file is ok.
+ */
+ } else {
#ifdef S_ISLNK
- if ((types->type & TCL_GLOB_TYPE_LINK)
- && (TclOSlstat(nativeEntry, &buf) == 0)
- && S_ISLNK(buf.st_mode)) {
- goto filetypeOK;
- }
+ if (types->type & TCL_GLOB_TYPE_LINK) {
+ if (TclOSlstat(nativeEntry, &buf) == 0) {
+ if (S_ISLNK(buf.st_mode)) {
+ goto filetypeOK;
+ }
+ }
+ }
#endif /* S_ISLNK */
- return 0;
+ return 0;
+ }
}
- }
- filetypeOK:
-
- /*
- * If we're on OSX, we also have to worry about matching the file creator
- * code (if specified). Do that now.
- */
-
+ filetypeOK: ;
#ifdef MAC_OSX_TCL
- if (types->macType != NULL || types->macCreator != NULL ||
- (types->perm & TCL_GLOB_PERM_HIDDEN)) {
- int matchResult;
+ if (types->macType != NULL || types->macCreator != NULL ||
+ (types->perm & TCL_GLOB_PERM_HIDDEN)) {
+ int matchResult;
- if (types->perm == 0 && types->type == 0) {
- /*
- * We haven't yet done a stat on the file.
- */
+ if (types->perm == 0 && types->type == 0) {
+ /*
+ * We haven't yet done a stat on the file.
+ */
- if (TclOSstat(nativeEntry, &buf) != 0) {
- return 0;
+ if (TclOSstat(nativeEntry, &buf) != 0) {
+ return 0;
+ }
}
- }
- matchResult = TclMacOSXMatchType(interp, nativeEntry, nativeName,
- &buf, types);
- if (matchResult != 1) {
- return matchResult;
+ matchResult = TclMacOSXMatchType(interp, nativeEntry, nativeName,
+ &buf, types);
+ if (matchResult != 1) {
+ return matchResult;
+ }
}
+#endif
}
-#else
- (void)interp;
-#endif /* MAC_OSX_TCL */
-
return 1;
}
@@ -591,23 +574,25 @@ NativeMatchType(
*----------------------------------------------------------------------
*/
-const char *
+char *
TclpGetUserHome(
- const char *name, /* User name for desired home directory. */
+ CONST char *name, /* User name for desired home directory. */
Tcl_DString *bufferPtr) /* Uninitialized or free DString filled with
* name of user's home directory. */
{
struct passwd *pwPtr;
Tcl_DString ds;
- const char *native = Tcl_UtfToExternalDString(NULL, name, TCL_INDEX_NONE, &ds);
+ CONST char *native;
+ native = Tcl_UtfToExternalDString(NULL, name, -1, &ds);
pwPtr = TclpGetPwNam(native); /* INTL: Native. */
Tcl_DStringFree(&ds);
if (pwPtr == NULL) {
return NULL;
}
- return Tcl_ExternalToUtfDString(NULL, pwPtr->pw_dir, TCL_INDEX_NONE, bufferPtr);
+ Tcl_ExternalToUtfDString(NULL, pwPtr->pw_dir, -1, bufferPtr);
+ return Tcl_DStringValue(bufferPtr);
}
/*
@@ -631,12 +616,12 @@ TclpObjAccess(
Tcl_Obj *pathPtr, /* Path of file to access */
int mode) /* Permission setting. */
{
- const char *path = (const char *)Tcl_FSGetNativePath(pathPtr);
-
+ CONST char *path = Tcl_FSGetNativePath(pathPtr);
if (path == NULL) {
return -1;
+ } else {
+ return access(path, mode);
}
- return access(path, mode);
}
/*
@@ -659,12 +644,12 @@ int
TclpObjChdir(
Tcl_Obj *pathPtr) /* Path to new working directory */
{
- const char *path = (const char *)Tcl_FSGetNativePath(pathPtr);
-
+ CONST char *path = Tcl_FSGetNativePath(pathPtr);
if (path == NULL) {
return -1;
+ } else {
+ return chdir(path);
}
- return chdir(path);
}
/*
@@ -688,7 +673,7 @@ TclpObjLstat(
Tcl_Obj *pathPtr, /* Path of file to stat */
Tcl_StatBuf *bufPtr) /* Filled with results of stat call. */
{
- return TclOSlstat((const char *)Tcl_FSGetNativePath(pathPtr), bufPtr);
+ return TclOSlstat(Tcl_FSGetNativePath(pathPtr), bufPtr);
}
/*
@@ -703,7 +688,7 @@ TclpObjLstat(
* is either the given clientData, if the working directory hasn't
* changed, or a new clientData (owned by our caller), giving the new
* native path, or NULL if the current directory could not be determined.
- * If NULL is returned, the caller can examine the standard Posix error
+ * If NULL is returned, the caller can examine the standard posix error
* codes to determine the cause of the problem.
*
* Side effects:
@@ -712,34 +697,31 @@ TclpObjLstat(
*----------------------------------------------------------------------
*/
-void *
+ClientData
TclpGetNativeCwd(
- void *clientData)
+ ClientData clientData)
{
char buffer[MAXPATHLEN+1];
#ifdef USEGETWD
- if (getwd(buffer) == NULL) { /* INTL: Native. */
- return NULL;
- }
+ if (getwd(buffer) == NULL) /* INTL: Native. */
#else
- if (getcwd(buffer, MAXPATHLEN+1) == NULL) { /* INTL: Native. */
+ if (getcwd(buffer, MAXPATHLEN+1) == NULL) /* INTL: Native. */
+#endif
+ {
return NULL;
}
-#endif /* USEGETWD */
-
- if ((clientData == NULL) || strcmp(buffer, (const char *) clientData)) {
- char *newCd = (char *)ckalloc(strlen(buffer) + 1);
+ if ((clientData != NULL) && strcmp(buffer, (CONST char*)clientData) == 0) {
+ /*
+ * No change to pwd.
+ */
+ return clientData;
+ } else {
+ char *newCd = (char *) ckalloc((unsigned) (strlen(buffer) + 1));
strcpy(newCd, buffer);
- return newCd;
+ return (ClientData) newCd;
}
-
- /*
- * No change to pwd.
- */
-
- return clientData;
}
/*
@@ -764,7 +746,7 @@ TclpGetNativeCwd(
*----------------------------------------------------------------------
*/
-const char *
+CONST char *
TclpGetCwd(
Tcl_Interp *interp, /* If non-NULL, used for error reporting. */
Tcl_DString *bufferPtr) /* Uninitialized or free DString filled with
@@ -776,16 +758,16 @@ TclpGetCwd(
if (getwd(buffer) == NULL) /* INTL: Native. */
#else
if (getcwd(buffer, MAXPATHLEN+1) == NULL) /* INTL: Native. */
-#endif /* USEGETWD */
+#endif
{
if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "error getting working directory name: %s",
- Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp,
+ "error getting working directory name: ",
+ Tcl_PosixError(interp), NULL);
}
return NULL;
}
- return Tcl_ExternalToUtfDString(NULL, buffer, TCL_INDEX_NONE, bufferPtr);
+ return Tcl_ExternalToUtfDString(NULL, buffer, -1, bufferPtr);
}
/*
@@ -810,17 +792,17 @@ TclpGetCwd(
char *
TclpReadlink(
- const char *path, /* Path of file to readlink (UTF-8). */
+ CONST char *path, /* Path of file to readlink (UTF-8). */
Tcl_DString *linkPtr) /* Uninitialized or free DString filled with
* contents of link (UTF-8). */
{
#ifndef DJGPP
char link[MAXPATHLEN];
- Tcl_Size length;
- const char *native;
+ int length;
+ CONST char *native;
Tcl_DString ds;
- native = Tcl_UtfToExternalDString(NULL, path, TCL_INDEX_NONE, &ds);
+ native = Tcl_UtfToExternalDString(NULL, path, -1, &ds);
length = readlink(native, link, sizeof(link)); /* INTL: Native. */
Tcl_DStringFree(&ds);
@@ -832,7 +814,7 @@ TclpReadlink(
return Tcl_DStringValue(linkPtr);
#else
return NULL;
-#endif /* !DJGPP */
+#endif
}
/*
@@ -856,25 +838,25 @@ TclpObjStat(
Tcl_Obj *pathPtr, /* Path of file to stat */
Tcl_StatBuf *bufPtr) /* Filled with results of stat call. */
{
- const char *path = (const char *)Tcl_FSGetNativePath(pathPtr);
-
+ CONST char *path = Tcl_FSGetNativePath(pathPtr);
if (path == NULL) {
return -1;
+ } else {
+ return TclOSstat(path, bufPtr);
}
- return TclOSstat(path, bufPtr);
}
#ifdef S_IFLNK
-Tcl_Obj *
+Tcl_Obj*
TclpObjLink(
Tcl_Obj *pathPtr,
Tcl_Obj *toPtr,
int linkAction)
{
if (toPtr != NULL) {
- const char *src = (const char *)Tcl_FSGetNativePath(pathPtr);
- const char *target = NULL;
+ CONST char *src = Tcl_FSGetNativePath(pathPtr);
+ CONST char *target = NULL;
if (src == NULL) {
return NULL;
@@ -919,7 +901,7 @@ TclpObjLink(
Tcl_DecrRefCount(absPtr);
Tcl_DecrRefCount(dirPtr);
} else {
- target = (const char*)Tcl_FSGetNativePath(toPtr);
+ target = Tcl_FSGetNativePath(toPtr);
if (target == NULL) {
return NULL;
}
@@ -947,9 +929,9 @@ TclpObjLink(
*/
if (linkAction & TCL_CREATE_SYMBOLIC_LINK) {
+ int targetLen;
Tcl_DString ds;
Tcl_Obj *transPtr;
- Tcl_Size length;
/*
* Now we don't want to link to the absolute, normalized path.
@@ -961,8 +943,8 @@ TclpObjLink(
if (transPtr == NULL) {
return NULL;
}
- target = TclGetStringFromObj(transPtr, &length);
- target = Tcl_UtfToExternalDString(NULL, target, length, &ds);
+ target = Tcl_GetStringFromObj(transPtr, &targetLen);
+ target = Tcl_UtfToExternalDString(NULL, target, targetLen, &ds);
Tcl_DecrRefCount(transPtr);
if (symlink(target, src) != 0) {
@@ -982,7 +964,7 @@ TclpObjLink(
Tcl_Obj *linkPtr = NULL;
char link[MAXPATHLEN];
- Tcl_Size length;
+ int length;
Tcl_DString ds;
Tcl_Obj *transPtr;
@@ -992,14 +974,18 @@ TclpObjLink(
}
Tcl_DecrRefCount(transPtr);
- length = readlink((const char *)Tcl_FSGetNativePath(pathPtr), link, sizeof(link));
+ length = readlink(Tcl_FSGetNativePath(pathPtr), link, sizeof(link));
if (length < 0) {
return NULL;
}
Tcl_ExternalToUtfDString(NULL, link, length, &ds);
- linkPtr = Tcl_DStringToObj(&ds);
- Tcl_IncrRefCount(linkPtr);
+ linkPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds),
+ Tcl_DStringLength(&ds));
+ Tcl_DStringFree(&ds);
+ if (linkPtr != NULL) {
+ Tcl_IncrRefCount(linkPtr);
+ }
return linkPtr;
}
}
@@ -1026,7 +1012,7 @@ TclpObjLink(
Tcl_Obj *
TclpFilesystemPathType(
- TCL_UNUSED(Tcl_Obj *))
+ Tcl_Obj *pathPtr)
{
/*
* All native paths are of the same type.
@@ -1058,12 +1044,22 @@ TclpFilesystemPathType(
Tcl_Obj *
TclpNativeToNormalized(
- void *clientData)
+ ClientData clientData)
{
Tcl_DString ds;
+ Tcl_Obj *objPtr;
+ int len;
+
+ CONST char *copy;
+ Tcl_ExternalToUtfDString(NULL, (CONST char*)clientData, -1, &ds);
- Tcl_ExternalToUtfDString(NULL, (const char *) clientData, TCL_INDEX_NONE, &ds);
- return Tcl_DStringToObj(&ds);
+ copy = Tcl_DStringValue(&ds);
+ len = Tcl_DStringLength(&ds);
+
+ objPtr = Tcl_NewStringObj(copy,len);
+ Tcl_DStringFree(&ds);
+
+ return objPtr;
}
/*
@@ -1082,15 +1078,15 @@ TclpNativeToNormalized(
*---------------------------------------------------------------------------
*/
-void *
+ClientData
TclNativeCreateNativeRep(
Tcl_Obj *pathPtr)
{
char *nativePathPtr;
- const char *str;
Tcl_DString ds;
Tcl_Obj *validPathPtr;
- Tcl_Size len;
+ int len;
+ char *str;
if (TclFSCwdIsNative()) {
/*
@@ -1115,7 +1111,7 @@ TclNativeCreateNativeRep(
Tcl_IncrRefCount(validPathPtr);
}
- str = TclGetStringFromObj(validPathPtr, &len);
+ str = Tcl_GetStringFromObj(validPathPtr, &len);
Tcl_UtfToExternalDString(NULL, str, len, &ds);
len = Tcl_DStringLength(&ds) + sizeof(char);
if (strlen(Tcl_DStringValue(&ds)) < len - sizeof(char)) {
@@ -1125,11 +1121,11 @@ TclNativeCreateNativeRep(
return NULL;
}
Tcl_DecrRefCount(validPathPtr);
- nativePathPtr = (char *)ckalloc(len);
- memcpy(nativePathPtr, Tcl_DStringValue(&ds), len);
+ nativePathPtr = ckalloc((unsigned) len);
+ memcpy((void*)nativePathPtr, (void*)Tcl_DStringValue(&ds), (size_t) len);
Tcl_DStringFree(&ds);
- return nativePathPtr;
+ return (ClientData)nativePathPtr;
}
/*
@@ -1149,9 +1145,9 @@ TclNativeCreateNativeRep(
*---------------------------------------------------------------------------
*/
-void *
+ClientData
TclNativeDupInternalRep(
- void *clientData)
+ ClientData clientData)
{
char *copy;
size_t len;
@@ -1164,11 +1160,11 @@ TclNativeDupInternalRep(
* ASCII representation when running on Unix.
*/
- len = (strlen((const char*) clientData) + 1) * sizeof(char);
+ len = sizeof(char) + (strlen((CONST char*) clientData) * sizeof(char));
- copy = (char *)ckalloc(len);
- memcpy(copy, clientData, len);
- return copy;
+ copy = (char *) ckalloc(len);
+ memcpy((void *) copy, (void *) clientData, len);
+ return (ClientData)copy;
}
/*
@@ -1192,43 +1188,13 @@ TclpUtime(
Tcl_Obj *pathPtr, /* File to modify */
struct utimbuf *tval) /* New modification date structure */
{
- return utime((const char *)Tcl_FSGetNativePath(pathPtr), tval);
+ return utime(Tcl_FSGetNativePath(pathPtr), tval);
}
-
#ifdef __CYGWIN__
-
-int
-TclOSfstat(
- int fd,
- void *cygstat)
-{
- struct stat buf;
- Tcl_StatBuf *statBuf = (Tcl_StatBuf *)cygstat;
- int result = fstat(fd, &buf);
-
- statBuf->st_mode = buf.st_mode;
- statBuf->st_ino = buf.st_ino;
- statBuf->st_dev = buf.st_dev;
- statBuf->st_rdev = buf.st_rdev;
- statBuf->st_nlink = buf.st_nlink;
- statBuf->st_uid = buf.st_uid;
- statBuf->st_gid = buf.st_gid;
- statBuf->st_size = buf.st_size;
- statBuf->st_atime = buf.st_atime;
- statBuf->st_mtime = buf.st_mtime;
- statBuf->st_ctime = buf.st_ctime;
- return result;
-}
-
-int
-TclOSstat(
- const char *name,
- void *cygstat)
-{
+int TclOSstat(const char *name, void *cygstat) {
struct stat buf;
- Tcl_StatBuf *statBuf = (Tcl_StatBuf *)cygstat;
+ Tcl_StatBuf *statBuf = cygstat;
int result = stat(name, &buf);
-
statBuf->st_mode = buf.st_mode;
statBuf->st_ino = buf.st_ino;
statBuf->st_dev = buf.st_dev;
@@ -1242,16 +1208,10 @@ TclOSstat(
statBuf->st_ctime = buf.st_ctime;
return result;
}
-
-int
-TclOSlstat(
- const char *name,
- void *cygstat)
-{
+int TclOSlstat(const char *name, void *cygstat) {
struct stat buf;
- Tcl_StatBuf *statBuf = (Tcl_StatBuf *)cygstat;
+ Tcl_StatBuf *statBuf = cygstat;
int result = lstat(name, &buf);
-
statBuf->st_mode = buf.st_mode;
statBuf->st_ino = buf.st_ino;
statBuf->st_dev = buf.st_dev;
@@ -1265,7 +1225,7 @@ TclOSlstat(
statBuf->st_ctime = buf.st_ctime;
return result;
}
-#endif /* CYGWIN */
+#endif
/*
* Local Variables:
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index b15f80a..a8cd00d 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -3,20 +3,22 @@
*
* Contains the Unix-specific interpreter initialization functions.
*
- * Copyright © 1995-1997 Sun Microsystems, Inc.
- * Copyright © 1999 Scriptics Corporation.
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright (c) 1999 by Scriptics Corporation.
* All rights reserved.
*/
#include "tclInt.h"
+#include <stddef.h>
+#include <locale.h>
#ifdef HAVE_LANGINFO
# include <langinfo.h>
# ifdef __APPLE__
-# if defined(HAVE_WEAK_IMPORT) && MAC_OS_X_VERSION_MIN_REQUIRED < 1030
+# if defined(HAVE_WEAK_IMPORT) && MAC_OS_X_VERSION_MIN_REQUIRED < 1030
/* Support for weakly importing nl_langinfo on Darwin. */
-# define WEAK_IMPORT_NL_LANGINFO
+# define WEAK_IMPORT_NL_LANGINFO
extern char *nl_langinfo(nl_item) WEAK_IMPORT_ATTRIBUTE;
-# endif
+# endif
# endif
#endif
#include <sys/resource.h>
@@ -31,53 +33,49 @@
#endif
#ifdef __CYGWIN__
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef __clang__
-#pragma clang diagnostic ignored "-Wignored-attributes"
-#endif
DLLIMPORT extern __stdcall unsigned char GetVersionExW(void *);
-DLLIMPORT extern __stdcall void *GetModuleHandleW(const void *);
+DLLIMPORT extern __stdcall void *LoadLibraryW(const void *);
DLLIMPORT extern __stdcall void FreeLibrary(void *);
DLLIMPORT extern __stdcall void *GetProcAddress(void *, const char *);
DLLIMPORT extern __stdcall void GetSystemInfo(void *);
-#ifdef __cplusplus
-}
-#endif
-#define NUMPROCESSORS 15
-static const char *const processors[NUMPROCESSORS] = {
- "i686", "mips", "alpha", "ppc", "shx", "arm", "ia64", "alpha64", "msil",
- "x86_64", "ia32_on_win64", "neutral", "arm64", "arm32_on_win64", "ia32_on_arm64"
+#define NUMPLATFORMS 4
+static const char *const platforms[NUMPLATFORMS] = {
+ "Win32s", "Windows 95", "Windows NT", "Windows CE"
+};
+
+#define NUMPROCESSORS 11
+static const char *const processors[NUMPROCESSORS] = {
+ "intel", "mips", "alpha", "ppc", "shx", "arm", "ia64", "alpha64", "msil",
+ "amd64", "ia32_on_win64"
};
-typedef struct {
- union {
- unsigned int dwOemId;
- struct {
- int wProcessorArchitecture;
- int wReserved;
- };
+typedef struct _SYSTEM_INFO {
+ union {
+ DWORD dwOemId;
+ struct {
+ int wProcessorArchitecture;
+ int wReserved;
};
- unsigned int dwPageSize;
- void *lpMinimumApplicationAddress;
- void *lpMaximumApplicationAddress;
- void *dwActiveProcessorMask;
- unsigned int dwNumberOfProcessors;
- unsigned int dwProcessorType;
- unsigned int dwAllocationGranularity;
- int wProcessorLevel;
- int wProcessorRevision;
+ };
+ DWORD dwPageSize;
+ void *lpMinimumApplicationAddress;
+ void *lpMaximumApplicationAddress;
+ void *dwActiveProcessorMask;
+ DWORD dwNumberOfProcessors;
+ DWORD dwProcessorType;
+ DWORD dwAllocationGranularity;
+ int wProcessorLevel;
+ int wProcessorRevision;
} SYSTEM_INFO;
-typedef struct {
- unsigned int dwOSVersionInfoSize;
- unsigned int dwMajorVersion;
- unsigned int dwMinorVersion;
- unsigned int dwBuildNumber;
- unsigned int dwPlatformId;
- wchar_t szCSDVersion[128];
+typedef struct _OSVERSIONINFOW {
+ DWORD dwOSVersionInfoSize;
+ DWORD dwMajorVersion;
+ DWORD dwMinorVersion;
+ DWORD dwBuildNumber;
+ DWORD dwPlatformId;
+ wchar_t szCSDVersion[128];
} OSVERSIONINFOW;
#endif
@@ -86,6 +84,64 @@ typedef struct {
#endif
/*
+ * Define TCL_NO_STACK_CHECK in the compiler options if you want to revert to
+ * the old behavior of never checking the stack.
+ */
+
+/*
+ * Define this if you want to see a lot of output regarding stack checking.
+ */
+
+#undef TCL_DEBUG_STACK_CHECK
+
+/*
+ * Values used to compute how much space is really available for Tcl's use for
+ * the stack.
+ *
+ * The getrlimit() function is documented to return the maximum stack size in
+ * bytes. However, with threads enabled, the pthread library on some platforms
+ * does bad things to the stack size limits. First, the limits cannot be
+ * changed. Second, they appear to be sometimes reported incorrectly.
+ *
+ * The defines below may need to be adjusted if more platforms have this
+ * broken behavior with threads enabled.
+ */
+
+#ifndef TCL_MAGIC_STACK_DIVISOR
+#define TCL_MAGIC_STACK_DIVISOR 1
+#endif
+#ifndef TCL_RESERVED_STACK_PAGES
+#define TCL_RESERVED_STACK_PAGES 8
+#endif
+
+/*
+ * Thread specific data for stack checking.
+ */
+
+#ifndef TCL_NO_STACK_CHECK
+typedef struct ThreadSpecificData {
+ int *outerVarPtr; /* The "outermost" stack frame pointer for
+ * this thread. */
+ int *stackBound; /* The current stack boundary */
+} ThreadSpecificData;
+static Tcl_ThreadDataKey dataKey;
+#ifdef TCL_CROSS_COMPILE
+static int stackGrowsDown = -1;
+static int StackGrowsDown(int *parent);
+#elif defined(TCL_STACK_GROWS_UP)
+#define stackGrowsDown 0
+#else
+#define stackGrowsDown 1
+#endif
+#endif /* TCL_NO_STACK_CHECK */
+
+#ifdef TCL_DEBUG_STACK_CHECK
+#define STACK_DEBUG(args) printf args
+#else
+#define STACK_DEBUG(args) (void)0
+#endif /* TCL_DEBUG_STACK_CHECK */
+
+/*
* Tcl tries to use standard and homebrew methods to guess the right encoding
* on the platform. However, there is always a final fallback, and this value
* is it. Make sure it is a real Tcl encoding.
@@ -100,7 +156,7 @@ typedef struct {
* defined by Makefile.
*/
-static const char defaultLibraryDir[] = TCL_LIBRARY;
+static char defaultLibraryDir[sizeof(TCL_LIBRARY)+200] = TCL_LIBRARY;
/*
* Directory in which to look for packages (each package is typically
@@ -108,7 +164,7 @@ static const char defaultLibraryDir[] = TCL_LIBRARY;
* Makefile.
*/
-static const char pkgPath[] = TCL_PACKAGE_PATH;
+static char pkgPath[sizeof(TCL_PACKAGE_PATH)+200] = TCL_PACKAGE_PATH;
/*
* The following table is used to map from Unix locale strings to encoding
@@ -117,9 +173,9 @@ static const char pkgPath[] = TCL_PACKAGE_PATH;
* first list checked for a mapping from env encoding to Tcl encoding name.
*/
-typedef struct {
- const char *lang;
- const char *encoding;
+typedef struct LocaleTable {
+ CONST char *lang;
+ CONST char *encoding;
} LocaleTable;
/*
@@ -132,10 +188,10 @@ typedef struct {
* among existing platforms.
*/
-static const LocaleTable localeTable[] = {
- {"", "iso8859-1"},
- {"ansi-1251", "cp1251"},
- {"ansi_x3.4-1968", "iso8859-1"},
+static CONST LocaleTable localeTable[] = {
+ {"", "iso8859-1"},
+ {"ansi-1251", "cp1251"},
+ {"ansi_x3.4-1968", "iso8859-1"},
{"ascii", "ascii"},
{"big5", "big5"},
{"cp1250", "cp1250"},
@@ -172,61 +228,61 @@ static const LocaleTable localeTable[] = {
{"euc-cn", "euc-cn"},
{"euc-jp", "euc-jp"},
{"euc-kr", "euc-kr"},
- {"eucjp", "euc-jp"},
- {"euckr", "euc-kr"},
- {"euctw", "euc-cn"},
+ {"eucjp", "euc-jp"},
+ {"euckr", "euc-kr"},
+ {"euctw", "euc-cn"},
{"gb12345", "gb12345"},
{"gb1988", "gb1988"},
{"gb2312", "gb2312"},
- {"gb2312-1980", "gb2312"},
+ {"gb2312-1980", "gb2312"},
{"gb2312-raw", "gb2312-raw"},
- {"greek8", "cp869"},
- {"ibm1250", "cp1250"},
- {"ibm1251", "cp1251"},
- {"ibm1252", "cp1252"},
- {"ibm1253", "cp1253"},
- {"ibm1254", "cp1254"},
- {"ibm1255", "cp1255"},
- {"ibm1256", "cp1256"},
- {"ibm1257", "cp1257"},
- {"ibm1258", "cp1258"},
- {"ibm437", "cp437"},
- {"ibm737", "cp737"},
- {"ibm775", "cp775"},
- {"ibm850", "cp850"},
- {"ibm852", "cp852"},
- {"ibm855", "cp855"},
- {"ibm857", "cp857"},
- {"ibm860", "cp860"},
- {"ibm861", "cp861"},
- {"ibm862", "cp862"},
- {"ibm863", "cp863"},
- {"ibm864", "cp864"},
- {"ibm865", "cp865"},
- {"ibm866", "cp866"},
- {"ibm869", "cp869"},
- {"ibm874", "cp874"},
- {"ibm932", "cp932"},
- {"ibm936", "cp936"},
- {"ibm949", "cp949"},
- {"ibm950", "cp950"},
- {"iso-2022", "iso2022"},
- {"iso-2022-jp", "iso2022-jp"},
- {"iso-2022-kr", "iso2022-kr"},
- {"iso-8859-1", "iso8859-1"},
- {"iso-8859-10", "iso8859-10"},
- {"iso-8859-13", "iso8859-13"},
- {"iso-8859-14", "iso8859-14"},
- {"iso-8859-15", "iso8859-15"},
- {"iso-8859-16", "iso8859-16"},
- {"iso-8859-2", "iso8859-2"},
- {"iso-8859-3", "iso8859-3"},
- {"iso-8859-4", "iso8859-4"},
- {"iso-8859-5", "iso8859-5"},
- {"iso-8859-6", "iso8859-6"},
- {"iso-8859-7", "iso8859-7"},
- {"iso-8859-8", "iso8859-8"},
- {"iso-8859-9", "iso8859-9"},
+ {"greek8", "cp869"},
+ {"ibm1250", "cp1250"},
+ {"ibm1251", "cp1251"},
+ {"ibm1252", "cp1252"},
+ {"ibm1253", "cp1253"},
+ {"ibm1254", "cp1254"},
+ {"ibm1255", "cp1255"},
+ {"ibm1256", "cp1256"},
+ {"ibm1257", "cp1257"},
+ {"ibm1258", "cp1258"},
+ {"ibm437", "cp437"},
+ {"ibm737", "cp737"},
+ {"ibm775", "cp775"},
+ {"ibm850", "cp850"},
+ {"ibm852", "cp852"},
+ {"ibm855", "cp855"},
+ {"ibm857", "cp857"},
+ {"ibm860", "cp860"},
+ {"ibm861", "cp861"},
+ {"ibm862", "cp862"},
+ {"ibm863", "cp863"},
+ {"ibm864", "cp864"},
+ {"ibm865", "cp865"},
+ {"ibm866", "cp866"},
+ {"ibm869", "cp869"},
+ {"ibm874", "cp874"},
+ {"ibm932", "cp932"},
+ {"ibm936", "cp936"},
+ {"ibm949", "cp949"},
+ {"ibm950", "cp950"},
+ {"iso-2022", "iso2022"},
+ {"iso-2022-jp", "iso2022-jp"},
+ {"iso-2022-kr", "iso2022-kr"},
+ {"iso-8859-1", "iso8859-1"},
+ {"iso-8859-10", "iso8859-10"},
+ {"iso-8859-13", "iso8859-13"},
+ {"iso-8859-14", "iso8859-14"},
+ {"iso-8859-15", "iso8859-15"},
+ {"iso-8859-16", "iso8859-16"},
+ {"iso-8859-2", "iso8859-2"},
+ {"iso-8859-3", "iso8859-3"},
+ {"iso-8859-4", "iso8859-4"},
+ {"iso-8859-5", "iso8859-5"},
+ {"iso-8859-6", "iso8859-6"},
+ {"iso-8859-7", "iso8859-7"},
+ {"iso-8859-8", "iso8859-8"},
+ {"iso-8859-9", "iso8859-9"},
{"iso2022", "iso2022"},
{"iso2022-jp", "iso2022-jp"},
{"iso2022-kr", "iso2022-kr"},
@@ -244,47 +300,47 @@ static const LocaleTable localeTable[] = {
{"iso8859-7", "iso8859-7"},
{"iso8859-8", "iso8859-8"},
{"iso8859-9", "iso8859-9"},
- {"iso88591", "iso8859-1"},
- {"iso885915", "iso8859-15"},
- {"iso88592", "iso8859-2"},
- {"iso88595", "iso8859-5"},
- {"iso88596", "iso8859-6"},
- {"iso88597", "iso8859-7"},
- {"iso88598", "iso8859-8"},
- {"iso88599", "iso8859-9"},
+ {"iso88591", "iso8859-1"},
+ {"iso885915", "iso8859-15"},
+ {"iso88592", "iso8859-2"},
+ {"iso88595", "iso8859-5"},
+ {"iso88596", "iso8859-6"},
+ {"iso88597", "iso8859-7"},
+ {"iso88598", "iso8859-8"},
+ {"iso88599", "iso8859-9"},
#ifdef hpux
- {"ja", "shiftjis"},
+ {"ja", "shiftjis"},
#else
- {"ja", "euc-jp"},
+ {"ja", "euc-jp"},
#endif
- {"ja_jp", "euc-jp"},
- {"ja_jp.euc", "euc-jp"},
- {"ja_jp.eucjp", "euc-jp"},
- {"ja_jp.jis", "iso2022-jp"},
- {"ja_jp.mscode", "shiftjis"},
- {"ja_jp.sjis", "shiftjis"},
- {"ja_jp.ujis", "euc-jp"},
- {"japan", "euc-jp"},
+ {"ja_jp", "euc-jp"},
+ {"ja_jp.euc", "euc-jp"},
+ {"ja_jp.eucjp", "euc-jp"},
+ {"ja_jp.jis", "iso2022-jp"},
+ {"ja_jp.mscode", "shiftjis"},
+ {"ja_jp.sjis", "shiftjis"},
+ {"ja_jp.ujis", "euc-jp"},
+ {"japan", "euc-jp"},
#ifdef hpux
- {"japanese", "shiftjis"},
+ {"japanese", "shiftjis"},
#else
- {"japanese", "euc-jp"},
+ {"japanese", "euc-jp"},
#endif
- {"japanese-sjis", "shiftjis"},
- {"japanese-ujis", "euc-jp"},
- {"japanese.euc", "euc-jp"},
- {"japanese.sjis", "shiftjis"},
+ {"japanese-sjis", "shiftjis"},
+ {"japanese-ujis", "euc-jp"},
+ {"japanese.euc", "euc-jp"},
+ {"japanese.sjis", "shiftjis"},
{"jis0201", "jis0201"},
{"jis0208", "jis0208"},
{"jis0212", "jis0212"},
- {"jp_jp", "shiftjis"},
- {"ko", "euc-kr"},
- {"ko_kr", "euc-kr"},
- {"ko_kr.euc", "euc-kr"},
- {"ko_kw.euckw", "euc-kr"},
+ {"jp_jp", "shiftjis"},
+ {"ko", "euc-kr"},
+ {"ko_kr", "euc-kr"},
+ {"ko_kr.euc", "euc-kr"},
+ {"ko_kw.euckw", "euc-kr"},
{"koi8-r", "koi8-r"},
{"koi8-u", "koi8-u"},
- {"korean", "euc-kr"},
+ {"korean", "euc-kr"},
{"ksc5601", "ksc5601"},
{"maccenteuro", "macCentEuro"},
{"maccroatian", "macCroatian"},
@@ -298,32 +354,35 @@ static const LocaleTable localeTable[] = {
{"macthai", "macThai"},
{"macturkish", "macTurkish"},
{"macukraine", "macUkraine"},
- {"roman8", "iso8859-1"},
- {"ru", "iso8859-5"},
- {"ru_ru", "iso8859-5"},
- {"ru_su", "iso8859-5"},
+ {"roman8", "iso8859-1"},
+ {"ru", "iso8859-5"},
+ {"ru_ru", "iso8859-5"},
+ {"ru_su", "iso8859-5"},
{"shiftjis", "shiftjis"},
- {"sjis", "shiftjis"},
+ {"sjis", "shiftjis"},
{"symbol", "symbol"},
{"tis-620", "tis-620"},
- {"tis620", "tis-620"},
- {"turkish8", "cp857"},
- {"utf8", "utf-8"},
- {"zh", "cp936"},
- {"zh_cn.gb2312", "euc-cn"},
- {"zh_cn.gbk", "euc-cn"},
- {"zh_cz.gb2312", "euc-cn"},
- {"zh_tw", "euc-tw"},
- {"zh_tw.big5", "big5"},
+ {"tis620", "tis-620"},
+ {"turkish8", "cp857"},
+ {"utf8", "utf-8"},
+ {"zh", "cp936"},
+ {"zh_cn.gb2312", "euc-cn"},
+ {"zh_cn.gbk", "euc-cn"},
+ {"zh_cz.gb2312", "euc-cn"},
+ {"zh_tw", "euc-tw"},
+ {"zh_tw.big5", "big5"},
};
+#ifndef TCL_NO_STACK_CHECK
+static int GetStackSize(size_t *stackSizePtr);
+#endif /* TCL_NO_STACK_CHECK */
#ifdef HAVE_COREFOUNDATION
static int MacOSXGetLibraryPath(Tcl_Interp *interp,
int maxPathLen, char *tclLibPath);
#endif /* HAVE_COREFOUNDATION */
#if defined(__APPLE__) && (defined(TCL_LOAD_FROM_MEMORY) || ( \
defined(MAC_OS_X_VERSION_MIN_REQUIRED) && ( \
- (TCL_THREADS && MAC_OS_X_VERSION_MIN_REQUIRED < 1030) || \
+ (defined(TCL_THREADS) && MAC_OS_X_VERSION_MIN_REQUIRED < 1030) || \
(defined(__LP64__) && MAC_OS_X_VERSION_MIN_REQUIRED < 1050) || \
(defined(HAVE_COREFOUNDATION) && MAC_OS_X_VERSION_MIN_REQUIRED < 1050)\
)))
@@ -342,7 +401,7 @@ long tclMacOSXDarwinRelease = 0;
*
* TclpInitPlatform --
*
- * Initialize all the platform-dependent things like signals and
+ * Initialize all the platform-dependant things like signals and
* floating-point error handling.
*
* Called at process initialization time.
@@ -369,13 +428,13 @@ TclpInitPlatform(void)
* Make sure, that the standard FDs exist. [Bug 772288]
*/
- if (TclOSseek(0, 0, SEEK_CUR) == -1 && errno == EBADF) {
+ if (TclOSseek(0, (Tcl_SeekOffset) 0, SEEK_CUR) == -1 && errno == EBADF) {
open("/dev/null", O_RDONLY);
}
- if (TclOSseek(1, 0, SEEK_CUR) == -1 && errno == EBADF) {
+ if (TclOSseek(1, (Tcl_SeekOffset) 0, SEEK_CUR) == -1 && errno == EBADF) {
open("/dev/null", O_WRONLY);
}
- if (TclOSseek(2, 0, SEEK_CUR) == -1 && errno == EBADF) {
+ if (TclOSseek(2, (Tcl_SeekOffset) 0, SEEK_CUR) == -1 && errno == EBADF) {
open("/dev/null", O_WRONLY);
}
@@ -393,6 +452,14 @@ TclpInitPlatform(void)
#endif /* SIGPIPE */
#if defined(__FreeBSD__) && defined(__GNUC__)
+ /*
+ * Adjust the rounding mode to be more conventional. Note that FreeBSD
+ * only provides the __fpsetreg() used by the following two for the GNU
+ * Compiler. When using, say, Intel's icc they break. (Partially based on
+ * patch in BSD ports system from root@celsius.bychok.com)
+ */
+
+ fpsetround(FP_RN);
(void) fpsetmask(0L);
#endif
@@ -418,7 +485,7 @@ TclpInitPlatform(void)
/*
* In case the initial locale is not "C", ensure that the numeric
* processing is done in "C" locale regardless. This is needed because Tcl
- * relies on routines like strtol/strtoul, but should not have locale dependent
+ * relies on routines like strtod, but should not have locale dependent
* behavior.
*/
@@ -455,31 +522,31 @@ TclpInitPlatform(void)
void
TclpInitLibraryPath(
char **valuePtr,
- unsigned int *lengthPtr,
+ int *lengthPtr,
Tcl_Encoding *encodingPtr)
{
#define LIBRARY_SIZE 32
Tcl_Obj *pathPtr, *objPtr;
- const char *str;
+ CONST char *str;
Tcl_DString buffer;
- TclNewObj(pathPtr);
+ pathPtr = Tcl_NewObj();
/*
* Look for the library relative to the TCL_LIBRARY env variable. If the
* last dirname in the TCL_LIBRARY path does not match the last dirname in
* the installLib variable, use the last dir name of installLib in
- * addition to the original TCL_LIBRARY path.
+ * addition to the orginal TCL_LIBRARY path.
*/
str = getenv("TCL_LIBRARY"); /* INTL: Native. */
- Tcl_ExternalToUtfDString(NULL, str, TCL_INDEX_NONE, &buffer);
+ Tcl_ExternalToUtfDString(NULL, str, -1, &buffer);
str = Tcl_DStringValue(&buffer);
if ((str != NULL) && (str[0] != '\0')) {
Tcl_DString ds;
int pathc;
- const char **pathv;
+ CONST char **pathv;
char installLib[LIBRARY_SIZE];
Tcl_DStringInit(&ds);
@@ -490,13 +557,14 @@ TclpInitLibraryPath(
* installed.
*/
- snprintf(installLib, sizeof(installLib), "lib/tcl%s", TCL_VERSION);
+ sprintf(installLib, "lib/tcl%s", TCL_VERSION);
/*
* If TCL_LIBRARY is set, search there.
*/
- Tcl_ListObjAppendElement(NULL, pathPtr, Tcl_NewStringObj(str, TCL_INDEX_NONE));
+ objPtr = Tcl_NewStringObj(str, -1);
+ Tcl_ListObjAppendElement(NULL, pathPtr, objPtr);
Tcl_SplitPath(str, &pathc, &pathv);
if ((pathc > 0) && (strcasecmp(installLib + 4, pathv[pathc-1]) != 0)) {
@@ -510,9 +578,11 @@ TclpInitLibraryPath(
pathv[pathc - 1] = installLib + 4;
str = Tcl_JoinPath(pathc, pathv, &ds);
- Tcl_ListObjAppendElement(NULL, pathPtr, Tcl_DStringToObj(&ds));
+ objPtr = Tcl_NewStringObj(str, Tcl_DStringLength(&ds));
+ Tcl_ListObjAppendElement(NULL, pathPtr, objPtr);
+ Tcl_DStringFree(&ds);
}
- ckfree(pathv);
+ ckfree((char *) pathv);
}
/*
@@ -537,17 +607,16 @@ TclpInitLibraryPath(
str = defaultLibraryDir;
}
if (str[0] != '\0') {
- objPtr = Tcl_NewStringObj(str, TCL_INDEX_NONE);
+ objPtr = Tcl_NewStringObj(str, -1);
Tcl_ListObjAppendElement(NULL, pathPtr, objPtr);
}
}
Tcl_DStringFree(&buffer);
*encodingPtr = Tcl_GetEncoding(NULL, NULL);
- str = TclGetString(pathPtr);
- *lengthPtr = pathPtr->length;
- *valuePtr = (char *)ckalloc(*lengthPtr + 1);
- memcpy(*valuePtr, str, *lengthPtr + 1);
+ str = Tcl_GetStringFromObj(pathPtr, lengthPtr);
+ *valuePtr = ckalloc((unsigned int) (*lengthPtr)+1);
+ memcpy(*valuePtr, str, (size_t)(*lengthPtr)+1);
Tcl_DecrRefCount(pathPtr);
}
@@ -584,14 +653,20 @@ TclpSetInitialEncodings(void)
Tcl_DStringFree(&encodingName);
}
-static const char *
+void
+TclpSetInterfaces(void)
+{
+ /* do nothing */
+}
+
+static CONST char *
SearchKnownEncodings(
- const char *encoding)
+ CONST char *encoding)
{
int left = 0;
int right = sizeof(localeTable)/sizeof(LocaleTable);
- while (left < right) {
+ while (left <= right) {
int test = (left + right)/2;
int code = strcmp(localeTable[test].lang, encoding);
@@ -607,12 +682,12 @@ SearchKnownEncodings(
return NULL;
}
-const char *
+CONST char *
Tcl_GetEncodingNameFromEnvironment(
Tcl_DString *bufPtr)
{
- const char *encoding;
- const char *knownEncoding;
+ CONST char *encoding;
+ CONST char *knownEncoding;
Tcl_DStringInit(bufPtr);
@@ -635,13 +710,13 @@ Tcl_GetEncodingNameFromEnvironment(
*/
Tcl_DStringInit(&ds);
- encoding = Tcl_DStringAppend(&ds, nl_langinfo(CODESET), TCL_INDEX_NONE);
+ encoding = Tcl_DStringAppend(&ds, nl_langinfo(CODESET), -1);
Tcl_UtfToLower(Tcl_DStringValue(&ds));
knownEncoding = SearchKnownEncodings(encoding);
if (knownEncoding != NULL) {
- Tcl_DStringAppend(bufPtr, knownEncoding, TCL_INDEX_NONE);
+ Tcl_DStringAppend(bufPtr, knownEncoding, -1);
} else if (NULL != Tcl_GetEncoding(NULL, encoding)) {
- Tcl_DStringAppend(bufPtr, encoding, TCL_INDEX_NONE);
+ Tcl_DStringAppend(bufPtr, encoding, -1);
}
Tcl_DStringFree(&ds);
if (Tcl_DStringLength(bufPtr)) {
@@ -668,19 +743,19 @@ Tcl_GetEncodingNameFromEnvironment(
}
if (encoding != NULL) {
- const char *p;
+ CONST char *p;
Tcl_DString ds;
Tcl_DStringInit(&ds);
p = encoding;
- encoding = Tcl_DStringAppend(&ds, p, TCL_INDEX_NONE);
+ encoding = Tcl_DStringAppend(&ds, p, -1);
Tcl_UtfToLower(Tcl_DStringValue(&ds));
knownEncoding = SearchKnownEncodings(encoding);
if (knownEncoding != NULL) {
- Tcl_DStringAppend(bufPtr, knownEncoding, TCL_INDEX_NONE);
+ Tcl_DStringAppend(bufPtr, knownEncoding, -1);
} else if (NULL != Tcl_GetEncoding(NULL, encoding)) {
- Tcl_DStringAppend(bufPtr, encoding, TCL_INDEX_NONE);
+ Tcl_DStringAppend(bufPtr, encoding, -1);
}
if (Tcl_DStringLength(bufPtr)) {
Tcl_DStringFree(&ds);
@@ -701,9 +776,9 @@ Tcl_GetEncodingNameFromEnvironment(
if (*p != '\0') {
knownEncoding = SearchKnownEncodings(p);
if (knownEncoding != NULL) {
- Tcl_DStringAppend(bufPtr, knownEncoding, TCL_INDEX_NONE);
+ Tcl_DStringAppend(bufPtr, knownEncoding, -1);
} else if (NULL != Tcl_GetEncoding(NULL, p)) {
- Tcl_DStringAppend(bufPtr, p, TCL_INDEX_NONE);
+ Tcl_DStringAppend(bufPtr, p, -1);
}
}
Tcl_DStringFree(&ds);
@@ -711,7 +786,7 @@ Tcl_GetEncodingNameFromEnvironment(
return Tcl_DStringValue(bufPtr);
}
}
- return Tcl_DStringAppend(bufPtr, TCL_DEFAULT_ENCODING, TCL_INDEX_NONE);
+ return Tcl_DStringAppend(bufPtr, TCL_DEFAULT_ENCODING, -1);
}
/*
@@ -733,43 +808,6 @@ Tcl_GetEncodingNameFromEnvironment(
*----------------------------------------------------------------------
*/
-#if defined(HAVE_COREFOUNDATION) && MAC_OS_X_VERSION_MAX_ALLOWED > 1020
-/*
- * Helper because whether CFLocaleCopyCurrent and CFLocaleGetIdentifier are
- * strongly or weakly bound varies by version of OSX, triggering warnings.
- */
-
-static inline void
-InitMacLocaleInfoVar(
- CFLocaleRef (*localeCopyCurrent)(void),
- CFStringRef (*localeGetIdentifier)(CFLocaleRef),
- Tcl_Interp *interp)
-{
- CFLocaleRef localeRef;
- CFStringRef locale;
- char loc[256];
-
- if (localeCopyCurrent == NULL || localeGetIdentifier == NULL) {
- return;
- }
-
- localeRef = localeCopyCurrent();
- if (!localeRef) {
- return;
- }
-
- locale = localeGetIdentifier(localeRef);
- if (locale && CFStringGetCString(locale, loc, 256,
- kCFStringEncodingUTF8)) {
- if (!Tcl_CreateNamespace(interp, "::tcl::mac", NULL, NULL)) {
- Tcl_ResetResult(interp);
- }
- Tcl_SetVar2(interp, "::tcl::mac::locale", NULL, loc, TCL_GLOBAL_ONLY);
- }
- CFRelease(localeRef);
-}
-#endif /*defined(HAVE_COREFOUNDATION) && MAC_OS_X_VERSION_MAX_ALLOWED > 1020*/
-
void
TclpSetVariables(
Tcl_Interp *interp)
@@ -783,37 +821,62 @@ TclpSetVariables(
struct utsname name;
#endif
int unameOK;
- const char *p, *q;
- Tcl_Obj *pkgListObj = Tcl_NewObj();
+ Tcl_DString ds;
#ifdef HAVE_COREFOUNDATION
char tclLibPath[MAXPATHLEN + 1];
+#if MAC_OS_X_VERSION_MAX_ALLOWED > 1020
/*
* Set msgcat fallback locale to current CFLocale identifier.
*/
-#if MAC_OS_X_VERSION_MAX_ALLOWED > 1020
- InitMacLocaleInfoVar(CFLocaleCopyCurrent, CFLocaleGetIdentifier, interp);
+ CFLocaleRef localeRef;
+
+ if (CFLocaleCopyCurrent != NULL && CFLocaleGetIdentifier != NULL &&
+ (localeRef = CFLocaleCopyCurrent())) {
+ CFStringRef locale = CFLocaleGetIdentifier(localeRef);
+
+ if (locale) {
+ char loc[256];
+
+ if (CFStringGetCString(locale, loc, 256, kCFStringEncodingUTF8)) {
+ if (!Tcl_CreateNamespace(interp, "::tcl::mac", NULL, NULL)) {
+ Tcl_ResetResult(interp);
+ }
+ Tcl_SetVar(interp, "::tcl::mac::locale", loc, TCL_GLOBAL_ONLY);
+ }
+ }
+ CFRelease(localeRef);
+ }
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED > 1020 */
if (MacOSXGetLibraryPath(interp, MAXPATHLEN, tclLibPath) == TCL_OK) {
- const char *str;
+ CONST char *str;
CFBundleRef bundleRef;
- Tcl_DString ds;
- Tcl_SetVar2(interp, "tclDefaultLibrary", NULL, tclLibPath, TCL_GLOBAL_ONLY);
- Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(tclLibPath, -1));
+ Tcl_SetVar(interp, "tclDefaultLibrary", tclLibPath, TCL_GLOBAL_ONLY);
+ Tcl_SetVar(interp, "tcl_pkgPath", tclLibPath, TCL_GLOBAL_ONLY);
+ Tcl_SetVar(interp, "tcl_pkgPath", " ",
+ TCL_GLOBAL_ONLY | TCL_APPEND_VALUE);
+
str = TclGetEnv("DYLD_FRAMEWORK_PATH", &ds);
if ((str != NULL) && (str[0] != '\0')) {
- p = Tcl_DStringValue(&ds);
- while ((q = strchr(p, ':')) != NULL) {
- Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(p, q-p));
- p = q+1;
- }
- if (*p) {
- Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(p, -1));
- }
+ char *p = Tcl_DStringValue(&ds);
+
+ /*
+ * Convert DYLD_FRAMEWORK_PATH from colon to space separated.
+ */
+
+ do {
+ if (*p == ':') {
+ *p = ' ';
+ }
+ } while (*p++);
+ Tcl_SetVar(interp, "tcl_pkgPath", Tcl_DStringValue(&ds),
+ TCL_GLOBAL_ONLY | TCL_APPEND_VALUE);
+ Tcl_SetVar(interp, "tcl_pkgPath", " ",
+ TCL_GLOBAL_ONLY | TCL_APPEND_VALUE);
Tcl_DStringFree(&ds);
}
bundleRef = CFBundleGetMainBundle();
@@ -827,7 +890,10 @@ TclpSetVariables(
(unsigned char*) tclLibPath, MAXPATHLEN) &&
! TclOSstat(tclLibPath, &statBuf) &&
S_ISDIR(statBuf.st_mode)) {
- Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(tclLibPath, -1));
+ Tcl_SetVar(interp, "tcl_pkgPath", tclLibPath,
+ TCL_GLOBAL_ONLY | TCL_APPEND_VALUE);
+ Tcl_SetVar(interp, "tcl_pkgPath", " ",
+ TCL_GLOBAL_ONLY | TCL_APPEND_VALUE);
}
CFRelease(frameworksURL);
}
@@ -837,22 +903,21 @@ TclpSetVariables(
(unsigned char*) tclLibPath, MAXPATHLEN) &&
! TclOSstat(tclLibPath, &statBuf) &&
S_ISDIR(statBuf.st_mode)) {
- Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(tclLibPath, -1));
+ Tcl_SetVar(interp, "tcl_pkgPath", tclLibPath,
+ TCL_GLOBAL_ONLY | TCL_APPEND_VALUE);
+ Tcl_SetVar(interp, "tcl_pkgPath", " ",
+ TCL_GLOBAL_ONLY | TCL_APPEND_VALUE);
}
CFRelease(frameworksURL);
}
}
- }
+ Tcl_SetVar(interp, "tcl_pkgPath", pkgPath,
+ TCL_GLOBAL_ONLY | TCL_APPEND_VALUE);
+ } else
#endif /* HAVE_COREFOUNDATION */
- p = pkgPath;
- while ((q = strchr(p, ':')) != NULL) {
- Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(p, q-p));
- p = q+1;
- }
- if (*p) {
- Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(p, -1));
+ {
+ Tcl_SetVar(interp, "tcl_pkgPath", pkgPath, TCL_GLOBAL_ONLY);
}
- Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_pkgPath", -1), NULL, pkgListObj, TCL_GLOBAL_ONLY);
#ifdef DJGPP
Tcl_SetVar2(interp, "tcl_platform", "platform", "dos", TCL_GLOBAL_ONLY);
@@ -864,23 +929,26 @@ TclpSetVariables(
#ifdef __CYGWIN__
unameOK = 1;
if (!osInfoInitialized) {
- void *handle = GetModuleHandleW(L"NTDLL");
+ HANDLE handle = LoadLibraryW(L"NTDLL");
int(__stdcall *getversion)(void *) =
(int(__stdcall *)(void *))GetProcAddress(handle, "RtlGetVersion");
osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
if (!getversion || getversion(&osInfo)) {
GetVersionExW(&osInfo);
}
+ if (handle) {
+ FreeLibrary(handle);
+ }
osInfoInitialized = 1;
}
GetSystemInfo(&sysInfo);
- if (osInfo.dwMajorVersion == 10 && osInfo.dwBuildNumber >= 22000) {
- osInfo.dwMajorVersion = 11;
+ if (osInfo.dwPlatformId < NUMPLATFORMS) {
+ Tcl_SetVar2(interp, "tcl_platform", "os",
+ platforms[osInfo.dwPlatformId], TCL_GLOBAL_ONLY);
}
- Tcl_SetVar2(interp, "tcl_platform", "os", "Windows NT", TCL_GLOBAL_ONLY);
- snprintf(buffer, sizeof(buffer), "%d.%d", osInfo.dwMajorVersion, osInfo.dwMinorVersion);
+ sprintf(buffer, "%d.%d", osInfo.dwMajorVersion, osInfo.dwMinorVersion);
Tcl_SetVar2(interp, "tcl_platform", "osVersion", buffer, TCL_GLOBAL_ONLY);
if (sysInfo.wProcessorArchitecture < NUMPROCESSORS) {
Tcl_SetVar2(interp, "tcl_platform", "machine",
@@ -890,12 +958,11 @@ TclpSetVariables(
#elif !defined NO_UNAME
if (uname(&name) >= 0) {
- const char *native;
- Tcl_DString ds;
+ CONST char *native;
unameOK = 1;
- native = Tcl_ExternalToUtfDString(NULL, name.sysname, TCL_INDEX_NONE, &ds);
+ native = Tcl_ExternalToUtfDString(NULL, name.sysname, -1, &ds);
Tcl_SetVar2(interp, "tcl_platform", "os", native, TCL_GLOBAL_ONLY);
Tcl_DStringFree(&ds);
@@ -953,24 +1020,17 @@ TclpSetVariables(
{
struct passwd *pwEnt = TclpGetPwUid(getuid());
const char *user;
- Tcl_DString ds;
if (pwEnt == NULL) {
user = "";
Tcl_DStringInit(&ds); /* ensure cleanliness */
} else {
- user = Tcl_ExternalToUtfDString(NULL, pwEnt->pw_name, TCL_INDEX_NONE, &ds);
+ user = Tcl_ExternalToUtfDString(NULL, pwEnt->pw_name, -1, &ds);
}
Tcl_SetVar2(interp, "tcl_platform", "user", user, TCL_GLOBAL_ONLY);
Tcl_DStringFree(&ds);
}
-
- /*
- * Define what the platform PATH separator is. [TIP #315]
- */
-
- Tcl_SetVar2(interp, "tcl_platform","pathSeparator", ":", TCL_GLOBAL_ONLY);
}
/*
@@ -979,7 +1039,7 @@ TclpSetVariables(
* TclpFindVariable --
*
* Locate the entry in environ for a given name. On Unix this routine is
- * case sensitive, on Windows this matches mixed case.
+ * case sensetive, on Windows this matches mixed case.
*
* Results:
* The return value is the index in environ of an entry with the name
@@ -995,7 +1055,7 @@ TclpSetVariables(
int
TclpFindVariable(
- const char *name, /* Name of desired environment variable
+ CONST char *name, /* Name of desired environment variable
* (native). */
int *lengthPtr) /* Used to return length of name (for
* successful searches) or number of non-NULL
@@ -1003,12 +1063,12 @@ TclpFindVariable(
* searches). */
{
int i, result = -1;
- const char *env, *p1, *p2;
+ register CONST char *env, *p1, *p2;
Tcl_DString envString;
Tcl_DStringInit(&envString);
for (i = 0, env = environ[i]; env != NULL; i++, env = environ[i]) {
- p1 = Tcl_ExternalToUtfDString(NULL, env, TCL_INDEX_NONE, &envString);
+ p1 = Tcl_ExternalToUtfDString(NULL, env, -1, &envString);
p2 = name;
for (; *p2 == *p1; p1++, p2++) {
@@ -1030,6 +1090,216 @@ TclpFindVariable(
return result;
}
+#ifndef TCL_NO_STACK_CHECK
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclpGetCStackParams --
+ *
+ * Determine the stack params for the current thread: in which
+ * direction does the stack grow, and what is the stack lower (resp.
+ * upper) bound for safe invocation of a new command? This is used to
+ * cache the values needed for an efficient computation of
+ * TclpCheckStackSpace() when the interp is known.
+ *
+ * Results:
+ * Returns 1 if the stack grows down, in which case a stack lower bound
+ * is stored at stackBoundPtr. If the stack grows up, 0 is returned and
+ * an upper bound is stored at stackBoundPtr. If a bound cannot be
+ * determined NULL is stored at stackBoundPtr.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclpGetCStackParams(
+ int **stackBoundPtr)
+{
+ int result = TCL_OK;
+ size_t stackSize = 0; /* The size of the current stack. */
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ /* Most variables are actually in a
+ * thread-specific data block to minimise the
+ * impact on the stack. */
+#ifdef TCL_CROSS_COMPILE
+ if (stackGrowsDown == -1) {
+ /*
+ * Not initialised!
+ */
+
+ stackGrowsDown = StackGrowsDown(NULL);
+ }
+#endif
+
+ /*
+ * The first time through in a thread: record the "outermost" stack
+ * frame and inquire with the OS about the stack size.
+ */
+
+ if (tsdPtr->outerVarPtr == NULL) {
+ tsdPtr->outerVarPtr = &result;
+ result = GetStackSize(&stackSize);
+ if (result != TCL_OK) {
+ /* Can't check, assume it always succeeds */
+#ifdef TCL_CROSS_COMPILE
+ stackGrowsDown = 1;
+#endif
+ tsdPtr->stackBound = NULL;
+ goto done;
+ }
+ }
+
+ if (stackSize || (tsdPtr->stackBound &&
+ ((stackGrowsDown && (&result < tsdPtr->stackBound)) ||
+ (!stackGrowsDown && (&result > tsdPtr->stackBound))))) {
+ /*
+ * Either the thread's first pass or stack failure: set the params
+ */
+
+ if (!stackSize) {
+ /*
+ * Stack failure: if we didn't already blow up, we are within the
+ * safety area. Recheck with the OS in case the stack was grown.
+ */
+ result = GetStackSize(&stackSize);
+ if (result != TCL_OK) {
+ /* Can't check, assume it always succeeds */
+#ifdef TCL_CROSS_COMPILE
+ stackGrowsDown = 1;
+#endif
+ tsdPtr->stackBound = NULL;
+ goto done;
+ }
+ }
+
+ if (stackGrowsDown) {
+ tsdPtr->stackBound = (int *) ((char *)tsdPtr->outerVarPtr -
+ stackSize);
+ if (tsdPtr->stackBound > tsdPtr->outerVarPtr) {
+ /* Overflow, that should never happen, just set it to NULL.
+ * See [Bug #3166410] */
+ tsdPtr->stackBound = NULL;
+ }
+ } else {
+ tsdPtr->stackBound = (int *) ((char *)tsdPtr->outerVarPtr +
+ stackSize);
+ if (tsdPtr->stackBound < tsdPtr->outerVarPtr) {
+ /* Overflow, that should never happen, just set it to NULL.
+ * See [Bug #3166410] */
+ tsdPtr->stackBound = NULL;
+ }
+ }
+ }
+
+ done:
+ *stackBoundPtr = tsdPtr->stackBound;
+ return stackGrowsDown;
+}
+
+#ifdef TCL_CROSS_COMPILE
+int
+StackGrowsDown(
+ int *parent)
+{
+ int here;
+ if (!parent) {
+ return StackGrowsDown(&here);
+ }
+ return (&here < parent);
+}
+#endif
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetStackSize --
+ *
+ * Discover what the stack size for the current thread/process actually
+ * is. Expects to only ever be called once per thread and then only at a
+ * point when there is a reasonable amount of space left on the current
+ * stack; TclpCheckStackSpace is called sufficiently frequently that that
+ * is true.
+ *
+ * Results:
+ * TCL_OK if the stack space was discovered, TCL_BREAK if the stack space
+ * was undiscoverable in a way that stack checks should fail, and
+ * TCL_CONTINUE if the stack space was undiscoverable in a way that stack
+ * checks should succeed.
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+GetStackSize(
+ size_t *stackSizePtr)
+{
+ size_t rawStackSize;
+ struct rlimit rLimit; /* The result from getrlimit(). */
+
+#ifdef TCL_THREADS
+ rawStackSize = TclpThreadGetStackSize();
+ if (rawStackSize == (size_t) -1) {
+ /*
+ * Some kind of confirmed error in TclpThreadGetStackSize?! Fall back
+ * to whatever getrlimit can determine.
+ */
+ STACK_DEBUG(("stack checks: TclpThreadGetStackSize failed in \n"));
+ }
+ if (rawStackSize > 0) {
+ goto finalSanityCheck;
+ }
+
+ /*
+ * If we have zero or an error, try the system limits instead. After all,
+ * the pthread documentation states that threads should always be bound by
+ * the system stack size limit in any case.
+ */
+#endif /* TCL_THREADS */
+
+ if (getrlimit(RLIMIT_STACK, &rLimit) != 0) {
+ /*
+ * getrlimit() failed, just fail the whole thing.
+ */
+ STACK_DEBUG(("skipping stack checks with failure: getrlimit failed\n"));
+ return TCL_BREAK;
+ }
+ if (rLimit.rlim_cur == RLIM_INFINITY) {
+ /*
+ * Limit is "infinite"; there is no stack limit.
+ */
+ STACK_DEBUG(("skipping stack checks with success: infinite limit\n"));
+ return TCL_CONTINUE;
+ }
+ rawStackSize = rLimit.rlim_cur;
+
+ /*
+ * Final sanity check on the determined stack size. If we fail this,
+ * assume there are bogus values about and that we can't actually figure
+ * out what the stack size really is.
+ */
+
+#ifdef TCL_THREADS /* Stop warning... */
+ finalSanityCheck:
+#endif
+ if (rawStackSize <= 0) {
+ STACK_DEBUG(("skipping stack checks with success\n"));
+ return TCL_CONTINUE;
+ }
+
+ /*
+ * Calculate a stack size with a safety margin.
+ */
+
+ *stackSizePtr = (rawStackSize / TCL_MAGIC_STACK_DIVISOR)
+ - (getpagesize() * TCL_RESERVED_STACK_PAGES);
+
+ return TCL_OK;
+}
+#endif /* TCL_NO_STACK_CHECK */
+
/*
*----------------------------------------------------------------------
*
@@ -1048,27 +1318,22 @@ TclpFindVariable(
*/
#ifdef HAVE_COREFOUNDATION
-#ifdef TCL_FRAMEWORK
static int
MacOSXGetLibraryPath(
Tcl_Interp *interp,
int maxPathLen,
char *tclLibPath)
{
- return Tcl_MacOSXOpenVersionedBundleResources(interp,
+ int foundInFramework = TCL_ERROR;
+
+#ifdef TCL_FRAMEWORK
+ foundInFramework = Tcl_MacOSXOpenVersionedBundleResources(interp,
"com.tcltk.tcllibrary", TCL_FRAMEWORK_VERSION, 0, maxPathLen,
tclLibPath);
-}
-#else
-static int
-MacOSXGetLibraryPath(
- TCL_UNUSED(Tcl_Interp *),
- TCL_UNUSED(int),
- TCL_UNUSED(char *))
-{
- return TCL_ERROR;
-}
#endif
+
+ return foundInFramework;
+}
#endif /* HAVE_COREFOUNDATION */
/*
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index 1023db4..a57a89a 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.c
@@ -1,43 +1,280 @@
+#define AT_FORK_INIT_VALUE 0
+#define RESET_ATFORK_MUTEX 1
/*
- * tclUnixNotfy.c --
+ * tclUnixNotify.c --
*
- * This file contains subroutines shared by all notifier backend
- * implementations on *nix platforms. It is *included* by the epoll,
- * kqueue and select notifier implementation files.
+ * This file contains the implementation of the select()-based
+ * Unix-specific notifier, which is the lowest-level part of the Tcl
+ * event loop. This file works together with generic/tclNotify.c.
*
- * Copyright © 1995-1997 Sun Microsystems, Inc.
- * Copyright © 2016 Lucio Andrés Illanes Albornoz <l.illanes@gmx.de>
- * Copyright © 2021 Donal K. Fellows
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include <poll.h>
#include "tclInt.h"
+#ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is
+ * in tclMacOSXNotify.c */
+#include <signal.h>
+
+/*
+ * This code does deep stub magic to allow replacement of the notifier at
+ * runtime.
+ */
+
+extern TclStubs tclStubs;
+extern Tcl_NotifierProcs tclOriginalNotifier;
+
+/*
+ * This structure is used to keep track of the notifier info for a registered
+ * file.
+ */
+
+typedef struct FileHandler {
+ int fd;
+ int mask; /* Mask of desired events: TCL_READABLE,
+ * etc. */
+ int readyMask; /* Mask of events that have been seen since
+ * the last time file handlers were invoked
+ * for this file. */
+ Tcl_FileProc *proc; /* Function to call, in the style of
+ * Tcl_CreateFileHandler. */
+ ClientData clientData; /* Argument to pass to proc. */
+ struct FileHandler *nextPtr;/* Next in list of all files we care about. */
+} FileHandler;
+
+/*
+ * The following structure is what is added to the Tcl event queue when file
+ * handlers are ready to fire.
+ */
+
+typedef struct FileHandlerEvent {
+ Tcl_Event header; /* Information that is standard for all
+ * events. */
+ int fd; /* File descriptor that is ready. Used to find
+ * the FileHandler structure for the file
+ * (can't point directly to the FileHandler
+ * structure because it could go away while
+ * the event is queued). */
+} FileHandlerEvent;
+
+/*
+ * The following structure contains a set of select() masks to track readable,
+ * writable, and exception conditions.
+ */
+
+typedef struct SelectMasks {
+ fd_set readable;
+ fd_set writable;
+ fd_set exception;
+} SelectMasks;
+
+/*
+ * The following static structure contains the state information for the
+ * select based implementation of the Tcl notifier. One of these structures is
+ * created for each thread that is using the notifier.
+ */
+
+typedef struct ThreadSpecificData {
+ FileHandler *firstFileHandlerPtr;
+ /* Pointer to head of file handler list. */
+ SelectMasks checkMasks; /* This structure is used to build up the
+ * masks to be used in the next call to
+ * select. Bits are set in response to calls
+ * to Tcl_CreateFileHandler. */
+ SelectMasks readyMasks; /* This array reflects the readable/writable
+ * conditions that were found to exist by the
+ * last call to select. */
+ int numFdBits; /* Number of valid bits in checkMasks (one
+ * more than highest fd for which
+ * Tcl_WatchFile has been called). */
+#ifdef TCL_THREADS
+ int onList; /* True if it is in this list */
+ unsigned int pollState; /* pollState is used to implement a polling
+ * handshake between each thread and the
+ * notifier thread. Bits defined below. */
+ struct ThreadSpecificData *nextPtr, *prevPtr;
+ /* All threads that are currently waiting on
+ * an event have their ThreadSpecificData
+ * structure on a doubly-linked listed formed
+ * from these pointers. You must hold the
+ * notifierMutex lock before accessing these
+ * fields. */
+#ifdef __CYGWIN__
+ void *event; /* Any other thread alerts a notifier
+ * that an event is ready to be processed
+ * by sending this event. */
+ void *hwnd; /* Messaging window. */
+#else /* !__CYGWIN__ */
+ pthread_cond_t waitCV; /* Any other thread alerts a notifier that an
+ * event is ready to be processed by signaling
+ * this condition variable. */
+#endif /* __CYGWIN__ */
+ int waitCVinitialized; /* Variable to flag initialization of the structure */
+ int eventReady; /* True if an event is ready to be processed.
+ * Used as condition flag together with waitCV
+ * above. */
+#endif /* TCL_THREADS */
+} ThreadSpecificData;
+
+static Tcl_ThreadDataKey dataKey;
+
+#ifdef TCL_THREADS
+/*
+ * The following static indicates the number of threads that have initialized
+ * notifiers.
+ *
+ * You must hold the notifierMutex lock before accessing this variable.
+ */
+
+static int notifierCount = 0;
+
+/*
+ * The following variable points to the head of a doubly-linked list of
+ * ThreadSpecificData structures for all threads that are currently waiting on
+ * an event.
+ *
+ * You must hold the notifierMutex lock before accessing this list.
+ */
+
+static ThreadSpecificData *waitingListPtr = NULL;
+
+/*
+ * The notifier thread spends all its time in select() waiting for a file
+ * descriptor associated with one of the threads on the waitingListPtr list to
+ * do something interesting. But if the contents of the waitingListPtr list
+ * ever changes, we need to wake up and restart the select() system call. You
+ * can wake up the notifier thread by writing a single byte to the file
+ * descriptor defined below. This file descriptor is the input-end of a pipe
+ * and the notifier thread is listening for data on the output-end of the same
+ * pipe. Hence writing to this file descriptor will cause the select() system
+ * call to return and wake up the notifier thread.
+ *
+ * You must hold the notifierMutex lock before writing to the pipe.
+ */
+
+static int triggerPipe = -1;
+
+/*
+ * The notifierMutex locks access to all of the global notifier state.
+ */
+
+pthread_mutex_t notifierInitMutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t notifierMutex = PTHREAD_MUTEX_INITIALIZER;
+/*
+ * The following static indicates if the notifier thread is running.
+ *
+ * You must hold the notifierInitMutex before accessing this variable.
+ */
+
+static int notifierThreadRunning = 0;
+
+/*
+ * The notifier thread signals the notifierCV when it has finished
+ * initializing the triggerPipe and right before the notifier thread
+ * terminates.
+ */
+
+static pthread_cond_t notifierCV = PTHREAD_COND_INITIALIZER;
+
+/*
+ * The pollState bits
+ * POLL_WANT is set by each thread before it waits on its condition
+ * variable. It is checked by the notifier before it does select.
+ * POLL_DONE is set by the notifier if it goes into select after seeing
+ * POLL_WANT. The idea is to ensure it tries a select with the
+ * same bits the initial thread had set.
+ */
+
+#define POLL_WANT 0x1
+#define POLL_DONE 0x2
+
+/*
+ * This is the thread ID of the notifier thread that does select.
+ */
+
+static Tcl_ThreadId notifierThread;
+
+#endif /* TCL_THREADS */
/*
* Static routines defined in this file.
*/
-static int FileHandlerEventProc(Tcl_Event *evPtr, int flags);
-#if !TCL_THREADS
-# undef NOTIFIER_EPOLL
-# undef NOTIFIER_KQUEUE
-# define NOTIFIER_SELECT
-#elif !defined(NOTIFIER_EPOLL) && !defined(NOTIFIER_KQUEUE)
-# define NOTIFIER_SELECT
-static TCL_NORETURN void NotifierThreadProc(void *clientData);
-# if defined(HAVE_PTHREAD_ATFORK)
-static void AtForkChild(void);
-# endif /* HAVE_PTHREAD_ATFORK */
+#ifdef TCL_THREADS
+static void NotifierThreadProc(ClientData clientData);
+#if defined(HAVE_PTHREAD_ATFORK)
+static int atForkInit = AT_FORK_INIT_VALUE;
+static void AtForkPrepare(void);
+static void AtForkParent(void);
+static void AtForkChild(void);
+#endif /* HAVE_PTHREAD_ATFORK */
+#endif /* TCL_THREADS */
+static int FileHandlerEventProc(Tcl_Event *evPtr, int flags);
/*
+ * Import of Windows API when building threaded with Cygwin.
+ */
+
+#if defined(TCL_THREADS) && defined(__CYGWIN__)
+typedef struct {
+ void *hwnd;
+ unsigned int *message;
+ int wParam;
+ int lParam;
+ int time;
+ int x;
+ int y;
+} MSG;
+
+typedef struct {
+ unsigned int style;
+ void *lpfnWndProc;
+ int cbClsExtra;
+ int cbWndExtra;
+ void *hInstance;
+ void *hIcon;
+ void *hCursor;
+ void *hbrBackground;
+ void *lpszMenuName;
+ const void *lpszClassName;
+} WNDCLASS;
+
+extern void __stdcall CloseHandle(void *);
+extern void *__stdcall CreateEventW(void *, unsigned char, unsigned char,
+ void *);
+extern void * __stdcall CreateWindowExW(void *, const void *, const void *,
+ DWORD, int, int, int, int, void *, void *, void *, void *);
+extern DWORD __stdcall DefWindowProcW(void *, int, void *, void *);
+extern unsigned char __stdcall DestroyWindow(void *);
+extern int __stdcall DispatchMessageW(const MSG *);
+extern unsigned char __stdcall GetMessageW(MSG *, void *, int, int);
+extern void __stdcall MsgWaitForMultipleObjects(DWORD, void *,
+ unsigned char, DWORD, DWORD);
+extern unsigned char __stdcall PeekMessageW(MSG *, void *, int, int, int);
+extern unsigned char __stdcall PostMessageW(void *, unsigned int, void *,
+ void *);
+extern void __stdcall PostQuitMessage(int);
+extern void *__stdcall RegisterClassW(const WNDCLASS *);
+extern unsigned char __stdcall ResetEvent(void *);
+extern unsigned char __stdcall TranslateMessage(const MSG *);
+
+/*
+ * Threaded-cygwin specific functions in this file:
+ */
+
+static DWORD __stdcall NotifierProc(void *hwnd, unsigned int message,
+ void *wParam, void *lParam);
+#endif /* TCL_THREADS && __CYGWIN__ */
+
+#if TCL_THREADS
+/*
*----------------------------------------------------------------------
*
* StartNotifierThread --
*
- * Start a notifier thread and wait for the notifier pipe to be created.
+ * Start a notfier thread and wait for the notifier pipe to be created.
*
* Results:
* None.
@@ -47,10 +284,8 @@ static void AtForkChild(void);
*
*----------------------------------------------------------------------
*/
-
static void
-StartNotifierThread(
- const char *proc)
+StartNotifierThread(const char *proc)
{
if (!notifierThreadRunning) {
pthread_mutex_lock(&notifierInitMutex);
@@ -61,7 +296,6 @@ StartNotifierThread(
}
pthread_mutex_lock(&notifierMutex);
-
/*
* Wait for the notifier pipe to be created.
*/
@@ -76,127 +310,200 @@ StartNotifierThread(
pthread_mutex_unlock(&notifierInitMutex);
}
}
-#endif /* NOTIFIER_SELECT */
+#endif /* TCL_THREADS */
/*
*----------------------------------------------------------------------
*
- * TclpAlertNotifier --
+ * Tcl_InitNotifier --
*
- * Wake up the specified notifier from any thread. This routine is called
- * by the platform independent notifier code whenever the Tcl_ThreadAlert
- * routine is called. This routine is guaranteed not to be called on a
- * given notifier after Tcl_FinalizeNotifier is called for that notifier.
+ * Initializes the platform specific notifier state.
*
* Results:
- * None.
+ * Returns a handle to the notifier state for this thread.
*
* Side effects:
- * select(2) notifier:
- * signals the notifier condition variable for the specified
- * notifier.
- * epoll(7) notifier:
- * write(2)s to the eventfd(2) of the specified thread.
- * kqueue(2) notifier:
- * write(2)s to the trigger pipe(2) of the specified thread.
+ * None.
*
*----------------------------------------------------------------------
*/
-void
-TclpAlertNotifier(
- void *clientData)
+ClientData
+Tcl_InitNotifier(void)
{
-#ifdef NOTIFIER_SELECT
-#if TCL_THREADS
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData;
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- pthread_mutex_lock(&notifierMutex);
- tsdPtr->eventReady = 1;
+#ifdef TCL_THREADS
+ tsdPtr->eventReady = 0;
-# ifdef __CYGWIN__
- PostMessageW(tsdPtr->hwnd, 1024, 0, 0);
-# else
- pthread_cond_broadcast(&tsdPtr->waitCV);
-# endif /* __CYGWIN__ */
- pthread_mutex_unlock(&notifierMutex);
-#else
- (void)clientData;
-#endif /* TCL_THREADS */
-#else /* !NOTIFIER_SELECT */
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData;
-#if defined(NOTIFIER_EPOLL) && defined(HAVE_EVENTFD)
- uint64_t eventFdVal = 1;
+ /*
+ * Initialize thread specific condition variable for this thread.
+ */
+ if (tsdPtr->waitCVinitialized == 0) {
+#ifdef __CYGWIN__
+ WNDCLASS class;
- if (write(tsdPtr->triggerEventFd, &eventFdVal,
- sizeof(eventFdVal)) != sizeof(eventFdVal)) {
- Tcl_Panic("Tcl_AlertNotifier: unable to write to %p->triggerEventFd",
- (void *) tsdPtr);
- }
+ class.style = 0;
+ class.cbClsExtra = 0;
+ class.cbWndExtra = 0;
+ class.hInstance = TclWinGetTclInstance();
+ class.hbrBackground = NULL;
+ class.lpszMenuName = NULL;
+ class.lpszClassName = L"TclNotifier";
+ class.lpfnWndProc = NotifierProc;
+ class.hIcon = NULL;
+ class.hCursor = NULL;
+
+ RegisterClassW(&class);
+ tsdPtr->hwnd = CreateWindowExW(NULL, class.lpszClassName,
+ class.lpszClassName, 0, 0, 0, 0, 0, NULL, NULL,
+ TclWinGetTclInstance(), NULL);
+ tsdPtr->event = CreateEventW(NULL, 1 /* manual */,
+ 0 /* !signaled */, NULL);
#else
- if (write(tsdPtr->triggerPipe[1], "", 1) != 1) {
- Tcl_Panic("Tcl_AlertNotifier: unable to write to %p->triggerPipe",
- (void *) tsdPtr);
+ pthread_cond_init(&tsdPtr->waitCV, NULL);
+#endif /* __CYGWIN__ */
+ tsdPtr->waitCVinitialized = 1;
}
-#endif /* NOTIFIER_EPOLL && HAVE_EVENTFD */
-#endif /* NOTIFIER_SELECT */
+
+ pthread_mutex_lock(&notifierInitMutex);
+#if defined(HAVE_PTHREAD_ATFORK)
+ /*
+ * Install pthread_atfork handlers to clean up the notifier in the
+ * child of a fork.
+ */
+
+ if (!atForkInit) {
+ int result = pthread_atfork(AtForkPrepare, AtForkParent, AtForkChild);
+
+ if (result) {
+ Tcl_Panic("Tcl_InitNotifier: pthread_atfork failed");
+ }
+ atForkInit = 1;
+ }
+#endif /* HAVE_PTHREAD_ATFORK */
+
+ notifierCount++;
+
+ pthread_mutex_unlock(&notifierInitMutex);
+
+#endif /* TCL_THREADS */
+ return (ClientData) tsdPtr;
}
/*
*----------------------------------------------------------------------
*
- * LookUpFileHandler --
+ * Tcl_FinalizeNotifier --
*
- * Look up the file handler structure (and optionally the previous one in
- * the chain) associated with a file descriptor.
+ * This function is called to cleanup the notifier state before a thread
+ * is terminated.
*
- * Returns:
- * A pointer to the file handler, or NULL if it can't be found.
+ * Results:
+ * None.
*
* Side effects:
- * If prevPtrPtr is non-NULL, it will be written to if the file handler
- * is found.
+ * May terminate the background notifier thread if this is the last
+ * notifier instance.
*
*----------------------------------------------------------------------
*/
-static inline FileHandler *
-LookUpFileHandler(
- ThreadSpecificData *tsdPtr, /* Where to look things up. */
- int fd, /* What we are looking for. */
- FileHandler **prevPtrPtr) /* If non-NULL, where to report the previous
- * pointer. */
+void
+Tcl_FinalizeNotifier(
+ ClientData clientData) /* Not used. */
{
- FileHandler *filePtr, *prevPtr;
+#ifdef TCL_THREADS
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+
+ pthread_mutex_lock(&notifierInitMutex);
+ notifierCount--;
/*
- * Find the entry for the given file (and return if there isn't one).
+ * If this is the last thread to use the notifier, close the notifier
+ * pipe and wait for the background thread to terminate.
*/
- for (prevPtr = NULL, filePtr = tsdPtr->firstFileHandlerPtr; ;
- prevPtr = filePtr, filePtr = filePtr->nextPtr) {
- if (filePtr == NULL) {
- return NULL;
- }
- if (filePtr->fd == fd) {
- break;
+ if (notifierCount == 0) {
+
+ if (triggerPipe != -1) {
+ if (write(triggerPipe, "q", 1) != 1) {
+ Tcl_Panic("Tcl_FinalizeNotifier: %s",
+ "unable to write q to triggerPipe");
+ }
+ close(triggerPipe);
+ while(triggerPipe != -1) {
+ pthread_cond_wait(&notifierCV, &notifierMutex);
+ }
+ if (notifierThreadRunning) {
+ int result = pthread_join((pthread_t) notifierThread, NULL);
+
+ if (result) {
+ Tcl_Panic("Tcl_FinalizeNotifier: unable to join notifier "
+ "thread");
+ }
+ notifierThreadRunning = 0;
+ }
}
}
/*
- * Report what we've found to our caller.
+ * Clean up any synchronization objects in the thread local storage.
*/
- if (prevPtrPtr) {
- *prevPtrPtr = prevPtr;
- }
- return filePtr;
+#ifdef __CYGWIN__
+ DestroyWindow(tsdPtr->hwnd);
+ CloseHandle(tsdPtr->event);
+#else /* __CYGWIN__ */
+ pthread_cond_destroy(&tsdPtr->waitCV);
+#endif /* __CYGWIN__ */
+ tsdPtr->waitCVinitialized = 0;
+
+ pthread_mutex_unlock(&notifierInitMutex);
+#endif /* TCL_THREADS */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_AlertNotifier --
+ *
+ * Wake up the specified notifier from any thread. This routine is called
+ * by the platform independent notifier code whenever the Tcl_ThreadAlert
+ * routine is called. This routine is guaranteed not to be called on a
+ * given notifier after Tcl_FinalizeNotifier is called for that notifier.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Signals the notifier condition variable for the specified notifier.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tcl_AlertNotifier(
+ ClientData clientData)
+{
+#ifdef TCL_THREADS
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData;
+
+ pthread_mutex_lock(&notifierMutex);
+ tsdPtr->eventReady = 1;
+#ifdef __CYGWIN__
+ PostMessageW(tsdPtr->hwnd, 1024, 0, 0);
+#else /* __CYGWIN__ */
+ pthread_cond_broadcast(&tsdPtr->waitCV);
+#endif /* __CYGWIN__ */
+ pthread_mutex_unlock(&notifierMutex);
+#endif /* TCL_THREADS */
}
/*
*----------------------------------------------------------------------
*
- * TclpSetTimer --
+ * Tcl_SetTimer --
*
* This function sets the current notifier timer value. This interface is
* not implemented in this notifier because we are always running inside
@@ -212,14 +519,18 @@ LookUpFileHandler(
*/
void
-TclpSetTimer(
- TCL_UNUSED(const Tcl_Time *)) /* Timeout value, may be NULL. */
+Tcl_SetTimer(
+ Tcl_Time *timePtr) /* Timeout value, may be NULL. */
{
/*
- * The interval timer doesn't do anything in this implementation, because
- * the only event loop is via Tcl_DoOneEvent, which passes timeout values
- * to Tcl_WaitForEvent.
+ * The interval timer doesn't do anything in this implementation,
+ * because the only event loop is via Tcl_DoOneEvent, which passes
+ * timeout values to Tcl_WaitForEvent.
*/
+
+ if (tclStubs.tcl_SetTimer != tclOriginalNotifier.setTimerProc) {
+ tclStubs.tcl_SetTimer(timePtr);
+ }
}
/*
@@ -239,22 +550,186 @@ TclpSetTimer(
*/
void
-TclpServiceModeHook(
+Tcl_ServiceModeHook(
int mode) /* Either TCL_SERVICE_ALL, or
* TCL_SERVICE_NONE. */
{
- if (mode == TCL_SERVICE_ALL) {
-#ifdef NOTIFIER_SELECT
#if TCL_THREADS
+ if (mode == TCL_SERVICE_ALL) {
StartNotifierThread("Tcl_ServiceModeHook");
+ }
#endif
-#endif /* NOTIFIER_SELECT */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_CreateFileHandler --
+ *
+ * This function registers a file handler with the select notifier.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Creates a new file handler structure.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tcl_CreateFileHandler(
+ int fd, /* Handle of stream to watch. */
+ int mask, /* OR'ed combination of TCL_READABLE,
+ * TCL_WRITABLE, and TCL_EXCEPTION: indicates
+ * conditions under which proc should be
+ * called. */
+ Tcl_FileProc *proc, /* Function to call for each selected
+ * event. */
+ ClientData clientData) /* Arbitrary data to pass to proc. */
+{
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ FileHandler *filePtr;
+
+ if (tclStubs.tcl_CreateFileHandler !=
+ tclOriginalNotifier.createFileHandlerProc) {
+ tclStubs.tcl_CreateFileHandler(fd, mask, proc, clientData);
+ return;
+ }
+
+ for (filePtr = tsdPtr->firstFileHandlerPtr; filePtr != NULL;
+ filePtr = filePtr->nextPtr) {
+ if (filePtr->fd == fd) {
+ break;
+ }
+ }
+ if (filePtr == NULL) {
+ filePtr = (FileHandler*) ckalloc(sizeof(FileHandler));
+ filePtr->fd = fd;
+ filePtr->readyMask = 0;
+ filePtr->nextPtr = tsdPtr->firstFileHandlerPtr;
+ tsdPtr->firstFileHandlerPtr = filePtr;
+ }
+ filePtr->proc = proc;
+ filePtr->clientData = clientData;
+ filePtr->mask = mask;
+
+ /*
+ * Update the check masks for this file.
+ */
+
+ if (mask & TCL_READABLE) {
+ FD_SET(fd, &tsdPtr->checkMasks.readable);
+ } else {
+ FD_CLR(fd, &tsdPtr->checkMasks.readable);
+ }
+ if (mask & TCL_WRITABLE) {
+ FD_SET(fd, &tsdPtr->checkMasks.writable);
+ } else {
+ FD_CLR(fd, &tsdPtr->checkMasks.writable);
+ }
+ if (mask & TCL_EXCEPTION) {
+ FD_SET(fd, &tsdPtr->checkMasks.exception);
+ } else {
+ FD_CLR(fd, &tsdPtr->checkMasks.exception);
+ }
+ if (tsdPtr->numFdBits <= fd) {
+ tsdPtr->numFdBits = fd+1;
}
}
/*
*----------------------------------------------------------------------
*
+ * Tcl_DeleteFileHandler --
+ *
+ * Cancel a previously-arranged callback arrangement for a file.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * If a callback was previously registered on file, remove it.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tcl_DeleteFileHandler(
+ int fd) /* Stream id for which to remove callback
+ * function. */
+{
+ FileHandler *filePtr, *prevPtr;
+ int i;
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+
+ if (tclStubs.tcl_DeleteFileHandler !=
+ tclOriginalNotifier.deleteFileHandlerProc) {
+ tclStubs.tcl_DeleteFileHandler(fd);
+ return;
+ }
+
+ /*
+ * Find the entry for the given file (and return if there isn't one).
+ */
+
+ for (prevPtr = NULL, filePtr = tsdPtr->firstFileHandlerPtr; ;
+ prevPtr = filePtr, filePtr = filePtr->nextPtr) {
+ if (filePtr == NULL) {
+ return;
+ }
+ if (filePtr->fd == fd) {
+ break;
+ }
+ }
+
+ /*
+ * Update the check masks for this file.
+ */
+
+ if (filePtr->mask & TCL_READABLE) {
+ FD_CLR(fd, &tsdPtr->checkMasks.readable);
+ }
+ if (filePtr->mask & TCL_WRITABLE) {
+ FD_CLR(fd, &tsdPtr->checkMasks.writable);
+ }
+ if (filePtr->mask & TCL_EXCEPTION) {
+ FD_CLR(fd, &tsdPtr->checkMasks.exception);
+ }
+
+ /*
+ * Find current max fd.
+ */
+
+ if (fd+1 == tsdPtr->numFdBits) {
+ int numFdBits = 0;
+
+ for (i = fd-1; i >= 0; i--) {
+ if (FD_ISSET(i, &tsdPtr->checkMasks.readable)
+ || FD_ISSET(i, &tsdPtr->checkMasks.writable)
+ || FD_ISSET(i, &tsdPtr->checkMasks.exception)) {
+ numFdBits = i+1;
+ break;
+ }
+ }
+ tsdPtr->numFdBits = numFdBits;
+ }
+
+ /*
+ * Clean up information in the callback record.
+ */
+
+ if (prevPtr == NULL) {
+ tsdPtr->firstFileHandlerPtr = filePtr->nextPtr;
+ } else {
+ prevPtr->nextPtr = filePtr->nextPtr;
+ }
+ ckfree((char *) filePtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* FileHandlerEventProc --
*
* This function is called by Tcl_ServiceEvent when a file event reaches
@@ -326,170 +801,550 @@ FileHandlerEventProc(
return 1;
}
-#ifdef NOTIFIER_SELECT
-#if TCL_THREADS
+#if defined(TCL_THREADS) && defined(__CYGWIN__)
+
+static DWORD __stdcall
+NotifierProc(
+ void *hwnd,
+ unsigned int message,
+ void *wParam,
+ void *lParam)
+{
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+
+ if (message != 1024) {
+ return DefWindowProcW(hwnd, message, wParam, lParam);
+ }
+
+ /*
+ * Process all of the runnable events.
+ */
+
+ tsdPtr->eventReady = 1;
+ Tcl_ServiceAll();
+ return 0;
+}
+#endif /* TCL_THREADS && __CYGWIN__ */
+
/*
*----------------------------------------------------------------------
*
- * AlertSingleThread --
+ * Tcl_WaitForEvent --
*
- * Notify a single thread that is waiting on a file descriptor to become
- * readable or writable or to have an exception condition.
- * notifierMutex must be held.
+ * This function is called by Tcl_DoOneEvent to wait for new events on
+ * the message queue. If the block time is 0, then Tcl_WaitForEvent just
+ * polls without blocking.
*
- * Result:
- * None.
+ * Results:
+ * Returns -1 if the select would block forever, otherwise returns 0.
*
* Side effects:
- * The condition variable associated with the thread is broadcasted.
+ * Queues file events that are detected by the select.
*
*----------------------------------------------------------------------
*/
-static void
-AlertSingleThread(
- ThreadSpecificData *tsdPtr)
+int
+Tcl_WaitForEvent(
+ Tcl_Time *timePtr) /* Maximum block time, or NULL. */
{
- tsdPtr->eventReady = 1;
- if (tsdPtr->onList) {
+ FileHandler *filePtr;
+ int mask;
+ Tcl_Time vTime;
+#ifdef TCL_THREADS
+ int waitForFiles;
+#ifdef __CYGWIN__
+ MSG msg;
+#endif /* __CYGWIN__ */
+#else
+ /*
+ * Impl. notes: timeout & timeoutPtr are used if, and only if threads
+ * are not enabled. They are the arguments for the regular select()
+ * used when the core is not thread-enabled.
+ */
+
+ struct timeval timeout, *timeoutPtr;
+ int numFound;
+#endif /* TCL_THREADS */
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+
+ if (tclStubs.tcl_WaitForEvent != tclOriginalNotifier.waitForEventProc) {
+ return tclStubs.tcl_WaitForEvent(timePtr);
+ }
+
+ /*
+ * Set up the timeout structure. Note that if there are no events to
+ * check for, we return with a negative result rather than blocking
+ * forever.
+ */
+
+ if (timePtr != NULL) {
+ /*
+ * TIP #233 (Virtualized Time). Is virtual time in effect? And do
+ * we actually have something to scale? If yes to both then we
+ * call the handler to do this scaling.
+ */
+
+ if (timePtr->sec != 0 || timePtr->usec != 0) {
+ vTime = *timePtr;
+ tclScaleTimeProcPtr(&vTime, tclTimeClientData);
+ timePtr = &vTime;
+ }
+#ifndef TCL_THREADS
+ timeout.tv_sec = timePtr->sec;
+ timeout.tv_usec = timePtr->usec;
+ timeoutPtr = &timeout;
+ } else if (tsdPtr->numFdBits == 0) {
+ /*
+ * If there are no threads, no timeout, and no fds registered,
+ * then there are no events possible and we must avoid deadlock.
+ * Note that this is not entirely correct because there might be a
+ * signal that could interrupt the select call, but we don't
+ * handle that case if we aren't using threads.
+ */
+
+ return -1;
+ } else {
+ timeoutPtr = NULL;
+#endif /* !TCL_THREADS */
+ }
+
+#ifdef TCL_THREADS
+ /*
+ * Start notifier thread and place this thread on the list of
+ * interested threads, signal the notifier thread, and wait for a
+ * response or a timeout.
+ */
+ StartNotifierThread("Tcl_WaitForEvent");
+
+ pthread_mutex_lock(&notifierMutex);
+
+ if (timePtr != NULL && timePtr->sec == 0 && (timePtr->usec == 0
+#if defined(__APPLE__) && defined(__LP64__)
+ /*
+ * On 64-bit Darwin, pthread_cond_timedwait() appears to have
+ * a bug that causes it to wait forever when passed an
+ * absolute time which has already been exceeded by the system
+ * time; as a workaround, when given a very brief timeout,
+ * just do a poll. [Bug 1457797]
+ */
+ || timePtr->usec < 10
+#endif /* __APPLE__ && __LP64__ */
+ )) {
+ /*
+ * Cannot emulate a polling select with a polling condition
+ * variable. Instead, pretend to wait for files and tell the
+ * notifier thread what we are doing. The notifier thread makes
+ * sure it goes through select with its select mask in the same
+ * state as ours currently is. We block until that happens.
+ */
+
+ waitForFiles = 1;
+ tsdPtr->pollState = POLL_WANT;
+ timePtr = NULL;
+ } else {
+ waitForFiles = (tsdPtr->numFdBits > 0);
+ tsdPtr->pollState = 0;
+ }
+
+ if (waitForFiles) {
+ /*
+ * Add the ThreadSpecificData structure of this thread to the list
+ * of ThreadSpecificData structures of all threads that are
+ * waiting on file events.
+ */
+
+ tsdPtr->nextPtr = waitingListPtr;
+ if (waitingListPtr) {
+ waitingListPtr->prevPtr = tsdPtr;
+ }
+ tsdPtr->prevPtr = 0;
+ waitingListPtr = tsdPtr;
+ tsdPtr->onList = 1;
+
+ if ((write(triggerPipe, "", 1) == -1) && (errno != EAGAIN)) {
+ Tcl_Panic("Tcl_WaitForEvent: %s",
+ "unable to write to triggerPipe");
+ }
+ }
+
+ FD_ZERO(&tsdPtr->readyMasks.readable);
+ FD_ZERO(&tsdPtr->readyMasks.writable);
+ FD_ZERO(&tsdPtr->readyMasks.exception);
+
+ if (!tsdPtr->eventReady) {
+#ifdef __CYGWIN__
+ if (!PeekMessageW(&msg, NULL, 0, 0, 0)) {
+ DWORD timeout;
+
+ if (timePtr) {
+ timeout = timePtr->sec * 1000 + timePtr->usec / 1000;
+ } else {
+ timeout = 0xFFFFFFFF;
+ }
+ pthread_mutex_unlock(&notifierMutex);
+ MsgWaitForMultipleObjects(1, &tsdPtr->event, 0, timeout, 1279);
+ pthread_mutex_lock(&notifierMutex);
+ }
+#else
+ if (timePtr != NULL) {
+ Tcl_Time now;
+ struct timespec ptime;
+
+ Tcl_GetTime(&now);
+ ptime.tv_sec = timePtr->sec + now.sec + (timePtr->usec + now.usec) / 1000000;
+ ptime.tv_nsec = 1000 * ((timePtr->usec + now.usec) % 1000000);
+
+ pthread_cond_timedwait(&tsdPtr->waitCV, &notifierMutex, &ptime);
+ } else {
+ pthread_cond_wait(&tsdPtr->waitCV, &notifierMutex);
+ }
+#endif /* __CYGWIN__ */
+ }
+ tsdPtr->eventReady = 0;
+
+#ifdef __CYGWIN__
+ while (PeekMessageW(&msg, NULL, 0, 0, 0)) {
+ /*
+ * Retrieve and dispatch the message.
+ */
+
+ DWORD result = GetMessageW(&msg, NULL, 0, 0);
+
+ if (result == 0) {
+ PostQuitMessage(msg.wParam);
+ /* What to do here? */
+ } else if (result != (DWORD) -1) {
+ TranslateMessage(&msg);
+ DispatchMessageW(&msg);
+ }
+ }
+ ResetEvent(tsdPtr->event);
+#endif /* __CYGWIN__ */
+
+ if (waitForFiles && tsdPtr->onList) {
/*
* Remove the ThreadSpecificData structure of this thread from the
- * waiting list. This prevents us from continuously spinning on
- * epoll_wait until the other threads runs and services the file
- * event.
+ * waiting list. Alert the notifier thread to recompute its select
+ * masks - skipping this caused a hang when trying to close a pipe
+ * which the notifier thread was still doing a select on.
*/
if (tsdPtr->prevPtr) {
- tsdPtr->prevPtr->nextPtr = tsdPtr->nextPtr;
+ tsdPtr->prevPtr->nextPtr = tsdPtr->nextPtr;
} else {
- waitingListPtr = tsdPtr->nextPtr;
+ waitingListPtr = tsdPtr->nextPtr;
}
if (tsdPtr->nextPtr) {
- tsdPtr->nextPtr->prevPtr = tsdPtr->prevPtr;
+ tsdPtr->nextPtr->prevPtr = tsdPtr->prevPtr;
}
tsdPtr->nextPtr = tsdPtr->prevPtr = NULL;
tsdPtr->onList = 0;
- tsdPtr->pollState = 0;
+ if ((write(triggerPipe, "", 1) == -1) && (errno != EAGAIN)) {
+ Tcl_Panic("Tcl_WaitForEvent: %s",
+ "unable to write to triggerPipe");
+ }
}
-#ifdef __CYGWIN__
- PostMessageW(tsdPtr->hwnd, 1024, 0, 0);
-#else /* !__CYGWIN__ */
- pthread_cond_broadcast(&tsdPtr->waitCV);
-#endif /* __CYGWIN__ */
+
+#else
+ tsdPtr->readyMasks = tsdPtr->checkMasks;
+ numFound = select(tsdPtr->numFdBits, &tsdPtr->readyMasks.readable,
+ &tsdPtr->readyMasks.writable, &tsdPtr->readyMasks.exception,
+ timeoutPtr);
+
+ /*
+ * Some systems don't clear the masks after an error, so we have to do
+ * it here.
+ */
+
+ if (numFound == -1) {
+ FD_ZERO(&tsdPtr->readyMasks.readable);
+ FD_ZERO(&tsdPtr->readyMasks.writable);
+ FD_ZERO(&tsdPtr->readyMasks.exception);
+ }
+#endif /* TCL_THREADS */
+
+ /*
+ * Queue all detected file events before returning.
+ */
+
+ for (filePtr = tsdPtr->firstFileHandlerPtr; (filePtr != NULL);
+ filePtr = filePtr->nextPtr) {
+ mask = 0;
+ if (FD_ISSET(filePtr->fd, &tsdPtr->readyMasks.readable)) {
+ mask |= TCL_READABLE;
+ }
+ if (FD_ISSET(filePtr->fd, &tsdPtr->readyMasks.writable)) {
+ mask |= TCL_WRITABLE;
+ }
+ if (FD_ISSET(filePtr->fd, &tsdPtr->readyMasks.exception)) {
+ mask |= TCL_EXCEPTION;
+ }
+
+ if (!mask) {
+ continue;
+ }
+
+ /*
+ * Don't bother to queue an event if the mask was previously
+ * non-zero since an event must still be on the queue.
+ */
+
+ if (filePtr->readyMask == 0) {
+ FileHandlerEvent *fileEvPtr =
+ (FileHandlerEvent *) ckalloc(sizeof(FileHandlerEvent));
+
+ fileEvPtr->header.proc = FileHandlerEventProc;
+ fileEvPtr->fd = filePtr->fd;
+ Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL);
+ }
+ filePtr->readyMask = mask;
+ }
+#ifdef TCL_THREADS
+ pthread_mutex_unlock(&notifierMutex);
+#endif /* TCL_THREADS */
+ return 0;
}
-#if defined(HAVE_PTHREAD_ATFORK)
+#ifdef TCL_THREADS
/*
*----------------------------------------------------------------------
*
- * AtForkChild --
+ * NotifierThreadProc --
*
- * Unlock and reinstall the notifier in the child after a fork.
+ * This routine is the initial (and only) function executed by the
+ * special notifier thread. Its job is to wait for file descriptors to
+ * become readable or writable or to have an exception condition and then
+ * to notify other threads who are interested in this information by
+ * signalling a condition variable. Other threads can signal this
+ * notifier thread of a change in their interests by writing a single
+ * byte to a special pipe that the notifier thread is monitoring.
*
- * Results:
- * None.
+ * Result:
+ * None. Once started, this routine never exits. It dies with the overall
+ * process.
*
* Side effects:
- * None.
+ * The trigger pipe used to signal the notifier thread is created when
+ * the notifier thread first starts.
*
*----------------------------------------------------------------------
*/
static void
-AtForkChild(void)
+NotifierThreadProc(
+ ClientData clientData) /* Not used. */
{
- if (notifierThreadRunning == 1) {
- pthread_cond_destroy(&notifierCV);
+ ThreadSpecificData *tsdPtr;
+ fd_set readableMask;
+ fd_set writableMask;
+ fd_set exceptionMask;
+ int fds[2];
+ int i, numFdBits = 0, receivePipe;
+ long found;
+ struct timeval poll = {0., 0.}, *timePtr;
+ char buf[2];
+
+ if (pipe(fds) != 0) {
+ Tcl_Panic("NotifierThreadProc: %s", "could not create trigger pipe");
}
- pthread_mutex_init(&notifierInitMutex, NULL);
- pthread_mutex_init(&notifierMutex, NULL);
- pthread_cond_init(&notifierCV, NULL);
-#ifdef NOTIFIER_SELECT
- asyncPending = 0;
-#endif
+ receivePipe = fds[0];
+
+ if (TclUnixSetBlockingMode(receivePipe, TCL_MODE_NONBLOCKING) < 0) {
+ Tcl_Panic("NotifierThreadProc: %s",
+ "could not make receive pipe non blocking");
+ }
+ if (TclUnixSetBlockingMode(fds[1], TCL_MODE_NONBLOCKING) < 0) {
+ Tcl_Panic("NotifierThreadProc: %s",
+ "could not make trigger pipe non blocking");
+ }
+ if (fcntl(receivePipe, F_SETFD, FD_CLOEXEC) < 0) {
+ Tcl_Panic("NotifierThreadProc: %s",
+ "could not make receive pipe close-on-exec");
+ }
+ if (fcntl(fds[1], F_SETFD, FD_CLOEXEC) < 0) {
+ Tcl_Panic("NotifierThreadProc: %s",
+ "could not make trigger pipe close-on-exec");
+ }
/*
- * notifierThreadRunning == 1: thread is running, (there might be data in
- * notifier lists)
- * atForkInit == 0: InitNotifier was never called
- * notifierCount != 0: unbalanced InitNotifier() / FinalizeNotifier calls
- * waitingListPtr != 0: there are threads currently waiting for events.
+ * Install the write end of the pipe into the global variable.
*/
- if (atForkInit == 1) {
+ pthread_mutex_lock(&notifierMutex);
+ triggerPipe = fds[1];
- notifierCount = 0;
- if (notifierThreadRunning == 1) {
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- notifierThreadRunning = 0;
+ /*
+ * Signal any threads that are waiting.
+ */
- close(triggerPipe);
- triggerPipe = -1;
-#ifdef NOTIFIER_SELECT
- close(otherPipe);
- otherPipe = -1;
-#endif
- /*
- * The waitingListPtr might contain event info from multiple
- * threads, which are invalid here, so setting it to NULL is not
- * unreasonable.
- */
- waitingListPtr = NULL;
+ pthread_cond_broadcast(&notifierCV);
+ pthread_mutex_unlock(&notifierMutex);
+
+ /*
+ * Look for file events and report them to interested threads.
+ */
+
+ while (1) {
+ FD_ZERO(&readableMask);
+ FD_ZERO(&writableMask);
+ FD_ZERO(&exceptionMask);
+
+ /*
+ * Compute the logical OR of the select masks from all the waiting
+ * notifiers.
+ */
+ pthread_mutex_lock(&notifierMutex);
+ timePtr = NULL;
+ for (tsdPtr = waitingListPtr; tsdPtr; tsdPtr = tsdPtr->nextPtr) {
+ for (i = tsdPtr->numFdBits-1; i >= 0; --i) {
+ if (FD_ISSET(i, &tsdPtr->checkMasks.readable)) {
+ FD_SET(i, &readableMask);
+ }
+ if (FD_ISSET(i, &tsdPtr->checkMasks.writable)) {
+ FD_SET(i, &writableMask);
+ }
+ if (FD_ISSET(i, &tsdPtr->checkMasks.exception)) {
+ FD_SET(i, &exceptionMask);
+ }
+ }
+ if (tsdPtr->numFdBits > numFdBits) {
+ numFdBits = tsdPtr->numFdBits;
+ }
+ if (tsdPtr->pollState & POLL_WANT) {
+ /*
+ * Here we make sure we go through select() with the same mask
+ * bits that were present when the thread tried to poll.
+ */
+
+ tsdPtr->pollState |= POLL_DONE;
+ timePtr = &poll;
+ }
+ }
+ pthread_mutex_unlock(&notifierMutex);
+
+ /*
+ * Set up the select mask to include the receive pipe.
+ */
+
+ if (receivePipe >= numFdBits) {
+ numFdBits = receivePipe + 1;
+ }
+ FD_SET(receivePipe, &readableMask);
+
+ if (select(numFdBits, &readableMask, &writableMask, &exceptionMask,
+ timePtr) == -1) {
/*
- * The tsdPtr from before the fork is copied as well. But since we
- * are paranoiac, we don't trust its condvar and reset it.
+ * Try again immediately on an error.
*/
+
+ continue;
+ }
+
+ /*
+ * Alert any threads that are waiting on a ready file descriptor.
+ */
+
+ pthread_mutex_lock(&notifierMutex);
+ for (tsdPtr = waitingListPtr; tsdPtr; tsdPtr = tsdPtr->nextPtr) {
+ found = 0;
+
+ for (i = tsdPtr->numFdBits-1; i >= 0; --i) {
+ if (FD_ISSET(i, &tsdPtr->checkMasks.readable)
+ && FD_ISSET(i, &readableMask)) {
+ FD_SET(i, &tsdPtr->readyMasks.readable);
+ found = 1;
+ }
+ if (FD_ISSET(i, &tsdPtr->checkMasks.writable)
+ && FD_ISSET(i, &writableMask)) {
+ FD_SET(i, &tsdPtr->readyMasks.writable);
+ found = 1;
+ }
+ if (FD_ISSET(i, &tsdPtr->checkMasks.exception)
+ && FD_ISSET(i, &exceptionMask)) {
+ FD_SET(i, &tsdPtr->readyMasks.exception);
+ found = 1;
+ }
+ }
+
+ if (found || (tsdPtr->pollState & POLL_DONE)) {
+ tsdPtr->eventReady = 1;
+ if (tsdPtr->onList) {
+ /*
+ * Remove the ThreadSpecificData structure of this thread
+ * from the waiting list. This prevents us from
+ * continuously spining on select until the other threads
+ * runs and services the file event.
+ */
+
+ if (tsdPtr->prevPtr) {
+ tsdPtr->prevPtr->nextPtr = tsdPtr->nextPtr;
+ } else {
+ waitingListPtr = tsdPtr->nextPtr;
+ }
+ if (tsdPtr->nextPtr) {
+ tsdPtr->nextPtr->prevPtr = tsdPtr->prevPtr;
+ }
+ tsdPtr->nextPtr = tsdPtr->prevPtr = NULL;
+ tsdPtr->onList = 0;
+ tsdPtr->pollState = 0;
+ }
#ifdef __CYGWIN__
- DestroyWindow(tsdPtr->hwnd);
- tsdPtr->hwnd = CreateWindowExW(NULL, className,
- className, 0, 0, 0, 0, 0, NULL, NULL,
- TclWinGetTclInstance(), NULL);
- ResetEvent(tsdPtr->event);
-#else /* !__CYGWIN__ */
- pthread_cond_destroy(&tsdPtr->waitCV);
- pthread_cond_init(&tsdPtr->waitCV, NULL);
+ PostMessageW(tsdPtr->hwnd, 1024, 0, 0);
+#else /* __CYGWIN__ */
+ pthread_cond_broadcast(&tsdPtr->waitCV);
#endif /* __CYGWIN__ */
+ }
+ }
+ pthread_mutex_unlock(&notifierMutex);
- /*
- * In case, we had multiple threads running before the fork,
- * make sure, we don't try to reach out to their thread local data.
- */
- tsdPtr->nextPtr = tsdPtr->prevPtr = NULL;
+ /*
+ * Consume the next byte from the notifier pipe if the pipe was
+ * readable. Note that there may be multiple bytes pending, but to
+ * avoid a race condition we only read one at a time.
+ */
- /*
- * The list of registered event handlers at fork time is in
- * tsdPtr->firstFileHandlerPtr;
- */
+ if (FD_ISSET(receivePipe, &readableMask)) {
+ i = read(receivePipe, buf, 1);
+
+ if ((i == 0) || ((i == 1) && (buf[0] == 'q'))) {
+ /*
+ * Someone closed the write end of the pipe or sent us a Quit
+ * message [Bug: 4139] and then closed the write end of the
+ * pipe so we need to shut down the notifier thread.
+ */
+
+ break;
+ }
}
}
- Tcl_InitNotifier();
-
-#ifdef NOTIFIER_SELECT
/*
- * Restart the notifier thread for signal handling.
+ * Clean up the read end of the pipe and signal any threads waiting on
+ * termination of the notifier thread.
*/
- StartNotifierThread("AtForkChild");
-#endif
+ close(receivePipe);
+ pthread_mutex_lock(&notifierMutex);
+ triggerPipe = -1;
+ pthread_cond_broadcast(&notifierCV);
+ pthread_mutex_unlock(&notifierMutex);
+
+ TclpThreadExit(0);
}
-#endif /* HAVE_PTHREAD_ATFORK */
-#endif /* TCL_THREADS */
-#endif /* NOTIFIER_SELECT */
+#if defined(HAVE_PTHREAD_ATFORK)
/*
*----------------------------------------------------------------------
*
- * TclpNotifierData --
+ * AtForkPrepare --
*
- * This function returns a void pointer to be associated
- * with a Tcl_AsyncHandler.
+ * Lock the notifier in preparation for a fork.
*
* Results:
- * For the epoll and kqueue notifiers, this function returns the
- * thread specific data. Otherwise NULL.
+ * None.
*
* Side effects:
* None.
@@ -497,164 +1352,124 @@ AtForkChild(void)
*----------------------------------------------------------------------
*/
-void *
-TclpNotifierData(void)
+static void
+AtForkPrepare(void)
{
-#if defined(NOTIFIER_EPOLL) || defined(NOTIFIER_KQUEUE)
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
-
- return tsdPtr;
-#else
- return NULL;
+#if RESET_ATFORK_MUTEX == 0
+ pthread_mutex_lock(&notifierInitMutex);
#endif
}
/*
*----------------------------------------------------------------------
*
- * TclUnixWaitForFile --
+ * AtForkParent --
*
- * This function waits synchronously for a file to become readable or
- * writable, with an optional timeout.
+ * Unlock the notifier in the parent after a fork.
*
* Results:
- * The return value is an OR'ed combination of TCL_READABLE,
- * TCL_WRITABLE, and TCL_EXCEPTION, indicating the conditions that are
- * present on file at the time of the return. This function will not
- * return until either "timeout" milliseconds have elapsed or at least
- * one of the conditions given by mask has occurred for file (a return
- * value of 0 means that a timeout occurred). No normal events will be
- * serviced during the execution of this function.
+ * None.
*
* Side effects:
- * Time passes.
+ * None.
*
*----------------------------------------------------------------------
*/
-#ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is
- * in tclMacOSXNotify.c */
-
-int
-TclUnixWaitForFile(
- int fd, /* Handle for file on which to wait. */
- int mask, /* What to wait for: OR'ed combination of
- * TCL_READABLE, TCL_WRITABLE, and
- * TCL_EXCEPTION. */
- int timeout) /* Maximum amount of time to wait for one of
- * the conditions in mask to occur, in
- * milliseconds. A value of 0 means don't wait
- * at all, and a value of -1 means wait
- * forever. */
+static void
+AtForkParent(void)
{
- Tcl_Time abortTime = {0, 0}, now; /* silence gcc 4 warning */
- struct timeval blockTime, *timeoutPtr;
- struct pollfd pollFds[1];
- int numFound, result = 0, pollTimeout;
-
- /*
- * If there is a non-zero finite timeout, compute the time when we give
- * up.
- */
+#if RESET_ATFORK_MUTEX == 0
+ pthread_mutex_unlock(&notifierInitMutex);
+#endif
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * AtForkChild --
+ *
+ * Unlock and reinstall the notifier in the child after a fork.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
- if (timeout > 0) {
- Tcl_GetTime(&now);
- abortTime.sec = now.sec + timeout / 1000;
- abortTime.usec = now.usec + (timeout % 1000) * 1000;
- if (abortTime.usec >= 1000000) {
- abortTime.usec -= 1000000;
- abortTime.sec += 1;
- }
- timeoutPtr = &blockTime;
- } else if (timeout == 0) {
- timeoutPtr = &blockTime;
- blockTime.tv_sec = 0;
- blockTime.tv_usec = 0;
- } else {
- timeoutPtr = NULL;
+static void
+AtForkChild(void)
+{
+ if (notifierThreadRunning == 1) {
+ pthread_cond_destroy(&notifierCV);
}
+#if RESET_ATFORK_MUTEX == 0
+ pthread_mutex_unlock(&notifierInitMutex);
+#else
+ pthread_mutex_init(&notifierInitMutex, NULL);
+ pthread_mutex_init(&notifierMutex, NULL);
+#endif
+ pthread_cond_init(&notifierCV, NULL);
/*
- * Setup the pollfd structure for the fd.
+ * notifierThreadRunning == 1: thread is running, (there might be data in notifier lists)
+ * atForkInit == 0: InitNotifier was never called
+ * notifierCount != 0: unbalanced InitNotifier() / FinalizeNotifier calls
+ * waitingListPtr != 0: there are threads currently waiting for events.
*/
- pollFds[0].fd = fd;
- pollFds[0].events = pollFds[0].revents = 0;
- if (mask & TCL_READABLE) {
- pollFds[0].events |= (POLLIN | POLLHUP);
- }
- if (mask & TCL_WRITABLE) {
- pollFds[0].events |= POLLOUT;
- }
- if (mask & TCL_EXCEPTION) {
- pollFds[0].events |= POLLERR;
- }
+ if (atForkInit == 1) {
- /*
- * Loop in a mini-event loop of our own, waiting for either the file to
- * become ready or a timeout to occur.
- */
+ notifierCount = 0;
+ if (notifierThreadRunning == 1) {
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ notifierThreadRunning = 0;
- do {
- if (timeout > 0) {
- blockTime.tv_sec = abortTime.sec - now.sec;
- blockTime.tv_usec = abortTime.usec - now.usec;
- if (blockTime.tv_usec < 0) {
- blockTime.tv_sec -= 1;
- blockTime.tv_usec += 1000000;
- }
- if (blockTime.tv_sec < 0) {
- blockTime.tv_sec = 0;
- blockTime.tv_usec = 0;
- }
- }
+ close(triggerPipe);
+ triggerPipe = -1;
+ /*
+ * The waitingListPtr might contain event info from multiple
+ * threads, which are invalid here, so setting it to NULL is not
+ * unreasonable.
+ */
+ waitingListPtr = NULL;
- /*
- * Wait for the event or a timeout.
- */
+ /*
+ * The tsdPtr from before the fork is copied as well. But since
+ * we are paranoic, we don't trust its condvar and reset it.
+ */
+#ifdef __CYGWIN__
+ DestroyWindow(tsdPtr->hwnd);
+ tsdPtr->hwnd = CreateWindowExW(NULL, L"TclNotifier",
+ L"TclNotifier", 0, 0, 0, 0, 0, NULL, NULL,
+ TclWinGetTclInstance(), NULL);
+ ResetEvent(tsdPtr->event);
+#else
+ pthread_cond_destroy(&tsdPtr->waitCV);
+ pthread_cond_init(&tsdPtr->waitCV, NULL);
+#endif
+ /*
+ * In case, we had multiple threads running before the fork,
+ * make sure, we don't try to reach out to their thread local data.
+ */
+ tsdPtr->nextPtr = tsdPtr->prevPtr = NULL;
- if (!timeoutPtr) {
- pollTimeout = -1;
- } else if (!timeoutPtr->tv_sec && !timeoutPtr->tv_usec) {
- pollTimeout = 0;
- } else {
- pollTimeout = (int) timeoutPtr->tv_sec * 1000;
- if (timeoutPtr->tv_usec) {
- pollTimeout += (int) timeoutPtr->tv_usec / 1000;
- }
- }
- numFound = poll(pollFds, 1, pollTimeout);
- if (numFound == 1) {
- result = 0;
- if (pollFds[0].revents & (POLLIN | POLLHUP)) {
- result |= TCL_READABLE;
- }
- if (pollFds[0].revents & POLLOUT) {
- result |= TCL_WRITABLE;
- }
- if (pollFds[0].revents & POLLERR) {
- result |= TCL_EXCEPTION;
- }
- if (result) {
- break;
- }
- }
- if (timeout == 0) {
- break;
- }
- if (timeout < 0) {
- continue;
+ /*
+ * The list of registered event handlers at fork time is in
+ * tsdPtr->firstFileHandlerPtr;
+ */
}
+ }
- /*
- * The select returned early, so we need to recompute the timeout.
- */
-
- Tcl_GetTime(&now);
- } while ((abortTime.sec > now.sec)
- || (abortTime.sec == now.sec && abortTime.usec > now.usec));
- return result;
+ Tcl_InitNotifier();
}
+#endif /* HAVE_PTHREAD_ATFORK */
+
+#endif /* TCL_THREADS */
+
#endif /* !HAVE_COREFOUNDATION */
/*
diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c
index 70a5d5d..d0a5e53 100644
--- a/unix/tclUnixPipe.c
+++ b/unix/tclUnixPipe.c
@@ -4,8 +4,8 @@
* This file implements the UNIX-specific exec pipeline functions, the
* "pipe" channel driver, and the "pid" Tcl command.
*
- * Copyright © 1991-1994 The Regents of the University of California.
- * Copyright © 1994-1997 Sun Microsystems, Inc.
+ * Copyright (c) 1991-1994 The Regents of the University of California.
+ * Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -13,19 +13,18 @@
#include "tclInt.h"
-#ifdef HAVE_POSIX_SPAWNP
-# if defined(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2) \
- && defined(HAVE_POSIX_SPAWNATTR_SETFLAGS) \
- && !defined(HAVE_VFORK)
-# include <unistd.h>
-# include <spawn.h>
-# else
-# undef HAVE_POSIX_SPAWNP
-# endif
+#ifdef USE_VFORK
+#define fork vfork
#endif
-#ifdef HAVE_VFORK
-#define fork vfork
+/*
+ * Fallback temporary file location the temporary file generation code. Can be
+ * overridden at compile time for when it is known that temp files can't be
+ * written to /tmp (hello, iOS!).
+ */
+
+#ifndef TCL_TEMPORARY_FILE_DIRECTORY
+#define TCL_TEMPORARY_FILE_DIRECTORY "/tmp"
#endif
/*
@@ -41,7 +40,7 @@
* This structure describes per-instance state of a pipe based channel.
*/
-typedef struct {
+typedef struct PipeState {
Tcl_Channel channel; /* Channel associated with this file. */
TclFile inFile; /* Output from pipe. */
TclFile outFile; /* Input to pipe. */
@@ -59,16 +58,17 @@ typedef struct {
* Declarations for local functions defined in this file:
*/
-static int PipeBlockModeProc(void *instanceData, int mode);
-static int PipeClose2Proc(void *instanceData,
- Tcl_Interp *interp, int flags);
-static int PipeGetHandleProc(void *instanceData,
- int direction, void **handlePtr);
-static int PipeInputProc(void *instanceData, char *buf,
+static const char * DefaultTempDir(void);
+static int PipeBlockModeProc(ClientData instanceData, int mode);
+static int PipeCloseProc(ClientData instanceData,
+ Tcl_Interp *interp);
+static int PipeGetHandleProc(ClientData instanceData,
+ int direction, ClientData *handlePtr);
+static int PipeInputProc(ClientData instanceData, char *buf,
int toRead, int *errorCode);
-static int PipeOutputProc(void *instanceData,
+static int PipeOutputProc(ClientData instanceData,
const char *buf, int toWrite, int *errorCode);
-static void PipeWatchProc(void *instanceData, int mask);
+static void PipeWatchProc(ClientData instanceData, int mask);
static void RestoreSignals(void);
static int SetupStdFile(TclFile file, int type);
@@ -77,10 +77,10 @@ static int SetupStdFile(TclFile file, int type);
* I/O:
*/
-static const Tcl_ChannelType pipeChannelType = {
+static Tcl_ChannelType pipeChannelType = {
"pipe", /* Type name. */
TCL_CHANNEL_VERSION_5, /* v5 channel */
- TCL_CLOSE2PROC, /* Close proc. */
+ PipeCloseProc, /* Close proc. */
PipeInputProc, /* Input proc. */
PipeOutputProc, /* Output proc. */
NULL, /* Seek proc. */
@@ -88,7 +88,7 @@ static const Tcl_ChannelType pipeChannelType = {
NULL, /* Get option proc. */
PipeWatchProc, /* Initialize notifier. */
PipeGetHandleProc, /* Get OS handles out of channel. */
- PipeClose2Proc, /* close2proc. */
+ NULL, /* close2proc. */
PipeBlockModeProc, /* Set blocking or non-blocking mode.*/
NULL, /* flush proc. */
NULL, /* handler proc. */
@@ -118,13 +118,14 @@ TclpMakeFile(
Tcl_Channel channel, /* Channel to get file from. */
int direction) /* Either TCL_READABLE or TCL_WRITABLE. */
{
- void *data;
+ ClientData data;
- if (Tcl_GetChannelHandle(channel, direction, &data) != TCL_OK) {
- return NULL;
+ if (Tcl_GetChannelHandle(channel, direction,
+ (ClientData *) &data) == TCL_OK) {
+ return MakeFile(PTR2INT(data));
+ } else {
+ return (TclFile) NULL;
}
-
- return MakeFile(PTR2INT(data));
}
/*
@@ -152,7 +153,7 @@ TclpOpenFile(
const char *native;
Tcl_DString ds;
- native = Tcl_UtfToExternalDString(NULL, fname, TCL_INDEX_NONE, &ds);
+ native = Tcl_UtfToExternalDString(NULL, fname, -1, &ds);
fd = TclOSopen(native, mode, 0666); /* INTL: Native. */
Tcl_DStringFree(&ds);
if (fd != -1) {
@@ -164,7 +165,7 @@ TclpOpenFile(
*/
if ((mode & O_WRONLY) && !(mode & O_APPEND)) {
- TclOSseek(fd, 0, SEEK_END);
+ TclOSseek(fd, (Tcl_SeekOffset) 0, SEEK_END);
}
/*
@@ -199,24 +200,36 @@ TclFile
TclpCreateTempFile(
const char *contents) /* String to write into temp file, or NULL. */
{
- int fd = TclUnixOpenTemporaryFile(NULL, NULL, NULL, NULL);
+ char fileName[L_tmpnam + 9];
+ const char *native;
+ Tcl_DString dstring;
+ int fd;
+
+ /*
+ * We should also check against making more then TMP_MAX of these.
+ */
+ strcpy(fileName, DefaultTempDir()); /* INTL: Native. */
+ if (fileName[strlen(fileName) - 1] != '/') {
+ strcat(fileName, "/"); /* INTL: Native. */
+ }
+ strcat(fileName, "tclXXXXXX");
+ fd = mkstemp(fileName); /* INTL: Native. */
if (fd == -1) {
return NULL;
}
fcntl(fd, F_SETFD, FD_CLOEXEC);
- if (contents != NULL) {
- Tcl_DString dstring;
- char *native;
+ unlink(fileName); /* INTL: Native. */
- native = Tcl_UtfToExternalDString(NULL, contents, TCL_INDEX_NONE, &dstring);
+ if (contents != NULL) {
+ native = Tcl_UtfToExternalDString(NULL, contents, -1, &dstring);
if (write(fd, native, Tcl_DStringLength(&dstring)) == -1) {
close(fd);
Tcl_DStringFree(&dstring);
return NULL;
}
Tcl_DStringFree(&dstring);
- TclOSseek(fd, 0, SEEK_SET);
+ TclOSseek(fd, (Tcl_SeekOffset) 0, SEEK_SET);
}
return MakeFile(fd);
}
@@ -240,56 +253,67 @@ TclpCreateTempFile(
Tcl_Obj *
TclpTempFileName(void)
{
- Tcl_Obj *retVal, *nameObj;
+ char fileName[L_tmpnam + 9];
+ Tcl_Obj *result = NULL;
int fd;
- TclNewObj(nameObj);
- Tcl_IncrRefCount(nameObj);
- fd = TclUnixOpenTemporaryFile(NULL, NULL, NULL, nameObj);
+ /*
+ * We should also check against making more then TMP_MAX of these.
+ */
+
+ strcpy(fileName, DefaultTempDir()); /* INTL: Native. */
+ if (fileName[strlen(fileName) - 1] != '/') {
+ strcat(fileName, "/"); /* INTL: Native. */
+ }
+ strcat(fileName, "tclXXXXXX");
+ fd = mkstemp(fileName); /* INTL: Native. */
if (fd == -1) {
- Tcl_DecrRefCount(nameObj);
return NULL;
}
-
fcntl(fd, F_SETFD, FD_CLOEXEC);
- TclpObjDeleteFile(nameObj);
+ unlink(fileName); /* INTL: Native. */
+
+ result = TclpNativeToNormalized((ClientData) fileName);
close(fd);
- retVal = Tcl_DuplicateObj(nameObj);
- Tcl_DecrRefCount(nameObj);
- return retVal;
+ return result;
}
/*
- *----------------------------------------------------------------------------
- *
- * TclpTempFileNameForLibrary --
- *
- * Constructs a file name in the native file system where a dynamically
- * loaded library may be placed.
+ *----------------------------------------------------------------------
*
- * Results:
- * Returns the constructed file name. If an error occurs, returns NULL
- * and leaves an error message in the interpreter result.
+ * DefaultTempDir --
*
- * On Unix, it works to load a shared object from a file of any name, so this
- * function is merely a thin wrapper around TclpTempFileName().
+ * Helper that does *part* of what tempnam() does.
*
- *----------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
-Tcl_Obj *
-TclpTempFileNameForLibrary(
- Tcl_Interp *interp, /* Tcl interpreter. */
- TCL_UNUSED(Tcl_Obj *) /*path*/)
+static const char *
+DefaultTempDir(void)
{
- Tcl_Obj *retval = TclpTempFileName();
+ const char *dir;
+ struct stat buf;
+
+ dir = getenv("TMPDIR");
+ if (dir && dir[0] && stat(dir, &buf) == 0 && S_ISDIR(buf.st_mode)
+ && access(dir, W_OK)) {
+ return dir;
+ }
- if (retval == NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't create temporary file: %s",
- Tcl_PosixError(interp)));
+#ifdef P_tmpdir
+ dir = P_tmpdir;
+ if (stat(dir, &buf) == 0 && S_ISDIR(buf.st_mode) && access(dir, W_OK)) {
+ return dir;
}
- return retval;
+#endif
+
+ /*
+ * Assume that the default location ("/tmp" if not overridden) is always
+ * an existing writable directory; we've no recovery mechanism if it
+ * isn't.
+ */
+
+ return TCL_TEMPORARY_FILE_DIRECTORY;
}
/*
@@ -386,6 +410,7 @@ TclpCloseFile(
*---------------------------------------------------------------------------
*/
+ /* ARGSUSED */
int
TclpCreateProcess(
Tcl_Interp *interp, /* Interpreter in which to leave errors that
@@ -404,12 +429,12 @@ TclpCreateProcess(
* receive no standard input. */
TclFile outputFile, /* If non-NULL, gives the file that receives
* output from the child process. If
- * outputFile file is not writable or is
+ * outputFile file is not writeable or is
* NULL, output from the child will be
* discarded. */
TclFile errorFile, /* If non-NULL, gives the file that receives
* errors from the child process. If errorFile
- * file is not writable or is NULL, errors
+ * file is not writeable or is NULL, errors
* from the child will be discarded. errorFile
* may be the same as outputFile. */
Tcl_Pid *pidPtr) /* If this function is successful, pidPtr is
@@ -421,12 +446,7 @@ TclpCreateProcess(
char errSpace[200 + TCL_INTEGER_SPACE];
Tcl_DString *dsArray;
char **newArgv;
- int pid;
- int i;
-#if defined(HAVE_POSIX_SPAWNP)
- int childErrno;
- static int use_spawn = -1;
-#endif
+ int pid, i;
errPipeIn = NULL;
errPipeOut = NULL;
@@ -438,8 +458,8 @@ TclpCreateProcess(
*/
if (TclpCreatePipe(&errPipeIn, &errPipeOut) == 0) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't create pipe: %s", Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, "couldn't create pipe: ",
+ Tcl_PosixError(interp), NULL);
goto error;
}
@@ -448,99 +468,34 @@ TclpCreateProcess(
* deallocated later
*/
- dsArray = (Tcl_DString *)TclStackAlloc(interp, argc * sizeof(Tcl_DString));
- newArgv = (char **)TclStackAlloc(interp, (argc+1) * sizeof(char *));
+ dsArray = (Tcl_DString *)
+ TclStackAlloc(interp, argc * sizeof(Tcl_DString));
+ newArgv = (char **) TclStackAlloc(interp, (argc+1) * sizeof(char *));
newArgv[argc] = NULL;
for (i = 0; i < argc; i++) {
- newArgv[i] = Tcl_UtfToExternalDString(NULL, argv[i], TCL_INDEX_NONE, &dsArray[i]);
+ newArgv[i] = Tcl_UtfToExternalDString(NULL, argv[i], -1, &dsArray[i]);
}
-#if defined(HAVE_VFORK) || defined(HAVE_POSIX_SPAWNP)
+#ifdef USE_VFORK
/*
* After vfork(), do not call code in the child that changes global state,
* because it is using the parent's memory space at that point and writes
- * might corrupt the parent: so ensure standard channels are initialized
- * in the parent, otherwise SetupStdFile() might initialize them in the
- * child.
+ * might corrupt the parent: so ensure standard channels are initialized in
+ * the parent, otherwise SetupStdFile() might initialize them in the child.
*/
if (!inputFile) {
Tcl_GetStdChannel(TCL_STDIN);
}
if (!outputFile) {
- Tcl_GetStdChannel(TCL_STDOUT);
+ Tcl_GetStdChannel(TCL_STDOUT);
}
if (!errorFile) {
- Tcl_GetStdChannel(TCL_STDERR);
+ Tcl_GetStdChannel(TCL_STDERR);
}
#endif
-#ifdef HAVE_POSIX_SPAWNP
-#ifdef _CS_GNU_LIBC_VERSION
- if (use_spawn < 0) {
- char conf[32], *p;
- int major = 0, minor = 0;
-
- use_spawn = 0;
- memset(conf, 0, sizeof(conf));
- confstr(_CS_GNU_LIBC_VERSION, conf, sizeof(conf));
- p = strchr(conf, ' '); /* skip "glibc" */
- if (p != NULL) {
- ++p;
- if (sscanf(p, "%d.%d", &major, &minor) > 1) {
- if ((major > 2) || ((major == 2) && (minor >= 24))) {
- use_spawn = 1;
- }
- }
- }
- }
-#endif
- status = -1;
- if (use_spawn) {
- posix_spawn_file_actions_t actions;
- posix_spawnattr_t attr;
- sigset_t sigs;
-
- posix_spawn_file_actions_init(&actions);
- posix_spawnattr_init(&attr);
- sigfillset(&sigs);
- sigdelset(&sigs, SIGKILL);
- sigdelset(&sigs, SIGSTOP);
-
- posix_spawnattr_setflags(&attr, POSIX_SPAWN_SETSIGDEF
-#ifdef POSIX_SPAWN_USEVFORK
- | POSIX_SPAWN_USEVFORK
-#endif
- );
- posix_spawnattr_setsigdefault(&attr, &sigs);
-
- posix_spawn_file_actions_adddup2(&actions, GetFd(inputFile), 0);
- posix_spawn_file_actions_adddup2(&actions, GetFd(outputFile), 1);
- posix_spawn_file_actions_adddup2(&actions, GetFd(errorFile), 2);
-
- status = posix_spawnp(&pid, newArgv[0], &actions, &attr,
- newArgv, environ);
- childErrno = errno;
- posix_spawn_file_actions_destroy(&actions);
- posix_spawnattr_destroy(&attr);
-
- /*
- * Fork semantics:
- * - pid == 0: child process
- * - pid == -1: error
- * - pid > 0: parent process
- *
- * Mimic fork semantics to minimize changes below,
- * but retry with fork() as last ressort.
- */
- }
- if (status != 0) {
- pid = fork();
- childErrno = errno;
- }
-#else
pid = fork();
-#endif
if (pid == 0) {
size_t len;
int joinThisError = errorFile && (errorFile == outputFile);
@@ -556,8 +511,8 @@ TclpCreateProcess(
|| (!joinThisError && !SetupStdFile(errorFile, TCL_STDERR))
|| (joinThisError &&
((dup2(1,2) == -1) || (fcntl(2, F_SETFD, 0) != 0)))) {
- snprintf(errSpace, sizeof(errSpace),
- "%dforked process couldn't set up input/output", errno);
+ sprintf(errSpace,
+ "%dforked process couldn't set up input/output: ", errno);
len = strlen(errSpace);
if (len != (size_t) write(fd, errSpace, len)) {
Tcl_Panic("TclpCreateProcess: unable to write to errPipeOut");
@@ -571,11 +526,11 @@ TclpCreateProcess(
RestoreSignals();
execvp(newArgv[0], newArgv); /* INTL: Native. */
- snprintf(errSpace, sizeof(errSpace), "%dcouldn't execute \"%.150s\"", errno, argv[0]);
+ sprintf(errSpace, "%dcouldn't execute \"%.150s\": ", errno, argv[0]);
len = strlen(errSpace);
- if (len != (size_t) write(fd, errSpace, len)) {
+ if (len != (size_t) write(fd, errSpace, len)) {
Tcl_Panic("TclpCreateProcess: unable to write to errPipeOut");
- }
+ }
_exit(1);
}
@@ -590,11 +545,8 @@ TclpCreateProcess(
TclStackFree(interp, dsArray);
if (pid == -1) {
-#ifdef HAVE_POSIX_SPAWNP
- errno = childErrno;
-#endif
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't fork child process: %s", Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, "couldn't fork child process: ",
+ Tcl_PosixError(interp), NULL);
goto error;
}
@@ -608,14 +560,12 @@ TclpCreateProcess(
errPipeOut = NULL;
fd = GetFd(errPipeIn);
- count = read(fd, errSpace, sizeof(errSpace) - 1);
+ count = read(fd, errSpace, (size_t) (sizeof(errSpace) - 1));
if (count > 0) {
char *end;
-
errSpace[count] = 0;
errno = strtol(errSpace, &end, 10);
- Tcl_SetObjResult(interp, Tcl_ObjPrintf("%s: %s",
- end, Tcl_PosixError(interp)));
+ Tcl_AppendResult(interp, end, Tcl_PosixError(interp), NULL);
goto error;
}
@@ -632,7 +582,7 @@ TclpCreateProcess(
* here, since this is the error case. [Bug: 6148]
*/
- Tcl_WaitPid((Tcl_Pid)INT2PTR(pid), &status, 0);
+ Tcl_WaitPid((Tcl_Pid) INT2PTR(pid), &status, 0);
}
if (errPipeIn) {
@@ -828,7 +778,7 @@ TclpCreateCommandChannel(
{
char channelName[16 + TCL_INTEGER_SPACE];
int channelId;
- PipeState *statePtr = (PipeState *)ckalloc(sizeof(PipeState));
+ PipeState *statePtr = (PipeState *) ckalloc((unsigned) sizeof(PipeState));
int mode;
statePtr->inFile = readFile;
@@ -866,58 +816,15 @@ TclpCreateCommandChannel(
* natural to use "pipe%d".
*/
- snprintf(channelName, sizeof(channelName), "file%d", channelId);
+ sprintf(channelName, "file%d", channelId);
statePtr->channel = Tcl_CreateChannel(&pipeChannelType, channelName,
- statePtr, mode);
+ (ClientData) statePtr, mode);
return statePtr->channel;
}
/*
*----------------------------------------------------------------------
*
- * Tcl_CreatePipe --
- *
- * System dependent interface to create a pipe for the [chan pipe]
- * command. Stolen from TclX.
- *
- * Results:
- * TCL_OK or TCL_ERROR.
- *
- * Side effects:
- * Registers two channels.
- *
- *----------------------------------------------------------------------
- */
-
-int
-Tcl_CreatePipe(
- Tcl_Interp *interp, /* Errors returned in result. */
- Tcl_Channel *rchan, /* Returned read side. */
- Tcl_Channel *wchan, /* Returned write side. */
- TCL_UNUSED(int) /*flags*/) /* Reserved for future use. */
-{
- int fileNums[2];
-
- if (pipe(fileNums) < 0) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf("pipe creation failed: %s",
- Tcl_PosixError(interp)));
- return TCL_ERROR;
- }
-
- fcntl(fileNums[0], F_SETFD, FD_CLOEXEC);
- fcntl(fileNums[1], F_SETFD, FD_CLOEXEC);
-
- *rchan = Tcl_MakeFileChannel(INT2PTR(fileNums[0]), TCL_READABLE);
- Tcl_RegisterChannel(interp, *rchan);
- *wchan = Tcl_MakeFileChannel(INT2PTR(fileNums[1]), TCL_WRITABLE);
- Tcl_RegisterChannel(interp, *wchan);
-
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TclGetAndDetachPids --
*
* This function is invoked in the generic implementation of a
@@ -941,8 +848,8 @@ TclGetAndDetachPids(
{
PipeState *pipePtr;
const Tcl_ChannelType *chanTypePtr;
- Tcl_Obj *pidsObj;
int i;
+ char buf[TCL_INTEGER_SPACE];
/*
* Punt if the channel is not a command channel.
@@ -953,16 +860,14 @@ TclGetAndDetachPids(
return;
}
- pipePtr = (PipeState *)Tcl_GetChannelInstanceData(chan);
- TclNewObj(pidsObj);
+ pipePtr = (PipeState *) Tcl_GetChannelInstanceData(chan);
for (i = 0; i < pipePtr->numPids; i++) {
- Tcl_ListObjAppendElement(NULL, pidsObj, Tcl_NewWideIntObj(
- PTR2INT(pipePtr->pidPtr[i])));
- Tcl_DetachPids(1, &pipePtr->pidPtr[i]);
+ TclFormatInt(buf, (long) TclpGetPid(pipePtr->pidPtr[i]));
+ Tcl_AppendElement(interp, buf);
+ Tcl_DetachPids(1, &(pipePtr->pidPtr[i]));
}
- Tcl_SetObjResult(interp, pidsObj);
if (pipePtr->numPids > 0) {
- ckfree(pipePtr->pidPtr);
+ ckfree((char *) pipePtr->pidPtr);
pipePtr->numPids = 0;
}
}
@@ -984,22 +889,25 @@ TclGetAndDetachPids(
*----------------------------------------------------------------------
*/
+ /* ARGSUSED */
static int
PipeBlockModeProc(
- void *instanceData, /* Pipe state. */
+ ClientData instanceData, /* Pipe state. */
int mode) /* The mode to set. Can be one of
* TCL_MODE_BLOCKING or
* TCL_MODE_NONBLOCKING. */
{
- PipeState *psPtr = (PipeState *)instanceData;
+ PipeState *psPtr = instanceData;
- if (psPtr->inFile
- && TclUnixSetBlockingMode(GetFd(psPtr->inFile), mode) < 0) {
- return errno;
+ if (psPtr->inFile) {
+ if (TclUnixSetBlockingMode(GetFd(psPtr->inFile), mode) < 0) {
+ return errno;
+ }
}
- if (psPtr->outFile
- && TclUnixSetBlockingMode(GetFd(psPtr->outFile), mode) < 0) {
- return errno;
+ if (psPtr->outFile) {
+ if (TclUnixSetBlockingMode(GetFd(psPtr->outFile), mode) < 0) {
+ return errno;
+ }
}
psPtr->isNonBlocking = (mode == TCL_MODE_NONBLOCKING);
@@ -1010,10 +918,11 @@ PipeBlockModeProc(
/*
*----------------------------------------------------------------------
*
- * PipeClose2Proc
+ * PipeCloseProc --
*
* This function is invoked by the generic IO level to perform
- * pipeline-type-specific half or full-close.
+ * channel-type-specific cleanup when a command pipeline channel is
+ * closed.
*
* Results:
* 0 on success, errno otherwise.
@@ -1024,43 +933,30 @@ PipeBlockModeProc(
*----------------------------------------------------------------------
*/
+ /* ARGSUSED */
static int
-PipeClose2Proc(
- void *instanceData, /* The pipe to close. */
- Tcl_Interp *interp, /* For error reporting. */
- int flags) /* Flags that indicate which side to close. */
+PipeCloseProc(
+ ClientData instanceData, /* The pipe to close. */
+ Tcl_Interp *interp) /* For error reporting. */
{
- PipeState *pipePtr = (PipeState *)instanceData;
+ PipeState *pipePtr;
Tcl_Channel errChan;
int errorCode, result;
errorCode = 0;
result = 0;
-
- if (((!flags) || (flags & TCL_CLOSE_READ)) && (pipePtr->inFile != NULL)) {
+ pipePtr = (PipeState *) instanceData;
+ if (pipePtr->inFile) {
if (TclpCloseFile(pipePtr->inFile) < 0) {
errorCode = errno;
- } else {
- pipePtr->inFile = NULL;
}
}
- if (((!flags) || (flags & TCL_CLOSE_WRITE)) && (pipePtr->outFile != NULL)
- && (errorCode == 0)) {
- if (TclpCloseFile(pipePtr->outFile) < 0) {
+ if (pipePtr->outFile) {
+ if ((TclpCloseFile(pipePtr->outFile) < 0) && (errorCode == 0)) {
errorCode = errno;
- } else {
- pipePtr->outFile = NULL;
}
}
- /*
- * If half-closing, stop here.
- */
-
- if (flags) {
- return errorCode;
- }
-
if (pipePtr->isNonBlocking || TclInExit()) {
/*
* If the channel is non-blocking or Tcl is being cleaned up, just
@@ -1082,8 +978,7 @@ PipeClose2Proc(
if (pipePtr->errorFile) {
errChan = Tcl_MakeFileChannel(
- INT2PTR(GetFd(pipePtr->errorFile)),
- TCL_READABLE);
+ (ClientData) INT2PTR(GetFd(pipePtr->errorFile)), TCL_READABLE);
} else {
errChan = NULL;
}
@@ -1092,9 +987,9 @@ PipeClose2Proc(
}
if (pipePtr->numPids != 0) {
- ckfree(pipePtr->pidPtr);
+ ckfree((char *) pipePtr->pidPtr);
}
- ckfree(pipePtr);
+ ckfree((char *) pipePtr);
if (errorCode == 0) {
return result;
}
@@ -1121,13 +1016,13 @@ PipeClose2Proc(
static int
PipeInputProc(
- void *instanceData, /* Pipe state. */
+ ClientData instanceData, /* Pipe state. */
char *buf, /* Where to store data read. */
int toRead, /* How much space is available in the
* buffer? */
int *errorCodePtr) /* Where to store error code. */
{
- PipeState *psPtr = (PipeState *)instanceData;
+ PipeState *psPtr = (PipeState *) instanceData;
int bytesRead; /* How many bytes were actually read from the
* input device? */
@@ -1142,14 +1037,15 @@ PipeInputProc(
*/
do {
- bytesRead = read(GetFd(psPtr->inFile), buf, toRead);
+ bytesRead = read(GetFd(psPtr->inFile), buf, (size_t) toRead);
} while ((bytesRead < 0) && (errno == EINTR));
if (bytesRead < 0) {
*errorCodePtr = errno;
return -1;
+ } else {
+ return bytesRead;
}
- return bytesRead;
}
/*
@@ -1172,12 +1068,12 @@ PipeInputProc(
static int
PipeOutputProc(
- void *instanceData, /* Pipe state. */
+ ClientData instanceData, /* Pipe state. */
const char *buf, /* The data buffer. */
int toWrite, /* How many bytes to write? */
int *errorCodePtr) /* Where to store error code. */
{
- PipeState *psPtr = (PipeState *)instanceData;
+ PipeState *psPtr = (PipeState *) instanceData;
int written;
*errorCodePtr = 0;
@@ -1188,14 +1084,15 @@ PipeOutputProc(
*/
do {
- written = write(GetFd(psPtr->outFile), buf, toWrite);
+ written = write(GetFd(psPtr->outFile), buf, (size_t) toWrite);
} while ((written < 0) && (errno == EINTR));
if (written < 0) {
*errorCodePtr = errno;
return -1;
+ } else {
+ return written;
}
- return written;
}
/*
@@ -1215,35 +1112,22 @@ PipeOutputProc(
*----------------------------------------------------------------------
*/
-/*
- * Bug ad5a57f2f271: Tcl_NotifyChannel is not a Tcl_FileProc,
- * so do not pass it to directly to Tcl_CreateFileHandler.
- * Instead, pass a wrapper which is a Tcl_FileProc.
- */
-static void
-PipeWatchNotifyChannelWrapper(
- void *clientData,
- int mask)
-{
- Tcl_Channel channel = (Tcl_Channel)clientData;
- Tcl_NotifyChannel(channel, mask);
-}
-
static void
PipeWatchProc(
- void *instanceData, /* The pipe state. */
+ ClientData instanceData, /* The pipe state. */
int mask) /* Events of interest; an OR-ed combination of
* TCL_READABLE, TCL_WRITABLE and
* TCL_EXCEPTION. */
{
- PipeState *psPtr = (PipeState *)instanceData;
+ PipeState *psPtr = (PipeState *) instanceData;
int newmask;
if (psPtr->inFile) {
newmask = mask & (TCL_READABLE | TCL_EXCEPTION);
if (newmask) {
- Tcl_CreateFileHandler(GetFd(psPtr->inFile), newmask,
- PipeWatchNotifyChannelWrapper, psPtr->channel);
+ Tcl_CreateFileHandler(GetFd(psPtr->inFile), mask,
+ (Tcl_FileProc *) Tcl_NotifyChannel,
+ (ClientData) psPtr->channel);
} else {
Tcl_DeleteFileHandler(GetFd(psPtr->inFile));
}
@@ -1251,8 +1135,9 @@ PipeWatchProc(
if (psPtr->outFile) {
newmask = mask & (TCL_WRITABLE | TCL_EXCEPTION);
if (newmask) {
- Tcl_CreateFileHandler(GetFd(psPtr->outFile), newmask,
- PipeWatchNotifyChannelWrapper, psPtr->channel);
+ Tcl_CreateFileHandler(GetFd(psPtr->outFile), mask,
+ (Tcl_FileProc *) Tcl_NotifyChannel,
+ (ClientData) psPtr->channel);
} else {
Tcl_DeleteFileHandler(GetFd(psPtr->outFile));
}
@@ -1279,18 +1164,18 @@ PipeWatchProc(
static int
PipeGetHandleProc(
- void *instanceData, /* The pipe state. */
+ ClientData instanceData, /* The pipe state. */
int direction, /* TCL_READABLE or TCL_WRITABLE */
- void **handlePtr) /* Where to store the handle. */
+ ClientData *handlePtr) /* Where to store the handle. */
{
- PipeState *psPtr = (PipeState *)instanceData;
+ PipeState *psPtr = (PipeState *) instanceData;
if (direction == TCL_READABLE && psPtr->inFile) {
- *handlePtr = INT2PTR(GetFd(psPtr->inFile));
+ *handlePtr = (ClientData) INT2PTR(GetFd(psPtr->inFile));
return TCL_OK;
}
if (direction == TCL_WRITABLE && psPtr->outFile) {
- *handlePtr = INT2PTR(GetFd(psPtr->outFile));
+ *handlePtr = (ClientData) INT2PTR(GetFd(psPtr->outFile));
return TCL_OK;
}
return TCL_ERROR;
@@ -1346,35 +1231,37 @@ Tcl_WaitPid(
*----------------------------------------------------------------------
*/
+ /* ARGSUSED */
int
Tcl_PidObjCmd(
- TCL_UNUSED(void *),
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument strings. */
{
- Tcl_Channel chan;
- PipeState *pipePtr;
- int i;
- Tcl_Obj *resultPtr;
-
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?channelId?");
return TCL_ERROR;
}
if (objc == 1) {
- Tcl_SetObjResult(interp, Tcl_NewWideIntObj(getpid()));
+ Tcl_SetObjResult(interp, Tcl_NewLongObj((long) getpid()));
} else {
/*
* Get the channel and make sure that it refers to a pipe.
*/
+ Tcl_Channel chan;
+ const Tcl_ChannelType *chanTypePtr;
+ PipeState *pipePtr;
+ int i;
+ Tcl_Obj *resultPtr, *longObjPtr;
chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), NULL);
- if (chan == NULL) {
+ if (chan == (Tcl_Channel) NULL) {
return TCL_ERROR;
}
- if (Tcl_GetChannelType(chan) != &pipeChannelType) {
+ chanTypePtr = Tcl_GetChannelType(chan);
+ if (chanTypePtr != &pipeChannelType) {
return TCL_OK;
}
@@ -1382,11 +1269,11 @@ Tcl_PidObjCmd(
* Extract the process IDs from the pipe structure.
*/
- pipePtr = (PipeState *)Tcl_GetChannelInstanceData(chan);
- TclNewObj(resultPtr);
+ pipePtr = (PipeState *) Tcl_GetChannelInstanceData(chan);
+ resultPtr = Tcl_NewObj();
for (i = 0; i < pipePtr->numPids; i++) {
- Tcl_ListObjAppendElement(NULL, resultPtr,
- Tcl_NewWideIntObj(PTR2INT(TclpGetPid(pipePtr->pidPtr[i]))));
+ longObjPtr = Tcl_NewLongObj((long) TclpGetPid(pipePtr->pidPtr[i]));
+ Tcl_ListObjAppendElement(NULL, resultPtr, longObjPtr);
}
Tcl_SetObjResult(interp, resultPtr);
}
diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h
index f9fd702..965014e 100644
--- a/unix/tclUnixPort.h
+++ b/unix/tclUnixPort.h
@@ -1,22 +1,23 @@
/*
* tclUnixPort.h --
*
- * This header file handles porting issues that occur because of
- * differences between systems. It reads in UNIX-related header files and
- * sets up UNIX-related macros for Tcl's UNIX core. It should be the only
- * file that contains #ifdefs to handle different flavors of UNIX. This
- * file sets up the union of all UNIX-related things needed by any of the
- * Tcl core files. This file depends on configuration #defines such as
- * HAVE_SYS_PARAM_H that are set up by the "configure" script.
+ * This header file handles porting issues that occur because
+ * of differences between systems. It reads in UNIX-related
+ * header files and sets up UNIX-related macros for Tcl's UNIX
+ * core. It should be the only file that contains #ifdefs to
+ * handle different flavors of UNIX. This file sets up the
+ * union of all UNIX-related things needed by any of the Tcl
+ * core files. This file depends on configuration #defines such
+ * as NO_DIRENT_H that are set up by the "configure" script.
*
- * Much of the material in this file was originally contributed by Karl
- * Lehenbauer, Mark Diekhans and Peter da Silva.
+ * Much of the material in this file was originally contributed
+ * by Karl Lehenbauer, Mark Diekhans and Peter da Silva.
*
* Copyright (c) 1991-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _TCLUNIXPORT
@@ -40,7 +41,15 @@
# include <sys/param.h>
#endif
#include <sys/types.h>
-#include <dirent.h>
+#ifdef USE_DIRENT2_H
+# include "../compat/dirent2.h"
+#else
+#ifdef NO_DIRENT_H
+# include "../compat/dirent.h"
+#else
+# include <dirent.h>
+#endif
+#endif
/*
*---------------------------------------------------------------------------
@@ -49,23 +58,12 @@
*/
#ifdef HAVE_STRUCT_DIRENT64
-typedef struct dirent64 Tcl_DirEntry;
+typedef struct dirent64 Tcl_DirEntry;
# define TclOSreaddir readdir64
#else
-typedef struct dirent Tcl_DirEntry;
+typedef struct dirent Tcl_DirEntry;
# define TclOSreaddir readdir
#endif
-#ifdef HAVE_DIR64
-typedef DIR64 TclDIR;
-# define TclOSopendir opendir64
-# define TclOSrewinddir rewinddir64
-# define TclOSclosedir closedir64
-#else
-typedef DIR TclDIR;
-# define TclOSopendir opendir
-# define TclOSrewinddir rewinddir
-# define TclOSclosedir closedir
-#endif
#ifdef HAVE_TYPE_OFF64_T
typedef off64_t Tcl_SeekOffset;
@@ -78,192 +76,172 @@ typedef off_t Tcl_SeekOffset;
#endif
#ifdef __CYGWIN__
-#ifdef __cplusplus
-extern "C" {
-#endif
+
/* Make some symbols available without including <windows.h> */
# define DWORD unsigned int
# define CP_UTF8 65001
# define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
# define HANDLE void *
# define HINSTANCE void *
-# define HMODULE void *
-# define MAX_PATH 260
# define SOCKET unsigned int
# define WSAEWOULDBLOCK 10035
- typedef unsigned short WCHAR;
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wignored-attributes"
-#endif
- __declspec(dllimport) extern __stdcall int GetModuleHandleExW(unsigned int, const void *, void *);
- __declspec(dllimport) extern __stdcall int GetModuleFileNameW(void *, const void *, int);
- __declspec(dllimport) extern __stdcall int WideCharToMultiByte(int, int, const void *, int,
- char *, int, const char *, void *);
- __declspec(dllimport) extern __stdcall int MultiByteToWideChar(int, int, const char *, int,
- WCHAR *, int);
- __declspec(dllimport) extern __stdcall void OutputDebugStringW(const WCHAR *);
- __declspec(dllimport) extern __stdcall int IsDebuggerPresent(void);
- __declspec(dllimport) extern __stdcall int GetLastError(void);
- __declspec(dllimport) extern __stdcall int GetFileAttributesW(const WCHAR *);
- __declspec(dllimport) extern __stdcall int SetFileAttributesW(const WCHAR *, int);
+ __declspec(dllimport) extern __stdcall int GetModuleHandleExW(unsigned int, const char *, void *);
+ __declspec(dllimport) extern __stdcall int GetModuleFileNameW(void *, const char *, int);
+ __declspec(dllimport) extern __stdcall int WideCharToMultiByte(int, int, const char *, int,
+ const char *, int, const char *, const char *);
+
__declspec(dllimport) extern int cygwin_conv_path(int, const void *, void *, int);
-#ifdef __clang__
-#pragma clang diagnostic pop
+/* On Cygwin, the environment is imported from the Cygwin DLL. */
+#ifndef __x86_64__
+# define environ __cygwin_environ
+ extern char **__cygwin_environ;
#endif
# define timezone _timezone
- extern int TclOSfstat(int fd, void *statBuf);
extern int TclOSstat(const char *name, void *statBuf);
extern int TclOSlstat(const char *name, void *statBuf);
-#ifdef __cplusplus
-}
-#endif
#elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
-# define TclOSfstat(fd, buf) fstat64(fd, (struct stat64 *)buf)
-# define TclOSstat(name, buf) stat64(name, (struct stat64 *)buf)
-# define TclOSlstat(name,buf) lstat64(name, (struct stat64 *)buf)
+# define TclOSstat stat64
+# define TclOSlstat lstat64
#else
-# define TclOSfstat(fd, buf) fstat(fd, (struct stat *)buf)
-# define TclOSstat(name, buf) stat(name, (struct stat *)buf)
-# define TclOSlstat(name, buf) lstat(name, (struct stat *)buf)
+# define TclOSstat stat
+# define TclOSlstat lstat
#endif
-
-/*
- *---------------------------------------------------------------------------
- * Miscellaneous includes that might be missing.
- *---------------------------------------------------------------------------
- */
#include <sys/file.h>
#ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif
#include <sys/stat.h>
-#ifdef HAVE_SYS_TIME_H
+#if TIME_WITH_SYS_TIME
# include <sys/time.h>
+# include <time.h>
+#else
+#if HAVE_SYS_TIME_H
+# include <sys/time.h>
+#else
+# include <time.h>
+#endif
#endif
-#include <time.h>
#ifndef NO_SYS_WAIT_H
# include <sys/wait.h>
#endif
-#ifdef HAVE_INTTYPES_H
+#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
-#include <limits.h>
-#include <unistd.h>
+#ifdef NO_LIMITS_H
+# include "../compat/limits.h"
+#else
+# include <limits.h>
+#endif
+#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#else
+# include "../compat/unistd.h"
+#endif
-MODULE_SCOPE int TclUnixSetBlockingMode(int fd, int mode);
+extern int TclUnixSetBlockingMode(int fd, int mode);
#include <utime.h>
-
+
/*
- *---------------------------------------------------------------------------
- * Socket support stuff: This likely needs more work to parameterize for each
- * system.
- *---------------------------------------------------------------------------
+ * Socket support stuff: This likely needs more work to parameterize for
+ * each system.
*/
-
#include <sys/socket.h> /* struct sockaddr, SOCK_STREAM, ... */
#ifndef NO_UNAME
# include <sys/utsname.h> /* uname system call. */
#endif
#include <netinet/in.h> /* struct in_addr, struct sockaddr_in */
#include <arpa/inet.h> /* inet_ntoa() */
-#include <netdb.h> /* getaddrinfo() */
-#ifdef NEED_FAKE_RFC2553
-# include "../compat/fake-rfc2553.h"
-#endif
-
+#include <netdb.h> /* gethostbyname() */
+
/*
- *---------------------------------------------------------------------------
- * Some platforms (e.g. SunOS) don't define FLT_MAX and FLT_MIN, so we look
- * for an alternative definition. If no other alternative is available we use
- * a reasonable guess.
- *---------------------------------------------------------------------------
+ * Some platforms (e.g. SunOS) don't define FLT_MAX and FLT_MIN, so we
+ * look for an alternative definition. If no other alternative is available
+ * we use a reasonable guess.
*/
-#include <float.h>
+#ifndef NO_FLOAT_H
+# include <float.h>
+#else
+#ifndef NO_VALUES_H
+# include <values.h>
+#endif
+#endif
#ifndef FLT_MAX
# ifdef MAXFLOAT
-# define FLT_MAX MAXFLOAT
+# define FLT_MAX MAXFLOAT
# else
-# define FLT_MAX 3.402823466E+38F
+# define FLT_MAX 3.402823466E+38F
# endif
#endif
#ifndef FLT_MIN
# ifdef MINFLOAT
-# define FLT_MIN MINFLOAT
+# define FLT_MIN MINFLOAT
# else
-# define FLT_MIN 1.175494351E-38F
+# define FLT_MIN 1.175494351E-38F
# endif
#endif
-
+
/*
- *---------------------------------------------------------------------------
* NeXT doesn't define O_NONBLOCK, so #define it here if necessary.
- *---------------------------------------------------------------------------
*/
#ifndef O_NONBLOCK
# define O_NONBLOCK 0x80
#endif
-
+
/*
- *---------------------------------------------------------------------------
- * The type of the status returned by wait varies from UNIX system to UNIX
- * system. The macro below defines it:
- *---------------------------------------------------------------------------
+ * The type of the status returned by wait varies from UNIX system
+ * to UNIX system. The macro below defines it:
*/
#ifdef _AIX
-# define WAIT_STATUS_TYPE pid_t
+# define WAIT_STATUS_TYPE pid_t
#else
#ifndef NO_UNION_WAIT
-# define WAIT_STATUS_TYPE union wait
+# define WAIT_STATUS_TYPE union wait
#else
-# define WAIT_STATUS_TYPE int
+# define WAIT_STATUS_TYPE int
#endif
#endif
-
+
/*
- *---------------------------------------------------------------------------
- * Supply definitions for macros to query wait status, if not already defined
- * in header files above.
- *---------------------------------------------------------------------------
+ * Supply definitions for macros to query wait status, if not already
+ * defined in header files above.
*/
#ifndef WIFEXITED
-# define WIFEXITED(stat) (((*((int *) &(stat))) & 0xFF) == 0)
+# define WIFEXITED(stat) (((*((int *) &(stat))) & 0xff) == 0)
#endif
#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xFF)
+# define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xff)
#endif
#ifndef WIFSIGNALED
-# define WIFSIGNALED(stat) \
- (((*((int *) &(stat)))) && ((*((int *) &(stat))) \
- == ((*((int *) &(stat))) & 0x00FF)))
+# define WIFSIGNALED(stat) (((*((int *) &(stat)))) && ((*((int *) &(stat))) == ((*((int *) &(stat))) & 0x00ff)))
#endif
#ifndef WTERMSIG
-# define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7F)
+# define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7f)
#endif
#ifndef WIFSTOPPED
-# define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xFF) == 0177)
+# define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xff) == 0177)
#endif
#ifndef WSTOPSIG
-# define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xFF)
+# define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xff)
#endif
-
+
/*
- *---------------------------------------------------------------------------
- * Define constants for waitpid() system call if they aren't defined by a
- * system header file.
- *---------------------------------------------------------------------------
+ * Define constants for waitpid() system call if they aren't defined
+ * by a system header file.
*/
#ifndef WNOHANG
@@ -272,12 +250,10 @@ MODULE_SCOPE int TclUnixSetBlockingMode(int fd, int mode);
#ifndef WUNTRACED
# define WUNTRACED 2
#endif
-
+
/*
- *---------------------------------------------------------------------------
- * Supply macros for seek offsets, if they're not already provided by an
- * include file.
- *---------------------------------------------------------------------------
+ * Supply macros for seek offsets, if they're not already provided by
+ * an include file.
*/
#ifndef SEEK_SET
@@ -289,62 +265,50 @@ MODULE_SCOPE int TclUnixSetBlockingMode(int fd, int mode);
#ifndef SEEK_END
# define SEEK_END 2
#endif
-
+
/*
- *---------------------------------------------------------------------------
- * The stuff below is needed by the "time" command. If this system has no
+ * The stuff below is needed by the "time" command. If this system has no
* gettimeofday call, then must use times() instead.
- *---------------------------------------------------------------------------
*/
#ifdef NO_GETTOD
# include <sys/times.h>
-#else
-# ifdef HAVE_BSDGETTIMEOFDAY
-# define gettimeofday BSDgettimeofday
-# endif
#endif
#ifdef GETTOD_NOT_DECLARED
-extern int gettimeofday(struct timeval *tp,
+extern int gettimeofday (struct timeval *tp,
struct timezone *tzp);
#endif
-
+
/*
- *---------------------------------------------------------------------------
* Define access mode constants if they aren't already defined.
- *---------------------------------------------------------------------------
*/
#ifndef F_OK
-# define F_OK 00
+# define F_OK 00
#endif
#ifndef X_OK
-# define X_OK 01
+# define X_OK 01
#endif
#ifndef W_OK
-# define W_OK 02
+# define W_OK 02
#endif
#ifndef R_OK
-# define R_OK 04
+# define R_OK 04
#endif
-
+
/*
- *---------------------------------------------------------------------------
- * Define FD_CLOEEXEC (the close-on-exec flag bit) if it isn't already
- * defined.
- *---------------------------------------------------------------------------
+ * Define FD_CLOEEXEC (the close-on-exec flag bit) if it isn't
+ * already defined.
*/
#ifndef FD_CLOEXEC
-# define FD_CLOEXEC 1
+# define FD_CLOEXEC 1
#endif
-
+
/*
- *---------------------------------------------------------------------------
- * On systems without symbolic links (i.e. S_IFLNK isn't defined) define
- * "lstat" to use "stat" instead.
- *---------------------------------------------------------------------------
+ * On systems without symbolic links (i.e. S_IFLNK isn't defined)
+ * define "lstat" to use "stat" instead.
*/
#ifndef S_IFLNK
@@ -353,278 +317,270 @@ extern int gettimeofday(struct timeval *tp,
# define lstat64 stat64
# define TclOSlstat TclOSstat
#endif
-
+
/*
- *---------------------------------------------------------------------------
- * Define macros to query file type bits, if they're not already defined.
- *---------------------------------------------------------------------------
+ * Define macros to query file type bits, if they're not already
+ * defined.
*/
#ifndef S_ISREG
# ifdef S_IFREG
-# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
# else
-# define S_ISREG(m) 0
+# define S_ISREG(m) 0
# endif
#endif /* !S_ISREG */
#ifndef S_ISDIR
# ifdef S_IFDIR
-# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
# else
-# define S_ISDIR(m) 0
+# define S_ISDIR(m) 0
# endif
#endif /* !S_ISDIR */
#ifndef S_ISCHR
# ifdef S_IFCHR
-# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
+# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
# else
-# define S_ISCHR(m) 0
+# define S_ISCHR(m) 0
# endif
#endif /* !S_ISCHR */
-
#ifndef S_ISBLK
# ifdef S_IFBLK
-# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
# else
-# define S_ISBLK(m) 0
+# define S_ISBLK(m) 0
# endif
#endif /* !S_ISBLK */
-
#ifndef S_ISFIFO
# ifdef S_IFIFO
-# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
# else
-# define S_ISFIFO(m) 0
+# define S_ISFIFO(m) 0
# endif
#endif /* !S_ISFIFO */
-
#ifndef S_ISLNK
# ifdef S_IFLNK
-# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
# else
-# define S_ISLNK(m) 0
+# define S_ISLNK(m) 0
# endif
#endif /* !S_ISLNK */
-
#ifndef S_ISSOCK
# ifdef S_IFSOCK
-# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
# else
-# define S_ISSOCK(m) 0
+# define S_ISSOCK(m) 0
# endif
#endif /* !S_ISSOCK */
-
+
/*
- *---------------------------------------------------------------------------
* Make sure that MAXPATHLEN and MAXNAMLEN are defined.
- *---------------------------------------------------------------------------
*/
#ifndef MAXPATHLEN
# ifdef PATH_MAX
-# define MAXPATHLEN PATH_MAX
+# define MAXPATHLEN PATH_MAX
# else
-# define MAXPATHLEN 2048
+# define MAXPATHLEN 2048
# endif
#endif
#ifndef MAXNAMLEN
# ifdef NAME_MAX
-# define MAXNAMLEN NAME_MAX
+# define MAXNAMLEN NAME_MAX
# else
-# define MAXNAMLEN 255
+# define MAXNAMLEN 255
# endif
#endif
-
+
/*
- *---------------------------------------------------------------------------
- * The following macro defines the type of the mask arguments to select:
- *---------------------------------------------------------------------------
+ * Make sure that L_tmpnam is defined.
+ */
+
+#ifndef L_tmpnam
+# define L_tmpnam 100
+#endif
+
+/*
+ * The following macro defines the type of the mask arguments to
+ * select:
*/
#ifndef NO_FD_SET
-# define SELECT_MASK fd_set
+# define SELECT_MASK fd_set
#else /* NO_FD_SET */
# ifndef _AIX
- typedef long fd_mask;
+ typedef long fd_mask;
# endif /* !AIX */
# if defined(_IBMR2)
-# define SELECT_MASK void
+# define SELECT_MASK void
# else /* !defined(_IBMR2) */
-# define SELECT_MASK int
+# define SELECT_MASK int
# endif /* defined(_IBMR2) */
#endif /* !NO_FD_SET */
-
+
/*
- *---------------------------------------------------------------------------
* Define "NBBY" (number of bits per byte) if it's not already defined.
- *---------------------------------------------------------------------------
*/
#ifndef NBBY
-# define NBBY 8
+# define NBBY 8
#endif
-
+
/*
- *---------------------------------------------------------------------------
* The following macro defines the number of fd_masks in an fd_set:
- *---------------------------------------------------------------------------
*/
#ifndef FD_SETSIZE
# ifdef OPEN_MAX
-# define FD_SETSIZE OPEN_MAX
+# define FD_SETSIZE OPEN_MAX
# else
-# define FD_SETSIZE 256
+# define FD_SETSIZE 256
# endif
#endif /* FD_SETSIZE */
-
-#ifndef howmany
-# define howmany(x, y) (((x)+((y)-1))/(y))
+#if !defined(howmany)
+# define howmany(x, y) (((x)+((y)-1))/(y))
#endif /* !defined(howmany) */
-
#ifndef NFDBITS
-# define NFDBITS NBBY*sizeof(fd_mask)
+# define NFDBITS NBBY*sizeof(fd_mask)
#endif /* NFDBITS */
+#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS)
-#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS)
-
/*
- *---------------------------------------------------------------------------
- * Not all systems declare the errno variable in errno.h, so this file does it
- * explicitly. The list of system error messages also isn't generally declared
- * in a header file anywhere.
- *---------------------------------------------------------------------------
+ * Not all systems declare the errno variable in errno.h. so this
+ * file does it explicitly. The list of system error messages also
+ * isn't generally declared in a header file anywhere.
*/
#ifdef NO_ERRNO
extern int errno;
#endif /* NO_ERRNO */
-
+
/*
- *---------------------------------------------------------------------------
- * Not all systems declare all the errors that Tcl uses! Provide some
+ * Not all systems declare all the errors that Tcl uses! Provide some
* work-arounds...
- *---------------------------------------------------------------------------
*/
#ifndef EOVERFLOW
# ifdef EFBIG
-# define EOVERFLOW EFBIG
+# define EOVERFLOW EFBIG
# else /* !EFBIG */
-# define EOVERFLOW EINVAL
+# define EOVERFLOW EINVAL
# endif /* EFBIG */
#endif /* EOVERFLOW */
-
+
/*
- *---------------------------------------------------------------------------
* Variables provided by the C library:
- *---------------------------------------------------------------------------
*/
#if defined(__APPLE__) && defined(__DYNAMIC__)
# include <crt_externs.h>
-# define environ (*_NSGetEnviron())
-# define USE_PUTENV 1
+# define environ (*_NSGetEnviron())
+# define USE_PUTENV 1
#else
# if defined(_sgi) || defined(__sgi)
-# define environ _environ
+# define environ _environ
# endif
-extern char ** environ;
+extern char **environ;
#endif
-
+
+/*
+ * There is no platform-specific panic routine for Unix in the Tcl internals.
+ */
+
+#define TclpPanic ((Tcl_PanicProc *) NULL)
+
/*
- *---------------------------------------------------------------------------
* Darwin specifc configure overrides.
- *---------------------------------------------------------------------------
*/
#ifdef __APPLE__
-
/*
- *---------------------------------------------------------------------------
* Support for fat compiles: configure runs only once for multiple architectures
- *---------------------------------------------------------------------------
*/
-
# if defined(__LP64__) && defined (NO_COREFOUNDATION_64)
-# undef HAVE_COREFOUNDATION
-# endif /* __LP64__ && NO_COREFOUNDATION_64 */
+# undef HAVE_COREFOUNDATION
+# endif /* __LP64__ && NO_COREFOUNDATION_64 */
# include <sys/cdefs.h>
# ifdef __DARWIN_UNIX03
-# if __DARWIN_UNIX03
-# undef HAVE_PUTENV_THAT_COPIES
-# else
-# define HAVE_PUTENV_THAT_COPIES 1
-# endif
+# if __DARWIN_UNIX03
+# undef HAVE_PUTENV_THAT_COPIES
+# else
+# define HAVE_PUTENV_THAT_COPIES 1
+# endif
# endif /* __DARWIN_UNIX03 */
-
/*
- *---------------------------------------------------------------------------
+ * The termios configure test program relies on the configure script being run
+ * from a terminal, which is not the case e.g. when configuring from Xcode.
+ * Since termios is known to be present on all Mac OS X releases since 10.0,
+ * override the configure defines for serial API here. [Bug 497147]
+ */
+# define USE_TERMIOS 1
+# undef USE_TERMIO
+# undef USE_SGTTY
+/*
* Include AvailabilityMacros.h here (when available) to ensure any symbolic
* MAC_OS_X_VERSION_* constants passed on the command line are translated.
- *---------------------------------------------------------------------------
*/
-
# ifdef HAVE_AVAILABILITYMACROS_H
-# include <AvailabilityMacros.h>
+# include <AvailabilityMacros.h>
# endif
-
/*
- *---------------------------------------------------------------------------
* Support for weak import.
- *---------------------------------------------------------------------------
*/
-
# ifdef HAVE_WEAK_IMPORT
-# if !defined(HAVE_AVAILABILITYMACROS_H) || !defined(MAC_OS_X_VERSION_MIN_REQUIRED)
-# undef HAVE_WEAK_IMPORT
-# else
-# ifndef WEAK_IMPORT_ATTRIBUTE
-# define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
-# endif
-# endif
+# if !defined(HAVE_AVAILABILITYMACROS_H) || !defined(MAC_OS_X_VERSION_MIN_REQUIRED)
+# undef HAVE_WEAK_IMPORT
+# else
+# ifndef WEAK_IMPORT_ATTRIBUTE
+# define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
+# endif
+# endif
# endif /* HAVE_WEAK_IMPORT */
-
/*
- *---------------------------------------------------------------------------
* Support for MAC_OS_X_VERSION_MAX_ALLOWED define from AvailabilityMacros.h:
* only use API available in the indicated OS version or earlier.
- *---------------------------------------------------------------------------
*/
-
# ifdef MAC_OS_X_VERSION_MAX_ALLOWED
-# if MAC_OS_X_VERSION_MAX_ALLOWED < 1050 && defined(__LP64__)
-# undef HAVE_COREFOUNDATION
-# endif
-# if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
-# undef HAVE_OSSPINLOCKLOCK
-# undef HAVE_PTHREAD_ATFORK
-# undef HAVE_COPYFILE
-# endif
-# if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
- /* prior to 10.3, realpath is not threadsafe, c.f. bug 711232 */
-# define NO_REALPATH 1
-# undef HAVE_LANGINFO
-# endif
+# if MAC_OS_X_VERSION_MAX_ALLOWED < 1050 && defined(__LP64__)
+# undef HAVE_COREFOUNDATION
+# endif
+# if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
+# undef HAVE_OSSPINLOCKLOCK
+# undef HAVE_PTHREAD_ATFORK
+# undef HAVE_COPYFILE
+# endif
+# if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
+# ifdef TCL_THREADS
+ /* prior to 10.3, realpath is not threadsafe, c.f. bug 711232 */
+# define NO_REALPATH 1
+# endif
+# undef HAVE_LANGINFO
+# endif
# endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
# if defined(HAVE_COREFOUNDATION) && defined(__LP64__) && \
defined(HAVE_WEAK_IMPORT) && MAC_OS_X_VERSION_MIN_REQUIRED < 1050
-# warning "Weak import of 64-bit CoreFoundation is not supported, will not run on Mac OS X < 10.5."
+# warning "Weak import of 64-bit CoreFoundation is not supported, will not run on Mac OS X < 10.5."
# endif
- /*
- * For now, test exec-17.1 fails (I/O setup after closing stdout) with
- * posix_spawnp(), but the classic implementation (based on fork()+execvp())
- * works well under macOS.
- */
-# undef HAVE_POSIX_SPAWNP
-# undef HAVE_VFORK
+/*
+ * At present, using vfork() instead of fork() causes execve() to fail
+ * intermittently on Darwin x86_64. rdar://4685553
+ */
+# if defined(__x86_64__) && !defined(FIXED_RDAR_4685553)
+# undef USE_VFORK
+# endif /* __x86_64__ */
+/* Workaround problems with vfork() when building with llvm-gcc-4.2 */
+# if defined (__llvm__) && \
+ (__GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 2 || \
+ (__GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ > 0))))
+# undef USE_VFORK
+# endif /* __llvm__ */
#endif /* __APPLE__ */
-
+
/*
*---------------------------------------------------------------------------
- * The following macros and declarations represent the interface between
- * generic and unix-specific parts of Tcl. Some of the macros may override
+ * The following macros and declarations represent the interface between
+ * generic and unix-specific parts of Tcl. Some of the macros may override
* functions declared in tclInt.h.
*---------------------------------------------------------------------------
*/
@@ -639,70 +595,69 @@ typedef int socklen_t;
#else
#define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_LF
#endif
-
+
/*
- *---------------------------------------------------------------------------
- * The following macros have trivial definitions, allowing generic code to
+ * The following macros have trivial definitions, allowing generic code to
* address platform-specific issues.
- *---------------------------------------------------------------------------
*/
#define TclpReleaseFile(file) /* Nothing. */
-
+
/*
- *---------------------------------------------------------------------------
* The following defines wrap the system memory allocation routines.
- *---------------------------------------------------------------------------
*/
-#define TclpSysAlloc(size, isBin) malloc((size_t)(size))
-#define TclpSysFree(ptr) free((char *)(ptr))
-#define TclpSysRealloc(ptr, size) realloc((char *)(ptr), (size_t)(size))
-
+#define TclpSysAlloc(size, isBin) malloc((size_t)size)
+#define TclpSysFree(ptr) free((char*)ptr)
+#define TclpSysRealloc(ptr, size) realloc((char*)ptr, (size_t)size)
+
/*
- *---------------------------------------------------------------------------
- * The following macros and declaration wrap the C runtime library functions.
- *---------------------------------------------------------------------------
+ * The following macros and declaration wrap the C runtime library
+ * functions.
*/
-#define TclpExit exit
+#define TclpExit exit
-#if !defined(TCL_THREADS) || TCL_THREADS
-# include <pthread.h>
+#ifdef TCL_THREADS
+# include <pthread.h>
+/* #define localtime(x) TclpLocaltime(x)
+ * #define gmtime(x) TclpGmtime(x) */
+# undef inet_ntoa
+# define inet_ntoa(x) TclpInetNtoa(x)
+# ifdef HAVE_PTHREAD_ATTR_GET_NP
+# define TclpPthreadGetAttrs pthread_attr_get_np
+# ifdef ATTRGETNP_NOT_DECLARED
+/*
+ * Assume it is in pthread_np.h if it isn't in pthread.h. [Bug 1064882]
+ * We might need to revisit this in the future. :^(
+ */
+# include <pthread_np.h>
+# endif
+# else
+# ifdef HAVE_PTHREAD_GETATTR_NP
+# define TclpPthreadGetAttrs pthread_getattr_np
+# ifdef GETATTRNP_NOT_DECLARED
+extern int pthread_getattr_np (pthread_t, pthread_attr_t *);
+# endif
+# endif /* HAVE_PTHREAD_GETATTR_NP */
+# endif /* HAVE_PTHREAD_ATTR_GET_NP */
#endif /* TCL_THREADS */
-/* FIXME - Hyper-enormous platform assumption! */
-#ifndef AF_INET6
-# define AF_INET6 10
-#endif
-
/*
- *---------------------------------------------------------------------------
- * Set of MT-safe implementations of some known-to-be-MT-unsafe library calls.
- * Instead of returning pointers to the static storage, those return pointers
+ * Set of MT-safe implementations of some
+ * known-to-be-MT-unsafe library calls.
+ * Instead of returning pointers to the
+ * static storage, those return pointers
* to the TSD data.
- *---------------------------------------------------------------------------
*/
-#include <pwd.h>
#include <grp.h>
-MODULE_SCOPE struct passwd * TclpGetPwNam(const char *name);
-MODULE_SCOPE struct group * TclpGetGrNam(const char *name);
-MODULE_SCOPE struct passwd * TclpGetPwUid(uid_t uid);
-MODULE_SCOPE struct group * TclpGetGrGid(gid_t gid);
-MODULE_SCOPE struct hostent * TclpGetHostByName(const char *name);
-MODULE_SCOPE struct hostent * TclpGetHostByAddr(const char *addr,
- int length, int type);
-MODULE_SCOPE void *TclpMakeTcpClientChannelMode(
- void *tcpSocket, int mode);
+extern struct passwd* TclpGetPwNam(const char *name);
+extern struct group* TclpGetGrNam(const char *name);
+extern struct passwd* TclpGetPwUid(uid_t uid);
+extern struct group* TclpGetGrGid(gid_t gid);
+extern struct hostent* TclpGetHostByName(const char *name);
+extern struct hostent* TclpGetHostByAddr(const char *addr, int length, int type);
#endif /* _TCLUNIXPORT */
-
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 4
- * fill-column: 78
- * End:
- */
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index 2195ab0..a2b4015 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.c
@@ -3,179 +3,13 @@
*
* This file contains Unix-specific socket related code.
*
- * Copyright © 1995 Sun Microsystems, Inc.
+ * Copyright (c) 1995 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tclInt.h"
-#include <netinet/tcp.h>
-
-/*
- * Helper macros to make parts of this file clearer. The macros do exactly
- * what they say on the tin. :-) They also only ever refer to their arguments
- * once, and so can be used without regard to side effects.
- */
-
-#define SET_BITS(var, bits) ((var) |= (bits))
-#define CLEAR_BITS(var, bits) ((var) &= ~(bits))
-#define GOT_BITS(var, bits) (((var) & (bits)) != 0)
-
-/* "sock" + a pointer in hex + \0 */
-#define SOCK_CHAN_LENGTH (4 + sizeof(void *) * 2 + 1)
-#define SOCK_TEMPLATE "sock%" TCL_Z_MODIFIER "x"
-
-#undef SOCKET /* Possible conflict with win32 SOCKET */
-
-/*
- * This is needed to comply with the strict aliasing rules of GCC, but it also
- * simplifies casting between the different sockaddr types.
- */
-
-typedef union {
- struct sockaddr sa;
- struct sockaddr_in sa4;
- struct sockaddr_in6 sa6;
- struct sockaddr_storage sas;
-} address;
-
-/*
- * This structure describes per-instance state of a tcp-based channel.
- */
-
-typedef struct TcpState TcpState;
-
-typedef struct TcpFdList {
- TcpState *statePtr;
- int fd;
- struct TcpFdList *next;
-} TcpFdList;
-
-struct TcpState {
- Tcl_Channel channel; /* Channel associated with this file. */
- int flags; /* OR'ed combination of the bitfields defined
- * below. */
- TcpFdList fds; /* The file descriptors of the sockets. */
- int interest; /* Event types of interest */
-
- /*
- * Only needed for server sockets
- */
-
- Tcl_TcpAcceptProc *acceptProc;
- /* Proc to call on accept. */
- void *acceptProcData; /* The data for the accept proc. */
-
- /*
- * Only needed for client sockets
- */
-
- struct addrinfo *addrlist; /* Addresses to connect to. */
- struct addrinfo *addr; /* Iterator over addrlist. */
- struct addrinfo *myaddrlist;/* Local address. */
- struct addrinfo *myaddr; /* Iterator over myaddrlist. */
- int filehandlers; /* Caches FileHandlers that get set up while
- * an async socket is not yet connected. */
- int connectError; /* Cache SO_ERROR of async socket. */
- int cachedBlocking; /* Cache blocking mode of async socket. */
-};
-
-/*
- * These bits may be OR'ed together into the "flags" field of a TcpState
- * structure.
- */
-
-#define TCP_NONBLOCKING (1<<0) /* Socket with non-blocking I/O */
-#define TCP_ASYNC_CONNECT (1<<1) /* Async connect in progress. */
-#define TCP_ASYNC_PENDING (1<<4) /* TcpConnect was called to
- * process an async connect. This
- * flag indicates that reentry is
- * still pending */
-#define TCP_ASYNC_FAILED (1<<5) /* An async connect finally failed */
-
-#define TCP_ASYNC_TEST_MODE (1<<8) /* Async testing activated. Do not
- * automatically continue connection
- * process. */
-
-/*
- * The following defines the maximum length of the listen queue. This is the
- * number of outstanding yet-to-be-serviced requests for a connection on a
- * server socket, more than this number of outstanding requests and the
- * connection request will fail.
- */
-
-#ifndef SOMAXCONN
-# define SOMAXCONN 100
-#elif (SOMAXCONN < 100)
-# undef SOMAXCONN
-# define SOMAXCONN 100
-#endif /* SOMAXCONN < 100 */
-
-/*
- * The following defines how much buffer space the kernel should maintain for
- * a socket.
- */
-
-#define SOCKET_BUFSIZE 4096
-
-/*
- * Static routines for this file:
- */
-
-static void TcpAsyncCallback(void *clientData, int mask);
-static int TcpConnect(Tcl_Interp *interp, TcpState *state);
-static void TcpAccept(void *data, int mask);
-static int TcpBlockModeProc(void *data, int mode);
-static int TcpCloseProc(void *instanceData,
- Tcl_Interp *interp);
-static int TcpClose2Proc(void *instanceData,
- Tcl_Interp *interp, int flags);
-static int TcpGetHandleProc(void *instanceData,
- int direction, void **handlePtr);
-static int TcpGetOptionProc(void *instanceData,
- Tcl_Interp *interp, const char *optionName,
- Tcl_DString *dsPtr);
-static int TcpInputProc(void *instanceData, char *buf,
- int toRead, int *errorCode);
-static int TcpOutputProc(void *instanceData,
- const char *buf, int toWrite, int *errorCode);
-static int TcpSetOptionProc(void *instanceData,
- Tcl_Interp *interp, const char *optionName,
- const char *value);
-static void TcpThreadActionProc(void *instanceData, int action);
-static void TcpWatchProc(void *instanceData, int mask);
-static int WaitForConnect(TcpState *statePtr, int *errorCodePtr);
-static Tcl_FileProc WrapNotify;
-
-/*
- * This structure describes the channel type structure for TCP socket
- * based IO:
- */
-
-static const Tcl_ChannelType tcpChannelType = {
- "tcp", /* Type name. */
- TCL_CHANNEL_VERSION_5, /* v5 channel */
-#ifndef TCL_NO_DEPRECATED
- TcpCloseProc, /* Close proc. */
-#else
- TCL_CLOSE2PROC, /* Close proc. */
-#endif
- TcpInputProc, /* Input proc. */
- TcpOutputProc, /* Output proc. */
- NULL, /* Seek proc. */
- TcpSetOptionProc, /* Set option proc. */
- TcpGetOptionProc, /* Get option proc. */
- TcpWatchProc, /* Initialize notifier. */
- TcpGetHandleProc, /* Get OS handles out of channel. */
- TcpClose2Proc, /* Close2 proc. */
- TcpBlockModeProc, /* Set blocking or non-blocking mode.*/
- NULL, /* flush proc. */
- NULL, /* handler proc. */
- NULL, /* wide seek proc. */
- TcpThreadActionProc, /* thread action proc. */
- NULL /* truncate proc. */
-};
/*
* The following variable holds the network name of this host.
@@ -184,27 +18,10 @@ static const Tcl_ChannelType tcpChannelType = {
static TclInitProcessGlobalValueProc InitializeHostName;
static ProcessGlobalValue hostName =
{0, 0, NULL, NULL, InitializeHostName, NULL, NULL};
-
-#if 0
-/* printf debugging */
-void
-printaddrinfo(
- struct addrinfo *addrlist,
- char *prefix)
-{
- char host[NI_MAXHOST], port[NI_MAXSERV];
- struct addrinfo *ai;
- for (ai = addrlist; ai != NULL; ai = ai->ai_next) {
- getnameinfo(ai->ai_addr, ai->ai_addrlen,
- host, sizeof(host), port, sizeof(port),
- NI_NUMERICHOST|NI_NUMERICSERV);
- fprintf(stderr,"%s: %s:%s\n", prefix, host, port);
- }
-}
-#endif
+
/*
- * ----------------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* InitializeHostName --
*
@@ -214,23 +31,23 @@ printaddrinfo(
* Results:
* None.
*
- * ----------------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static void
InitializeHostName(
char **valuePtr,
- unsigned int *lengthPtr,
+ int *lengthPtr,
Tcl_Encoding *encodingPtr)
{
- const char *native = NULL;
+ CONST char *native = NULL;
#ifndef NO_UNAME
struct utsname u;
struct hostent *hp;
memset(&u, (int) 0, sizeof(struct utsname));
- if (uname(&u) >= 0) { /* INTL: Native. */
+ if (uname(&u) > -1) { /* INTL: Native. */
hp = TclpGetHostByName(u.nodename); /* INTL: Native. */
if (hp == NULL) {
/*
@@ -242,9 +59,9 @@ InitializeHostName(
char *dot = strchr(u.nodename, '.');
if (dot != NULL) {
- char *node = (char *)ckalloc(dot - u.nodename + 1);
+ char *node = ckalloc((unsigned) (dot - u.nodename + 1));
- memcpy(node, u.nodename, dot - u.nodename);
+ memcpy(node, u.nodename, (size_t) (dot - u.nodename));
node[dot - u.nodename] = '\0';
hp = TclpGetHostByName(node);
ckfree(node);
@@ -256,7 +73,10 @@ InitializeHostName(
native = u.nodename;
}
}
-#else /* !NO_UNAME */
+ if (native == NULL) {
+ native = tclEmptyStringRep;
+ }
+#else
/*
* Uname doesn't exist; try gethostname instead.
*
@@ -272,31 +92,25 @@ InitializeHostName(
* Fix suggested by Viktor Dukhovni (viktor@esm.com)
*/
-# if defined(SYS_NMLN) && (SYS_NMLEN >= 256)
+# if defined(SYS_NMLN) && SYS_NMLEN >= 256
char buffer[SYS_NMLEN];
# else
char buffer[256];
# endif
- if (gethostname(buffer, sizeof(buffer)) >= 0) { /* INTL: Native. */
+ if (gethostname(buffer, sizeof(buffer)) > -1) { /* INTL: Native. */
native = buffer;
}
-#endif /* NO_UNAME */
+#endif
*encodingPtr = Tcl_GetEncoding(NULL, NULL);
- if (native) {
- *lengthPtr = strlen(native);
- *valuePtr = (char *)ckalloc(*lengthPtr + 1);
- memcpy(*valuePtr, native, *lengthPtr + 1);
- } else {
- *lengthPtr = 0;
- *valuePtr = (char *)ckalloc(1);
- *valuePtr[0] = '\0';
- }
+ *lengthPtr = strlen(native);
+ *valuePtr = ckalloc((unsigned int) (*lengthPtr)+1);
+ memcpy(*valuePtr, (void *) native, (size_t)(*lengthPtr)+1);
}
/*
- * ----------------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Tcl_GetHostName --
*
@@ -310,577 +124,24 @@ InitializeHostName(
* Side effects:
* Caches the name to return for future calls.
*
- * ----------------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
-const char *
+CONST char *
Tcl_GetHostName(void)
{
return Tcl_GetString(TclGetProcessGlobalValue(&hostName));
}
/*
- * ----------------------------------------------------------------------
- *
- * TclpFinalizeSockets --
- *
- * Performs per-thread socket subsystem finalization.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- * ----------------------------------------------------------------------
- */
-
-void
-TclpFinalizeSockets(void)
-{
- return;
-}
-
-/*
- * ----------------------------------------------------------------------
- *
- * TcpBlockModeProc --
- *
- * This function is invoked by the generic IO level to set blocking and
- * nonblocking mode on a TCP socket based channel.
- *
- * Results:
- * 0 if successful, errno when failed.
- *
- * Side effects:
- * Sets the device into blocking or nonblocking mode.
- *
- * ----------------------------------------------------------------------
- */
-
-static int
-TcpBlockModeProc(
- void *instanceData, /* Socket state. */
- int mode) /* The mode to set. Can be one of
- * TCL_MODE_BLOCKING or
- * TCL_MODE_NONBLOCKING. */
-{
- TcpState *statePtr = (TcpState *)instanceData;
-
- if (mode == TCL_MODE_BLOCKING) {
- CLEAR_BITS(statePtr->flags, TCP_NONBLOCKING);
- } else {
- SET_BITS(statePtr->flags, TCP_NONBLOCKING);
- }
- if (GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT)) {
- statePtr->cachedBlocking = mode;
- return 0;
- }
- if (TclUnixSetBlockingMode(statePtr->fds.fd, mode) < 0) {
- return errno;
- }
- return 0;
-}
-
-/*
- * ----------------------------------------------------------------------
- *
- * WaitForConnect --
- *
- * Check the state of an async connect process. If a connection attempt
- * terminated, process it, which may finalize it or may start the next
- * attempt. If a connect error occurs, it is saved in
- * statePtr->connectError to be reported by 'fconfigure -error'.
- *
- * There are two modes of operation, defined by errorCodePtr:
- * * non-NULL: Called by explicit read/write command. Blocks if the
- * socket is blocking.
- * May return two error codes:
- * * EWOULDBLOCK: if connect is still in progress
- * * ENOTCONN: if connect failed. This would be the error message
- * of a recv or sendto syscall so this is emulated here.
- * * NULL: Called by a background operation. Do not block and do not
- * return any error code.
- *
- * Results:
- * 0 if the connection has completed, -1 if still in progress or there is
- * an error.
- *
- * Side effects:
- * Processes socket events off the system queue. May process
- * asynchronous connects.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-WaitForConnect(
- TcpState *statePtr, /* State of the socket. */
- int *errorCodePtr)
-{
- int timeout;
-
- /*
- * Check if an async connect failed already and error reporting is
- * demanded, return the error ENOTCONN
- */
-
- if (errorCodePtr != NULL && GOT_BITS(statePtr->flags, TCP_ASYNC_FAILED)) {
- *errorCodePtr = ENOTCONN;
- return -1;
- }
-
- /*
- * Check if an async connect is running. If not return ok.
- */
-
- if (!GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING)) {
- return 0;
- }
-
- /*
- * In socket test mode do not continue with the connect.
- * Exceptions are:
- * - Call by recv/send and blocking socket
- * (errorCodePtr != NULL && !GOT_BITS(flags, TCP_NONBLOCKING))
- */
-
- if (GOT_BITS(statePtr->flags, TCP_ASYNC_TEST_MODE)
- && !(errorCodePtr != NULL
- && !GOT_BITS(statePtr->flags, TCP_NONBLOCKING))) {
- *errorCodePtr = EWOULDBLOCK;
- return -1;
- }
-
- if (errorCodePtr == NULL || GOT_BITS(statePtr->flags, TCP_NONBLOCKING)) {
- timeout = 0;
- } else {
- timeout = -1;
- }
- do {
- if (TclUnixWaitForFile(statePtr->fds.fd,
- TCL_WRITABLE | TCL_EXCEPTION, timeout) != 0) {
- TcpConnect(NULL, statePtr);
- }
-
- /*
- * Do this only once in the nonblocking case and repeat it until the
- * socket is final when blocking.
- */
- } while (timeout == -1 && GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT));
-
- if (errorCodePtr != NULL) {
- if (GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING)) {
- *errorCodePtr = EAGAIN;
- return -1;
- } else if (statePtr->connectError != 0) {
- *errorCodePtr = ENOTCONN;
- return -1;
- }
- }
- return 0;
-}
-
-/*
*----------------------------------------------------------------------
*
- * TcpInputProc --
- *
- * This function is invoked by the generic IO level to read input from a
- * TCP socket based channel.
+ * TclpHasSockets --
*
- * NOTE: We cannot share code with FilePipeInputProc because here we must
- * use recv to obtain the input from the channel, not read.
+ * Detect if sockets are available on this platform.
*
* Results:
- * The number of bytes read is returned or -1 on error. An output
- * argument contains the POSIX error code on error, or zero if no error
- * occurred.
- *
- * Side effects:
- * Reads input from the input device of the channel.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-TcpInputProc(
- void *instanceData, /* Socket state. */
- char *buf, /* Where to store data read. */
- int bufSize, /* How much space is available in the
- * buffer? */
- int *errorCodePtr) /* Where to store error code. */
-{
- TcpState *statePtr = (TcpState *)instanceData;
- int bytesRead;
-
- *errorCodePtr = 0;
- if (WaitForConnect(statePtr, errorCodePtr) != 0) {
- return -1;
- }
- bytesRead = recv(statePtr->fds.fd, buf, bufSize, 0);
- if (bytesRead >= 0) {
- return bytesRead;
- }
- if (errno == ECONNRESET) {
- /*
- * Turn ECONNRESET into a soft EOF condition.
- */
-
- return 0;
- }
- *errorCodePtr = errno;
- return -1;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TcpOutputProc --
- *
- * This function is invoked by the generic IO level to write output to a
- * TCP socket based channel.
- *
- * NOTE: We cannot share code with FilePipeOutputProc because here we
- * must use send, not write, to get reliable error reporting.
- *
- * Results:
- * The number of bytes written is returned. An output argument is set to
- * a POSIX error code if an error occurred, or zero.
- *
- * Side effects:
- * Writes output on the output device of the channel.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-TcpOutputProc(
- void *instanceData, /* Socket state. */
- const char *buf, /* The data buffer. */
- int toWrite, /* How many bytes to write? */
- int *errorCodePtr) /* Where to store error code. */
-{
- TcpState *statePtr = (TcpState *)instanceData;
- int written;
-
- *errorCodePtr = 0;
- if (WaitForConnect(statePtr, errorCodePtr) != 0) {
- return -1;
- }
- written = send(statePtr->fds.fd, buf, toWrite, 0);
-
- if (written >= 0) {
- return written;
- }
- *errorCodePtr = errno;
- return -1;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TcpCloseProc --
- *
- * This function is invoked by the generic IO level to perform
- * channel-type-specific cleanup when a TCP socket based channel is
- * closed.
- *
- * Results:
- * 0 if successful, the value of errno if failed.
- *
- * Side effects:
- * Closes the socket of the channel.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-TcpCloseProc(
- void *instanceData, /* The socket to close. */
- TCL_UNUSED(Tcl_Interp *))
-{
- TcpState *statePtr = (TcpState *)instanceData;
- int errorCode = 0;
- TcpFdList *fds;
-
- /*
- * Delete a file handler that may be active for this socket if this is a
- * server socket - the file handler was created automatically by Tcl as
- * part of the mechanism to accept new client connections. Channel
- * handlers are already deleted in the generic IO channel closing code
- * that called this function, so we do not have to delete them here.
- */
-
- for (fds = &statePtr->fds; fds != NULL; fds = fds->next) {
- if (fds->fd < 0) {
- continue;
- }
- Tcl_DeleteFileHandler(fds->fd);
- if (close(fds->fd) < 0) {
- errorCode = errno;
- }
-
- }
- fds = statePtr->fds.next;
- while (fds != NULL) {
- TcpFdList *next = fds->next;
-
- ckfree(fds);
- fds = next;
- }
- if (statePtr->addrlist != NULL) {
- freeaddrinfo(statePtr->addrlist);
- }
- if (statePtr->myaddrlist != NULL) {
- freeaddrinfo(statePtr->myaddrlist);
- }
- ckfree(statePtr);
- return errorCode;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TcpClose2Proc --
- *
- * This function is called by the generic IO level to perform the channel
- * type specific part of a half-close: namely, a shutdown() on a socket.
- *
- * Results:
- * 0 if successful, the value of errno if failed.
- *
- * Side effects:
- * Shuts down one side of the socket.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-TcpClose2Proc(
- void *instanceData, /* The socket to close. */
- TCL_UNUSED(Tcl_Interp *),
- int flags) /* Flags that indicate which side to close. */
-{
- TcpState *statePtr = (TcpState *)instanceData;
- int readError = 0;
- int writeError = 0;
-
- /*
- * Shutdown the OS socket handle.
- */
- if ((flags & (TCL_CLOSE_READ|TCL_CLOSE_WRITE)) == 0) {
- return TcpCloseProc(instanceData, NULL);
- }
- if ((flags & TCL_CLOSE_READ) && (shutdown(statePtr->fds.fd, SHUT_RD) < 0)) {
- readError = errno;
- }
- if ((flags & TCL_CLOSE_WRITE) && (shutdown(statePtr->fds.fd, SHUT_WR) < 0)) {
- writeError = errno;
- }
- return (readError != 0) ? readError : writeError;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TcpHostPortList --
- *
- * This function is called by the -gethostname and -getpeername switches
- * of TcpGetOptionProc() to add three list elements with the textual
- * representation of the given address to the given DString.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Adds three elements do dsPtr
- *
- *----------------------------------------------------------------------
- */
-
-#ifndef NEED_FAKE_RFC2553
-#if defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5))))
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wstrict-aliasing"
-#endif
-static inline int
-IPv6AddressNeedsNumericRendering(
- struct in6_addr addr)
-{
- if (IN6_ARE_ADDR_EQUAL(&addr, &in6addr_any)) {
- return 1;
- }
-
- /*
- * The IN6_IS_ADDR_V4MAPPED macro has a problem with aliasing warnings on
- * at least some versions of OSX.
- */
-
- if (!IN6_IS_ADDR_V4MAPPED(&addr)) {
- return 0;
- }
-
- return (addr.s6_addr[12] == 0 && addr.s6_addr[13] == 0
- && addr.s6_addr[14] == 0 && addr.s6_addr[15] == 0);
-}
-#if defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5))))
-#pragma GCC diagnostic pop
-#endif
-#endif /* NEED_FAKE_RFC2553 */
-
-static void
-TcpHostPortList(
- Tcl_Interp *interp,
- Tcl_DString *dsPtr,
- address addr,
- socklen_t salen)
-{
-#define SUPPRESS_RDNS_VAR "::tcl::unsupported::noReverseDNS"
- char host[NI_MAXHOST], nhost[NI_MAXHOST], nport[NI_MAXSERV];
- int flags = 0;
-
- getnameinfo(&addr.sa, salen, nhost, sizeof(nhost), nport, sizeof(nport),
- NI_NUMERICHOST | NI_NUMERICSERV);
- Tcl_DStringAppendElement(dsPtr, nhost);
-
- /*
- * We don't want to resolve INADDR_ANY and sin6addr_any; they can
- * sometimes cause problems (and never have a name).
- */
-
- if (addr.sa.sa_family == AF_INET) {
- if (addr.sa4.sin_addr.s_addr == INADDR_ANY) {
- flags |= NI_NUMERICHOST;
- }
-#ifndef NEED_FAKE_RFC2553
- } else if (addr.sa.sa_family == AF_INET6) {
- if (IPv6AddressNeedsNumericRendering(addr.sa6.sin6_addr)) {
- flags |= NI_NUMERICHOST;
- }
-#endif /* NEED_FAKE_RFC2553 */
- }
-
- /*
- * Check if reverse DNS has been switched off globally.
- */
-
- if (interp != NULL &&
- Tcl_GetVar2(interp, SUPPRESS_RDNS_VAR, NULL, 0) != NULL) {
- flags |= NI_NUMERICHOST;
- }
- if (getnameinfo(&addr.sa, salen, host, sizeof(host), NULL, 0,
- flags) == 0) {
- /*
- * Reverse mapping worked.
- */
-
- Tcl_DStringAppendElement(dsPtr, host);
- } else {
- /*
- * Reverse mapping failed - use the numeric rep once more.
- */
-
- Tcl_DStringAppendElement(dsPtr, nhost);
- }
- Tcl_DStringAppendElement(dsPtr, nport);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TcpSetOptionProc --
- *
- * Sets TCP channel specific options.
- *
- * Results:
- * None, unless an error happens.
- *
- * Side effects:
- * Changes attributes of the socket at the system level.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-TcpSetOptionProc(
- void *instanceData, /* Socket state. */
- Tcl_Interp *interp, /* For error reporting - can be NULL. */
- const char *optionName, /* Name of the option to set. */
- const char *value) /* New value for option. */
-{
- TcpState *statePtr = (TcpState *)instanceData;
- size_t len = 0;
-
- if (optionName != NULL) {
- len = strlen(optionName);
- }
-
- if ((len > 1) && (optionName[1] == 'k') &&
- (strncmp(optionName, "-keepalive", len) == 0)) {
- int val = 0, ret;
-
- if (Tcl_GetBoolean(interp, value, &val) != TCL_OK) {
- return TCL_ERROR;
- }
-#if defined(SO_KEEPALIVE)
- ret = setsockopt(statePtr->fds.fd, SOL_SOCKET, SO_KEEPALIVE,
- (const char *) &val, sizeof(int));
-#else
- ret = -1;
- Tcl_SetErrno(ENOTSUP);
-#endif
- if (ret < 0) {
- if (interp) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't set socket option: %s",
- Tcl_PosixError(interp)));
- }
- return TCL_ERROR;
- }
- return TCL_OK;
- }
- if ((len > 1) && (optionName[1] == 'n') &&
- (strncmp(optionName, "-nodelay", len) == 0)) {
- int val = 0, ret;
-
- if (Tcl_GetBoolean(interp, value, &val) != TCL_OK) {
- return TCL_ERROR;
- }
-#if defined(SOL_TCP) && defined(TCP_NODELAY)
- ret = setsockopt(statePtr->fds.fd, SOL_TCP, TCP_NODELAY,
- (const char *) &val, sizeof(int));
-#else
- ret = -1;
- Tcl_SetErrno(ENOTSUP);
-#endif
- if (ret < 0) {
- if (interp) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't set socket option: %s",
- Tcl_PosixError(interp)));
- }
- return TCL_ERROR;
- }
- return TCL_OK;
- }
- return Tcl_BadChannelOption(interp, optionName, "keepalive nodelay");
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TcpGetOptionProc --
- *
- * Computes an option value for a TCP socket based channel, or a list of
- * all options and their values.
- *
- * Note: This code is based on code contributed by John Haxby.
- *
- * Results:
- * A standard Tcl result. The value of the specified option or a list of
- * all options and their values is returned in the supplied DString. Sets
- * Error message if needed.
+ * Returns TCL_OK.
*
* Side effects:
* None.
@@ -888,1063 +149,33 @@ TcpSetOptionProc(
*----------------------------------------------------------------------
*/
-static int
-TcpGetOptionProc(
- void *instanceData, /* Socket state. */
- Tcl_Interp *interp, /* For error reporting - can be NULL. */
- const char *optionName, /* Name of the option to retrieve the value
- * for, or NULL to get all options and their
- * values. */
- Tcl_DString *dsPtr) /* Where to store the computed value;
- * initialized by caller. */
-{
- TcpState *statePtr = (TcpState *)instanceData;
- size_t len = 0;
-
- if (optionName != NULL) {
- len = strlen(optionName);
- }
-
- if ((len > 1) && (optionName[1] == 'e') &&
- (strncmp(optionName, "-error", len) == 0)) {
- socklen_t optlen = sizeof(int);
-
- WaitForConnect(statePtr, NULL);
- if (GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT)) {
- /*
- * Suppress errors as long as we are not done.
- */
-
- errno = 0;
- } else if (statePtr->connectError != 0) {
- errno = statePtr->connectError;
- statePtr->connectError = 0;
- } else {
- int err;
-
- getsockopt(statePtr->fds.fd, SOL_SOCKET, SO_ERROR, (char *) &err,
- &optlen);
- errno = err;
- }
- if (errno != 0) {
- Tcl_DStringAppend(dsPtr, Tcl_ErrnoMsg(errno), TCL_INDEX_NONE);
- }
- return TCL_OK;
- }
-
- if ((len > 1) && (optionName[1] == 'c') &&
- (strncmp(optionName, "-connecting", len) == 0)) {
- WaitForConnect(statePtr, NULL);
- Tcl_DStringAppend(dsPtr,
- GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT) ? "1" : "0", TCL_INDEX_NONE);
- return TCL_OK;
- }
-
- if ((len == 0) || ((len > 1) && (optionName[1] == 'p') &&
- (strncmp(optionName, "-peername", len) == 0))) {
- address peername;
- socklen_t size = sizeof(peername);
-
- WaitForConnect(statePtr, NULL);
- if (GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT)) {
- /*
- * In async connect output an empty string
- */
-
- if (len == 0) {
- Tcl_DStringAppendElement(dsPtr, "-peername");
- Tcl_DStringAppendElement(dsPtr, "");
- } else {
- return TCL_OK;
- }
- } else if (getpeername(statePtr->fds.fd, &peername.sa, &size) >= 0) {
- /*
- * Peername fetch succeeded - output list
- */
-
- if (len == 0) {
- Tcl_DStringAppendElement(dsPtr, "-peername");
- Tcl_DStringStartSublist(dsPtr);
- }
- TcpHostPortList(interp, dsPtr, peername, size);
- if (len) {
- return TCL_OK;
- }
- Tcl_DStringEndSublist(dsPtr);
- } else {
- /*
- * getpeername failed - but if we were asked for all the options
- * (len==0), don't flag an error at that point because it could be
- * an fconfigure request on a server socket (which have no peer).
- * Same must be done on win&mac.
- */
-
- if (len) {
- if (interp) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "can't get peername: %s",
- Tcl_PosixError(interp)));
- }
- return TCL_ERROR;
- }
- }
- }
-
- if ((len == 0) || ((len > 1) && (optionName[1] == 's') &&
- (strncmp(optionName, "-sockname", len) == 0))) {
- TcpFdList *fds;
- address sockname;
- socklen_t size;
- int found = 0;
-
- WaitForConnect(statePtr, NULL);
- if (len == 0) {
- Tcl_DStringAppendElement(dsPtr, "-sockname");
- Tcl_DStringStartSublist(dsPtr);
- }
- if (GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT)) {
- /*
- * In async connect output an empty string
- */
-
- found = 1;
- } else {
- for (fds = &statePtr->fds; fds != NULL; fds = fds->next) {
- size = sizeof(sockname);
- if (getsockname(fds->fd, &(sockname.sa), &size) >= 0) {
- found = 1;
- TcpHostPortList(interp, dsPtr, sockname, size);
- }
- }
- }
- if (found) {
- if (len) {
- return TCL_OK;
- }
- Tcl_DStringEndSublist(dsPtr);
- } else {
- if (interp) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "can't get sockname: %s", Tcl_PosixError(interp)));
- }
- return TCL_ERROR;
- }
- }
-
- if ((len == 0) || ((len > 1) && (optionName[1] == 'k') &&
- (strncmp(optionName, "-keepalive", len) == 0))) {
- int opt = 0;
-#if defined(SO_KEEPALIVE)
- socklen_t size = sizeof(opt);
-#endif
-
- if (len == 0) {
- Tcl_DStringAppendElement(dsPtr, "-keepalive");
- }
-#if defined(SO_KEEPALIVE)
- getsockopt(statePtr->fds.fd, SOL_SOCKET, SO_KEEPALIVE,
- (char *) &opt, &size);
-#endif
- Tcl_DStringAppendElement(dsPtr, opt ? "1" : "0");
- if (len > 0) {
- return TCL_OK;
- }
- }
-
- if ((len == 0) || ((len > 1) && (optionName[1] == 'n') &&
- (strncmp(optionName, "-nodelay", len) == 0))) {
- int opt = 0;
-#if defined(SOL_TCP) && defined(TCP_NODELAY)
- socklen_t size = sizeof(opt);
-#endif
-
- if (len == 0) {
- Tcl_DStringAppendElement(dsPtr, "-nodelay");
- }
-#if defined(SOL_TCP) && defined(TCP_NODELAY)
- getsockopt(statePtr->fds.fd, SOL_TCP, TCP_NODELAY,
- (char *) &opt, &size);
-#endif
- Tcl_DStringAppendElement(dsPtr, opt ? "1" : "0");
- if (len > 0) {
- return TCL_OK;
- }
- }
-
- if (len > 0) {
- return Tcl_BadChannelOption(interp, optionName,
- "connecting keepalive nodelay peername sockname");
- }
-
- return TCL_OK;
-}
-
-/*
- * ----------------------------------------------------------------------
- *
- * TcpThreadActionProc --
- *
- * Handles detach/attach for asynchronously connecting socket.
- *
- * Reassigning the file handler associated with thread-related channel
- * notification, responsible for callbacks (signaling that asynchronous
- * connection attempt has succeeded or failed).
- *
- * Results:
- * None.
- *
- * ----------------------------------------------------------------------
- */
-
-static void
-TcpThreadActionProc(
- void *instanceData,
- int action)
-{
- TcpState *statePtr = (TcpState *)instanceData;
-
- if (GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT)) {
- /*
- * Async-connecting socket must get reassigned handler if it have been
- * transferred to another thread. Remove the handler if the socket is
- * not managed by this thread anymore and create new handler (TSD related)
- * so the callback will run in the correct thread, bug [f583715154].
- */
- switch (action) {
- case TCL_CHANNEL_THREAD_REMOVE:
- CLEAR_BITS(statePtr->flags, TCP_ASYNC_PENDING);
- Tcl_DeleteFileHandler(statePtr->fds.fd);
- break;
- case TCL_CHANNEL_THREAD_INSERT:
- Tcl_CreateFileHandler(statePtr->fds.fd,
- TCL_WRITABLE | TCL_EXCEPTION, TcpAsyncCallback, statePtr);
- SET_BITS(statePtr->flags, TCP_ASYNC_PENDING);
- break;
- }
- }
-}
-
-/*
- * ----------------------------------------------------------------------
- *
- * TcpWatchProc --
- *
- * Initialize the notifier to watch the fd from this channel.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Sets up the notifier so that a future event on the channel will be
- * seen by Tcl.
- *
- * ----------------------------------------------------------------------
- */
-
-static void
-WrapNotify(
- void *clientData,
- int mask)
+int
+TclpHasSockets(
+ Tcl_Interp *interp) /* Not used. */
{
- TcpState *statePtr = (TcpState *) clientData;
- int newmask = mask & statePtr->interest;
-
- if (newmask == 0) {
- /*
- * There was no overlap between the states the channel is interested
- * in notifications for, and the states that are reported present on
- * the file descriptor by select(). The only way that can happen is
- * when the channel is interested in a writable condition, and only a
- * readable state is reported present (see TcpWatchProc() below). In
- * that case, signal back to the caller the writable state, which is
- * really an error condition. As an extra check on that assumption,
- * check for a non-zero value of errno before reporting an artificial
- * writable state.
- */
-
- if (errno == 0) {
- return;
- }
- newmask = TCL_WRITABLE;
- }
- Tcl_NotifyChannel(statePtr->channel, newmask);
-}
-
-static void
-TcpWatchProc(
- void *instanceData, /* The socket state. */
- int mask) /* Events of interest; an OR-ed combination of
- * TCL_READABLE, TCL_WRITABLE and
- * TCL_EXCEPTION. */
-{
- TcpState *statePtr = (TcpState *)instanceData;
-
- if (statePtr->acceptProc != NULL) {
- /*
- * Make sure we don't mess with server sockets since they will never
- * be readable or writable at the Tcl level. This keeps Tcl scripts
- * from interfering with the -accept behavior (bug #3394732).
- */
-
- return;
- }
-
- if (GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING)) {
- /*
- * Async sockets use a FileHandler internally while connecting, so we
- * need to cache this request until the connection has succeeded.
- */
-
- statePtr->filehandlers = mask;
- } else if (mask) {
-
- /*
- * Whether it is a bug or feature or otherwise, it is a fact of life
- * that on at least some Linux kernels select() fails to report that a
- * socket file descriptor is writable when the other end of the socket
- * is closed. This is in contrast to the guarantees Tcl makes that
- * its channels become writable and fire writable events on an error
- * condition. This has caused a leak of file descriptors in a state of
- * background flushing. See Tcl ticket 1758a0b603.
- *
- * As a workaround, when our caller indicates an interest in writable
- * notifications, we must tell the notifier built around select() that
- * we are interested in the readable state of the file descriptor as
- * well, as that is the only reliable means to get notified of error
- * conditions. Then it is the task of WrapNotify() above to untangle
- * the meaning of these channel states and report the chan events as
- * best it can. We save a copy of the mask passed in to assist with
- * that.
- */
-
- statePtr->interest = mask;
- Tcl_CreateFileHandler(statePtr->fds.fd, mask|TCL_READABLE,
- WrapNotify, statePtr);
- } else {
- Tcl_DeleteFileHandler(statePtr->fds.fd);
- }
-}
-
-/*
- * ----------------------------------------------------------------------
- *
- * TcpGetHandleProc --
- *
- * Called from Tcl_GetChannelHandle to retrieve OS handles from inside a
- * TCP socket based channel.
- *
- * Results:
- * Returns TCL_OK with the fd in handlePtr, or TCL_ERROR if there is no
- * handle for the specified direction.
- *
- * Side effects:
- * None.
- *
- * ----------------------------------------------------------------------
- */
-
-static int
-TcpGetHandleProc(
- void *instanceData, /* The socket state. */
- TCL_UNUSED(int) /*direction*/,
- void **handlePtr) /* Where to store the handle. */
-{
- TcpState *statePtr = (TcpState *)instanceData;
-
- *handlePtr = INT2PTR(statePtr->fds.fd);
- return TCL_OK;
-}
-
-/*
- * ----------------------------------------------------------------------
- *
- * TcpAsyncCallback --
- *
- * Called by the event handler that TcpConnect sets up internally for
- * [socket -async] to get notified when the asynchronous connection
- * attempt has succeeded or failed.
- *
- * ----------------------------------------------------------------------
- */
-
-static void
-TcpAsyncCallback(
- void *clientData, /* The socket state. */
- TCL_UNUSED(int) /*mask*/)
-{
- TcpConnect(NULL, (TcpState *)clientData);
-}
-
-/*
- * ----------------------------------------------------------------------
- *
- * TcpConnect --
- *
- * This function opens a new socket in client mode.
- *
- * Results:
- * TCL_OK, if the socket was successfully connected or an asynchronous
- * connection is in progress. If an error occurs, TCL_ERROR is returned
- * and an error message is left in interp.
- *
- * Side effects:
- * Opens a socket.
- *
- * Remarks:
- * A single host name may resolve to more than one IP address, e.g. for
- * an IPv4/IPv6 dual stack host. For handling asynchronously connecting
- * sockets in the background for such hosts, this function can act as a
- * coroutine. On the first call, it sets up the control variables for the
- * two nested loops over the local and remote addresses. Once the first
- * connection attempt is in progress, it sets up itself as a writable
- * event handler for that socket, and returns. When the callback occurs,
- * control is transferred to the "reenter" label, right after the initial
- * return and the loops resume as if they had never been interrupted.
- * For synchronously connecting sockets, the loops work the usual way.
- *
- * ----------------------------------------------------------------------
- */
-
-static int
-TcpConnect(
- Tcl_Interp *interp, /* For error reporting; can be NULL. */
- TcpState *statePtr)
-{
- socklen_t optlen;
- int async_callback = GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING);
- int ret = -1, error = EHOSTUNREACH;
- int async = GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT);
- static const int reuseaddr = 1;
-
- if (async_callback) {
- goto reenter;
- }
-
- for (statePtr->addr = statePtr->addrlist; statePtr->addr != NULL;
- statePtr->addr = statePtr->addr->ai_next) {
- for (statePtr->myaddr = statePtr->myaddrlist;
- statePtr->myaddr != NULL;
- statePtr->myaddr = statePtr->myaddr->ai_next) {
- /*
- * No need to try combinations of local and remote addresses of
- * different families.
- */
-
- if (statePtr->myaddr->ai_family != statePtr->addr->ai_family) {
- continue;
- }
-
- /*
- * Close the socket if it is still open from the last unsuccessful
- * iteration.
- */
-
- if (statePtr->fds.fd >= 0) {
- close(statePtr->fds.fd);
- statePtr->fds.fd = -1;
- errno = 0;
- }
-
- statePtr->fds.fd = socket(statePtr->addr->ai_family, SOCK_STREAM,
- 0);
- if (statePtr->fds.fd < 0) {
- continue;
- }
-
- /*
- * Set the close-on-exec flag so that the socket will not get
- * inherited by child processes.
- */
-
- fcntl(statePtr->fds.fd, F_SETFD, FD_CLOEXEC);
-
- /*
- * Set kernel space buffering
- */
-
- TclSockMinimumBuffers(INT2PTR(statePtr->fds.fd), SOCKET_BUFSIZE);
-
- if (async) {
- ret = TclUnixSetBlockingMode(statePtr->fds.fd,
- TCL_MODE_NONBLOCKING);
- if (ret < 0) {
- continue;
- }
- }
-
- /*
- * Must reset the error variable here, before we use it for the
- * first time in this iteration.
- */
-
- error = 0;
-
- (void) setsockopt(statePtr->fds.fd, SOL_SOCKET, SO_REUSEADDR,
- (char *) &reuseaddr, sizeof(reuseaddr));
- ret = bind(statePtr->fds.fd, statePtr->myaddr->ai_addr,
- statePtr->myaddr->ai_addrlen);
- if (ret < 0) {
- error = errno;
- continue;
- }
-
- /*
- * Attempt to connect. The connect may fail at present with an
- * EINPROGRESS but at a later time it will complete. The caller
- * will set up a file handler on the socket if she is interested
- * in being informed when the connect completes.
- */
-
- ret = connect(statePtr->fds.fd, statePtr->addr->ai_addr,
- statePtr->addr->ai_addrlen);
- if (ret < 0) {
- error = errno;
- }
- if (ret < 0 && errno == EINPROGRESS) {
- Tcl_CreateFileHandler(statePtr->fds.fd,
- TCL_WRITABLE | TCL_EXCEPTION, TcpAsyncCallback,
- statePtr);
- errno = EWOULDBLOCK;
- SET_BITS(statePtr->flags, TCP_ASYNC_PENDING);
- return TCL_OK;
-
- reenter:
- CLEAR_BITS(statePtr->flags, TCP_ASYNC_PENDING);
- Tcl_DeleteFileHandler(statePtr->fds.fd);
-
- /*
- * Read the error state from the socket to see if the async
- * connection has succeeded or failed. As this clears the
- * error condition, we cache the status in the socket state
- * struct for later retrieval by [fconfigure -error].
- */
-
- optlen = sizeof(int);
-
- getsockopt(statePtr->fds.fd, SOL_SOCKET, SO_ERROR,
- (char *) &error, &optlen);
- errno = error;
- }
- if (error == 0) {
- goto out;
- }
- }
- }
-
- out:
- statePtr->connectError = error;
- CLEAR_BITS(statePtr->flags, TCP_ASYNC_CONNECT);
- if (async_callback) {
- /*
- * An asynchonous connection has finally succeeded or failed.
- */
-
- TcpWatchProc(statePtr, statePtr->filehandlers);
- TclUnixSetBlockingMode(statePtr->fds.fd, statePtr->cachedBlocking);
-
- if (error != 0) {
- SET_BITS(statePtr->flags, TCP_ASYNC_FAILED);
- }
-
- /*
- * We need to forward the writable event that brought us here, because
- * upon reading of getsockopt(SO_ERROR), at least some OSes clear the
- * writable state from the socket, and so a subsequent select() on
- * behalf of a script level [fileevent] would not fire. It doesn't
- * hurt that this is also called in the successful case and will save
- * the event mechanism one roundtrip through select().
- */
-
- if (statePtr->cachedBlocking == TCL_MODE_NONBLOCKING) {
- Tcl_NotifyChannel(statePtr->channel, TCL_WRITABLE);
- }
- }
- if (error != 0) {
- /*
- * Failure for either a synchronous connection, or an async one that
- * failed before it could enter background mode, e.g. because an
- * invalid -myaddr was given.
- */
-
- if (interp != NULL) {
- errno = error;
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't open socket: %s", Tcl_PosixError(interp)));
- }
- return TCL_ERROR;
- }
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
- * Tcl_OpenTcpClient --
- *
- * Opens a TCP client socket and creates a channel around it.
- *
- * Results:
- * The channel or NULL if failed. An error message is returned in the
- * interpreter on failure.
- *
- * Side effects:
- * Opens a client socket and creates a new channel.
- *
- *----------------------------------------------------------------------
- */
-
-Tcl_Channel
-Tcl_OpenTcpClient(
- Tcl_Interp *interp, /* For error reporting; can be NULL. */
- int port, /* Port number to open. */
- const char *host, /* Host on which to open port. */
- const char *myaddr, /* Client-side address */
- int myport, /* Client-side port */
- int async) /* If nonzero, attempt to do an asynchronous
- * connect. Otherwise we do a blocking
- * connect. */
-{
- TcpState *statePtr;
- const char *errorMsg = NULL;
- struct addrinfo *addrlist = NULL, *myaddrlist = NULL;
- char channelName[SOCK_CHAN_LENGTH];
-
- /*
- * Do the name lookups for the local and remote addresses.
- */
-
- if (!TclCreateSocketAddress(interp, &addrlist, host, port, 0, &errorMsg)
- || !TclCreateSocketAddress(interp, &myaddrlist, myaddr, myport, 1,
- &errorMsg)) {
- if (addrlist != NULL) {
- freeaddrinfo(addrlist);
- }
- if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "couldn't open socket: %s", errorMsg));
- }
- return NULL;
- }
-
- /*
- * Allocate a new TcpState for this socket.
- */
-
- statePtr = (TcpState *)ckalloc(sizeof(TcpState));
- memset(statePtr, 0, sizeof(TcpState));
- statePtr->flags = async ? TCP_ASYNC_CONNECT : 0;
- statePtr->cachedBlocking = TCL_MODE_BLOCKING;
- statePtr->addrlist = addrlist;
- statePtr->myaddrlist = myaddrlist;
- statePtr->fds.fd = -1;
-
- /*
- * Create a new client socket and wrap it in a channel.
- */
-
- if (TcpConnect(interp, statePtr) != TCL_OK) {
- TcpCloseProc(statePtr, NULL);
- return NULL;
- }
-
- snprintf(channelName, sizeof(channelName), SOCK_TEMPLATE, PTR2INT(statePtr));
-
- statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName,
- statePtr, TCL_READABLE | TCL_WRITABLE);
- if (Tcl_SetChannelOption(interp, statePtr->channel, "-translation",
- "auto crlf") == TCL_ERROR) {
- Tcl_Close(NULL, statePtr->channel);
- return NULL;
- }
- return statePtr->channel;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * Tcl_MakeTcpClientChannel --
- *
- * Creates a Tcl_Channel from an existing client TCP socket.
- *
- * Results:
- * The Tcl_Channel wrapped around the preexisting TCP socket.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-Tcl_Channel
-Tcl_MakeTcpClientChannel(
- void *sock) /* The socket to wrap up into a channel. */
-{
- return (Tcl_Channel) TclpMakeTcpClientChannelMode(sock,
- TCL_READABLE | TCL_WRITABLE);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpMakeTcpClientChannelMode --
+ * TclpFinalizeSockets --
*
- * Creates a Tcl_Channel from an existing client TCP socket
- * with given mode.
+ * Performs per-thread socket subsystem finalization.
*
* Results:
- * The Tcl_Channel wrapped around the preexisting TCP socket.
- *
- * Side effects:
* None.
*
- *----------------------------------------------------------------------
- */
-
-void *
-TclpMakeTcpClientChannelMode(
- void *sock, /* The socket to wrap up into a channel. */
- int mode) /* OR'ed combination of TCL_READABLE and
- * TCL_WRITABLE to indicate file mode. */
-{
- TcpState *statePtr;
- char channelName[SOCK_CHAN_LENGTH];
-
- statePtr = (TcpState *)ckalloc(sizeof(TcpState));
- memset(statePtr, 0, sizeof(TcpState));
- statePtr->fds.fd = PTR2INT(sock);
- statePtr->flags = 0;
-
- snprintf(channelName, sizeof(channelName), SOCK_TEMPLATE, PTR2INT(statePtr));
-
- statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName,
- statePtr, mode);
- if (Tcl_SetChannelOption(NULL, statePtr->channel, "-translation",
- "auto crlf") == TCL_ERROR) {
- Tcl_Close(NULL, statePtr->channel);
- return NULL;
- }
- return statePtr->channel;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * Tcl_OpenTcpServerEx --
- *
- * Opens a TCP server socket and creates a channel around it.
- *
- * Results:
- * The channel or NULL if failed. If an error occurred, an error message
- * is left in the interp's result if interp is not NULL.
- *
* Side effects:
- * Opens a server socket and creates a new channel.
- *
- *----------------------------------------------------------------------
- */
-
-Tcl_Channel
-Tcl_OpenTcpServerEx(
- Tcl_Interp *interp, /* For error reporting - may be NULL. */
- const char *service, /* Port number to open. */
- const char *myHost, /* Name of local host. */
- unsigned int flags, /* Flags. */
- int backlog, /* Length of OS listen backlog queue. */
- Tcl_TcpAcceptProc *acceptProc,
- /* Callback for accepting connections from new
- * clients. */
- void *acceptProcData) /* Data for the callback. */
-{
- int status = 0, sock = -1, optvalue, port, chosenport;
- struct addrinfo *addrlist = NULL, *addrPtr; /* socket address */
- TcpState *statePtr = NULL;
- char channelName[SOCK_CHAN_LENGTH];
- const char *errorMsg = NULL;
- TcpFdList *fds = NULL, *newfds;
-
- /*
- * Try to record and return the most meaningful error message, i.e. the
- * one from the first socket that went the farthest before it failed.
- */
-
- enum { LOOKUP, SOCKET, BIND, LISTEN } howfar = LOOKUP;
- int my_errno = 0;
-
- /*
- * If we were called with port 0 to listen on a random port number, we
- * copy the port number from the first member of the addrinfo list to all
- * subsequent members, so that IPv4 and IPv6 listen on the same port. This
- * might fail to bind() with EADDRINUSE if a port is free on the first
- * address family in the list but already used on the other. In this case
- * we revert everything we've done so far and start from scratch hoping
- * that next time we'll find a port number that is usable on all address
- * families. We try this at most MAXRETRY times to avoid an endless loop
- * if all ports are taken.
- */
-
- int retry = 0;
-#define MAXRETRY 10
-
- repeat:
- if (retry > 0) {
- if (statePtr != NULL) {
- TcpCloseProc(statePtr, NULL);
- statePtr = NULL;
- }
- if (addrlist != NULL) {
- freeaddrinfo(addrlist);
- addrlist = NULL;
- }
- if (retry >= MAXRETRY) {
- goto error;
- }
- }
- retry++;
- chosenport = 0;
-
- if (TclSockGetPort(interp, service, "tcp", &port) != TCL_OK) {
- errorMsg = "invalid port number";
- goto error;
- }
-
- if (!TclCreateSocketAddress(interp, &addrlist, myHost, port, 1,
- &errorMsg)) {
- my_errno = errno;
- goto error;
- }
-
- for (addrPtr = addrlist; addrPtr != NULL; addrPtr = addrPtr->ai_next) {
- sock = socket(addrPtr->ai_family, addrPtr->ai_socktype,
- addrPtr->ai_protocol);
- if (sock == -1) {
- if (howfar < SOCKET) {
- howfar = SOCKET;
- my_errno = errno;
- }
- continue;
- }
-
- /*
- * Set the close-on-exec flag so that the socket will not get
- * inherited by child processes.
- */
-
- fcntl(sock, F_SETFD, FD_CLOEXEC);
-
- /*
- * Set kernel space buffering
- */
-
- TclSockMinimumBuffers(INT2PTR(sock), SOCKET_BUFSIZE);
-
- /*
- * Set up to reuse server addresses and/or ports if requested.
- */
-
- if (GOT_BITS(flags, TCL_TCPSERVER_REUSEADDR)) {
- optvalue = 1;
- (void) setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
- (char *) &optvalue, sizeof(optvalue));
- }
-
- if (GOT_BITS(flags, TCL_TCPSERVER_REUSEPORT)) {
-#ifndef SO_REUSEPORT
- /*
- * If the platform doesn't support the SO_REUSEPORT flag we can't
- * do much beside erroring out.
- */
-
- errorMsg = "SO_REUSEPORT isn't supported by this platform";
- goto error;
-#else
- optvalue = 1;
- (void) setsockopt(sock, SOL_SOCKET, SO_REUSEPORT,
- (char *) &optvalue, sizeof(optvalue));
-#endif
- }
-
- /*
- * Make sure we use the same port number when opening two server
- * sockets for IPv4 and IPv6 on a random port.
- *
- * As sockaddr_in6 uses the same offset and size for the port member
- * as sockaddr_in, we can handle both through the IPv4 API.
- */
-
- if (port == 0 && chosenport != 0) {
- ((struct sockaddr_in *) addrPtr->ai_addr)->sin_port =
- htons(chosenport);
- }
-
-#ifdef IPV6_V6ONLY
- /*
- * Missing on: Solaris 2.8
- */
-
- if (addrPtr->ai_family == AF_INET6) {
- int v6only = 1;
-
- (void) setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY,
- &v6only, sizeof(v6only));
- }
-#endif /* IPV6_V6ONLY */
-
- status = bind(sock, addrPtr->ai_addr, addrPtr->ai_addrlen);
- if (status == -1) {
- if (howfar < BIND) {
- howfar = BIND;
- my_errno = errno;
- }
- close(sock);
- sock = -1;
- if (port == 0 && errno == EADDRINUSE) {
- goto repeat;
- }
- continue;
- }
- if (port == 0 && chosenport == 0) {
- address sockname;
- socklen_t namelen = sizeof(sockname);
-
- /*
- * Synchronize port numbers when binding to port 0 of multiple
- * addresses.
- */
-
- if (getsockname(sock, &sockname.sa, &namelen) >= 0) {
- chosenport = ntohs(sockname.sa4.sin_port);
- }
- }
- if (backlog < 0) {
- backlog = SOMAXCONN;
- }
- status = listen(sock, backlog);
- if (status < 0) {
- if (howfar < LISTEN) {
- howfar = LISTEN;
- my_errno = errno;
- }
- close(sock);
- sock = -1;
- if (port == 0 && errno == EADDRINUSE) {
- goto repeat;
- }
- continue;
- }
- if (statePtr == NULL) {
- /*
- * Allocate a new TcpState for this socket.
- */
-
- statePtr = (TcpState *)ckalloc(sizeof(TcpState));
- memset(statePtr, 0, sizeof(TcpState));
- statePtr->acceptProc = acceptProc;
- statePtr->acceptProcData = acceptProcData;
- snprintf(channelName, sizeof(channelName), SOCK_TEMPLATE, PTR2INT(statePtr));
- newfds = &statePtr->fds;
- } else {
- newfds = (TcpFdList *)ckalloc(sizeof(TcpFdList));
- memset(newfds, (int) 0, sizeof(TcpFdList));
- fds->next = newfds;
- }
- newfds->fd = sock;
- newfds->statePtr = statePtr;
- fds = newfds;
-
- /*
- * Set up the callback mechanism for accepting connections from new
- * clients.
- */
-
- Tcl_CreateFileHandler(sock, TCL_READABLE, TcpAccept, fds);
- }
-
- error:
- if (addrlist != NULL) {
- freeaddrinfo(addrlist);
- }
- if (statePtr != NULL) {
- statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName,
- statePtr, 0);
- return statePtr->channel;
- }
- if (interp != NULL) {
- Tcl_Obj *errorObj = Tcl_NewStringObj("couldn't open socket: ", TCL_INDEX_NONE);
-
- if (errorMsg == NULL) {
- errno = my_errno;
- Tcl_AppendToObj(errorObj, Tcl_PosixError(interp), TCL_INDEX_NONE);
- } else {
- Tcl_AppendToObj(errorObj, errorMsg, TCL_INDEX_NONE);
- }
- Tcl_SetObjResult(interp, errorObj);
- }
- if (sock != -1) {
- close(sock);
- }
- return NULL;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TcpAccept --
- * Accept a TCP socket connection. This is called by the event loop.
- *
- * Results:
* None.
*
- * Side effects:
- * Creates a new connection socket. Calls the registered callback for the
- * connection acceptance mechanism.
- *
*----------------------------------------------------------------------
*/
-static void
-TcpAccept(
- void *data, /* Callback token. */
- TCL_UNUSED(int) /*mask*/)
+void
+TclpFinalizeSockets(void)
{
- TcpFdList *fds = (TcpFdList *)data; /* Client data of server socket. */
- int newsock; /* The new client socket */
- TcpState *newSockState; /* State for new socket. */
- address addr; /* The remote address */
- socklen_t len; /* For accept interface */
- char channelName[SOCK_CHAN_LENGTH];
- char host[NI_MAXHOST], port[NI_MAXSERV];
-
- len = sizeof(addr);
- newsock = accept(fds->fd, &addr.sa, &len);
- if (newsock < 0) {
- return;
- }
-
- /*
- * Set close-on-exec flag to prevent the newly accepted socket from being
- * inherited by child processes.
- */
-
- (void) fcntl(newsock, F_SETFD, FD_CLOEXEC);
-
- newSockState = (TcpState *)ckalloc(sizeof(TcpState));
- memset(newSockState, 0, sizeof(TcpState));
- newSockState->flags = 0;
- newSockState->fds.fd = newsock;
-
- snprintf(channelName, sizeof(channelName), SOCK_TEMPLATE, PTR2INT(newSockState));
- newSockState->channel = Tcl_CreateChannel(&tcpChannelType, channelName,
- newSockState, TCL_READABLE | TCL_WRITABLE);
-
- Tcl_SetChannelOption(NULL, newSockState->channel, "-translation",
- "auto crlf");
-
- if (fds->statePtr->acceptProc != NULL) {
- getnameinfo(&addr.sa, len, host, sizeof(host), port, sizeof(port),
- NI_NUMERICHOST|NI_NUMERICSERV);
- fds->statePtr->acceptProc(fds->statePtr->acceptProcData,
- newSockState->channel, host, atoi(port));
- }
+ return;
}
/*
@@ -1952,7 +183,5 @@ TcpAccept(
* mode: c
* c-basic-offset: 4
* fill-column: 78
- * tab-width: 8
- * indent-tabs-mode: nil
* End:
*/
diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c
index 515f234..722ded9 100644
--- a/unix/tclUnixTest.c
+++ b/unix/tclUnixTest.c
@@ -3,16 +3,13 @@
*
* Contains platform specific test commands for the Unix platform.
*
- * Copyright © 1996-1997 Sun Microsystems, Inc.
- * Copyright © 1998 Scriptics Corporation.
+ * Copyright (c) 1996-1997 Sun Microsystems, Inc.
+ * Copyright (c) 1998 by Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#ifndef USE_TCL_STUBS
-# define USE_TCL_STUBS
-#endif
#include "tclInt.h"
/*
@@ -37,9 +34,9 @@
* exercised by the "testfilehandler" command.
*/
-typedef struct {
- TclFile readFile; /* File handle for reading from the pipe. NULL
- * means pipe doesn't exist yet. */
+typedef struct Pipe {
+ TclFile readFile; /* File handle for reading from the pipe.
+ * NULL means pipe doesn't exist yet. */
TclFile writeFile; /* File handle for writing from the pipe. */
int readCount; /* Number of times the file handler for this
* file has triggered and the file was
@@ -62,15 +59,29 @@ static const char *gotsig = "0";
* Forward declarations of functions defined later in this file:
*/
-static Tcl_ObjCmdProc TestalarmCmd;
-static Tcl_ObjCmdProc TestchmodCmd;
-static Tcl_ObjCmdProc TestfilehandlerCmd;
-static Tcl_ObjCmdProc TestfilewaitCmd;
-static Tcl_ObjCmdProc TestfindexecutableCmd;
-static Tcl_ObjCmdProc TestforkCmd;
-static Tcl_ObjCmdProc TestgotsigCmd;
-static Tcl_FileProc TestFileHandlerProc;
+static void TestFileHandlerProc(ClientData clientData, int mask);
+static int TestfilehandlerCmd(ClientData dummy,
+ Tcl_Interp *interp, int argc, CONST char **argv);
+static int TestfilewaitCmd(ClientData dummy,
+ Tcl_Interp *interp, int argc, CONST char **argv);
+static int TestfindexecutableCmd(ClientData dummy,
+ Tcl_Interp *interp, int argc, CONST char **argv);
+static int TestforkObjCmd(ClientData dummy,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST *argv);
+static int TestgetopenfileCmd(ClientData dummy,
+ Tcl_Interp *interp, int argc, CONST char **argv);
+static int TestgetdefencdirCmd(ClientData dummy,
+ Tcl_Interp *interp, int argc, CONST char **argv);
+static int TestsetdefencdirCmd(ClientData dummy,
+ Tcl_Interp *interp, int argc, CONST char **argv);
+int TclplatformtestInit(Tcl_Interp *interp);
+static int TestalarmCmd(ClientData dummy,
+ Tcl_Interp *interp, int argc, CONST char **argv);
+static int TestgotsigCmd(ClientData dummy,
+ Tcl_Interp *interp, int argc, CONST char **argv);
static void AlarmHandler(int signum);
+static int TestchmodCmd(ClientData dummy,
+ Tcl_Interp *interp, int argc, CONST char **argv);
/*
*----------------------------------------------------------------------
@@ -93,20 +104,26 @@ int
TclplatformtestInit(
Tcl_Interp *interp) /* Interpreter to add commands to. */
{
- Tcl_CreateObjCommand(interp, "testchmod", TestchmodCmd,
- NULL, NULL);
- Tcl_CreateObjCommand(interp, "testfilehandler", TestfilehandlerCmd,
- NULL, NULL);
- Tcl_CreateObjCommand(interp, "testfilewait", TestfilewaitCmd,
- NULL, NULL);
- Tcl_CreateObjCommand(interp, "testfindexecutable", TestfindexecutableCmd,
- NULL, NULL);
- Tcl_CreateObjCommand(interp, "testfork", TestforkCmd,
- NULL, NULL);
- Tcl_CreateObjCommand(interp, "testalarm", TestalarmCmd,
- NULL, NULL);
- Tcl_CreateObjCommand(interp, "testgotsig", TestgotsigCmd,
- NULL, NULL);
+ Tcl_CreateCommand(interp, "testchmod", TestchmodCmd,
+ (ClientData) 0, NULL);
+ Tcl_CreateCommand(interp, "testfilehandler", TestfilehandlerCmd,
+ (ClientData) 0, NULL);
+ Tcl_CreateCommand(interp, "testfilewait", TestfilewaitCmd,
+ (ClientData) 0, NULL);
+ Tcl_CreateCommand(interp, "testfindexecutable", TestfindexecutableCmd,
+ (ClientData) 0, NULL);
+ Tcl_CreateObjCommand(interp, "testfork", TestforkObjCmd,
+ (ClientData) 0, NULL);
+ Tcl_CreateCommand(interp, "testgetopenfile", TestgetopenfileCmd,
+ (ClientData) 0, NULL);
+ Tcl_CreateCommand(interp, "testgetdefenc", TestgetdefencdirCmd,
+ (ClientData) 0, NULL);
+ Tcl_CreateCommand(interp, "testsetdefenc", TestsetdefencdirCmd,
+ (ClientData) 0, NULL);
+ Tcl_CreateCommand(interp, "testalarm", TestalarmCmd,
+ (ClientData) 0, NULL);
+ Tcl_CreateCommand(interp, "testgotsig", TestgotsigCmd,
+ (ClientData) 0, NULL);
return TCL_OK;
}
@@ -129,10 +146,10 @@ TclplatformtestInit(
static int
TestfilehandlerCmd(
- TCL_UNUSED(void *),
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
+ int argc, /* Number of arguments. */
+ CONST char **argv) /* Argument strings. */
{
Pipe *pipePtr;
int i, mask, timeout;
@@ -152,23 +169,24 @@ TestfilehandlerCmd(
initialized = 1;
}
- if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ...");
+ if (argc < 2) {
+ Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0],
+ " option ... \"", NULL);
return TCL_ERROR;
}
pipePtr = NULL;
- if (objc >= 3) {
- if (Tcl_GetIntFromObj(interp, objv[2], &i) != TCL_OK) {
+ if (argc >= 3) {
+ if (Tcl_GetInt(interp, argv[2], &i) != TCL_OK) {
return TCL_ERROR;
}
if (i >= MAX_PIPES) {
- Tcl_AppendResult(interp, "bad index ", objv[2], (void *)NULL);
+ Tcl_AppendResult(interp, "bad index ", argv[2], NULL);
return TCL_ERROR;
}
pipePtr = &testPipes[i];
}
- if (strcmp(Tcl_GetString(objv[1]), "close") == 0) {
+ if (strcmp(argv[1], "close") == 0) {
for (i = 0; i < MAX_PIPES; i++) {
if (testPipes[i].readFile != NULL) {
TclpCloseFile(testPipes[i].readFile);
@@ -177,117 +195,124 @@ TestfilehandlerCmd(
testPipes[i].writeFile = NULL;
}
}
- } else if (strcmp(Tcl_GetString(objv[1]), "clear") == 0) {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "index");
+ } else if (strcmp(argv[1], "clear") == 0) {
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "wrong # arguments: should be \"",
+ argv[0], " clear index\"", NULL);
return TCL_ERROR;
}
pipePtr->readCount = pipePtr->writeCount = 0;
- } else if (strcmp(Tcl_GetString(objv[1]), "counts") == 0) {
+ } else if (strcmp(argv[1], "counts") == 0) {
char buf[TCL_INTEGER_SPACE * 2];
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "index");
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "wrong # arguments: should be \"",
+ argv[0], " counts index\"", NULL);
return TCL_ERROR;
}
- snprintf(buf, sizeof(buf), "%d %d", pipePtr->readCount, pipePtr->writeCount);
- Tcl_AppendResult(interp, buf, (void *)NULL);
- } else if (strcmp(Tcl_GetString(objv[1]), "create") == 0) {
- if (objc != 5) {
- Tcl_WrongNumArgs(interp, 2, objv, "index readMode writeMode");
+ sprintf(buf, "%d %d", pipePtr->readCount, pipePtr->writeCount);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ } else if (strcmp(argv[1], "create") == 0) {
+ if (argc != 5) {
+ Tcl_AppendResult(interp, "wrong # arguments: should be \"",
+ argv[0], " create index readMode writeMode\"", NULL);
return TCL_ERROR;
}
if (pipePtr->readFile == NULL) {
if (!TclpCreatePipe(&pipePtr->readFile, &pipePtr->writeFile)) {
Tcl_AppendResult(interp, "couldn't open pipe: ",
- Tcl_PosixError(interp), (void *)NULL);
+ Tcl_PosixError(interp), NULL);
return TCL_ERROR;
}
#ifdef O_NONBLOCK
fcntl(GetFd(pipePtr->readFile), F_SETFL, O_NONBLOCK);
fcntl(GetFd(pipePtr->writeFile), F_SETFL, O_NONBLOCK);
#else
- Tcl_AppendResult(interp, "can't make pipes non-blocking",
- (void *)NULL);
+ Tcl_SetResult(interp, "can't make pipes non-blocking",
+ TCL_STATIC);
return TCL_ERROR;
#endif
}
pipePtr->readCount = 0;
pipePtr->writeCount = 0;
- if (strcmp(Tcl_GetString(objv[3]), "readable") == 0) {
+ if (strcmp(argv[3], "readable") == 0) {
Tcl_CreateFileHandler(GetFd(pipePtr->readFile), TCL_READABLE,
- TestFileHandlerProc, pipePtr);
- } else if (strcmp(Tcl_GetString(objv[3]), "off") == 0) {
+ TestFileHandlerProc, (ClientData) pipePtr);
+ } else if (strcmp(argv[3], "off") == 0) {
Tcl_DeleteFileHandler(GetFd(pipePtr->readFile));
- } else if (strcmp(Tcl_GetString(objv[3]), "disabled") == 0) {
+ } else if (strcmp(argv[3], "disabled") == 0) {
Tcl_CreateFileHandler(GetFd(pipePtr->readFile), 0,
- TestFileHandlerProc, pipePtr);
+ TestFileHandlerProc, (ClientData) pipePtr);
} else {
- Tcl_AppendResult(interp, "bad read mode \"", Tcl_GetString(objv[3]), "\"", (void *)NULL);
+ Tcl_AppendResult(interp, "bad read mode \"", argv[3], "\"", NULL);
return TCL_ERROR;
}
- if (strcmp(Tcl_GetString(objv[4]), "writable") == 0) {
+ if (strcmp(argv[4], "writable") == 0) {
Tcl_CreateFileHandler(GetFd(pipePtr->writeFile), TCL_WRITABLE,
- TestFileHandlerProc, pipePtr);
- } else if (strcmp(Tcl_GetString(objv[4]), "off") == 0) {
+ TestFileHandlerProc, (ClientData) pipePtr);
+ } else if (strcmp(argv[4], "off") == 0) {
Tcl_DeleteFileHandler(GetFd(pipePtr->writeFile));
- } else if (strcmp(Tcl_GetString(objv[4]), "disabled") == 0) {
+ } else if (strcmp(argv[4], "disabled") == 0) {
Tcl_CreateFileHandler(GetFd(pipePtr->writeFile), 0,
- TestFileHandlerProc, pipePtr);
+ TestFileHandlerProc, (ClientData) pipePtr);
} else {
- Tcl_AppendResult(interp, "bad read mode \"", Tcl_GetString(objv[4]), "\"", (void *)NULL);
+ Tcl_AppendResult(interp, "bad read mode \"", argv[4], "\"", NULL);
return TCL_ERROR;
}
- } else if (strcmp(Tcl_GetString(objv[1]), "empty") == 0) {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "index");
+ } else if (strcmp(argv[1], "empty") == 0) {
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "wrong # arguments: should be \"",
+ argv[0], " empty index\"", NULL);
return TCL_ERROR;
}
while (read(GetFd(pipePtr->readFile), buffer, 4000) > 0) {
- /* Empty loop body. */
+ /* Empty loop body. */
}
- } else if (strcmp(Tcl_GetString(objv[1]), "fill") == 0) {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "index");
+ } else if (strcmp(argv[1], "fill") == 0) {
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "wrong # arguments: should be \"",
+ argv[0], " fill index\"", NULL);
return TCL_ERROR;
}
memset(buffer, 'a', 4000);
- while (write(GetFd(pipePtr->writeFile), buffer, 4000) > 0) {
- /* Empty loop body. */
- }
- } else if (strcmp(Tcl_GetString(objv[1]), "fillpartial") == 0) {
+ while (write(GetFd(pipePtr->writeFile), buffer, 4000) > 0) {
+ /* Empty loop body. */
+ }
+ } else if (strcmp(argv[1], "fillpartial") == 0) {
char buf[TCL_INTEGER_SPACE];
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "index");
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "wrong # arguments: should be \"",
+ argv[0], " fillpartial index\"", NULL);
return TCL_ERROR;
}
memset(buffer, 'b', 10);
TclFormatInt(buf, write(GetFd(pipePtr->writeFile), buffer, 10));
- Tcl_AppendResult(interp, buf, (void *)NULL);
- } else if (strcmp(Tcl_GetString(objv[1]), "oneevent") == 0) {
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ } else if (strcmp(argv[1], "oneevent") == 0) {
Tcl_DoOneEvent(TCL_FILE_EVENTS|TCL_DONT_WAIT);
- } else if (strcmp(Tcl_GetString(objv[1]), "wait") == 0) {
- if (objc != 5) {
- Tcl_WrongNumArgs(interp, 2, objv, "index readable|writable timeout");
+ } else if (strcmp(argv[1], "wait") == 0) {
+ if (argc != 5) {
+ Tcl_AppendResult(interp, "wrong # arguments: should be \"",
+ argv[0], " wait index readable|writable timeout\"", NULL);
return TCL_ERROR;
}
if (pipePtr->readFile == NULL) {
- Tcl_AppendResult(interp, "pipe ", Tcl_GetString(objv[2]), " doesn't exist", (void *)NULL);
+ Tcl_AppendResult(interp, "pipe ", argv[2], " doesn't exist", NULL);
return TCL_ERROR;
}
- if (strcmp(Tcl_GetString(objv[3]), "readable") == 0) {
+ if (strcmp(argv[3], "readable") == 0) {
mask = TCL_READABLE;
file = pipePtr->readFile;
} else {
mask = TCL_WRITABLE;
file = pipePtr->writeFile;
}
- if (Tcl_GetIntFromObj(interp, objv[4], &timeout) != TCL_OK) {
+ if (Tcl_GetInt(interp, argv[4], &timeout) != TCL_OK) {
return TCL_ERROR;
}
i = TclUnixWaitForFile(GetFd(file), mask, timeout);
@@ -297,12 +322,12 @@ TestfilehandlerCmd(
if (i & TCL_WRITABLE) {
Tcl_AppendElement(interp, "writable");
}
- } else if (strcmp(Tcl_GetString(objv[1]), "windowevent") == 0) {
+ } else if (strcmp(argv[1], "windowevent") == 0) {
Tcl_DoOneEvent(TCL_WINDOW_EVENTS|TCL_DONT_WAIT);
} else {
- Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]),
+ Tcl_AppendResult(interp, "bad option \"", argv[1],
"\": must be close, clear, counts, create, empty, fill, "
- "fillpartial, oneevent, wait, or windowevent", (void *)NULL);
+ "fillpartial, oneevent, wait, or windowevent", NULL);
return TCL_ERROR;
}
return TCL_OK;
@@ -310,11 +335,11 @@ TestfilehandlerCmd(
static void
TestFileHandlerProc(
- void *clientData, /* Points to a Pipe structure. */
+ ClientData clientData, /* Points to a Pipe structure. */
int mask) /* Indicates which events happened:
* TCL_READABLE or TCL_WRITABLE. */
{
- Pipe *pipePtr = (Pipe *)clientData;
+ Pipe *pipePtr = (Pipe *) clientData;
if (mask & TCL_READABLE) {
pipePtr->readCount++;
@@ -343,43 +368,44 @@ TestFileHandlerProc(
static int
TestfilewaitCmd(
- TCL_UNUSED(void *),
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
+ int argc, /* Number of arguments. */
+ CONST char **argv) /* Argument strings. */
{
int mask, result, timeout;
Tcl_Channel channel;
int fd;
- void *data;
+ ClientData data;
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "file readable|writable|both timeout");
+ if (argc != 4) {
+ Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0],
+ " file readable|writable|both timeout\"", NULL);
return TCL_ERROR;
}
- channel = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), NULL);
+ channel = Tcl_GetChannel(interp, argv[1], NULL);
if (channel == NULL) {
return TCL_ERROR;
}
- if (strcmp(Tcl_GetString(objv[2]), "readable") == 0) {
+ if (strcmp(argv[2], "readable") == 0) {
mask = TCL_READABLE;
- } else if (strcmp(Tcl_GetString(objv[2]), "writable") == 0){
+ } else if (strcmp(argv[2], "writable") == 0){
mask = TCL_WRITABLE;
- } else if (strcmp(Tcl_GetString(objv[2]), "both") == 0){
+ } else if (strcmp(argv[2], "both") == 0){
mask = TCL_WRITABLE|TCL_READABLE;
} else {
- Tcl_AppendResult(interp, "bad argument \"", Tcl_GetString(objv[2]),
- "\": must be readable, writable, or both", (void *)NULL);
+ Tcl_AppendResult(interp, "bad argument \"", argv[2],
+ "\": must be readable, writable, or both", NULL);
return TCL_ERROR;
}
if (Tcl_GetChannelHandle(channel,
(mask & TCL_READABLE) ? TCL_READABLE : TCL_WRITABLE,
- (void **) &data) != TCL_OK) {
- Tcl_AppendResult(interp, "couldn't get channel file", (void *)NULL);
+ (ClientData*) &data) != TCL_OK) {
+ Tcl_SetResult(interp, "couldn't get channel file", TCL_STATIC);
return TCL_ERROR;
}
fd = PTR2INT(data);
- if (Tcl_GetIntFromObj(interp, objv[3], &timeout) != TCL_OK) {
+ if (Tcl_GetInt(interp, argv[3], &timeout) != TCL_OK) {
return TCL_ERROR;
}
result = TclUnixWaitForFile(fd, mask, timeout);
@@ -411,22 +437,23 @@ TestfilewaitCmd(
static int
TestfindexecutableCmd(
- TCL_UNUSED(void *),
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
+ int argc, /* Number of arguments. */
+ CONST char **argv) /* Argument strings. */
{
Tcl_Obj *saveName;
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "argv0");
+ if (argc != 2) {
+ Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0],
+ " argv0\"", NULL);
return TCL_ERROR;
}
saveName = TclGetObjNameOfExecutable();
Tcl_IncrRefCount(saveName);
- TclpFindExecutable(Tcl_GetString(objv[1]));
+ TclpFindExecutable(argv[1]);
Tcl_SetObjResult(interp, TclGetObjNameOfExecutable());
TclSetObjNameOfExecutable(saveName, NULL);
@@ -437,7 +464,84 @@ TestfindexecutableCmd(
/*
*----------------------------------------------------------------------
*
- * TestforkCmd --
+ * TestgetopenfileCmd --
+ *
+ * This function implements the "testgetopenfile" command. It is used to
+ * get a FILE * value from a registered channel.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+TestgetopenfileCmd(
+ ClientData clientData, /* Not used. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int argc, /* Number of arguments. */
+ CONST char **argv) /* Argument strings. */
+{
+ ClientData filePtr;
+
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " channelName forWriting\"", NULL);
+ return TCL_ERROR;
+ }
+ if (Tcl_GetOpenFile(interp, argv[1], atoi(argv[2]), 1, &filePtr)
+ == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ if (filePtr == (ClientData) NULL) {
+ Tcl_AppendResult(interp,
+ "Tcl_GetOpenFile succeeded but FILE * NULL!", NULL);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TestsetdefencdirCmd --
+ *
+ * This function implements the "testsetdefenc" command. It is used to
+ * test Tcl_SetDefaultEncodingDir().
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+TestsetdefencdirCmd(
+ ClientData clientData, /* Not used. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int argc, /* Number of arguments. */
+ CONST char **argv) /* Argument strings. */
+{
+ if (argc != 2) {
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " defaultDir\"", NULL);
+ return TCL_ERROR;
+ }
+
+ Tcl_SetDefaultEncodingDir(argv[1]);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TestforkObjCmd --
*
* This function implements the "testfork" command. It is used to
* fork the Tcl process for specific test cases.
@@ -452,11 +556,11 @@ TestfindexecutableCmd(
*/
static int
-TestforkCmd(
- TCL_UNUSED(void *),
+TestforkObjCmd(
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
+ Tcl_Obj *CONST *objv) /* Argument strings. */
{
pid_t pid;
@@ -467,7 +571,7 @@ TestforkCmd(
pid = fork();
if (pid == -1) {
Tcl_AppendResult(interp,
- "Cannot fork", (void *)NULL);
+ "Cannot fork", NULL);
return TCL_ERROR;
}
/* Only needed when pthread_atfork is not present,
@@ -475,7 +579,40 @@ TestforkCmd(
if (pid==0) {
Tcl_InitNotifier();
}
- Tcl_SetObjResult(interp, Tcl_NewWideIntObj(pid));
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(pid));
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TestgetdefencdirCmd --
+ *
+ * This function implements the "testgetdefenc" command. It is used to
+ * test Tcl_GetDefaultEncodingDir().
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+TestgetdefencdirCmd(
+ ClientData clientData, /* Not used. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int argc, /* Number of arguments. */
+ CONST char **argv) /* Argument strings. */
+{
+ if (argc != 1) {
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], NULL);
+ return TCL_ERROR;
+ }
+
+ Tcl_AppendResult(interp, Tcl_GetDefaultEncodingDir(), NULL);
return TCL_OK;
}
@@ -499,17 +636,19 @@ TestforkCmd(
static int
TestalarmCmd(
- TCL_UNUSED(void *),
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
+ int argc, /* Number of arguments. */
+ CONST char **argv) /* Argument strings. */
{
#ifdef SA_RESTART
- unsigned int sec = 1;
+ unsigned int sec;
struct sigaction action;
- if (objc > 1) {
- Tcl_GetIntFromObj(interp, objv[1], (int *)&sec);
+ if (argc > 1) {
+ Tcl_GetInt(interp, argv[1], (int *)&sec);
+ } else {
+ sec = 1;
}
/*
@@ -522,16 +661,15 @@ TestalarmCmd(
action.sa_flags = SA_RESTART;
if (sigaction(SIGALRM, &action, NULL) < 0) {
- Tcl_AppendResult(interp, "sigaction: ", Tcl_PosixError(interp), (void *)NULL);
+ Tcl_AppendResult(interp, "sigaction: ", Tcl_PosixError(interp), NULL);
return TCL_ERROR;
}
(void) alarm(sec);
return TCL_OK;
#else
-
Tcl_AppendResult(interp,
"warning: sigaction SA_RESTART not support on this platform",
- (void *)NULL);
+ NULL);
return TCL_ERROR;
#endif
}
@@ -554,7 +692,7 @@ TestalarmCmd(
static void
AlarmHandler(
- TCL_UNUSED(int) /*signum*/)
+ int signum)
{
gotsig = "1";
}
@@ -577,12 +715,12 @@ AlarmHandler(
static int
TestgotsigCmd(
- TCL_UNUSED(void *),
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- TCL_UNUSED(int) /*objc*/,
- TCL_UNUSED(Tcl_Obj *const *))
+ int argc, /* Number of arguments. */
+ CONST char **argv) /* Argument strings. */
{
- Tcl_AppendResult(interp, gotsig, (void *)NULL);
+ Tcl_AppendResult(interp, gotsig, NULL);
gotsig = "0";
return TCL_OK;
}
@@ -594,7 +732,7 @@ TestgotsigCmd(
*
* Implements the "testchmod" cmd. Used when testing "file" command.
* The only attribute used by the Windows platform is the user write
- * flag; if this is not set, the file is made read-only. Otherwise, the
+ * flag; if this is not set, the file is made read-only. Otehrwise, the
* file is made read-write.
*
* Results:
@@ -608,45 +746,40 @@ TestgotsigCmd(
static int
TestchmodCmd(
- TCL_UNUSED(void *),
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
+ int argc, /* Number of arguments. */
+ CONST char **argv) /* Argument strings. */
{
int i, mode;
+ char *rest;
- if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "mode file ?file ...?");
+ if (argc < 2) {
+ usage:
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " mode file ?file ...?", NULL);
return TCL_ERROR;
}
- if (Tcl_GetIntFromObj(interp, objv[1], &mode) != TCL_OK) {
- return TCL_ERROR;
+ mode = (int) strtol(argv[1], &rest, 8);
+ if ((rest == argv[1]) || (*rest != '\0')) {
+ goto usage;
}
- for (i = 2; i < objc; i++) {
+ for (i = 2; i < argc; i++) {
Tcl_DString buffer;
- const char *translated;
+ CONST char *translated;
- translated = Tcl_TranslateFileName(interp, Tcl_GetString(objv[i]), &buffer);
+ translated = Tcl_TranslateFileName(interp, argv[i], &buffer);
if (translated == NULL) {
return TCL_ERROR;
}
- if (chmod(translated, mode) != 0) {
+ if (chmod(translated, (unsigned) mode) != 0) {
Tcl_AppendResult(interp, translated, ": ", Tcl_PosixError(interp),
- (void *)NULL);
+ NULL);
return TCL_ERROR;
}
Tcl_DStringFree(&buffer);
}
return TCL_OK;
}
-
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 4
- * fill-column: 78
- * tab-width: 8
- * End:
- */
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index 9587590..a7a294d 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -3,9 +3,8 @@
*
* This file implements the UNIX-specific thread support.
*
- * Copyright © 1991-1994 The Regents of the University of California.
- * Copyright © 1994-1997 Sun Microsystems, Inc.
- * Copyright © 2008 George Peter Staplin
+ * Copyright (c) 1991-1994 The Regents of the University of California.
+ * Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -13,192 +12,46 @@
#include "tclInt.h"
-#if TCL_THREADS
-
-/*
- * TIP #509. Ensures that Tcl's mutexes are reentrant.
- *
- *----------------------------------------------------------------------
- *
- * PMutexInit --
- *
- * Sets up the memory pointed to by its argument so that it contains the
- * implementation of a recursive lock. Caller supplies the space.
- *
- *----------------------------------------------------------------------
- *
- * PMutexDestroy --
- *
- * Tears down the implementation of a recursive lock (but does not
- * deallocate the space holding the lock).
- *
- *----------------------------------------------------------------------
- *
- * PMutexLock --
- *
- * Locks a recursive lock. (Similar to pthread_mutex_lock)
- *
- *----------------------------------------------------------------------
- *
- * PMutexUnlock --
- *
- * Unlocks a recursive lock. (Similar to pthread_mutex_unlock)
- *
- *----------------------------------------------------------------------
- *
- * PCondWait --
- *
- * Waits on a condition variable linked a recursive lock. (Similar to
- * pthread_cond_wait)
- *
- *----------------------------------------------------------------------
- *
- * PCondTimedWait --
- *
- * Waits for a limited amount of time on a condition variable linked to a
- * recursive lock. (Similar to pthread_cond_timedwait)
- *
- *----------------------------------------------------------------------
- */
-
-#ifndef HAVE_DECL_PTHREAD_MUTEX_RECURSIVE
-#define HAVE_DECL_PTHREAD_MUTEX_RECURSIVE 0
-#endif
-
-#if HAVE_DECL_PTHREAD_MUTEX_RECURSIVE
-/*
- * Pthread has native reentrant (AKA recursive) mutexes. Use them for
- * Tcl_Mutex.
- */
-
-typedef pthread_mutex_t PMutex;
-
-static void
-PMutexInit(
- PMutex *pmutexPtr)
-{
- pthread_mutexattr_t attr;
-
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(pmutexPtr, &attr);
-}
-
-#define PMutexDestroy pthread_mutex_destroy
-#define PMutexLock pthread_mutex_lock
-#define PMutexUnlock pthread_mutex_unlock
-#define PCondWait pthread_cond_wait
-#define PCondTimedWait pthread_cond_timedwait
+#ifdef TCL_THREADS
-#else /* !HAVE_PTHREAD_MUTEX_RECURSIVE */
-
-/*
- * No native support for reentrant mutexes. Emulate them with regular mutexes
- * and thread-local counters.
- */
-
-typedef struct PMutex {
- pthread_mutex_t mutex;
- pthread_t thread;
- int counter;
-} PMutex;
-
-static void
-PMutexInit(
- PMutex *pmutexPtr)
-{
- pthread_mutex_init(&pmutexPtr->mutex, NULL);
- pmutexPtr->thread = 0;
- pmutexPtr->counter = 0;
-}
-
-static void
-PMutexDestroy(
- PMutex *pmutexPtr)
-{
- pthread_mutex_destroy(&pmutexPtr->mutex);
-}
-
-static void
-PMutexLock(
- PMutex *pmutexPtr)
-{
- if (pmutexPtr->thread != pthread_self() || pmutexPtr->counter == 0) {
- pthread_mutex_lock(&pmutexPtr->mutex);
- pmutexPtr->thread = pthread_self();
- pmutexPtr->counter = 0;
- }
- pmutexPtr->counter++;
-}
-
-static void
-PMutexUnlock(
- PMutex *pmutexPtr)
-{
- pmutexPtr->counter--;
- if (pmutexPtr->counter == 0) {
- pmutexPtr->thread = 0;
- pthread_mutex_unlock(&pmutexPtr->mutex);
- }
-}
-
-static void
-PCondWait(
- pthread_cond_t *pcondPtr,
- PMutex *pmutexPtr)
-{
- pthread_cond_wait(pcondPtr, &pmutexPtr->mutex);
-}
-
-static void
-PCondTimedWait(
- pthread_cond_t *pcondPtr,
- PMutex *pmutexPtr,
- struct timespec *ptime)
-{
- pthread_cond_timedwait(pcondPtr, &pmutexPtr->mutex, ptime);
-}
-#endif /* HAVE_PTHREAD_MUTEX_RECURSIVE */
-
-#ifndef TCL_NO_DEPRECATED
-typedef struct {
+typedef struct ThreadSpecificData {
char nabuf[16];
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
-#endif /* TCL_NO_DEPRECATED */
/*
- * globalLock is used to serialize creation of mutexes, condition variables,
+ * masterLock is used to serialize creation of mutexes, condition variables,
* and thread local storage. This is the only place that can count on the
* ability to statically initialize the mutex.
*/
-static pthread_mutex_t globalLock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t masterLock = PTHREAD_MUTEX_INITIALIZER;
/*
* initLock is used to serialize initialization and finalization of Tcl. It
- * cannot use any dynamically allocated storage.
+ * cannot use any dyamically allocated storage.
*/
static pthread_mutex_t initLock = PTHREAD_MUTEX_INITIALIZER;
/*
* allocLock is used by Tcl's version of malloc for synchronization. For
- * obvious reasons, cannot use any dynamically allocated storage.
+ * obvious reasons, cannot use any dyamically allocated storage.
*/
-static PMutex allocLock;
-static pthread_once_t allocLockInitOnce = PTHREAD_ONCE_INIT;
+static pthread_mutex_t allocLock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t *allocLockPtr = &allocLock;
-static void
-allocLockInit(void)
-{
- PMutexInit(&allocLock);
-}
-static PMutex *allocLockPtr = &allocLock;
+/*
+ * These are for the critical sections inside this file.
+ */
+
+#define MASTER_LOCK pthread_mutex_lock(&masterLock)
+#define MASTER_UNLOCK pthread_mutex_unlock(&masterLock)
#endif /* TCL_THREADS */
+
/*
*----------------------------------------------------------------------
@@ -220,13 +73,13 @@ static PMutex *allocLockPtr = &allocLock;
int
TclpThreadCreate(
Tcl_ThreadId *idPtr, /* Return, the ID of the thread */
- Tcl_ThreadCreateProc *proc, /* Main() function of the thread */
- void *clientData, /* The one argument to Main() */
- TCL_HASH_TYPE stackSize, /* Size of stack for the new thread */
+ Tcl_ThreadCreateProc proc, /* Main() function of the thread */
+ ClientData clientData, /* The one argument to Main() */
+ int stackSize, /* Size of stack for the new thread */
int flags) /* Flags controlling behaviour of the new
* thread. */
{
-#if TCL_THREADS
+#ifdef TCL_THREADS
pthread_attr_t attr;
pthread_t theThread;
int result;
@@ -236,7 +89,7 @@ TclpThreadCreate(
#ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE
if (stackSize != TCL_THREAD_STACK_DEFAULT) {
- pthread_attr_setstacksize(&attr, (size_t)stackSize);
+ pthread_attr_setstacksize(&attr, (size_t) stackSize);
#ifdef TCL_THREAD_STACK_MIN
} else {
/*
@@ -252,23 +105,22 @@ TclpThreadCreate(
*/
size_t size;
-
result = pthread_attr_getstacksize(&attr, &size);
if (!result && (size < TCL_THREAD_STACK_MIN)) {
- pthread_attr_setstacksize(&attr, (size_t)TCL_THREAD_STACK_MIN);
+ pthread_attr_setstacksize(&attr, (size_t) TCL_THREAD_STACK_MIN);
}
-#endif /* TCL_THREAD_STACK_MIN */
+#endif
}
-#endif /* HAVE_PTHREAD_ATTR_SETSTACKSIZE */
-
- if (!(flags & TCL_THREAD_JOINABLE)) {
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+ if (! (flags & TCL_THREAD_JOINABLE)) {
+ pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
}
+
if (pthread_create(&theThread, &attr,
- (void * (*)(void *))(void *)proc, (void *)clientData) &&
+ (void * (*)(void *))proc, (void *)clientData) &&
pthread_create(&theThread, NULL,
- (void * (*)(void *))(void *)proc, (void *)clientData)) {
+ (void * (*)(void *))proc, (void *)clientData)) {
result = TCL_ERROR;
} else {
*idPtr = (Tcl_ThreadId)theThread;
@@ -277,11 +129,6 @@ TclpThreadCreate(
pthread_attr_destroy(&attr);
return result;
#else
- (void)idPtr;
- (void)proc;
- (void)clientData;
- (void)stackSize;
- (void)flags;
return TCL_ERROR;
#endif /* TCL_THREADS */
}
@@ -309,7 +156,7 @@ Tcl_JoinThread(
* thread we wait upon will be written into.
* May be NULL. */
{
-#if TCL_THREADS
+#ifdef TCL_THREADS
int result;
unsigned long retcode, *retcodePtr = &retcode;
@@ -319,13 +166,11 @@ Tcl_JoinThread(
}
return (result == 0) ? TCL_OK : TCL_ERROR;
#else
- (void)threadId;
- (void)state;
-
return TCL_ERROR;
#endif
}
+#ifdef TCL_THREADS
/*
*----------------------------------------------------------------------
*
@@ -346,12 +191,102 @@ void
TclpThreadExit(
int status)
{
-#if TCL_THREADS
pthread_exit(INT2PTR(status));
-#else /* TCL_THREADS */
- exit(status);
+}
#endif /* TCL_THREADS */
+
+#ifdef TCL_THREADS
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclpThreadGetStackSize --
+ *
+ * This procedure returns the size of the current thread's stack.
+ *
+ * Results:
+ * Stack size (in bytes?) or -1 for error or 0 for undeterminable.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+size_t
+TclpThreadGetStackSize(void)
+{
+ size_t stackSize = 0;
+#if defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) && defined(TclpPthreadGetAttrs)
+ pthread_attr_t threadAttr; /* This will hold the thread attributes for
+ * the current thread. */
+#ifdef __GLIBC__
+ /*
+ * Fix for [Bug 1815573]
+ *
+ * DESCRIPTION:
+ * On linux TclpPthreadGetAttrs (which is pthread_attr_get_np) may return
+ * bogus values on the initial thread.
+ *
+ * ASSUMPTIONS:
+ * There seems to be no api to determine if we are on the initial
+ * thread. The simple scheme implemented here assumes:
+ * 1. The first Tcl interp to be created lives in the initial thread. If
+ * this assumption is not true, the fix is to call
+ * TclpThreadGetStackSize from the initial thread previous to
+ * creating any Tcl interpreter. In this case, especially if another
+ * Tcl interpreter may be created in the initial thread, it might be
+ * better to enable the second branch in the #if below
+ * 2. There will be no races in creating the first Tcl interp - ie, the
+ * second Tcl interp will be created only after the first call to
+ * Tcl_CreateInterp returns.
+ *
+ * These assumptions are satisfied by tclsh. Embedders on linux may want
+ * to check their validity, and possibly adapt the code on failing to meet
+ * them.
+ */
+
+ static int initialized = 0;
+
+ if (!initialized) {
+ initialized = 1;
+ return 0;
+ } else {
+#else
+ {
+#endif
+ if (pthread_attr_init(&threadAttr) != 0) {
+ return -1;
+ }
+ if (TclpPthreadGetAttrs(pthread_self(), &threadAttr) != 0) {
+ pthread_attr_destroy(&threadAttr);
+ return (size_t)-1;
+ }
+ }
+
+
+ if (pthread_attr_getstacksize(&threadAttr, &stackSize) != 0) {
+ pthread_attr_destroy(&threadAttr);
+ return (size_t)-1;
+ }
+ pthread_attr_destroy(&threadAttr);
+#elif defined(HAVE_PTHREAD_GET_STACKSIZE_NP)
+#ifdef __APPLE__
+ /*
+ * On Darwin, the API below does not return the correct stack size for the
+ * main thread (which is not a real pthread), so fallback to getrlimit().
+ */
+ if (!pthread_main_np())
+#endif
+ stackSize = pthread_get_stacksize_np(pthread_self());
+#else
+ /*
+ * Cannot determine the real stack size of this thread. The caller might
+ * want to try looking at the process accounting limits instead.
+ */
+#endif
+ return stackSize;
}
+#endif /* TCL_THREADS */
/*
*----------------------------------------------------------------------
@@ -372,7 +307,7 @@ TclpThreadExit(
Tcl_ThreadId
Tcl_GetCurrentThread(void)
{
-#if TCL_THREADS
+#ifdef TCL_THREADS
return (Tcl_ThreadId) pthread_self();
#else
return (Tcl_ThreadId) 0;
@@ -401,7 +336,7 @@ Tcl_GetCurrentThread(void)
void
TclpInitLock(void)
{
-#if TCL_THREADS
+#ifdef TCL_THREADS
pthread_mutex_lock(&initLock);
#endif
}
@@ -409,7 +344,7 @@ TclpInitLock(void)
/*
*----------------------------------------------------------------------
*
- * TclFinalizeLock
+ * TclpFinalizeLock
*
* This procedure is used to destroy all private resources used in this
* file.
@@ -427,11 +362,11 @@ TclpInitLock(void)
void
TclFinalizeLock(void)
{
-#if TCL_THREADS
+#ifdef TCL_THREADS
/*
* You do not need to destroy mutexes that were created with the
* PTHREAD_MUTEX_INITIALIZER macro. These mutexes do not need any
- * destruction: globalLock, allocLock, and initLock.
+ * destruction: masterLock, allocLock, and initLock.
*/
pthread_mutex_unlock(&initLock);
@@ -458,7 +393,7 @@ TclFinalizeLock(void)
void
TclpInitUnlock(void)
{
-#if TCL_THREADS
+#ifdef TCL_THREADS
pthread_mutex_unlock(&initLock);
#endif
}
@@ -466,36 +401,37 @@ TclpInitUnlock(void)
/*
*----------------------------------------------------------------------
*
- * TclpGlobalLock
+ * TclpMasterLock
*
* This procedure is used to grab a lock that serializes creation and
* finalization of serialization objects. This interface is only needed
* in finalization; it is hidden during creation of the objects.
*
* This lock must be different than the initLock because the initLock is
- * held during creation of synchronization objects.
+ * held during creation of syncronization objects.
*
* Results:
* None.
*
* Side effects:
- * Acquire the global mutex.
+ * Acquire the master mutex.
*
*----------------------------------------------------------------------
*/
void
-TclpGlobalLock(void)
+TclpMasterLock(void)
{
-#if TCL_THREADS
- pthread_mutex_lock(&globalLock);
+#ifdef TCL_THREADS
+ pthread_mutex_lock(&masterLock);
#endif
}
+
/*
*----------------------------------------------------------------------
*
- * TclpGlobalUnlock
+ * TclpMasterUnlock
*
* This procedure is used to release a lock that serializes creation and
* finalization of synchronization objects.
@@ -504,16 +440,16 @@ TclpGlobalLock(void)
* None.
*
* Side effects:
- * Release the global mutex.
+ * Release the master mutex.
*
*----------------------------------------------------------------------
*/
void
-TclpGlobalUnlock(void)
+TclpMasterUnlock(void)
{
-#if TCL_THREADS
- pthread_mutex_unlock(&globalLock);
+#ifdef TCL_THREADS
+ pthread_mutex_unlock(&masterLock);
#endif
}
@@ -523,7 +459,7 @@ TclpGlobalUnlock(void)
* Tcl_GetAllocMutex
*
* This procedure returns a pointer to a statically initialized mutex for
- * use by the memory allocator. The allocator must use this lock, because
+ * use by the memory allocator. The alloctor must use this lock, because
* all other locks are allocated...
*
* Results:
@@ -539,17 +475,15 @@ TclpGlobalUnlock(void)
Tcl_Mutex *
Tcl_GetAllocMutex(void)
{
-#if TCL_THREADS
- PMutex **allocLockPtrPtr = &allocLockPtr;
-
- pthread_once(&allocLockInitOnce, allocLockInit);
+#ifdef TCL_THREADS
+ pthread_mutex_t **allocLockPtrPtr = &allocLockPtr;
return (Tcl_Mutex *) allocLockPtrPtr;
#else
return NULL;
#endif
}
-#if TCL_THREADS
+#ifdef TCL_THREADS
/*
*----------------------------------------------------------------------
@@ -565,7 +499,7 @@ Tcl_GetAllocMutex(void)
* None.
*
* Side effects:
- * May block the current thread. The mutex is acquired when this returns.
+ * May block the current thread. The mutex is aquired when this returns.
* Will allocate memory for a pthread_mutex_t and initialize this the
* first time this Tcl_Mutex is used.
*
@@ -574,26 +508,26 @@ Tcl_GetAllocMutex(void)
void
Tcl_MutexLock(
- Tcl_Mutex *mutexPtr) /* Really (PMutex **) */
+ Tcl_Mutex *mutexPtr) /* Really (pthread_mutex_t **) */
{
- PMutex *pmutexPtr;
+ pthread_mutex_t *pmutexPtr;
if (*mutexPtr == NULL) {
- pthread_mutex_lock(&globalLock);
+ MASTER_LOCK;
if (*mutexPtr == NULL) {
/*
- * Double inside global lock check to avoid a race condition.
+ * Double inside master lock check to avoid a race condition.
*/
- pmutexPtr = (PMutex *)ckalloc(sizeof(PMutex));
- PMutexInit(pmutexPtr);
- *mutexPtr = (Tcl_Mutex) pmutexPtr;
+ pmutexPtr = (pthread_mutex_t *)ckalloc(sizeof(pthread_mutex_t));
+ pthread_mutex_init(pmutexPtr, NULL);
+ *mutexPtr = (Tcl_Mutex)pmutexPtr;
TclRememberMutex(mutexPtr);
}
- pthread_mutex_unlock(&globalLock);
+ MASTER_UNLOCK;
}
- pmutexPtr = *((PMutex **) mutexPtr);
- PMutexLock(pmutexPtr);
+ pmutexPtr = *((pthread_mutex_t **)mutexPtr);
+ pthread_mutex_lock(pmutexPtr);
}
/*
@@ -615,11 +549,10 @@ Tcl_MutexLock(
void
Tcl_MutexUnlock(
- Tcl_Mutex *mutexPtr) /* Really (PMutex **) */
+ Tcl_Mutex *mutexPtr) /* Really (pthread_mutex_t **) */
{
- PMutex *pmutexPtr = *(PMutex **) mutexPtr;
-
- PMutexUnlock(pmutexPtr);
+ pthread_mutex_t *pmutexPtr = *(pthread_mutex_t **)mutexPtr;
+ pthread_mutex_unlock(pmutexPtr);
}
/*
@@ -630,7 +563,7 @@ Tcl_MutexUnlock(
* This procedure is invoked to clean up one mutex. This is only safe to
* call at the end of time.
*
- * This assumes the Global Lock is held.
+ * This assumes the Master Lock is held.
*
* Results:
* None.
@@ -645,11 +578,10 @@ void
TclpFinalizeMutex(
Tcl_Mutex *mutexPtr)
{
- PMutex *pmutexPtr = *(PMutex **) mutexPtr;
-
+ pthread_mutex_t *pmutexPtr = *(pthread_mutex_t **)mutexPtr;
if (pmutexPtr != NULL) {
- PMutexDestroy(pmutexPtr);
- ckfree(pmutexPtr);
+ pthread_mutex_destroy(pmutexPtr);
+ ckfree((char *) pmutexPtr);
*mutexPtr = NULL;
}
}
@@ -669,7 +601,7 @@ TclpFinalizeMutex(
* None.
*
* Side effects:
- * May block the current thread. The mutex is acquired when this returns.
+ * May block the current thread. The mutex is aquired when this returns.
* Will allocate memory for a pthread_mutex_t and initialize this the
* first time this Tcl_Mutex is used.
*
@@ -679,15 +611,15 @@ TclpFinalizeMutex(
void
Tcl_ConditionWait(
Tcl_Condition *condPtr, /* Really (pthread_cond_t **) */
- Tcl_Mutex *mutexPtr, /* Really (PMutex **) */
- const Tcl_Time *timePtr) /* Timeout on waiting period */
+ Tcl_Mutex *mutexPtr, /* Really (pthread_mutex_t **) */
+ Tcl_Time *timePtr) /* Timeout on waiting period */
{
pthread_cond_t *pcondPtr;
- PMutex *pmutexPtr;
+ pthread_mutex_t *pmutexPtr;
struct timespec ptime;
if (*condPtr == NULL) {
- pthread_mutex_lock(&globalLock);
+ MASTER_LOCK;
/*
* Double check inside mutex to avoid race, then initialize condition
@@ -695,17 +627,17 @@ Tcl_ConditionWait(
*/
if (*condPtr == NULL) {
- pcondPtr = (pthread_cond_t *)ckalloc(sizeof(pthread_cond_t));
+ pcondPtr = (pthread_cond_t *) ckalloc(sizeof(pthread_cond_t));
pthread_cond_init(pcondPtr, NULL);
- *condPtr = (Tcl_Condition) pcondPtr;
+ *condPtr = (Tcl_Condition)pcondPtr;
TclRememberCondition(condPtr);
}
- pthread_mutex_unlock(&globalLock);
+ MASTER_UNLOCK;
}
- pmutexPtr = *((PMutex **)mutexPtr);
+ pmutexPtr = *((pthread_mutex_t **)mutexPtr);
pcondPtr = *((pthread_cond_t **)condPtr);
if (timePtr == NULL) {
- PCondWait(pcondPtr, pmutexPtr);
+ pthread_cond_wait(pcondPtr, pmutexPtr);
} else {
Tcl_Time now;
@@ -718,7 +650,7 @@ Tcl_ConditionWait(
ptime.tv_sec = timePtr->sec + now.sec +
(timePtr->usec + now.usec) / 1000000;
ptime.tv_nsec = 1000 * ((timePtr->usec + now.usec) % 1000000);
- PCondTimedWait(pcondPtr, pmutexPtr, &ptime);
+ pthread_cond_timedwait(pcondPtr, pmutexPtr, &ptime);
}
}
@@ -746,12 +678,11 @@ Tcl_ConditionNotify(
Tcl_Condition *condPtr)
{
pthread_cond_t *pcondPtr = *((pthread_cond_t **)condPtr);
-
if (pcondPtr != NULL) {
pthread_cond_broadcast(pcondPtr);
} else {
/*
- * No-one has used the condition variable, so there are no waiters.
+ * Noone has used the condition variable, so there are no waiters.
*/
}
}
@@ -764,7 +695,7 @@ Tcl_ConditionNotify(
* This procedure is invoked to clean up a condition variable. This is
* only safe to call at the end of time.
*
- * This assumes the Global Lock is held.
+ * This assumes the Master Lock is held.
*
* Results:
* None.
@@ -780,10 +711,9 @@ TclpFinalizeCondition(
Tcl_Condition *condPtr)
{
pthread_cond_t *pcondPtr = *(pthread_cond_t **)condPtr;
-
if (pcondPtr != NULL) {
pthread_cond_destroy(pcondPtr);
- ckfree(pcondPtr);
+ ckfree((char *) pcondPtr);
*condPtr = NULL;
}
}
@@ -810,57 +740,55 @@ TclpFinalizeCondition(
*----------------------------------------------------------------------
*/
-#ifndef TCL_NO_DEPRECATED
Tcl_DirEntry *
TclpReaddir(
- TclDIR * dir)
+ DIR * dir)
{
return TclOSreaddir(dir);
}
-#undef TclpInetNtoa
char *
TclpInetNtoa(
struct in_addr addr)
{
-#if TCL_THREADS
+#ifdef TCL_THREADS
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
unsigned char *b = (unsigned char*) &addr.s_addr;
- snprintf(tsdPtr->nabuf, sizeof(tsdPtr->nabuf), "%u.%u.%u.%u", b[0], b[1], b[2], b[3]);
+ sprintf(tsdPtr->nabuf, "%u.%u.%u.%u", b[0], b[1], b[2], b[3]);
return tsdPtr->nabuf;
#else
return inet_ntoa(addr);
#endif
}
-#endif /* TCL_NO_DEPRECATED */
-#if TCL_THREADS
+#ifdef TCL_THREADS
/*
* Additions by AOL for specialized thread memory allocator.
*/
#ifdef USE_THREAD_ALLOC
+static volatile int initialized = 0;
static pthread_key_t key;
-typedef struct {
+typedef struct allocMutex {
Tcl_Mutex tlock;
- PMutex plock;
-} AllocMutex;
+ pthread_mutex_t plock;
+} allocMutex;
Tcl_Mutex *
TclpNewAllocMutex(void)
{
- AllocMutex *lockPtr;
- PMutex *plockPtr;
+ struct allocMutex *lockPtr;
+ register pthread_mutex_t *plockPtr;
- lockPtr = (AllocMutex *)malloc(sizeof(AllocMutex));
+ lockPtr = malloc(sizeof(struct allocMutex));
if (lockPtr == NULL) {
Tcl_Panic("could not allocate lock");
}
plockPtr = &lockPtr->plock;
lockPtr->tlock = (Tcl_Mutex) plockPtr;
- PMutexInit(&lockPtr->plock);
+ pthread_mutex_init(&lockPtr->plock, NULL);
return &lockPtr->tlock;
}
@@ -868,47 +796,48 @@ void
TclpFreeAllocMutex(
Tcl_Mutex *mutex) /* The alloc mutex to free. */
{
- AllocMutex *lockPtr = (AllocMutex *)mutex;
-
+ allocMutex* lockPtr = (allocMutex*) mutex;
if (!lockPtr) {
return;
}
- PMutexDestroy(&lockPtr->plock);
+ pthread_mutex_destroy(&lockPtr->plock);
free(lockPtr);
}
void
-TclpInitAllocCache(void)
-{
- pthread_key_create(&key, NULL);
-}
-
-void
TclpFreeAllocCache(
void *ptr)
{
if (ptr != NULL) {
/*
- * Called by TclFinalizeThreadAllocThread() during the thread
- * finalization initiated from Tcl_FinalizeThread()
+ * Called by the pthread lib when a thread exits
*/
TclFreeAllocCache(ptr);
pthread_setspecific(key, NULL);
- } else {
+ } else if (initialized) {
/*
- * Called by TclFinalizeThreadAlloc() during the process
+ * Called by us in TclFinalizeThreadAlloc() during the library
* finalization initiated from Tcl_Finalize()
*/
pthread_key_delete(key);
+ initialized = 0;
}
}
void *
TclpGetAllocCache(void)
{
+ if (!initialized) {
+ pthread_mutex_lock(allocLockPtr);
+ if (!initialized) {
+ pthread_key_create(&key, TclpFreeAllocCache);
+ initialized = 1;
+ }
+ pthread_mutex_unlock(allocLockPtr);
+ }
return pthread_getspecific(key);
}
@@ -919,58 +848,6 @@ TclpSetAllocCache(
pthread_setspecific(key, arg);
}
#endif /* USE_THREAD_ALLOC */
-
-void *
-TclpThreadCreateKey(void)
-{
- pthread_key_t *ptkeyPtr;
-
- ptkeyPtr = (pthread_key_t *)TclpSysAlloc(sizeof(pthread_key_t), 0);
- if (NULL == ptkeyPtr) {
- Tcl_Panic("unable to allocate thread key!");
- }
-
- if (pthread_key_create(ptkeyPtr, NULL)) {
- Tcl_Panic("unable to create pthread key!");
- }
-
- return ptkeyPtr;
-}
-
-void
-TclpThreadDeleteKey(
- void *keyPtr)
-{
- pthread_key_t *ptkeyPtr = (pthread_key_t *)keyPtr;
-
- if (pthread_key_delete(*ptkeyPtr)) {
- Tcl_Panic("unable to delete key!");
- }
-
- TclpSysFree(keyPtr);
-}
-
-void
-TclpThreadSetGlobalTSD(
- void *tsdKeyPtr,
- void *ptr)
-{
- pthread_key_t *ptkeyPtr = (pthread_key_t *)tsdKeyPtr;
-
- if (pthread_setspecific(*ptkeyPtr, ptr)) {
- Tcl_Panic("unable to set global TSD value");
- }
-}
-
-void *
-TclpThreadGetGlobalTSD(
- void *tsdKeyPtr)
-{
- pthread_key_t *ptkeyPtr = (pthread_key_t *)tsdKeyPtr;
-
- return pthread_getspecific(*ptkeyPtr);
-}
-
#endif /* TCL_THREADS */
/*
diff --git a/unix/tclUnixThrd.h b/unix/tclUnixThrd.h
new file mode 100644
index 0000000..6a73132
--- /dev/null
+++ b/unix/tclUnixThrd.h
@@ -0,0 +1,19 @@
+/*
+ * tclUnixThrd.h --
+ *
+ * This header file defines things for thread support.
+ *
+ * Copyright (c) 1998 Sun Microsystems, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#ifndef _TCLUNIXTHRD
+#define _TCLUNIXTHRD
+
+#ifdef TCL_THREADS
+
+
+#endif /* TCL_THREADS */
+#endif /* _TCLUNIXTHRD */
diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c
index c4f6737..b98f2e1 100644
--- a/unix/tclUnixTime.c
+++ b/unix/tclUnixTime.c
@@ -4,26 +4,29 @@
* Contains Unix specific versions of Tcl functions that obtain time
* values from the operating system.
*
- * Copyright © 1995 Sun Microsystems, Inc.
+ * Copyright (c) 1995 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tclInt.h"
+#include <locale.h>
#if defined(TCL_WIDE_CLICKS) && defined(MAC_OSX_TCL)
#include <mach/mach_time.h>
#endif
+#define TM_YEAR_BASE 1900
+#define IsLeapYear(x) (((x)%4 == 0) && ((x)%100 != 0 || (x)%400 == 0))
+
/*
* TclpGetDate is coded to return a pointer to a 'struct tm'. For thread
* safety, this structure must be in thread-specific data. The 'tmKey'
* variable is the key to this buffer.
*/
-#ifndef TCL_NO_DEPRECATED
static Tcl_ThreadDataKey tmKey;
-typedef struct {
+typedef struct ThreadSpecificData {
struct tm gmtime_buf;
struct tm localtime_buf;
} ThreadSpecificData;
@@ -44,13 +47,11 @@ static char *lastTZ = NULL; /* Holds the last setting of the TZ
*/
static void SetTZIfNecessary(void);
-static void CleanupMemory(void *clientData);
-#endif /* TCL_NO_DEPRECATED */
-
+static void CleanupMemory(ClientData clientData);
static void NativeScaleTime(Tcl_Time *timebuf,
- void *clientData);
+ ClientData clientData);
static void NativeGetTime(Tcl_Time *timebuf,
- void *clientData);
+ ClientData clientData);
/*
* TIP #233 (Virtualized Time): Data for the time hooks, if any.
@@ -58,24 +59,7 @@ static void NativeGetTime(Tcl_Time *timebuf,
Tcl_GetTimeProc *tclGetTimeProcPtr = NativeGetTime;
Tcl_ScaleTimeProc *tclScaleTimeProcPtr = NativeScaleTime;
-void *tclTimeClientData = NULL;
-
-/*
- * Inlined version of Tcl_GetTime.
- */
-
-static inline void
-GetTime(
- Tcl_Time *timePtr)
-{
- tclGetTimeProcPtr(timePtr, tclTimeClientData);
-}
-
-static inline int
-IsTimeNative(void)
-{
- return tclGetTimeProcPtr == NativeGetTime;
-}
+ClientData tclTimeClientData = NULL;
/*
*----------------------------------------------------------------------
@@ -103,38 +87,12 @@ TclpGetSeconds(void)
/*
*----------------------------------------------------------------------
*
- * TclpGetMicroseconds --
- *
- * This procedure returns the number of microseconds from the epoch.
- * On most Unix systems the epoch is Midnight Jan 1, 1970 GMT.
- *
- * Results:
- * Number of microseconds from the epoch.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-long long
-TclpGetMicroseconds(void)
-{
- Tcl_Time time;
-
- GetTime(&time);
- return ((long long) time.sec)*1000000 + time.usec;
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TclpGetClicks --
*
* This procedure returns a value that represents the highest resolution
- * clock available on the system. There are no guarantees on what the
+ * clock available on the system. There are no garantees on what the
* resolution will be. In Tcl we will call this value a "click". The
- * start time is also system dependent.
+ * start time is also system dependant.
*
* Results:
* Number of clicks from some start time.
@@ -151,11 +109,11 @@ TclpGetClicks(void)
unsigned long now;
#ifdef NO_GETTOD
- if (!IsTimeNative()) {
+ if (tclGetTimeProcPtr != NativeGetTime) {
Tcl_Time time;
- GetTime(&time);
- now = ((unsigned long)(time.sec)*1000000UL) + (unsigned long)(time.usec);
+ (*tclGetTimeProcPtr) (&time, tclTimeClientData);
+ now = time.sec*1000000 + time.usec;
} else {
/*
* A semi-NativeGetTime, specialized to clicks.
@@ -164,26 +122,26 @@ TclpGetClicks(void)
now = (unsigned long) times(&dummy);
}
-#else /* !NO_GETTOD */
+#else
Tcl_Time time;
- GetTime(&time);
- now = ((unsigned long)(time.sec)*1000000UL) + (unsigned long)(time.usec);
-#endif /* NO_GETTOD */
+ (*tclGetTimeProcPtr) (&time, tclTimeClientData);
+ now = time.sec*1000000 + time.usec;
+#endif
return now;
}
#ifdef TCL_WIDE_CLICKS
/*
- *----------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
*
* TclpGetWideClicks --
*
* This procedure returns a WideInt value that represents the highest
- * resolution clock available on the system. There are no guarantees on
+ * resolution clock available on the system. There are no garantees on
* what the resolution will be. In Tcl we will call this value a "click".
- * The start time is also system dependent.
+ * The start time is also system dependant.
*
* Results:
* Number of WideInt clicks from some start time.
@@ -191,32 +149,32 @@ TclpGetClicks(void)
* Side effects:
* None.
*
- *----------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
*/
-long long
+Tcl_WideInt
TclpGetWideClicks(void)
{
- long long now;
+ Tcl_WideInt now;
- if (!IsTimeNative()) {
+ if (tclGetTimeProcPtr != NativeGetTime) {
Tcl_Time time;
- GetTime(&time);
- now = ((long long) time.sec)*1000000 + time.usec;
+ (*tclGetTimeProcPtr) (&time, tclTimeClientData);
+ now = (Tcl_WideInt) (time.sec*1000000 + time.usec);
} else {
#ifdef MAC_OSX_TCL
- now = (long long) (mach_absolute_time() & INT64_MAX);
+ now = (Tcl_WideInt) (mach_absolute_time() & INT64_MAX);
#else
#error Wide high-resolution clicks not implemented on this platform
-#endif /* MAC_OSX_TCL */
+#endif
}
return now;
}
/*
- *----------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
*
* TclpWideClicksToNanoseconds --
*
@@ -229,22 +187,22 @@ TclpGetWideClicks(void)
* Side effects:
* None.
*
- *----------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
*/
double
TclpWideClicksToNanoseconds(
- long long clicks)
+ Tcl_WideInt clicks)
{
double nsec;
- if (!IsTimeNative()) {
+ if (tclGetTimeProcPtr != NativeGetTime) {
nsec = clicks * 1000;
} else {
#ifdef MAC_OSX_TCL
static mach_timebase_info_data_t tb;
static uint64_t maxClicksForUInt64;
-
+
if (!tb.denom) {
mach_timebase_info(&tb);
maxClicksForUInt64 = UINT64_MAX / tb.numer;
@@ -256,23 +214,24 @@ TclpWideClicksToNanoseconds(
}
#else
#error Wide high-resolution clicks not implemented on this platform
-#endif /* MAC_OSX_TCL */
+#endif
}
return nsec;
}
+#endif /* TCL_WIDE_CLICKS */
/*
*----------------------------------------------------------------------
*
- * TclpWideClickInMicrosec --
+ * TclpGetTimeZone --
*
- * This procedure return scale to convert click values from the
- * TclpGetWideClicks native resolution to microsecond resolution
- * and back.
+ * Determines the current timezone. The method varies wildly between
+ * different platform implementations, so its hidden in this function.
*
* Results:
- * 1 click in microseconds as double.
+ * The return value is the local time zone, measured in minutes away from
+ * GMT (-ve for east, +ve for west).
*
* Side effects:
* None.
@@ -280,33 +239,103 @@ TclpWideClicksToNanoseconds(
*----------------------------------------------------------------------
*/
-double
-TclpWideClickInMicrosec(void)
+int
+TclpGetTimeZone(
+ unsigned long currentTime)
{
- if (!IsTimeNative()) {
- return 1.0;
- } else {
-#ifdef MAC_OSX_TCL
- static int initialized = 0;
- static double scale = 0.0;
+ int timeZone;
- if (initialized) {
- return scale;
- } else {
- mach_timebase_info_data_t tb;
+ /*
+ * We prefer first to use the time zone in "struct tm" if the structure
+ * contains such a member. Following that, we try to locate the external
+ * 'timezone' variable and use its value. If both of those methods fail,
+ * we attempt to convert a known time to local time and use the difference
+ * from UTC as the local time zone. In all cases, we need to undo any
+ * Daylight Saving Time adjustment.
+ */
- mach_timebase_info(&tb);
- /* value of tb.numer / tb.denom = 1 click in nanoseconds */
- scale = ((double)tb.numer) / tb.denom / 1000;
- initialized = 1;
- return scale;
- }
-#else
-#error Wide high-resolution clicks not implemented on this platform
-#endif /* MAC_OSX_TCL */
+#if defined(HAVE_TM_TZADJ)
+#define TCL_GOT_TIMEZONE
+ /*
+ * Struct tm contains tm_tzadj - that value may be used.
+ */
+
+ time_t curTime = (time_t) currentTime;
+ struct tm *timeDataPtr = TclpLocaltime(&curTime);
+
+ timeZone = timeDataPtr->tm_tzadj / 60;
+ if (timeDataPtr->tm_isdst) {
+ timeZone += 60;
+ }
+#endif
+
+#if defined(HAVE_TM_GMTOFF) && !defined (TCL_GOT_TIMEZONE)
+#define TCL_GOT_TIMEZONE
+ /*
+ * Struct tm contains tm_gmtoff - that value may be used.
+ */
+
+ time_t curTime = (time_t) currentTime;
+ struct tm *timeDataPtr = TclpLocaltime(&curTime);
+
+ timeZone = -(timeDataPtr->tm_gmtoff / 60);
+ if (timeDataPtr->tm_isdst) {
+ timeZone += 60;
+ }
+#endif
+
+#if defined(HAVE_TIMEZONE_VAR) && !defined(TCL_GOT_TIMEZONE) && !defined(USE_DELTA_FOR_TZ)
+#define TCL_GOT_TIMEZONE
+ /*
+ * The 'timezone' external var is present and may be used.
+ */
+
+ SetTZIfNecessary();
+
+ /*
+ * Note: this is not a typo in "timezone" below! See tzset documentation
+ * for details.
+ */
+
+ timeZone = timezone / 60;
+#endif
+
+#if !defined(TCL_GOT_TIMEZONE)
+#define TCL_GOT_TIMEZONE
+ /*
+ * Fallback - determine time zone with a known reference time.
+ */
+
+ time_t tt;
+ struct tm *stm;
+
+ tt = 849268800L; /* 1996-11-29 12:00:00 GMT */
+ stm = TclpLocaltime(&tt); /* eg 1996-11-29 6:00:00 CST6CDT */
+
+ /*
+ * The calculation below assumes a max of +12 or -12 hours from GMT.
+ */
+
+ timeZone = (12 - stm->tm_hour)*60 + (0 - stm->tm_min);
+ if (stm->tm_isdst) {
+ timeZone += 60;
}
+
+ /*
+ * Now have offset for our known reference time, eg +360 for CST6CDT.
+ */
+#endif
+
+#ifndef TCL_GOT_TIMEZONE
+ /*
+ * Cause fatal compile error, we don't know how to get timezone.
+ */
+
+#error autoconf did not figure out how to determine the timezone.
+#endif
+
+ return timeZone;
}
-#endif /* TCL_WIDE_CLICKS */
/*
*----------------------------------------------------------------------
@@ -332,7 +361,7 @@ void
Tcl_GetTime(
Tcl_Time *timePtr) /* Location to store time information. */
{
- GetTime(timePtr);
+ (*tclGetTimeProcPtr) (timePtr, tclTimeClientData);
}
/*
@@ -353,10 +382,9 @@ Tcl_GetTime(
*----------------------------------------------------------------------
*/
-#ifndef TCL_NO_DEPRECATED
struct tm *
TclpGetDate(
- const time_t *time,
+ CONST time_t *time,
int useGMT)
{
if (useGMT) {
@@ -384,7 +412,7 @@ TclpGetDate(
struct tm *
TclpGmtime(
- const time_t *timePtr) /* Pointer to the number of seconds since the
+ CONST time_t *timePtr) /* Pointer to the number of seconds since the
* local system's epoch */
{
/*
@@ -394,14 +422,14 @@ TclpGmtime(
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&tmKey);
#ifdef HAVE_GMTIME_R
- gmtime_r(timePtr, &tsdPtr->gmtime_buf);
+ gmtime_r(timePtr, &(tsdPtr->gmtime_buf));
#else
Tcl_MutexLock(&tmMutex);
- memcpy(&tsdPtr->gmtime_buf, gmtime(timePtr), sizeof(struct tm));
+ memcpy(&(tsdPtr->gmtime_buf), gmtime(timePtr), sizeof(struct tm));
Tcl_MutexUnlock(&tmMutex);
#endif
- return &tsdPtr->gmtime_buf;
+ return &(tsdPtr->gmtime_buf);
}
/*
@@ -423,7 +451,7 @@ TclpGmtime(
struct tm *
TclpLocaltime(
- const time_t *timePtr) /* Pointer to the number of seconds since the
+ CONST time_t *timePtr) /* Pointer to the number of seconds since the
* local system's epoch */
{
/*
@@ -434,16 +462,15 @@ TclpLocaltime(
SetTZIfNecessary();
#ifdef HAVE_LOCALTIME_R
- localtime_r(timePtr, &tsdPtr->localtime_buf);
+ localtime_r(timePtr, &(tsdPtr->localtime_buf));
#else
Tcl_MutexLock(&tmMutex);
- memcpy(&tsdPtr->localtime_buf, localtime(timePtr), sizeof(struct tm));
+ memcpy(&(tsdPtr->localtime_buf), localtime(timePtr), sizeof(struct tm));
Tcl_MutexUnlock(&tmMutex);
#endif
- return &tsdPtr->localtime_buf;
+ return &(tsdPtr->localtime_buf);
}
-#endif /* TCL_NO_DEPRECATED */
/*
*----------------------------------------------------------------------
@@ -466,7 +493,7 @@ void
Tcl_SetTimeProc(
Tcl_GetTimeProc *getProc,
Tcl_ScaleTimeProc *scaleProc,
- void *clientData)
+ ClientData clientData)
{
tclGetTimeProcPtr = getProc;
tclScaleTimeProcPtr = scaleProc;
@@ -493,7 +520,7 @@ void
Tcl_QueryTimeProc(
Tcl_GetTimeProc **getProc,
Tcl_ScaleTimeProc **scaleProc,
- void **clientData)
+ ClientData *clientData)
{
if (getProc) {
*getProc = tclGetTimeProcPtr;
@@ -525,8 +552,8 @@ Tcl_QueryTimeProc(
static void
NativeScaleTime(
- TCL_UNUSED(Tcl_Time *),
- TCL_UNUSED(void *))
+ Tcl_Time *timePtr,
+ ClientData clientData)
{
/* Native scale is 1:1. Nothing is done */
}
@@ -551,7 +578,7 @@ NativeScaleTime(
static void
NativeGetTime(
Tcl_Time *timePtr,
- TCL_UNUSED(void *))
+ ClientData clientData)
{
struct timeval tv;
@@ -578,11 +605,10 @@ NativeGetTime(
*----------------------------------------------------------------------
*/
-#ifndef TCL_NO_DEPRECATED
static void
SetTZIfNecessary(void)
{
- const char *newTZ = getenv("TZ");
+ CONST char *newTZ = getenv("TZ");
Tcl_MutexLock(&tmMutex);
if (newTZ == NULL) {
@@ -591,11 +617,11 @@ SetTZIfNecessary(void)
if (lastTZ == NULL || strcmp(lastTZ, newTZ)) {
tzset();
if (lastTZ == NULL) {
- Tcl_CreateExitHandler(CleanupMemory, NULL);
+ Tcl_CreateExitHandler(CleanupMemory, (ClientData) NULL);
} else {
- ckfree(lastTZ);
+ Tcl_Free(lastTZ);
}
- lastTZ = (char *) ckalloc(strlen(newTZ) + 1);
+ lastTZ = ckalloc(strlen(newTZ) + 1);
strcpy(lastTZ, newTZ);
}
Tcl_MutexUnlock(&tmMutex);
@@ -620,11 +646,10 @@ SetTZIfNecessary(void)
static void
CleanupMemory(
- TCL_UNUSED(void *))
+ ClientData ignored)
{
ckfree(lastTZ);
}
-#endif /* TCL_NO_DEPRECATED */
/*
* Local Variables:
diff --git a/unix/tclXtNotify.c b/unix/tclXtNotify.c
index 87f7e86..b2d1f4d 100644
--- a/unix/tclXtNotify.c
+++ b/unix/tclXtNotify.c
@@ -4,20 +4,17 @@
* This file contains the notifier driver implementation for the Xt
* intrinsics.
*
- * Copyright © 1997 Sun Microsystems, Inc.
+ * Copyright (c) 1997 by Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#ifndef USE_TCL_STUBS
-# define USE_TCL_STUBS
-#endif
#include <X11/Intrinsic.h>
#include "tclInt.h"
/*
- * This structure is used to keep track of the notifier info for a
+ * This structure is used to keep track of the notifier info for a a
* registered file.
*/
@@ -33,7 +30,7 @@ typedef struct FileHandler {
XtInputId except; /* Xt exception callback handle. */
Tcl_FileProc *proc; /* Procedure to call, in the style of
* Tcl_CreateFileHandler. */
- void *clientData; /* Argument to pass to proc. */
+ ClientData clientData; /* Argument to pass to proc. */
struct FileHandler *nextPtr;/* Next in list of all files we care about. */
} FileHandler;
@@ -42,7 +39,7 @@ typedef struct FileHandler {
* handlers are ready to fire.
*/
-typedef struct {
+typedef struct FileHandlerEvent {
Tcl_Event header; /* Information that is standard for all
* events. */
int fd; /* File descriptor that is ready. Used to find
@@ -79,19 +76,19 @@ static int initialized = 0;
static int FileHandlerEventProc(Tcl_Event *evPtr, int flags);
static void FileProc(XtPointer clientData, int *source,
XtInputId *id);
-static void NotifierExitHandler(void *clientData);
+static void NotifierExitHandler(ClientData clientData);
static void TimerProc(XtPointer clientData, XtIntervalId *id);
static void CreateFileHandler(int fd, int mask,
- Tcl_FileProc *proc, void *clientData);
+ Tcl_FileProc *proc, ClientData clientData);
static void DeleteFileHandler(int fd);
-static void SetTimer(const Tcl_Time * timePtr);
-static int WaitForEvent(const Tcl_Time * timePtr);
+static void SetTimer(Tcl_Time * timePtr);
+static int WaitForEvent(Tcl_Time * timePtr);
/*
* Functions defined in this file for use by users of the Xt Notifier:
*/
-MODULE_SCOPE void InitNotifier(void);
+MODULE_SCOPE void InitNotifier(void);
MODULE_SCOPE XtAppContext TclSetAppContext(XtAppContext ctx);
/*
@@ -132,7 +129,7 @@ TclSetAppContext(
* after initialization, so we panic.
*/
- Tcl_Panic("TclSetAppContext: multiple application contexts");
+ Tcl_Panic("TclSetAppContext: multiple application contexts");
}
} else {
/*
@@ -181,13 +178,7 @@ TclSetAppContext(
void
InitNotifier(void)
{
- static const Tcl_NotifierProcs np =
- SetTimer,
- WaitForEvent,
- CreateFileHandler,
- DeleteFileHandler,
- NULL, NULL, NULL, NULL
- };
+ Tcl_NotifierProcs np;
/*
* Only reinitialize if we are not in exit handling. The notifier can get
@@ -199,6 +190,14 @@ InitNotifier(void)
return;
}
+ np.createFileHandlerProc = CreateFileHandler;
+ np.deleteFileHandlerProc = DeleteFileHandler;
+ np.setTimerProc = SetTimer;
+ np.waitForEventProc = WaitForEvent;
+ np.initNotifierProc = Tcl_InitNotifier;
+ np.finalizeNotifierProc = Tcl_FinalizeNotifier;
+ np.alertNotifierProc = Tcl_AlertNotifier;
+ np.serviceModeHookProc = Tcl_ServiceModeHook;
Tcl_SetNotifier(&np);
/*
@@ -207,6 +206,7 @@ InitNotifier(void)
*/
initialized = 1;
+ memset(&np, 0, sizeof(np));
Tcl_CreateExitHandler(NotifierExitHandler, NULL);
}
@@ -229,7 +229,7 @@ InitNotifier(void)
static void
NotifierExitHandler(
- TCL_UNUSED(void *))
+ ClientData clientData) /* Not used. */
{
if (notifier.currentTimeout != 0) {
XtRemoveTimeOut(notifier.currentTimeout);
@@ -263,7 +263,7 @@ NotifierExitHandler(
static void
SetTimer(
- const Tcl_Time *timePtr) /* Timeout value, may be NULL. */
+ Tcl_Time *timePtr) /* Timeout value, may be NULL. */
{
long timeout;
@@ -302,7 +302,7 @@ SetTimer(
static void
TimerProc(
- TCL_UNUSED(XtPointer),
+ XtPointer clientData, /* Not used. */
XtIntervalId *id)
{
if (*id != notifier.currentTimeout) {
@@ -339,7 +339,7 @@ CreateFileHandler(
* called. */
Tcl_FileProc *proc, /* Procedure to call for each selected
* event. */
- void *clientData) /* Arbitrary data to pass to proc. */
+ ClientData clientData) /* Arbitrary data to pass to proc. */
{
FileHandler *filePtr;
@@ -356,7 +356,7 @@ CreateFileHandler(
}
}
if (filePtr == NULL) {
- filePtr = (FileHandler *) ckalloc(sizeof(FileHandler));
+ filePtr = (FileHandler*) ckalloc(sizeof(FileHandler));
filePtr->fd = fd;
filePtr->read = 0;
filePtr->write = 0;
@@ -467,7 +467,7 @@ DeleteFileHandler(
if (filePtr->mask & TCL_EXCEPTION) {
XtRemoveInput(filePtr->except);
}
- ckfree(filePtr);
+ ckfree((char *) filePtr);
}
/*
@@ -493,7 +493,7 @@ FileProc(
int *fd,
XtInputId *id)
{
- FileHandler *filePtr = (FileHandler *) clientData;
+ FileHandler *filePtr = (FileHandler *)clientData;
FileHandlerEvent *fileEvPtr;
int mask = 0;
@@ -598,7 +598,7 @@ FileHandlerEventProc(
mask = filePtr->readyMask & filePtr->mask;
filePtr->readyMask = 0;
if (mask != 0) {
- filePtr->proc(filePtr->clientData, mask);
+ (*filePtr->proc)(filePtr->clientData, mask);
}
break;
}
@@ -627,7 +627,7 @@ FileHandlerEventProc(
static int
WaitForEvent(
- const Tcl_Time *timePtr) /* Maximum block time, or NULL. */
+ Tcl_Time *timePtr) /* Maximum block time, or NULL. */
{
int timeout;
diff --git a/unix/tclXtTest.c b/unix/tclXtTest.c
index c6bcc18..8437f2a 100644
--- a/unix/tclXtTest.c
+++ b/unix/tclXtTest.c
@@ -1,28 +1,20 @@
-/*
+/*
* tclXtTest.c --
*
* Contains commands for Xt notifier specific tests on Unix.
*
- * Copyright © 1997 Sun Microsystems, Inc.
+ * Copyright (c) 1997 by Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#ifndef USE_TCL_STUBS
-# define USE_TCL_STUBS
-#endif
#include <X11/Intrinsic.h>
#include "tcl.h"
-static Tcl_ObjCmdProc TesteventloopCmd;
-
-/*
- * Functions defined in tclXtNotify.c for use by users of the Xt Notifier:
- */
-
-extern void InitNotifier(void);
-extern XtAppContext TclSetAppContext(XtAppContext ctx);
+static int TesteventloopCmd(ClientData clientData,
+ Tcl_Interp *interp, int argc, CONST char **argv);
+extern void InitNotifier(void);
/*
*----------------------------------------------------------------------
@@ -43,17 +35,17 @@ extern XtAppContext TclSetAppContext(XtAppContext ctx);
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Tclxttest_Init(
Tcl_Interp *interp) /* Interpreter for application. */
{
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
XtToolkitInitialize();
InitNotifier();
- Tcl_CreateObjCommand(interp, "testeventloop", TesteventloopCmd,
- NULL, NULL);
+ Tcl_CreateCommand(interp, "testeventloop", TesteventloopCmd,
+ (ClientData) 0, NULL);
return TCL_OK;
}
@@ -77,22 +69,23 @@ Tclxttest_Init(
static int
TesteventloopCmd(
- TCL_UNUSED(void *),
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ int argc, /* Number of arguments. */
+ CONST char **argv) /* Argument strings. */
{
static int *framePtr = NULL;/* Pointer to integer on stack frame of
* innermost invocation of the "wait"
* subcommand. */
- if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ...");
- return TCL_ERROR;
+ if (argc < 2) {
+ Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0],
+ " option ... \"", NULL);
+ return TCL_ERROR;
}
- if (strcmp(Tcl_GetString(objv[1]), "done") == 0) {
+ if (strcmp(argv[1], "done") == 0) {
*framePtr = 1;
- } else if (strcmp(Tcl_GetString(objv[1]), "wait") == 0) {
+ } else if (strcmp(argv[1], "wait") == 0) {
int *oldFramePtr;
int done;
int oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
@@ -116,18 +109,9 @@ TesteventloopCmd(
(void) Tcl_SetServiceMode(oldMode);
framePtr = oldFramePtr;
} else {
- Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]),
- "\": must be done or wait", (void *)NULL);
+ Tcl_AppendResult(interp, "bad option \"", argv[1],
+ "\": must be done or wait", NULL);
return TCL_ERROR;
}
return TCL_OK;
}
-
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 4
- * fill-column: 78
- * tab-width: 8
- * End:
- */
diff --git a/unix/tclooConfig.sh b/unix/tclooConfig.sh
deleted file mode 100644
index a400b5b..0000000
--- a/unix/tclooConfig.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-# tclooConfig.sh --
-#
-# This shell script (for sh) is generated automatically by TclOO's configure
-# script, or would be except it has no values that we substitute. It will
-# create shell variables for most of the configuration options discovered by
-# the configure script. This script is intended to be included by TEA-based
-# configure scripts for TclOO extensions so that they don't have to figure
-# this all out for themselves.
-#
-# The information in this file is specific to a single platform.
-
-# These are mostly empty because no special steps are ever needed from Tcl 8.6
-# onwards; all libraries and include files are just part of Tcl.
-TCLOO_LIB_SPEC=""
-TCLOO_STUB_LIB_SPEC=""
-TCLOO_INCLUDE_SPEC=""
-TCLOO_PRIVATE_INCLUDE_SPEC=""
-TCLOO_CFLAGS=""
-TCLOO_VERSION=1.3