This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Make autoreconf under gdb/ work (Re: RFC: automatic dependency tracking for gdbserver)
- 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, 16 Jan 2013 19:47:57 +0000
- Subject: Make autoreconf under gdb/ work (Re: RFC: automatic dependency tracking for gdbserver)
- References: <87r4n6vnqx.fsf@fleche.redhat.com> <50C1C285.5070904@redhat.com> <87pq2lx6qx.fsf@fleche.redhat.com>
On 12/07/2012 02:43 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>
> Pedro> I think I'd mildly prefer having these listed explicitly in
> Pedro> acinclude.m4, so you can do just autoreconf on the command line
> Pedro> or aclocal, without worrying about forgetting -I (IIRC,
> Pedro> ACLOCAL_AMFLAGS is actually ignored, because we're not using
> Pedro> automake). WDYT?
>
> Sure, I will make that change.
>
> Pedro> I actually have a patch for GDB that does the
> Pedro> same to gdb's aclocal.
>
> I think the change would be fine, but gdb does actually use this
> variable:
>
> $(srcdir)/aclocal.m4: @MAINTAINER_MODE_TRUE@ $(aclocal_m4_deps)
> cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
Ah. I don't tend to remember to enable maintainer mode...
The dependencies are already stale though.
If you do 'autoreconf' on gdb's source dir currently, you'll see
aclocal.m4/configure changing spuriously and configure losing
a couple flags. A patch like the below fixes that, and adds
a couple "keep in sync with" comments. WDYT?
> gdbserver doesn't seem to have these maintainer-mode rebuild rules.
> All these little details are a benefit of automake; but I looked at that
> a bit and it is kind of a pain to switch over.
Yeah...
2013-01-16 Pedro Alves <palves@redhat.com>
* acinclude.m4: Include ../config/plugins.m4,
../config/largefile.m4, ../config/lead-dot.m4. Add comments.
* Makefile.in (aclocal_m4_deps): Update.
* aclocal.m4: Renegerate.
---
gdb/Makefile.in | 11 +++++++----
gdb/acinclude.m4 | 17 +++++++++++++++--
gdb/aclocal.m4 | 3 ---
3 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index b065d41..6d386ac 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1312,15 +1312,17 @@ config.status: $(srcdir)/configure configure.tgt configure.host
ACLOCAL = aclocal
ACLOCAL_AMFLAGS = -I ../config
+
+# Keep these in sync with the includes in acinclude.s4.
aclocal_m4_deps = \
configure.ac \
acx_configure_dir.m4 \
- ../config/extensions.m4 \
- ../config/lead-dot.m4 \
- ../config/proginstall.m4 \
../bfd/bfd.m4 \
../config/acinclude.m4 \
+ ../config/plugins.m4 \
+ ../config/lead-dot.m4 \
../config/override.m4 \
+ ../config/largefile.m4 \
../config/gettext-sister.m4 \
../config/lib-ld.m4 \
../config/lib-prefix.m4 \
@@ -1329,7 +1331,8 @@ aclocal_m4_deps = \
../config/tcl.m4 \
../config/depstand.m4 \
../config/lcmessage.m4 \
- ../config/codeset.m4
+ ../config/codeset.m4 \
+ ../config/zlib.m4
$(srcdir)/aclocal.m4: @MAINTAINER_MODE_TRUE@ $(aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index 5399e40..25caddd 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -1,17 +1,30 @@
dnl written by Rob Savoye <rob@cygnus.com> for Cygnus Support
dnl major rewriting for Tcl 7.5 by Don Libes <libes@nist.gov>
+# Keep these includes in sync with the aclocal_m4_deps list in
+# Makefile.in.
+
sinclude(acx_configure_dir.m4)
dnl gdb/configure.in uses BFD_NEED_DECLARATION, so get its definition.
sinclude(../bfd/bfd.m4)
-dnl This gets the standard macros
+dnl This gets the standard macros.
sinclude(../config/acinclude.m4)
-dnl This gets autoconf bugfixes
+dnl This gets AC_PLUGINS, needed by ACX_LARGEFILE.
+sinclude(../config/plugins.m4)
+
+dnl For ACX_LARGEFILE.
+sinclude(../config/largefile.m4)
+
+dnl For AM_SET_LEADING_DOT.
+sinclude(../config/lead-dot.m4)
+
+dnl This gets autoconf bugfixes.
sinclude(../config/override.m4)
+dnl For ZW_GNU_GETTEXT_SISTER_DIR.
sinclude(../config/gettext-sister.m4)
dnl For AC_LIB_HAVE_LINKFLAGS.
diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
index fdd8d08..7b546b7 100644
--- a/gdb/aclocal.m4
+++ b/gdb/aclocal.m4
@@ -106,7 +106,4 @@ AC_DEFUN([_AM_SUBST_NOTMAKE])
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
-m4_include([../config/largefile.m4])
-m4_include([../config/lead-dot.m4])
-m4_include([../config/plugins.m4])
m4_include([acinclude.m4])