]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
So apparently target is just for compilers and we should be using host instead.
authorRoy Marples <roy@marples.name>
Mon, 24 Mar 2014 18:40:45 +0000 (18:40 +0000)
committerRoy Marples <roy@marples.name>
Mon, 24 Mar 2014 18:40:45 +0000 (18:40 +0000)
configure

index f467dfd25ce87fcd0973de2c54861aa39777bddd..a136e7b1999ea1eabdb820ae26d29a820e5688a7 100755 (executable)
--- a/configure
+++ b/configure
@@ -13,10 +13,9 @@ GETLINE=
 STRLCPY=
 UDEV=
 OS=
-BUILD=
+BUILDCC=
 HOST=
 TARGET=
-TARGETCC=
 DEBUG=
 FORK=
 STATIC=
@@ -57,7 +56,7 @@ for x do
        --with-hook) HOOKSCRIPTS="$HOOKSCRIPTS${HOOKSCRIPTS:+ }$var";;
        --with-hooks|HOOKSCRIPTS) HOOKSCRIPTS=$var; HOOKSET=true;;
        --build) BUILD=$var;;
-       --host) HOST=$var;;
+       --host) HOST=$var; HOSTCC=$var-;;
        --target) TARGET=$var;;
        --libdir) LIBDIR=$var;;
        --without-arc4random) ARC4RANDOM=no;;
@@ -190,23 +189,14 @@ CONFIG_MK=config.mk
 if [ -z "$BUILD" ]; then
        # autoconf target triplet: cpu-vendor-os
        BUILD=$(uname -m)-unknown-$(uname -s | tr '[:upper:]' '[:lower:]')
-else
-       TARGETCC=$BUILD-
-fi
-if [ -n "$TARGET" ]; then
-       TARGETCC=$TARGET-
-elif [ -n "$HOST" ]; then
-       TARGET=$HOST
-else
-       HOST=$BUILD
-       TARGET=$HOST
 fi
+: ${HOST:=$BUILD}
 
 if [ -z "$OS" ]; then
-       echo "Deriving operating system from ... $TARGET"
+       echo "Deriving operating system from ... $HOST"
        # Derive OS from cpu-vendor-[kernel-]os
-       CPU=${TARGET%%-*}
-       REST=${TARGET#*-}
+       CPU=${HOST%%-*}
+       REST=${HOST#*-}
        if [ "$CPU" != "$REST" ]; then
                VENDOR=${REST%%-*}
                REST=${REST#*-}
@@ -254,14 +244,14 @@ echo "MANDIR=             $MANDIR" >>$CONFIG_MK
 # --host or --build targets the expectation is we try and match that
 # to a compiler.
 if [ -n "$CC" ]; then
-       TARGETCC=
+       HOSTCC=
 else
        CC=cc
        _COMPILERS="cc clang gcc pcc icc"
 fi
-if [ -n "$TARGETCC" ]; then
+if [ -n "$HOSTCC" ]; then
        for _CC in $_COMPILERS; do
-               _CC=$(_which "$TARGETCC$_CC")
+               _CC=$(_which "$HOSTCC$_CC")
                if [ -x "$_CC" ]; then
                        CC=$_CC
                        break