aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2011-12-19 04:33:39 +0000
committerJoel Brobecker <brobecker@gnat.com>2011-12-19 04:33:39 +0000
commit96987c2b7f27be4aa28c08815bebcf1a831b99c4 (patch)
tree19947a3ca62c673b5386e6764d524b052e170da9 /sim/common
parent9a5ce6c0540ee6c0ef8f7d739cacb6f7b3e50393 (diff)
downloadgdb-96987c2b7f27be4aa28c08815bebcf1a831b99c4.zip
gdb-96987c2b7f27be4aa28c08815bebcf1a831b99c4.tar.gz
gdb-96987c2b7f27be4aa28c08815bebcf1a831b99c4.tar.bz2
Work around Solaris bourne shell limitation when building the sim
Building the sim on a sparc-solaris 2.8 machine fails when configured with no extra sim hardware: > for hw in ; do \ > echo "extern const struct hw_descriptor > dv_${hw}_descriptor[];" ; \ > done >> tmp-hw.h > echo 'const char version[] = "'"`sed q > /[...]/../../gdb/version.in`"'";' > >> version.c-tmp > /bin/sh: -c: line 1: syntax error near unexpected token `;' > /bin/sh: -c: line 1: `for hw in ; do \' > make[3]: *** [hw-config.h] Error 2 The same thing happens with the version of bash that we got from Sun as well (which is very old: 2.03.0(1)-release). The problems comes from the fact that both shells are buggy, and reject the following script: for hw in ; do [...] done The above is what sim/common/Makefile.in tries to execute when generating hw-config.h. In order to allow users to build out of the box on these machines, this patch works around this bug. It does rely on the fact that none of the tokens in SIM_HW contain whitespaces. sim/common/ChangeLog: * Make-common.in (hw-config.h): Work around bug in Solaris 2.8 system bourne shell.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog5
-rw-r--r--sim/common/Make-common.in6
2 files changed, 9 insertions, 2 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index c69b948..b2b8b63 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-19 Joel Brobecker <brobecker@adacore.com>
+
+ * Make-common.in (hw-config.h): Work around bug in Solaris 2.8
+ system bourne shell.
+
2011-12-03 Mike Frysinger <vapier@gentoo.org>
* syscall.c (cb_get_string): Rename from "get_string".
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index c12d155..606e595 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -462,11 +462,13 @@ sim-inline.c: $(srccom)/sim-inline.c
hw-config.h: Makefile.in $(srccom)/Make-common.in config.status Makefile
rm -f tmp-hw.h
echo "/* generated by Makefile */" > tmp-hw.h
- for hw in $(SIM_HW) ; do \
+ sim_hw="$(SIM_HW)"; \
+ for hw in $$sim_hw ; do \
echo "extern const struct hw_descriptor dv_$${hw}_descriptor[];" ; \
done >> tmp-hw.h
echo "const struct hw_descriptor *hw_descriptors[] = {" >> tmp-hw.h
- for hw in $(SIM_HW) ; do \
+ sim_hw="$(SIM_HW)"; \
+ for hw in $$sim_hw ; do \
echo " dv_$${hw}_descriptor," ; \
done >> tmp-hw.h
echo " NULL," >> tmp-hw.h