about summary refs log tree commit diff
path: root/configure
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2016-03-19 18:22:18 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2016-03-19 18:22:18 +0000
commit9921a1c7b25cca0ddce396b5059d8e96c2e68b15 (patch)
tree20f7d613afe4c5693b6a402dc9eacc580f4f440b /configure
parentb269e2113cec7637bfef29b7f8251b5cfb4dcd54 (diff)
downloads6-portable-utils-9921a1c7b25cca0ddce396b5059d8e96c2e68b15.tar.gz
s6-portable-utils-9921a1c7b25cca0ddce396b5059d8e96c2e68b15.tar.xz
s6-portable-utils-9921a1c7b25cca0ddce396b5059d8e96c2e68b15.zip
More standard cross-compilation support (only --host, no --enable-cross needed)
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure22
1 files changed, 15 insertions, 7 deletions
diff --git a/configure b/configure
index 3378c99..ab7279f 100755
--- a/configure
+++ b/configure
@@ -43,7 +43,6 @@ Optional features:
   --disable-allstatic           do not prefer linking against static libraries [enabled]
   --enable-static-libc          make entirely static binaries [disabled]
   --enable-slashpackage[=ROOT]  assume /package installation at ROOT [disabled]
-  --enable-cross=CROSS          prefix toolchain executable names with CROSS [none]
 
 EOF
 exit 0
@@ -150,7 +149,7 @@ addlibspath=''
 addlibdpath=''
 vpaths=''
 vpathd=''
-cross="$CROSS_COMPILE"
+build=
 
 for arg ; do
   case "$arg" in
@@ -179,11 +178,9 @@ for arg ; do
     --enable-slashpackage=*) sproot=${arg#*=} ; slashpackage=true ; ;;
     --enable-slashpackage) sproot= ; slashpackage=true ;;
     --disable-slashpackage) sproot= ; slashpackage=false ;;
-    --enable-cross=*) cross=${arg#*=} ;;
-    --enable-cross) ;;
-    --disable-cross) cross= ;;
-    --enable-*|--disable-*|--with-*|--without-*|--*dir=*|--build=*) ;;
+    --enable-*|--disable-*|--with-*|--without-*|--*dir=*) ;;
     --host=*|--target=*) target=${arg#*=} ;;
+    --build=*) build=${arg#*=} ;;
     -* ) echo "$0: unknown option $arg" ;;
     *=*) ;;
     *) target=$arg ;;
@@ -252,6 +249,11 @@ if $slashpackage ; then
 fi
 
 # Find a C compiler to use
+if test -n "$target" && test x${build} != x${target} ; then
+  cross=${target}-
+else
+  cross=
+fi
 echo "checking for C compiler..."
 trycc ${cross}${CC}
 trycc ${cross}gcc
@@ -270,7 +272,13 @@ else
 fi
 
 echo "checking target system type..."
-test -n "$target" || target=$($CC_AUTO -dumpmachine 2>/dev/null) || target=unknown
+if test -z "$target" ; then
+  if test -n "$build" ; then
+    target=$build ;
+  else
+    target=$($CC_AUTO -dumpmachine 2>/dev/null) || target=unknown
+  fi
+fi
 echo "  ... $target"
 if test ! -d $sysdeps || test ! -f $sysdeps/target ; then
   echo "$0: error: $sysdeps is not a valid sysdeps directory"