From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18408 invoked by alias); 25 Mar 2006 16:23:38 -0000 Received: (qmail 18393 invoked by uid 22791); 25 Mar 2006 16:23:37 -0000 X-Spam-Check-By: sourceware.org Received: from miranda.se.axis.com (HELO miranda.se.axis.com) (193.13.178.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 25 Mar 2006 16:23:35 +0000 Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.83.5.18]) by miranda.se.axis.com (8.12.9/8.12.9/Debian-5local0.1) with ESMTP id k2PGNUag031074; Sat, 25 Mar 2006 17:23:30 +0100 Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id k2PGNU2V002247; Sat, 25 Mar 2006 17:23:30 +0100 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id k2PGMwcQ002238; Sat, 25 Mar 2006 17:22:58 +0100 Date: Sun, 26 Mar 2006 08:15:00 -0000 Message-Id: <200603251622.k2PGMwcQ002238@ignucius.se.axis.com> From: Hans-Peter Nilsson To: gdb-patches@sourceware.org Subject: [RFA:] sim/common/aclocal.m4: correct duplicate arg test for --enable-sim-hardware=... Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00296.txt.bz2 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