changeset 34654:ef4ff507a341

configure: Derive system name from 3rd and 2nd component passed to --target. This fixes common system name triplets used with MinGW. based on a patch from Diogo Franco, diogomfranco gmail com
author diego
date Sun, 19 Feb 2012 15:21:31 +0000
parents 958431e2cde0
children 16f8330fc70b
files configure
diffstat 1 files changed, 18 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Sun Feb 19 15:21:28 2012 +0000
+++ b/configure	Sun Feb 19 15:21:31 2012 +0000
@@ -1514,22 +1514,24 @@
       *) host_arch=UNKNOWN ;;
   esac
 else # if test -z "$_target"
-  system_name=$(echo $_target | cut -d '-' -f 2)
-  case "$(echo $system_name | tr A-Z a-z)" in
-    linux) system_name=Linux ;;
-    freebsd) system_name=FreeBSD ;;
-    gnu/kfreebsd) system_name=FreeBSD ;;
-    netbsd) system_name=NetBSD ;;
-    bsd/os) system_name=BSD/OS ;;
-    openbsd) system_name=OpenBSD ;;
-    dragonfly) system_name=DragonFly ;;
-    sunos) system_name=SunOS ;;
-    qnx) system_name=QNX ;;
-    morphos) system_name=MorphOS ;;
-    amigaos) system_name=AmigaOS ;;
-    mingw32*) system_name=MINGW32 ;;
-    wine) system_name=Wine ;;
-  esac
+  for component in 3 2; do
+    system_name=$(echo $_target | cut -d '-' -f $component)
+    case "$(echo $system_name | tr A-Z a-z)" in
+      linux) system_name=Linux ;;
+      freebsd) system_name=FreeBSD ;;
+      gnu/kfreebsd) system_name=FreeBSD ;;
+      netbsd) system_name=NetBSD ;;
+      bsd/os) system_name=BSD/OS ;;
+      openbsd) system_name=OpenBSD ;;
+      dragonfly) system_name=DragonFly ;;
+      sunos) system_name=SunOS ;;
+      qnx) system_name=QNX ;;
+      morphos) system_name=MorphOS ;;
+      amigaos) system_name=AmigaOS ;;
+      mingw32*) system_name=MINGW32 ;;
+      wine) system_name=Wine ;;
+    esac
+  done
   # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
   host_arch=$(echo $_target | cut -d '-' -f 1)
   if test $(echo $host_arch) != "x86_64" ; then