From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15702 invoked by alias); 24 Apr 2013 18:54:46 -0000 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 Received: (qmail 15692 invoked by uid 89); 24 Apr 2013 18:54:45 -0000 X-Spam-SWARE-Status: No, score=-8.4 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 24 Apr 2013 18:54:44 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3OIsg46005360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 24 Apr 2013 14:54:42 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3OIsfNS016424; Wed, 24 Apr 2013 14:54:42 -0400 Message-ID: <51782A71.7030305@redhat.com> Date: Wed, 24 Apr 2013 23:16:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: RFC: introduce common.m4 References: <871u9zomzd.fsf@fleche.redhat.com> In-Reply-To: <871u9zomzd.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-04/txt/msg00754.txt.bz2 On 04/24/2013 06:30 PM, Tom Tromey wrote: > It has bothered me for a while that files in common/ use macros > defined via autoconf checks, but rely on each configure.ac doing the > proper checks independently. > > This patch introduces common/common.m4 which consolidates the checks > assumed by code in common. > > The rule I propose is that if something is needed or used by common, > it should be checked for by common.m4; but that code outside this > directory also be free to use these results. This means that removing > checks from common.m4 must first be preceded by looking at uses in gdb > and gdbserver. I think this is pretty easy to do -- easier than what > we are doing now -- and I have documented the requirement. What's the advantage of doing it this way? Caching? Doesn't autoconf use the cached value if there are multiple AC_CHECK_FOOs for the same thing? Not super sure I like this over keeping each directory aware of its dependencies, but I suppose I can go along. > This process revealed a few things not checked for in gdbserver > (nothing too crucial I think) and also that the decl check for getopt > was dead. Ah, an "also". ;-) > I wrote GDB_AC_COMMON by looking for HAVE_ symbols in common/*.[ch]. > I did not look for library dependencies, so it is possible that > something is missing. I think it is worthwhile to have this in place > now, even if it is not perfect, because it gives us a place to make > future improvements. I definitely agree with the idea of a common common.m4 in common/. :-) > gdb: > * acinclude.m4: Include common.m4. > * common/common.m4: New file. > * configure, config.in: Rebuild. > * configure: Move some checks to common.m4. Use GDB_AC_COMMON. s/configure/configure.ac/ > > gdbserver: > * acinclude.m4: Include common.m4, codeset.m4. codeset.m4? > * configure, config.in: Rebuild. > * configure: Move some checks to common.m4. Use GDB_AC_COMMON. s/configure/configure.ac/ > + AC_CHECK_HEADERS(linux/perf_event.h locale.h memory.h signal.h dnl > + string.h strings.h sys/resource.h sys/un.h sys/wait.h dnl > + thread_db.h wait.h) Something odd with indentation here. Mechanically looks good to me. I don't plan on checking/cross-checking what was moved in detail. -- Pedro Alves