Index: unix/Makefile.in
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/Makefile.in,v
retrieving revision 1.98
diff -u -r1.98 Makefile.in
--- unix/Makefile.in	23 Apr 2002 05:41:03 -0000	1.98
+++ unix/Makefile.in	3 May 2002 07:08:32 -0000
@@ -238,6 +238,10 @@
 CC			= @CC@
 #CC			= purify -best-effort @CC@ -DPURIFY
 
+# Flags to be passed to mkLinks to control whether the manpages
+# should be compressed and linked with softlinks
+MKLINKS_FLAGS           = @MKLINKS_FLAGS@
+
 #----------------------------------------------------------------
 # The information below should be usable as is.  The configure
 # script won't modify it and you shouldn't need to modify it
@@ -662,7 +666,7 @@
 	    chmod 444 $(MAN1_INSTALL_DIR)/$$i; \
 	    done;
 	@echo "Cross-linking top-level (.1) docs";
-	@$(UNIX_DIR)/mkLinks $(MAN1_INSTALL_DIR)
+	@$(UNIX_DIR)/mkLinks $(MKLINKS_FLAGS) $(MAN1_INSTALL_DIR)
 	@echo "Installing C API (.3) docs";
 	@cd $(TOP_DIR)/doc; for i in *.3; \
 	    do \
@@ -672,7 +676,7 @@
 	    chmod 444 $(MAN3_INSTALL_DIR)/$$i; \
 	    done;
 	@echo "Cross-linking C API (.3) docs";
-	@$(UNIX_DIR)/mkLinks $(MAN3_INSTALL_DIR)
+	@$(UNIX_DIR)/mkLinks $(MKLINKS_FLAGS) $(MAN3_INSTALL_DIR)
 	@echo "Installing command (.n) docs";
 	@cd $(TOP_DIR)/doc; for i in *.n; \
 	    do \
@@ -682,7 +686,7 @@
 	    chmod 444 $(MANN_INSTALL_DIR)/$$i; \
 	    done;
 	@echo "Cross-linking command (.n) docs";
-	@$(UNIX_DIR)/mkLinks $(MANN_INSTALL_DIR)
+	@$(UNIX_DIR)/mkLinks $(MKLINKS_FLAGS) $(MANN_INSTALL_DIR)
 
 Makefile: $(UNIX_DIR)/Makefile.in $(DLTEST_DIR)/Makefile.in
 	$(SHELL) config.status
Index: unix/configure.in
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/configure.in,v
retrieving revision 1.83
diff -u -r1.83 configure.in
--- unix/configure.in	6 Mar 2002 15:20:23 -0000	1.83
+++ unix/configure.in	3 May 2002 07:08:32 -0000
@@ -28,6 +28,11 @@
 TCL_SRC_DIR=`cd $srcdir/..; pwd`
 
 #------------------------------------------------------------------------
+# Compress and/or soft link the manpages?
+#------------------------------------------------------------------------
+SC_CONFIG_MANPAGES
+
+#------------------------------------------------------------------------
 # Standard compiler checks
 #------------------------------------------------------------------------
 
Index: unix/mkLinks.tcl
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/mkLinks.tcl,v
retrieving revision 1.6
diff -u -r1.6 mkLinks.tcl
--- unix/mkLinks.tcl	20 Dec 2001 18:57:30 -0000	1.6
+++ unix/mkLinks.tcl	3 May 2002 07:08:32 -0000
@@ -22,11 +22,33 @@
 # The script takes one argument, which is the name of the directory
 # where the manual entries have been installed.
 
+while true; do
+    case $1 in
+        -s | --symlinks )
+            S=-s
+            ;;
+        -z | --compress )
+            ZIP=$2
+            shift
+            ;;
+        *) break
+            ;;
+    esac
+    shift
+done
+
 if test $# != 1; then
-    echo "Usage: mkLinks dir"
+    echo "Usage: mkLinks <options> dir"
     exit 1
 fi
 
+if test -n "$ZIP"; then
+    touch TeST
+    $ZIP TeST
+    Z=`ls TeST* | sed 's/^[^.]*//'`
+    rm -f TeST*
+fi
+
 cd $1
 echo foo > xyzzyTestingAVeryLongFileName.foo
 x=`echo xyzzyTe*`
@@ -72,12 +94,16 @@
 			   set tstfi ""
 		    	}
 			lappend namelist $name$ext
-			append rmOutput "   $tst rm -f $name$ext$tstfi\n"
-			append lnOutput "   $tst ln $tail $name$ext$tstfi\n"
+			append rmOutput "   $tst rm -f $name$ext $name$ext\$Z$tstfi\n"
+			append lnOutput "   $tst ln \$S $tail\$Z $name$ext\$Z$tstfi\n"
 		    }
 		}
+		puts "if test -n \"\$ZIP\" -a -r $tail; then"
+		puts "    rm -f $tail\$Z"
+		puts "    \$ZIP $tail"
+		puts "fi"
 		if { [llength $namelist] } {
-		    puts "if test -r $tail; then"
+		    puts "if test -r $tail\$Z; then"
 		    puts -nonewline $rmOutput
 		    puts -nonewline $lnOutput
 		    puts "fi"
Index: unix/tcl.m4
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/tcl.m4,v
retrieving revision 1.65
diff -u -r1.65 tcl.m4
--- unix/tcl.m4	26 Apr 2002 19:29:55 -0000	1.65
+++ unix/tcl.m4	3 May 2002 07:08:32 -0000
@@ -505,6 +505,47 @@
 ])
 
 #--------------------------------------------------------------------
+# SC_CONFIG_MANPAGES
+#	
+#	Decide whether to use symlinks for linking the manpages and
+#	whether to compress the manpages after installation.
+#
+# Arguments:
+#	none
+#
+# Results:
+#
+#	Adds the following arguments to configure:
+#		--enable-man-symlinks
+#		--enable-man-compression=PROG
+#
+#	Defines the following variable:
+#
+#	MKLINKS_FLAGS -		The apropriate flags for mkLinks
+#				according to the user's selection.
+#
+#--------------------------------------------------------------------
+AC_DEFUN(SC_CONFIG_MANPAGES, [
+
+	AC_MSG_CHECKING([whether to use symlinks for manpages])
+	AC_ARG_ENABLE(man-symlinks,
+		AC_HELP_STRING([--enable-man-symlinks],[use symlinks for the manpages]),
+		test "$enableval" != "no" && MKLINKS_FLAGS="$MKLINKS_FLAGS --symlinks",
+		enableval="no")
+	AC_MSG_RESULT([$enableval])
+
+	AC_MSG_CHECKING([compression for manpages])
+	AC_ARG_ENABLE(man-compression,
+		AC_HELP_STRING([--enable-man-compression=PROG], [compress the manpages with PROG]),
+		test "$enableval" = "yes" && echo && AC_MSG_ERROR([missing argument to --enable-man-compression])
+		test "$enableval" != "no" && MKLINKS_FLAGS="$MKLINKS_FLAGS --compress $enableval",
+		enableval="no")
+	AC_MSG_RESULT([$enableval])
+
+	AC_SUBST(MKLINKS_FLAGS)
+])
+
+#--------------------------------------------------------------------
 # SC_CONFIG_CFLAGS
 #
 #	Try to determine the proper flags to pass to the compiler
