From a47966515893d9ddf720bbbb001735a5756b6f6b Mon Sep 17 00:00:00 2001 From: Vincent Danjean Date: Thu, 21 Jun 2012 10:03:31 +0200 Subject: fix build *and check* out of tree - use Makefile variables $< (and $@) so that sources are found correctly - use ${srcdir} in test scripts to find the sources This allows "make distcheck" to successfully pass --- tests/Makefile.am | 8 ++++---- tests/no-rpath.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 9d9b6bc..aa9e22b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -18,7 +18,7 @@ main-scoped: main.o libfoo-scoped.so LD_LIBRARY_PATH=. gcc -Wl,--enable-new-dtags -o main-scoped main.o -L . -lfoo-scoped main.o: main.c - $(CC) -fpic -o main.o -c main.c + $(CC) -fpic -o $@ -c $< libfoo.so: foo.o libbar.so NIX_DONT_SET_RPATH=1 $(CC) -Wl,--disable-new-dtags -shared -o libfoo.so foo.o -L . -lbar @@ -27,7 +27,7 @@ libfoo-scoped.so: foo.o libbar-scoped.so NIX_DONT_SET_RPATH=1 $(CC) -Wl,--enable-new-dtags -shared -o libfoo-scoped.so foo.o -L . -lbar-scoped foo.o: foo.c - $(CC) -fpic -o foo.o -c foo.c + $(CC) -fpic -o $@ -c $< libbar.so: bar.o NIX_DONT_SET_RPATH=1 $(CC) -Wl,--disable-new-dtags -shared -o libbar.so bar.o -L . -Wl,-rpath,`pwd`/no-such-path @@ -36,7 +36,7 @@ libbar-scoped.so: bar.o NIX_DONT_SET_RPATH=1 $(CC) -Wl,--enable-new-dtags -shared -o libbar-scoped.so bar.o bar.o: bar.c - $(CC) -fpic -o bar.o -c bar.c + $(CC) -fpic -o $@ -c $< big_dynstr_SOURCES = big-dynstr.c @@ -45,7 +45,7 @@ big-dynstr: big-dynstr.o libfoo.so LD_LIBRARY_PATH=. gcc -Wl,--disable-new-dtags -o big-dynstr big-dynstr.o -L . -lfoo big-dynstr.c: main.c - cat main.c > big-dynstr.c + cat $< > big-dynstr.c for i in $$(seq 1 2000); do echo "void f$$i(void) { };" >> big-dynstr.c; done diff --git a/tests/no-rpath.sh b/tests/no-rpath.sh index c253952..7245317 100755 --- a/tests/no-rpath.sh +++ b/tests/no-rpath.sh @@ -3,7 +3,7 @@ rm -rf scratch mkdir -p scratch -cp no-rpath scratch/ +cp ${srcdir}/no-rpath scratch/ oldRPath=$(../src/patchelf --print-rpath scratch/no-rpath) if test -n "$oldRPath"; then exit 1; fi -- cgit v0.12