summaryrefslogtreecommitdiffstats
path: root/unix/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'unix/configure.in')
-rw-r--r--unix/configure.in127
1 files changed, 91 insertions, 36 deletions
diff --git a/unix/configure.in b/unix/configure.in
index 8c9a91c..633a04a 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -3,7 +3,7 @@ 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.
#
-# RCS: @(#) $Id: configure.in,v 1.129 2005/05/14 20:46:48 das Exp $
+# RCS: @(#) $Id: configure.in,v 1.130 2005/05/23 20:20:53 das Exp $
AC_INIT([tcl],[8.5])
AC_PREREQ(2.57)
@@ -30,8 +30,6 @@ fi
if test "${exec_prefix}" = "NONE"; then
exec_prefix=$prefix
fi
-# libdir must be a fully qualified path and (not ${exec_prefix}/lib)
-eval libdir="$libdir"
TCL_SRC_DIR=`cd $srcdir/..; pwd`
#------------------------------------------------------------------------
@@ -431,6 +429,15 @@ AC_CHECK_FUNCS(getattrlist)
SC_BLOCKING_STYLE
+#------------------------------------------------------------------------
+
+AC_ARG_ENABLE(dll-unloading,
+ [ --enable-dll-unloading turn on the 'unload' command (default: on)],
+ [tcl_ok=$enableval], [tcl_ok=yes])
+if test $tcl_ok = yes; then
+ AC_DEFINE(TCL_UNLOAD_DLLS, 1, [Do we allow unloading of shared libraries?])
+fi
+
#--------------------------------------------------------------------
# The statements below define a collection of symbols related to
# building libtcl as a shared library instead of a static library.
@@ -440,42 +447,85 @@ TCL_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}
TCL_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}
eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}"
-SC_ENABLE_FRAMEWORK
-
# tclConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed
# since on some platforms TCL_LIB_FILE contains shell escapes.
# (See also: TCL_TRIM_DOTS).
eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
+TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)'
+PRIVATE_INCLUDE_DIR='$(includedir)'
+HTML_DIR='$(DISTDIR)/html'
+
# Note: in the following variable, it's important to use the absolute
# path name of the Tcl directory rather than "..": this is because
# AIX remembers this path and will attempt to use it at run-time to look
# up the Tcl library.
+if test "`uname -s`" = "Darwin" ; then
+ SC_ENABLE_FRAMEWORK
+ TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version ${TCL_VERSION}`echo ${TCL_PATCH_LEVEL} | awk ['{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}']`"
+ TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -install_name ${DYLIB_INSTALL_DIR}/${TCL_LIB_FILE} -seg1addr 0xa000000'
+fi
+
if test "$FRAMEWORK_BUILD" = "1" ; then
- TCL_BUILD_LIB_SPEC="-F`pwd` -framework Tcl"
- TCL_LIB_SPEC="-framework Tcl"
- TCL_LIB_FILE="Tcl"
AC_DEFINE(TCL_FRAMEWORK, 1, [Is Tcl built as a framework?])
-elif test "$SHARED_BUILD" = "0" || test "$TCL_NEEDS_EXP_FILE" = "0"; then
- if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
- TCL_LIB_FLAG="-ltcl${TCL_VERSION}"
- else
- TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`"
+ AC_CONFIG_FILES([Tcl-Info.plist:../macosx/Tcl-Info.plist.in])
+ # Construct a fake local framework structure to make linking with
+ # '-framework Tcl' and running of tcltest work
+ AC_CONFIG_COMMANDS([Tcl.framework], [n=Tcl &&
+ f=$n.framework && v=Versions/$VERSION &&
+ rm -rf $f && mkdir -p $f/$v/Resources &&
+ ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v &&
+ ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist &&
+ unset n f v
+ ], VERSION=${TCL_VERSION})
+ LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH"
+ if test "${libdir}" = '${exec_prefix}/lib'; then
+ # override libdir default
+ libdir="/Library/Frameworks"
fi
- TCL_BUILD_LIB_SPEC="-L`pwd` ${TCL_LIB_FLAG}"
- TCL_LIB_SPEC="-L${libdir} ${TCL_LIB_FLAG}"
+ TCL_LIB_FILE="Tcl"
+ TCL_LIB_FLAG="-framework Tcl"
+ TCL_BUILD_LIB_SPEC="-F`pwd` -framework Tcl"
+ TCL_LIB_SPEC="-F${libdir} -framework Tcl"
+ libdir="${libdir}/Tcl.framework/Versions/\${VERSION}"
+ TCL_LIBRARY="${libdir}/Resources/Scripts"
+ includedir="${libdir}/Headers"
+ PRIVATE_INCLUDE_DIR="${libdir}/PrivateHeaders"
+ HTML_DIR="${libdir}/Resources/Documentation/Reference/Tcl"
+ EXTRA_INSTALL="install-private-headers html-tcl"
+ EXTRA_BUILD_HTML='@ln -fs contents.htm $(HTML_INSTALL_DIR)/TclTOC.html'
+ EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "Tcl-Info.plist $(LIB_INSTALL_DIR)/Resources/Info.plist"'
+ EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tcl.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" "$(STUB_LIB_FILE)" tclConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done'
+ TCL_YEAR="`date +%Y`"
+ # Don't use AC_DEFINE for the following as the framework version define
+ # needs to go into the Makefile even when using autoheader, so that we
+ # can pick up a potential make override of VERSION. Also, don't put this
+ # into CFLAGS as it should not go into tclConfig.sh
+ EXTRA_CC_SWITCHES='-DTCL_FRAMEWORK_VERSION=\"$(VERSION)\"'
else
- TCL_BUILD_EXP_FILE="lib.exp"
- eval "TCL_EXP_FILE=libtcl${TCL_EXPORT_FILE_SUFFIX}"
-
- if test "$GCC" = "yes" ; then
- TCL_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TCL_BUILD_EXP_FILE} -L`pwd`"
- TCL_LIB_SPEC="-Wl,-bI:${libdir}/${TCL_EXP_FILE} -L`pwd`"
+ # libdir must be a fully qualified path and not ${exec_prefix}/lib
+ eval libdir="$libdir"
+ if test "$SHARED_BUILD" = "0" || test "$TCL_NEEDS_EXP_FILE" = "0"; then
+ if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
+ TCL_LIB_FLAG="-ltcl${TCL_VERSION}"
+ else
+ TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`"
+ fi
+ TCL_BUILD_LIB_SPEC="-L`pwd` ${TCL_LIB_FLAG}"
+ TCL_LIB_SPEC="-L${libdir} ${TCL_LIB_FLAG}"
else
- TCL_BUILD_LIB_SPEC="-bI:`pwd`/${TCL_BUILD_EXP_FILE}"
- TCL_LIB_SPEC="-bI:${libdir}/${TCL_EXP_FILE}"
+ TCL_BUILD_EXP_FILE="lib.exp"
+ eval "TCL_EXP_FILE=libtcl${TCL_EXPORT_FILE_SUFFIX}"
+
+ if test "$GCC" = "yes" ; then
+ TCL_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TCL_BUILD_EXP_FILE} -L`pwd`"
+ TCL_LIB_SPEC="-Wl,-bI:${libdir}/${TCL_EXP_FILE} -L`pwd`"
+ else
+ TCL_BUILD_LIB_SPEC="-bI:`pwd`/${TCL_BUILD_EXP_FILE}"
+ TCL_LIB_SPEC="-bI:${libdir}/${TCL_EXP_FILE}"
+ fi
fi
fi
VERSION='${VERSION}'
@@ -492,7 +542,8 @@ VERSION=${TCL_VERSION}
#--------------------------------------------------------------------
if test "$FRAMEWORK_BUILD" = "1" ; then
- TCL_PACKAGE_PATH="${libdir}/Resources/Scripts"
+ TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl /Network/Library/Tcl /System/Library/Tcl ~/Library/Frameworks /Library/Frameworks /Network/Library/Frameworks /System/Library/Frameworks"
+ TCL_MODULE_PATH="~/Library/Tcl /Library/Tcl /Network/Library/Tcl /System/Library/Tcl"
elif test "$prefix/lib" != "$libdir"; then
TCL_PACKAGE_PATH="${libdir} ${prefix}/lib"
else
@@ -509,6 +560,7 @@ fi
#
eval "TCL_STUB_LIB_FILE=libtclstub${TCL_UNSHARED_LIB_SUFFIX}"
eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
+eval "TCL_STUB_LIB_DIR=${libdir}"
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
TCL_STUB_LIB_FLAG="-ltclstub${TCL_VERSION}"
@@ -517,23 +569,14 @@ else
fi
TCL_BUILD_STUB_LIB_SPEC="-L`pwd` ${TCL_STUB_LIB_FLAG}"
-TCL_STUB_LIB_SPEC="-L${libdir} ${TCL_STUB_LIB_FLAG}"
+TCL_STUB_LIB_SPEC="-L${TCL_STUB_LIB_DIR} ${TCL_STUB_LIB_FLAG}"
TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}"
-TCL_STUB_LIB_PATH="${libdir}/${TCL_STUB_LIB_FILE}"
+TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}"
# Install time header dir can be set via --includedir
eval "TCL_INCLUDE_SPEC=\"-I${includedir}\""
#------------------------------------------------------------------------
-
-AC_ARG_ENABLE(dll-unloading,
- [ --enable-dll-unloading turn on the 'unload' command (default: on)],
- [tcl_ok=$enableval], [tcl_ok=yes])
-if test $tcl_ok = yes; then
- AC_DEFINE(TCL_UNLOAD_DLLS, 1, [Do we allow unloading of shared libraries?])
-fi
-
-#------------------------------------------------------------------------
# tclConfig.sh refers to this by a different name
#------------------------------------------------------------------------
@@ -543,6 +586,7 @@ AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_MAJOR_VERSION)
AC_SUBST(TCL_MINOR_VERSION)
AC_SUBST(TCL_PATCH_LEVEL)
+AC_SUBST(TCL_YEAR)
AC_SUBST(TCL_LIB_FILE)
AC_SUBST(TCL_LIB_FLAG)
@@ -576,8 +620,19 @@ AC_SUBST(TCL_HAS_LONGLONG)
AC_SUBST(BUILD_DLTEST)
AC_SUBST(TCL_PACKAGE_PATH)
+AC_SUBST(TCL_MODULE_PATH)
+
+AC_SUBST(TCL_LIBRARY)
+AC_SUBST(PRIVATE_INCLUDE_DIR)
+AC_SUBST(HTML_DIR)
+
+AC_SUBST(EXTRA_CC_SWITCHES)
+AC_SUBST(EXTRA_INSTALL)
+AC_SUBST(EXTRA_INSTALL_BINARIES)
+AC_SUBST(EXTRA_BUILD_HTML)
dnl Disable the automake-friendly normalization of LIBOBJS
dnl performed by autoconf 2.53 and later. It's not correct for us.
define([_AC_LIBOBJS_NORMALIZE],[])
-AC_OUTPUT([Makefile dltest/Makefile tclConfig.sh])
+AC_CONFIG_FILES([Makefile dltest/Makefile tclConfig.sh])
+AC_OUTPUT