$OpenBSD: patch-unix_Makefile_in,v 1.4 2009/11/21 02:50:23 sthen Exp $
--- unix/Makefile.in.orig	Fri Nov 13 13:38:45 2009
+++ unix/Makefile.in	Thu Nov 19 20:29:58 2009
@@ -557,6 +557,10 @@ ${STUB_LIB_FILE}: ${STUB_LIB_OBJS}
 	rm -f $@
 	@MAKE_STUB_LIB@
 
+${TCL_BUILD_EXP_FILE}: ${OBJS}
+	rm -f $@
+	${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@
+
 # Make target which outputs the list of the .o contained in the Tcl lib useful
 # to build a single big shared library containing Tcl and other extensions.
 # Used for the Tcl Plugin.  -- dl
@@ -719,21 +723,17 @@ install-binaries: binaries
 	    do \
 	    if [ ! -d "$$i" ] ; then \
 		echo "Making directory $$i"; \
-		mkdir -p "$$i"; \
-		chmod 755 "$$i"; \
+		$(INSTALL_DATA_DIR) "$$i"; \
 		else true; \
 		fi; \
 	    done;
-	@if test ! -x $(SRC_DIR)/../unix/install-sh; then \
-	    chmod +x $(SRC_DIR)/../unix/install-sh; \
-	    fi
 	@echo "Installing $(LIB_FILE) to $(LIB_INSTALL_DIR)/"
 	@@INSTALL_LIB@
-	@chmod 555 "$(LIB_INSTALL_DIR)"/$(LIB_FILE)
 	@if test "$(TCL_BUILD_EXP_FILE)" != ""; then \
 	    echo "Installing $(TCL_EXP_FILE) to $(LIB_INSTALL_DIR)/"; \
 	    $(INSTALL_DATA) $(TCL_BUILD_EXP_FILE) \
 			"$(LIB_INSTALL_DIR)"/$(TCL_EXP_FILE); \
+	    (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(TCL_EXP_FILE)); \
 	    fi
 	@echo "Installing tclsh as $(BIN_INSTALL_DIR)/tclsh$(VERSION)"
 	@$(INSTALL_PROGRAM) tclsh "$(BIN_INSTALL_DIR)"/tclsh$(VERSION)
@@ -746,12 +746,12 @@ install-binaries: binaries
 	@EXTRA_INSTALL_BINARIES@
 
 install-libraries: libraries $(INSTALL_TZDATA) install-msgs
-	@for i in "$(INCLUDE_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)"; \
+	@for i in "$(INCLUDE_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)" \
+		"$(INCLUDE_INSTALL_DIR)"/generic "$(INCLUDE_INSTALL_DIR)"/unix; \
 	    do \
 	    if [ ! -d "$$i" ] ; then \
 		echo "Making directory $$i"; \
-		mkdir -p "$$i"; \
-		chmod 755 "$$i"; \
+		$(INSTALL_DATA_DIR) "$$i"; \
 		else true; \
 		fi; \
 	    done;
@@ -759,14 +759,10 @@ install-libraries: libraries $(INSTALL_TZDATA) install
 	    do \
 	    if [ ! -d "$(SCRIPT_INSTALL_DIR)"/$$i ] ; then \
 		echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \
-		mkdir -p "$(SCRIPT_INSTALL_DIR)"/$$i; \
-		chmod 755 "$(SCRIPT_INSTALL_DIR)"/$$i; \
+		$(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)"/$$i; \
 		else true; \
 		fi; \
 	    done;
-	@if test ! -x $(SRC_DIR)/../unix/install-sh; then \
-	    chmod +x $(SRC_DIR)/../unix/install-sh; \
-	    fi
 	@echo "Installing header files";
 	@for i in $(GENERIC_DIR)/tcl.h $(GENERIC_DIR)/tclDecls.h \
 		$(GENERIC_DIR)/tclPlatDecls.h \
@@ -774,7 +770,18 @@ install-libraries: libraries $(INSTALL_TZDATA) install
 		$(GENERIC_DIR)/tclTomMathDecls.h ; \
 	    do \
 	    $(INSTALL_DATA) $$i "$(INCLUDE_INSTALL_DIR)"; \
+	    cd "$(INCLUDE_INSTALL_DIR)"/generic && ln -sf ../`basename $$i` ./`basename $$i`; \
 	    done;
+	@for i in $(GENERIC_DIR)/tclInt.h $(GENERIC_DIR)/tclIntDecls.h \
+		$(GENERIC_DIR)/tclIntPlatDecls.h $(GENERIC_DIR)/tclPort.h \
+		$(GENERIC_DIR)/tclRegexp.h $(GENERIC_DIR)/regex.h ; \
+	    do \
+	    $(INSTALL_DATA) $$i "$(INCLUDE_INSTALL_DIR)"/generic; \
+	    done;
+	@for i in $(UNIX_DIR)/tclUnixPort.h; \
+	    do \
+	    $(INSTALL_DATA) $$i "$(INCLUDE_INSTALL_DIR)"/unix; \
+	    done;
 	@echo "Installing library files to $(SCRIPT_INSTALL_DIR)";
 	@for i in $(TOP_DIR)/library/*.tcl $(TOP_DIR)/library/tclIndex \
 		$(UNIX_DIR)/tclAppInit.c @LDAIX_SRC@ @DTRACE_SRC@; \
@@ -832,8 +839,7 @@ install-doc: doc
 	    do \
 	    if [ ! -d "$$i" ] ; then \
 		echo "Making directory $$i"; \
-		mkdir -p "$$i"; \
-		chmod 755 "$$i"; \
+		$(INSTALL_DATA_DIR) "$$i"; \
 		else true; \
 		fi; \
 	    done;
