From dc3cdb1d53c51c95981dbf77b05f70e4040075b9 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Fri, 3 May 2013 20:56:02 +0200 Subject: build: tiny reduction in code duplication The code was only duplicated two times, but we are soon going to need a third occurrence, and that would be one to much. * Makefile.am (extend_path): New. (update_mans): Use it instead of copying & pasting its contents. ($(srcdir)/doc/amhello-1.0.tar.gz): Likewise, and minor related adjustments. Signed-off-by: Stefano Lattarini --- Makefile.am | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index ab1dfedd8..7ac03df76 100644 --- a/Makefile.am +++ b/Makefile.am @@ -73,6 +73,11 @@ EXTRA_DIST += \ syntax-checks.mk \ HACKING +# For some tests or targets, we need to have the just-build automake and +# aclocal scripts avaiable on PATH. +extend_PATH = \ + { PATH='$(abs_builddir)/t/wrap'$(PATH_SEPARATOR)$$PATH && export PATH; } + # Make versioned links. We only run the transform on the root name; # then we make a versioned link with the transformed base name. This # seemed like the most reasonable approach. @@ -574,8 +579,7 @@ EXTRA_DIST += doc/help2man update_mans = \ $(AM_V_GEN): \ && $(MKDIR_P) doc \ - && PATH="$(abs_builddir)/t/wrap$(PATH_SEPARATOR)$$PATH" \ - && export PATH \ + && $(extend_PATH) \ && $(PERL) $(srcdir)/doc/help2man --output=$@ doc/aclocal.1 doc/automake.1: @@ -617,13 +621,11 @@ dist_doc_DATA = $(srcdir)/doc/amhello-1.0.tar.gz # We depend on configure.ac so that we regenerate the tarball # whenever the Automake version changes. -# aclocal-$(APIVERSION) and automake-$(APIVERSION) are generated by -# configure in 't/wrap'. $(srcdir)/doc/amhello-1.0.tar.gz: $(amhello_sources) $(srcdir)/configure.ac $(AM_V_GEN)tmp=amhello-output.tmp \ - && PATH="$(abs_top_builddir)/t/wrap$(PATH_SEPARATOR)$$PATH" \ - && export PATH \ && $(am__cd) $(srcdir)/doc/amhello \ + && : Make our aclocal and automake avaiable before system ones; \ + && $(extend_PATH) \ && ACLOCAL=aclocal-$(APIVERSION) && export ACLOCAL \ && AUTOMAKE=automake-$(APIVERSION) && export AUTOMAKE \ && AUTOCONF='$(am_AUTOCONF)' && export AUTOCONF \ -- cgit v1.2.1 From eddba1ccc124aaed5a613260b259f73e2aedf825 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Fri, 3 May 2013 21:02:42 +0200 Subject: build: preparatory refactoring No semantic change intended. This change will be required by a later patch. * Makefile.am (setup_autotools_paths): New. ($(srcdir)/doc/amhello-1.0.tar.gz): Use it. Signed-off-by: Stefano Lattarini --- Makefile.am | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 7ac03df76..0b337f1db 100644 --- a/Makefile.am +++ b/Makefile.am @@ -619,20 +619,25 @@ amhello_configury = \ dist_noinst_DATA += $(amhello_sources) dist_doc_DATA = $(srcdir)/doc/amhello-1.0.tar.gz +setup_autotools_paths = { \ + $(extend_PATH) \ + && ACLOCAL=aclocal-$(APIVERSION) && export ACLOCAL \ + && AUTOMAKE=automake-$(APIVERSION) && export AUTOMAKE \ + && AUTOCONF='$(am_AUTOCONF)' && export AUTOCONF \ + && AUTOM4TE='$(am_AUTOM4TE)' && export AUTOM4TE \ + && AUTORECONF='$(am_AUTORECONF)' && export AUTORECONF \ + && AUTOHEADER='$(am_AUTOHEADER)' && export AUTOHEADER \ + && AUTOUPDATE='$(am_AUTOUPDATE)' && export AUTOUPDATE \ + && true; \ +} + # We depend on configure.ac so that we regenerate the tarball # whenever the Automake version changes. $(srcdir)/doc/amhello-1.0.tar.gz: $(amhello_sources) $(srcdir)/configure.ac $(AM_V_GEN)tmp=amhello-output.tmp \ && $(am__cd) $(srcdir)/doc/amhello \ - && : Make our aclocal and automake avaiable before system ones; \ - && $(extend_PATH) \ - && ACLOCAL=aclocal-$(APIVERSION) && export ACLOCAL \ - && AUTOMAKE=automake-$(APIVERSION) && export AUTOMAKE \ - && AUTOCONF='$(am_AUTOCONF)' && export AUTOCONF \ - && AUTOM4TE='$(am_AUTOM4TE)' && export AUTOM4TE \ - && AUTORECONF='$(am_AUTORECONF)' && export AUTORECONF \ - && AUTOHEADER='$(am_AUTOHEADER)' && export AUTOHEADER \ - && AUTOUPDATE='$(am_AUTOUPDATE)' && export AUTOUPDATE \ + && : Make our aclocal and automake avaiable before system ones. \ + && $(setup_autotools_paths) \ && ( \ { $(AM_V_P) || exec 5>&2 >$$tmp 2>&1; } \ && $(am_AUTORECONF) -vfi \ -- cgit v1.2.1