Release openresolv-3.7.1
[openresolv] / configure
index daf818abb851b56b06e0f20b1bee92e795ee4ae8..190ee71a9f92646fc57c1828a2980b546908b17d 100755 (executable)
--- a/configure
+++ b/configure
@@ -80,49 +80,37 @@ eval MANDIR="$MANDIR"
 CONFIG_MK=config.mk
 
 if [ -z "$BUILD" ]; then
-       BUILD=`uname -m`-`uname -s | tr '[:upper:]' '[:lower:]'`
-fi
-if [ -z "$HOST" ]; then
-       [ -z "$TARGET" ] && TARGET=$BUILD
-       HOST=$TARGET
-fi
-if [ -z "$TARGET" ]; then
-       [ -z "$HOST" ] && HOST=$BUILD
-       TARGET=$HOST
-fi
-
-# Debian and Slackware have linux in different places when dealing with
-# autoconf, so we deal with that here.
-if [ -z "$OS" ]; then
-       case "$TARGET" in
-       *-linux-*|linux-*|*-linux|linux) OS=linux;;
-       esac
+       # autoconf target triplet: cpu-vendor-os
+       BUILD=$(uname -m)-unknown-$(uname -s | tr '[:upper:]' '[:lower:]')
 fi
+: ${HOST:=$BUILD}
 
 if [ -z "$OS" ]; then
-       # Derive OS from cpu-manufacturer-os-kernel
-       CPU=${TARGET%%-*}
-       REST=${TARGET#*-}
+       echo "Deriving operating system from ... $HOST"
+       # Derive OS from cpu-vendor-[kernel-]os
+       CPU=${HOST%%-*}
+       REST=${HOST#*-}
        if [ "$CPU" != "$REST" ]; then
-               MANU=${REST%%-*}
+               VENDOR=${REST%%-*}
                REST=${REST#*-}
-               if [ "$MANU" != "$REST" ]; then
+               if [ "$VENDOR" != "$REST" ]; then
+                       # Use kernel if given, otherwise os
                        OS=${REST%%-*}
-                       REST=${REST#*-}
-                       if [ "$OS" != "$REST" ]; then
-                               KERNEL=${REST%%-*}
-                       else
-                               # 3 tupple
-                               KERNEL=$OS
-                               OS=$MANU
-                               MANU=
-                       fi
                else
                        # 2 tupple
-                       OS=$MANU
-                       MANU=
+                       OS=$VENDOR
+                       VENDOR=
                fi
        fi
+
+        # Work with cpu-kernel-os, ie Debian
+       case "$VENDOR" in
+       linux*|kfreebsd*) OS=$VENDOR; VENDOR= ;;
+       esac
+       # Special case
+       case "$OS" in
+       gnu*) OS=hurd;; # No HURD support as yet
+       esac
 fi
 
 echo "Configuring openresolv for ... $OS"
@@ -194,6 +182,18 @@ if [ -z "$RESTARTCMD" ]; then
        fi
 fi
 if [ -z "$RESTARTCMD" ]; then
+       printf "Checking for runit... "
+       if [ -x /bin/sv ]; then
+               RESTARTCMD="/bin/sv try-restart \1"
+               echo "yes"
+       elif [ -x /usr/bin/sv ]; then
+               RESTARTCMD="/usr/bin/sv try-restart \1"
+               echo "yes"
+       else
+               echo "no"
+       fi
+fi
+if [ -z "$RESTARTCMD" ]; then
        for x in /etc/init.d/rc.d /etc/rc.d /etc/init.d; do
                printf "Checking for $x ... "
                if [ -d $x ]; then