diff options
author | surles <surles> | 1999-06-11 01:53:03 (GMT) |
---|---|---|
committer | surles <surles> | 1999-06-11 01:53:03 (GMT) |
commit | a0a78db773e3d53770e0572f340ca0629a2c38d7 (patch) | |
tree | 40efe70e77af27761fe138a92f28eb6ea9847e91 /win | |
parent | 472789da3f84f55b673fe1fcb33ecb7bfba7ff2b (diff) | |
download | tcl-a0a78db773e3d53770e0572f340ca0629a2c38d7.zip tcl-a0a78db773e3d53770e0572f340ca0629a2c38d7.tar.gz tcl-a0a78db773e3d53770e0572f340ca0629a2c38d7.tar.bz2 |
Continued work on configure and make scripts
Diffstat (limited to 'win')
-rw-r--r-- | win/Makefile.in | 155 | ||||
-rw-r--r-- | win/aclocal.m4 | 1290 | ||||
-rw-r--r-- | win/configure.in | 126 | ||||
-rw-r--r-- | win/tcl.m4 | 818 |
4 files changed, 736 insertions, 1653 deletions
diff --git a/win/Makefile.in b/win/Makefile.in index 20e587c..ee034fe 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -5,7 +5,7 @@ # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.4 1999/06/08 02:59:31 hershey Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.5 1999/06/11 01:53:04 surles Exp $ VERSION = @TCL_VERSION@ @@ -25,73 +25,93 @@ VERSION = @TCL_VERSION@ prefix = @prefix@ exec_prefix = @exec_prefix@ +# The following definition can be set to non-null for special systems +# like AFS with replication. It allows the pathnames used for installation +# to be different than those used for actually reference files at +# run-time. INSTALL_ROOT is prepended to $prefix and $exec_prefix +# when installing files. +INSTALL_ROOT = + # Directory from which applications will reference the library of Tcl # scripts (note: you can set the TCL_LIBRARY environment variable at # run-time to override this value): -TCL_LIBRARY = $(prefix)/lib/tcl$(VERSION) +TCL_LIBRARY = $(prefix)/lib/tcl$(VERSION) -# Directory in which to install libtcl.so or libtcl.a: -LIB_INSTALL_DIR = @libdir@ +# Path to use at runtime to refer to LIB_INSTALL_DIR: +LIB_RUNTIME_DIR = $(exec_prefix)/lib # Directory in which to install the program tclsh: -BIN_INSTALL_DIR = @bindir@ +BIN_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/bin + +# Directory in which to install libtcl.so or libtcl.a: +LIB_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/lib -# Path name to use when installing script libraries: -SCRIPT_INSTALL_DIR = $(prefix)/lib +# Path name to use when installing library scripts: +SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TCL_LIBRARY) # Directory in which to install the include file tcl.h: -INCLUDE_INSTALL_DIR = @includedir@ +INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/include # Top-level directory in which to install manual entries: -MAN_INSTALL_DIR = @mandir@ +MAN_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/man # Directory in which to install manual entry for tclsh: -MAN1_INSTALL_DIR = $(MAN_INSTALL_DIR)/man1 +MAN1_INSTALL_DIR = $(MAN_INSTALL_DIR)/man1 # Directory in which to install manual entries for Tcl's C library # procedures: -MAN3_INSTALL_DIR = $(MAN_INSTALL_DIR)/man3 +MAN3_INSTALL_DIR = $(MAN_INSTALL_DIR)/man3 # Directory in which to install manual entries for the built-in # Tcl commands: -MANN_INSTALL_DIR = $(MAN_INSTALL_DIR)/mann +MANN_INSTALL_DIR = $(MAN_INSTALL_DIR)/mann -PATHTYPE = @PATHTYPE@ +# Directory in which to install the include file tcl.h: +INCLUDE_INSTALL_DIR = @includedir@ -#SRC_DIR = $(shell cygpath $(PATHTYPE) '@srcdir@') -#ROOT_DIR = $(shell cygpath $(PATHTYPE) '@srcdir@/..') -#GENERIC_DIR = $(shell cygpath $(PATHTYPE) '@srcdir@/../generic') -#WIN_DIR = $(shell cygpath $(PATHTYPE) '@srcdir@') -#COMPAT_DIR = $(shell cygpath $(PATHTYPE) '@srcdir@/../compat') -#TOP_DIR = $(shell cygpath $(PATHTYPE) '@srcdir@/..') +# Libraries built with optimization switches have this additional extension +TCL_DBGX = @TCL_DBGX@ + +# warning flags +CFLAGS_WARNING = @CFLAGS_WARNING@ + +# The default switches for optimization or debugging +CFLAGS_DEBUG = @CFLAGS_DEBUG@ +CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ + +# To change the compiler switches, for example to change from optimization to +# debugging symbols, change the following line: +#CFLAGS = $(CFLAGS_DEBUG) +#CFLAGS = $(CFLAGS_OPTIMIZE) +#CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_OPTIMIZE) +CFLAGS = @CFLAGS@ SRC_DIR = @srcdir@ ROOT_DIR = @srcdir@/.. GENERIC_DIR = @srcdir@/../generic WIN_DIR = @srcdir@ COMPAT_DIR = @srcdir@/../compat -TOP_DIR = @srcdir@/.. + +PATHTYPE = @PATHTYPE@ GENERIC_DIR_NATIVE = $(shell cygpath $(PATHTYPE) '$(GENERIC_DIR)') -WIN_DIR_NATIVE = $(shell cygpath $(PATHTYPE) '$(WIN_DIR)') -TOP_DIR_NATIVE = $(shell cygpath $(PATHTYPE) '$(TOP_DIR)') +WIN_DIR_NATIVE = $(shell cygpath $(PATHTYPE) '$(WIN_DIR)') +ROOT_DIR_NATIVE = $(shell cygpath $(PATHTYPE) '$(ROOT_DIR)') DLLSUFFIX = @DLLSUFFIX@ LIBSUFFIX = @LIBSUFFIX@ EXESUFFIX = @EXESUFFIX@ -STUB_LIB = tclstub$(VER)${LIBSUFFIX} -TCL_DLL = tcl$(VER)${DLLSUFFIX} -TCL_LIB = tcl$(VER)${LIBSUFFIX} -DDE_DLL = tcldde$(VER)${DLLSUFFIX} -DDE_LIB = tcldde$(VER)${LIBSUFFIX} -REG_DLL = tclreg$(VER)${DLLSUFFIX} -REG_LIB = tclreg$(VER)${LIBSUFFIX} -PIPE_DLL = tclpip$(VER)${DLLSUFFIX} -PIPE_LIB = tclpip$(VER)${LIBSUFFIX} +TCL_STUB_LIB_FILE = tclstub$(VER)${LIBSUFFIX} +TCL_DLL_FILE = tcl$(VER)${DLLSUFFIX} +TCL_LIB_FILE = tcl$(VER)${LIBSUFFIX} +DDE_DLL_FILE = tcldde$(VER)${DLLSUFFIX} +REG_DLL_FILE = tclreg$(VER)${DLLSUFFIX} +PIPE_DLL_FILE = tclpip$(VER)${DLLSUFFIX} -SHARED_LIBRARIES = $(TCL_DLL) $(STUB_LIB) $(DDE_DLL) $(REG_DLL) $(PIPE_DLL) -STATIC_LIBRARIES = $(TCL_LIB) +SHARED_LIBRARIES = $(TCL_DLL_FILE) $(TCL_STUB_LIB_FILE) $(DDE_DLL_FILE) \ + $(REG_DLL_FILE) $(PIPE_DLL_FILE) +STATIC_LIBRARIES = $(TCL_LIB_FILE) TCLSH = tclsh$(VER)${EXESUFFIX} TCLTEST = tcltest${EXEEXT} @@ -112,10 +132,6 @@ VPATH = $(GENERIC_DIR);$(WIN_DIR);$(COMPAT_DIR) AR = @AR@ CC = @CC@ AC_FLAGS = @EXTRA_CFLAGS@ @DEFS@ -CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ -CFLAGS_DEBUG = @CFLAGS_DEBUG@ -CFLAGS_WARNING = @CFLAGS_WARNING@ -CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ EXEEXT = @EXEEXT@ @@ -124,7 +140,6 @@ SHLIB_LD = @SHLIB_LD@ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_SUFFIX = @SHLIB_SUFFIX@ -TCL_DBGX = @TCL_DBGX@ VER = @TCL_MAJOR_VERSION@@TCL_MINOR_VERSION@ DOTVER = @TCL_MAJOR_VERSION@.@TCL_MINOR_VERSION@ LIBS = @LIBS@ @@ -254,37 +269,37 @@ libraries: man: -$(TCLSH): $(TCL_LIB) $(TCLSH_OBJS) - $(CC) $(CFLAGS) $(TCLSH_OBJS) $(TCL_LIB) $(LIBS) $(CC_EXENAME) +$(TCLSH): $(TCL_LIB_FILE) $(TCLSH_OBJS) + $(CC) $(CFLAGS) $(TCLSH_OBJS) $(TCL_LIB_FILE) $(LIBS) $(CC_EXENAME) -$(TCLTEST): $(TCL_LIB) $(TCLTEST_OBJS) - $(CC) $(CFLAGS) $(TCLTEST_OBJS) $(TCL_LIB) $(LIBS) $(CC_EXENAME) +$(TCLTEST): $(TCL_LIB_FILE) $(TCLTEST_OBJS) + $(CC) $(CFLAGS) $(TCLTEST_OBJS) $(TCL_LIB_FILE) $(LIBS) $(CC_EXENAME) # The following targets are configured by autoconf to generate either # a shared library or static library -${STUB_LIB}: ${STUB_OBJS} - @$(RM) ${STUB_LIB} +${TCL_STUB_LIB_FILE}: ${STUB_OBJS} + @$(RM) ${TCL_STUB_LIB_FILE} @MAKE_LIB@ ${STUB_OBJS} -${TCL_DLL}: ${TCL_OBJS} - @$(RM) ${TCL_DLL} +${TCL_DLL_FILE}: ${TCL_OBJS} + @$(RM) ${TCL_DLL_FILE} @MAKE_DLL@ ${TCL_OBJS} -${TCL_LIB}: ${TCL_OBJS} - @$(RM) ${TCL_LIB} +${TCL_LIB_FILE}: ${TCL_OBJS} + @$(RM) ${TCL_LIB_FILE} @MAKE_LIB@ ${TCL_OBJS} -${DDE_DLL}: ${DDE_OBJS} ${STUB_LIB} - @$(RM) ${DDE_DLL} - @MAKE_DLL@ ${DDE_OBJS} ${STUB_LIB} +${DDE_DLL_FILE}: ${DDE_OBJS} ${TCL_STUB_LIB_FILE} + @$(RM) ${DDE_DLL_FILE} + @MAKE_DLL@ ${DDE_OBJS} ${TCL_STUB_LIB_FILE} -${REG_DLL}: ${REG_OBJS} ${STUB_LIB} - @$(RM) ${REG_DLL} - @MAKE_DLL@ ${REG_OBJS} ${STUB_LIB} +${REG_DLL_FILE}: ${REG_OBJS} ${TCL_STUB_LIB_FILE} + @$(RM) ${REG_DLL_FILE} + @MAKE_DLL@ ${REG_OBJS} ${TCL_STUB_LIB_FILE} -${PIPE_DLL}: ${PIPE_OBJS} - @$(RM) ${PIPE_DLL} +${PIPE_DLL_FILE}: ${PIPE_OBJS} + @$(RM) ${PIPE_DLL_FILE} @MAKE_DLL@ ${PIPE_OBJS} # Add the object extension to the implicit rules. By default .obj is not @@ -345,28 +360,28 @@ install-binaries: binaries else true; \ fi; \ done; - @for i in $(TCL_DLL) $(TCLSH) $(PIPE_DLL); \ + @for i in $(TCL_DLL_FILE) $(TCLSH) $(PIPE_DLL_FILE); \ do \ if [ -f $$i ]; then \ echo "Installing $$i"; \ $(COPY) $$i "$(BIN_INSTALL_DIR)"; \ fi; \ done - @for i in $(TCL_LIB) $(STUB_LIB); \ + @for i in $(TCL_LIB_FILE) $(TCL_STUB_LIB_FILE); \ do \ if [ -f $$i ]; then \ echo "Installing $$i"; \ $(COPY) $$i "$(LIB_INSTALL_DIR)"; \ fi; \ done - @if [ -f $(DDE_DLL) ]; then \ - echo installing $(DDE_DLL); \ - $(COPY) $(DDE_DLL) $(LIB_INSTALL_DIR)/dde1.0; \ + @if [ -f $(DDE_DLL_FILE) ]; then \ + echo installing $(DDE_DLL_FILE); \ + $(COPY) $(DDE_DLL_FILE) $(LIB_INSTALL_DIR)/dde1.0; \ $(COPY) $(ROOT_DIR)/library/dde1.0/pkgIndex.tcl $(LIB_INSTALL_DIR)/dde1.0; \ fi - @if [ -f $(REG_DLL) ]; then \ - echo installing $(REG_DLL); \ - $(COPY) $(REG_DLL) $(LIB_INSTALL_DIR)/reg1.0; \ + @if [ -f $(REG_DLL_FILE) ]; then \ + echo installing $(REG_DLL_FILE); \ + $(COPY) $(REG_DLL_FILE) $(LIB_INSTALL_DIR)/reg1.0; \ $(COPY) $(ROOT_DIR)/library/reg1.0/pkgIndex.tcl $(LIB_INSTALL_DIR)/reg1.0; \ fi @@ -393,31 +408,31 @@ install-libraries: libraries echo "Installing $$i"; \ $(COPY) "$$i" "$(INCLUDE_INSTALL_DIR)"; \ done; - @for i in $(TOP_DIR)/library/*.tcl $(TOP_DIR)/library/tclIndex; \ + @for i in $(ROOT_DIR)/library/*.tcl $(ROOT_DIR)/library/tclIndex; \ do \ echo "Installing $$i"; \ $(COPY) "$$i" "$(SCRIPT_INSTALL_DIR)/tcl$(VERSION)"; \ done; @for i in http2.0 http1.0 opt0.4 msgcat1.0; \ do \ - for j in $(TOP_DIR)/library/$$i/*.tcl; \ + for j in $(ROOT_DIR)/library/$$i/*.tcl; \ do \ echo "Installing $$j"; \ $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/$$i"; \ done; \ done; @echo "Installing encodings" - @for i in $(TOP_DIR)/library/encoding/*.enc ; do \ + @for i in $(ROOT_DIR)/library/encoding/*.enc ; do \ $(COPY) "$$i" "$(SCRIPT_INSTALL_DIR)/encoding"; \ done; test: binaries $(TCLTEST) - @TCL_LIBRARY="$(TOP_DIR_NATIVE)/library"; export TCL_LIBRARY; \ - ./tcltest "$(TOP_DIR_NATIVE)/tests/all.tcl" $(TESTFLAGS) + @TCL_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TCL_LIBRARY; \ + ./tcltest "$(ROOT_DIR_NATIVE)/tests/all.tcl" $(TESTFLAGS) # Useful target to launch a built tcltest with the proper path,... runtest: tcltest - @TCL_LIBRARY="$(TOP_DIR_NATIVE)/library"; export TCL_LIBRARY; \ + @TCL_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TCL_LIBRARY; \ ./tcltest depend: diff --git a/win/aclocal.m4 b/win/aclocal.m4 index d43ff7b..dbbf43b 100644 --- a/win/aclocal.m4 +++ b/win/aclocal.m4 @@ -1,875 +1,415 @@ -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: +# TCLCONFIG 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 + TCLCONFIG_DEFAULT=../../tcl8.1$1/win + else + TCLCONFIG_DEFAULT=../../tcl8.1/win + fi + + AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.1 binaries from DIR], + TCLCONFIG=$withval, TCLCONFIG=`cd $TCLCONFIG_DEFAULT; pwd`) + if test ! -d $TCLCONFIG; then + AC_MSG_ERROR(Tcl directory $TCLCONFIG does not exist) + fi + if test ! -f $TCLCONFIG/tclConfig.sh; then + AC_MSG_ERROR(There is no tclConfig.sh in $TCLCONFIG: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?) + fi + + AC_MSG_RESULT([$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, [ + AC_MSG_CHECKING([the location of tkConfig.sh]) + + if test -d ../../tk8.1$1/win; then + TKCONFIG_DEFAULT=../../tk8.1$1/win + else + TKCONFIG_DEFAULT=../../tk8.1/win + fi + + AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.1 binaries from DIR], + TKCONFIG=$withval, TKCONFIG=`cd $TKCONFIG_DEFAULT; pwd`) + if test ! -d $TKCONFIG; then + AC_MSG_ERROR(Tk directory $TKCONFIG does not exist) + fi + if test ! -f $TKCONFIG/tkConfig.sh; then + AC_MSG_ERROR(There is no tkConfig.sh in $TKCONFIG: perhaps you did not specify the Tk *build* directory (not the toplevel Tk directory) or you forgot to configure Tk?) + fi + + AC_MSG_RESULT([$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: +# +# 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, [ + if test -f "$TCLCONFIG" ; then + echo "loading $TCLCONFIG" + . $TCLCONFIG + 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: +# TKCONFIG +# +# Results: +# +# Sets the following vars that should be in tkConfig.sh: +# TK_BIN_DIR +#------------------------------------------------------------------------ + +AC_DEFUN(SC_LOAD_TKCONFIG, [ + if test -f "$TKCONFIG" ; then + echo "loading $TKCONFIG" + . $TKCONFIG + 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 +# 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_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}' + LD_FLAGS_DEFAULT='${LDFLAGS_DEBUG}' + DBGX=d + AC_MSG_RESULT([yes]) + else + CFLAGS_DEFAULT='${CFLAGS_OPTIMIZE}' + LD_FLAGS_DEFAULT='${LDFLAGS_OPTIMIZE}' + DBGX="" + AC_MSG_RESULT([no]) + fi +]) + + +#-------------------------------------------------------------------- +# SC_TCL_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_TCL_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" + MAKE_LIB="\${AR} -out:\[$]@" + MAKE_EXE="\${CC} -Fe\[$]@" + + if test "${SHARED_BUILD}" = "0" ; then + # static + echo "building static version" + runtime=-MT + MAKE_DLL="echo " + LIBSUFFIX="s\${DBGX}.lib" + LIBRARIES="\${STATIC_LIBRARIES}" + EXESUFFIX="s\${DBGX}.exe" + DLLSUFFIX="" + else + # dynamic + echo "building dynamic version" + runtime=-MD + MAKE_DLL="\${SHLIB_LD} \${SHLIB_LD_LIBS} -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_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 + AC_MSG_RESULT([done]) +]) + +#------------------------------------------------------------------------ +# 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 f4e1e5c..092f1ee 100644 --- a/win/configure.in +++ b/win/configure.in @@ -1,104 +1,82 @@ -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 Tcl installation +# to configure the system for the local environment. +# +# RCS: @(#) $Id: configure.in,v 1.5 1999/06/11 01:53:04 surles Exp $ + AC_INIT(../generic/tcl.h) -# RCS: @(#) $Id: configure.in,v 1.4 1999/06/10 21:47:28 wart Exp $ TCL_VERSION=8.1 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=1 TCL_PATCH_LEVEL=.2 -VERSION=${TCL_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. +#-------------------------------------------------------------------- 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 -# Set the default compiler switches based on the --enable-symbols option +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +#-------------------------------------------------------------------- -SC_ENABLE_SYMBOLS +SC_ENABLE_THREADS -CFLAGS=${CFLAGS_DEFAULT} -LD_FLAGS=${LDFLAGS_DEFAULT} -TCL_DBGX=${DBGX} +#-------------------------------------------------------------------- +# The statements below define a collection of symbols related to +# building libtcl as a shared library instead of a static library. +#-------------------------------------------------------------------- -# Trick to replace DBGX with TCL_DBGX -DBGX='${TCL_DBGX}' -eval "TCL_LIB_FILE=${TCL_LIB_FILE}" +SC_ENABLE_SHARED -# Check whether --enable-threads or --disable-threads was given. +#-------------------------------------------------------------------- +# 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_ENABLE_THREADS +SC_TCL_CONFIG_CFLAGS #-------------------------------------------------------------------- -# The statements below define a collection of symbols related to -# building libtcl as a shared library instead of a static library. +# Set the default compiler switches based on the --enable-symbols +# option. This macro depends on C flags, and should be called +# after SC_TCL_CONFIG_CFLAGS macro is called. #-------------------------------------------------------------------- -SC_ENABLE_SHARED +SC_ENABLE_SYMBOLS -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" - CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -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 +CFLAGS=${CFLAGS_DEFAULT} +LD_FLAGS=${LDFLAGS_DEFAULT} +TCL_DBGX=${DBGX} +#-------------------------------------------------------------------- +# Perform final evaluations of variables with possible substitutions. +#-------------------------------------------------------------------- + +eval "TCL_LIB_FILE=${TCL_LIB_FILE}" eval "LD_FLAGS=${LD_FLAGS}" AC_SUBST(PATHTYPE) @@ -6,7 +6,7 @@ # Currently a no-op for Windows # # Arguments: -# none +# PATCH_LEVEL The patch level for Tcl if any. # # Results: # @@ -18,6 +18,24 @@ #------------------------------------------------------------------------ AC_DEFUN(SC_PATH_TCLCONFIG, [ + AC_MSG_CHECKING([the location of tclConfig.sh]) + + if test -d ../../tcl8.1$1/win; then + TCLCONFIG_DEFAULT=../../tcl8.1$1/win + else + TCLCONFIG_DEFAULT=../../tcl8.1/win + fi + + AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.1 binaries from DIR], + TCLCONFIG=$withval, TCLCONFIG=`cd $TCLCONFIG_DEFAULT; pwd`) + if test ! -d $TCLCONFIG; then + AC_MSG_ERROR(Tcl directory $TCLCONFIG does not exist) + fi + if test ! -f $TCLCONFIG/tclConfig.sh; then + AC_MSG_ERROR(There is no tclConfig.sh in $TCLCONFIG: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?) + fi + + AC_MSG_RESULT([$TCLCONFIG]) ]) #------------------------------------------------------------------------ @@ -39,6 +57,24 @@ AC_DEFUN(SC_PATH_TCLCONFIG, [ #------------------------------------------------------------------------ AC_DEFUN(SC_PATH_TKCONFIG, [ + AC_MSG_CHECKING([the location of tkConfig.sh]) + + if test -d ../../tk8.1$1/win; then + TKCONFIG_DEFAULT=../../tk8.1$1/win + else + TKCONFIG_DEFAULT=../../tk8.1/win + fi + + AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.1 binaries from DIR], + TKCONFIG=$withval, TKCONFIG=`cd $TKCONFIG_DEFAULT; pwd`) + if test ! -d $TKCONFIG; then + AC_MSG_ERROR(Tk directory $TKCONFIG does not exist) + fi + if test ! -f $TKCONFIG/tkConfig.sh; then + AC_MSG_ERROR(There is no tkConfig.sh in $TKCONFIG: perhaps you did not specify the Tk *build* directory (not the toplevel Tk directory) or you forgot to configure Tk?) + fi + + AC_MSG_RESULT([$TKCONFIG]) ]) #------------------------------------------------------------------------ @@ -54,21 +90,23 @@ AC_DEFUN(SC_PATH_TKCONFIG, [ # # 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 +# 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, [ + if test -f "$TCLCONFIG" ; then + echo "loading $TCLCONFIG" + . $TCLCONFIG + fi + + if test $TCL_THREADS = 1; then + AC_DEFINE(TCL_THREADS) + fi ]) #------------------------------------------------------------------------ @@ -84,18 +122,15 @@ AC_DEFUN(SC_LOAD_TCLCONFIG, [ # # 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 +# Sets the following vars that should be in tkConfig.sh: +# TK_BIN_DIR #------------------------------------------------------------------------ AC_DEFUN(SC_LOAD_TKCONFIG, [ + if test -f "$TKCONFIG" ; then + echo "loading $TKCONFIG" + . $TKCONFIG + fi ]) #------------------------------------------------------------------------ @@ -139,29 +174,31 @@ AC_DEFUN(SC_ENABLE_GCC, [ # --enable-shared=yes|no # # Defines the following vars: -# TCL_SHARED_BUILD Value of 1 or 0 +# 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 + enableval="$enable_shared" + tcl_ok=$enableval else - tcl_ok=yes + tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then - TCL_SHARED_BUILD=1 + AC_MSG_RESULT([shared]) + SHARED_BUILD=1 else - TCL_SHARED_BUILD=0 + AC_MSG_RESULT([static]) + SHARED_BUILD=0 AC_DEFINE(STATIC_BUILD) fi - ]) #------------------------------------------------------------------------ @@ -183,13 +220,14 @@ AC_DEFUN(SC_ENABLE_SHARED, [ #------------------------------------------------------------------------ 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) - echo "building with threads enabled" else - echo "building with threads disabled (default)" + AC_MSG_RESULT(no (default)) fi ]) @@ -214,24 +252,25 @@ AC_DEFUN(SC_ENABLE_THREADS, [ # 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 +# 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}' LD_FLAGS_DEFAULT='${LDFLAGS_DEBUG}' DBGX=d - echo "building with debug symbols" + AC_MSG_RESULT([yes]) else CFLAGS_DEFAULT='${CFLAGS_OPTIMIZE}' LD_FLAGS_DEFAULT='${LDFLAGS_OPTIMIZE}' DBGX="" - echo "building without debug symbols" + AC_MSG_RESULT([no]) fi ]) @@ -242,624 +281,135 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [ # 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: +# 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 # -# 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` + 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 - 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). + 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 -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) + if test "${SHARED_BUILD}" = "0" ; then + # static + echo "building static version" + runtime=-MT + MAKE_DLL="echo " + LIBSUFFIX="s\${DBGX}.lib" + LIBRARIES="\${STATIC_LIBRARIES}" + EXESUFFIX="s\${DBGX}.exe" + DLLSUFFIX="" + else + # dynamic + echo "building dynamic version" + runtime=-MD + MAKE_DLL="\${SHLIB_LD} \${SHLIB_LD_LIBS} -out:\[$]@" + LIBSUFFIX="\${DBGX}.lib" + DLLSUFFIX="\${DBGX}.dll" + EXESUFFIX="\${DBGX}.exe" + LIBRARIES="\${SHARED_LIBRARIES}" 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") + EXTRA_CFLAGS="-YX" + CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -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 + AC_MSG_RESULT([done]) +]) - # 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. +#------------------------------------------------------------------------ +# 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. +#------------------------------------------------------------------------ - 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 +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 - - # 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="" + + 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 "x$DL_OBJS" != "x" ; then - BUILD_DLTEST="\$(DLTEST_TARGETS)" + 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 "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 + echo "building against Tcl binaries in: $TCL_BIN_DIR" fi + AC_SUBST(TCL_BIN_DIR) ]) + |