diff -u -3 -r1.63.2.4 Makefile.in
--- unix/Makefile.in	2001/04/03 23:00:17	1.63.2.4
+++ unix/Makefile.in	2001/04/06 18:05:32
@@ -161,8 +161,13 @@
 # "install" around;  better to use the install-sh script that comes
 # with the distribution, which is slower but guaranteed to work.
 
+INSTALL_STRIP_PROGRAM   = -s
+INSTALL_STRIP_LIBRARY   =
+#INSTALL_STRIP_LIBRARY  = -S -S
+
 INSTALL			= @srcdir@/install-sh -c
 INSTALL_PROGRAM		= ${INSTALL}
+INSTALL_LIBRARY		= ${INSTALL}
 INSTALL_DATA		= ${INSTALL} -m 644
 
 # The following specifies which Tcl executable to use for make targets
@@ -246,7 +251,7 @@
 ${AC_FLAGS} ${MATH_FLAGS} ${GENERIC_FLAGS} ${PROTO_FLAGS} ${MEM_DEBUG_FLAGS} \
 ${COMPILE_DEBUG_FLAGS} ${ENV_FLAGS} -DTCL_SHLIB_EXT=\"${SHLIB_SUFFIX}\"
 
-LIBS		= @DL_LIBS@ @LIBS@ $(MATH_LIBS) -lc
+LIBS		= @DL_LIBS@ @LIBS@ $(MATH_LIBS)
 
 DEPEND_SWITCHES	= ${CFLAGS} -I${GENERIC_DIR} -I${SRC_DIR} \
 ${AC_FLAGS} ${MATH_FLAGS} \
@@ -408,7 +413,9 @@
 ${TCL_LIB_FILE}: ${OBJS} ${STUB_LIB_FILE}
 	rm -f ${TCL_LIB_FILE}
 	@MAKE_LIB@
-	$(RANLIB) ${TCL_LIB_FILE}
+	if test "x@DL_OBJS@" = "xtclLoadAout.o"; then \
+		$(RANLIB) ${TCL_LIB_FILE}; \
+	fi
 
 ${STUB_LIB_FILE}: ${STUB_LIB_OBJS}
 	rm -f ${STUB_LIB_FILE}
@@ -504,14 +511,16 @@
 install: install-binaries install-libraries install-doc
 
 install-strip:
-	$(MAKE) install INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s"
+	$(MAKE) install \
+		INSTALL_PROGRAM="$(INSTALL_PROGRAM) ${INSTALL_STRIP_PROGRAM}" \
+		INSTALL_LIBRARY="$(INSTALL_LIBRARY) ${INSTALL_STRIP_LIBRARY}"
 
 # Note: before running ranlib below, must cd to target directory because
 # some ranlibs write to current directory, and this might not always be
 # possible (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) $(SCRIPT_INSTALL_DIR); \
 	    do \
 	    if [ ! -d $$i ] ; then \
 		echo "Making directory $$i"; \
@@ -524,8 +533,10 @@
 	    chmod +x $(SRC_DIR)/install-sh; \
 	    fi
 	@echo "Installing $(TCL_LIB_FILE) to $(LIB_INSTALL_DIR)/"
-	@$(INSTALL_DATA) $(TCL_LIB_FILE) $(LIB_INSTALL_DIR)/$(TCL_LIB_FILE)
-	@(cd $(LIB_INSTALL_DIR); $(RANLIB) $(TCL_LIB_FILE))
+	@$(INSTALL_LIBRARY) $(TCL_LIB_FILE) $(LIB_INSTALL_DIR)/$(TCL_LIB_FILE)
+	@if test "x@DL_OBJS@" = "xtclLoadAout.o"; then \
+	    (cd $(LIB_INSTALL_DIR); $(RANLIB) $(TCL_LIB_FILE)); \
+	    fi
 	@chmod 555 $(LIB_INSTALL_DIR)/$(TCL_LIB_FILE)
 	@if test "$(TCL_BUILD_EXP_FILE)" != ""; then \
 	    echo "Installing $(TCL_EXP_FILE) to $(LIB_INSTALL_DIR)/"; \
@@ -534,11 +545,11 @@
 	    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 $(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_DATA) $(STUB_LIB_FILE) \
+	    $(INSTALL_LIBRARY) $(STUB_LIB_FILE) \
 			 $(LIB_INSTALL_DIR)/$(TCL_STUB_LIB_FILE); \
 	    fi
 
@@ -609,7 +620,7 @@
 	@if test ! -x $(UNIX_DIR)/mkLinks; then \
 	    chmod +x $(UNIX_DIR)/mkLinks; \
 	    fi
-	@for i in $(MAN_INSTALL_DIR) $(MAN1_INSTALL_DIR) $(MAN3_INSTALL_DIR) $(MANN_INSTALL_DIR) ; \
+	@for i in $(MAN_INSTALL_DIR) $(MAN1_INSTALL_DIR) $(MAN3_INSTALL_DIR) ; \
 	    do \
 	    if [ ! -d $$i ] ; then \
 		echo "Making directory $$i"; \
@@ -639,15 +650,15 @@
 	@echo "Cross-linking C API (.3) docs";
 	@$(UNIX_DIR)/mkLinks $(MAN3_INSTALL_DIR)
 	@echo "Installing command (.n) docs";
-	@cd $(TOP_DIR)/doc; for i in *.n; \
-	    do \
-	    rm -f $(MANN_INSTALL_DIR)/$$i; \
-	    sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
-		    $$i > $(MANN_INSTALL_DIR)/$$i; \
-	    chmod 444 $(MANN_INSTALL_DIR)/$$i; \
-	    done;
-	@echo "Cross-linking command (.n) docs";
-	@$(UNIX_DIR)/mkLinks $(MANN_INSTALL_DIR)
+#	@cd $(TOP_DIR)/doc; for i in *.n; \
+#	    do \
+#	    rm -f $(MANN_INSTALL_DIR)/$$i; \
+#	    sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
+#		    $$i > $(MANN_INSTALL_DIR)/$$i; \
+#	    chmod 444 $(MANN_INSTALL_DIR)/$$i; \
+#	    done;
+#	@echo "Cross-linking command (.n) docs";
+#	@$(UNIX_DIR)/mkLinks $(MANN_INSTALL_DIR)
 
 Makefile: $(UNIX_DIR)/Makefile.in
 	$(SHELL) config.status
diff -u -3 -r1.3.2.3 configure
--- unix/configure	2001/04/04 19:13:29	1.3.2.3
+++ unix/configure	2001/04/06 18:05:31
@@ -5178,6 +5178,17 @@
 	    LDFLAGS="-export-dynamic"
 	    LD_SEARCH_FLAGS=""
 	    ;;
+	Rhapsody-*|Darwin-*)
+	    SHLIB_CFLAGS="-fno-common"
+	    SHLIB_LD="cc -dynamiclib \${LDFLAGS} -compatibility_version ${TCL_MAJOR_VERSION} -current_version \${VERSION} -install_name \${LIB_RUNTIME_DIR}/\${TCL_LIB_FILE}"
+	    SHLIB_LD_LIBS=""
+	    SHLIB_SUFFIX=".dylib"
+	    DL_OBJS="tclLoadDyld.o"
+	    DL_LIBS=""
+	    LDFLAGS=""
+	    LD_SEARCH_FLAGS=""
+	    CFLAGS_OPTIMIZE="-O3"
+	    ;;
 	NEXTSTEP-*)
 	    SHLIB_CFLAGS=""
 	    SHLIB_LD="cc -nostdlib -r"
@@ -5596,6 +5607,8 @@
 		    ;;
 		NetBSD-*|FreeBSD-*|OpenBSD-*)
 		    ;;
+		Rhapsody-*|Darwin-*)
+		    ;;
 		RISCos-*)
 		    ;;
 		SCO_SV-3.2*)
@@ -5838,7 +5851,6 @@
 	MAKE_LIB="ar cr \${TCL_LIB_FILE} \${OBJS}"
     else
 	MAKE_LIB="\${SHLIB_LD} -o \${TCL_LIB_FILE} \${OBJS} ${SHLIB_LD_LIBS}"
-	RANLIB=":"
     fi
 else
     case $system in
diff -u -3 -r1.57.2.2 configure.in
--- unix/configure.in	2001/04/03 22:54:39	1.57.2.2
+++ unix/configure.in	2001/04/06 18:05:31
@@ -380,7 +380,6 @@
 	MAKE_LIB="ar cr \${TCL_LIB_FILE} \${OBJS}"
     else
 	MAKE_LIB="\${SHLIB_LD} -o \${TCL_LIB_FILE} \${OBJS} ${SHLIB_LD_LIBS}"
-	RANLIB=":"
     fi
 else
     case $system in
diff -u -3 -r1.1 install-sh
--- unix/install-sh	1998/03/26 14:58:46	1.1
+++ unix/install-sh	2001/04/06 18:05:31
@@ -62,6 +62,11 @@
 	    shift
 	    continue;;
 
+	-S) stripcmd="$stripprog $2"
+	    shift
+	    shift
+	    continue;;
+
 	*)  if [ x"$src" = x ]
 	    then
 		src=$1
diff -u -3 -r1.22.2.2 tcl.m4
--- unix/tcl.m4	2001/04/04 19:13:30	1.22.2.2
+++ unix/tcl.m4	2001/04/06 18:05:32
@@ -893,6 +893,17 @@
 	    LDFLAGS="-export-dynamic"
 	    LD_SEARCH_FLAGS=""
 	    ;;
+	Rhapsody-*|Darwin-*)
+	    SHLIB_CFLAGS="-fno-common"
+	    SHLIB_LD="cc -dynamiclib \${LDFLAGS} -compatibility_version ${TCL_MAJOR_VERSION} -current_version \${VERSION} -install_name \${LIB_RUNTIME_DIR}/\${TCL_LIB_FILE}"
+	    SHLIB_LD_LIBS=""
+	    SHLIB_SUFFIX=".dylib"
+	    DL_OBJS="tclLoadDyld.o"
+	    DL_LIBS=""
+	    LDFLAGS=""
+	    LD_SEARCH_FLAGS=""
+	    CFLAGS_OPTIMIZE="-O3"
+	    ;;
 	NEXTSTEP-*)
 	    SHLIB_CFLAGS=""
 	    SHLIB_LD="cc -nostdlib -r"
@@ -1220,6 +1231,8 @@
 		IRIX*)
 		    ;;
 		NetBSD-*|FreeBSD-*|OpenBSD-*)
+		    ;;
+		Rhapsody-*|Darwin-*)
 		    ;;
 		RISCos-*)
 		    ;;
diff -u -3 -r1.2 tclLoadDyld.c
--- unix/tclLoadDyld.c	2000/04/25 17:55:45	1.2
+++ unix/tclLoadDyld.c	2001/04/06 18:05:32
@@ -18,6 +18,11 @@
 #include "tclInt.h"
 #include <mach-o/dyld.h>
 
+/* For compatibility with older API. */
+#ifndef NSLINKMODULE_OPTION_PRIVATE
+#define NSLINKMODULE_OPTION_PRIVATE TRUE
+#endif
+
 /*
  *----------------------------------------------------------------------
  *
@@ -87,7 +92,7 @@
 	return TCL_ERROR;
     }
 
-    module = NSLinkModule(image, fileName, TRUE);
+    module = NSLinkModule(image, fileName, NSLINKMODULE_OPTION_PRIVATE);
 
     if (module == NULL) {
 	Tcl_SetResult(interp, "dyld: falied to link module", TCL_STATIC);
@@ -96,13 +101,21 @@
 
     name = (char*)malloc(sizeof(char)*(strlen(sym1)+2));
     sprintf(name, "_%s", sym1);
+#ifdef NSLINKMODULE_OPTION_PRIVATE
+    symbol = NSLookupSymbolInModule(module, name);
+#else
     symbol = NSLookupAndBindSymbol(name);
+#endif
     free(name);
     *proc1Ptr = NSAddressOfSymbol(symbol);
 
     name = (char*)malloc(sizeof(char)*(strlen(sym2)+2));
     sprintf(name, "_%s", sym2);
+#ifdef NSLINKMODULE_OPTION_PRIVATE
+    symbol = NSLookupSymbolInModule(module, name);
+#else
     symbol = NSLookupAndBindSymbol(name);
+#endif
     free(name);
     *proc2Ptr = NSAddressOfSymbol(symbol);
 
diff -u -3 -r1.3 tclMtherr.c
--- unix/tclMtherr.c	1999/04/16 00:48:04	1.3
+++ unix/tclMtherr.c	2001/04/06 18:05:32
@@ -61,6 +61,9 @@
  *----------------------------------------------------------------------
  */
 
+#ifdef __APPLE_CC__
+__private_extern__
+#endif
 int
 matherr(xPtr)
     struct exception *xPtr;	/* Describes error that occurred. */
