This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: introduce common.m4
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 24 Apr 2013 19:54:41 +0100
- Subject: Re: RFC: introduce common.m4
- References: <871u9zomzd dot fsf at fleche dot redhat dot com>
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