summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-06-17 15:12:13 +0100
committerRoy Marples <roy@marples.name>2020-06-17 15:12:13 +0100
commitee73e526cc6129d7f6e8b95db77055e395612c3b (patch)
treefaf54a11ab65459556ac2f8e060a2c20762e8fed
parent9a399ac6e6fea2afc5af0eea54fff810752728ca (diff)
downloaddhcpcd-ee73e526cc6129d7f6e8b95db77055e395612c3b.tar.xz
configure: add --with-eghook=foo
Allows to force for example ypbind if it's not installed.
-rwxr-xr-xconfigure33
1 files changed, 19 insertions, 14 deletions
diff --git a/configure b/configure
index a3701726..68295f45 100755
--- a/configure
+++ b/configure
@@ -88,6 +88,8 @@ for x do
PKG_CONFIG) PKG_CONFIG=$var;;
--with-hook) HOOKSCRIPTS="$HOOKSCRIPTS${HOOKSCRIPTS:+ }$var";;
--with-hooks|HOOKSCRIPTS) HOOKSCRIPTS=$var; HOOKSET=true;;
+ --with-eghook) EGHOOKSCRIPTS="$EGHOOKSCRIPTS${EGHOOKSCRIPTS+ }$var";;
+ --with-hooks|EGHOOKSCRIPTS) EGHOOKSCRIPTS=$var; EGHOOKSET=true;;
--with-default-hostname) _DEFAULT_HOSTNAME=$var;;
--build) BUILD=$var;;
--host) HOST=$var; HOSTCC=$var-;;
@@ -1712,16 +1714,24 @@ if ! $HOOKSET; then
fi
fi
+find_hook()
+{
+ for h in [0-9][0-9]"-$x" [0-9][0-9]"-$x.in" \
+ [0-9][0-9]"-$x.sh" [0-9][0-9]"-$x.sh.in" \
+ [0-9][0-9]"-$x.conf" [0-9][0-9]"-$x.conf.in"
+ do
+ [ -e "$h" ] && break
+ done
+ [ -e "$h" ] || return 1
+ echo "${h%%.in}"
+ return 0
+}
+
if cd hooks; then
for x in $HOOKSCRIPTS; do
printf "Finding hook $x ... "
- for h in [0-9][0-9]"-$x" \
- [0-9][0-9]"-$x.sh" \
- [0-9][0-9]"-$x.conf"
- do
- [ -e "$h" ] && break
- done
- if [ ! -e "$h" ]; then
+ h=$(find_hook "$x")
+ if [ -z "$h" ]; then
echo "no"
else
echo "$h"
@@ -1733,13 +1743,8 @@ if cd hooks; then
done
for x in $EGHOOKSCRIPTS; do
printf "Finding example hook $x ... "
- for h in [0-9][0-9]"-$x" \
- [0-9][0-9]"-$x.sh" \
- [0-9][0-9]"-$x.conf"
- do
- [ -e "$h" ] && break
- done
- if [ ! -e "$h" ]; then
+ h=$(find_hook "$x")
+ if [ -z "$h" ]; then
echo "no"
else
echo "$h"