This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]