1: #!/bin/sh
2:
3: search=$1
4: shift
5: pkg=$1
6: shift
7: op=$1
8: shift
9:
10: in=`cat`
11:
12: if grep "^\#[[:space:]]*define[[:space:]]*$search" config.h >/dev/null 2>&1 || \
13: echo $in | grep $search >/dev/null 2>&1; then
14: # Nasty, nasty, in --copy, arg 2 is another config to search for, use with NO_GMP
15: if [ $op = "--copy" ]; then
16: if grep "^\#[[:space:]]*define[[:space:]]*$pkg" config.h >/dev/null 2>&1 || \
17: echo $in | grep $pkg >/dev/null 2>&1; then
18: pkg=""
19: else
20: pkg="$*"
21: fi
22: elif grep "^\#[[:space:]]*define[[:space:]]*${search}_STATIC" config.h >/dev/null 2>&1 || \
23: echo $in | grep ${search}_STATIC >/dev/null 2>&1; then
24: pkg=`$pkg --static $op $*`
25: else
26: pkg=`$pkg $op $*`
27: fi
28:
29: if grep "^\#[[:space:]]*define[[:space:]]*${search}_STATIC" config.h >/dev/null 2>&1 || \
30: echo $in | grep ${search}_STATIC >/dev/null 2>&1; then
31: if [ $op = "--libs" ] || [ $op = "--copy" ]; then
32: echo "-Wl,-Bstatic $pkg -Wl,-Bdynamic"
33: else
34: echo "$pkg"
35: fi
36: else
37: echo "$pkg"
38: fi
39: fi
40:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>