This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Makefile/configure patch for manpage generation


This patch makes some configure/makefile changes towards more manpage
generation: it does the necessary configure work to avoid trying to
regenerate manpages when users didn't run gcc_update --touch, if they
don't have sufficiently recent tools; enables generation of cpp.1 from
the Makefile; avoids relying on #! to run perl for texi2pod.pl; and,
in preparation for future work, requires texinfo 4.0 for installed
texinfo and handles @option and @env in texi2pod.pl (though this isn't
useful until the in-tree texinfo goes away).

Bootstrapped and passed "make install" with no regressions on
i686-pc-linux-gnu.  OK to commit?

contrib/ChangeLog:
2000-12-19  Joseph S. Myers  <jsm28@cam.ac.uk>

	* texi2pod.pl: Handle @option and @env.

gcc/ChangeLog:
2000-12-19  Joseph S. Myers  <jsm28@cam.ac.uk>

	* configure.in: Require at least texinfo 4.0.  Check for whether
	Pod::Man is sufficiently recent to regenerate GCC manpages.
	* configure:  Regenerate.
	* Makefile.in (TEXI2POD): Call perl explicitly rather than relying
	on #!.
	(GENERATED_MANPAGES): Define.
	(generated-manpages): New target.  Depend on cpp.1 as well as
	gcov.1.
	(install-man): Depend on $(GENERATED_MANPAGES) (defined by
	configure to generated-manpages or empty) rather than on the
	manpages directly.  Remove execute permission from installed
	gcov.1 as well as cpp.1.
	* cpp.1, gcov.1: Regenerate.

--- contrib/texi2pod.pl.orig	Thu Dec  7 22:55:06 2000
+++ contrib/texi2pod.pl	Tue Dec 19 09:38:43 2000
@@ -251,7 +251,7 @@ sub postprocess
     # Formatting commands.
     s/\@(?:dfn|var|emph|cite|i)\{([^\}]*)\}/I<$1>/g;
     s/\@(?:code|kbd)\{([^\}]*)\}/C<$1>/g;
-    s/\@(?:samp|strong|key|b)\{([^\}]*)\}/B<$1>/g;
+    s/\@(?:samp|strong|key|option|env|b)\{([^\}]*)\}/B<$1>/g;
     s/\@sc\{([^\}]*)\}/\U$1/g;
     s/\@file\{([^\}]*)\}/F<$1>/g;
     s/\@w\{([^\}]*)\}/S<$1>/g;
--- gcc/configure.in.orig	Mon Dec 18 21:41:56 2000
+++ gcc/configure.in	Tue Dec 19 09:34:21 2000
@@ -456,7 +456,7 @@ else
   # that we can use it.
   gcc_AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
   [GNU texinfo.* \([0-9][0-9.]*\)],
-  [3.1[2-9] | 3.[2-9][0-9] | 4.* | 1.6[89] | 1.7[0-9]])
+  [4.*])
 fi

 if test $gcc_cv_prog_makeinfo_modern = no; then
@@ -466,6 +466,16 @@ if test $gcc_cv_prog_makeinfo_modern = n
   BUILD_INFO=
 else
   BUILD_INFO=info		AC_SUBST(BUILD_INFO)
+fi
+
+# Is pod2man recent enough to regenerate manpages?
+AC_MSG_CHECKING([for recent Pod::Man])
+if perl -e 'use 1.10 Pod::Man' >/dev/null 2>&1; then
+  AC_MSG_RESULT(yes)
+  GENERATED_MANPAGES=generated-manpages		AC_SUBST(GENERATED_MANPAGES)
+else
+  AC_MSG_RESULT(no)
+  GENERATED_MANPAGES=
 fi

 # How about lex?
--- gcc/Makefile.in.orig	Mon Dec 18 21:41:54 2000
+++ gcc/Makefile.in	Tue Dec 19 09:40:40 2000
@@ -129,7 +129,7 @@ INSTALL_DATA = @INSTALL_DATA@
 MAKEINFO = @MAKEINFO@
 MAKEINFOFLAGS =
 TEXI2DVI = texi2dvi
-TEXI2POD = $(srcdir)/../contrib/texi2pod.pl
+TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl
 POD2MAN = pod2man --center="GNU" --release="gcc-$(version)" --section=1
 # For GNUmake: let us decide what gets passed to recursive makes.
 MAKEOVERRIDES =
@@ -469,6 +469,9 @@ INSTALL_HEADERS=install-headers
 # Control whether Info documentation is built and installed.
 BUILD_INFO = @BUILD_INFO@

+# Control whether manpages generated by texi2pod.pl can be rebuilt.
+GENERATED_MANPAGES = @GENERATED_MANPAGES@
+
 # Additional directories of header files to run fixincludes on.
 # These should be directories searched automatically by default
 # just as /usr/include is.
@@ -2195,6 +2198,8 @@ cpp.dvi: $(srcdir)/cpp.texi
 	texindex cpp.??
 	TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex cpp.texi

+generated-manpages: $(srcdir)/gcov.1 $(srcdir)/cpp.1
+
 $(srcdir)/gcov.1: $(srcdir)/gcov.texi
 	$(TEXI2POD) < $(srcdir)/gcov.texi > gcov.pod
 	($(POD2MAN) gcov.pod > $(srcdir)/gcov.1.T$$$$ && \
@@ -2202,6 +2207,13 @@ $(srcdir)/gcov.1: $(srcdir)/gcov.texi
 		(rm -f $(srcdir)/gcov.1.T$$$$ && exit 1)
 	rm -f gcov.pod

+$(srcdir)/cpp.1: $(srcdir)/cpp.texi
+	$(TEXI2POD) < $(srcdir)/cpp.texi > cpp.pod
+	($(POD2MAN) cpp.pod > $(srcdir)/cpp.1.T$$$$ && \
+		mv -f $(srcdir)/cpp.1.T$$$$ $(srcdir)/cpp.1) || \
+		(rm -f $(srcdir)/cpp.1.T$$$$ && exit 1)
+	rm -f cpp.pod
+
 #
 # Deletion of files made during compilation.
 # There are four levels of this:
@@ -2328,7 +2340,7 @@ maintainer-clean:
 	-rm -f cpp.??s cpp.*aux
 	-rm -f gcc.??s gcc.*aux
 	-rm -f $(srcdir)/cpp.info* $(srcdir)/gcc.info* $(srcdir)/c-tree.info*
-	-rm -f $(srcdir)/gcov.1
+	-rm -f $(srcdir)/gcov.1 $(srcdir)/cpp.1
 #
 # Entry points `install' and `uninstall'.
 # Also use `install-collect2' to install collect2 when the config files don't.
@@ -2517,7 +2529,7 @@ install-info: doc installdirs lang.insta
 	-chmod a-x $(infodir)/cpp.info* $(infodir)/gcc.info*

 # Install the man pages.
-install-man: installdirs $(srcdir)/gcc.1 $(srcdir)/cpp.1 $(srcdir)/gcov.1 lang.install-man
+install-man: installdirs $(srcdir)/gcc.1 $(GENERATED_MANPAGES) lang.install-man
 	-if [ -f gcc-cross$(exeext) ] ; then \
 	  rm -f $(man1dir)/$(GCC_CROSS_NAME)$(manext); \
 	  $(INSTALL_DATA) $(srcdir)/gcc.1 $(man1dir)/$(GCC_CROSS_NAME)$(manext); \
@@ -2529,9 +2541,10 @@ install-man: installdirs $(srcdir)/gcc.1
 	fi
 	-rm -f $(man1dir)/cpp$(manext)
 	-$(INSTALL_DATA) $(srcdir)/cpp.1 $(man1dir)/cpp$(manext)
+	-chmod a-x $(man1dir)/cpp$(manext)
 	-rm -f $(man1dir)/gcov$(manext)
 	-$(INSTALL_DATA) $(srcdir)/gcov.1 $(man1dir)/gcov$(manext)
-	-chmod a-x $(man1dir)/cpp$(manext)
+	-chmod a-x $(man1dir)/gcov$(manext)

 # Install the library.
 install-libgcc: libgcc.a installdirs

-- 
Joseph S. Myers
jsm28@cam.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]