blob: 37c33a2273d49b69ab1e9e6f721c720b876b9bb7 [file] [log] [blame]
Simon Kelley3d8df262005-08-29 12:19:27 +01001#!/bin/sh
2
Simon Kelley1f15b812009-10-13 17:49:32 +01003search=$1
4shift
Simon Kelleyc979fa02014-01-21 13:45:17 +00005pkg=$1
6shift
7op=$1
8shift
Simon Kelley1f15b812009-10-13 17:49:32 +01009
Simon Kelleyc979fa02014-01-21 13:45:17 +000010in=`cat`
11
12if grep "^\#[[:space:]]*define[[:space:]]*${search}_STATIC" config.h >/dev/null 2>&1 || \
13 echo $in | grep ${search}_STATIC >/dev/null 2>&1; then
14 if [ $op = "--libs" ]; then
15 pkg=`$pkg --static $op $*`
16 echo "-Wl,-Bstatic $pkg -Wl,-Bdynamic"
17 exit 0
18 fi
Simon Kelley3d8df262005-08-29 12:19:27 +010019fi
20
Simon Kelleyc979fa02014-01-21 13:45:17 +000021if grep "^\#[[:space:]]*define[[:space:]]*$search" config.h >/dev/null 2>&1 || \
22 echo $in | grep $search >/dev/null 2>&1; then
23 pkg=`$pkg $op $*`
24 echo "$pkg"
25
26fi
Simon Kelley3d8df262005-08-29 12:19:27 +010027