This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Update rebuild rules in non-automake directories.


This patch is the first preliminary step for the autotools update.

For each subdirectory of GCC that does not use automake, it ensures
that the configure.ac script supports --enable-maintainer-mode,
substitutes @MAINT@ appropriately, that the top Makefile.in file has
rebuild rules in place for regenerating each file generated by autotools
(if maintainer mode has been enabled).  It also ensures that the
variables AUTOHEADER, AUTOCONF, and ACLOCAL are used consistently in
these rules.

Some non-GNU make implementations do not extend comments across
backslash-newline, so the patch makes sure that @MAINT@, if set to '#',
comments out all prerequisites of generated files by listing them in an
extra variable.  This is future-safer than requiring that all of them be
listed on one long line.

OK to commit?

I have tested this patch at the time I wrote it, by bootstrapping it
with and without maintainer mode enabled.  It's been a while, so I'm
rerunning a cursory test right now.  I'm seeing that some of the
generated files are out of date, so I will commit them alongside of this
patch.

I will probably sync the commit with the respective one for src.

Thanks,
Ralf

fixincludes/ChangeLog:
2009-06-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* Makefile.in (AUTOCONF, AUTOHEADER, ACLOCAL, ACLOCAL_AMFLAGS):
	New variables.
	($(srcdir)/configure, $(srcdir)/config.h.in, $(srcdir)/aclocal.m4):
	Use them.

gcc/ChangeLog:
2009-06-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* Makefile.in (AUTOCONF, ACLOCAL, ACLOCAL_AMFLAGS, aclocal_deps):
	New variables.
	($(srcdir)/configure, $(srcdir)/aclocal.m4): New rules.
	(AUTOHEADER): New variable.
	($(srcdir)/cstamp-h.in): Use it.

gnattools/ChangeLog:
2009-06-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* Makefile.in (AUTOCONF, configure_deps): New variables.
	($(srcdir)/configure): Use them.

libada/ChangeLog:
2009-06-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* configure.ac: sinclude ../config/multi.m4.
	* configure: Regenerate.
	* Makefile.in (AUTOCONF, configure_deps): New variables.
	($(srcdir)/configure)): Use them.  Also depend on multi.m4.

libgcc/ChangeLog:
2009-06-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* configure.ac: Add snippet for maintainer-mode.
	* configure: Regenerate.
	* Makefile.in (AUTOCONF, configure_deps): New variables.
	($(srcdir)/configure)): New rule, active only with maintainer
	mode turned on.

libiberty/ChangeLog:
2009-06-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* Makefile.in (AUTOCONF, configure_deps): New variables.
	($(srcdir)/configure): New rule, active only in maintainer mode.

libobjc/ChangeLog:
2009-06-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* Makefile.in (AUTOCONF, ACLOCAL, ACLOCAL_AMFLAGS, aclocal_deps):
	New variables.
	($(srcdir)/configure, $(srcdir)/aclocal.m4): New rules.

diff --git a/fixincludes/Makefile.in b/fixincludes/Makefile.in
index 1f89cf9..f91a70d 100644
--- a/fixincludes/Makefile.in
+++ b/fixincludes/Makefile.in
@@ -63,6 +63,11 @@ itoolsdatadir = $(libsubdir)/install-tools
 # Locate mkinstalldirs.
 mkinstalldirs=$(SHELL) $(srcdir)/../mkinstalldirs
 
+AUTOCONF = autoconf
+AUTOHEADER = autoheader
+ACLOCAL = aclocal
+ACLOCAL_AMFLAGS = -I ../gcc -I .. -I ../config
+
 default : all
 
 # Now figure out from those variables how to compile and link.
@@ -159,13 +164,13 @@ config.status: $(srcdir)/configure
 	$(SHELL) ./config.status --recheck
 
 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/aclocal.m4
-	cd $(srcdir) && autoconf
+	cd $(srcdir) && $(AUTOCONF)
 
 $(srcdir)/config.h.in: @MAINT@ $(srcdir)/configure.ac
-	cd $(srcdir) && autoheader
+	cd $(srcdir) && $(AUTOHEADER)
 
 $(srcdir)/aclocal.m4: @MAINT@ $(srcdir)/configure.ac
-	cd $(srcdir) && aclocal -I ../gcc -I .. -I ../config
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
 
 check : all
 	autogen -T $(srcdir)/check.tpl $(srcdir)/inclhack.def
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index d8bbc68..f7dfa58 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1591,9 +1591,35 @@ cs-tm_p.h: Makefile
 # might be on a read-only file system.  If configured for maintainer mode
 # then do allow autoconf to be run.
 
-$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/aclocal.m4 \
-  $(srcdir)/acinclude.m4
-	(cd $(srcdir) && autoconf)
+AUTOCONF = autoconf
+ACLOCAL = aclocal
+ACLOCAL_AMFLAGS = -I ../config -I ..
+aclocal_deps = \
+	$(srcdir)/../libtool.m4 \
+	$(srcdir)/../ltoptions.m4 \
+	$(srcdir)/../ltsugar.m4 \
+	$(srcdir)/../ltversion.m4 \
+	$(srcdir)/../lt~obsolete.m4 \
+	$(srcdir)/../config/acx.m4 \
+	$(srcdir)/../config/codeset.m4 \
+	$(srcdir)/../config/extensions.m4 \
+	$(srcdir)/../config/gettext-sister.m4 \
+	$(srcdir)/../config/iconv.m4 \
+	$(srcdir)/../config/lcmessage.m4 \
+	$(srcdir)/../config/lib-ld.m4 \
+	$(srcdir)/../config/lib-link.m4 \
+	$(srcdir)/../config/lib-prefix.m4 \
+	$(srcdir)/../config/override.m4 \
+	$(srcdir)/../config/progtest.m4 \
+	$(srcdir)/../config/unwind_ipinfo.m4 \
+	$(srcdir)/../config/warnings.m4 \
+	$(srcdir)/acinclude.m4
+
+$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/aclocal.m4
+	(cd $(srcdir) && $(AUTOCONF))
+
+$(srcdir)/aclocal.m4 : @MAINT@ $(aclocal_deps)
+	(cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS))
 
 gccbug:	$(srcdir)/gccbug.in
 	CONFIG_FILES=gccbug CONFIG_HEADERS= ./config.status
@@ -1610,9 +1636,10 @@ gccbug:	$(srcdir)/gccbug.in
 
 # Don't run autoheader automatically either.
 # Only run it if maintainer mode is enabled.
+@MAINT@ AUTOHEADER = autoheader
 @MAINT@ $(srcdir)/config.in: $(srcdir)/cstamp-h.in
 @MAINT@ $(srcdir)/cstamp-h.in: $(srcdir)/configure.ac
-@MAINT@	(cd $(srcdir) && autoheader)
+@MAINT@	(cd $(srcdir) && $(AUTOHEADER))
 @MAINT@	@rm -f $(srcdir)/cstamp-h.in
 @MAINT@	echo timestamp > $(srcdir)/cstamp-h.in
 auto-host.h: cstamp-h ; @true
diff --git a/gnattools/Makefile.in b/gnattools/Makefile.in
index 92f4773..9319896 100644
--- a/gnattools/Makefile.in
+++ b/gnattools/Makefile.in
@@ -305,9 +305,14 @@ Makefile: $(srcdir)/Makefile.in config.status
 config.status: $(srcdir)/configure
 	$(SHELL) ./config.status --recheck
 
-$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac \
-	$(srcdir)/../config/acx.m4 $(srcdir)/../config/override.m4
-	cd $(srcdir) && autoconf
+AUTOCONF = autoconf
+configure_deps = \
+	$(srcdir)/configure.ac \
+	$(srcdir)/../config/acx.m4 \
+	$(srcdir)/../config/override.m4
+
+$(srcdir)/configure: @MAINT@ $(configure_deps)
+	cd $(srcdir) && $(AUTOCONF)
 
 # Don't export variables to the environment, in order to not confuse
 # configure.
diff --git a/libada/Makefile.in b/libada/Makefile.in
index f5057a0..db483b5 100644
--- a/libada/Makefile.in
+++ b/libada/Makefile.in
@@ -171,9 +171,15 @@ Makefile: $(srcdir)/Makefile.in config.status
 config.status: $(srcdir)/configure
 	$(SHELL) ./config.status --recheck
 
-$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac \
-	$(srcdir)/../config/acx.m4 $(srcdir)/../config/override.m4
-	cd $(srcdir) && autoconf
+AUTOCONF = autoconf
+configure_deps = \
+	$(srcdir)/configure.ac \
+	$(srcdir)/../config/acx.m4 \
+	$(srcdir)/../config/override.m4 \
+	$(srcdir)/../config/multi.m4
+
+$(srcdir)/configure: @MAINT@ $(configure_deps)
+	cd $(srcdir) && $(AUTOCONF)
 
 # Don't export variables to the environment, in order to not confuse
 # configure.
diff --git a/libada/configure.ac b/libada/configure.ac
index 9cee1a0..3c4cee6 100644
--- a/libada/configure.ac
+++ b/libada/configure.ac
@@ -17,6 +17,7 @@
 
 sinclude(../config/acx.m4)
 sinclude(../config/override.m4)
+sinclude(../config/multi.m4)
 
 AC_INIT
 AC_PREREQ([2.59])
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index 53dde12..9484e7e 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -140,6 +140,17 @@ stamp-h: $(srcdir)/config.in config.status Makefile
 config.status: $(srcdir)/configure $(srcdir)/config.host
 	$(SHELL) ./config.status --recheck
 
+AUTOCONF = autoconf
+configure_deps = \
+	$(srcdir)/../config/enable.m4 \
+	$(srcdir)/../config/tls.m4 \
+	$(srcdir)/../config/acx.m4 \
+	$(srcdir)/../config/no-executables.m4 \
+	$(srcdir)/../config/override.m4 \
+
+$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(configure_deps)
+	cd $(srcdir) && $(AUTOCONF)
+
 include $(gcc_objdir)/libgcc.mvars
 
 # Flags to pass to recursive makes.
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
index d48bccc..b055dba 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -78,6 +78,21 @@ else
 fi)
 AC_SUBST(slibdir)
 
+# 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_PROG_INSTALL
 
 AC_PROG_AWK
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 8a10092..3128954 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -459,6 +459,16 @@ stamp-h: $(srcdir)/config.in config.status Makefile
 config.status: $(srcdir)/configure
 	$(SHELL) ./config.status --recheck
 
+AUTOCONF = autoconf
+configure_deps = $(srcdir)/aclocal.m4 \
+	$(srcdir)/../config/acx.m4 \
+	$(srcdir)/../config/no-executables.m4 \
+	$(srcdir)/../config/override.m4 \
+	$(srcdir)/../config/warnings.m4 \
+
+$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(configure_deps)
+	cd $(srcdir) && $(AUTOCONF)
+
 # Depending on config.h makes sure that config.status has been re-run
 # if needed.  This prevents problems with parallel builds, in case
 # subdirectories need to run config.status also.
diff --git a/libobjc/Makefile.in b/libobjc/Makefile.in
index 8555003..98539cf 100644
--- a/libobjc/Makefile.in
+++ b/libobjc/Makefile.in
@@ -333,9 +333,25 @@ config.status: configure
 	CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
 	CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
 
-${srcdir}/configure: @MAINT@ configure.ac
+AUTOCONF = autoconf
+ACLOCAL = aclocal
+ACLOCAL_AMFLAGS = -I ../config -I ..
+aclocal_deps = \
+	$(srcdir)/../config/multi.m4 \
+	$(srcdir)/../config/override.m4 \
+	$(srcdir)/../config/proginstall.m4 \
+	$(srcdir)/../ltoptions.m4 \
+	$(srcdir)/../ltsugar.m4 \
+	$(srcdir)/../ltversion.m4 \
+	$(srcdir)/../lt~obsolete.m4 \
+	$(srcdir)/acinclude.m4
+
+$(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4
 	rm -f config.cache
-	cd ${srcdir} && autoconf
+	cd $(srcdir) && $(AUTOCONF)
+
+$(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
 
 install: install-libs install-headers
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]