Merge 1.8.0~pre4 packaging into master
[pkg-k5-afs_openafs.git] / tests / libwrap
blob161abd78f4460756f3ab0469e14fd74f6d4498a0
1 #!/bin/sh
2 # libwrap - run a command with the specified library paths
3 # Parameters: path_to_library command_to_run command_parameters
5 # This was written to help run the OpenAFS test suite.
7 # License: MIT
9 NEWLIB_PATH="$1"
10 export NEWLIB_PATH
12 shift
13 TEST_COMMAND="$1"
15 # Linux, HP-UX (64bit), Solaris, BSD
16 if [ -z "$LD_LIBRARY_PATH" ] ; then
17 LD_LIBRARY_PATH="$NEWLIB_PATH"
18 else
19 LD_LIBRARY_PATH="$NEWLIB_PATH:$LD_LIBRARY_PATH"
21 export LD_LIBRARY_PATH
23 # Mac OS X
24 if [ -z "$DYLD_LIBRARY_PATH" ] ; then
25 DYLD_LIBRARY_PATH="$NEWLIB_PATH"
26 else
27 DYLD_LIBRARY_PATH="$NEWLIB_PATH:$DYLD_LIBRARY_PATH"
29 export DYLD_LIBRARY_PATH
31 # HP-UX (32bit)
32 if [ -z "$SHLIB_PATH" ] ; then
33 SHLIB_PATH="$NEWLIB_PATH"
34 else
35 SHLIB_PATH="$NEWLIB_PATH:$SHLIB_PATH"
37 export SHLIB_PATH
39 # AIX
40 if [ -z "$LIBPATH" ] ; then
41 LIBPATH="$NEWLIB_PATH"
42 else
43 LIBPATH="$NEWLIB_PATH:$LIBPATH"
45 export LIBPATH
47 shift
48 exec "$TEST_COMMAND" "$@"