From 89f1c38881d566bb731711632ac84ee1e3d883ee Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 19 Oct 2012 23:31:28 +0000 Subject: [PATCH] Use $(built-program-cmd) in io/ftwtest-sh. --- ChangeLog | 7 +++++++ io/Makefile | 5 ++--- io/ftwtest-sh | 24 +++++++++++------------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index baae8c234f..e5d8bbaa6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2012-10-19 Joseph Myers + * io/Makefile ($(objpfx)ftwtest.out): Depend on ftwtest-sh. Pass + script to $(SHELL) as $<. Pass $(common-objpfx) to script + directly. Pass built executable to script as + $(built-program-cmd). + * io/ftwtest-sh (ldso): Remove variable. Run ftwtest directly as + $testprogram without using LD_LIBRARY_PATH and $ldso. + * grp/Makefile ($(objpfx)tst_fgetgrent.out): Pass $(run-program-prefix) to tst_fgetgrent.sh, not $(elf-objpfx) and $(rtld-installed-name). diff --git a/io/Makefile b/io/Makefile index f6534c0bb4..9601a6ff6c 100644 --- a/io/Makefile +++ b/io/Makefile @@ -101,7 +101,6 @@ tst-statvfs-ARGS = $(objpfx)tst-statvfs tst-statvfs.c /tmp ifeq ($(cross-compiling),no) tests: $(objpfx)ftwtest.out -$(objpfx)ftwtest.out: $(objpfx)ftwtest - $(SHELL) ftwtest-sh $(shell cd $(common-objpfx). && pwd)/ \ - $(shell cd $( $@ +$(objpfx)ftwtest.out: ftwtest-sh $(objpfx)ftwtest + $(SHELL) $< $(common-objpfx) '$(built-program-cmd)' > $@ endif diff --git a/io/ftwtest-sh b/io/ftwtest-sh index 93b2e669fb..adc66678d2 100644 --- a/io/ftwtest-sh +++ b/io/ftwtest-sh @@ -47,8 +47,6 @@ export LANG tmp=`pwd | sed 's|\(.\)/*$|\1|'` tmpdir=$tmp/ftwtest.d -[ -f ${objpfx}elf/ld.so ] && ldso=${objpfx}elf/ld.so - trap 'chmod -fR a+x $tmpdir; rm -fr $tmpdir $testout' 1 2 3 15 if test -d $tmpdir; then @@ -73,7 +71,7 @@ chmod a-x,a+r $tmpdir/bar testout=$tmp/ftwtest.out -LD_LIBRARY_PATH=$objpfx $ldso $testprogram $tmpdir | +$testprogram $tmpdir | sort > $testout cat < $testout cat < $testout cat < $testout # perhaps $tmp involves some symlinks... @@ -159,7 +157,7 @@ rm $testout curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd` cd "$tmp" -LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d | +$testprogram --chdir ftwtest.d | sort > $testout cd "$curwd" @@ -181,7 +179,7 @@ rm $testout curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd` cd "$tmp" -LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/. | +$testprogram --chdir ftwtest.d/. | sort > $testout cd "$curwd" @@ -203,7 +201,7 @@ rm $testout curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd` cd "$tmp" -LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/foo/lvl1/link@1 | +$testprogram --chdir ftwtest.d/foo/lvl1/link@1 | sort > $testout cd "$curwd" @@ -212,7 +210,7 @@ base = "ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/ft EOF rm $testout -LD_LIBRARY_PATH=$objpfx $ldso $testprogram --early-exit $tmpdir | +$testprogram --early-exit $tmpdir | sort > $testout cat < $tmpdir/foo/lvl1b/file@1b echo > $tmpdir/foo/lvl1b/file2@1b echo > $tmpdir/foo/lvl1b/file3@1b -LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-subtree=lvl1 $tmpdir | +$testprogram --skip-subtree=lvl1 $tmpdir | sort > $testout cat < $testout # The filesystem is not required to put lvl1 before lvl1b. @@ -267,7 +265,7 @@ base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3 EOF rm $testout -LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-siblings=file@1b $tmpdir | +$testprogram --skip-siblings=file@1b $tmpdir | sort > $testout # The filesystem is not required to put file2@1b and file3@1b after file@1b.