Simon Kelley | 3d8df26 | 2005-08-29 12:19:27 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Kelley | 1f15b81 | 2009-10-13 17:49:32 +0100 | [diff] [blame] | 3 | search=$1 |
| 4 | shift |
Simon Kelley | c979fa0 | 2014-01-21 13:45:17 +0000 | [diff] [blame] | 5 | pkg=$1 |
| 6 | shift |
| 7 | op=$1 |
| 8 | shift |
Simon Kelley | 1f15b81 | 2009-10-13 17:49:32 +0100 | [diff] [blame] | 9 | |
Simon Kelley | c979fa0 | 2014-01-21 13:45:17 +0000 | [diff] [blame] | 10 | in=`cat` |
| 11 | |
| 12 | if 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 Kelley | 3d8df26 | 2005-08-29 12:19:27 +0100 | [diff] [blame] | 19 | fi |
| 20 | |
Simon Kelley | c979fa0 | 2014-01-21 13:45:17 +0000 | [diff] [blame] | 21 | if 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 | |
| 26 | fi |
Simon Kelley | 3d8df26 | 2005-08-29 12:19:27 +0100 | [diff] [blame] | 27 | |