From 7f9766e49a1f3c833b8bb9feca7f0a54483a7031 Mon Sep 17 00:00:00 2001
From: Joseph Myers <joseph@codesourcery.com>
Date: Tue, 1 Apr 2008 17:38:56 +0100
Subject: [PATCH] texi2pod.pl: Handle @samp and @url inside verbatim blocks.

contrib:
	* texi2pod.pl: Handle @samp and @url inside verbatim blocks.
	Handle @heading.  Handle enumerated lists with starting numbers
	and extra headings.

gcc:
	* doc/include/gpl_v3.texi: Update for manpage generation.
	* doc/gcc.texi, doc/gccint.texi: Include gpl_v3.texi instead of
	gpl.texi.
	* doc/sourcebuild.texi: Document gpl_v3.texi as well as gpl.texi.
	* Makefile.in (TEXI_GCC_FILES, TEXI_GCCINT_FILES): Include
	gpl_v3.texi instead of gpl.texi.
	(gpl.pod): New.

gcc/fortran:
	* gfortran.texi: Include gpl_v3.texi instead of gpl.texi
	* Make-lang.in (GFORTRAN_TEXI): Include gpl_v3.texi instead of
	gpl.texi.

gcc/java:
	* gcj.texi: Include gpl_v3.texi instead of gpl.texi
	* Make-lang.in (TEXI_JAVA_FILES): Include gpl_v3.texi instead of
	gpl.texi.

From-SVN: r133794
---
 contrib/ChangeLog           |  6 ++++++
 contrib/texi2pod.pl         | 16 ++++++++++++----
 gcc/ChangeLog               | 10 ++++++++++
 gcc/Makefile.in             |  7 +++++--
 gcc/doc/gcc.texi            |  2 +-
 gcc/doc/gccint.texi         |  2 +-
 gcc/doc/include/gpl_v3.texi | 16 ++++++++++++++++
 gcc/doc/sourcebuild.texi    |  1 +
 gcc/fortran/ChangeLog       |  6 ++++++
 gcc/fortran/Make-lang.in    |  2 +-
 gcc/fortran/gfortran.texi   |  2 +-
 gcc/java/ChangeLog          |  6 ++++++
 gcc/java/Make-lang.in       |  2 +-
 gcc/java/gcj.texi           |  2 +-
 14 files changed, 68 insertions(+), 12 deletions(-)

diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 88cf772b96e1..e763771b802e 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-01  Joseph Myers  <joseph@codesourcery.com>
+
+	* texi2pod.pl: Handle @samp and @url inside verbatim blocks.
+	Handle @heading.  Handle enumerated lists with starting numbers
+	and extra headings.
+
 2008-03-10  Janis Johnson  <janis187@us.ibm.com>
 
 	* patch_tester.sh (initialization): Initialize svnpatch and stop.
diff --git a/contrib/texi2pod.pl b/contrib/texi2pod.pl
index 3931e1ce3e20..fcdc14550bae 100755
--- a/contrib/texi2pod.pl
+++ b/contrib/texi2pod.pl
@@ -218,9 +218,11 @@ while(<$inf>) {
     s/\@\}/&rbrace;/g;
     s/\@\@/&at;/g;
 
-    # Inside a verbatim block, handle @var specially.
+    # Inside a verbatim block, handle @var, @samp and @url specially.
     if ($shift ne "") {
 	s/\@var\{([^\}]*)\}/<$1>/g;
+	s/\@samp\{([^\}]*)\}/"$1"/g;
+	s/\@url\{([^\}]*)\}/<$1>/g;
     }
 
     # POD doesn't interpret E<> inside a verbatim block.
@@ -250,7 +252,7 @@ while(<$inf>) {
 	next;
     };
 
-    /^\@(?:section|unnumbered|unnumberedsec|center)\s+(.+)$/
+    /^\@(?:section|unnumbered|unnumberedsec|center|heading)\s+(.+)$/
 	and $_ = "\n=head2 $1\n";
     /^\@subsection\s+(.+)$/
 	and $_ = "\n=head3 $1\n";
@@ -321,8 +323,14 @@ while(<$inf>) {
     /^\@itemx?\s*(.+)?$/ and do {
 	if (defined $1) {
             if ($ic) {
-                # Entity escapes prevent munging by the <> processing below.
-                $_ = "\n=item $ic\&LT;$1\&GT;\n";
+		if ($endw eq "enumerate") {
+		    $_ = "\n=item $ic $1\n";
+		    $ic =~ s/(\d+)/$1 + 1/eg;
+		} else {
+		    # Entity escapes prevent munging by the <>
+		    # processing below.
+		    $_ = "\n=item $ic\&LT;$1\&GT;\n";
+		}
             } else {
                 $_ = "\n=item $1\n";
             }
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0ba7058737f0..444f34297c49 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2008-04-01  Joseph Myers  <joseph@codesourcery.com>
+
+	* doc/include/gpl_v3.texi: Update for manpage generation.
+	* doc/gcc.texi, doc/gccint.texi: Include gpl_v3.texi instead of
+	gpl.texi.
+	* doc/sourcebuild.texi: Document gpl_v3.texi as well as gpl.texi.
+	* Makefile.in (TEXI_GCC_FILES, TEXI_GCCINT_FILES): Include
+	gpl_v3.texi instead of gpl.texi.
+	(gpl.pod): New.
+
 2008-04-01  Jakub Jelinek  <jakub@redhat.com>
 
 	PR pch/13675
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 407e2fefdbde..7e3e028c8744 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3638,7 +3638,7 @@ TEXI_CPP_FILES = cpp.texi fdl.texi cppenv.texi cppopts.texi		\
 TEXI_GCC_FILES = gcc.texi gcc-common.texi gcc-vers.texi frontends.texi	\
 	 standards.texi invoke.texi extend.texi md.texi objc.texi	\
 	 gcov.texi trouble.texi bugreport.texi service.texi		\
-	 contribute.texi compat.texi funding.texi gnu.texi gpl.texi	\
+	 contribute.texi compat.texi funding.texi gnu.texi gpl_v3.texi	\
 	 fdl.texi contrib.texi cppenv.texi cppopts.texi			\
 	 implement-c.texi arm-neon-intrinsics.texi
 
@@ -3647,7 +3647,7 @@ TEXI_GCCINT_FILES = gccint.texi gcc-common.texi gcc-vers.texi		\
 	 portability.texi interface.texi passes.texi c-tree.texi	\
 	 rtl.texi md.texi tm.texi hostconfig.texi fragments.texi	\
 	 configfiles.texi collect2.texi headerdirs.texi funding.texi	\
-	 gnu.texi gpl.texi fdl.texi contrib.texi languages.texi		\
+	 gnu.texi gpl_v3.texi fdl.texi contrib.texi languages.texi	\
 	 sourcebuild.texi gty.texi libgcc.texi cfg.texi tree-ssa.texi	\
 	 loop.texi
 
@@ -3798,6 +3798,9 @@ gfdl.pod: fdl.texi
 fsf-funding.pod: funding.texi
 	$(STAMP) $@
 	-$(TEXI2POD) $< > $@
+gpl.pod: gpl_v3.texi
+	$(STAMP) $@
+	-$(TEXI2POD) $< > $@
 
 #
 # Deletion of files made during compilation.
diff --git a/gcc/doc/gcc.texi b/gcc/doc/gcc.texi
index e52d79a65438..baf4173c7871 100644
--- a/gcc/doc/gcc.texi
+++ b/gcc/doc/gcc.texi
@@ -170,7 +170,7 @@ Introduction, gccint, GNU Compiler Collection (GCC) Internals}.
 
 @include funding.texi
 @include gnu.texi
-@include gpl.texi
+@include gpl_v3.texi
 
 @c ---------------------------------------------------------------------
 @c GFDL
diff --git a/gcc/doc/gccint.texi b/gcc/doc/gccint.texi
index 2f699472f5b6..47e02214f098 100644
--- a/gcc/doc/gccint.texi
+++ b/gcc/doc/gccint.texi
@@ -156,7 +156,7 @@ Additional tutorial information is linked to from
 
 @include funding.texi
 @include gnu.texi
-@include gpl.texi
+@include gpl_v3.texi
 
 @c ---------------------------------------------------------------------
 @c GFDL
diff --git a/gcc/doc/include/gpl_v3.texi b/gcc/doc/include/gpl_v3.texi
index 6e7ea63fefe7..318067773668 100644
--- a/gcc/doc/include/gpl_v3.texi
+++ b/gcc/doc/include/gpl_v3.texi
@@ -1,4 +1,19 @@
+@ignore
+@c Set file name and title for man page.
+@setfilename gpl
+@settitle GNU General Public License
+@c man begin SEEALSO
+gfdl(7), fsf-funding(7).
+@c man end
+@c man begin COPYRIGHT
+Copyright @copyright{} 2007 Free Software Foundation, Inc.
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+@c man end
+@end ignore
 @node Copying
+@c man begin DESCRIPTION
 @unnumbered GNU General Public License
 @center Version 3, 29 June 2007
 
@@ -715,3 +730,4 @@ library, you may consider it more useful to permit linking proprietary
 applications with the library.  If this is what you want to do, use
 the GNU Lesser General Public License instead of this License.  But
 first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.
+@c man end
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index d4b775345676..7db367453fd8 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -340,6 +340,7 @@ The section ``Funding Free Software''.
 @item gcc-common.texi
 Common definitions for manuals.
 @item gpl.texi
+@itemx gpl_v3.texi
 The GNU General Public License.
 @item texinfo.tex
 A copy of @file{texinfo.tex} known to work with the GCC manuals.
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index b56aa730e68e..cd69cbaad67f 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-01  Joseph Myers  <joseph@codesourcery.com>
+
+	* gfortran.texi: Include gpl_v3.texi instead of gpl.texi
+	* Make-lang.in (GFORTRAN_TEXI): Include gpl_v3.texi instead of
+	gpl.texi.
+
 2008-03-30  Paul Thomas  <pault@gcc.gnu.org>
 
 	PR fortran/35740
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index 1702b9f124f1..378e394bbf9a 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -149,7 +149,7 @@ GFORTRAN_TEXI = \
   $(srcdir)/fortran/intrinsic.texi \
   $(srcdir)/fortran/invoke.texi \
   $(srcdir)/doc/include/fdl.texi \
-  $(srcdir)/doc/include/gpl.texi \
+  $(srcdir)/doc/include/gpl_v3.texi \
   $(srcdir)/doc/include/funding.texi \
   $(srcdir)/doc/include/gcc-common.texi \
   gcc-vers.texi
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index afbfe03317f6..085de7668dab 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -1933,7 +1933,7 @@ Environment variable forcing standard output to be line buffered (unix).
 @c GNU General Public License
 @c ---------------------------------------------------------------------
 
-@include gpl.texi
+@include gpl_v3.texi
 
 
 
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 5af91ac94302..2c2c35e03d4f 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-01  Joseph Myers  <joseph@codesourcery.com>
+
+	* gcj.texi: Include gpl_v3.texi instead of gpl.texi
+	* Make-lang.in (TEXI_JAVA_FILES): Include gpl_v3.texi instead of
+	gpl.texi.
+
 2008-03-27  Tom Tromey  <tromey@redhat.com>
 
 	* Make-lang.in: Revert automatic dependency patch.
diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in
index bfb57a3b59b9..8c6ce3e204f4 100644
--- a/gcc/java/Make-lang.in
+++ b/gcc/java/Make-lang.in
@@ -311,7 +311,7 @@ java/jcf-path.o: java/jcf-path.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
 	  $(srcdir)/java/jcf-path.c $(OUTPUT_OPTION)
 
 TEXI_JAVA_FILES = java/gcj.texi $(gcc_docdir)/include/fdl.texi		\
-	 $(gcc_docdir)/include/gpl.texi $(gcc_docdir)/include/gcc-common.texi   \
+	 $(gcc_docdir)/include/gpl_v3.texi $(gcc_docdir)/include/gcc-common.texi   \
 	 gcc-vers.texi
 
 # Documentation
diff --git a/gcc/java/gcj.texi b/gcc/java/gcj.texi
index f5df9d943e78..40e1cd6c10bf 100644
--- a/gcc/java/gcj.texi
+++ b/gcc/java/gcj.texi
@@ -122,7 +122,7 @@ files and object files, and it can read both Java source code and
 @end menu
 
 
-@include gpl.texi
+@include gpl_v3.texi
 
 @include fdl.texi
 
-- 
GitLab