From 6ed6122606e553c2adefca5b85dc1dd3d36cb134 Mon Sep 17 00:00:00 2001
From: Jesse Thilo <jthilo@gnu.org>
Date: Mon, 14 Jun 1999 22:22:25 +0000
Subject: [PATCH] Have configure build version string instead of relying on
 ANSI string concatentation.

---
 acconfig.h      | 3 +++
 configure.in    | 1 +
 src/Makefile.am | 3 +--
 src/getargs.c   | 3 +--
 src/reader.c    | 4 +---
 src/version.c   | 5 -----
 6 files changed, 7 insertions(+), 12 deletions(-)
 delete mode 100644 src/version.c

diff --git a/acconfig.h b/acconfig.h
index d8b432aa..0218c127 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -8,6 +8,9 @@
 /* Version of package.  */
 #undef VERSION
 
+/* Version string.  */
+#undef VERSION_STRING
+
 /* Define if the compiler understands prototypes.  */
 #undef PROTOTYPES
 
diff --git a/configure.in b/configure.in
index cd302681..3b810f88 100644
--- a/configure.in
+++ b/configure.in
@@ -39,6 +39,7 @@ AM_GNU_GETTEXT
 # the ANSI2KNR-filtering rules.
 LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
 
+AC_DEFINE_UNQUOTED(VERSION_STRING, "GNU Bison version ${VERSION}")
 XPFILE="${datadir}/bison.simple"
 BISON_DEFINE_FILE(XPFILE, XPFILE)
 XPFILE1="${datadir}/bison.hairy"
diff --git a/src/Makefile.am b/src/Makefile.am
index 2284284a..71b8759c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,8 +5,7 @@ bin_PROGRAMS = bison
 
 bison_SOURCES = LR0.c allocate.c closure.c conflicts.c derives.c	\
     files.c getargs.c gram.c lalr.c lex.c main.c nullable.c output.c	\
-    print.c reader.c reduce.c symtab.c warshall.c version.c getopt.c	\
-    getopt1.c
+    print.c reader.c reduce.c symtab.c warshall.c getopt.c getopt1.c
 
 EXTRA_bison_SOURCES = vmsgetargs.c
 
diff --git a/src/getargs.c b/src/getargs.c
index e337a54b..ee1a03a7 100644
--- a/src/getargs.c
+++ b/src/getargs.c
@@ -39,7 +39,6 @@ void usage PARAMS((FILE *));
 void getargs PARAMS((int, char *[]));
 
 extern char *program_name;
-extern char *version_string;
 
 extern void warns PARAMS((char *, char *));	/* main.c */
 
@@ -108,7 +107,7 @@ getargs (int argc, char *argv[])
 	  exit (0);
 
 	case 'V':
-	  printf ("%s", version_string);
+	  printf ("%s\n", VERSION_STRING);
 	  exit (0);
 	  
 	case 'v':
diff --git a/src/reader.c b/src/reader.c
index 54f03400..e67a1189 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -136,8 +136,6 @@ static bucket *undeftoken;
 /* Nonzero if any action or guard uses the @n construct.  */
 static int yylsp_needed;
 
-extern char *version_string;
-
 
 static void
 skip_to_char (int target)
@@ -209,7 +207,7 @@ reader (void)
 		infile);
   else
     fprintf(ftable, "\n/*  A Bison parser, made from %s\n", infile);
-  fprintf(ftable, " by  %s  */\n\n", version_string);
+  fprintf(ftable, "    by %s  */\n\n", VERSION_STRING);
   fprintf(ftable, "#define YYBISON 1  /* Identify Bison output.  */\n\n");
   read_declarations();
   /* start writing the guard and action files, if they are needed.  */
diff --git a/src/version.c b/src/version.c
deleted file mode 100644
index 61596f91..00000000
--- a/src/version.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-char *version_string = "GNU Bison version " VERSION "\n";
-- 
2.47.2