File: pkg-wrapper

package info (click to toggle)
dnsmasq 2.92-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,124 kB
  • sloc: ansic: 37,139; sh: 654; perl: 643; makefile: 210; python: 136; xml: 53
file content (45 lines) | stat: -rwxr-xr-x 810 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh

in=`cat`

search()
{
    grep "^\#[[:space:]]*define[[:space:]]*$1" config.h >/dev/null 2>&1 || \
    echo $in | grep $1 >/dev/null 2>&1
}

while [ "$#" -gt 0 ]; do
    search=$1
    pkg=$2
    op=$3
    lib=$4
    shift 4
if search "$search"; then

# Nasty, nasty, in --copy, arg 2 (if non-empty) is another config to search for, used with NO_GMP
    if [ $op = "--copy" ]; then
	if [ -z "$pkg" ]; then
	    pkg="$lib"
	elif search "$pkg"; then
	    pkg=""
	else 
	    pkg="$lib"
	fi
    elif search "${search}_STATIC"; then
	pkg=`$pkg  --static $op $lib`
    else
	pkg=`$pkg $op $lib`
    fi
    
    if search "${search}_STATIC"; then
	if [ $op = "--libs" ] || [ $op = "--copy" ]; then
	    echo "-Wl,-Bstatic $pkg -Wl,-Bdynamic"
	else
	    echo "$pkg" 
	fi
    else
	echo "$pkg"
    fi
fi

done