This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA:] sim/common/aclocal.m4: correct duplicate arg test for --enable-sim-hardware=...
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: gdb-patches at sourceware dot org
- Date: Sat, 25 Mar 2006 17:22:58 +0100
- Subject: [RFA:] sim/common/aclocal.m4: correct duplicate arg test for --enable-sim-hardware=...
The existing test was bogus: there was no variable f, and
no " $f " could match a "x" anyway (missing spaces). The result
was that you'd always get duplicates and always a build error
for the bogus dv-x.o that was added if you use the
--enable-sim-hardware=... option. I think the below is what was
intended. Comma is an appropriate delimeter to use for
combining the "x" exclusion duplication test as it has been
filtered out from $hardware. For those in doubt, the "or" is
supposedly portable; see other uses in configure, for example the
general --enable-* parse bits at the top.
Tested with patches for cris/configure.ac (adding a dv-rv.c and
"SIM_AC_OPTION_HARDWARE(no,,rv)") and
--enable-sim-hardware
(enables all base hardware and rv)
--enable-sim-hardware=rv
(enables rv)
--enable-sim-hardware=,
(as --enable-sim-hardware)
--enable-sim-hardware=rv,x,rv,rv,x,x
(as --enable-sim-hardware=rv)
and observing expected behavior on the "Setting hardware to"
line at configure time and that the expected dv-*.o file(s) were
compiled.
Ok to commit? With obvious rebuild of configure for all users?
sim/common:
* aclocal.m4 (SIM_AC_OPTION_HARDWARE): Correct duplicate-
option-contents test.
Index: aclocal.m4
===================================================================
RCS file: /cvs/src/src/sim/common/aclocal.m4,v
retrieving revision 1.11
diff -p -u -r1.11 aclocal.m4
--- aclocal.m4 23 Mar 2005 18:55:14 -0000 1.11
+++ aclocal.m4 25 Mar 2006 15:56:54 -0000
@@ -594,9 +594,8 @@ else
sim_hw=""
sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
for i in x $hardware ; do
- case " $f " in
- x) ;;
- *" $i "*) ;;
+ case " $sim_hw,$i " in
+ *",x "* | *" $i,"*) ;;
*) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
esac
done
brgds, H-P