Added support to cross-compile to android
authorNathan <nathan.huesken@posteo.de>
Wed, 23 Jan 2013 17:07:19 +0000 (18:07 +0100)
committerDavid Terei <davidterei@gmail.com>
Fri, 25 Jan 2013 06:45:24 +0000 (22:45 -0800)
Signed-off-by: David Terei <davidterei@gmail.com>
aclocal.m4
compiler/llvmGen/LlvmCodeGen/Ppr.hs
compiler/utils/Platform.hs

index 57e35a2..edbe389 100644 (file)
@@ -251,6 +251,9 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
         dragonfly|osf1|hpux|linuxaout|freebsd2|cygwin32|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix)
             test -z "[$]2" || eval "[$]2=OSUnknown"
             ;;
+        linux-android)
+            test -z "[$]2" || eval "[$]2=OSAndroid"
+            ;;
         *)
             echo "Unknown OS '[$]1'"
             exit 1
@@ -1821,6 +1824,9 @@ AC_DEFUN([GHC_CONVERT_VENDOR],[
 # converts os from gnu to ghc naming, and assigns the result to $target_var
 AC_DEFUN([GHC_CONVERT_OS],[
 case "$1" in
+  linux-android*)
+    $2="linux-android"
+    ;;
   linux-*|linux)
     $2="linux"
     ;;
index 218870a..5d9fb23 100644 (file)
@@ -58,6 +58,9 @@ moduleLayout = sdocWithPlatform $ \platform ->
     Platform { platformArch = ArchARM {}, platformOS = OSLinux } ->
         text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32\""
         $+$ text "target triple = \"arm-unknown-linux-gnueabi\""
+    Platform { platformArch = ArchARM {}, platformOS = OSAndroid } ->
+        text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32\""
+        $+$ text "target triple = \"arm-unknown-linux-androideabi\""
     _ ->
         -- FIX: Other targets
         empty
index 661e03a..090ce41 100644 (file)
@@ -70,6 +70,7 @@ data OS
         | OSHaiku
         | OSOsf3
         | OSQNXNTO
+        | OSAndroid
         deriving (Read, Show, Eq)
 
 -- | ARM Instruction Set Architecture, Extensions and ABI
@@ -112,6 +113,7 @@ osElfTarget OSHaiku     = True
 osElfTarget OSOsf3      = False -- I don't know if this is right, but as
                                 -- per comment below it's safe
 osElfTarget OSQNXNTO    = False
+osElfTarget OSAndroid   = True
 osElfTarget OSUnknown   = False
  -- Defaulting to False is safe; it means don't rely on any
  -- ELF-specific functionality.  It is important to have a default for