maint: no more make recursion in Automake's build system
[platform/upstream/automake.git] / t / self-check-reexec.tap
index 48e5cfb..8237c08 100755 (executable)
@@ -26,7 +26,7 @@ plan_ 32
 unset AM_TESTS_REEXEC BASH_VERSION || :
 
 cwd=`pwd` || fatal_ "cannot get current working directory"
-cp ../defs .
+cp "$am_top_builddir"/defs . || fatal_ "fetching 'defs' from top_builddir"
 
 #
 # Search for required bash and non-bash shells.
@@ -97,9 +97,9 @@ cat > need-bash.sh <<'END'
 (foo=abac && test xbxc = ${foo//a/x} && test -n "$BASH_VERSION")
 END
 
-sed -e "s|^testbuilddir=.*|testbuilddir='$cwd'|" \
+sed -e "s|^am_top_builddir=.*|am_top_builddir='$cwd'|" \
     -e 's|^SHELL=.*$|SHELL=bash; export SHELL|' \
-    < ../defs-static >defs-static
+    < "$am_top_builddir"/defs-static >defs-static
 
 do_reexec ()
 {
@@ -151,10 +151,10 @@ chmod a+x dummy.sh checkargs.sh
 
 mkdir sub
 cp dummy.sh checkargs.sh defs sub
-sed -e "s|^testbuilddir=.*|testbuilddir='$cwd'|" \
-    < ../defs-static > defs-static
-sed -e "s|^testbuilddir=.*|testbuilddir='$cwd/sub'|" \
-    < ../defs-static > sub/defs-static
+sed -e "s|^am_top_builddir=.*|am_top_builddir='$cwd'|" \
+    <  "$am_top_builddir"/defs-static > defs-static
+sed -e "s|^am_top_builddir=.*|am_top_builddir='$cwd/sub'|" \
+    <  "$am_top_builddir"/defs-static > sub/defs-static
 
 check_preserve_args ()
 {