summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/aclocal.m41303
-rw-r--r--win/configure.in257
-rw-r--r--win/stubs.c6
3 files changed, 533 insertions, 1033 deletions
diff --git a/win/aclocal.m4 b/win/aclocal.m4
index d43ff7b..9099193 100644
--- a/win/aclocal.m4
+++ b/win/aclocal.m4
@@ -1,875 +1,428 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4a
-
-dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-dnl PARTICULAR PURPOSE.
-
-#------------------------------------------------------------------------
-# SC_PATH_TCLCONFIG --
-#
-# Locate the tclConfig.sh file and perform a sanity check on
-# the Tcl compile flags
-# Currently a no-op for Windows
-#
-# Arguments:
-# none
-#
-# Results:
-#
-# Adds the following arguments to configure:
-# --with-tcl=...
-#
-# Defines the following vars:
-# TCLCONFIG Full path to the tclConfig.sh file
-#------------------------------------------------------------------------
-
-AC_DEFUN(SC_PATH_TCLCONFIG, [
-])
-
-#------------------------------------------------------------------------
-# SC_PATH_TKCONFIG --
-#
-# Locate the tkConfig.sh file
-# Currently a no-op for Windows
-#
-# Arguments:
-# none
-#
-# Results:
-#
-# Adds the following arguments to configure:
-# --with-tk=...
-#
-# Defines the following vars:
-# TKCONFIG Full path to the tkConfig.sh file
-#------------------------------------------------------------------------
-
-AC_DEFUN(SC_PATH_TKCONFIG, [
-])
-
-#------------------------------------------------------------------------
-# SC_LOAD_TCLCONFIG --
-#
-# Load the tclConfig.sh file
-# Currently a no-op for Windows
-#
-# Arguments:
-#
-# Requires the following vars to be set:
-# TCLCONFIG
-#
-# Results:
-#
-# Subst's the following vars:
-# TCL_CC
-# TCL_DEFS
-# TCL_CFLAGS
-# TCL_DBGX
-# TCL_LIBS
-# TCL_SHLIB_LD
-# SHLIB_SUFFIX
-# TCL_LD_FLAGS
-# TCL_BUILD_LIB_SPEC
-# TCL_LIB_SPEC
-# TCL_SHARED_LIB_SUFFIX
-#------------------------------------------------------------------------
-
-AC_DEFUN(SC_LOAD_TCLCONFIG, [
-])
-
-#------------------------------------------------------------------------
-# SC_LOAD_TKCONFIG --
-#
-# Load the tkConfig.sh file
-# Currently a no-op for Windows
-#
-# Arguments:
-#
-# Requires the following vars to be set:
-# TKCONFIG
-#
-# Results:
-#
-# Subst's the following vars:
-# TK_VERSION
-# TK_DEFS
-# TK_DBGX
-# TK_LIBS
-# TK_XINCLUDES
-# TK_XLIBSW
-# TK_BUILD_LIB_SPEC
-# TK_LIB_SPEC
-#------------------------------------------------------------------------
-
-AC_DEFUN(SC_LOAD_TKCONFIG, [
-])
-
-#------------------------------------------------------------------------
-# SC_ENABLE_GCC --
-#
-# Allows the use of GCC if available
-#
-# Arguments:
-# none
-#
-# Results:
-#
-# Adds the following arguments to configure:
-# --enable-gcc
-#
-# Defines the following vars:
-# CC Command to use for the compiler
-#------------------------------------------------------------------------
-
-AC_DEFUN(SC_ENABLE_GCC, [
- AC_ARG_ENABLE(gcc, [ --enable-gcc allow use of gcc if available [--disable-gcc]],
- [ok=$enableval], [ok=no])
- if test "$ok" = "yes"; then
- CC=gcc
- else
- CC=cl
- fi
-])
-
-#------------------------------------------------------------------------
-# SC_ENABLE_SHARED --
-#
-# Allows the building of shared libraries
-#
-# Arguments:
-# none
-#
-# Results:
-#
-# Adds the following arguments to configure:
-# --enable-shared=yes|no
-#
-# Defines the following vars:
-# TCL_SHARED_BUILD Value of 1 or 0
-# STATIC_BUILD
-#------------------------------------------------------------------------
-
-AC_DEFUN(SC_ENABLE_SHARED, [
- AC_ARG_ENABLE(shared,
- [ --enable-shared build and link with shared libraries [--enable-shared]],
- [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
- TCL_SHARED_BUILD=1
- else
- TCL_SHARED_BUILD=0
- AC_DEFINE(STATIC_BUILD)
- fi
-
-])
-
-#------------------------------------------------------------------------
-# SC_ENABLE_THREADS --
-#
-# Specify if thread support should be enabled
-#
-# Arguments:
-# none
-#
-# Results:
-#
-# Adds the following arguments to configure:
-# --enable-threads=yes|no
-#
-# Defines the following vars:
-# TCL_THREADS
-#
-#------------------------------------------------------------------------
-
-AC_DEFUN(SC_ENABLE_THREADS, [
- AC_ARG_ENABLE(threads, [ --enable-threads build with threads],
- [tcl_ok=$enableval], [tcl_ok=no])
- if test "$tcl_ok" = "yes"; then
- AC_DEFINE(TCL_THREADS)
- echo "building with threads enabled"
- else
- echo "building with threads disabled (default)"
- fi
-])
-
-#------------------------------------------------------------------------
-# SC_ENABLE_SYMBOLS --
-#
-# Specify if debugging symbols should be used
-#
-# Arguments:
-# none
-#
-# Requires the following vars to be set:
-# CFLAGS_DEBUG
-# CFLAGS_OPTIMIZE
-#
-# Results:
-#
-# Adds the following arguments to configure:
-# --enable-symbols
-#
-# Defines the following vars:
-# CFLAGS_DEFAULT Sets to CFLAGS_DEBUG if true
-# Sets to CFLAGS_OPTIMIZE if false
-# LD_FLAGS_DEFAULT Sets to LDFLAGS_DEBUG if true
- Sets to LDFLAGS_OPTIMIZE if false
-# DBGX Debug library extension
-#
-#------------------------------------------------------------------------
-
-AC_DEFUN(SC_ENABLE_SYMBOLS, [
- AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no])
-
- if test "$tcl_ok" = "yes"; then
- CFLAGS_DEFAULT='${CFLAGS_DEBUG}'
- LD_FLAGS_DEFAULT='${LDFLAGS_DEBUG}'
- DBGX=d
- echo "building with debug symbols"
- else
- CFLAGS_DEFAULT='${CFLAGS_OPTIMIZE}'
- LD_FLAGS_DEFAULT='${LDFLAGS_OPTIMIZE}'
- DBGX=""
- echo "building without debug symbols"
- fi
-])
-
-
-#--------------------------------------------------------------------
-# SC_TCL_CONFIG_CFLAGS
-#
-# Arguments:
-# none
-#
-# Results:
-#
-# Defines the following vars:
-#
-# DL_OBJS - Name of the object file that implements dynamic
-# loading for Tcl on this system.
-# DL_LIBS - Library file(s) to include in tclsh and other base
-# applications in order for the "load" command to work.
-# LD_FLAGS - Flags to pass to the compiler when linking object
-# files into an executable application binary such
-# as tclsh.
-# LD_SEARCH_FLAGS-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. Depends on
-# the variable LIB_RUNTIME_DIR in the Makefile.
-# MAKE_LIB - Command to execute to build the Tcl library;
-# differs depending on whether or not Tcl is being
-# compiled as a shared library.
-# SHLIB_CFLAGS - Flags to pass to cc when compiling the components
-# of a shared library (may request position-independent
-# code, among other things).
-# SHLIB_LD - Base command to use for combining object files
-# into a shared library.
-# 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 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
-# 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.
-# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable
-# extensions. An empty string means we don't know how
-# to use shared libraries on this platform.
-# TCL_LIB_FILE - Name of the file that contains the Tcl library, such
-# as libtcl7.8.so or libtcl7.8.a.
-# TCL_LIB_SUFFIX -Specifies everything that comes after the "libtcl"
-# in the shared library name, using the $VERSION variable
-# to put the version in the right place. This is used
-# by platforms that need non-standard library names.
-# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs
-# to have a version after the .so, and ${VERSION}.a
-# on AIX, since the Tcl shared library needs to have
-# a .a extension whereas shared objects for loadable
-# extensions have a .so extension. Defaults to
-# ${VERSION}${SHLIB_SUFFIX}.
-# TCL_NEEDS_EXP_FILE -
-# 1 means that an export file is needed to link to a
-# shared library.
-# TCL_EXP_FILE - The name of the installed export / import file which
-# should be used to link to the Tcl shared library.
-# Empty if Tcl is unshared.
-# TCL_BUILD_EXP_FILE -
-# The name of the built export / import file which
-# should be used to link to the Tcl shared library.
-# Empty if Tcl is unshared.
-# CFLAGS_DEBUG -
-# Flags used when running the compiler in debug mode
-# CFLAGS_OPTIMIZE -
-# Flags used when running the compiler in optimize mode
-#--------------------------------------------------------------------
-
-AC_DEFUN(SC_TCL_CONFIG_CFLAGS, [
-
- # Step 1: set the variable "system" to hold the name and version number
- # for the system. This can usually be done via the "uname" command, but
- # there are a few systems, like Next, where this doesn't work.
-
- AC_MSG_CHECKING([system version (for dynamic loading)])
- if test -f /usr/lib/NextStep/software_version; then
- system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
- else
- system=`uname -s`-`uname -r`
- if test "$?" -ne 0 ; then
- AC_MSG_RESULT([unknown (can't find uname command)])
- system=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
- system=MP-RAS-`awk '{print $3}' /etc/.relid'`
- fi
- if test "`uname -s`" = "AIX" ; then
- system=AIX-`uname -v`.`uname -r`
- fi
- AC_MSG_RESULT($system)
- fi
- fi
-
- # Step 2: check for existence of -ldl library. This is needed because
- # Linux can use either -ldl or -ldld for dynamic loading.
-
- AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
-
- # Step 3: set configuration options based on system name and version.
-
- do64bit_ok=no
- fullSrcDir=`cd $srcdir; pwd`
- EXTRA_CFLAGS=""
- TCL_EXPORT_FILE_SUFFIX=""
- TCL_UNSHARED_LIB_SUFFIX=""
- TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`'
- ECHO_VERSION='`echo ${VERSION}`'
- TCL_LIB_VERSIONS_OK=ok
- CFLAGS_DEBUG=-g
- CFLAGS_OPTIMIZE=-O
- TCL_NEEDS_EXP_FILE=0
- TCL_BUILD_EXP_FILE=""
- TCL_EXP_FILE=""
- case $system in
- AIX-4.[[2-9]])
- SHLIB_CFLAGS=""
- SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- LD_FLAGS=""
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- TCL_NEEDS_EXP_FILE=1
- TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
- ;;
- AIX-*)
- SHLIB_CFLAGS=""
- SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- LIBOBJS="$LIBOBJS tclLoadAix.o"
- DL_LIBS="-lld"
- LD_FLAGS=""
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- TCL_NEEDS_EXP_FILE=1
- TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
- ;;
- BSD/OS-2.1*|BSD/OS-3*)
- SHLIB_CFLAGS=""
- SHLIB_LD="shlicc -r"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- LD_FLAGS=""
- LD_SEARCH_FLAGS=""
- ;;
- BSD/OS-4.*)
- SHLIB_CFLAGS="-export-dynamic -fPIC"
- SHLIB_LD="cc -shared"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- LD_FLAGS="-export-dynamic"
- LD_SEARCH_FLAGS=""
- ;;
- dgux*)
- SHLIB_CFLAGS="-K PIC"
- SHLIB_LD="cc -G"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- LD_FLAGS=""
- LD_SEARCH_FLAGS=""
- ;;
- HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*|HP-UX-*.11.*)
- SHLIB_SUFFIX=".sl"
- AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
- if test "$tcl_ok" = yes; then
- SHLIB_CFLAGS="+z"
- SHLIB_LD="ld -b"
- SHLIB_LD_LIBS=""
- DL_OBJS="tclLoadShl.o"
- DL_LIBS="-ldld"
- LD_FLAGS="-Wl,-E"
- LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
- fi
- ;;
- IRIX-4.*)
- SHLIB_CFLAGS="-G 0"
- SHLIB_SUFFIX=".a"
- SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
- SHLIB_LD_LIBS='${LIBS}'
- DL_OBJS="tclLoadAout.o"
- DL_LIBS=""
- LD_FLAGS="-Wl,-D,08000000"
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- TCL_SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
- ;;
- IRIX-5.*|IRIX-6.*|IRIX64-6.5*)
- SHLIB_CFLAGS=""
- SHLIB_LD="ld -n32 -shared -rdata_shared"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
- EXTRA_CFLAGS="-mabi=n32"
- LD_FLAGS="-mabi=n32"
- else
- case $system in
- IRIX-6.3)
- # Use to build 6.2 compatible binaries on 6.3.
- EXTRA_CFLAGS="-n32 -D_OLD_TERMIOS"
- ;;
- *)
- EXTRA_CFLAGS="-n32"
- ;;
- esac
- LD_FLAGS="-n32"
- fi
- ;;
- IRIX64-6.*)
- SHLIB_CFLAGS=""
- SHLIB_LD="ld -32 -shared -rdata_shared"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LD_FLAGS=""
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- ;;
- Linux*)
- SHLIB_CFLAGS="-fPIC"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- if test "$have_dl" = yes; then
- SHLIB_LD="${CC} -shared"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- LD_FLAGS="-rdynamic"
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- else
- AC_CHECK_HEADER(dld.h, [
- SHLIB_LD="ld -shared"
- DL_OBJS="tclLoadDld.o"
- DL_LIBS="-ldld"
- LD_FLAGS=""
- LD_SEARCH_FLAGS=""])
- 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"
- LD_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"
- LD_FLAGS="-Wl,-Bexport"
- LD_SEARCH_FLAGS=""
- ;;
- NetBSD-*|FreeBSD-[[12]].*|OpenBSD-*)
- # Not available on all versions: check for include file.
- AC_CHECK_HEADER(dlfcn.h, [
- SHLIB_CFLAGS="-fpic"
- SHLIB_LD="ld -Bshareable -x"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LD_FLAGS=""
- LD_SEARCH_FLAGS=""
- TCL_SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
- ], [
- SHLIB_CFLAGS=""
- SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".a"
- DL_OBJS="tclLoadAout.o"
- DL_LIBS=""
- LD_FLAGS=""
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- TCL_SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
- ])
-
- # FreeBSD doesn't handle version numbers with dots.
-
- TCL_UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
- TCL_LIB_VERSIONS_OK=nodots
- ;;
- FreeBSD-*)
- # FreeBSD 3.* and greater have ELF.
- SHLIB_CFLAGS="-fpic"
- SHLIB_LD="ld -Bshareable -x"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LD_FLAGS=""
- LD_SEARCH_FLAGS=""
- ;;
- NEXTSTEP-*)
- SHLIB_CFLAGS=""
- SHLIB_LD="cc -nostdlib -r"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadNext.o"
- DL_LIBS=""
- LD_FLAGS=""
- LD_SEARCH_FLAGS=""
- ;;
- OS/390-*)
- CFLAGS_OPTIMIZE="" # Optimizer is buggy
- AC_DEFINE(_OE_SOCKETS) # needed in sys/socket.h
- ;;
- 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=""
- LD_FLAGS=""
- LD_SEARCH_FLAGS=""
- ;;
- OSF1-1.*)
- # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
- SHLIB_CFLAGS="-fpic"
- SHLIB_LD="ld -shared"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LD_FLAGS=""
- LD_SEARCH_FLAGS=""
- ;;
- OSF1-V*)
- # Digital OSF/1
- SHLIB_CFLAGS=""
- SHLIB_LD='ld -shared -expect_unresolved "*"'
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LD_FLAGS=""
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- ;;
- RISCos-*)
- SHLIB_CFLAGS="-G 0"
- SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".a"
- DL_OBJS="tclLoadAout.o"
- DL_LIBS=""
- LD_FLAGS="-Wl,-D,08000000"
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- ;;
- SCO_SV-3.2*)
- # 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.
- SHLIB_CFLAGS="-Kpic -belf"
- SHLIB_LD="ld -G"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LD_FLAGS="-belf -Wl,-Bexport"
- 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"
- LD_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"
- LD_FLAGS=""
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
-
- # 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
-
- TCL_SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
- TCL_UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
- TCL_LIB_VERSIONS_OK=nodots
- ;;
- SunOS-5.[[0-6]]*)
- SHLIB_CFLAGS="-KPIC"
- SHLIB_LD="/usr/ccs/bin/ld -G -z text"
-
- # Note: need the LIBS below, otherwise Tk won't find Tcl's
- # symbols when dynamically loaded into tclsh.
-
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- LD_FLAGS=""
- LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
- ;;
- SunOS-5*)
- SHLIB_CFLAGS="-KPIC"
- SHLIB_LD="/usr/ccs/bin/ld -G -z text"
- LD_FLAGS=""
-
- do64bit_ok=no
- if test "$do64bit" = "yes" ; then
- arch=`isainfo`
- if test "$arch" = "sparcv9 sparc" ; then
- if test "$CC" != "gcc" -a `$CC -v 2>&1 | grep -c gcc` = "0" ; then
- do64bit_ok=yes
- EXTRA_CFLAGS="-xarch=v9"
- LD_FLAGS="-xarch=v9"
- else
- AC_MSG_WARN("64bit mode not supported using GCC on $system")
- fi
- else
- AC_MSG_WARN("64bit mode only supported sparcv9 system")
- fi
- fi
-
- # Note: need the LIBS below, otherwise Tk won't find Tcl's
- # symbols when dynamically loaded into tclsh.
-
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
- LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
- else
- LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
- fi
- ;;
- ULTRIX-4.*)
- SHLIB_CFLAGS="-G 0"
- SHLIB_SUFFIX=".a"
- SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
- SHLIB_LD_LIBS='${LIBS}'
- DL_OBJS="tclLoadAout.o"
- DL_LIBS=""
- LD_FLAGS="-Wl,-D,08000000"
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- ;;
- UNIX_SV* | UnixWare-5*)
- SHLIB_CFLAGS="-KPIC"
- SHLIB_LD="cc -G"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- 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.
- hold_ldflags=$LDFLAGS
- AC_MSG_CHECKING(for ld accepts -Bexport flag)
- LDFLAGS="${LDFLAGS} -Wl,-Bexport"
- AC_TRY_LINK(, [int i;], found=yes, found=no)
- LDFLAGS=$hold_ldflags
- AC_MSG_RESULT($found)
- if test $found = yes; then
- LD_FLAGS="-Wl,-Bexport"
- else
- LD_FLAGS=""
- fi
- LD_SEARCH_FLAGS=""
- ;;
- esac
-
- if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then
- AC_MSG_WARN("64bit support being disabled -- not supported on this platform")
- fi
-
- # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic
- # Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop,
- # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need
- # to determine which of several header files defines the a.out file
- # format (a.out.h, sys/exec.h, or sys/exec_aout.h). At present, we
- # support only a file format that is more or less version-7-compatible.
- # In particular,
- # - a.out files must begin with `struct exec'.
- # - the N_TXTOFF on the `struct exec' must compute the seek address
- # of the text segment
- # - The `struct exec' must contain a_magic, a_text, a_data, a_bss
- # and a_entry fields.
- # The following compilation should succeed if and only if either sys/exec.h
- # or a.out.h is usable for the purpose.
- #
- # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the
- # `struct exec' includes a second header that contains information that
- # duplicates the v7 fields that are needed.
-
- if test "x$DL_OBJS" = "xtclLoadAout.o" ; then
- AC_MSG_CHECKING(sys/exec.h)
- AC_TRY_COMPILE([#include <sys/exec.h>],[
- struct exec foo;
- unsigned long seek;
- int flag;
-#if defined(__mips) || defined(mips)
- seek = N_TXTOFF (foo.ex_f, foo.ex_o);
-#else
- seek = N_TXTOFF (foo);
-#endif
- flag = (foo.a_magic == OMAGIC);
- return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
- ], tcl_ok=usable, tcl_ok=unusable)
- AC_MSG_RESULT($tcl_ok)
- if test $tcl_ok = usable; then
- AC_DEFINE(USE_SYS_EXEC_H)
- else
- AC_MSG_CHECKING(a.out.h)
- AC_TRY_COMPILE([#include <a.out.h>],[
- struct exec foo;
- unsigned long seek;
- int flag;
-#if defined(__mips) || defined(mips)
- seek = N_TXTOFF (foo.ex_f, foo.ex_o);
-#else
- seek = N_TXTOFF (foo);
-#endif
- flag = (foo.a_magic == OMAGIC);
- return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
- ], tcl_ok=usable, tcl_ok=unusable)
- AC_MSG_RESULT($tcl_ok)
- if test $tcl_ok = usable; then
- AC_DEFINE(USE_A_OUT_H)
- else
- AC_MSG_CHECKING(sys/exec_aout.h)
- AC_TRY_COMPILE([#include <sys/exec_aout.h>],[
- struct exec foo;
- unsigned long seek;
- int flag;
-#if defined(__mips) || defined(mips)
- seek = N_TXTOFF (foo.ex_f, foo.ex_o);
-#else
- seek = N_TXTOFF (foo);
-#endif
- flag = (foo.a_midmag == OMAGIC);
- return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
- ], tcl_ok=usable, tcl_ok=unusable)
- AC_MSG_RESULT($tcl_ok)
- if test $tcl_ok = usable; then
- AC_DEFINE(USE_SYS_EXEC_AOUT_H)
- else
- DL_OBJS=""
- fi
- fi
- fi
- fi
-
- # Step 5: disable dynamic loading if requested via a command-line switch.
-
- AC_ARG_ENABLE(load, [ --disable-load disallow dynamic loading and "load" command],
- [tcl_ok=$enableval], [tcl_ok=yes])
- if test "$tcl_ok" = "no"; then
- DL_OBJS=""
- fi
-
- if test "x$DL_OBJS" != "x" ; then
- BUILD_DLTEST="\$(DLTEST_TARGETS)"
- else
- echo "Can't figure out how to do dynamic loading or shared libraries"
- echo "on this system."
- SHLIB_CFLAGS=""
- SHLIB_LD=""
- SHLIB_SUFFIX=""
- DL_OBJS="tclLoadNone.o"
- DL_LIBS=""
- LD_FLAGS=""
- LD_SEARCH_FLAGS=""
- BUILD_DLTEST=""
- fi
-
- # 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" ; then
- if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
- case $system in
- AIX-*)
- ;;
- BSD/OS*)
- ;;
- IRIX*)
- ;;
- NetBSD-*|FreeBSD-*|OpenBSD-*)
- ;;
- RISCos-*)
- ;;
- ULTRIX-4.*)
- ;;
- *)
- SHLIB_CFLAGS="-fPIC"
- ;;
- esac
- fi
- fi
-])
-
+#------------------------------------------------------------------------
+# SC_PATH_TCLCONFIG --
+#
+# Locate the tclConfig.sh file and perform a sanity check on
+# the Tcl compile flags
+# Currently a no-op for Windows
+#
+# Arguments:
+# PATCH_LEVEL The patch level for Tcl if any.
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-tcl=...
+#
+# Defines the following vars:
+# TCL_BIN_DIR Full path to the tclConfig.sh file
+#------------------------------------------------------------------------
+
+AC_DEFUN(SC_PATH_TCLCONFIG, [
+ AC_MSG_CHECKING([the location of tclConfig.sh])
+
+ if test -d ../../tcl8.1$1/win; then
+ TCL_BIN_DIR_DEFAULT=../../tcl8.1$1/win
+ else
+ TCL_BIN_DIR_DEFAULT=../../tcl8.1/win
+ fi
+
+ AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.1 binaries from DIR],
+ TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DIR_DEFAULT; pwd`)
+ if test ! -d $TCL_BIN_DIR; then
+ AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist)
+ fi
+ if test ! -f $TCL_BIN_DIR/tclConfig.sh; then
+ AC_MSG_ERROR(There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?)
+ fi
+ AC_MSG_RESULT([$TCL_BIN_DIR])
+])
+
+#------------------------------------------------------------------------
+# SC_PATH_TKCONFIG --
+#
+# Locate the tkConfig.sh file
+# Currently a no-op for Windows
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-tk=...
+#
+# Defines the following vars:
+# TK_BIN_DIR Full path to the tkConfig.sh file
+#------------------------------------------------------------------------
+
+AC_DEFUN(SC_PATH_TKCONFIG, [
+ AC_MSG_CHECKING([the location of tkConfig.sh])
+
+ if test -d ../../tk8.1$1/win; then
+ TK_BIN_DIR_DEFAULT=../../tk8.1$1/win
+ else
+ TK_BIN_DIR_DEFAULT=../../tk8.1/win
+ fi
+
+ AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.1 binaries from DIR],
+ TK_BIN_DIR=$withval, TK_BIN_DIR=`cd $TK_BIN_DIR_DEFAULT; pwd`)
+ if test ! -d $TK_BIN_DIR; then
+ AC_MSG_ERROR(Tk directory $TK_BIN_DIR does not exist)
+ fi
+ if test ! -f $TK_BIN_DIR/tkConfig.sh; then
+ AC_MSG_ERROR(There is no tkConfig.sh in $TK_BIN_DIR: perhaps you did not specify the Tk *build* directory (not the toplevel Tk directory) or you forgot to configure Tk?)
+ fi
+
+ AC_MSG_RESULT([$TK_BIN_DIR])
+])
+
+#------------------------------------------------------------------------
+# SC_LOAD_TCLCONFIG --
+#
+# Load the tclConfig.sh file
+# Currently a no-op for Windows
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# TCL_BIN_DIR
+#
+# Results:
+#
+# Sets the following vars that should be in tclConfig.sh:
+# TCL_BIN_DIR
+# TCL_SRC_DIR
+# TCL_LIB_FILE
+# Defines the following vars:
+# TCL_THREADS
+#------------------------------------------------------------------------
+
+AC_DEFUN(SC_LOAD_TCLCONFIG, [
+ AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh])
+
+ if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
+ AC_MSG_RESULT([loading])
+ . $TCL_BIN_DIR/tclConfig.sh
+ else
+ AC_MSG_RESULT([file not found])
+ fi
+
+ if test "$TCL_THREADS" = "1"; then
+ AC_DEFINE(TCL_THREADS)
+ fi
+])
+
+#------------------------------------------------------------------------
+# SC_LOAD_TKCONFIG --
+#
+# Load the tkConfig.sh file
+# Currently a no-op for Windows
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# TK_BIN_DIR
+#
+# Results:
+#
+# Sets the following vars that should be in tkConfig.sh:
+# TK_BIN_DIR
+#------------------------------------------------------------------------
+
+AC_DEFUN(SC_LOAD_TKCONFIG, [
+ AC_MSG_CHECKING([for existence of $TCLCONFIG])
+
+ if test -f "$TK_BIN_DIR/tkConfig.sh" ; then
+ AC_MSG_CHECKING([loading $TK_BIN_DIR/tkConfig.sh])
+ . $TK_BIN_DIR/tkConfig.sh
+ else
+ AC_MSG_RESULT([could not find $TK_BIN_DIR/tkConfig.sh])
+ fi
+])
+
+#------------------------------------------------------------------------
+# SC_ENABLE_GCC --
+#
+# Allows the use of GCC if available
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-gcc
+#
+# Defines the following vars:
+# CC Command to use for the compiler
+#------------------------------------------------------------------------
+
+AC_DEFUN(SC_ENABLE_GCC, [
+ AC_ARG_ENABLE(gcc, [ --enable-gcc allow use of gcc if available [--disable-gcc]],
+ [ok=$enableval], [ok=no])
+ if test "$ok" = "yes"; then
+ CC=gcc
+ else
+ CC=cl
+ fi
+])
+
+#------------------------------------------------------------------------
+# SC_ENABLE_SHARED --
+#
+# Allows the building of shared libraries
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-shared=yes|no
+#
+# Defines the following vars:
+# SHARED_BUILD Value of 1 or 0
+# STATIC_BUILD
+#------------------------------------------------------------------------
+
+AC_DEFUN(SC_ENABLE_SHARED, [
+ AC_MSG_CHECKING([how to build libraries])
+ AC_ARG_ENABLE(shared,
+ [ --enable-shared build and link with shared libraries [--enable-shared]],
+ [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
+ else
+ AC_MSG_RESULT([static])
+ SHARED_BUILD=0
+ AC_DEFINE(STATIC_BUILD)
+ fi
+])
+
+#------------------------------------------------------------------------
+# SC_ENABLE_THREADS --
+#
+# Specify if thread support should be enabled
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-threads=yes|no
+#
+# Defines the following vars:
+# TCL_THREADS
+#
+#------------------------------------------------------------------------
+
+AC_DEFUN(SC_ENABLE_THREADS, [
+ AC_MSG_CHECKING(for building with threads)
+ AC_ARG_ENABLE(threads, [ --enable-threads build with threads],
+ [tcl_ok=$enableval], [tcl_ok=no])
+ if test "$tcl_ok" = "yes"; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(TCL_THREADS)
+ else
+ AC_MSG_RESULT(no (default))
+ fi
+])
+
+#------------------------------------------------------------------------
+# SC_ENABLE_SYMBOLS --
+#
+# Specify if debugging symbols should be used
+#
+# Arguments:
+# none
+#
+# Requires the following vars to be set:
+# CFLAGS_DEBUG
+# CFLAGS_OPTIMIZE
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-symbols
+#
+# Defines the following vars:
+# CFLAGS_DEFAULT Sets to CFLAGS_DEBUG if true
+# Sets to CFLAGS_OPTIMIZE if false
+# LDFLAGS_DEFAULT Sets to LDFLAGS_DEBUG if true
+# Sets to LDFLAGS_OPTIMIZE if false
+# DBGX Debug library extension
+#
+#------------------------------------------------------------------------
+
+AC_DEFUN(SC_ENABLE_SYMBOLS, [
+ AC_MSG_CHECKING([for build with symbols])
+ AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no])
+
+ if test "$tcl_ok" = "yes"; then
+ CFLAGS_DEFAULT='${CFLAGS_DEBUG}'
+ LDFLAGS_DEFAULT='${LDFLAGS_DEBUG}'
+ DBGX=d
+ AC_MSG_RESULT([yes])
+ else
+ CFLAGS_DEFAULT='${CFLAGS_OPTIMIZE}'
+ LDFLAGS_DEFAULT='${LDFLAGS_OPTIMIZE}'
+ DBGX=""
+ AC_MSG_RESULT([no])
+ fi
+])
+
+
+#--------------------------------------------------------------------
+# SC_CONFIG_CFLAGS
+#
+# Try to determine the proper flags to pass to the compiler
+# for building shared libraries and other such nonsense.
+#
+# NOTE: The backslashes in quotes below are substituted twice
+# due to the fact that they are in a macro and then inlined
+# in the final configure script.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines the following vars for all compilers:
+# EXTRA_CFLAGS
+# CFLAGS_DEBUG
+# CFLAGS_OPTIMIZE
+# CFLAGS_WARNING
+# LDFLAGS_DEBUG
+# LDFLAGS_OPTIMIZE
+# PATHTYPE
+# CC_OBJNAME
+# CC_EXENAME
+#
+# Defines the following vars for non-gcc compilers
+# SHLIB_LD
+# SHLIB_LD_LIBS
+# LIBS
+# AR
+# MAKE_LIB
+# MAKE_EXE
+# MAKE_DLL
+#
+# LIBSUFFIX
+# LIBRARIES
+# EXESUFFIX
+# DLLSUFFIX
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN(SC_CONFIG_CFLAGS, [
+ AC_MSG_CHECKING([compiler flags])
+ EXTRA_CFLAGS=""
+ # set various compiler flags depending on whether we are using gcc or cl
+
+ if test "${GCC}" = "yes" ; then
+ CFLAGS_DEBUG=-g
+ CFLAGS_OPTIMIZE=-O
+ CFLAGS_WARNING="-Wall -Wconversion"
+ LDFLAGS_DEBUG=-g
+ LDFLAGS_OPTIMIZE=-O
+ PATHTYPE=-u
+
+ # Specify the CC output file names based on the target name
+ CC_OBJNAME="-o \[$]@"
+ CC_EXENAME="-o \[$]@"
+ else
+ SHLIB_LD="link -dll -nologo"
+ SHLIB_LD_LIBS="user32.lib advapi32.lib"
+ LIBS="user32.lib advapi32.lib"
+ AR="lib -nologo"
+ RC="rc"
+ MAKE_LIB="\${AR} -out:\[$]@"
+ MAKE_EXE="\${CC} -Fe\[$]@"
+
+ if test "${SHARED_BUILD}" = "0" ; then
+ # static
+ AC_MSG_RESULT([using static flags])
+ runtime=-MT
+ MAKE_DLL="echo "
+ LIBSUFFIX="s\${DBGX}.lib"
+ LIBRARIES="\${STATIC_LIBRARIES}"
+ EXESUFFIX="s\${DBGX}.exe"
+ DLLSUFFIX=""
+ else
+ # dynamic
+ AC_MSG_RESULT([using shared flags])
+ runtime=-MD
+ MAKE_DLL="\${SHLIB_LD} \${SHLIB_LD_LIBS} \$(LDFLAGS) -out:\[$]@"
+ LIBSUFFIX="\${DBGX}.lib"
+ DLLSUFFIX="\${DBGX}.dll"
+ EXESUFFIX="\${DBGX}.exe"
+ LIBRARIES="\${SHARED_LIBRARIES}"
+ fi
+
+ EXTRA_CFLAGS="-YX"
+ CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
+# CFLAGS_OPTIMIZE="-nologo -O2 -Gs -GD ${runtime}"
+ CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}"
+ CFLAGS_WARNING="-W3"
+ LDFLAGS_DEBUG="-debug:full -debugtype:cv"
+ LDFLAGS_OPTIMIZE="-release"
+ PATHTYPE=-w
+
+ # Specify the CC output file names based on the target name
+ CC_OBJNAME="-Fo\[$]@"
+ CC_EXENAME="-Fe\[$]@"
+
+ # Specify linker flags depending on the type of app being
+ # built -- Console vs. Window.
+ LDFLAGS_CONSOLE="-subsystem:console"
+ LDFLAGS_WINDOW="-subsystem:windows"
+ fi
+])
+
+#------------------------------------------------------------------------
+# SC_WITH_TCL --
+#
+# Location of the Tcl build directory.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-tcl=...
+#
+# Defines the following vars:
+# TCL_BIN_DIR Full path to the tcl build dir.
+#------------------------------------------------------------------------
+
+AC_DEFUN(SC_WITH_TCL, [
+ if test -d ../../tcl8.1$1/win; then
+ TCL_BIN_DEFAULT=../../tcl8.1$1/win
+ else
+ TCL_BIN_DEFAULT=../../tcl8.1/win
+ fi
+
+ AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.1 binaries from DIR],
+ TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`)
+ if test ! -d $TCL_BIN_DIR; then
+ AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist)
+ fi
+ if test ! -f $TCL_BIN_DIR/Makefile; then
+ AC_MSG_ERROR(There is no Makefile in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?)
+ else
+ echo "building against Tcl binaries in: $TCL_BIN_DIR"
+ fi
+ AC_SUBST(TCL_BIN_DIR)
+])
+
diff --git a/win/configure.in b/win/configure.in
index 648c8da..8e49ac6 100644
--- a/win/configure.in
+++ b/win/configure.in
@@ -1,186 +1,137 @@
-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.
+# This file is an input file used by the GNU "autoconf" program to
+# generate the file "configure", which is run during Tk installation
+# to configure the system for the local environment.
+#
+# RCS: @(#) $Id: configure.in,v 1.2 1999/06/16 20:11:30 surles Exp $
+
AC_INIT(../generic/tk.h)
-# RCS: @(#) $Id: configure.in,v 1.1 1999/06/02 19:30:23 surles Exp $
TK_VERSION=8.1
TK_MAJOR_VERSION=8
TK_MINOR_VERSION=1
TK_PATCH_LEVEL=.2
-VERSION=${TK_VERSION}
+VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION
-# Check whether --enable-gcc or --disable-gcc was given. Do this before
-# AC_PROG_CC and AC_CYGWIN are called so the compiler can be fully tested
-# by built-in autoconf tools.
+#--------------------------------------------------------------------
+# Check whether --enable-gcc or --disable-gcc was given. Do this
+# before AC_PROG_CC and AC_CYGWIN are called so the compiler can
+# be fully tested by built-in autoconf tools.
+#--------------------------------------------------------------------
-AC_ARG_ENABLE(gcc, [ --enable-gcc build with gcc],
- [tcl_ok=$enableval], [tcl_ok=test_all])
-if test "$tcl_ok" = "yes"; then
- CC=gcc
-fi
-if test "$tcl_ok" = "no"; then
- CC=cl
-fi
+SC_ENABLE_GCC
+
+#--------------------------------------------------------------------
+# Checks to see if the make progeam sets the $MAKE variable.
+#--------------------------------------------------------------------
AC_PROG_MAKE_SET
+
+#--------------------------------------------------------------------
+# These two macros perform additinal compiler test.
+#--------------------------------------------------------------------
+
AC_PROG_CC
AC_CYGWIN
+
+#--------------------------------------------------------------------
+# Determines the correct binary file extension (.o, .obj, .exe etc.)
+#--------------------------------------------------------------------
+
AC_OBJEXT
AC_EXEEXT
#--------------------------------------------------------------------
-# See if there was a command-line option for where Tcl is; if
-# not, assume that its top-level directory is a sibling of ours.
-# Try the patch-level-specific directory first, then the general one.
-#--------------------------------------------------------------------
-
-if test -d ../../tcl8.1$TK_PATCH_LEVEL/unix; then
- TCL_BIN_DEFAULT=../../tcl8.1$TK_PATCH_LEVEL/unix
-else
- TCL_BIN_DEFAULT=../../tcl8.1/unix
-fi
-
-AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.1 binaries from DIR],
- TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`)
-if test ! -d $TCL_BIN_DIR; then
- AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist)
-fi
-if test ! -f $TCL_BIN_DIR/Makefile; then
- AC_MSG_ERROR(There is no Makefile in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?)
-else
- echo "building against Tcl binaries in: $TCL_BIN_DIR"
-fi
-
-# Set the default compiler switches based on the --enable-symbols option
-
-AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols],
- [tcl_ok=$enableval], [tcl_ok=no])
-if test "$tcl_ok" = "yes"; then
- CFLAGS='${CFLAGS_DEBUG}'
- LD_FLAGS='${LDFLAGS_DEBUG}'
- TCL_DBGX=d
- echo "building with debug symbols"
-else
- CFLAGS='${CFLAGS_OPTIMIZE}'
- LD_FLAGS='${LDFLAGS_OPTIMIZE}'
- TCL_DBGX=""
- echo "building without debug symbols"
-fi
-
-# Trick to replace DBGX with TCL_DBGX
-DBGX='${TCL_DBGX}'
-eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
-
# Check whether --enable-threads or --disable-threads was given.
+#--------------------------------------------------------------------
+
+SC_ENABLE_THREADS
+
+#--------------------------------------------------------------------
+# The statements below define a collection of symbols related to
+# building libtk as a shared library instead of a static library.
+#--------------------------------------------------------------------
+
+SC_ENABLE_SHARED
+
+#--------------------------------------------------------------------
+# 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.
+#--------------------------------------------------------------------
+
+SC_CONFIG_CFLAGS
+
+#--------------------------------------------------------------------
+# Set the default compiler switches based on the --enable-symbols
+# option. This macro depends on C flags, and should be called
+# after SC_CONFIG_CFLAGS macro is called.
+#--------------------------------------------------------------------
+
+SC_ENABLE_SYMBOLS
+
+TK_DBGX=${DBGX}
+CFLAGS=${CFLAGS_DEFAULT}
+LDFLAGS=${LDFLAGS_DEFAULT}
+
+#--------------------------------------------------------------------
+# Locate and source the tclConfig.sh file.
+#--------------------------------------------------------------------
+
+SC_PATH_TCLCONFIG($TK_PATCH_LEVEL)
+SC_LOAD_TCLCONFIG
+
+#--------------------------------------------------------------------
+# Perform final evaluations of variables with possible substitutions.
+#--------------------------------------------------------------------
+
+eval "TK_SRC_DIR=`cd $srcdir; pwd`"
+eval "TK_DLL_FILE=tk$VER${DLLSUFFIX}"
+eval "TK_LIB_FILE=tk$VER${LIBSUFFIX}"
+eval "TK_STUB_LIB_FILE=tkstub$VER${LIBSUFFIX}"
+eval "TCL_DLL_FILE=tcl$VER${DLLSUFFIX}"
+eval "TCL_LIB_FILE=tcl$VER${LIBSUFFIX}"
+eval "TCL_STUB_LIB_FILE=tclstub$VER${LIBSUFFIX}"
+
+AC_SUBST(TK_VERSION)
+AC_SUBST(TK_MAJOR_VERSION)
+AC_SUBST(TK_MINOR_VERSION)
+AC_SUBST(TK_PATCH_LEVEL)
+AC_SUBST(TK_DBGX)
+AC_SUBST(TK_LIB_FILE)
+AC_SUBST(TK_DLL_FILE)
+AC_SUBST(TK_STUB_LIB_FILE)
+AC_SUBST(TK_SRC_DIR)
+AC_SUBST(TK_BIN_DIR)
+AC_SUBST(TCL_VERSION)
+AC_SUBST(TCL_MAJOR_VERSION)
+AC_SUBST(TCL_MINOR_VERSION)
+AC_SUBST(TCL_PATCH_LEVEL)
+AC_SUBST(TCL_LIB_FILE)
+AC_SUBST(TCL_DLL_FILE)
+AC_SUBST(TCL_STUB_LIB_FILE)
+AC_SUBST(TCL_SRC_DIR)
+AC_SUBST(TCL_BIN_DIR)
+AC_SUBST(TCL_DBGX)
-AC_ARG_ENABLE(threads, [ --enable-threads build with threads],
- [tcl_ok=$enableval], [tcl_ok=no])
-if test "$tcl_ok" = "yes"; then
- AC_DEFINE(TCL_THREADS)
- echo "building with threads enabled"
-else
- echo "building with threads disabled (default)"
-fi
-
-#--------------------------------------------------------------------
-# The statements below define a collection of symbols related to
-# building libtcl as a shared library instead of a static library.
-#--------------------------------------------------------------------
-
-AC_ARG_ENABLE(shared,
- [ --enable-shared build libtcl as a shared library (on by default)],
- [tcl_ok=$enableval], [tcl_ok=yes])
-
-# 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
-
-if test "$tcl_ok" = "yes" ; then
- TCL_SHARED_BUILD=1
-else
- TCL_SHARED_BUILD=0
- AC_DEFINE(STATIC_BUILD)
-fi
-
-EXTRA_CFLAGS=""
-# set various compiler flags depending on whether we are using gcc or cl
-if test "${GCC}" = "yes" ; then
- CFLAGS_DEBUG=-g
- CFLAGS_OPTIMIZE=-O
- CFLAGS_WARNING="-Wall -Wconversion"
- LDFLAGS_DEBUG=-g
- LDFLAGS_OPTIMIZE=-O
- PATHTYPE=-u
-
- # Specify the CC output file names based on the target name
- CC_OBJNAME="-o \$@"
- CC_EXENAME="-o \$@"
-else
- SHLIB_LD="link -dll -nologo"
- SHLIB_LD_LIBS="user32.lib advapi32.lib"
- LIBS="user32.lib advapi32.lib"
- AR="lib -nologo"
- MAKE_LIB="\${AR} -out:\$@"
- MAKE_EXE="\${CC} -Fe\$@"
-
- if test "${TCL_SHARED_BUILD}" = "0" ; then
- # static
- echo "building static version"
- runtime=-MT
- MAKE_DLL="echo "
- LIBSUFFIX="s\${TCL_DBGX}.lib"
- LIBRARIES="\${STATIC_LIBRARIES}"
- EXESUFFIX="s\${TCL_DBGX}.exe"
- DLLSUFFIX=""
- else
- # dynamic
- echo "building dynamic version"
- runtime=-MD
- MAKE_DLL="\${SHLIB_LD} \${SHLIB_LD_LIBS} -out:\$@"
- LIBSUFFIX="\${TCL_DBGX}.lib"
- DLLSUFFIX="\${TCL_DBGX}.dll"
- EXESUFFIX="\${TCL_DBGX}.exe"
- LIBRARIES="\${SHARED_LIBRARIES}"
- fi
-
- EXTRA_CFLAGS="-YX -nologo"
- CFLAGS_DEBUG="-Z7 -Od -WX ${runtime}d"
- CFLAGS_OPTIMIZE="-O2 -Gs -GD ${runtime}"
- CFLAGS_WARNING="-W3"
- LDFLAGS_DEBUG="-debug"
- LDFLAGS_OPTIMIZE="-release"
- PATHTYPE=-w
-
- # Specify the CC output file names based on the target name
- CC_OBJNAME="-Fo\$@"
- CC_EXENAME="-Fe\$@"
-fi
-
-eval "LD_FLAGS=${LD_FLAGS}"
AC_SUBST(PATHTYPE)
AC_SUBST(CFLAGS_DEBUG)
AC_SUBST(CFLAGS_OPTIMIZE)
AC_SUBST(CFLAGS_WARNING)
AC_SUBST(EXTRA_CFLAGS)
-AC_SUBST(TCL_DBGX)
-AC_SUBST(TCL_LIB_FILE)
-AC_SUBST(TCL_MAJOR_VERSION)
-AC_SUBST(TCL_MINOR_VERSION)
-AC_SUBST(TCL_PATCH_LEVEL)
-AC_SUBST(TCL_VERSION)
AC_SUBST(SHLIB_LD)
AC_SUBST(SHLIB_LD_LIBS)
AC_SUBST(SHLIB_CFLAGS)
AC_SUBST(SHLIB_SUFFIX)
AC_SUBST(CC_OBJNAME)
AC_SUBST(CC_EXENAME)
+AC_SUBST(LDFLAGS)
+AC_SUBST(LDFLAGS_DEBUG)
+AC_SUBST(LDFLAGS_OPTIMIZE)
+AC_SUBST(LDFLAGS_CONSOLE)
+AC_SUBST(LDFLAGS_WINDOW)
AC_SUBST(AR)
+AC_SUBST(RC)
AC_SUBST(DLLSUFFIX)
AC_SUBST(LIBSUFFIX)
AC_SUBST(EXESUFFIX)
@@ -188,4 +139,4 @@ AC_SUBST(LIBRARIES)
AC_SUBST(MAKE_LIB)
AC_SUBST(MAKE_DLL)
-AC_OUTPUT(Makefile)
+AC_OUTPUT(Makefile tkConfig.sh)
diff --git a/win/stubs.c b/win/stubs.c
index c9b97f5..e827b0f 100644
--- a/win/stubs.c
+++ b/win/stubs.c
@@ -1,8 +1,4 @@
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <stdio.h>
-#include <tkInt.h>
-#include <tkPort.h>
+#include "tk.h"
/*
* Undocumented Xlib internal function