2 # Copyright (C) 2005-2012 Red Hat, Inc.
3 # This file is part of elfutils.
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # elfutils is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 # We don't compile in an rpath because we want "make installcheck" to
20 # use the installed libraries. So for local test runs we need to point
21 # the library path at this build.
23 # This wrapper script is called by the makefile, in one of two ways:
24 # $(srcdir)/test-wrapper.sh ../libelf:... run-test.sh ...
26 # $(srcdir)/test-wrapper.sh installed s,^,eu-, run-test.sh ...
28 if [ "$1" = installed ]; then
30 elfutils_tests_rpath=$1
32 program_transform_name="$1"
34 elfutils_testrun=installed
36 built_library_path="$1"
38 elfutils_testrun=built
41 old_path="${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
45 export built_library_path program_transform_name elfutils_testrun
46 export elfutils_tests_rpath
49 if [ $elfutils_testrun = built ]; then
50 LD_LIBRARY_PATH="$built_library_path$old_path"
51 elif [ $elfutils_tests_rpath = yes ]; then
52 echo >&2 installcheck not possible with --enable-tests-rpath
54 elif [ "x$libdir" != x/usr/lib ] && [ "x$libdir" != x/usr/lib64 ]; then
55 LD_LIBRARY_PATH="${libdir}:${libdir}/elfutils$old_path"
57 export LD_LIBRARY_PATH
61 if [ "x$VALGRIND_CMD" != "x" ]; then