test-wrapper.sh: Add ${libdir}/elfutils to LD_LIBRARY_PATH.
authorRoland McGrath <roland@hack.frob.com>
Tue, 21 Feb 2012 19:12:46 +0000 (11:12 -0800)
committerRoland McGrath <roland@hack.frob.com>
Tue, 21 Feb 2012 19:12:46 +0000 (11:12 -0800)
tests/ChangeLog
tests/test-wrapper.sh

index e54f5dd..38b189d 100644 (file)
@@ -1,3 +1,7 @@
+2012-02-21  Roland McGrath  <roland@hack.frob.com>
+
+       * test-wrapper.sh: Add ${libdir}/elfutils to LD_LIBRARY_PATH.
+
 2012-01-18  Roland McGrath  <roland@hack.frob.com>
 
        * asm-tst4.c (main): Don't set LD_LIBRARY_PATH in system invocation;
index 3477e38..12ab04e 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2005 Red Hat, Inc.
+# Copyright (C) 2005-2012 Red Hat, Inc.
 # This file is part of Red Hat elfutils.
 #
 # Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -46,6 +46,8 @@ else
   elfutils_testrun=built
 fi
 
+old_path="${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+
 case "$1" in
 *.sh)
   export built_library_path program_transform_name elfutils_testrun
@@ -53,15 +55,14 @@ case "$1" in
   ;;
 *)
   if [ $elfutils_testrun = built ]; then
-    LD_LIBRARY_PATH="$built_library_path${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
-    export LD_LIBRARY_PATH
+    LD_LIBRARY_PATH="$built_library_path$old_path"
   elif [ $elfutils_tests_rpath = yes ]; then
     echo >&2 installcheck not possible with --enable-tests-rpath
     exit 77
   elif [ "x$libdir" != x/usr/lib ] && [ "x$libdir" != x/usr/lib64 ]; then
-    LD_LIBRARY_PATH="$libdir${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
-    export LD_LIBRARY_PATH
+    LD_LIBRARY_PATH="${libdir}:${libdir}/elfutils$old_path"
   fi
+  export LD_LIBRARY_PATH
   ;;
 esac