commit b45b838c84c6d06397b28e3b2b5538e8b5b03b41 Author: Roy Marples Date: Wed Jun 17 15:12:13 2020 +0100 configure: add --with-eghook=foo Allows to force for example ypbind if it's not installed. 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"