>From 7916288fa566163e0c8f9ab7bde27435b30f7a0f Mon Sep 17 00:00:00 2001 Message-Id: From: Stefano Lattarini Date: Sat, 18 Aug 2012 10:18:47 +0200 Subject: [PATCH] build: support (and require) Automake-NG * configure.ac (AC_PREREQ): Require Autoconf version >= 2.65, since that is the minimal version supported by Automake-NG. (AC_SUBST): Define AM_VARTYPOS_WHITELIST to "LIBFFI_EXECUTABLE_LDFLAGS RELOC_LDFLAGS". This is required because Automake-NG is stricter than mainline Automake in its make runtime checks on possible typos in variables like 'foo_SOURCES' and 'bar_LDADD', and that was causing a spurious failure in the GNU Smalltalk build system. * Makefile.am (AUTOMAKE_OPTIONS): Add the 'ng' option, to ensure that mainstream Automake is not used by mistake when bootstrapping. Also, bump the required Automake version from '1.11.1' to '1.12a', which is the latest (and still development-only) version of Automake-NG at the moment of writing. Drop the 'dist-xz' option, that is not supported anymore. The same effect is now obtained ... (AM_DIST_FORMATS): ... defining this to "gzip xz". * packages/glib/Makefile.am (nodist_gst_glib_la_SOURCES): Don't list 'libs.def' here. There's no need to, because it is already generated early (being listed in BUILT_SOURCES), and its role as a prerequisite is already computed automatically by the automatic dependency tracking code. More importantly, Automake-NG does not blindly treat source files with a custom unknown user extension as if they were header files anymore, so the presence of 'libs.def' here would cause spurious errors. * packages/glib/Makefile.am (INCLUDES): Rename ... (AM_CPPFLAGS): ... like this; 'INCLUDES' was an obsolescent alias for this variable, and the support for it has been removed in Automake-NG (while still present in mainline Automake). * packages/gtk/Makefile.am: Likewise (with 'nodist_gst_gtk_la_SOURCES' in place of 'nodist_gst_glib_la_SOURCES'). * snprintfv/configure.ac: Drop AC_SUBST call on 'INCLUDES'; it's not used nor required. * libgst/Makefile.am (.gperf.inl): Rewrite ... (%.inl: %.gperf): ... as a pattern rule. ($(srcdir)/match.stamp): No need to specify the '$(srcdir)/' explicitly with GNU make (it was once necessary to avoid a bug with FreeBSD VPATH handling); so rename this target simply ... (match.stamp): ... like this. Also, depend on 'genbc$(EXEEXT)', rather than calling '$(MAKE)' recursively in the recipe to build it. Not only is this more efficient, it also avoid possible hanging of "make all" in the 'libgist' subdir; note that this issue was happening only with Automake-NG, not with mainline Automake. ($(srcdir)/prims.stamp): Likewise ... (prims.stamp): ... rename and modify the rule (with the dependency being on 'genprims$(EXEEXT)' this time). ($(srcdir)/vm.stamp): Likewise ... (vm.stamp): ... rename and modify the rule (with the dependency being on 'genvm$(EXEEXT)' this time). (dist-hook, STAMP_FILES): Remove, no more needed. (CLEANFILES): Add all the '*.stamp' files. * packages/i18n/Makefile.am (.sin.sed): Rewrite ... (%.sed: %.sin): ... as this pattern rule. * doc/Makefile.am (.texi.info): Rewrite ... (%.info: %.texi): ... as this pattern rule. * .gitignore: Ignore all the '.am/' directories everywhere; it's used internally by some Automake-NG generated rules. * build-aux/.gitignore: Ignore the 'am-ng/' directory; it's used by Automake-NG to install makefile fragments used by its generated Makefiles. --- .gitignore | 1 + ChangeLog | 62 +++++++++++++++++++++++++++++++++++++++++++++++ Makefile.am | 3 ++- build-aux/.gitignore | 1 + configure.ac | 6 ++++- doc/Makefile.am | 2 +- libgst/Makefile.am | 31 +++++++++--------------- packages/glib/Makefile.am | 6 +++-- packages/gtk/Makefile.am | 7 ++++-- packages/i18n/Makefile.am | 2 +- snprintfv/configure.ac | 1 - 11 files changed, 93 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index 504cfce..a92d716 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ *.lo *.o *.star +.am/ .svn .deps .dirstamp diff --git a/ChangeLog b/ChangeLog index ec4a739..2c19f80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,65 @@ +2012-08-17 Stefano Lattarini + + build: support (and require) Automake-NG + + * configure.ac (AC_PREREQ): Require Autoconf version >= 2.65, + since that is the minimal version supported by Automake-NG. + (AC_SUBST): Define AM_VARTYPOS_WHITELIST to "LIBFFI_EXECUTABLE_LDFLAGS + RELOC_LDFLAGS". This is required because Automake-NG is stricter than + mainline Automake in its make runtime checks on possible typos in + variables like 'foo_SOURCES' and 'bar_LDADD', and that was causing a + spurious failure in the GNU Smalltalk build system. + * Makefile.am (AUTOMAKE_OPTIONS): Add the 'ng' option, to ensure that + mainstream Automake is not used by mistake when bootstrapping. Also, + bump the required Automake version from '1.11.1' to '1.12a', which is + the latest (and still development-only) version of Automake-NG at the + moment of writing. Drop the 'dist-xz' option, that is not supported + anymore. The same effect is now obtained ... + (AM_DIST_FORMATS): ... defining this to "gzip xz". + * packages/glib/Makefile.am (nodist_gst_glib_la_SOURCES): Don't list + 'libs.def' here. There's no need to, because it is already generated + early (being listed in BUILT_SOURCES), and its role as a prerequisite + is already computed automatically by the automatic dependency tracking + code. More importantly, Automake-NG does not blindly treat source + files with a custom unknown user extension as if they were header + files anymore, so the presence of 'libs.def' here would cause spurious + errors. + * packages/glib/Makefile.am (INCLUDES): Rename ... + (AM_CPPFLAGS): ... like this; 'INCLUDES' was an obsolescent alias for + this variable, and the support for it has been removed in Automake-NG + (while still present in mainline Automake). + * packages/gtk/Makefile.am: Likewise (with 'nodist_gst_gtk_la_SOURCES' + in place of 'nodist_gst_glib_la_SOURCES'). + * snprintfv/configure.ac: Drop AC_SUBST call on 'INCLUDES'; it's not + used nor required. + * libgst/Makefile.am (.gperf.inl): Rewrite ... + (%.inl: %.gperf): ... as a pattern rule. + ($(srcdir)/match.stamp): No need to specify the '$(srcdir)/' explicitly + with GNU make (it was once necessary to avoid a bug with FreeBSD VPATH + handling); so rename this target simply ... + (match.stamp): ... like this. Also, depend on 'genbc$(EXEEXT)', rather + than calling '$(MAKE)' recursively in the recipe to build it. Not only + is this more efficient, it also avoid possible hanging of "make all" + in the 'libgist' subdir; note that this issue was happening only with + Automake-NG, not with mainline Automake. + ($(srcdir)/prims.stamp): Likewise ... + (prims.stamp): ... rename and modify the rule (with the dependency + being on 'genprims$(EXEEXT)' this time). + ($(srcdir)/vm.stamp): Likewise ... + (vm.stamp): ... rename and modify the rule (with the dependency + being on 'genvm$(EXEEXT)' this time). + (dist-hook, STAMP_FILES): Remove, no more needed. + (CLEANFILES): Add all the '*.stamp' files. + * packages/i18n/Makefile.am (.sin.sed): Rewrite ... + (%.sed: %.sin): ... as this pattern rule. + * doc/Makefile.am (.texi.info): Rewrite ... + (%.info: %.texi): ... as this pattern rule. + * .gitignore: Ignore all the '.am/' directories everywhere; it's + used internally by some Automake-NG generated rules. + * build-aux/.gitignore: Ignore the 'am-ng/' directory; it's used by + Automake-NG to install makefile fragments used by its generated + Makefiles. + 2012-02-22 Paolo Bonzini * kernel/CallinProcess.st: Fix creation of cloned process, reported diff --git a/Makefile.am b/Makefile.am index 732a72c..8159dd1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,7 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Automake requirements -AUTOMAKE_OPTIONS = gnu 1.11 dist-xz +AUTOMAKE_OPTIONS = ng gnu 1.12a +AM_DIST_FORMATS = gzip xz ACLOCAL_AMFLAGS = -I build-aux PACKAGE=smalltalk diff --git a/build-aux/.gitignore b/build-aux/.gitignore index d79bca9..df920ab 100644 --- a/build-aux/.gitignore +++ b/build-aux/.gitignore @@ -1,3 +1,4 @@ +am-ng/ compile config.guess config.sub diff --git a/configure.ac b/configure.ac index c040d4c..d509670 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ dnl with this software. dnl Process this file with autoconf to produce a configure script. dnl 2.63 needed by testsuite, actually -AC_PREREQ(2.63) +AC_PREREQ(2.65) AC_INIT([GNU Smalltalk], 3.2.90, address@hidden, smalltalk, [http://smalltalk.gnu.org/]) MAINTAINER="address@hidden" @@ -24,6 +24,10 @@ GST_PROG_GAWK AM_INIT_AUTOMAKE AC_CANONICAL_HOST +# Avoid spurious failures with Automake-NG. +AC_SUBST([AM_VARTYPOS_WHITELIST], + ['RELOC_LDFLAGS LIBFFI_EXECUTABLE_LDFLAGS']) + if test -d $srcdir/.git; then GIT_REVISION=-`git rev-parse --short HEAD 2>/dev/null || echo git` else diff --git a/doc/Makefile.am b/doc/Makefile.am index a89a38a..c6d7317 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -159,7 +159,7 @@ $(srcdir)/classes.texi: $(top_srcdir)/kernel/stamp-classes # In TeX output, having colons in index entries looks pretty, but # this is impossible in info output!!! So we hack by replacing # colons with underscores in the info file. -.texi.info: +%info: %.texi @cd $(srcdir) && rm -f $@ address@hidden address@hidden fixed=`pwd`/`echo $< | $(SED) 's/\.texi/-fixed&/' `; \ cd $(srcdir) && \ diff --git a/libgst/Makefile.am b/libgst/Makefile.am index 5a28027..6082a35 100644 --- a/libgst/Makefile.am +++ b/libgst/Makefile.am @@ -16,6 +16,7 @@ include_HEADERS = gstpub.h gst.h lib_LTLIBRARIES = libgst.la EXTRA_PROGRAMS = genprims genbc genvm CLEANFILES = genprims$(EXEEXT) genbc$(EXEEXT) genvm$(EXEEXT) \ + prims.stamp match.stamp vm.stamp \ genbc-decl.stamp genbc-impl.stamp genpr-parse.stamp genvm-parse.stamp # definitions for libgst.la @@ -81,7 +82,6 @@ BUILT_SOURCES = prims.inl match.h builtins.inl vm.inl \ genvm-parse.c genvm-scan.c genvm-parse.h dist_noinst_DATA = valgrind.supp prims.def byte.def vm.def builtins.gperf -STAMP_FILES = prims.stamp match.stamp vm.stamp noinst_HEADERS = \ gstpriv.h files.h lex.h str.h re.h \ @@ -109,11 +109,10 @@ noinst_HEADERS = \ # Try to economize in the rebuilds, by avoiding unnecessary # changes to the timestamp of match.h -$(srcdir)/match.h: $(srcdir)/match.stamp +$(srcdir)/match.h: match.stamp @: -$(srcdir)/match.stamp: byte.def byte.c opt.c xlat.c - @$(MAKE) genbc$(EXEEXT) +match.stamp: byte.def byte.c opt.c xlat.c genbc$(EXEEXT) @echo "./genbc$(EXEEXT) $(srcdir)/byte.def $(srcdir)/byte.c $(srcdir)/opt.c $(srcdir)/xlat.c > match.h"; \ ./genbc$(EXEEXT) $(srcdir)/byte.def $(srcdir)/byte.c $(srcdir)/opt.c $(srcdir)/xlat.c > _match.h @if cmp _match.h $(srcdir)/match.h > /dev/null 2>&1; then \ @@ -122,18 +121,17 @@ $(srcdir)/match.stamp: byte.def byte.c opt.c xlat.c else \ mv _match.h $(srcdir)/match.h; \ fi - @echo timestamp > $(srcdir)/match.stamp + @echo timestamp > $@ # rules for invoking genprims # Try to economize in the rebuilds, by avoiding unnecessary # changes to the timestamp of prims.inl -$(srcdir)/prims.inl: $(srcdir)/prims.stamp +$(srcdir)/prims.inl: prims.stamp @: -$(srcdir)/prims.stamp: prims.def - @$(MAKE) genprims$(EXEEXT) +prims.stamp: prims.def genprims$(EXEEXT) @echo "./genprims$(EXEEXT) < $(srcdir)/prims.def > prims.inl"; \ ./genprims$(EXEEXT) < $(srcdir)/prims.def > _prims.inl @if cmp _prims.inl $(srcdir)/prims.inl > /dev/null 2>&1; then \ @@ -142,17 +140,16 @@ $(srcdir)/prims.stamp: prims.def else \ mv _prims.inl $(srcdir)/prims.inl; \ fi - @echo timestamp > $(srcdir)/prims.stamp + @echo timestamp > $@ # rules for invoking genvm # Try to economize in the rebuilds, by avoiding unnecessary # changes to the timestamp of vm.inl -$(srcdir)/vm.inl: $(srcdir)/vm.stamp +$(srcdir)/vm.inl: vm.stamp @: -$(srcdir)/vm.stamp: vm.def - @$(MAKE) genvm$(EXEEXT) +vm.stamp: vm.def genvm$(EXEEXT) @echo "./genvm$(EXEEXT) < $(srcdir)/vm.def | awk '{ /^#/ && gsub(/__oline__/,NR+1); print }' > vm.inl"; \ ./genvm$(EXEEXT) < $(srcdir)/vm.def | awk '{ /^#/ && gsub(/__oline__/,NR+1); print }' > _vm.inl @if cmp _vm.inl $(srcdir)/vm.inl > /dev/null 2>&1; then \ @@ -161,12 +158,12 @@ $(srcdir)/vm.stamp: vm.def else \ mv _vm.inl $(srcdir)/vm.inl; \ fi - @echo timestamp > $(srcdir)/vm.stamp + @echo timestamp > $@ # rules for invoking gperf # not fully idiot-proof but only to be run by maintainers -.gperf.inl: +%.inl: %.gperf @opts="$< `$(SED) -ne /.*gperf/!d -e s///p -e q $< | \ $(SED) 's,$$(srcdir),$(srcdir),g'`"; \ echo $(GPERF) $$opts " > $@"; \ @@ -180,9 +177,3 @@ $(srcdir)/vm.stamp: vm.def done builtins.inl: builtins.gperf - -dist-hook: - for i in $(STAMP_FILES); do \ - echo timestamp > $(distdir)/$$i; \ - done - diff --git a/packages/glib/Makefile.am b/packages/glib/Makefile.am index 4ff4566..ae340af 100644 --- a/packages/glib/Makefile.am +++ b/packages/glib/Makefile.am @@ -16,14 +16,16 @@ gst_glib_la_LDFLAGS = $(gst_module_ldflags) gst_glib_la_LIBADD = $(ALL_LIBS) libgst-gobject.la ../../lib-src/library.la gst_glib_la_DEPENDENCIES = libgst-gobject.la dist_gst_glib_la_SOURCES = gst-glib.c -nodist_gst_glib_la_SOURCES = libs.def BUILT_SOURCES = libs.def # Work around bug in Automake (or is it Libtool?) The gst-glib library is # installed before libgst-gobject has been relinked. .NOTPARALLEL: -INCLUDES = -I$(top_srcdir)/libgst -I$(top_srcdir)/lib-src -I$(top_srcdir)/libltdl +AM_CPPFLAGS = \ + -I$(top_srcdir)/libgst \ + -I$(top_srcdir)/lib-src \ + -I$(top_srcdir)/libltdl AM_CFLAGS = $(GLIB_CFLAGS) $(GTHREAD_CFLAGS) diff --git a/packages/gtk/Makefile.am b/packages/gtk/Makefile.am index c136f38..3229e31 100644 --- a/packages/gtk/Makefile.am +++ b/packages/gtk/Makefile.am @@ -21,7 +21,6 @@ moduleexec_LTLIBRARIES = gst-gtk.la gst_gtk_la_LDFLAGS = $(gst_module_ldflags) gst_gtk_la_LIBADD = $(ALL_LIBS) ../glib/libgst-gobject.la dist_gst_gtk_la_SOURCES = gst-gtk.c placer.c -nodist_gst_gtk_la_SOURCES = libs.def BUILT_SOURCES = libs.def dist_noinst_HEADERS = placer.h @@ -30,7 +29,11 @@ testplacer_SOURCES = testplacer.c testplacer_LDADD = $(GLIB_LIBS) $(GTK_LIBS) -INCLUDES = -I$(top_srcdir)/libgst -I$(top_srcdir)/lib-src -I$(top_srcdir)/libltdl -I$(top_srcdir)/packages/glib +AM_CPPFLAGS = \ + -I$(top_srcdir)/libgst \ + -I$(top_srcdir)/lib-src \ + -I$(top_srcdir)/libltdl \ + -I$(top_srcdir)/packages/glib AM_CFLAGS = $(GLIB_CFLAGS) $(GTK_CFLAGS) $(PANGO_CFLAGS) $(ATK_CFLAGS) diff --git a/packages/i18n/Makefile.am b/packages/i18n/Makefile.am index 2ba4815..dc90582 100644 --- a/packages/i18n/Makefile.am +++ b/packages/i18n/Makefile.am @@ -15,7 +15,7 @@ EXTRA_DIST = ref-add.sin ref-del.sin config.charset noinst_SCRIPTS = ref-add.sed ref-del.sed CLEANFILES = ref-add.sed ref-del.sed charset.alias -.sin.sed: +%.sed: %.sin $(SED) -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@ mv t-$@ $@ diff --git a/snprintfv/configure.ac b/snprintfv/configure.ac index dbfd4f3..61eaa5c 100644 --- a/snprintfv/configure.ac +++ b/snprintfv/configure.ac @@ -343,7 +343,6 @@ LTLIBOBJS=`echo "$LIB@&address@hidden"|sed 's,\.o ,.lo,g;s,\.o$,.lo,'` AC_SUBST(LTLIBOBJS) AC_SUBST(LIBS) -AC_SUBST(INCLUDES) AC_SUBST(ac_aux_dir) AC_CONFIG_FILES(Makefile snprintfv/Makefile) -- 1.7.12.rc0.129.g61b472e