#!/bin/csh -f

echo ""
echo $2 uses these libraries:
echo ""
which ldd >& /dev/null
if ($status == 0) then
    env LD_LIBRARY_PATH=$1 ldd $2
    echo ""
    echo running $2 --
    echo ""
    env LD_LIBRARY_PATH=$1 $2 a
    echo ""
else
    which otool >& /dev/null
    if ($status == 0) then
	env DYLD_LIBRARY_PATH=$1 otool -L $2
	echo ""
	echo running $2 --
	echo ""
	env DYLD_LIBRARY_PATH=$1 $2 a
	echo ""
    else
	echo Could not figure out how to run testcore in correct environment
	echo Aborting.
    endif
endif
