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]
Other format: [Raw text]

There can be only one version_string


This patch eliminates the Ada and Fortran private copies of
version_string; everyone now gets it from version.c.  (The datestamp
in bits/c++config remains.)  I have compiled all of the affected code;
a bootstrap is in progress.  The changes to update_version are
untested and I would appreciate a second pair of eyes on them.

My Ada-fu is weak; there is probably a better way of expressing the
changes to gnatvsn.ad[sb].  I just borrowed code from Interfaces.C.
I needed to change version_string from const char *const to const char[]
to make the Ada stuff work; this is also marginally more memory
efficient.  update_version should be fine with this.

No code anywhere refers to g77__[fiu]vers__ - arguably those files
could just be deleted, but I decided to be conservative.

I would like to apply this patch to mainline, as it will make
trunk->branch merges quite a bit easier.  Reactions?

Do I need to do anything special to get the new update_version
activated?

zw

gcc:
	* version.c (version_string): Now const char[].
	* version.h: Update to match.

gcc/ada:
	* Make-lang.in (EXTRA_GNATBIND_OBJS): Add version.o.
	* Makefile.in (TOOLS_LIBS): Add ../../version.o.
	* gnatvsn.ads: Gnat_Version_String is now a function.
	* gnatvsn.adb: New file.  When asked for Gnat_Version_String,
	copy the C version_string into a String and return it.
	* gnatcmd.adb, gnatkr.adb, gnatlbr.adb, gnatlink.adb,
	gnatls.adb,gnatmake.adb, gnatprep.adb, gnatpsta.adb:
	Remove pragma Ident (Gnat_Version_String).  If this was the
	sole use of package Gnatvsn, remove the with statement too.
	* gnat1drv.adb: Tweak -gnatv output.

gcc/f:
	* Make-lang.in (g77spec.o): Don't depend on f/version.h.
	(f/parse.o): Depend on version.h not f/version.h.
	(g77version.o, f/version.o): Delete all references.

	* com.c (ffecom_init_0): Fix transposed array indices in bsearch test.
	* g77spec.c: Don't include f/version.h or refer to ffe_version_string.
	* parse.c: Use version_string, not ffe_version_string.
	* version.c, version.h: Delete files.

libf2c:
	* libF77/Version.c: Rename junk to __LIBF77_VERSION__.  Add
	external decls for __LIBI77_VERSION__ and __LIBU77_VERSION__.
	Delete __G77_LIBF77_VERSION__
	(g77__fvers__): Print all three __LIB*77_VERSION__ strings,
	and __VERSION__ if we have it; nothing else.

	* libI77/Version.c: Provide only __LIBI77_VERSION__ (formerly junk).
	* libU77/Version.c: Provide only __LIBU77_VERSION__ (formerly junk).

maintainer-scripts:
	* update_version: Do not check in files which are unchanged.

===================================================================
Index: gcc/version.c
--- gcc/version.c	20 Sep 2002 07:17:11 -0000	1.1724
+++ gcc/version.c	20 Sep 2002 20:42:34 -0000
@@ -1,4 +1,4 @@
 #include "ansidecl.h"
 #include "version.h"
 
-const char *const version_string = "3.3 20020920 (experimental)";
+const char version_string[] = "3.3 20020920 (experimental)";
===================================================================
Index: gcc/version.h
--- gcc/version.h	26 May 2001 01:31:35 -0000	1.3
+++ gcc/version.h	20 Sep 2002 20:42:34 -0000
@@ -1,4 +1,4 @@
 #ifndef GCC_VERSION_H
 #define GCC_VERSION_H
-extern const char *const version_string;
+extern const char version_string[];
 #endif /* ! GCC_VERSION_H */
===================================================================
Index: gcc/ada/Make-lang.in
--- gcc/ada/Make-lang.in	13 Aug 2002 13:00:07 -0000	1.15
+++ gcc/ada/Make-lang.in	20 Sep 2002 20:42:35 -0000
@@ -181,7 +181,7 @@ GNATBIND_OBJS = \
 
 # List of extra object files linked in with various programs.
 EXTRA_GNAT1_OBJS = prefix.o
-EXTRA_GNATBIND_OBJS = prefix.o
+EXTRA_GNATBIND_OBJS = prefix.o version.o
 
 # FIXME: handle with configure substitutions
 #ifeq ($(strip $(filter-out alpha% dec vms% openvms% alphavms%,$(host))),)
===================================================================
Index: gcc/ada/Makefile.in
--- gcc/ada/Makefile.in	28 Jun 2002 06:35:13 -0000	1.35
+++ gcc/ada/Makefile.in	20 Sep 2002 20:42:35 -0000
@@ -248,8 +248,8 @@ LIBIBERTY = ../../libiberty/libiberty.a
 # and the system's installed libraries.
 LIBS = $(INTLLIBS) $(LIBIBERTY) $(SYSLIBS)
 LIBDEPS = $(INTLDEPS) $(LIBIBERTY)
-TOOLS_LIBS = ../../prefix.o $(LIBGNAT) ../../../libiberty/libiberty.a \
-	$(SYSLIBS)
+TOOLS_LIBS = ../../prefix.o ../../version.o $(LIBGNAT) \
+	../../../libiberty/libiberty.a $(SYSLIBS)
 
 # Specify the directories to be searched for header files.
 # Both . and srcdir are used, in that order,
===================================================================
Index: gcc/ada/gnat1drv.adb
--- gcc/ada/gnat1drv.adb	14 Mar 2002 10:59:23 -0000	1.4
+++ gcc/ada/gnat1drv.adb	20 Sep 2002 20:42:35 -0000
@@ -130,7 +130,8 @@ begin
          end if;
 
          Write_Str (Gnat_Version_String);
-         Write_Str (" Copyright 1992-2002 Free Software Foundation, Inc.");
+         Write_Eol;
+         Write_Str ("Copyright 1992-2002 Free Software Foundation, Inc.");
          Write_Eol;
       end if;
 
===================================================================
Index: gcc/ada/gnatcmd.adb
--- gcc/ada/gnatcmd.adb	14 Mar 2002 10:59:25 -0000	1.10
+++ gcc/ada/gnatcmd.adb	20 Sep 2002 20:42:36 -0000
@@ -57,7 +57,6 @@ with GNAT.OS_Lib;             use GNAT.O
 with Table;
 
 procedure GNATCmd is
-   pragma Ident (Gnatvsn.Gnat_Version_String);
 
    Ada_Include_Path : constant String := "ADA_INCLUDE_PATH";
    Ada_Objects_Path : constant String := "ADA_OBJECTS_PATH";
===================================================================
Index: gcc/ada/gnatkr.adb
--- gcc/ada/gnatkr.adb	14 Mar 2002 10:59:25 -0000	1.2
+++ gcc/ada/gnatkr.adb	20 Sep 2002 20:42:36 -0000
@@ -27,12 +27,10 @@
 
 with Ada.Characters.Handling; use Ada.Characters.Handling;
 with Ada.Command_Line;        use Ada.Command_Line;
-with Gnatvsn;
 with Krunch;
 with System.IO; use System.IO;
 
 procedure Gnatkr is
-   pragma Ident (Gnatvsn.Gnat_Version_String);
 
    Count        : Natural;
    Maxlen       : Integer;
===================================================================
Index: gcc/ada/gnatlbr.adb
--- gcc/ada/gnatlbr.adb	14 Mar 2002 10:59:25 -0000	1.3
+++ gcc/ada/gnatlbr.adb	20 Sep 2002 20:42:36 -0000
@@ -45,14 +45,12 @@
 with Ada.Command_Line;     use Ada.Command_Line;
 with Ada.Text_IO;          use Ada.Text_IO;
 with GNAT.OS_Lib;          use GNAT.OS_Lib;
-with Gnatvsn;              use Gnatvsn;
 with Interfaces.C_Streams; use Interfaces.C_Streams;
 with Osint;                use Osint;
 with Sdefault;             use Sdefault;
 with System;
 
 procedure GnatLbr is
-   pragma Ident (Gnat_Version_String);
 
    type Lib_Mode is (None, Create, Set, Delete);
    Next_Arg  : Integer;
===================================================================
Index: gcc/ada/gnatlink.adb
--- gcc/ada/gnatlink.adb	14 Mar 2002 10:59:25 -0000	1.4
+++ gcc/ada/gnatlink.adb	20 Sep 2002 20:42:37 -0000
@@ -45,8 +45,6 @@ with Interfaces.C_Streams; use Interface
 
 procedure Gnatlink is
 
-   pragma Ident (Gnat_Version_String);
-
    package Gcc_Linker_Options is new Table.Table (
      Table_Component_Type => String_Access,
      Table_Index_Type     => Integer,
===================================================================
Index: gcc/ada/gnatls.adb
--- gcc/ada/gnatls.adb	14 Mar 2002 10:59:25 -0000	1.5
+++ gcc/ada/gnatls.adb	20 Sep 2002 20:42:37 -0000
@@ -41,7 +41,6 @@ with Targparm;    use Targparm;
 with Types;       use Types;
 
 procedure Gnatls is
-   pragma Ident (Gnat_Version_String);
 
    Max_Column : constant := 80;
 
===================================================================
Index: gcc/ada/gnatmake.adb
--- gcc/ada/gnatmake.adb	14 Mar 2002 10:59:25 -0000	1.2
+++ gcc/ada/gnatmake.adb	20 Sep 2002 20:42:37 -0000
@@ -27,12 +27,9 @@
 
 --  Gnatmake usage: please consult the gnat documentation
 
-with Gnatvsn;
 with Make;
 
 procedure Gnatmake is
-   pragma Ident (Gnatvsn.Gnat_Version_String);
-
 begin
    --  The real work is done in Package Make. Gnatmake used to be a standalone
    --  routine. Now Gnatmake's facilities have been placed in a package
===================================================================
Index: gcc/ada/gnatprep.adb
--- gcc/ada/gnatprep.adb	14 Mar 2002 10:59:27 -0000	1.3
+++ gcc/ada/gnatprep.adb	20 Sep 2002 20:42:37 -0000
@@ -36,7 +36,6 @@ with GNAT.Command_Line;
 with Gnatvsn;
 
 procedure GNATprep is
-   pragma Ident (Gnatvsn.Gnat_Version_String);
 
    type Strptr is access String;
 
===================================================================
Index: gcc/ada/gnatpsta.adb
--- gcc/ada/gnatpsta.adb	14 Mar 2002 10:59:27 -0000	1.2
+++ gcc/ada/gnatpsta.adb	20 Sep 2002 20:42:37 -0000
@@ -34,13 +34,11 @@
 --  integer and floating point sizes.
 
 with Ada.Text_IO; use Ada.Text_IO;
-with Gnatvsn;
 with Ttypef;      use Ttypef;
 with Ttypes;      use Ttypes;
 with Types;       use Types;
 
 procedure GnatPsta is
-   pragma Ident (Gnatvsn.Gnat_Version_String);
 
    procedure P (Item : String) renames Ada.Text_IO.Put_Line;
 
===================================================================
Index: gcc/ada/gnatvsn.adb
--- gcc/ada/gnatvsn.adb	1 Jan 1970 00:00:00 -0000
+++ gcc/ada/gnatvsn.adb	20 Sep 2002 20:42:37 -0000
@@ -0,0 +1,82 @@
+------------------------------------------------------------------------------
+--                                                                          --
+--                         GNAT COMPILER COMPONENTS                         --
+--                                                                          --
+--                              G N A T V S N                               --
+--                                                                          --
+--                                 B o d y                                  --
+--                                                                          --
+--                                                                          --
+--          Copyright (C) 2002 Free Software Foundation, Inc.               --
+--                                                                          --
+-- GNAT is free software;  you can  redistribute it  and/or modify it under --
+-- terms of the  GNU General Public License as published  by the Free Soft- --
+-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
+-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
+-- for  more details.  You should have  received  a copy of the GNU General --
+-- Public License  distributed with GNAT;  see file COPYING.  If not, write --
+-- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
+-- MA 02111-1307, USA.                                                      --
+--                                                                          --
+-- As a special exception,  if other files  instantiate  generics from this --
+-- unit, or you link  this unit with other files  to produce an executable, --
+-- this  unit  does not  by itself cause  the resulting  executable  to  be --
+-- covered  by the  GNU  General  Public  License.  This exception does not --
+-- however invalidate  any other reasons why  the executable file  might be --
+-- covered by the  GNU Public License.                                      --
+--                                                                          --
+-- GNAT was originally developed  by the GNAT team at  New York University. --
+-- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+--                                                                          --
+------------------------------------------------------------------------------
+
+package body Gnatvsn is
+
+   --  Import the string constant defined in the (language-independent)
+   --  source file version.c.
+
+   --  The size is a lie; we have no way of writing the truth (the size
+   --  is variable and depends on the actual text of the constant).
+
+   --  FIXME: It should be possible to declare this to be a constant, but
+   --  that is rejected by the compiler ("invalid context for deferred
+   --  constant declaration").  Per Ada95 this constraint only applies to
+   --  deferred constants completed by a full constant declaration, not
+   --  deferred constants completed by a pragma Import.
+
+   Version_String : array (0 .. Ver_Len_Max) of aliased Character;
+   pragma Import (C, Version_String, "version_string");
+
+   --  Convert that string constant to an Ada String and return it.
+   --  This is essentially the same as the To_Ada routine in
+   --  Interfaces.C; that package is not linked into gnat1 so
+   --  we cannot use it.
+
+   function Gnat_Version_String return String
+   is
+      Count : Natural := 0;
+
+   begin
+      loop
+         if Version_String (Count) = Character'First then
+            exit;
+         else
+            Count := Count + 1;
+         end if;
+      end loop;
+
+      declare
+         R : String (1 .. Count);
+
+      begin
+         for J in R'Range loop
+            R (J) := Version_String (J - 1);
+         end loop;
+
+         return R;
+      end;
+   end Gnat_Version_String;
+
+end Gnatvsn;
===================================================================
Index: gcc/ada/gnatvsn.ads
--- gcc/ada/gnatvsn.ads	20 Sep 2002 07:17:12 -0000	1.122
+++ gcc/ada/gnatvsn.ads	20 Sep 2002 20:42:37 -0000
@@ -32,20 +32,16 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
---  This package spec holds version information for GNAT, GNATBIND and
---  GNATMAKE. It is updated whenever the release number is changed.
+--  This package spec exports version information for GNAT, GNATBIND and
+--  GNATMAKE.
 
 package Gnatvsn is
 
-   Gnat_Version_String : constant String := "3.3 20020920 (experimental)";
+   function Gnat_Version_String
+     return String;
    --  Version output when GNAT (compiler), or its related tools, including
    --  GNATBIND, GNATCHOP, GNATFIND, GNATLINK, GNATMAKE, GNATXREF, are run
    --  (with appropriate verbose option switch set).
-   --
-   --  WARNING: some scripts rely on the format of this string. Any change
-   --  must be coordinated with a script maintainer. Furthermore, no
-   --  other variable in this package may have a name starting with
-   --  Gnat_Version_String.
 
    Gnat_Version_Type : constant String := "FSF    ";
    --  This string is set to one of three values:
===================================================================
Index: gcc/f/Make-lang.in
--- gcc/f/Make-lang.in	22 Aug 2002 02:20:43 -0000	1.112
+++ gcc/f/Make-lang.in	20 Sep 2002 20:42:38 -0000
@@ -65,21 +65,17 @@ F77 f77: f771$(exeext)
   f77.extraclean f77.maintainer-clean f77.rebuilt \
   f77.stage1 f77.stage2 f77.stage3 f77.stage4
 
-g77spec.o: $(srcdir)/f/g77spec.c $(srcdir)/f/version.h $(SYSTEM_H) $(GCC_H) \
+g77spec.o: $(srcdir)/f/g77spec.c $(SYSTEM_H) $(GCC_H) \
 	$(CONFIG_H)
 	(SHLIB_LINK='$(SHLIB_LINK)' \
 	SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
 	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
 		$(INCLUDES) $(srcdir)/f/g77spec.c)
 
-g77version.o: $(srcdir)/f/version.c
-	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -o g77version.o \
-	    $(srcdir)/f/version.c
-
 # Create the compiler driver for g77.
-g77$(exeext): gcc.o g77spec.o g77version.o version.o prefix.o intl.o \
+g77$(exeext): gcc.o g77spec.o version.o prefix.o intl.o \
   $(LIBDEPS) $(EXTRA_GCC_OBJS)
-	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o g77spec.o g77version.o \
+	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o g77spec.o \
 	   version.o prefix.o intl.o $(EXTRA_GCC_OBJS) $(LIBS)
 
 # Create a version of the g77 driver which calls the cross-compiler.
@@ -93,7 +89,7 @@ F77_OBJS = f/bad.o f/bit.o f/bld.o f/com
  f/global.o f/implic.o f/info.o f/intrin.o f/lab.o f/lex.o f/malloc.o \
  f/name.o f/parse.o f/src.o f/st.o f/sta.o f/stb.o f/stc.o \
  f/std.o f/ste.o f/storag.o f/stp.o f/str.o f/sts.o f/stt.o f/stu.o \
- f/stv.o f/stw.o f/symbol.o f/target.o f/top.o f/type.o f/version.o f/where.o
+ f/stv.o f/stw.o f/symbol.o f/target.o f/top.o f/type.o f/where.o
 
 # Use loose warnings for this front end.
 f-warn =
@@ -321,7 +317,7 @@ f77.mostlyclean:
 	-rm -f g77.aux g77.cps g77.ky g77.toc g77.vr g77.fn g77.kys \
 	       g77.pg g77.tp g77.vrs g77.cp g77.fns g77.log g77.pgs g77.tps 
 f77.clean:
-	-rm -f g77spec.o g77version.o
+	-rm -f g77spec.o
 f77.distclean:
 	-rm -f f/Makefile
 f77.extraclean:
@@ -332,7 +328,7 @@ f77.maintainer-clean:
 # The main makefile has already created stage?/f.
 
 G77STAGESTUFF = f/*$(objext) f/fini$(build_exeext) f/stamp-str \
-  f/str-*.h f/str-*.j g77spec.o g77version.o
+  f/str-*.h f/str-*.j g77spec.o
 
 f77.stage1: stage1-start
 	-mv -f $(G77STAGESTUFF) stage1/f
@@ -425,7 +421,7 @@ f/parse.o: f/parse.c f/proj.h $(CONFIG_H
  f/where.h glimits.h f/com.h f/com-rt.def $(TREE_H) f/bld.h f/bld-op.def \
  f/bit.h f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h \
  f/bad.def f/lex.h f/type.h f/intrin.h f/intrin.def f/lab.h f/symbol.h \
- f/symbol.def f/equiv.h f/storag.h f/global.h f/name.h f/version.h flags.h
+ f/symbol.def f/equiv.h f/storag.h f/global.h f/name.h version.h flags.h
 f/src.o: f/src.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/src.h f/bad.h f/bad.def \
  f/where.h glimits.h f/top.h f/malloc.h
 f/st.o: f/st.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/st.h f/bad.h f/bad.def \
@@ -527,6 +523,5 @@ f/top.o: f/top.c f/proj.h $(CONFIG_H) $(
  f/intrin.def f/data.h f/expr.h f/implic.h f/src.h f/st.h flags.h \
  toplev.h
 f/type.o: f/type.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/type.h f/malloc.h
-f/version.o: f/version.c f/version.h
 f/where.o: f/where.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/where.h glimits.h f/top.h \
  f/malloc.h f/lex.h $(GGC_H) gt-f-where.h
===================================================================
Index: gcc/f/com.c
--- gcc/f/com.c	16 Sep 2002 18:33:22 -0000	1.179
+++ gcc/f/com.c	20 Sep 2002 20:42:41 -0000
@@ -11124,7 +11124,7 @@ ffecom_init_0 ()
 
       name = bsearch ("foo", &names[0], ARRAY_SIZE (names), sizeof (names[0]),
 		      (int (*)(const void *, const void *)) strcmp);
-      if (name != &names[0][2])
+      if (name != &names[2][0])
 	{
 	  assert ("bsearch doesn't work, #define FFEPROJ_BSEARCH 0 in proj.h"
 		  == NULL);
===================================================================
Index: gcc/f/g77spec.c
--- gcc/f/g77spec.c	31 Jan 2002 19:36:24 -0000	1.37
+++ gcc/f/g77spec.c	20 Sep 2002 20:42:41 -0000
@@ -47,7 +47,6 @@ Boston, MA 02111-1307, USA.  */
 #include "config.h"
 #include "system.h"
 #include "gcc.h"
-#include <f/version.h>
 
 #ifndef MATH_LIBRARY
 #define MATH_LIBRARY "-lm"
@@ -374,7 +373,7 @@ lang_specific_driver (in_argc, in_argv, 
 
 	case OPTION_version:
 	  printf ("\
-GNU Fortran (GCC %s) %s\n\
+GNU Fortran (GCC) %s\n\
 Copyright (C) 2002 Free Software Foundation, Inc.\n\
 \n\
 GNU Fortran comes with NO WARRANTY, to the extent permitted by law.\n\
@@ -382,7 +381,7 @@ You may redistribute copies of GNU Fortr
 under the terms of the GNU General Public License.\n\
 For more information about these matters, see the file named COPYING\n\
 or type the command `info -f g77 Copying'.\n\
-", version_string, ffe_version_string);
+", version_string);
 	  exit (0);
 	  break;
 
===================================================================
Index: gcc/f/parse.c
--- gcc/f/parse.c	25 Apr 2002 06:24:39 -0000	1.12
+++ gcc/f/parse.c	20 Sep 2002 20:42:41 -0000
@@ -35,7 +35,7 @@ ffe_parse_file (set_yydebug)
   ffewhereFile wf;
 
   if (ffe_is_version ())
-    fprintf (stderr, "GNU Fortran Front End version %s\n", ffe_version_string);
+    fprintf (stderr, "GNU Fortran Front End version %s\n", version_string);
 
   if (!ffe_is_pedantic ())
     ffe_set_is_pedantic (pedantic);
===================================================================
Index: gcc/f/version.c
--- gcc/f/version.c	20 Sep 2002 07:17:12 -0000	1.1214
+++ gcc/f/version.c	1 Jan 1970 00:00:00 -0000
@@ -1,4 +0,0 @@
-#include "ansidecl.h"
-#include "f/version.h"
-
-const char *const ffe_version_string = "3.3 20020920 (experimental)";
===================================================================
Index: gcc/f/version.h
--- gcc/f/version.h	12 Sep 2001 16:52:42 -0000	1.6
+++ gcc/f/version.h	1 Jan 1970 00:00:00 -0000
@@ -1,6 +0,0 @@
-#ifndef GCC_F_VERSION_H
-#define GCC_F_VERSION_H
-
-extern const char *const ffe_version_string;
-
-#endif /* ! GCC_F_VERSION_H */
===================================================================
Index: libf2c/libF77/Version.c
--- libf2c/libF77/Version.c	20 Sep 2002 07:17:12 -0000	1.1182
+++ libf2c/libF77/Version.c	20 Sep 2002 20:42:42 -0000
@@ -1,9 +1,6 @@
-static char junk[] = "\n@(#)LIBF77 VERSION 20000929\n";
-
-/*
-*/
-
-char __G77_LIBF77_VERSION__[] = "3.3 20020920 (experimental)";
+const char __LIBF77_VERSION__[] = "@(#) LIBF77 VERSION 20000929\n";
+extern const char __LIBI77_VERSION__[];
+extern const char __LIBU77_VERSION__[];
 
 /*
 2.00	11 June 1980.  File version.c added to library.
@@ -87,6 +84,11 @@ char __G77_LIBF77_VERSION__[] = "3.3 200
 void
 g77__fvers__ ()
 {
-  fprintf (stderr, "__G77_LIBF77_VERSION__: %s", __G77_LIBF77_VERSION__);
-  fputs (junk, stderr);
+  fputs ("GNU Fortran library.\n", stderr);
+#if defined __GNUC__ && defined __VERSION__
+  fprintf (stderr, "Compiled by GCC %s\n", __VERSION__);
+#endif
+  fputs (__LIBF77_VERSION__, stderr);
+  fputs (__LIBI77_VERSION__, stderr);
+  fputs (__LIBU77_VERSION__, stderr);
 }
===================================================================
Index: libf2c/libI77/Version.c
--- libf2c/libI77/Version.c	20 Sep 2002 07:17:13 -0000	1.1189
+++ libf2c/libI77/Version.c	20 Sep 2002 20:42:43 -0000
@@ -1,9 +1,4 @@
-static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 20001205\n";
-
-/*
-*/
-
-char __G77_LIBI77_VERSION__[] = "3.3 20020920 (experimental)";
+const char __LIBI77_VERSION__[] = "@(#) LIBI77 VERSION pjw,dmg-mods 20001205\n";
 
 /*
 2.01	$ format added
@@ -324,17 +319,6 @@ wrtfmt.c:
 /*		treat Tstuff= and Fstuff= as new assignments rather than as */
 /*		logical constants. */
 
-
-
 /* Changes for GNU Fortran (g77) version of libf2c:  */
 
 /* 17 June 1997: detect recursive I/O and call f__fatal explaining it. */
-
-#include <stdio.h>
-
-void
-g77__ivers__ ()
-{
-  fprintf (stderr, "__G77_LIBI77_VERSION__: %s", __G77_LIBI77_VERSION__);
-  fputs (junk, stderr);
-}
===================================================================
Index: libf2c/libU77/Version.c
--- libf2c/libU77/Version.c	20 Sep 2002 07:17:13 -0000	1.1181
+++ libf2c/libU77/Version.c	20 Sep 2002 20:42:43 -0000
@@ -1,12 +1 @@
-static char junk[] = "\n@(#) LIBU77 VERSION 19980709\n";
-
-char __G77_LIBU77_VERSION__[] = "3.3 20020920 (experimental)";
-
-#include <stdio.h>
-
-void
-g77__uvers__ ()
-{
-  fprintf (stderr, "__G77_LIBU77_VERSION__: %s", __G77_LIBU77_VERSION__);
-  fputs (junk, stderr);
-}
+const char __LIBU77_VERSION__[] = "@(#) LIBU77 VERSION 19980709\n";
===================================================================
Index: maintainer-scripts/update_version
--- maintainer-scripts/update_version	27 May 2002 07:33:05 -0000	1.7
+++ maintainer-scripts/update_version	20 Sep 2002 20:42:44 -0000
@@ -45,23 +45,29 @@ for BRANCH in $BRANCHES; do
 
   for file in $textstring_FILES; do
     if test -f $file; then 
-      OLD_VERSION=`/bin/cat $file`
-      /bin/sed -e "s/\(.*\"[^ ]*\) [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/\1 ${CURR_DATE}/" >${file} <<HERE
-$OLD_VERSION
-HERE
+      /bin/sed  <$file >$file.new -e \
+  "s/\(.*\"[^ ]*\) [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/\1 ${CURR_DATE}/" 
 
-      COMMIT_FILES="$COMMIT_FILES $file"
+      if /usr/bin/cmp -s $file $file.new; then
+	rm -f $file.new
+      else
+	mv -f $file.new $file
+        COMMIT_FILES="$COMMIT_FILES $file"
+      fi
     fi
   done
 
   for file in $cppdefine_FILES; do
-    if test -f $file; then 
-      OLD_VERSION=`/bin/cat $file`
-      /bin/sed -e "s/\(#.*\) [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/\1 ${CURR_DATE}/" >${file} <<HERE
-$OLD_VERSION
-HERE
+    if test -f $file; then
+      /bin/sed <$file >$file.new -e \
+  "s/\(#.*\) [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/\1 ${CURR_DATE}/"
 
-      COMMIT_FILES="$COMMIT_FILES $file"
+      if /usr/bin/cmp -s $file $file.new; then
+	rm -f $file.new
+      else
+	mv -f $file.new $file
+        COMMIT_FILES="$COMMIT_FILES $file"
+      fi
     fi
   done
 


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