#! /bin/sh

# remove old symbolic link
rm -f bf1942_lnxded

# use ldd to look for 'not found' errors
if ldd bf1942_lnxded.dynamic 2>&1 | grep -q -i not\ found; then
   echo "$0: using statically linked binary"
   ln -s bf1942_lnxded.static bf1942_lnxded;
else
   echo "$0: using dynamically linked binary"
   ln -s bf1942_lnxded.dynamic bf1942_lnxded;
fi

# launch binary
exec ./bf1942_lnxded $@
