From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32298 invoked by alias); 26 Aug 2009 19:22:19 -0000 Received: (qmail 32290 invoked by uid 22791); 26 Aug 2009 19:22:18 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.gmx.net (HELO mail.gmx.net) (213.165.64.20) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Wed, 26 Aug 2009 19:22:13 +0000 Received: (qmail invoked by alias); 26 Aug 2009 19:22:10 -0000 Received: from xdsl-87-78-70-243.netcologne.de (EHLO localhost.localdomain) [87.78.70.243] by mail.gmx.net (mp023) with SMTP; 26 Aug 2009 21:22:10 +0200 Received: from ralf by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1MgO4P-0008Gm-53; Wed, 26 Aug 2009 21:22:09 +0200 Date: Wed, 26 Aug 2009 20:08:00 -0000 From: Ralf Wildenhues To: Paolo Bonzini Cc: "Frank Ch. Eigler" , Tom Tromey , gdb-patches@sources.redhat.com Subject: Re: fixup SIM_CHECK_* Message-ID: <20090826192208.GI9074@gmx.de> References: <20090815112928.GB5396@gmx.de> <20090815113302.GC20172@gmx.de> <20090818184349.GE30742@gmx.de> <20090825195545.GC5034@gmx.de> <4A94E277.70205@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A94E277.70205@gnu.org> User-Agent: Mutt/1.5.20 (2009-08-09) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-08/txt/msg00459.txt.bz2 Hi Paolo, * Paolo Bonzini wrote on Wed, Aug 26, 2009 at 09:21:27AM CEST: > On 08/25/2009 09:55 PM, Ralf Wildenhues wrote: > >This was still left TODO. Of course, I managed to actually commit a > >patch, that would not expand AC_CHECK_MEMBERS correctly, as that uses > >_$0_BODY internally, and $0 is still SIM_CHECK_MEMBER (Paolo, it's ugly > >to have to remember this, so we maybe shouldn't use m4_defn so much): > > Hey, Eric (Blake) is the big optimizer in Autoconf-land, not me. :-) > I agree with you, though of course I don't like this kind of relying > on Autoconf internals. Hmm, I guess I didn't explain myself well. What I meant was this: if we override Autoconf macros, say in config/override.m4, then we should try to use something other than m4_defn. For example AU_ALIAS should work better. This wasn't meant as a bug report against Autoconf, more as a hint how to avoid such override issues in GCC. > The patch seems fine. Well, since I meant it to be two patches, and exactly to remind of the wrong defn use, I propose that I do eat my own dogfood and would like to commit these two patches instead. The end result is the same, as are the generated files in between. Thanks, Ralf Fix SIM_CHECK_MEMBER definition with Autoconf 2.64. sim/common/ChangeLog: 2009-08-26 Ralf Wildenhues * aclocal.m4 (SIM_CHECK_MEMBER): Use AU_ALIAS to define, not defn. * configure: Regenerate. diff --git a/sim/common/aclocal.m4 b/sim/common/aclocal.m4 index 24b1aa2..6820164 100644 --- a/sim/common/aclocal.m4 +++ b/sim/common/aclocal.m4 @@ -945,7 +945,7 @@ dnl dnl --------------------------------------------------------- dnl AGGREGATE.MEMBER is for instance `struct passwd.pw_gecos', shell dnl variables are not a valid argument. -AC_DEFUN([SIM_CHECK_MEMBER], defn([AC_CHECK_MEMBER])) +AU_ALIAS([SIM_CHECK_MEMBER], [AC_CHECK_MEMBER]) dnl dnl Translated from a FC2 autoconf-2.59-3 installation. dnl SIM_CHECK_MEMBERS([AGGREGATE.MEMBER, ...]) Remove SIM_CHECK_MEMBER*. sim/common/ChangeLog: 2009-08-26 Ralf Wildenhues * aclocal.m4 (SIM_CHECK_MEMBER, SIM_CHECK_MEMBERS) (SIM_CHECK_MEMBERS_1): Remove. * configure.ac: Replace SIM_CHECK_MEMBERS call with equivalent AC_CHECK_MEMBERS one. * configure: Regenerate. diff --git a/sim/common/aclocal.m4 b/sim/common/aclocal.m4 index 6820164..7beaebd 100644 --- a/sim/common/aclocal.m4 +++ b/sim/common/aclocal.m4 @@ -933,50 +933,3 @@ AC_SUBST(CGEN_MAINT) AC_SUBST(cgendir) AC_SUBST(cgen) ]) -dnl FIXME: When upgrading to modern autoconf, remove -dnl SIM_CHECK_MEMBER and SIM_CHECK_MEMBERS et al and use -dnl AC_CHECK_MEMBERS from autoconf. -dnl -dnl Translated from a FC2 autoconf-2.59-3 installation. -dnl AC_CHECK_MEMBER(AGGREGATE.MEMBER, -dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], -dnl [INCLUDES]) -dnl -dnl --------------------------------------------------------- -dnl AGGREGATE.MEMBER is for instance `struct passwd.pw_gecos', shell -dnl variables are not a valid argument. -AU_ALIAS([SIM_CHECK_MEMBER], [AC_CHECK_MEMBER]) -dnl -dnl Translated from a FC2 autoconf-2.59-3 installation. -dnl SIM_CHECK_MEMBERS([AGGREGATE.MEMBER, ...]) -dnl except we just work with a limited set of fixed includes. -dnl -AC_DEFUN([SIM_CHECK_MEMBERS_1], -[ifelse($#, 1, -[SIM_CHECK_MEMBER([$1], -AC_DEFINE_UNQUOTED([HAVE_]translit([$1], [a-z .], [A-Z__]), 1, -[Define to 1 if ]patsubst([$1], -[^[^.]*\.])[ is a member of ]patsubst([$1], [\..*])[. ]),, -[#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif])], -[SIM_CHECK_MEMBER([$1], -AC_DEFINE_UNQUOTED([HAVE_]translit([$1], [a-z .], [A-Z__]), 1, -[Define to 1 if ]patsubst([$1], -[^[^.]*\.])[ is a member of ]patsubst([$1], [\..*])[. ]),, -[#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif]) -SIM_CHECK_MEMBERS_1(builtin(shift,$@))])])dnl SIM_CHECK_MEMBERS -dnl -AC_DEFUN([SIM_CHECK_MEMBERS], -[ifelse($#, 1, [SIM_CHECK_MEMBERS_1($1)], -[errprint(__file__:__line__: -[This SIM_CHECK_MEMBERS only supports one argument,] -[the list of struct tests])])])dnl SIM_CHECK_MEMBERS diff --git a/sim/common/configure.ac b/sim/common/configure.ac index 5516d9e..5f5845a 100644 --- a/sim/common/configure.ac +++ b/sim/common/configure.ac @@ -38,10 +38,16 @@ AC_SUBST(TARGET_SUBDIR) # These aren't all needed yet, but will be eventually. AC_CHECK_HEADERS(stdlib.h string.h strings.h time.h sys/times.h sys/stat.h sys/mman.h) AC_CHECK_FUNCS(mmap munmap lstat truncate ftruncate) -SIM_CHECK_MEMBERS([[struct stat.st_dev], [struct stat.st_ino], +AC_CHECK_MEMBERS([[struct stat.st_dev], [struct stat.st_ino], [struct stat.st_mode], [struct stat.st_nlink], [struct stat.st_uid], [struct stat.st_gid], [struct stat.st_rdev], [struct stat.st_size], [struct stat.st_blksize], [struct stat.st_blocks], [struct stat.st_atime], -[struct stat.st_mtime], [struct stat.st_ctime]]) +[struct stat.st_mtime], [struct stat.st_ctime]], [], [], +[[#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_STAT_H +#include +#endif]]) AC_OUTPUT(Makefile, [case x$CONFIG_HEADERS in xcconfig.h:config.in) echo > stamp-h ;; esac])