diff options
author | das <das> | 2005-05-24 04:20:05 (GMT) |
---|---|---|
committer | das <das> | 2005-05-24 04:20:05 (GMT) |
commit | 1f8ced7c37e71e5e0c6563a50e8aa53ea2242fa5 (patch) | |
tree | bf72ea7d291744b7df10a64e210f2c0d4ec41b6e /unix/configure.in | |
parent | fca40523b43d3d77abecf7ffcd91efb66fdc7893 (diff) | |
download | tcl-1f8ced7c37e71e5e0c6563a50e8aa53ea2242fa5.zip tcl-1f8ced7c37e71e5e0c6563a50e8aa53ea2242fa5.tar.gz tcl-1f8ced7c37e71e5e0c6563a50e8aa53ea2242fa5.tar.bz2 |
* macosx/Makefile:
* macosx/README:
* macosx/Tcl-Info.plist.in (new file):
* unix/Makefile.in:
* unix/configure.in:
* unix/tcl.m4:
* unix/tclUnixInit.c: moved all Darwin framework build support from
macosx/Makefile into the standard unix configure/make buildsystem, the
macosx/Makefile is no longer required to build Tcl.framework (but its
functionality is still available for backwards compatibility).
* unix/configure: autoconf-2.13
Diffstat (limited to 'unix/configure.in')
-rw-r--r-- | unix/configure.in | 114 |
1 files changed, 83 insertions, 31 deletions
diff --git a/unix/configure.in b/unix/configure.in index bb68eb2..e56f3f1 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.106.2.13 2005/04/26 00:46:03 das Exp $ +# RCS: @(#) $Id: configure.in,v 1.106.2.14 2005/05/24 04:20:12 das Exp $ AC_INIT(../generic/tcl.h) AC_PREREQ(2.13) @@ -24,8 +24,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` #------------------------------------------------------------------------ @@ -75,7 +73,6 @@ fi SC_TCL_LINK_LIBS # Add the threads support libraries - LIBS="$LIBS$THREADS_LIBS" SC_ENABLE_SHARED @@ -455,8 +452,6 @@ 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 # so that the backslashes quoting the DBX braces are dropped. @@ -464,37 +459,82 @@ SC_ENABLE_FRAMEWORK DBGX='${TCL_DBGX}' 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) -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}\${TCL_DBGX}" - else - TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`\${TCL_DBGX}" + tcl_config_files="${tcl_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_OUTPUT_COMMANDS([n=Tcl && echo "creating $n.framework" && + 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}" - - # Replace DBGX with TCL_DBGX - eval "TCL_EXP_FILE=\"${TCL_EXP_FILE}\"" - - 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}\${TCL_DBGX}" + else + TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`\${TCL_DBGX}" + 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}" + + # Replace DBGX with TCL_DBGX + eval "TCL_EXP_FILE=\"${TCL_EXP_FILE}\"" + + 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}' @@ -511,7 +551,7 @@ 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" elif test "$prefix" != "$exec_prefix"; then TCL_PACKAGE_PATH="${libdir} ${prefix}/lib" else @@ -527,6 +567,7 @@ fi eval "TCL_STUB_LIB_FILE=libtclstub${TCL_UNSHARED_LIB_SUFFIX}" # Replace DBGX with TCL_DBGX 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}\${TCL_DBGX}" @@ -535,9 +576,9 @@ 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}\"" @@ -552,6 +593,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) @@ -587,4 +629,14 @@ AC_SUBST(TCL_HAS_LONGLONG) AC_SUBST(BUILD_DLTEST) AC_SUBST(TCL_PACKAGE_PATH) -AC_OUTPUT([Makefile dltest/Makefile tclConfig.sh]) +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) + +tcl_config_files="${tcl_config_files} [Makefile dltest/Makefile tclConfig.sh]" +AC_OUTPUT([${tcl_config_files}]) |