backport to buster
[hcoop/debian/openafs.git] / tests / libwrap
CommitLineData
805e021f
CE
1#!/bin/sh
2# libwrap - run a command with the specified library paths
3# Parameters: path_to_library command_to_run command_parameters
4#
5# This was written to help run the OpenAFS test suite.
6#
7# License: MIT
8
9NEWLIB_PATH="$1"
10export NEWLIB_PATH
11
12shift
13TEST_COMMAND="$1"
14
15# Linux, HP-UX (64bit), Solaris, BSD
16if [ -z "$LD_LIBRARY_PATH" ] ; then
17 LD_LIBRARY_PATH="$NEWLIB_PATH"
18else
19 LD_LIBRARY_PATH="$NEWLIB_PATH:$LD_LIBRARY_PATH"
20fi
21export LD_LIBRARY_PATH
22
23# Mac OS X
24if [ -z "$DYLD_LIBRARY_PATH" ] ; then
25 DYLD_LIBRARY_PATH="$NEWLIB_PATH"
26else
27 DYLD_LIBRARY_PATH="$NEWLIB_PATH:$DYLD_LIBRARY_PATH"
28fi
29export DYLD_LIBRARY_PATH
30
31# HP-UX (32bit)
32if [ -z "$SHLIB_PATH" ] ; then
33 SHLIB_PATH="$NEWLIB_PATH"
34else
35 SHLIB_PATH="$NEWLIB_PATH:$SHLIB_PATH"
36fi
37export SHLIB_PATH
38
39# AIX
40if [ -z "$LIBPATH" ] ; then
41 LIBPATH="$NEWLIB_PATH"
42else
43 LIBPATH="$NEWLIB_PATH:$LIBPATH"
44fi
45export LIBPATH
46
47shift
48exec "$TEST_COMMAND" "$@"