summaryrefslogtreecommitdiff
path: root/scripts/libtooldeps.sh
blob: d8937c829b6269df6c6587cfeae0729bb995b42a (plain)
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
#!/bin/sh

[ $# -ge 2 ] || {
    cat > /dev/null
    exit 0
}

case $1 in
-P|--provides)
    shift
    RPM_BUILD_ROOT="$1"
    while read possible
    do
	case "$possible" in
	*.la)
	    if grep -iq '^# Generated by ltmain.sh' "$possible" 2> /dev/null ; then
		possible="`echo ${possible} | sed -e s,${RPM_BUILD_ROOT}/,/,`"
		echo "libtool($possible)"
	    fi
	    ;;
	esac
    done
    ;;
-R|--requires)
    while read possible ; do
	case "$possible" in
	*.la)
	    for dep in `grep '^dependency_libs='"$possible" 2> /dev/null | \
			sed -e "s,^dependency_libs='\(.*\)',\1,g"`
	    do
		case "$dep" in
		/*.la)
		    echo "libtool($dep)"
		    ;;
		esac
	    done
	    ;;
	esac
    done
    ;;
esac
exit 0