Debian Codegraph @

bld/pkg-wrapper

raw
1 #!/bin/sh
2
3 in=`cat`
4
5 search()
6 {
7 grep "^\#[[:space:]]*define[[:space:]]*$1" config.h >/dev/null 2>&1 || \
8 echo $in | grep $1 >/dev/null 2>&1
9 }
10
11 while [ "$#" -gt 0 ]; do
12 search=$1
13 pkg=$2
14 op=$3
15 lib=$4
16 shift 4
17 if search "$search"; then
18
19 # Nasty, nasty, in --copy, arg 2 (if non-empty) is another config to search for, used with NO_GMP
20 if [ $op = "--copy" ]; then
21 if [ -z "$pkg" ]; then
22 pkg="$lib"
23 elif search "$pkg"; then
24 pkg=""
25 else
26 pkg="$lib"
27 fi
28 elif search "${search}_STATIC"; then
29 pkg=`$pkg --static $op $lib`
30 else
31 pkg=`$pkg $op $lib`
32 fi
33
34 if search "${search}_STATIC"; then
35 if [ $op = "--libs" ] || [ $op = "--copy" ]; then
36 echo "-Wl,-Bstatic $pkg -Wl,-Bdynamic"
37 else
38 echo "$pkg"
39 fi
40 else
41 echo "$pkg"
42 fi
43 fi
44
45 done