From 22ce7af7758444030a12394242057ab031c2c739 Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Tue, 20 Jan 2009 03:54:35 +0000 Subject: Backport of Patch 907924 --- ChangeLog | 10 ++++++++++ unix/Makefile.in | 14 +++++++++----- unix/configure | 17 +++++++++++++---- unix/tcl.m4 | 11 ++++++++--- 4 files changed, 40 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index c6b9740..10edf6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-01-19 Kevin B. Kenny + + * unix/Makefile.in: Added a CONFIG_INSTALL_DIR parameter so that + * unix/tcl.m4: distributors can control where tclConfig.sh goes. + Made the installation of 'ldAix' conditional + upon actually being on an AIX system. Allowed for downstream + packagers to customize SHLIB_VERSION on BSD-derived systems. + Thanks to Stuart Cassoff for [Patch 907924]. + * unix/configure: Autoconf 2.59 + 2009-01-09 Don Porter * generic/tclStringObj.c (STRING_SIZE): Corrected failure to limit diff --git a/unix/Makefile.in b/unix/Makefile.in index e698cb1..84ad721 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -4,7 +4,7 @@ # "./configure", which is a configuration script generated by the "autoconf" # program (constructs like "@foo@" will get replaced in the actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.229.2.10 2008/11/10 17:57:10 andreas_kupries Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.229.2.11 2009/01/20 03:54:35 kennykb Exp $ VERSION = @TCL_VERSION@ MAJOR_VERSION = @TCL_MAJOR_VERSION@ @@ -80,6 +80,9 @@ HTML_DIR = @HTML_DIR@ # Directory in which to install html documentation: HTML_INSTALL_DIR = $(INSTALL_ROOT)$(HTML_DIR) +# Directory in which to install the configuration file tclConfig.sh +CONFIG_INSTALL_DIR = $(INSTALL_ROOT)$(libdir) + # Package search path. TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ @@ -711,7 +714,8 @@ install-strip: # (e.g. if installing as root). install-binaries: binaries - @for i in "$(LIB_INSTALL_DIR)" "$(BIN_INSTALL_DIR)" ; \ + @for i in "$(LIB_INSTALL_DIR)" "$(BIN_INSTALL_DIR)" \ + "$(CONFIG_INSTALL_DIR)"; \ do \ if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ @@ -733,8 +737,8 @@ install-binaries: binaries fi @echo "Installing tclsh as $(BIN_INSTALL_DIR)/tclsh$(VERSION)" @$(INSTALL_PROGRAM) tclsh "$(BIN_INSTALL_DIR)"/tclsh$(VERSION) - @echo "Installing tclConfig.sh to $(LIB_INSTALL_DIR)/" - @$(INSTALL_DATA) tclConfig.sh "$(LIB_INSTALL_DIR)"/tclConfig.sh + @echo "Installing tclConfig.sh to $(CONFIG_INSTALL_DIR)/" + @$(INSTALL_DATA) tclConfig.sh "$(CONFIG_INSTALL_DIR)"/tclConfig.sh @if test "$(STUB_LIB_FILE)" != "" ; then \ echo "Installing $(STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \ @INSTALL_STUB_LIB@ ; \ @@ -773,7 +777,7 @@ install-libraries: libraries $(INSTALL_TZDATA) install-msgs done; @echo "Installing library files to $(SCRIPT_INSTALL_DIR)"; @for i in $(TOP_DIR)/library/*.tcl $(TOP_DIR)/library/tclIndex \ - $(UNIX_DIR)/tclAppInit.c $(UNIX_DIR)/ldAix @DTRACE_SRC@; \ + $(UNIX_DIR)/tclAppInit.c @LDAIX_SRC@ @DTRACE_SRC@; \ do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"; \ done; diff --git a/unix/configure b/unix/configure index b6b140b..88021cd 100755 --- a/unix/configure +++ b/unix/configure @@ -308,7 +308,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR LIBOBJS TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT DTRACE TCL_VERSION TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_YEAR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_STUB_LIB_PATH TCL_INCLUDE_SPEC TCL_BUILD_STUB_LIB_SPEC TCL_BUILD_STUB_LIB_PATH TCL_SRC_DIR CFG_TCL_SHARED_LIB_SUFFIX CFG_TCL_UNSHARED_LIB_SUFFIX CFG_TCL_EXPORT_FILE_SUFFIX TCL_SHARED_BUILD LD_LIBRARY_PATH_VAR TCL_BUILD_LIB_SPEC TCL_NEEDS_EXP_FILE TCL_BUILD_EXP_FILE TCL_EXP_FILE TCL_LIB_VERSIONS_OK TCL_SHARED_LIB_SUFFIX TCL_UNSHARED_LIB_SUFFIX TCL_HAS_LONGLONG INSTALL_TZDATA DTRACE_SRC DTRACE_HDR DTRACE_OBJ MAKEFILE_SHELL BUILD_DLTEST TCL_PACKAGE_PATH TCL_MODULE_PATH TCL_LIBRARY PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_TCLSH_LIBS DLTEST_LD DLTEST_SUFFIX' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR LIBOBJS TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS LDAIX_SRC CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT DTRACE TCL_VERSION TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_YEAR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_STUB_LIB_PATH TCL_INCLUDE_SPEC TCL_BUILD_STUB_LIB_SPEC TCL_BUILD_STUB_LIB_PATH TCL_SRC_DIR CFG_TCL_SHARED_LIB_SUFFIX CFG_TCL_UNSHARED_LIB_SUFFIX CFG_TCL_EXPORT_FILE_SUFFIX TCL_SHARED_BUILD LD_LIBRARY_PATH_VAR TCL_BUILD_LIB_SPEC TCL_NEEDS_EXP_FILE TCL_BUILD_EXP_FILE TCL_EXP_FILE TCL_LIB_VERSIONS_OK TCL_SHARED_LIB_SUFFIX TCL_UNSHARED_LIB_SUFFIX TCL_HAS_LONGLONG INSTALL_TZDATA DTRACE_SRC DTRACE_HDR DTRACE_OBJ MAKEFILE_SHELL BUILD_DLTEST TCL_PACKAGE_PATH TCL_MODULE_PATH TCL_LIBRARY PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_TCLSH_LIBS DLTEST_LD DLTEST_SUFFIX' ac_subst_files='' # Initialize some variables set by options. @@ -6620,6 +6620,11 @@ fi # Require ranlib early so we can override it in special cases below. + LDAIX_SRC="" + if test x"$(SHLIB_VERSION)" = x; then + SHLIB_VERSION="1.0" +fi + @@ -6725,6 +6730,7 @@ fi LD_LIBRARY_PATH_VAR="LIBPATH" # Check to enable 64-bit flags for compiler/linker on AIX 4+ + LDAIX_SRC='$(UNIX_DIR)/ldAix' if test "$do64bit" = yes -a "`uname -v`" -gt 3; then if test "$GCC" = yes; then @@ -7541,7 +7547,7 @@ echo "${ECHO_T}$tcl_cv_ld_elf" >&6 else - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' fi @@ -7552,6 +7558,7 @@ fi TCL_LIB_VERSIONS_OK=nodots ;; OpenBSD-*) + CFLAGS_OPTIMIZE='-O2' SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_LD_LIBS='${LIBS}' @@ -7564,7 +7571,7 @@ fi fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' echo "$as_me:$LINENO: checking for ELF" >&5 echo $ECHO_N "checking for ELF... $ECHO_C" >&6 if test "${tcl_cv_ld_elf+set}" = set; then @@ -8310,7 +8317,7 @@ fi # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; @@ -8922,6 +8929,7 @@ fi + cat >>confdefs.h <<_ACEOF #define TCL_SHLIB_EXT "${SHLIB_SUFFIX}" _ACEOF @@ -19621,6 +19629,7 @@ s,@DL_LIBS@,$DL_LIBS,;t t s,@DL_OBJS@,$DL_OBJS,;t t s,@PLAT_OBJS@,$PLAT_OBJS,;t t s,@PLAT_SRCS@,$PLAT_SRCS,;t t +s,@LDAIX_SRC@,$LDAIX_SRC,;t t s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t diff --git a/unix/tcl.m4 b/unix/tcl.m4 index c7a13c6..4a44599 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1121,6 +1121,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) # Require ranlib early so we can override it in special cases below. + LDAIX_SRC="" + AS_IF([test x"$(SHLIB_VERSION)" = x], [SHLIB_VERSION="1.0"]) AC_REQUIRE([AC_PROG_RANLIB]) @@ -1180,6 +1182,7 @@ dnl AC_CHECK_TOOL(AR, ar) LD_LIBRARY_PATH_VAR="LIBPATH" # Check to enable 64-bit flags for compiler/linker on AIX 4+ + LDAIX_SRC='$(UNIX_DIR)/ldAix' AS_IF([test "$do64bit" = yes -a "`uname -v`" -gt 3], [ AS_IF([test "$GCC" = yes], [ AC_MSG_WARN([64bit mode not supported with GCC on $system]) @@ -1521,7 +1524,7 @@ dnl AC_CHECK_TOOL(AR, ar) AS_IF([test $tcl_cv_ld_elf = yes], [ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' ], [ - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' ]) # Ancient FreeBSD doesn't handle version numbers with dots. @@ -1530,6 +1533,7 @@ dnl AC_CHECK_TOOL(AR, ar) TCL_LIB_VERSIONS_OK=nodots ;; OpenBSD-*) + CFLAGS_OPTIMIZE='-O2' SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_LD_LIBS='${LIBS}' @@ -1539,7 +1543,7 @@ dnl AC_CHECK_TOOL(AR, ar) AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ AC_EGREP_CPP(yes, [ #ifdef __ELF__ @@ -1848,7 +1852,7 @@ dnl AC_CHECK_TOOL(AR, ar) # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; @@ -2112,6 +2116,7 @@ dnl # preprocessing tests use only CPPFLAGS. AC_SUBST(DL_OBJS) AC_SUBST(PLAT_OBJS) AC_SUBST(PLAT_SRCS) + AC_SUBST(LDAIX_SRC) AC_SUBST(CFLAGS) AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_OPTIMIZE) -- cgit v0.12