From 822a73a5dec13549cb20e6c7338b059ece2ea95a Mon Sep 17 00:00:00 2001
From: Richard Purdie <rpurdie@linux.intel.com>
Date: Wed, 9 Dec 2009 23:59:44 +0000
Subject: [PATCH] tcl: add .0 to libtcl.so filename

This patch is fixing the issue after the fact; the issue
is that upstream defines the shared library filename as
libtcl.so (without version) for all platforms in unix/tcl.m4,
and I (AlexK) suspect they won't be interested in
changing that.

Upstream-Status: Inappropriate [see above]
---
 unix/Makefile.in | 5 ++++-
 unix/tcl.m4      | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/unix/Makefile.in b/unix/Makefile.in
index b72b0da..2de7b2f 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -1021,7 +1021,10 @@ install-binaries: binaries
 	done
 	@echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/"
 	@@INSTALL_LIB@
-	@chmod 555 "$(DLL_INSTALL_DIR)/$(LIB_FILE)"
+	mv "$(DLL_INSTALL_DIR)"/$(LIB_FILE) "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0
+	ln -sf $(LIB_FILE).0 "$(DLL_INSTALL_DIR)"/$(LIB_FILE)
+	ln -sf "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0 ./
+	@chmod 555 "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0
 	@echo "Installing ${TCL_EXE} as $(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"
 	@$(INSTALL_PROGRAM) ${TCL_EXE} "$(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"
 	@echo "Installing tclConfig.sh to $(CONFIG_INSTALL_DIR)/"
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 4265832..49ad5ab 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -1269,6 +1269,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
 	    # get rid of the warnings.
 	    #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
 
+	    # following line added by CW for Debian GNU/Linux
+	    TCL_SHLIB_LD_EXTRAS="-Wl,-soname,\${TCL_LIB_FILE}.0"
+
 	    SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared'
 	    DL_OBJS="tclLoadDl.o"
 	    DL_LIBS="-ldl"
