Tcl Source Code

Artifact [07c6a0caa1]
Login

Artifact 07c6a0caa1275b078727ec6aeaac56ad2a73ce00:

Attachment "tk-manpages.patch" to ticket [518052ffff] added by rmax 2002-05-03 15:55:00.
Index: unix/Makefile.in
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/Makefile.in,v
retrieving revision 1.65
diff -u -r1.65 Makefile.in
--- unix/Makefile.in	6 Mar 2002 18:54:16 -0000	1.65
+++ unix/Makefile.in	3 May 2002 07:13:53 -0000
@@ -242,6 +242,10 @@
 # either.
 #----------------------------------------------------------------
 
+# Flags to be passed to mkLinks to control whether the manpages
+# should be compressed and linked with softlinks
+MKLINKS_FLAGS           = @MKLINKS_FLAGS@
+
 CC			= @CC@
 
 CC_SWITCHES_NO_STUBS = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \
@@ -498,9 +502,6 @@
 	@if test ! -x $(UNIX_DIR)/install-sh; then \
 	    chmod +x $(UNIX_DIR)/install-sh; \
 	    fi
-	@if test ! -x $(UNIX_DIR)/mkLinks; then \
-	    chmod +x $(UNIX_DIR)/mkLinks; \
-	    fi
 	@echo "Installing $(TK_LIB_FILE) to $(LIB_INSTALL_DIR)/"
 	@$(INSTALL_DATA) $(TK_LIB_FILE) $(LIB_INSTALL_DIR)/$(TK_LIB_FILE)
 	@(cd $(LIB_INSTALL_DIR); $(RANLIB) $(TK_LIB_FILE))
@@ -595,6 +596,9 @@
 	    done;
 
 install-doc:
+	@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) ; \
 	    do \
 	    if [ ! -d $$i ] ; then \
@@ -613,7 +617,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 $(SRC_DIR)/doc; for i in *.3; \
 	    do \
@@ -623,7 +627,7 @@
 	    chmod 444 $(MAN3_INSTALL_DIR)/$$i; \
 	    done;
 	@echo "Cross-linking top-level (.3) docs";
-	@$(UNIX_DIR)/mkLinks $(MAN3_INSTALL_DIR)
+	@$(UNIX_DIR)/mkLinks $(MKLINKS_FLAGS) $(MAN3_INSTALL_DIR)
 	@echo "Installing command (.n) docs";
 	@cd $(SRC_DIR)/doc; for i in *.n; \
 	    do \
@@ -633,7 +637,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
 	$(SHELL) config.status
@@ -1012,6 +1016,11 @@
 	mv RPMS/i386/*.rpm .
 	rm -rf RPMS THIS.TK.SPEC
 
+mklinks:
+	$(TCL_EXE) $(TCLDIR)/unix/mkLinks.tcl \
+		$(UNIX_DIR)/../doc/*.[13n] > $(UNIX_DIR)/mkLinks
+	chmod +x $(UNIX_DIR)/mkLinks
+
 #
 # Target to create a proper Tk distribution from information in the
 # master source directory.  DISTDIR must be defined to indicate where
@@ -1026,7 +1035,7 @@
 $(UNIX_DIR)/configure: $(UNIX_DIR)/configure.in
 	autoconf $(UNIX_DIR)/configure.in > $(UNIX_DIR)/configure
 
-dist:   $(UNIX_DIR)/configure
+dist:   $(UNIX_DIR)/configure mklinks
 	rm -rf $(DISTDIR)
 	mkdir -p $(DISTDIR)
 	mkdir $(DISTDIR)/unix
@@ -1036,12 +1045,9 @@
 	cp $(UNIX_DIR)/configure $(UNIX_DIR)/configure.in $(UNIX_DIR)/tk.spec \
 		$(UNIX_DIR)/aclocal.m4 $(UNIX_DIR)/tcl.m4 \
 		$(UNIX_DIR)/tkConfig.sh.in $(TCLDIR)/unix/install-sh \
-		$(UNIX_DIR)/README $(DISTDIR)/unix
+		$(UNIX_DIR)/README $(UNIX_DIR)/mkLinks $(DISTDIR)/unix
 	chmod 775 $(DISTDIR)/unix/configure $(DISTDIR)/unix/configure.in
 	chmod +x $(DISTDIR)/unix/install-sh
-	$(TCL_EXE) $(TCLDIR)/unix/mkLinks.tcl $(TOP_DIR)/doc/*.[13n] \
-		> $(DISTDIR)/unix/mkLinks
-	chmod +x $(DISTDIR)/unix/mkLinks
 	mkdir $(DISTDIR)/bitmaps
 	@(cd $(TOP_DIR); for i in bitmaps/* ; do \
 	    if [ -f $$i ] ; then \
Index: unix/configure.in
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/configure.in,v
retrieving revision 1.71
diff -u -r1.71 configure.in
--- unix/configure.in	6 Mar 2002 15:36:17 -0000	1.71
+++ unix/configure.in	3 May 2002 07:13:53 -0000
@@ -31,6 +31,11 @@
 TK_SRC_DIR=`cd $srcdir/..; pwd`
 
 #------------------------------------------------------------------------
+# Compress and/or soft link the manpages?
+#------------------------------------------------------------------------
+SC_CONFIG_MANPAGES
+
+#------------------------------------------------------------------------
 # Standard compiler checks
 #------------------------------------------------------------------------
 
Index: unix/tcl.m4
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/tcl.m4,v
retrieving revision 1.28
diff -u -r1.28 tcl.m4
--- unix/tcl.m4	26 Apr 2002 19:32:54 -0000	1.28
+++ unix/tcl.m4	3 May 2002 07:13:53 -0000
@@ -502,6 +502,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