Provide for static library linking.

This commit is contained in:
Simon Kelley
2014-01-21 13:45:17 +00:00
parent c5f4ec7d23
commit c979fa04a4
2 changed files with 32 additions and 4 deletions

View File

@@ -2,10 +2,26 @@
search=$1
shift
pkg=$1
shift
op=$1
shift
if grep "^\#[[:space:]]*define[[:space:]]*$search" config.h >/dev/null 2>&1 || \
grep $search >/dev/null 2>&1; then
exec $*
in=`cat`
if grep "^\#[[:space:]]*define[[:space:]]*${search}_STATIC" config.h >/dev/null 2>&1 || \
echo $in | grep ${search}_STATIC >/dev/null 2>&1; then
if [ $op = "--libs" ]; then
pkg=`$pkg --static $op $*`
echo "-Wl,-Bstatic $pkg -Wl,-Bdynamic"
exit 0
fi
fi
if grep "^\#[[:space:]]*define[[:space:]]*$search" config.h >/dev/null 2>&1 || \
echo $in | grep $search >/dev/null 2>&1; then
pkg=`$pkg $op $*`
echo "$pkg"
fi