blob: efb848a97a373c2eac7d41a86b6416ec824cb85f [file] [log] [blame]
Simon Kelley3d8df262005-08-29 12:19:27 +01001#!/bin/sh
2
Simon Kelley1f15b812009-10-13 17:49:32 +01003search=$1
4shift
Simon Kelleyc979fa02014-01-21 13:45:17 +00005pkg=$1
6shift
7op=$1
8shift
Simon Kelley1f15b812009-10-13 17:49:32 +01009
Simon Kelleyc979fa02014-01-21 13:45:17 +000010in=`cat`
11
Simon Kelleyc979fa02014-01-21 13:45:17 +000012if grep "^\#[[:space:]]*define[[:space:]]*$search" config.h >/dev/null 2>&1 || \
13 echo $in | grep $search >/dev/null 2>&1; then
Simon Kelleyb98d22c2014-02-04 16:57:25 +000014
15 if [ $op = "--copy" ]; then
16 pkg="$*"
17 else
18 pkg=`$pkg $op $*`
19 fi
20
21 if grep "^\#[[:space:]]*define[[:space:]]*${search}_STATIC" config.h >/dev/null 2>&1 || \
22 echo $in | grep ${search}_STATIC >/dev/null 2>&1; then
23 if [ $op = "--libs" ] || [ $op = "--copy" ]; then
24 echo "-Wl,-Bstatic $pkg -Wl,-Bdynamic"
25 else
26 echo "$pkg"
27 fi
28 else
29 echo "$pkg"
30 fi
Simon Kelleyc979fa02014-01-21 13:45:17 +000031fi
Simon Kelley3d8df262005-08-29 12:19:27 +010032