From: Ralf Wildenhues Date: Thu, 4 Sep 2008 20:04:37 +0000 (+0200) Subject: For all possibly-relative subdirs, use $(am__cd). X-Git-Tag: v1.10b~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fb0f1cec8fec274adf8544879e7cab75e89adbc;p=thirdparty%2Fautomake.git For all possibly-relative subdirs, use $(am__cd). Up to now, $(am__cd) was only used within backquotes, to avoid extraneous output. This patch also uses it for every `cd' to a relative subdir, to prevent CDPATH from entering an unwanted directory. * Makefile.am (maintainer-check): Fix current check for $(am__cd) within backquotes a bit. Add new check for `cd' to a relative subdir. * automake.in (handle_tags, handle_configure): Adjust rules. * lib/am/ansi2knr.am: Likewise. * lib/am/configure.am: Likewise. * lib/am/distdir.am: Likewise. * lib/am/remake-hdr.am: Likewise. * lib/am/subdirs.am: Likewise. * lib/am/tags.am: Likewise. * lib/am/texibuild.am: Likewise. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index ac0eb1ada..ae1310b36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,22 @@ 2008-09-04 Ralf Wildenhues + For all possibly-relative subdirs, use $(am__cd). + Up to now, $(am__cd) was only used within backquotes, to avoid + extraneous output. This patch also uses it for every `cd' to a + relative subdir, to prevent CDPATH from entering an unwanted + directory. + * Makefile.am (maintainer-check): Fix current check for + $(am__cd) within backquotes a bit. Add new check for `cd' to a + relative subdir. + * automake.in (handle_tags, handle_configure): Adjust rules. + * lib/am/ansi2knr.am: Likewise. + * lib/am/configure.am: Likewise. + * lib/am/distdir.am: Likewise. + * lib/am/remake-hdr.am: Likewise. + * lib/am/subdirs.am: Likewise. + * lib/am/tags.am: Likewise. + * lib/am/texibuild.am: Likewise. + Fix nobase-python.test for BSD make. * tests/nobase-python.test: Listing a dependency to be found via VPATH search explicitly, without the path, as a target, diff --git a/HACKING b/HACKING index 3be23bcbc..5e7191f51 100644 --- a/HACKING +++ b/HACKING @@ -64,6 +64,9 @@ * Do not use `cd' within back-quotes, use `$(am__cd)' instead. Otherwise the directory name may be printed, depending on CDPATH. + More generally, do not ever use plain `cd' together with a relative + directory that does not start with a dot, or you might end up in one + computed with CDPATH. * For install and uninstall rules, if a loop is required, it should be silent. Then the body of the loop itself should print each diff --git a/Makefile.am b/Makefile.am index 7fc1fd9d4..2589adc71 100644 --- a/Makefile.am +++ b/Makefile.am @@ -164,7 +164,21 @@ maintainer-check: automake aclocal ## Look for cd within backquotes @if grep -n '^[^#]*` *cd ' $(srcdir)/automake.in \ $(srcdir)/lib/am/*.am; then \ - echo "Consider using $$$$(am__cd) in the line above." 1>&2; \ + echo "Consider using \$$(am__cd) in the lines above." 1>&2; \ + exit 1; \ + fi +## Look for cd to a relative directory (may be influenced by CDPATH). +## Skip some known directories that are OK. + @if grep -n '^[^#]*cd ' $(srcdir)/automake.in \ + $(srcdir)/lib/am/*.am | \ + grep -v 'echo.*cd ' | \ + grep -v 'am__cd =' | \ + grep -v '^[^#]*cd [./]' | \ + grep -v '^[^#]*cd \$$(top_builddir)' | \ + grep -v '^[^#]*cd "\$$\$$am__cwd' | \ + grep -v '^[^#]*cd \$$(abs' | \ + grep -v '^[^#]*cd "\$$(DESTDIR)'; then \ + echo "Consider using \$$(am__cd) in the lines above." 1>&2; \ exit 1; \ fi ## Using @_ in a scalar context is most probably a programming error. diff --git a/Makefile.in b/Makefile.in index c9792af0b..d3665dcd9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -239,13 +239,13 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ - cd $(srcdir) && $(AUTOMAKE) --gnu \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ - cd $(top_srcdir) && \ + $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @@ -262,9 +262,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENC $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) + $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @@ -310,7 +310,7 @@ $(RECURSIVE_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ @@ -344,16 +344,16 @@ $(RECURSIVE_CLEAN_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -415,7 +415,7 @@ CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ + && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: @@ -460,7 +460,7 @@ distdir: $(DISTFILES) dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ - (cd $$subdir && \ + ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ @@ -536,7 +536,7 @@ distcheck: dist chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && cd $(distdir)/_build \ + && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ @@ -564,7 +564,7 @@ distcheck: dist list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @cd '$(distuninstallcheck_dir)' \ + @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ @@ -775,7 +775,19 @@ maintainer-check: automake aclocal fi @if grep -n '^[^#]*` *cd ' $(srcdir)/automake.in \ $(srcdir)/lib/am/*.am; then \ - echo "Consider using $$$$(am__cd) in the line above." 1>&2; \ + echo "Consider using \$$(am__cd) in the lines above." 1>&2; \ + exit 1; \ + fi + @if grep -n '^[^#]*cd ' $(srcdir)/automake.in \ + $(srcdir)/lib/am/*.am | \ + grep -v 'echo.*cd ' | \ + grep -v 'am__cd =' | \ + grep -v '^[^#]*cd [./]' | \ + grep -v '^[^#]*cd \$$(top_builddir)' | \ + grep -v '^[^#]*cd "\$$\$$am__cwd' | \ + grep -v '^[^#]*cd \$$(abs' | \ + grep -v '^[^#]*cd "\$$(DESTDIR)'; then \ + echo "Consider using \$$(am__cd) in the lines above." 1>&2; \ exit 1; \ fi @if grep -Hn '[^@_A-Za-z0-9][_A-Za-z0-9]*[^) ] *= *@_' $(srcdir)/automake.in; then \ diff --git a/automake.in b/automake.in index c49045fb9..baaac964b 100755 --- a/automake.in +++ b/automake.in @@ -3521,7 +3521,7 @@ sub handle_tags . "\tlist=\'\$(SUBDIRS)\'; for subdir in \$\$list; do \\\n" # Never fail here if a subdir fails; it # isn't important. - . "\t test \"\$\$subdir\" = . || (cd \$\$subdir" + . "\t test \"\$\$subdir\" = . || (\$(am__cd) \$\$subdir" . " && \$(MAKE) \$(AM_MAKEFLAGS) tags); \\\n" . "\tdone\n"); push (@tag_deps, 'tags-recursive'); @@ -3531,7 +3531,7 @@ sub handle_tags . "\tlist=\'\$(SUBDIRS)\'; for subdir in \$\$list; do \\\n" # Never fail here if a subdir fails; it # isn't important. - . "\t test \"\$\$subdir\" = . || (cd \$\$subdir" + . "\t test \"\$\$subdir\" = . || (\$(am__cd) \$\$subdir" . " && \$(MAKE) \$(AM_MAKEFLAGS) ctags); \\\n" . "\tdone\n"); push (@ctag_deps, 'ctags-recursive'); diff --git a/doc/Makefile.in b/doc/Makefile.in index e82c47e2c..9df28b3dc 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -214,7 +214,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ - cd $(top_srcdir) && \ + $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @@ -237,7 +237,7 @@ $(am__aclocal_m4_deps): .texi.info: restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - am__cwd=`pwd` && cd $(srcdir) && \ + am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ @@ -249,10 +249,10 @@ $(am__aclocal_m4_deps): -o $@ $<; \ then \ rc=0; \ - cd $(srcdir); \ + $(am__cd) $(srcdir); \ else \ rc=$$?; \ - cd $(srcdir) && \ + $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc @@ -459,7 +459,7 @@ CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ + && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index a5a014a02..eac37eec0 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -243,7 +243,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Automake/Makefile'; \ - cd $(top_srcdir) && \ + $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Automake/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @@ -324,7 +324,7 @@ $(RECURSIVE_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ @@ -358,16 +358,16 @@ $(RECURSIVE_CLEAN_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -429,7 +429,7 @@ CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ + && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: @@ -472,7 +472,7 @@ distdir: $(DISTFILES) dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ - (cd $$subdir && \ + ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index 5cb486e51..32cfdd93c 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -171,7 +171,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Automake/tests/Makefile'; \ - cd $(top_srcdir) && \ + $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Automake/tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status diff --git a/lib/Makefile.in b/lib/Makefile.in index 2c0e7a08e..ae035cb62 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -219,7 +219,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ - cd $(top_srcdir) && \ + $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @@ -300,7 +300,7 @@ $(RECURSIVE_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ @@ -334,16 +334,16 @@ $(RECURSIVE_CLEAN_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -405,7 +405,7 @@ CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ + && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: @@ -448,7 +448,7 @@ distdir: $(DISTFILES) dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ - (cd $$subdir && \ + ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index 9796e1011..d30c8d1f2 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -210,7 +210,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/am/Makefile'; \ - cd $(top_srcdir) && \ + $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/am/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status diff --git a/lib/am/ansi2knr.am b/lib/am/ansi2knr.am index 7dafd1e0d..ee106c59f 100644 --- a/lib/am/ansi2knr.am +++ b/lib/am/ansi2knr.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1997, 2001, 2003 +## Copyright (C) 1994, 1995, 1996, 1997, 2001, 2003, 2008 ## Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify @@ -27,7 +27,7 @@ if %?ANSI2KNR-DIR% ANSI2KNR = %ANSI2KNR-DIR%/ansi2knr %ANSI2KNR-DIR%/ansi2knr: - cd %ANSI2KNR-DIR% && $(MAKE) $(AM_MAKEFLAGS) ./ansi2knr + $(am__cd) %ANSI2KNR-DIR% && $(MAKE) $(AM_MAKEFLAGS) ./ansi2knr else !%?ANSI2KNR-DIR% diff --git a/lib/am/configure.am b/lib/am/configure.am index 4623f4148..e24e9a6cb 100644 --- a/lib/am/configure.am +++ b/lib/am/configure.am @@ -40,7 +40,7 @@ endif %?TOPDIR_P% case '$(am__configure_deps)' in \ *$$dep*) \ ?TOPDIR_P? echo ' cd $(srcdir) && $(AUTOMAKE) --%STRICTNESS% %USE-DEPS%'; \ -?TOPDIR_P? cd $(srcdir) && $(AUTOMAKE) --%STRICTNESS% %USE-DEPS% \ +?TOPDIR_P? $(am__cd) $(srcdir) && $(AUTOMAKE) --%STRICTNESS% %USE-DEPS% \ ?TOPDIR_P? && exit 0; \ ?!TOPDIR_P? ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ ## If on the other hand, subdir/Makefile.in has been removed, then toplevel @@ -53,7 +53,7 @@ endif %?TOPDIR_P% done; \ ## Otherwise, rebuild only this file. echo ' cd $(top_srcdir) && $(AUTOMAKE) --%STRICTNESS% %USE-DEPS% %MAKEFILE-AM-SOURCES%'; \ - cd $(top_srcdir) && \ + $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --%STRICTNESS% %USE-DEPS% %MAKEFILE-AM-SOURCES% ## Ensure that GNU make doesn't remove Makefile if ./config.status (below) @@ -102,7 +102,7 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENC ?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: %MAINTAINER-MODE% $(am__configure_deps) -?TOPDIR_P? cd $(srcdir) && $(AUTOCONF) +?TOPDIR_P? $(am__cd) $(srcdir) && $(AUTOCONF) ?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -119,7 +119,7 @@ $(top_srcdir)/configure: %MAINTAINER-MODE% $(am__configure_deps) ## the $(am__configure_deps) dependency. if %?REGEN-ACLOCAL-M4% $(ACLOCAL_M4): %MAINTAINER-MODE% $(am__aclocal_m4_deps) -?TOPDIR_P? cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +?TOPDIR_P? $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) ?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ## Avoid the "deleted header file" problem for the dependencies. diff --git a/lib/am/distdir.am b/lib/am/distdir.am index 825b5617b..41e9b2bda 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -1,6 +1,6 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software -## Foundation, Inc. +## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free +## Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -206,7 +206,7 @@ if %?SUBDIRS% dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ - (cd $$subdir && \ + ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ @@ -390,7 +390,7 @@ distcheck: dist ## create very long directory names. && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ ?DISTCHECK-HOOK? && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \ - && cd $(distdir)/_build \ + && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ ?GETTEXT? --with-included-gettext \ ## Additional flags for configure. Keep this last in the configure @@ -440,7 +440,7 @@ distuninstallcheck_listfiles = find . -type f -print distuninstallcheck: ## We use -le 1 because the `dir' file (created by install-info) ## might still exist after uninstall. - @cd '$(distuninstallcheck_dir)' \ + @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ diff --git a/lib/am/remake-hdr.am b/lib/am/remake-hdr.am index 421a9823f..c1bc42f0a 100644 --- a/lib/am/remake-hdr.am +++ b/lib/am/remake-hdr.am @@ -35,7 +35,7 @@ ## by autoheader. if %?FIRST% %CONFIG_HIN%: %MAINTAINER-MODE% $(am__configure_deps) %FILES% - cd $(top_srcdir) && $(AUTOHEADER) + $(am__cd) $(top_srcdir) && $(AUTOHEADER) ## Whenever $(AUTOHEADER) has run, we must make sure that ## ./config.status will rebuild config.h. The dependency from %STAMP% ## on %CONFIG_H_DEPS% (which contains config.hin) is not enough to diff --git a/lib/am/subdirs.am b/lib/am/subdirs.am index 83ad2573d..188804263 100644 --- a/lib/am/subdirs.am +++ b/lib/am/subdirs.am @@ -1,6 +1,6 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 -## Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, +## 2004, 2008 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -49,7 +49,7 @@ $(RECURSIVE_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ @@ -102,6 +102,6 @@ $(RECURSIVE_CLEAN_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" diff --git a/lib/am/tags.am b/lib/am/tags.am index 191274d0c..a654ec86d 100644 --- a/lib/am/tags.am +++ b/lib/am/tags.am @@ -124,7 +124,7 @@ CTAGS: %CTAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \ .PHONY: GTAGS GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ + && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" diff --git a/lib/am/texibuild.am b/lib/am/texibuild.am index ac49073e3..aafa08180 100644 --- a/lib/am/texibuild.am +++ b/lib/am/texibuild.am @@ -1,6 +1,6 @@ ## automake - create Makefile.in from Makefile.am ## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -## 2003, 2004, 2005 Free Software Foundation, Inc. +## 2003, 2004, 2005, 2008 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ ## developer while he writes documentation.) ## *.iNN files are used on DJGPP. See the comments in install-info-am restore=: && backupdir="$(am__leading_dot)am$$$$" && \ -?INSRC? am__cwd=`pwd` && cd $(srcdir) && \ +?INSRC? am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ ## If makeinfo is not installed we must not backup the files so ##`missing' can do its job and touch $@ if it exists. @@ -49,11 +49,11 @@ ?INSRC??GENERIC_INFO? -o $@ $<; \ then \ rc=0; \ -?INSRC? cd $(srcdir); \ +?INSRC? $(am__cd) $(srcdir); \ else \ rc=$$?; \ ## Beware that backup info files might come from a subdirectory. -?INSRC? cd $(srcdir) && \ +?INSRC? $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc diff --git a/m4/Makefile.in b/m4/Makefile.in index 4a2504e5d..bd44eeaac 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -207,7 +207,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ - cd $(top_srcdir) && \ + $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu m4/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status diff --git a/tests/Makefile.in b/tests/Makefile.in index 783ab8beb..ac99bace7 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -812,7 +812,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ - cd $(top_srcdir) && \ + $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status