Add support for nto-qnx (BlackBerry 10)
authorSimon Marlow <marlowsd@gmail.com>
Wed, 23 Jan 2013 09:21:39 +0000 (09:21 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 23 Jan 2013 09:21:39 +0000 (09:21 +0000)
Submitted by: Stephen Paul Weber <singpolyma@singpolyma.net>

aclocal.m4
compiler/main/DriverPipeline.hs
compiler/utils/Platform.hs

index fca602f..57e35a2 100644 (file)
@@ -245,6 +245,9 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
         osf3)
             test -z "[$]2" || eval "[$]2=OSOsf3"
             ;;
+        nto-qnx)
+            test -z "[$]2" || eval "[$]2=OSQNXNTO"
+            ;;
         dragonfly|osf1|hpux|linuxaout|freebsd2|cygwin32|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix)
             test -z "[$]2" || eval "[$]2=OSUnknown"
             ;;
@@ -1830,6 +1833,9 @@ case "$1" in
             #      i686-gentoo-freebsd8.2
     $2="freebsd"
     ;;
+  nto-qnx*)
+    $2="nto-qnx"
+    ;;
   *)
     echo "Unknown OS $1"
     exit 1
index 4daaca3..f47aea7 100644 (file)
@@ -1819,7 +1819,7 @@ linkBinary dflags o_files dep_packages = do
             let os = platformOS (targetPlatform dflags)
             in if os == OSOsf3 then ["-lpthread", "-lexc"]
                else if os `elem` [OSMinGW32, OSFreeBSD, OSOpenBSD,
-                                  OSNetBSD, OSHaiku]
+                                  OSNetBSD, OSHaiku, OSQNXNTO]
                then []
                else ["-lpthread"]
          | otherwise               = []
index 76c9fa3..661e03a 100644 (file)
@@ -69,6 +69,7 @@ data OS
         | OSKFreeBSD
         | OSHaiku
         | OSOsf3
+        | OSQNXNTO
         deriving (Read, Show, Eq)
 
 -- | ARM Instruction Set Architecture, Extensions and ABI
@@ -110,6 +111,7 @@ osElfTarget OSKFreeBSD  = True
 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 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