$OpenBSD: patch-Makefile_in,v 1.1 2002/11/29 09:45:51 kevlo Exp $
--- Makefile.in.orig	Fri Oct 18 20:44:46 2002
+++ Makefile.in	Fri Nov 29 16:28:19 2002
@@ -37,6 +37,9 @@ mandir			= @mandir@
 # when installing files.
 INSTALL_ROOT		=
 
+# Path for the platform independent Tcl scripting generic header files:
+TCL_INCLUDE_GENERIC	= $(prefix)/include/tcl$(VERSION)/generic
+
 # Path for the platform independent Tcl scripting libraries:
 TCL_LIBRARY		= $(prefix)/lib/tcl$(VERSION)
 
@@ -407,7 +410,7 @@ SRCS = $(GENERIC_SRCS) $(UNIX_SRCS) $(ST
 
 all: binaries libraries doc
 
-binaries: ${TCL_LIB_FILE} $(TCL_STUB_LIB_FILE) $(TCL_BUILD_EXP_FILE) tclsh
+binaries: ${TCL_LIB_FILE} $(TCL_STUB_LIB_FILE) $(TCL_BUILD_EXP_FILE) libtcl83.a tclsh
 
 libraries:
 
@@ -418,12 +421,15 @@ doc:
 ${TCL_LIB_FILE}: ${OBJS} ${STUB_LIB_FILE}
 	rm -f ${TCL_LIB_FILE}
 	@MAKE_LIB@
-	$(RANLIB) ${TCL_LIB_FILE}
 
 ${STUB_LIB_FILE}: ${STUB_LIB_OBJS}
 	rm -f ${STUB_LIB_FILE}
 	@MAKE_STUB_LIB@
-	$(RANLIB) ${STUB_LIB_FILE}
+
+libtcl83.a: ${OBJS}
+	rm -f libtcl83.a
+	ar cr libtcl83.a ${OBJS}
+	$(RANLIB) libtcl83.a
 
 # Make target which outputs the list of the .o contained in the Tcl lib
 # usefull to build a single big shared library containing Tcl and other
@@ -559,8 +565,10 @@ install-binaries: binaries
 	    fi
 	@echo "Installing $(TCL_LIB_FILE) to $(LIB_INSTALL_DIR)/"
 	@$(INSTALL_LIBRARY) $(TCL_LIB_FILE) $(LIB_INSTALL_DIR)/$(TCL_LIB_FILE)
-	@(cd $(LIB_INSTALL_DIR); $(RANLIB) $(TCL_LIB_FILE))
 	@chmod 555 $(LIB_INSTALL_DIR)/$(TCL_LIB_FILE)
+	@echo "Installing libtcl83.a"
+	@$(INSTALL_DATA) libtcl83.a $(LIB_INSTALL_DIR)/libtcl83.a
+	@chmod 555 $(LIB_INSTALL_DIR)/libtcl83.a
 	@if test "$(TCL_BUILD_EXP_FILE)" != ""; then \
 	    echo "Installing $(TCL_EXP_FILE) to $(LIB_INSTALL_DIR)/"; \
 	    $(INSTALL_DATA) $(TCL_BUILD_EXP_FILE) \
@@ -569,7 +577,8 @@ install-binaries: binaries
 	@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
+	@mkdir -p $(SCRIPT_INSTALL_DIR)
+	@$(INSTALL_DATA) tclConfig.sh $(SCRIPT_INSTALL_DIR)/tclConfig.sh
 	@if test "$(TCL_STUB_LIB_FILE)" != "" ; then \
 	    echo "Installing $(TCL_STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \
 	    $(INSTALL_LIBRARY) $(STUB_LIB_FILE) \
@@ -577,7 +586,8 @@ install-binaries: binaries
 	    fi
 
 install-libraries: libraries
-	@for i in $(INCLUDE_INSTALL_DIR) $(SCRIPT_INSTALL_DIR); \
+	@for i in $(INSTALL_ROOT)$(prefix)/lib $(INSTALL_ROOT)$(GENERIC_INCLUDE_INSTALL_DIR) \
+	    $(INSTALL_ROOT)$(UNIX_INCLUDE_INSTALL_DIR) $(SCRIPT_INSTALL_DIR); \
 	    do \
 	    if [ ! -d $$i ] ; then \
 		echo "Making directory $$i"; \
@@ -599,11 +609,19 @@ install-libraries: libraries
 	    chmod +x $(SRC_DIR)/install-sh; \
 	    fi
 	@echo "Installing header files";
-	@for i in $(GENERIC_DIR)/tcl.h $(GENERIC_DIR)/tclDecls.h \
-		$(GENERIC_DIR)/tclPlatDecls.h ; \
+	@echo "Installing libraries, tcl.h and other headers"
+	@for i in $(GENERIC_DIR)/*.h ; \
+	    do \
+	    echo "Installing $$i"; \
+	    $(INSTALL_DATA) $$i $(INSTALL_ROOT)$(GENERIC_INCLUDE_INSTALL_DIR); \
+	    done;
+	@for i in $(UNIX_DIR)/*.h ; \
 	    do \
-	    $(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR); \
+	    $(INSTALL_DATA) $$i $(INSTALL_ROOT)$(UNIX_INCLUDE_INSTALL_DIR); \
 	    done;
+	@ln -sf $(GENERIC_INCLUDE_INSTALL_DIR)/tcl.h $(INCLUDE_INSTALL_DIR)/tcl.h
+	@ln -sf $(GENERIC_INCLUDE_INSTALL_DIR)/tclDecls.h $(INCLUDE_INSTALL_DIR)/tclDecls.h
+	@ln -sf $(GENERIC_INCLUDE_INSTALL_DIR)/tclPlatDecls.h $(INCLUDE_INSTALL_DIR)/tclPlatDecls.h
 	@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; \
 	    do \
@@ -682,6 +700,15 @@ install-doc: doc
 	    done;
 	@echo "Cross-linking command (.n) docs";
 	@$(UNIX_DIR)/mkLinks $(MANN_INSTALL_DIR)
+	@echo "**********"
+	@echo "IMPORTANT:"
+	@echo "**********"
+	@echo "tclConfig.sh     in $(TCL_LIBRARY)/tclConfig.sh"
+	@echo "tcl.h            in $(TCL_INCLUDE_GENERIC)/tcl.h"
+	@echo "tclDecls.h       in $(TCL_INCLUDE_GENERIC)/tclDecls.h"
+	@echo "tclPlatDecls.h   in $(TCL_INCLUDE_GENERIC)/tclPlatDecls.h"
+	@echo "These are NOT in the default place, but in a good place to avoid"
+	@echo "conflicting with another version of Tcl/Tk."
 
 Makefile: $(UNIX_DIR)/Makefile.in
 	$(SHELL) config.status
