This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [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: drow at false dot org
- Cc: hans-peter dot nilsson at axis dot com, gdb-patches at sourceware dot org
- Date: Wed, 29 Mar 2006 02:27:29 +0200
- Subject: Re: [RFA:] sim/common/aclocal.m4: correct duplicate arg test for --enable-sim-hardware=...
> Date: Tue, 28 Mar 2006 17:27:21 -0500
> From: Daniel Jacobowitz <drow@false.org>
> On Sat, Mar 25, 2006 at 05:22:58PM +0100, Hans-Peter Nilsson wrote:
> > - 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";;
>
> I don't think that's right. Don't you want:
>
> for i in $hardware ; do
> case " $sim_hw " in
> *" $i "*) ;;
> *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
> esac
> done
Yeah, that would seem the obvious correction if there isn't a
"x" to remove. Ha! Consider it done as such! :-)
> The "in x $hardware" bit is not necessary (that's only necessary from
> Makefiles),
Ok then, it's just that the previous author didn't think so, and
so I thought maybe there was a reason for that.
> and the commas don't work like you'd think, since sim_hw is
> space separated.
It's moot now, but that's was the point, as I also mentioned!
In other words, using a comma to join two values for a combined
$i-in-$sim_hw existence and filter-out-x test, with either side
wildcarded out, would be safe, as "," doesn't occur in
$hardware; it's replaced by spaces just a bit higher up; I guess
you saw that.
brgds, H-P