aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-01-17 06:16:38 -0500
committerMike Frysinger <vapier@gentoo.org>2021-01-18 12:25:57 -0500
commitf89f33e57c69e830980fbed4420883f678d2f47c (patch)
tree5dc54557cd100fcefbbd1f9e2a722a8f7e4ab6f8
parent5e25901fcc5e8a75e86b6829d3f887d4fbbea91e (diff)
downloadgdb-f89f33e57c69e830980fbed4420883f678d2f47c.zip
gdb-f89f33e57c69e830980fbed4420883f678d2f47c.tar.gz
gdb-f89f33e57c69e830980fbed4420883f678d2f47c.tar.bz2
sim: common: simplify version script
We don't use the host & target aliases, so don't bother emitting them.
-rw-r--r--sim/common/ChangeLog6
-rw-r--r--sim/common/Make-common.in5
-rwxr-xr-xsim/common/create-version.sh17
3 files changed, 15 insertions, 13 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index beca012..8ab1c90 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,11 @@
2021-01-18 Mike Frysinger <vapier@gentoo.org>
+ * Make-common.in (version.c): Simplifiy args and call move-if-change.
+ * create-version.sh: Delete host & target alias logic. Write to the
+ output directly.
+
+2021-01-18 Mike Frysinger <vapier@gentoo.org>
+
* configure, configure.ac, Makefile.in: Delete.
2021-01-13 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 6e71930..8740a4a 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -291,8 +291,9 @@ stamp-tvals: gentmap
touch stamp-tvals
version.c: Makefile $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(srcroot)/sim/common/create-version.sh
- $(SHELL) $(srcroot)/sim/common/create-version.sh $(srcroot)/gdb \
- $(host_alias) $(target_alias) version.c
+ $(SHELL) $(srcroot)/sim/common/create-version.sh $(srcroot)/gdb $@.tmp
+ $(SHELL) $(srcroot)/move-if-change $@.tmp $@
+ touch $@
#
# Rules for building sim-* components. Triggered by listing the corresponding
diff --git a/sim/common/create-version.sh b/sim/common/create-version.sh
index 5252c3b..7b35e87 100755
--- a/sim/common/create-version.sh
+++ b/sim/common/create-version.sh
@@ -23,16 +23,11 @@
# TARGET_ALIAS OUTPUT-FILE-NAME
srcdir="$1"
-host_alias="$2"
-target_alias="$3"
-output="$4"
+output="$2"
-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/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
+ver=`sed -e "s/DATE/$date/;q" $srcdir/version.in`
+(
+echo '#include "version.h"'
+echo 'const char version[] = "'"${ver}"'";'
+) >"${output}"