Re: Update rebuild rules in non-automake directories.

Ralf Wildenhues
2009-07-28T18:18:03Z

In <http://gcc.gnu.org/ml/gcc-patches/2009-06/msg02137.html>, I posted a
first set of changes against GCC trunk that update the rebuild rules for
files generated by the autotools. This patch was already approved, but
I wanted to defer its application until I had done the respective one
for src. Now's the time.

In the process, I found files I had omitted in that first patch. So
here is a second patch, against src (and overlapping with GCC), that I
am seeking approval for. I will then apply both combined, to both GCC
and src, where they apply. AFAICS they fix rules throughout the
binutils-gdb parts of src (i.e., what the git copy covers).

Notes:

- The intl and libdecnumber change is to please make implementations
where '#' comments does not extend across backslash-newline. It was
forgotten from the same (already posted) patch against GCC.

- The gdb change also fixes a bug with regeneration triggered by the
automake-generated makefile below the gnulib directory. This was
mentioned on this list a while ago, but I can't find a reference to it
now. Is there a PR attached to it that I should mention in the
ChangeLog?

There are changes unique to src (etc/) and to gdb in this patch, as well
as changes to files shared; a build system maintainer for GCC and src
should be able to approve this rather trivial patch, I hope.

Thanks,
Ralf

intl/ChangeLog:
2009-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>

* Makefile.in (aclocal_deps): New variable.
($(srcdir)/aclocal.m4): Use it, for portable makefile syntax.

libdecnumber/ChangeLog:
2009-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>

* Makefile.in (aclocal_deps): New variable.
($(srcdir)/aclocal.m4): Use it, for portable makefile syntax.

etc/ChangeLog:
2009-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>

* Makefile.in (AUTOCONF, configure_deps): New variables.
($(srcdir)/configure): New rule.
* configure.in: Accept --enable-maintainer-mode, set and
substitute MAINT accordingly.

gdb/ChangeLog:
2009-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>

* Makefile.in (ACLOCAL, ACLOCAL_AMFLAGS, aclocal_m4_deps):
New variables.
($(srcdir)/aclocal.m4, am--refresh): New rules.

diff --git a/etc/Makefile.in b/etc/Makefile.in
index 9642e07..66b4446 100644
--- a/etc/Makefile.in
+++ b/etc/Makefile.in
@@ -231,6 +231,12 @@ maintainer-clean realclean: distclean
Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
$(SHELL) ./config.status

+AUTOCONF = autoconf
+configure_deps = $(srcdir)/configure.in
+
+$(srcdir)/configure: @MAINT@ $(configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+
## these last targets are for standards.texi conformance
dist:
check:
diff --git a/etc/configure.in b/etc/configure.in
index 7285d37..6b94aac 100644
--- a/etc/configure.in
+++ b/etc/configure.in
@@ -4,6 +4,21 @@ AC_INIT(Makefile.in)

AC_PROG_INSTALL

+# Command-line options.
+# Very limited version of AC_MAINTAINER_MODE.
+AC_ARG_ENABLE([maintainer-mode],
+ [AC_HELP_STRING([--enable-maintainer-mode],
+ [enable make rules and dependencies not useful (and
+ sometimes confusing) to the casual installer])],
+ [case ${enable_maintainer_mode} in
+ yes) MAINT='' ;;
+ no) MAINT='#' ;;
+ *) AC_MSG_ERROR([--enable-maintainer-mode must be yes or no]) ;;
+ esac
+ maintainer_mode=${enableval}],
+ [MAINT='#'])
+AC_SUBST([MAINT])dnl
+
AC_SUBST(datarootdir)
AC_SUBST(docdir)
AC_SUBST(htmldir)
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 7659a8f..6874e09 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1222,6 +1222,48 @@ stamp-h: config.in config.status
config.status: configure configure.tgt configure.host
$(SHELL) config.status --recheck

+ACLOCAL = aclocal
+ACLOCAL_AMFLAGS = -I gnulib/m4
+aclocal_m4_deps = \
+ configure.ac \
+ gnulib/m4/extensions.m4 \
+ gnulib/m4/gnulib-common.m4 \
+ gnulib/m4/gnulib-comp.m4 \
+ gnulib/m4/include_next.m4 \
+ gnulib/m4/longlong.m4 \
+ gnulib/m4/memchr.m4 \
+ gnulib/m4/memcmp.m4 \
+ gnulib/m4/memmem.m4 \
+ gnulib/m4/onceonly_2_57.m4 \
+ gnulib/m4/stdint.m4 \
+ gnulib/m4/string_h.m4 \
+ gnulib/m4/wchar.m4 \
+ ../config/extensions.m4 \
+ ../config/lead-dot.m4 \
+ ../config/proginstall.m4 \
+ ../bfd/bfd.m4 \
+ ../config/acinclude.m4 \
+ ../config/override.m4 \
+ ../config/gettext-sister.m4 \
+ ../config/lib-ld.m4 \
+ ../config/lib-prefix.m4 \
+ ../config/lib-link.m4 \
+ ../config/acx.m4 \
+ ../config/tcl.m4 \
+ ../config/depstand.m4 \
+ ../config/lcmessage.m4 \
+ ../config/codeset.m4
+
+$(srcdir)/aclocal.m4: @MAINTAINER_MODE_TRUE@ $(aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+# automatic rebuilding in automake-generated Makefiles requires
+# this rule in the toplevel Makefile, which, with GNU make, causes
+# the desired updates through the implicit regeneration of the Makefile
+# and all of its prerequisites.
+am--refresh:
+ @:
+
force:

# Documentation!
diff --git a/intl/Makefile.in b/intl/Makefile.in
index 96211ff..3dd0b7f 100644
--- a/intl/Makefile.in
+++ b/intl/Makefile.in
@@ -211,16 +211,28 @@ config.status: $(srcdir)/configure
$(srcdir)/configure: @MAINT@ $(srcdir)/aclocal.m4 $(srcdir)/configure.ac
cd $(srcdir) && $(AUTOCONF)

-$(srcdir)/aclocal.m4: @MAINT@ $(srcdir)/configure.ac \
- $(srcdir)/../config/codeset.m4 $(srcdir)/../config/gettext.m4 \
- $(srcdir)/../config/glibc21.m4 $(srcdir)/../config/iconv.m4 \
- $(srcdir)/../config/intdiv0.m4 $(srcdir)/../config/inttypes-pri.m4 \
- $(srcdir)/../config/inttypes.m4 $(srcdir)/../config/inttypes_h.m4 \
- $(srcdir)/../config/lcmessage.m4 $(srcdir)/../config/lib-ld.m4 \
- $(srcdir)/../config/lib-link.m4 $(srcdir)/../config/lib-prefix.m4 \
- $(srcdir)/../config/nls.m4 $(srcdir)/../config/po.m4 \
- $(srcdir)/../config/progtest.m4 $(srcdir)/../config/stdint_h.m4 \
- $(srcdir)/../config/uintmax_t.m4 $(srcdir)/../config/ulonglong.m4
+aclocal_deps = \
+ $(srcdir)/configure.ac \
+ $(srcdir)/../config/codeset.m4 \
+ $(srcdir)/../config/gettext.m4 \
+ $(srcdir)/../config/glibc21.m4 \
+ $(srcdir)/../config/iconv.m4 \
+ $(srcdir)/../config/intdiv0.m4 \
+ $(srcdir)/../config/inttypes-pri.m4 \
+ $(srcdir)/../config/inttypes.m4 \
+ $(srcdir)/../config/inttypes_h.m4 \
+ $(srcdir)/../config/lcmessage.m4 \
+ $(srcdir)/../config/lib-ld.m4 \
+ $(srcdir)/../config/lib-link.m4 \
+ $(srcdir)/../config/lib-prefix.m4 \
+ $(srcdir)/../config/nls.m4 \
+ $(srcdir)/../config/po.m4 \
+ $(srcdir)/../config/progtest.m4 \
+ $(srcdir)/../config/stdint_h.m4 \
+ $(srcdir)/../config/uintmax_t.m4 \
+ $(srcdir)/../config/ulonglong.m4
+
+$(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
cd $(srcdir) && $(ACLOCAL) -I ../config

config.h: stamp-h1
diff --git a/libdecnumber/Makefile.in b/libdecnumber/Makefile.in
index 4160795..de91f6f 100644
--- a/libdecnumber/Makefile.in
+++ b/libdecnumber/Makefile.in
@@ -94,9 +94,13 @@ config.status: $(srcdir)/configure
$(srcdir)/configure: @MAINT@ $(srcdir)/aclocal.m4
cd $(srcdir) && $(AUTOCONF)

-$(srcdir)/aclocal.m4: @MAINT@ $(srcdir)/../config/stdint.m4 \
- $(srcdir)/../config/warnings.m4 $(srcdir)/../config/override.m4 \
+aclocal_deps = \
+ $(srcdir)/../config/stdint.m4 \
+ $(srcdir)/../config/warnings.m4 \
+ $(srcdir)/../config/override.m4 \
$(srcdir)/configure.ac
+
+$(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
cd $(srcdir) && $(ACLOCAL) -I ../config

config.h: stamp-h1