Re: [RFA/commit] Work around Solaris bourne shell limitation when building the sim

Joel Brobecker
2011-12-19T03:34:50Z

> that seems weird ... i just tried it locally and it seems to work for me ...

Weird indeed. I thought it was related to the Solaris shell
misunderstanding the variable assignment as a command, or something
like that. Your diff looks almost identical to mine, and yet mine
doesn't work, and I can't figure out why.

No matter, if you prefer this solution, here is a new complete diff.

sim/common/ChangeLog:

* Make-common.in (hw-config.h): Work around bug in Solaris 2.8
system bourne shell.

Tested on sparc-solaris with both /bin/sh and /bin/bash.

Thanks,
--
Joel

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