aboutsummaryrefslogtreecommitdiff
path: root/gdb/common
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-06-24 15:06:27 +0000
committerTom Tromey <tromey@redhat.com>2013-06-24 15:06:27 +0000
commit0120846339200cfc91bd0fc5132bcfea6f1dcff4 (patch)
treed9006b682dc9349708f84797b74fd9d5f833df70 /gdb/common
parentcd6d434c14735b0f374bada533793bbad5393e19 (diff)
downloadgdb-0120846339200cfc91bd0fc5132bcfea6f1dcff4.zip
gdb-0120846339200cfc91bd0fc5132bcfea6f1dcff4.tar.gz
gdb-0120846339200cfc91bd0fc5132bcfea6f1dcff4.tar.bz2
don't keep a gdb-specific date
Right now there are two nightly commits to update a file in the tree with the current date. One commit is for BFD, one is for gdb. It seems unnecessary to me to do this twice. We can make do with a single such commit. This patch changes gdb in a minimal way to reuse the BFD date -- it extracts it from bfd/version.h and changes version.in to use the placeholder string "DATE" for those times when a date is wanted. I propose removing the cron job that updates the version on trunk, and then check in this patch. For release branches, we can keep the cron job, but just tell it to rewrite bfd/version.h. I believe this is a simple change in the crontab -- the script will work just fine on this file. This also moves version.in and version.h into common/, to reflect their shared status; and updates gdbserver to use version.h besides. * common/create-version.sh: New file. * Makefile.in (version.c): Use bfd/version.h, common/version.in, create-version.sh. (HFILES_NO_SRCDIR): Use common/version.h. * version.in: Move to ... * common/version.in: ... here. Replace date with "DATE". * version.h: Move to ... * common/version.h: ... here. gdbserver: * Makefile.in (version.c): Use bfd/version.h, common/version.in, create-version.sh. (version.o): Remove. * gdbreplay.c: Include version.h. (version, host_name): Don't declare. * server.h: Include version.h. (version, host_name): Don't declare. doc: * Makefile.in (POD2MAN1, POD2MAN5): Use version.subst. (GDBvn.texi): Use version.subst. (version.subst): New target. (mostlyclean): Remove version.subst.
Diffstat (limited to 'gdb/common')
-rwxr-xr-xgdb/common/create-version.sh38
-rw-r--r--gdb/common/version.h31
-rw-r--r--gdb/common/version.in1
3 files changed, 70 insertions, 0 deletions
diff --git a/gdb/common/create-version.sh b/gdb/common/create-version.sh
new file mode 100755
index 0000000..2d2bc74
--- /dev/null
+++ b/gdb/common/create-version.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# Copyright (C) 1989-2013 Free Software Foundation, Inc.
+
+# This file is part of GDB.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT 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
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Create version.c from version.in.
+# Usage:
+# create-version.sh PATH-TO-GDB-SRCDIR HOST_ALIAS \
+# TARGET_ALIAS OUTPUT-FILE-NAME
+
+srcdir="$1"
+host_alias="$2"
+target_alias="$3"
+output="$4"
+
+rm -f version.c-tmp $output version.tmp
+date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$$/\1/p' $srcdir/../bfd/version.h`
+sed -e "s/DATE/$date/" < $srcdir/common/version.in > version.tmp
+echo '#include "version.h"' >> version.c-tmp
+echo 'const char version[] = "'"`sed q version.tmp`"'";' >> version.c-tmp
+echo 'const char host_name[] = "$host_alias";' >> version.c-tmp
+echo 'const char target_name[] = "$target_alias";' >> version.c-tmp
+mv version.c-tmp $output
+rm -f version.tmp
diff --git a/gdb/common/version.h b/gdb/common/version.h
new file mode 100644
index 0000000..94b577c
--- /dev/null
+++ b/gdb/common/version.h
@@ -0,0 +1,31 @@
+/* Version information for GDB.
+ Copyright (C) 1999-2013 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT 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
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef VERSION_H
+#define VERSION_H
+
+/* Version number of GDB, as a string. */
+extern const char version[];
+
+/* Canonical host name as a string. */
+extern const char host_name[];
+
+/* Canonical target name as a string. */
+extern const char target_name[];
+
+#endif /* #ifndef VERSION_H */
diff --git a/gdb/common/version.in b/gdb/common/version.in
new file mode 100644
index 0000000..99adaca
--- /dev/null
+++ b/gdb/common/version.in
@@ -0,0 +1 @@
+7.6.50.DATE-cvs