#! /bin/sh -e

# DP: versioned gpc names

if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;;
    -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;;
    *)
	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
	exit 1
esac
exit 0

--- src-old/gcc/p/doc/en/gpc.texi	Mon Oct  9 09:32:26 2000
+++ src-native/gcc/p/doc/en/gpc.texi	Tue Dec 19 21:04:21 2000
@@ -28,11 +28,11 @@
 
 @dircategory GNU programming tools
 @direntry
-* GPC: (gpc).                   The GNU Pascal Compiler.
+* GPC-2.1-3.3: (gpc-2.1-3.3).           The GNU Pascal Compiler.
 @end direntry
 @dircategory Individual utilities
 @direntry
-* GPC: (gpc)Invoking GPC.       The GNU Pascal Compiler.
+* GPC-2.1-3.3: (gpc-2.1-3.3)Invoking GPC. The GNU Pascal Compiler.
 @end direntry
 
 @c Version numbers appear twice: in lowercase and capitalized for headlines.

--- src/gcc/p/Make-lang.in~	2003-08-31 10:13:01.000000000 +0200
+++ src/gcc/p/Make-lang.in	2003-08-31 10:20:51.000000000 +0200
@@ -711,42 +711,42 @@
 pascal.start.encap:
 pascal.rest.encap:
 
-pascal.info: $(srcdir)/p/doc/info/gpc.info \
-             $(srcdir)/p/doc/info/gpcs.info \
-             $(srcdir)/p/doc/info/gpcs-de.info \
-             $(srcdir)/p/doc/info/gpc-hr.info \
-             $(srcdir)/p/doc/info/gpcs-hr.info \
-             $(srcdir)/p/doc/info/gpc-es.info \
-             $(srcdir)/p/doc/info/gpcs-es.info
+pascal.info: $(srcdir)/p/doc/info/gpc-2.1$(iv).info \
+             $(srcdir)/p/doc/info/gpcs-2.1$(iv).info \
+             $(srcdir)/p/doc/info/gpcs-de-2.1$(iv).info \
+             $(srcdir)/p/doc/info/gpc-hr-2.1$(iv).info \
+             $(srcdir)/p/doc/info/gpcs-hr-2.1$(iv).info \
+             $(srcdir)/p/doc/info/gpc-es-2.1$(iv).info \
+             $(srcdir)/p/doc/info/gpcs-es-2.1$(iv).info
 pascal.dvi: gpc.dvi
 
-$(srcdir)/p/doc/info/gpc.info: $(GPC_TEXI_EN)
+$(srcdir)/p/doc/info/gpc-2.1$(iv).info: $(GPC_TEXI_EN)
 	[ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info"
-	$(MAKEINFO_EN) -o $(srcdir)/p/doc/info/gpc.info gpc.texi
+	$(MAKEINFO_EN) -o $(srcdir)/p/doc/info/gpc-2.1$(iv).info gpc.texi
 
-$(srcdir)/p/doc/info/gpcs.info: $(GPC_TEXI_EN)
+$(srcdir)/p/doc/info/gpcs-2.1$(iv).info: $(GPC_TEXI_EN)
 	[ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info"
-	$(MAKEINFO_EN) --no-split -o $(srcdir)/p/doc/info/gpcs.info gpcs.texi
+	$(MAKEINFO_EN) --no-split -o $(srcdir)/p/doc/info/gpcs-2.1$(iv).info gpcs.texi
 
-$(srcdir)/p/doc/info/gpcs-de.info: $(GPC_TEXI_DE)
+$(srcdir)/p/doc/info/gpcs-de-2.1$(iv).info: $(GPC_TEXI_DE)
 	[ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info"
-	$(MAKEINFO_DE) --no-split -o $(srcdir)/p/doc/info/gpcs-de.info gpcs.texi
+	$(MAKEINFO_DE) --no-split -o $(srcdir)/p/doc/info/gpcs-de-2.1$(iv).info gpcs.texi
 
-$(srcdir)/p/doc/info/gpc-hr.info: $(GPC_TEXI_HR)
+$(srcdir)/p/doc/info/gpc-hr-2.1$(iv).info: $(GPC_TEXI_HR)
 	[ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info"
-	$(MAKEINFO_HR) -o $(srcdir)/p/doc/info/gpc-hr.info gpc.texi
+	$(MAKEINFO_HR) -o $(srcdir)/p/doc/info/gpc-hr-2.1$(iv).info gpc.texi
 
-$(srcdir)/p/doc/info/gpcs-hr.info: $(GPC_TEXI_HR)
+$(srcdir)/p/doc/info/gpcs-hr-2.1$(iv).info: $(GPC_TEXI_HR)
 	[ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info"
-	$(MAKEINFO_HR) --no-split -o $(srcdir)/p/doc/info/gpcs-hr.info gpcs.texi
+	$(MAKEINFO_HR) --no-split -o $(srcdir)/p/doc/info/gpcs-hr-2.1$(iv).info gpcs.texi
 
-$(srcdir)/p/doc/info/gpc-es.info: $(GPC_TEXI_ES)
+$(srcdir)/p/doc/info/gpc-es-2.1$(iv).info: $(GPC_TEXI_ES)
 	[ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info"
-	$(MAKEINFO_ES) -o $(srcdir)/p/doc/info/gpc-es.info gpc.texi
+	$(MAKEINFO_ES) -o $(srcdir)/p/doc/info/gpc-es-2.1$(iv).info gpc.texi
 
-$(srcdir)/p/doc/info/gpcs-es.info: $(GPC_TEXI_ES)
+$(srcdir)/p/doc/info/gpcs-es-2.1$(iv).info: $(GPC_TEXI_ES)
 	[ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info"
-	$(MAKEINFO_ES) --no-split -o $(srcdir)/p/doc/info/gpcs-es.info gpcs.texi
+	$(MAKEINFO_ES) --no-split -o $(srcdir)/p/doc/info/gpcs-es-2.1$(iv).info gpcs.texi
 
 gpc.dvi: $(GPC_TEXI_EN)
 	TEXINPUTS=$(srcdir)/p/doc:$(srcdir)/p/doc/images:$$TEXINPUTS \
@@ -942,11 +942,11 @@
 	fi
 
 pascal.install-info: pascal.install-info-man-dirs pascal.info
-	rm -f $(DESTDIR)$(infodir)/gpc.info* $(DESTDIR)$(infodir)/gpcs.info* $(DESTDIR)$(infodir)/gpcs-de.info* $(DESTDIR)$(infodir)/gpcs-hr.info* $(DESTDIR)$(infodir)/gpcs-es.info*
-	for f in `cd $(srcdir)/p/doc/info && echo gpc.info* gpcs*.info*`; do \
+	rm -f $(DESTDIR)$(infodir)/gpc*.info* $(DESTDIR)$(infodir)/gpcs*.info* $(DESTDIR)$(infodir)/gpcs-de*.info* $(DESTDIR)$(infodir)/gpcs-hr*.info* $(DESTDIR)$(infodir)/gpcs-es*.info*
+	for f in `cd $(srcdir)/p/doc/info && echo gpc-2.1$(iv).info* gpcs*.info*`; do \
 	  $(INSTALL_DATA) $(srcdir)/p/doc/info/$$f $(DESTDIR)$(infodir)/$$f || exit 1; \
 	done
-	chmod a-x $(DESTDIR)$(infodir)/gpc.info* $(DESTDIR)$(infodir)/gpcs.info* $(DESTDIR)$(infodir)/gpcs-de.info* $(DESTDIR)$(infodir)/gpcs-hr.info* $(DESTDIR)$(infodir)/gpcs-es.info*
+	chmod a-x $(DESTDIR)$(infodir)/gpc*.info* $(DESTDIR)$(infodir)/gpcs*.info* $(DESTDIR)$(infodir)/gpcs-de*.info* $(DESTDIR)$(infodir)/gpcs-hr*.info* $(DESTDIR)$(infodir)/gpcs-es*.info*
 
 pascal.install-man: pascal.install-info-man-dirs $(srcdir)/p/doc/en/gpc.1 $(srcdir)/p/doc/generated/gpc-run.1
 	-if [ -f gpc1$(exeext) ]; then \
