From: Gary V. Vaughan Date: Mon, 26 Mar 2007 20:18:43 +0000 (+0000) Subject: The stamp-vcl file rules caused non-gnu make programs to rerun X-Git-Tag: release-2-1b~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c193153265e32174b823066c00fdaab0fb781ec5;p=thirdparty%2Flibtool.git The stamp-vcl file rules caused non-gnu make programs to rerun parts of the configuration process on each invocation. Instead of relying on a stamp file, we now compare version numbers of generated files with the ChangeLog timestamp manually in the affected make rules to decide whether regenerating is necessary: * Makefile.am (EXTRA_DIST): Remove stamp-vcl. (clean-ltmain-sh): Also remove users' obsolescent stamp-vcl. (rebuild): Keep some common code here for... (libtool, libltdl/m4/ltversion.m4, libltdl/config/ltmain.sh): Rewritten to work without reference to intermediate stamp-vcl file. * configure.ac (CONFIG_STATUS_DEPENDENCIES): Change from stamp-vcl to ChangeLog. * NEWS: Removed entry saying this fix is needed. --- diff --git a/ChangeLog b/ChangeLog index 18ae0feff..3cb24e084 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2007-03-26 Gary V. Vaughan + + The stamp-vcl file rules caused non-gnu make programs to rerun + parts of the configuration process on each invocation. Instead + of relying on a stamp file, we now compare version numbers of + generated files with the ChangeLog timestamp manually in the + affected make rules to decide whether regenerating is necessary: + + * Makefile.am (EXTRA_DIST): Remove stamp-vcl. + (clean-ltmain-sh): Also remove users' obsolescent stamp-vcl. + (rebuild): Keep some common code here for... + (libtool, libltdl/m4/ltversion.m4, libltdl/config/ltmain.sh): + Rewritten to work without reference to intermediate stamp-vcl + file. + * configure.ac (CONFIG_STATUS_DEPENDENCIES): Change from + stamp-vcl to ChangeLog. + * NEWS: Removed entry saying this fix is needed. + 2007-03-25 Gary V. Vaughan * HACKING (LGPL with Libtool exception clause): Typo. diff --git a/Makefile.am b/Makefile.am index 75756ab1d..3f9aa6f96 100644 --- a/Makefile.am +++ b/Makefile.am @@ -47,6 +47,16 @@ m4dir = libltdl/m4 # Using `cd' in backquotes may print the directory name, use this instead: lt__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +MKSTAMP = $(SHELL) $(srcdir)/$(auxdir)/mkstamp + +timestamp = set dummy `$(MKSTAMP) < $(srcdir)/ChangeLog`; shift; \ + case $(VERSION) in \ + *[acegikmoqsuwy]) TIMESTAMP=" $$1 $$2 $$3" ;; \ + *) TIMESTAMP="" ;; \ + esac + +rebuild = rebuild=:; $(timestamp); correctver=$$1 + ## ---------------- ## ## Libtool scripts. ## @@ -76,9 +86,19 @@ $(srcdir)/libtoolize.in: $(sh_files) libtoolize.m4sh Makefile.am rm -f libtoolize.in; \ $(M4SH) -B $(auxdir) libtoolize.m4sh > libtoolize.in -libtool: $(top_builddir)/config.status $(srcdir)/$(auxdir)/ltmain.sh \ - $(srcdir)/stamp-vcl - cd $(top_builddir) && $(SHELL) ./config.status $@ +# We used to do this with a 'stamp-vcl' file, but non-gmake builds +# would rerun configure on every invocation, so now we manually +# check the version numbers from the build rule when necessary. +libtool: clean-ltmain-sh $(top_builddir)/config.status $(srcdir)/$(auxdir)/ltmain.sh ChangeLog + @target=libtool; $(rebuild); \ + if test -f "$$target"; then \ + set dummy `./$$target --version | sed 1q`; actualver="$$5"; \ + test "$$actualver" = "$$correctver" && rebuild=false; \ + fi; \ + if $$rebuild; then \ + echo $(SHELL) ./config.status $$target; \ + cd $(top_builddir) && $(SHELL) ./config.status $$target; \ + fi .PHONY: configure-subdirs configure-subdirs distdir: $(DIST_MAKEFILE_LIST) @@ -114,15 +134,9 @@ edit = sed \ -e 's,@prefix\@,$(prefix),g' \ -e "s,@configure_input\@,Generated from $$input; do not edit by hand,g" -timestamp = set dummy `$(MKSTAMP) < $(srcdir)/ChangeLog`; shift; \ - case $(VERSION) in \ - *[acegikmoqsuwy]) TIMESTAMP=" $$1 $$2 $$3" ;; \ - *) TIMESTAMP="" ;; \ - esac - sh_files = $(auxdir)/general.m4sh $(auxdir)/getopt.m4sh EXTRA_DIST += bootstrap $(srcdir)/libtoolize.in $(auxdir)/ltmain.m4sh \ - $(auxdir)/mkstamp $(sh_files) stamp-vcl \ + $(auxdir)/mkstamp $(sh_files) \ ChangeLog.1996 ChangeLog.1997 ChangeLog.1998 \ ChangeLog.1999 ChangeLog.2000 ChangeLog.2001 \ ChangeLog.2002 ChangeLog.2003 ChangeLog.2004 \ @@ -130,19 +144,6 @@ EXTRA_DIST += bootstrap $(srcdir)/libtoolize.in $(auxdir)/ltmain.m4sh \ CLEANFILES += libtool libtoolize libtoolize.tmp \ $(auxdir)/ltmain.tmp $(m4dir)/ltversion.tmp -## We know that $(srcdir)/ChangeLog has been edited if stamp-vcl -## needs updating, so we assume we have write access to $(srcdir). -## If we try to maintain ./stamp-vcl to avoid writing to a possibly -## read-only $(srcdir), then when the two stamp-vcls differ, distcheck -## will try to update the one in the read-only source tree it makes. -MKSTAMP = $(SHELL) $(srcdir)/$(auxdir)/mkstamp -$(srcdir)/stamp-vcl: vcl-tmp clean-ltmain-sh ChangeLog -vcl-tmp: - @set dummy `$(MKSTAMP) < $(srcdir)/ChangeLog`; shift; \ - echo "$$1" > vcl.tmp; \ - diff vcl.tmp $(srcdir)/stamp-vcl >/dev/null 2>&1 \ - || (echo "Updating stamp-vcl"; cp vcl.tmp $(srcdir)/stamp-vcl) - -@rm -f vcl.tmp ## We used to build ltmain.sh in the build tree, but now it is created ## in the source tree by bootstrap. This rule removes stale copies from @@ -150,29 +151,45 @@ vcl-tmp: ## source tree version in current builds. clean-ltmain-sh: @-test "$(srcdir)" = "$(top_builddir)" || \ - rm -f "$(top_builddir)/$(auxdir)/ltmain.sh" - -# We build ltversion.m4 here, instead of from config.status, -# because config.status is rerun each time one of configure's -# dependencies change and ltversion.m4 happens to be a configure -# dependency. configure and ltversion.m4 would be rebuilt in -# a loop otherwise. -# Use `$(srcdir)/m4' for the benefit of non-GNU makes: this is -# how ltversion.m4 appears in our dependencies. + rm -f "$(top_builddir)/$(auxdir)/ltmain.sh" stamp-vcl + +## We build ltversion.m4 here, instead of from config.status, +## because config.status is rerun each time one of configure's +## dependencies change and ltversion.m4 happens to be a configure +## dependency. configure and ltversion.m4 would be rebuilt in +## a loop otherwise. +## We used to do this with a 'stamp-vcl' file, but non-gmake builds +## would rerun configure on every invocation, so now we manually +## check the version numbers from the build rule when necessary. +## Use `$(srcdir)/m4' for the benefit of non-GNU makes: this is +## how ltversion.m4 appears in our dependencies. EXTRA_DIST += $(m4dir)/ltversion.in $(srcdir)/$(m4dir)/ltversion.m4 -$(srcdir)/$(m4dir)/ltversion.m4: $(m4dir)/ltversion.in configure.ac $(srcdir)/stamp-vcl - set dummy `$(MKSTAMP) < $(srcdir)/ChangeLog`; shift; \ - cd $(srcdir); \ - rm -f $(m4dir)/ltversion.tmp; \ - serial=`echo $$1 | sed 's,^1[.],,g'`; \ - input="ltversion.in"; \ - $(edit) -e "s,@MACRO_REVISION\@,$$1,g" \ - -e "s,@MACRO_SERIAL\@,$$serial,g" \ - $(m4dir)/ltversion.in > $(m4dir)/ltversion.tmp; \ - chmod a-w $(m4dir)/ltversion.tmp; \ - mv -f $(m4dir)/ltversion.tmp $(m4dir)/ltversion.m4 +$(srcdir)/$(m4dir)/ltversion.m4: clean-ltmain-sh $(m4dir)/ltversion.in configure.ac ChangeLog + @target='$(srcdir)/$(m4dir)/ltversion.m4'; $(rebuild); \ + if test -f "$$target"; then \ + set dummy `sed -n '/^# serial /p' "$$target"`; shift; \ + actualver=1.$$3; \ + test "$$actualver" = "$$correctver" && rebuild=false; \ + fi; \ + if $$rebuild; then \ + cd $(srcdir); \ + rm -f $(m4dir)/ltversion.tmp; \ + serial=`echo "$$correctver" | sed 's,^1[.],,g'`; \ + input="ltversion.in"; \ + echo $(edit) -e "s,@MACRO_REVISION\@,$$correctver,g" \ + -e "s,@MACRO_SERIAL\@,$$serial,g" \ + $(srcdir)/$(m4dir)/ltversion.in > $(srcdir)/$(m4dir)/ltversion.m4; \ + $(edit) -e "s,@MACRO_REVISION\@,$$correctver,g" \ + -e "s,@MACRO_SERIAL\@,$$serial,g" \ + $(m4dir)/ltversion.in > $(m4dir)/ltversion.tmp; \ + chmod a-w $(m4dir)/ltversion.tmp; \ + mv -f $(m4dir)/ltversion.tmp $(m4dir)/ltversion.m4; \ + fi ## And for similar reasons, ltmain.sh can't be built from config.status. +## We used to do this with a 'stamp-vcl' file, but non-gmake builds +## would rerun configure on every invocation, so now we manually +## check the version numbers from the build rule when necessary. ## !WARNING! If you edit this rule to change the contents of ltmain.sh, ## you must `touch $(srcdir)/$(auxdir)/ltmain.in' from the ## shell if you need ltmain.sh to be regenerated. Ideally, we @@ -180,21 +197,30 @@ $(srcdir)/$(m4dir)/ltversion.m4: $(m4dir)/ltversion.in configure.ac $(srcdir)/st ## distcheck (at least) by rebuilding ltmain.sh in the source ## tree whenever config.status regenerates the Makefile. EXTRA_DIST += $(srcdir)/$(auxdir)/ltmain.sh -$(srcdir)/$(auxdir)/ltmain.sh: $(sh_files) $(auxdir)/ltmain.m4sh configure.ac \ - $(srcdir)/stamp-vcl - $(timestamp); \ - cd $(srcdir); \ - rm -f $(auxdir)/ltmain.in $(auxdir)/ltmain.tmp \ +$(srcdir)/$(auxdir)/ltmain.sh: clean-ltmain-sh $(sh_files) $(auxdir)/ltmain.m4sh configure.ac ChangeLog + @target='$(srcdir)/$(auxdir)/ltmain.sh'; $(rebuild); \ + if test -f "$$target"; then \ + eval `sed -n '/^package_revision=/p' "$$target"`; \ + actualver=$$package_revision; \ + test "$$actualver" = "$$correctver" && rebuild=false; \ + fi; \ + if $$rebuild; then \ + cd $(srcdir); \ + rm -f $(auxdir)/ltmain.in $(auxdir)/ltmain.tmp \ $(auxdir)/ltmain.sh; \ - $(M4SH) -B $(auxdir) $(auxdir)/ltmain.m4sh \ + $(M4SH) -B $(auxdir) $(auxdir)/ltmain.m4sh \ > $(auxdir)/ltmain.in; \ - input="ltmain.m4sh"; \ - $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \ + input="ltmain.m4sh"; \ + echo $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \ + -e "s,@package_revision\@,$$correctver," \ + $(srcdir)/$(auxdir)/ltmain.in "> $$target"; \ + $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \ -e "s,@package_revision\@,$$1,g" \ $(auxdir)/ltmain.in > $(auxdir)/ltmain.tmp; \ - rm -f $(auxdir)/ltmain.in; \ - chmod a-w $(auxdir)/ltmain.tmp; \ - mv -f $(auxdir)/ltmain.tmp $(auxdir)/ltmain.sh + rm -f $(auxdir)/ltmain.in; \ + chmod a-w $(auxdir)/ltmain.tmp; \ + mv -f $(auxdir)/ltmain.tmp $(auxdir)/ltmain.sh; \ + fi $(srcdir)/libltdl/Makefile.am: $(srcdir)/libltdl/Makefile.inc cd $(srcdir); \ diff --git a/NEWS b/NEWS index 3c52c666d..ff55563a9 100644 --- a/NEWS +++ b/NEWS @@ -18,9 +18,6 @@ New in 2.1a: 2007-??-??; CVS version 2.1a, Libtool team: `dependency_libs' for both clarity and backward-compatibility. Currently, these flags are not uniquified and thus accumulate. - - GNU make is currently needed to build the Libtool package itself. - This restriction does not extend to packages that use Libtool. - * Important incompatible changes and obsoleted features: - Removed deprecated APIs from libltdl: lt_dlcaller_register, diff --git a/configure.ac b/configure.ac index 9cff3441d..fef579535 100644 --- a/configure.ac +++ b/configure.ac @@ -128,7 +128,7 @@ dnl We use m4sh to generate libtool's portable shell scripts AC_SUBST([M4SH], ['$(AUTOM4TE) --language=m4sh']) dnl Make sure config.status is regenerated when the version timestamp changes -AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/stamp-vcl']) +AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/ChangeLog']) dnl automake-1.9.x or autoconf-2.59 don't support subdir libobjs AC_MSG_CHECKING([whether subdir libobjs are useable])