mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
36 lines
766 B
Bash
Executable File
36 lines
766 B
Bash
Executable File
#!/bin/sh
|
|
|
|
search=$1
|
|
shift
|
|
pkg=$1
|
|
shift
|
|
op=$1
|
|
shift
|
|
|
|
in=`cat`
|
|
|
|
if grep "^\#[[:space:]]*define[[:space:]]*$search" config.h >/dev/null 2>&1 || \
|
|
echo $in | grep $search >/dev/null 2>&1; then
|
|
|
|
if [ $op = "--copy" ]; then
|
|
pkg="$*"
|
|
elif grep "^\#[[:space:]]*define[[:space:]]*${search}_STATIC" config.h >/dev/null 2>&1 || \
|
|
echo $in | grep ${search}_STATIC >/dev/null 2>&1; then
|
|
pkg=`$pkg --static $op $*`
|
|
else
|
|
pkg=`$pkg $op $*`
|
|
fi
|
|
|
|
if grep "^\#[[:space:]]*define[[:space:]]*${search}_STATIC" config.h >/dev/null 2>&1 || \
|
|
echo $in | grep ${search}_STATIC >/dev/null 2>&1; then
|
|
if [ $op = "--libs" ] || [ $op = "--copy" ]; then
|
|
echo "-Wl,-Bstatic $pkg -Wl,-Bdynamic"
|
|
else
|
|
echo "$pkg"
|
|
fi
|
|
else
|
|
echo "$pkg"
|
|
fi
|
|
fi
|
|
|