packages feed

base 4.2.0.2 → 4.3.0.0

raw patch · 111 files changed

+16374/−14812 lines, 111 files

Files

Control/Applicative.hs view
@@ -45,6 +45,10 @@ import Data.Functor ((<$>), (<$)) import Data.Monoid (Monoid(..)) +#ifdef __GLASGOW_HASKELL__+import GHC.Conc (STM, retry, orElse)+#endif+ infixl 3 <|> infixl 4 <*>, <*, *>, <**> @@ -145,6 +149,16 @@         pure = return         (<*>) = ap +#ifdef __GLASGOW_HASKELL__+instance Applicative STM where+    pure = return+    (<*>) = ap++instance Alternative STM where+    empty = retry+    (<|>) = orElse+#endif+ instance Applicative ((->) a) where         pure = const         (<*>) f g x = f x (g x)@@ -152,6 +166,11 @@ instance Monoid a => Applicative ((,) a) where         pure x = (mempty, x)         (u, f) <*> (v, x) = (u `mappend` v, f x)++instance Applicative (Either e) where+        pure          = Right+        Left  e <*> _ = Left e+        Right f <*> r = fmap f r  -- new instances 
Control/Arrow.hs view
@@ -74,7 +74,8 @@         --   version if desired.         second :: a b c -> a (d,b) (d,c)         second f = arr swap >>> first f >>> arr swap-                        where   swap ~(x,y) = (y,x)+                        where   swap :: (x,y) -> (y,x)+                                swap ~(x,y) = (y,x)          -- | Split the input between the two argument arrows and combine         --   their output.  Note that this is in general not a functor.@@ -182,7 +183,8 @@         --   version if desired.         right :: a b c -> a (Either d b) (Either d c)         right f = arr mirror >>> left f >>> arr mirror-                        where   mirror (Left x) = Right x+                        where   mirror :: Either x y -> Either y x+                                mirror (Left x) = Right x                                 mirror (Right y) = Left y          -- | Split the input between the two argument arrows, retagging
Control/Concurrent.hs view
@@ -28,6 +28,7 @@          forkIO, #ifdef __GLASGOW_HASKELL__+        forkIOUnmasked,         killThread,         throwTo, #endif@@ -98,9 +99,9 @@ #ifdef __GLASGOW_HASKELL__ import GHC.Exception import GHC.Conc         ( ThreadId(..), myThreadId, killThread, yield,-                          threadDelay, forkIO, childHandler )+                          threadDelay, forkIO, forkIOUnmasked, childHandler ) import qualified GHC.Conc-import GHC.IO           ( IO(..), unsafeInterleaveIO )+import GHC.IO           ( IO(..), unsafeInterleaveIO, unsafeUnmask ) import GHC.IORef        ( newIORef, readIORef, writeIORef ) import GHC.Base @@ -357,13 +358,15 @@ forkOS action0     | rtsSupportsBoundThreads = do         mv <- newEmptyMVar-        b <- Exception.blocked+        b <- Exception.getMaskingState         let-            -- async exceptions are blocked in the child if they are blocked+            -- async exceptions are masked in the child if they are masked             -- in the parent, as for forkIO (see #1048). forkOS_createThread-            -- creates a thread with exceptions blocked by default.-            action1 | b = action0-                    | otherwise = unblock action0+            -- creates a thread with exceptions masked by default.+            action1 = case b of+                        Unmasked -> unsafeUnmask action0+                        MaskedInterruptible -> action0+                        MaskedUninterruptible -> uninterruptibleMask_ action0              action_plus = Exception.catch action1 childHandler @@ -431,8 +434,8 @@         then do             mv <- newEmptyMVar             b <- blocked-            _ <- block $ forkIO $-              Exception.try (if b then action else unblock action) >>=+            _ <- mask $ \restore -> forkIO $+              Exception.try (if b then action else restore action) >>=               putMVar mv             takeMVar mv >>= \ei -> case ei of                 Left exception -> Exception.throw (exception :: SomeException)@@ -482,7 +485,7 @@ withThread :: IO a -> IO a withThread io = do   m <- newEmptyMVar-  _ <- block $ forkIO $ try io >>= putMVar m+  _ <- mask_ $ forkIO $ try io >>= putMVar m   x <- takeMVar m   case x of     Right a -> return a
Control/Concurrent/Chan.hs view
@@ -106,6 +106,7 @@    modifyMVar_ readVar $ \read_end -> do      putMVar new_read_end (ChItem val read_end)      return new_read_end+{-# DEPRECATED unGetChan "if you need this operation, use Control.Concurrent.STM.TChan instead.  See http://hackage.haskell.org/trac/ghc/ticket/4154 for details" #-}  -- |Returns 'True' if the supplied 'Chan' is empty. isEmptyChan :: Chan a -> IO Bool@@ -114,6 +115,7 @@      w <- readMVar writeVar      let eq = r == w      eq `seq` return eq+{-# DEPRECATED isEmptyChan "if you need this operation, use Control.Concurrent.STM.TChan instead.  See http://hackage.haskell.org/trac/ghc/ticket/4154 for details" #-}  -- Operators for interfacing with functional streams. 
Control/Concurrent/MVar.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_GHC -XNoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module      :  Control.Concurrent.MVar@@ -45,7 +46,12 @@                 ) #endif +#ifdef __GLASGOW_HASKELL__+import GHC.Base+#else import Prelude+#endif+ import Control.Exception.Base  {-|@@ -54,7 +60,7 @@ -} readMVar :: MVar a -> IO a readMVar m =-  block $ do+  mask_ $ do     a <- takeMVar m     putMVar m a     return a@@ -67,7 +73,7 @@ -} swapMVar :: MVar a -> a -> IO a swapMVar mvar new =-  block $ do+  mask_ $ do     old <- takeMVar mvar     putMVar mvar new     return old@@ -83,9 +89,9 @@ -- http://www.haskell.org//pipermail/haskell/2006-May/017907.html withMVar :: MVar a -> (a -> IO b) -> IO b withMVar m io =-  block $ do+  mask $ \restore -> do     a <- takeMVar m-    b <- unblock (io a) `onException` putMVar m a+    b <- restore (io a) `onException` putMVar m a     putMVar m a     return b @@ -97,9 +103,9 @@ {-# INLINE modifyMVar_ #-} modifyMVar_ :: MVar a -> (a -> IO a) -> IO () modifyMVar_ m io =-  block $ do+  mask $ \restore -> do     a  <- takeMVar m-    a' <- unblock (io a) `onException` putMVar m a+    a' <- restore (io a) `onException` putMVar m a     putMVar m a'  {-|@@ -109,8 +115,8 @@ {-# INLINE modifyMVar #-} modifyMVar :: MVar a -> (a -> IO (a,b)) -> IO b modifyMVar m io =-  block $ do+  mask $ \restore -> do     a      <- takeMVar m-    (a',b) <- unblock (io a) `onException` putMVar m a+    (a',b) <- restore (io a) `onException` putMVar m a     putMVar m a'     return b
Control/Concurrent/QSem.hs view
@@ -22,6 +22,7 @@  import Prelude import Control.Concurrent.MVar+import Control.Exception ( mask_ ) import Data.Typeable  #include "Typeable.h"@@ -50,12 +51,13 @@  -- |Wait for a unit to become available waitQSem :: QSem -> IO ()-waitQSem (QSem sem) = do+waitQSem (QSem sem) = mask_ $ do    (avail,blocked) <- takeMVar sem  -- gain ex. access    if avail > 0 then-     putMVar sem (avail-1,[])+     let avail' = avail-1+     in avail' `seq` putMVar sem (avail',[])     else do-     block <- newEmptyMVar+     b <- newEmptyMVar       {-         Stuff the reader at the back of the queue,         so as to preserve waiting order. A signalling@@ -65,16 +67,17 @@         The version of waitQSem given in the paper could         lead to starvation.       -}-     putMVar sem (0, blocked++[block])-     takeMVar block+     putMVar sem (0, blocked++[b])+     takeMVar b  -- |Signal that a unit of the 'QSem' is available signalQSem :: QSem -> IO ()-signalQSem (QSem sem) = do+signalQSem (QSem sem) = mask_ $ do    (avail,blocked) <- takeMVar sem    case blocked of-     [] -> putMVar sem (avail+1,[])+     [] -> let avail' = avail+1+           in avail' `seq` putMVar sem (avail',blocked) -     (block:blocked') -> do+     (b:blocked') -> do            putMVar sem (0,blocked')-           putMVar block ()+           putMVar b ()
Control/Concurrent/QSemN.hs view
@@ -24,6 +24,7 @@ import Prelude  import Control.Concurrent.MVar+import Control.Exception ( mask_ ) import Data.Typeable  #include "Typeable.h"@@ -45,29 +46,30 @@  -- |Wait for the specified quantity to become available waitQSemN :: QSemN -> Int -> IO ()-waitQSemN (QSemN sem) sz = do+waitQSemN (QSemN sem) sz = mask_ $ do   (avail,blocked) <- takeMVar sem   -- gain ex. access-  if (avail - sz) >= 0 then+  let remaining = avail - sz+  if remaining >= 0 then        -- discharging 'sz' still leaves the semaphore        -- in an 'unblocked' state.-     putMVar sem (avail-sz,blocked)+     putMVar sem (remaining,blocked)    else do-     block <- newEmptyMVar-     putMVar sem (avail, blocked++[(sz,block)])-     takeMVar block+     b <- newEmptyMVar+     putMVar sem (avail, blocked++[(sz,b)])+     takeMVar b  -- |Signal that a given quantity is now available from the 'QSemN'. signalQSemN :: QSemN -> Int  -> IO ()-signalQSemN (QSemN sem) n = do+signalQSemN (QSemN sem) n = mask_ $ do    (avail,blocked)   <- takeMVar sem    (avail',blocked') <- free (avail+n) blocked-   putMVar sem (avail',blocked')+   avail' `seq` putMVar sem (avail',blocked')  where    free avail []    = return (avail,[])-   free avail ((req,block):blocked)+   free avail ((req,b):blocked)      | avail >= req = do-        putMVar block ()+        putMVar b ()         free (avail-req) blocked      | otherwise    = do         (avail',blocked') <- free avail blocked-        return (avail',(req,block):blocked')+        return (avail',(req,b):blocked')
Control/Concurrent/SampleVar.hs view
@@ -30,8 +30,10 @@  import Control.Concurrent.MVar -import Control.Exception ( block )+import Control.Exception ( mask_ ) +import Data.Functor ( (<$>) )+ -- | -- Sample variables are slightly different from a normal 'MVar': -- @@ -48,28 +50,30 @@ --  * Writing to a filled 'SampleVar' overwrites the current value. --    (different from 'putMVar' on full 'MVar'.) -type SampleVar a- = MVar (Int,           -- 1  == full-                        -- 0  == empty-                        -- <0 no of readers blocked-          MVar a)+newtype SampleVar a = SampleVar ( MVar ( Int    -- 1  == full+                                                -- 0  == empty+                                                -- <0 no of readers blocked+                                       , MVar a+                                       )+                                )+    deriving (Eq)  -- |Build a new, empty, 'SampleVar' newEmptySampleVar :: IO (SampleVar a) newEmptySampleVar = do    v <- newEmptyMVar-   newMVar (0,v)+   SampleVar <$> newMVar (0,v)  -- |Build a 'SampleVar' with an initial value. newSampleVar :: a -> IO (SampleVar a) newSampleVar a = do    v <- newMVar a-   newMVar (1,v)+   SampleVar <$> newMVar (1,v)  -- |If the SampleVar is full, leave it empty.  Otherwise, do nothing. emptySampleVar :: SampleVar a -> IO ()-emptySampleVar v = block $ do-   s@(readers, var) <- block $ takeMVar v+emptySampleVar (SampleVar v) = mask_ $ do+   s@(readers, var) <- takeMVar v    if readers > 0 then do      _ <- takeMVar var      putMVar v (0,var)@@ -78,7 +82,7 @@  -- |Wait for a value to become available, then take it and return. readSampleVar :: SampleVar a -> IO a-readSampleVar svar = block $ do+readSampleVar (SampleVar svar) = mask_ $ do -- -- filled => make empty and grab sample -- not filled => try to grab value, empty when read val.@@ -91,7 +95,7 @@ -- |Write a value into the 'SampleVar', overwriting any previous value that -- was there. writeSampleVar :: SampleVar a -> a -> IO ()-writeSampleVar svar v = block $ do+writeSampleVar (SampleVar svar) v = mask_ $ do -- -- filled => overwrite -- not filled => fill, write val@@ -114,7 +118,7 @@ -- you see the result of 'isEmptySampleVar'. -- isEmptySampleVar :: SampleVar a -> IO Bool-isEmptySampleVar svar = do+isEmptySampleVar (SampleVar svar) = do    (readers, _) <- readMVar svar    return (readers == 0) 
Control/Exception.hs view
@@ -104,9 +104,20 @@          -- ** Asynchronous exception control -        -- |The following two functions allow a thread to control delivery of+        -- |The following functions allow a thread to control delivery of         -- asynchronous exceptions during a critical region. +        mask,+#ifndef __NHC__+        mask_,+        uninterruptibleMask,+        uninterruptibleMask_,+        MaskingState(..),+        getMaskingState,+#endif++        -- ** (deprecated) Asynchronous exception control+         block,         unblock,         blocked,@@ -138,7 +149,6 @@  #ifdef __GLASGOW_HASKELL__ import GHC.Base--- import GHC.IO hiding ( onException, finally ) import Data.Maybe #else import Prelude hiding (catch)@@ -243,7 +253,7 @@ -}  {- $block_handler-There\'s an implied 'block' around every exception handler in a call+There\'s an implied 'mask' around every exception handler in a call to one of the 'catch' family of functions.  This is because that is what you want most of the time - it eliminates a common race condition in starting an exception handler, because there may be no exception@@ -253,10 +263,9 @@ before being interrupted.  If this weren\'t the default, one would have to write something like ->      block (->           catch (unblock (...))->                      (\e -> handler)->      )+>      block $ \restore ->+>           catch (restore (...))+>                 (\e -> handler)  If you need to unblock asynchronous exceptions again in the exception handler, just use 'unblock' as normal.@@ -268,6 +277,7 @@  {- $interruptible + #interruptible# Some operations are /interruptible/, which means that they can receive asynchronous exceptions even in the scope of a 'block'.  Any function which may itself block is defined as interruptible; this includes@@ -277,11 +287,10 @@ some I\/O with the outside world.  The reason for having interruptible operations is so that we can write things like ->      block (+>      mask $ \restore -> do >         a <- takeMVar m->         catch (unblock (...))+>         catch (restore (...)) >               (\e -> ...)->      )  if the 'Control.Concurrent.MVar.takeMVar' was not interruptible, then this particular
Control/Exception/Base.hs view
@@ -1,5 +1,4 @@ {-# OPTIONS_GHC -XNoImplicitPrelude #-}-{-# OPTIONS_GHC -fno-warn-orphans #-}  #include "Typeable.h" @@ -79,7 +78,17 @@         -- * Asynchronous Exceptions          -- ** Asynchronous exception control+        mask,+#ifndef __NHC__+        mask_,+        uninterruptibleMask,+        uninterruptibleMask_,+        MaskingState(..),+        getMaskingState,+#endif +        -- ** (deprecated) Asynchronous exception control+         block,         unblock,         blocked,@@ -100,6 +109,7 @@         -- * Calls for GHC runtime         recSelError, recConError, irrefutPatError, runtimeError,         nonExhaustiveGuardsError, patError, noMethodBindingError,+        absentError,         nonTermination, nestedAtomically, #endif   ) where@@ -111,7 +121,7 @@ import GHC.Exception import GHC.Show -- import GHC.Exception hiding ( Exception )-import GHC.Conc+import GHC.Conc.Sync #endif  #ifdef __HUGS__@@ -176,8 +186,8 @@ data PatternMatchFail data NoMethodError data Deadlock-data BlockedOnDeadMVar-data BlockedIndefinitely+data BlockedIndefinitelyOnMVar+data BlockedIndefinitelyOnSTM data ErrorCall data RecConError data RecSelError@@ -215,6 +225,10 @@ assert True  x = x assert False _ = throw (toException (UserError "" "Assertion failed")) +mask   :: ((IO a-> IO a) -> IO a) -> IO a+mask action = action restore+    where restore act = act+ #endif  #ifdef __HUGS__@@ -506,12 +520,11 @@         -> (a -> IO c)  -- ^ computation to run in-between         -> IO c         -- returns the value from the in-between computation bracket before after thing =-  block (do+  mask $ \restore -> do     a <- before-    r <- unblock (thing a) `onException` after a+    r <- restore (thing a) `onException` after a     _ <- after a     return r- ) #endif  -- | A specialised variant of 'bracket' with just a computation to run@@ -522,11 +535,10 @@                         -- was raised)         -> IO a         -- returns the value from the first computation a `finally` sequel =-  block (do-    r <- unblock a `onException` sequel+  mask $ \restore -> do+    r <- restore a `onException` sequel     _ <- sequel     return r-  )  -- | A variant of 'bracket' where the return value from the first computation -- is not required.@@ -541,10 +553,9 @@         -> (a -> IO c)  -- ^ computation to run in-between         -> IO c         -- returns the value from the in-between computation bracketOnError before after thing =-  block (do+  mask $ \restore -> do     a <- before-    unblock (thing a) `onException` after a-  )+    restore (thing a) `onException` after a  #if !(__GLASGOW_HASKELL__ || __NHC__) assert :: Bool -> a -> a@@ -695,12 +706,14 @@  #ifdef __GLASGOW_HASKELL__ recSelError, recConError, irrefutPatError, runtimeError,-             nonExhaustiveGuardsError, patError, noMethodBindingError+  nonExhaustiveGuardsError, patError, noMethodBindingError,+  absentError         :: Addr# -> a   -- All take a UTF8-encoded C string  recSelError              s = throw (RecSelError ("No match in record selector " 			                         ++ unpackCStringUtf8# s))  -- No location info unfortunately runtimeError             s = error (unpackCStringUtf8# s)                   -- No location info unfortunately+absentError              s = error ("Oops!  Entered absent arg " ++ unpackCStringUtf8# s)  nonExhaustiveGuardsError s = throw (PatternMatchFail (untangle s "Non-exhaustive guards in")) irrefutPatError          s = throw (PatternMatchFail (untangle s "Irrefutable pattern failed for pattern"))
Control/Monad.hs view
@@ -28,7 +28,7 @@     -- ** Naming conventions     -- $naming -    -- ** Basic functions from the "Prelude"+    -- ** Basic @Monad@ functions      , mapM          -- :: (Monad m) => (a -> m b) -> [a] -> m [b]     , mapM_         -- :: (Monad m) => (a -> m b) -> [a] -> m ()@@ -40,11 +40,13 @@     , (>=>)         -- :: (Monad m) => (a -> m b) -> (b -> m c) -> (a -> m c)     , (<=<)         -- :: (Monad m) => (b -> m c) -> (a -> m b) -> (a -> m c)     , forever       -- :: (Monad m) => m a -> m b+    , void      -- ** Generalisations of list functions      , join          -- :: (Monad m) => m (m a) -> m a     , msum          -- :: (MonadPlus m) => [m a] -> m a+    , mfilter       -- :: (MonadPlus m) => (a -> Bool) -> m a -> m a     , filterM       -- :: (Monad m) => (a -> m Bool) -> [a] -> m [a]     , mapAndUnzipM  -- :: (Monad m) => (a -> m (b,c)) -> [a] -> m ([b], [c])     , zipWithM      -- :: (Monad m) => (a -> b -> m c) -> [a] -> [b] -> m [c]@@ -126,8 +128,6 @@    -- > mzero >>= f  =  mzero    -- > v >> mzero   =  mzero    ---   -- (but the instance for 'System.IO.IO' defined in Control.Monad.Error-   -- in the mtl package does not satisfy the second one).    mzero :: m a     -- | an associative operation    mplus :: m a -> m a -> m a@@ -182,7 +182,7 @@ (>=>)       :: Monad m => (a -> m b) -> (b -> m c) -> (a -> m c) f >=> g     = \x -> f x >>= g --- | Right-to-left Kleisli composition of monads. '(>=>)', with the arguments flipped+-- | Right-to-left Kleisli composition of monads. @('>=>')@, with the arguments flipped (<=<)       :: Monad m => (b -> m c) -> (a -> m b) -> (a -> m c) (<=<)       = flip (>=>) @@ -190,6 +190,10 @@ forever     :: (Monad m) => m a -> m b forever a   = a >> forever a +-- | @'void' value@ discards or ignores the result of evaluation, such as the return value of an 'IO' action.+void :: Functor f => f a -> f ()+void = fmap (const ())+ -- ----------------------------------------------------------------------------- -- Other monad functions @@ -215,11 +219,11 @@  {- | The 'foldM' function is analogous to 'foldl', except that its result is encapsulated in a monad. Note that 'foldM' works from left-to-right over-the list arguments. This could be an issue where '(>>)' and the `folded+the list arguments. This could be an issue where @('>>')@ and the `folded function' are not commutative.  ->       foldM f a1 [x1, x2, ..., xm ]+>       foldM f a1 [x1, x2, ..., xm]  ==   @@ -307,6 +311,20 @@ ap                :: (Monad m) => m (a -> b) -> m a -> m b ap                =  liftM2 id ++-- -----------------------------------------------------------------------------+-- Other MonadPlus functions++-- | Direct 'MonadPlus' equivalent of 'filter'+-- @'filter'@ = @(mfilter:: (a -> Bool) -> [a] -> [a]@+-- applicable to any 'MonadPlus', for example+-- @mfilter odd (Just 1) == Just 1@+-- @mfilter odd (Just 2) == Nothing@++mfilter :: (MonadPlus m) => (a -> Bool) -> m a -> m a+mfilter p ma = do+  a <- ma+  if p a then return a else mzero  {- $naming 
Control/Monad/Fix.hs view
@@ -29,6 +29,9 @@ #ifdef __HUGS__ import Hugs.Prelude (MonadFix(mfix)) #endif+#if defined(__GLASGOW_HASKELL__)+import GHC.ST+#endif  #ifndef __HUGS__ -- | Monads having fixed points with a \'knot-tying\' semantics.@@ -75,5 +78,18 @@ instance MonadFix IO where     mfix = fixIO  +-- Prelude types with Monad instances in Control.Monad.Instances+ instance MonadFix ((->) r) where     mfix f = \ r -> let a = f a r in a++instance MonadFix (Either e) where+    mfix f = let a = f (unRight a) in a+             where unRight (Right x) = x+                   unRight (Left  _) = error "mfix Either: Left"++#if defined(__GLASGOW_HASKELL__)+instance MonadFix (ST s) where+        mfix = fixST+#endif+
Control/Monad/Instances.hs view
@@ -1,4 +1,5 @@ {-# OPTIONS_NHC98 --prelude #-}+-- This module deliberately declares orphan instances: {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- |@@ -30,3 +31,8 @@ instance Functor (Either a) where         fmap _ (Left x) = Left x         fmap f (Right y) = Right (f y)++instance Monad (Either e) where+        return = Right+        Left  l >>= _ = Left l+        Right r >>= k = k r
Control/Monad/ST.hs view
@@ -1,4 +1,3 @@-{-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.ST@@ -32,15 +31,25 @@         unsafeSTToIO            -- :: ST s a -> IO a       ) where +#if defined(__GLASGOW_HASKELL__)+import Control.Monad.Fix ()+#else import Control.Monad.Fix+#endif  #include "Typeable.h" -#ifdef __HUGS__+#if defined(__GLASGOW_HASKELL__)+import GHC.ST           ( ST, runST, fixST, unsafeInterleaveST )+import GHC.Base         ( RealWorld )+import GHC.IO           ( stToIO, unsafeIOToST, unsafeSTToIO )+#elif defined(__HUGS__) import Data.Typeable import Hugs.ST import qualified Hugs.LazyST as LazyST+#endif +#if defined(__HUGS__) INSTANCE_TYPEABLE2(ST,sTTc,"ST") INSTANCE_TYPEABLE0(RealWorld,realWorldTc,"RealWorld") @@ -52,12 +61,8 @@     LazyST.lazyToStrictST . LazyST.unsafeInterleaveST . LazyST.strictToLazyST #endif -#ifdef __GLASGOW_HASKELL__-import GHC.ST           ( ST, runST, fixST, unsafeInterleaveST )-import GHC.Base         ( RealWorld )-import GHC.IO           ( stToIO, unsafeIOToST, unsafeSTToIO )-#endif-+#if !defined(__GLASGOW_HASKELL__) instance MonadFix (ST s) where         mfix = fixST+#endif 
Control/OldException.hs view
@@ -132,7 +132,6 @@  #ifdef __GLASGOW_HASKELL__ import GHC.Base-import GHC.Num import GHC.Show -- import GHC.IO ( IO ) import GHC.IO.Handle.FD ( stdout )@@ -151,7 +150,7 @@ #endif  import qualified Control.Exception as New-import           Control.Exception ( toException, fromException, throw, block, unblock, evaluate, throwIO )+import           Control.Exception ( toException, fromException, throw, block, unblock, mask, evaluate, throwIO ) import System.IO.Error  hiding ( catch, try ) import System.IO.Unsafe (unsafePerformIO) import Data.Dynamic@@ -452,14 +451,13 @@         -> (a -> IO c)  -- ^ computation to run in-between         -> IO c         -- returns the value from the in-between computation bracket before after thing =-  block (do+  mask $ \restore -> do     a <- before      r <- catch -           (unblock (thing a))+           (restore (thing a))            (\e -> do { _ <- after a; throw e })     _ <- after a     return r- ) #endif  -- | A specialised variant of 'bracket' with just a computation to run@@ -470,13 +468,12 @@                         -- was raised)         -> IO a         -- returns the value from the first computation a `finally` sequel =-  block (do+  mask $ \restore -> do     r <- catch -             (unblock a)+             (restore a)              (\e -> do { _ <- sequel; throw e })     _ <- sequel     return r-  )  -- | A variant of 'bracket' where the return value from the first computation -- is not required.@@ -491,12 +488,11 @@         -> (a -> IO c)  -- ^ computation to run in-between         -> IO c         -- returns the value from the in-between computation bracketOnError before after thing =-  block (do+  mask $ \restore -> do     a <- before      catch -        (unblock (thing a))+        (restore (thing a))         (\e -> do { _ <- after a; throw e })- )  -- ----------------------------------------------------------------------------- -- Asynchronous exceptions@@ -523,7 +519,7 @@ -}  {- $block_handler-There\'s an implied 'block' around every exception handler in a call+There\'s an implied 'mask_' around every exception handler in a call to one of the 'catch' family of functions.  This is because that is what you want most of the time - it eliminates a common race condition in starting an exception handler, because there may be no exception@@ -533,10 +529,9 @@ before being interrupted.  If this weren\'t the default, one would have to write something like ->      block (->           catch (unblock (...))+>      mask $ \restore ->+>           catch (restore (...)) >                      (\e -> handler)->      )  If you need to unblock asynchronous exceptions again in the exception handler, just use 'unblock' as normal.@@ -544,13 +539,13 @@ Note that 'try' and friends /do not/ have a similar default, because there is no exception handler in this case.  If you want to use 'try' in an asynchronous-exception-safe way, you will need to use-'block'.+'mask'. -}  {- $interruptible  Some operations are /interruptible/, which means that they can receive-asynchronous exceptions even in the scope of a 'block'.  Any function+asynchronous exceptions even in the scope of a 'mask'.  Any function which may itself block is defined as interruptible; this includes 'Control.Concurrent.MVar.takeMVar' (but not 'Control.Concurrent.MVar.tryTakeMVar'),@@ -558,11 +553,10 @@ some I\/O with the outside world.  The reason for having interruptible operations is so that we can write things like ->      block (+>      mask $ \restore -> do >         a <- takeMVar m->         catch (unblock (...))+>         catch (restore (...)) >               (\e -> ...)->      )  if the 'Control.Concurrent.MVar.takeMVar' was not interruptible, then this particular
Data/Bits.hs view
@@ -126,7 +126,7 @@                   | i>0  = (x `shift` i) .|. (x `shift` (i-bitSize x))     -} -    -- | @bit i@ is a value with the @i@th bit set+    -- | @bit i@ is a value with the @i@th bit set and all other bits clear     bit               :: Int -> a      -- | @x \`setBit\` i@ is the same as @x .|. bit i@@@ -151,6 +151,11 @@         value of the argument is ignored -}     isSigned          :: a -> Bool +    {-# INLINE bit #-}+    {-# INLINE setBit #-}+    {-# INLINE clearBit #-}+    {-# INLINE complementBit #-}+    {-# INLINE testBit #-}     bit i               = 1 `shiftL` i     x `setBit` i        = x .|. bit i     x `clearBit` i      = x .&. complement (bit i)@@ -164,6 +169,7 @@         'shift', depending on which is more convenient for the type in         question. -}     shiftL            :: a -> Int -> a+    {-# INLINE shiftL #-}     x `shiftL`  i = x `shift`  i      {-| Shift the first argument right by the specified number of bits@@ -176,6 +182,7 @@         'shift', depending on which is more convenient for the type in         question. -}     shiftR            :: a -> Int -> a+    {-# INLINE shiftR #-}     x `shiftR`  i = x `shift`  (-i)      {-| Rotate the argument left by the specified number of bits@@ -185,6 +192,7 @@         'rotate', depending on which is more convenient for the type in         question. -}     rotateL           :: a -> Int -> a+    {-# INLINE rotateL #-}     x `rotateL` i = x `rotate` i      {-| Rotate the argument right by the specified number of bits@@ -194,6 +202,7 @@         'rotate', depending on which is more convenient for the type in         question. -}     rotateR           :: a -> Int -> a+    {-# INLINE rotateR #-}     x `rotateR` i = x `rotate` (-i)  instance Bits Int where@@ -222,9 +231,6 @@         !wsib = WORD_SIZE_IN_BITS#   {- work around preprocessor problem (??) -}     bitSize  _             = WORD_SIZE_IN_BITS -    {-# INLINE shiftR #-}-    -- same as the default definition, but we want it inlined (#2376)-    x `shiftR`  i = x `shift`  (-i) #else /* !__GLASGOW_HASKELL__ */  #ifdef __HUGS__@@ -273,6 +279,8 @@    (.|.) = orInteger    xor = xorInteger    complement = complementInteger+   shift x i@(I# i#) | i >= 0    = shiftLInteger x i#+                     | otherwise = shiftRInteger x (negateInt# i#) #else    -- reduce bitwise binary operations to special cases we can handle @@ -289,10 +297,9 @@     -- assuming infinite 2's-complement arithmetic    complement a = -1 - a+   shift x i | i >= 0    = x * 2^i+             | otherwise = x `div` 2^(-i) #endif--   shift x i@(I# i#) | i >= 0    = shiftLInteger x i#-                     | otherwise = shiftRInteger x (negateInt# i#)     rotate x i = shift x i   -- since an Integer never wraps around 
Data/Complex.hs view
@@ -198,4 +198,4 @@      asinh z        =  log (z + sqrt (1+z*z))     acosh z        =  log (z + (z+1) * sqrt ((z-1)/(z+1)))-    atanh z        =  log ((1+z) / sqrt (1-z*z))+    atanh z        =  0.5 * log ((1.0+z) / (1.0-z))
Data/Data.hs view
@@ -310,20 +310,24 @@   --   gmapT f x0 = unID (gfoldl k ID x0)     where+      k :: Data d => ID (d->b) -> d -> ID b       k (ID c) x = ID (c (f x))     -- | A generic query with a left-associative binary operator-  gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r+  gmapQl :: forall r r'. (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r   gmapQl o r f = unCONST . gfoldl k z     where+      k :: Data d => CONST r (d->b) -> d -> CONST r b       k c x = CONST $ (unCONST c) `o` f x+      z :: g -> CONST r g       z _   = CONST r    -- | A generic query with a right-associative binary operator-  gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r+  gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r   gmapQr o r0 f x0 = unQr (gfoldl k (const (Qr id)) x0) r0     where+      k :: Data d => Qr r (d->b) -> d -> Qr r b       k (Qr c) x = Qr (\r -> c (f x `o` r))  @@ -335,10 +339,12 @@     -- | A generic query that processes one child by index (zero-based)-  gmapQi :: Int -> (forall d. Data d => d -> u) -> a -> u+  gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> a -> u   gmapQi i f x = case gfoldl k z x of { Qi _ q -> fromJust q }     where+      k :: Data d => Qi u (d -> b) -> d -> Qi u b       k (Qi i' q) a = Qi (i'+1) (if i==i' then Just (f a) else q)+      z :: g -> Qi q g       z _           = Qi 0 Nothing  @@ -347,7 +353,7 @@   -- The default definition instantiates the type constructor @c@ in   -- the type of 'gfoldl' to the monad datatype constructor, defining   -- injection and projection using 'return' and '>>='.-  gmapM   :: Monad m => (forall d. Data d => d -> m d) -> a -> m a+  gmapM :: forall m. Monad m => (forall d. Data d => d -> m d) -> a -> m a    -- Use immediately the monad datatype constructor    -- to instantiate the type constructor c in the type of gfoldl,@@ -355,13 +361,14 @@   --     gmapM f = gfoldl k return     where+      k :: Data d => m (d -> b) -> d -> m b       k c x = do c' <- c                  x' <- f x                  return (c' x')     -- | Transformation of at least one immediate subterm does not fail-  gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> a -> m a+  gmapMp :: forall m. MonadPlus m => (forall d. Data d => d -> m d) -> a -> m a  {- @@ -374,7 +381,9 @@   gmapMp f x = unMp (gfoldl k z x) >>= \(x',b) ->                 if b then return x' else mzero     where+      z :: g -> Mp m g       z g = Mp (return (g,False))+      k :: Data d => Mp m (d -> b) -> d -> Mp m b       k (Mp c) y         = Mp ( c >>= \(h, b) ->                  (f y >>= \y' -> return (h y', True))@@ -382,7 +391,7 @@              )    -- | Transformation of one immediate subterm with success-  gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> a -> m a+  gmapMo :: forall m. MonadPlus m => (forall d. Data d => d -> m d) -> a -> m a  {- @@ -397,7 +406,9 @@   gmapMo f x = unMp (gfoldl k z x) >>= \(x',b) ->                 if b then return x' else mzero     where+      z :: g -> Mp m g       z g = Mp (return (g,False))+      k :: Data d => Mp m (d -> b) -> d -> Mp m b       k (Mp c) y         = Mp ( c >>= \(h,b) -> if b                         then return (h y, b)@@ -446,18 +457,24 @@             -> a fromConstrB f = unID . gunfold k z  where+  k :: forall b r. Data b => ID (b -> r) -> ID r   k c = ID (unID c f)+ +  z :: forall r. r -> ID r   z = ID   -- | Monadic variation on 'fromConstrB'-fromConstrM :: (Monad m, Data a)+fromConstrM :: forall m a. (Monad m, Data a)             => (forall d. Data d => m d)             -> Constr             -> m a fromConstrM f = gunfold k z  where+  k :: forall b r. Data b => m (b -> r) -> m r   k c = do { c' <- c; b <- f; return (c' b) }++  z :: forall r. r -> m r   z = return  
Data/Dynamic.hs view
@@ -47,7 +47,6 @@ #ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.Show-import GHC.Num import GHC.Exception #endif 
Data/Either.hs view
@@ -79,8 +79,8 @@ partitionEithers :: [Either a b] -> ([a],[b]) partitionEithers = foldr (either left right) ([],[])  where-  left  a (l, r) = (a:l, r)-  right a (l, r) = (l, a:r)+  left  a ~(l, r) = (a:l, r)+  right a ~(l, r) = (l, a:r)  {- {--------------------------------------------------------------------
Data/Fixed.hs view
@@ -35,10 +35,14 @@ ) where  import Prelude -- necessary to get dependencies right+#ifndef __NHC__ import Data.Typeable import Data.Data+#endif +#ifndef __NHC__ default () -- avoid any defaulting shenanigans+#endif  -- | generalisation of 'div' to any instance of Real div' :: (Real a,Integral b) => a -> a -> b@@ -55,8 +59,14 @@     f = div' n d  -- | The type parameter should be an instance of 'HasResolution'.-newtype Fixed a = MkFixed Integer deriving (Eq,Ord,Typeable)+newtype Fixed a = MkFixed Integer+#ifndef __NHC__+        deriving (Eq,Ord,Typeable)+#else+        deriving (Eq,Ord)+#endif +#ifndef __NHC__ -- We do this because the automatically derived Data instance requires (Data a) context. -- Our manual instance has the more general (Typeable a) context. tyFixed :: DataType@@ -68,6 +78,7 @@     gunfold k z _ = k (z MkFixed)     dataTypeOf _ = tyFixed     toConstr _ = conMkFixed+#endif  class HasResolution a where     resolution :: p a -> Integer@@ -145,43 +156,64 @@     show = showFixed False  -data E0 = E0 deriving (Typeable)+data E0 = E0+#ifndef __NHC__+     deriving (Typeable)+#endif instance HasResolution E0 where     resolution _ = 1 -- | resolution of 1, this works the same as Integer type Uni = Fixed E0 -data E1 = E1 deriving (Typeable)+data E1 = E1+#ifndef __NHC__+     deriving (Typeable)+#endif instance HasResolution E1 where     resolution _ = 10 -- | resolution of 10^-1 = .1 type Deci = Fixed E1 -data E2 = E2 deriving (Typeable)+data E2 = E2+#ifndef __NHC__+     deriving (Typeable)+#endif instance HasResolution E2 where     resolution _ = 100 -- | resolution of 10^-2 = .01, useful for many monetary currencies type Centi = Fixed E2 -data E3 = E3 deriving (Typeable)+data E3 = E3+#ifndef __NHC__+     deriving (Typeable)+#endif instance HasResolution E3 where     resolution _ = 1000 -- | resolution of 10^-3 = .001 type Milli = Fixed E3 -data E6 = E6 deriving (Typeable)+data E6 = E6+#ifndef __NHC__+     deriving (Typeable)+#endif instance HasResolution E6 where     resolution _ = 1000000 -- | resolution of 10^-6 = .000001 type Micro = Fixed E6 -data E9 = E9 deriving (Typeable)+data E9 = E9+#ifndef __NHC__+     deriving (Typeable)+#endif instance HasResolution E9 where     resolution _ = 1000000000 -- | resolution of 10^-9 = .000000001 type Nano = Fixed E9 -data E12 = E12 deriving (Typeable)+data E12 = E12+#ifndef __NHC__+     deriving (Typeable)+#endif instance HasResolution E12 where     resolution _ = 1000000000000 -- | resolution of 10^-12 = .000000000001
Data/Foldable.hs view
@@ -90,14 +90,19 @@ -- -- a suitable instance would be ----- > instance Foldable Tree+-- > instance Foldable Tree where -- >    foldMap f Empty = mempty -- >    foldMap f (Leaf x) = f x -- >    foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r -- -- This is suitable even for abstract types, as the monoid is assumed--- to satisfy the monoid laws.+-- to satisfy the monoid laws.  Alternatively, one could define @foldr@: --+-- > instance Foldable Tree where+-- >    foldr f z Empty = z+-- >    foldr f z (Leaf x) = f x z+-- >    foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l+-- class Foldable t where         -- | Combine the elements of a structure using a monoid.         fold :: Monoid m => t m -> m@@ -157,6 +162,9 @@  instance Ix i => Foldable (Array i) where         foldr f z = Prelude.foldr f z . elems+        foldl f z = Prelude.foldl f z . elems+        foldr1 f = Prelude.foldr1 f . elems+        foldl1 f = Prelude.foldl1 f . elems  -- | Fold over the elements of a structure, -- associating to the right, but strictly.
Data/Functor.hs view
@@ -13,12 +13,16 @@  module Data.Functor     (-      Functor(fmap, (<$)),+      Functor(fmap),+      (<$),       (<$>),     ) where  #ifdef __GLASGOW_HASKELL__ import GHC.Base (Functor(..))+#else+(<$) :: Functor f => a -> f b -> f a+(<$) =  fmap . const #endif  infixl 4 <$>
Data/HashTable.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -XNoImplicitPrelude -funbox-strict-fields #-}+{-# OPTIONS_GHC -XNoImplicitPrelude -funbox-strict-fields -fno-warn-name-shadowing #-}  ----------------------------------------------------------------------------- -- |@@ -19,7 +19,7 @@  module Data.HashTable (         -- * Basic hash table operations-        HashTable, new, insert, delete, lookup, update,+        HashTable, new, newHint, insert, delete, lookup, update,         -- * Converting to and from lists         fromList, toList,         -- * Hash functions@@ -274,6 +274,55 @@   recordNew   -- make a new hash table with a single, empty, segment   let mask = tABLE_MIN-1+  bkts <- newMutArray (0,mask) []++  let+    kcnt = 0+    ht = HT {  buckets=bkts, kcount=kcnt, bmask=mask }++  table <- newIORef ht+  return (HashTable { tab=table, hash_fn=hash, cmp=cmpr })++{- +   bitTwiddleSameAs takes as arguments positive Int32s less than maxBound/2 and +   returns the smallest power of 2 that is greater than or equal to the +   argument.+   http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2+-}+bitTwiddleSameAs :: Int32 -> Int32+bitTwiddleSameAs v0 = +    let v1 = v0-1+        v2 = v1 .|. (v1`shiftR`1)+        v3 = v2 .|. (v2`shiftR`2)+        v4 = v3 .|. (v3`shiftR`4)+        v5 = v4 .|. (v4`shiftR`8)+        v6 = v5 .|. (v5`shiftR`16)+    in v6+1++{-+  powerOver takes as arguments Int32s and returns the smallest power of 2 +  that is greater than or equal to the argument if that power of 2 is +  within [tABLE_MIN,tABLE_MAX]+-}+powerOver :: Int32 -> Int32+powerOver n = +    if n <= tABLE_MIN+    then tABLE_MIN+    else if n >= tABLE_MAX+         then tABLE_MAX+         else bitTwiddleSameAs n ++-- | Creates a new hash table with the given minimum size.+newHint+  :: (key -> key -> Bool)    -- ^ @eq@: An equality comparison on keys+  -> (key -> Int32)          -- ^ @hash@: A hash function on keys+  -> Int                     -- ^ @minSize@: initial table size+  -> IO (HashTable key val)  -- ^ Returns: an empty hash table++newHint cmpr hash minSize = do+  recordNew+  -- make a new hash table with a single, empty, segment+  let mask = powerOver $ fromIntegral minSize   bkts <- newMutArray (0,mask) []    let
Data/List.hs view
@@ -230,10 +230,10 @@ -- It returns 'Nothing' if the list did not start with the prefix -- given, or 'Just' the list after the prefix, if it does. ----- > stripPrefix "foo" "foobar" -> Just "bar"--- > stripPrefix "foo" "foo" -> Just ""--- > stripPrefix "foo" "barfoo" -> Nothing--- > stripPrefix "foo" "barfoobaz" -> Nothing+-- > stripPrefix "foo" "foobar" == Just "bar"+-- > stripPrefix "foo" "foo" == Just ""+-- > stripPrefix "foo" "barfoo" == Nothing+-- > stripPrefix "foo" "barfoobaz" == Nothing stripPrefix :: Eq a => [a] -> [a] -> Maybe [a] stripPrefix [] ys = Just ys stripPrefix (x:xs) (y:ys)@@ -297,12 +297,12 @@ -- -- Example: ----- >isInfixOf "Haskell" "I really like Haskell." -> True--- >isInfixOf "Ial" "I really like Haskell." -> False+-- >isInfixOf "Haskell" "I really like Haskell." == True+-- >isInfixOf "Ial" "I really like Haskell." == False isInfixOf               :: (Eq a) => [a] -> [a] -> Bool isInfixOf needle haystack = any (isPrefixOf needle) (tails haystack) --- | The 'nub' function removes duplicate elements from a list.+-- | /O(n^2)/. The 'nub' function removes duplicate elements from a list. -- In particular, it keeps only the first occurrence of each element. -- (The name 'nub' means \`essence\'.) -- It is a special case of 'nubBy', which allows the programmer to supply@@ -793,10 +793,50 @@ sortBy cmp = foldr (insertBy cmp) [] #else +{-+GHC's mergesort replaced by a better implementation, 24/12/2009.+This code originally contributed to the nhc12 compiler by Thomas Nordin+in 2002.  Rumoured to have been based on code by Lennart Augustsson, e.g.+    http://www.mail-archive.com/haskell@haskell.org/msg01822.html+and possibly to bear similarities to a 1982 paper by Richard O'Keefe:+"A smooth applicative merge sort".++Benchmarks show it to be often 2x the speed of the previous implementation.+Fixes ticket http://hackage.haskell.org/trac/ghc/ticket/2143+-}++sort = sortBy compare+sortBy cmp = mergeAll . sequences+  where+    sequences (a:b:xs)+      | a `cmp` b == GT = descending b [a]  xs+      | otherwise       = ascending  b (a:) xs+    sequences xs = [xs]++    descending a as (b:bs)+      | a `cmp` b == GT = descending b (a:as) bs+    descending a as bs  = (a:as): sequences bs++    ascending a as (b:bs)+      | a `cmp` b /= GT = ascending b (\ys -> as (a:ys)) bs+    ascending a as bs   = as [a]: sequences bs++    mergeAll [x] = x+    mergeAll xs  = mergeAll (mergePairs xs)++    mergePairs (a:b:xs) = merge a b: mergePairs xs+    mergePairs xs       = xs++    merge as@(a:as') bs@(b:bs')+      | a `cmp` b == GT = b:merge as  bs'+      | otherwise       = a:merge as' bs+    merge [] bs         = bs+    merge as []         = as++{- sortBy cmp l = mergesort cmp l sort l = mergesort compare l -{- Quicksort replaced by mergesort, 14/5/2002.  From: Ian Lynagh <igloo@earth.li>@@ -837,7 +877,6 @@ func            100000           sorted        mergesort   2.23 func            100000           revsorted     sort        5872.34 func            100000           revsorted     mergesort   2.24--}  mergesort :: (a -> a -> Ordering) -> [a] -> [a] mergesort cmp = mergesort' cmp . map wrap@@ -863,9 +902,10 @@ wrap :: a -> [a] wrap x = [x] -{--OLD: qsort version ++OLDER: qsort version+ -- qsort is stable and does not concatenate. qsort :: (a -> a -> Ordering) -> [a] -> [a] -> [a] qsort _   []     r = r@@ -988,10 +1028,23 @@ -- characters.  The resulting strings do not contain newlines. lines                   :: String -> [String] lines ""                =  []+#ifdef __GLASGOW_HASKELL__+-- Somehow GHC doesn't detect the selector thunks in the below code,+-- so s' keeps a reference to the first line via the pair and we have+-- a space leak (cf. #4334).+-- So we need to make GHC see the selector thunks with a trick.+lines s                 =  cons (case break (== '\n') s of+                                    (l, s') -> (l, case s' of+                                                    []      -> []+                                                    _:s''   -> lines s''))+  where+    cons ~(h, t)        =  h : t+#else lines s                 =  let (l, s') = break (== '\n') s                            in  l : case s' of                                         []      -> []                                         (_:s'') -> lines s''+#endif  -- | 'unlines' is an inverse operation to 'lines'. -- It joins lines, after appending a terminating newline to each.
Data/Monoid.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_GHC -XNoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module      :  Data.Monoid@@ -30,7 +31,17 @@         Last(..)   ) where +-- Push down the module in the dependency hierarchy.+#if defined(__GLASGOW_HASKELL__)+import GHC.Base hiding (Any)+import GHC.Enum+import GHC.Num+import GHC.Read+import GHC.Show+import Data.Maybe+#else import Prelude+#endif  {- -- just for testing
Data/Traversable.hs view
@@ -62,7 +62,7 @@ -- -- a suitable instance would be ----- > instance Traversable Tree+-- > instance Traversable Tree where -- >    traverse f Empty = pure Empty -- >    traverse f (Leaf x) = Leaf <$> f x -- >    traverse f (Node l k r) = Node <$> traverse f l <*> f k <*> traverse f r@@ -107,6 +107,7 @@         traverse f (Just x) = Just <$> f x  instance Traversable [] where+        {-# INLINE traverse #-} -- so that traverse can fuse         traverse f = Prelude.foldr cons_f (pure [])           where cons_f x ys = (:) <$> f x <*> ys 
Data/Tuple.hs view
@@ -1,6 +1,5 @@ {-# OPTIONS_GHC -XNoImplicitPrelude #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-}-{-# OPTIONS_GHC -fno-warn-orphans #-} -- XXX -fno-warn-unused-imports needed for the GHC.Tuple import below. Sigh. ----------------------------------------------------------------------------- -- |@@ -21,6 +20,7 @@   , snd         -- :: (a,b) -> a   , curry       -- :: ((a, b) -> c) -> a -> b -> c   , uncurry     -- :: (a -> b -> c) -> ((a, b) -> c)+  , swap        -- :: (a,b) -> (b,a) #ifdef __NHC__   , (,)(..)   , (,,)(..)@@ -41,15 +41,19 @@     where  #ifdef __GLASGOW_HASKELL__-import GHC.Bool-import GHC.Classes-import GHC.Ordering--- XXX The standalone deriving clauses fail with---     The data constructors of `(,)' are not all in scope---       so you cannot derive an instance for it---     In the stand-alone deriving instance for `Eq (a, b)'--- if we don't import GHC.Tuple++import GHC.Base+-- We need to depend on GHC.Base so that+-- a) so that we get GHC.Bool, GHC.Classes, GHC.Ordering++-- b) so that GHC.Base.inline is available, which is used+--    when expanding instance declarations+ import GHC.Tuple+-- We must import GHC.Tuple, to ensure sure that the +-- data constructors of `(,)' are in scope when we do+-- the standalone deriving instance for Eq (a,b) etc+ #endif  /* __GLASGOW_HASKELL__ */  #ifdef __NHC__@@ -81,89 +85,6 @@  default ()              -- Double isn't available yet -#ifdef __GLASGOW_HASKELL__--- XXX Why aren't these derived?-instance Eq () where-    () == () = True-    () /= () = False--instance Ord () where-    () <= () = True-    () <  () = False-    () >= () = True-    () >  () = False-    max () () = ()-    min () () = ()-    compare () () = EQ--#ifndef __HADDOCK__-deriving instance (Eq  a, Eq  b) => Eq  (a, b)-deriving instance (Ord a, Ord b) => Ord (a, b)-deriving instance (Eq  a, Eq  b, Eq  c) => Eq  (a, b, c)-deriving instance (Ord a, Ord b, Ord c) => Ord (a, b, c)-deriving instance (Eq  a, Eq  b, Eq  c, Eq  d) => Eq  (a, b, c, d)-deriving instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)-deriving instance (Eq  a, Eq  b, Eq  c, Eq  d, Eq  e) => Eq  (a, b, c, d, e)-deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)-deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f)-               => Eq (a, b, c, d, e, f)-deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f)-               => Ord (a, b, c, d, e, f)-deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g)-               => Eq (a, b, c, d, e, f, g)-deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g)-               => Ord (a, b, c, d, e, f, g)-deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,-                   Eq h)-               => Eq (a, b, c, d, e, f, g, h)-deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,-                   Ord h)-               => Ord (a, b, c, d, e, f, g, h)-deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,-                   Eq h, Eq i)-               => Eq (a, b, c, d, e, f, g, h, i)-deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,-                   Ord h, Ord i)-               => Ord (a, b, c, d, e, f, g, h, i)-deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,-                   Eq h, Eq i, Eq j)-               => Eq (a, b, c, d, e, f, g, h, i, j)-deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,-                   Ord h, Ord i, Ord j)-               => Ord (a, b, c, d, e, f, g, h, i, j)-deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,-                   Eq h, Eq i, Eq j, Eq k)-               => Eq (a, b, c, d, e, f, g, h, i, j, k)-deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,-                   Ord h, Ord i, Ord j, Ord k)-               => Ord (a, b, c, d, e, f, g, h, i, j, k)-deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,-                   Eq h, Eq i, Eq j, Eq k, Eq l)-               => Eq (a, b, c, d, e, f, g, h, i, j, k, l)-deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,-                   Ord h, Ord i, Ord j, Ord k, Ord l)-               => Ord (a, b, c, d, e, f, g, h, i, j, k, l)-deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,-                   Eq h, Eq i, Eq j, Eq k, Eq l, Eq m)-               => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m)-deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,-                   Ord h, Ord i, Ord j, Ord k, Ord l, Ord m)-               => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m)-deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,-                   Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n)-               => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n)-deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,-                   Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n)-               => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n)-deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,-                   Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o)-               => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)-deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,-                   Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o)-               => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)-#endif  /* !__HADDOCK__ */-#endif  /* __GLASGOW_HASKELL__ */- -- --------------------------------------------------------------------------- -- Standard functions over tuples @@ -184,3 +105,7 @@ uncurry                 :: (a -> b -> c) -> ((a, b) -> c) uncurry f p             =  f (fst p) (snd p) #endif  /* neither __HUGS__ nor __NHC__ */++-- | Swap the components of a pair.+swap                    :: (a,b) -> (b,a)+swap (a,b)              = (b,a)
Data/Typeable.hs view
@@ -93,10 +93,10 @@ import GHC.Show         (Show(..), ShowS,                          shows, showString, showChar, showParen) import GHC.Err          (undefined)-import GHC.Num          (Integer, fromInteger, (+))+import GHC.Num          (Integer, (+)) import GHC.Real         ( rem, Ratio ) import GHC.IORef        (IORef,newIORef)-import GHC.IO           (unsafePerformIO,block)+import GHC.IO           (unsafePerformIO,mask_)  -- These imports are so we can define Typeable instances -- It'd be better to give Typeable instances in the modules themselves@@ -331,6 +331,7 @@ class Typeable1 t where   typeOf1 :: t a -> TypeRep +#ifdef __GLASGOW_HASKELL__ -- | For defining a 'Typeable' instance from any 'Typeable1' instance. typeOfDefault :: forall t a. (Typeable1 t, Typeable a) => t a -> TypeRep typeOfDefault = \_ -> rep@@ -338,11 +339,20 @@    rep = typeOf1 (undefined :: t a) `mkAppTy`           typeOf  (undefined :: a)    -- Note [Memoising typeOf]+#else+-- | For defining a 'Typeable' instance from any 'Typeable1' instance.+typeOfDefault :: (Typeable1 t, Typeable a) => t a -> TypeRep+typeOfDefault x = typeOf1 x `mkAppTy` typeOf (argType x)+ where+   argType :: t a -> a+   argType = undefined+#endif  -- | Variant for binary type constructors class Typeable2 t where   typeOf2 :: t a b -> TypeRep +#ifdef __GLASGOW_HASKELL__ -- | For defining a 'Typeable1' instance from any 'Typeable2' instance. typeOf1Default :: forall t a b. (Typeable2 t, Typeable a) => t a b -> TypeRep typeOf1Default = \_ -> rep @@ -350,11 +360,20 @@    rep = typeOf2 (undefined :: t a b) `mkAppTy`           typeOf  (undefined :: a)    -- Note [Memoising typeOf]+#else+-- | For defining a 'Typeable1' instance from any 'Typeable2' instance.+typeOf1Default :: (Typeable2 t, Typeable a) => t a b -> TypeRep+typeOf1Default x = typeOf2 x `mkAppTy` typeOf (argType x)+ where+   argType :: t a b -> a+   argType = undefined+#endif  -- | Variant for 3-ary type constructors class Typeable3 t where   typeOf3 :: t a b c -> TypeRep +#ifdef __GLASGOW_HASKELL__ -- | For defining a 'Typeable2' instance from any 'Typeable3' instance. typeOf2Default :: forall t a b c. (Typeable3 t, Typeable a) => t a b c -> TypeRep typeOf2Default = \_ -> rep @@ -362,11 +381,20 @@    rep = typeOf3 (undefined :: t a b c) `mkAppTy`           typeOf  (undefined :: a)    -- Note [Memoising typeOf]+#else+-- | For defining a 'Typeable2' instance from any 'Typeable3' instance.+typeOf2Default :: (Typeable3 t, Typeable a) => t a b c -> TypeRep+typeOf2Default x = typeOf3 x `mkAppTy` typeOf (argType x)+ where+   argType :: t a b c -> a+   argType = undefined+#endif  -- | Variant for 4-ary type constructors class Typeable4 t where   typeOf4 :: t a b c d -> TypeRep +#ifdef __GLASGOW_HASKELL__ -- | For defining a 'Typeable3' instance from any 'Typeable4' instance. typeOf3Default :: forall t a b c d. (Typeable4 t, Typeable a) => t a b c d -> TypeRep typeOf3Default = \_ -> rep@@ -374,11 +402,20 @@    rep = typeOf4 (undefined :: t a b c d) `mkAppTy`           typeOf  (undefined :: a)    -- Note [Memoising typeOf]+#else+-- | For defining a 'Typeable3' instance from any 'Typeable4' instance.+typeOf3Default :: (Typeable4 t, Typeable a) => t a b c d -> TypeRep+typeOf3Default x = typeOf4 x `mkAppTy` typeOf (argType x)+ where+   argType :: t a b c d -> a+   argType = undefined+#endif     -- | Variant for 5-ary type constructors class Typeable5 t where   typeOf5 :: t a b c d e -> TypeRep +#ifdef __GLASGOW_HASKELL__ -- | For defining a 'Typeable4' instance from any 'Typeable5' instance. typeOf4Default :: forall t a b c d e. (Typeable5 t, Typeable a) => t a b c d e -> TypeRep typeOf4Default = \_ -> rep @@ -386,11 +423,20 @@    rep = typeOf5 (undefined :: t a b c d e) `mkAppTy`           typeOf  (undefined :: a)    -- Note [Memoising typeOf]+#else+-- | For defining a 'Typeable4' instance from any 'Typeable5' instance.+typeOf4Default :: (Typeable5 t, Typeable a) => t a b c d e -> TypeRep+typeOf4Default x = typeOf5 x `mkAppTy` typeOf (argType x)+ where+   argType :: t a b c d e -> a+   argType = undefined+#endif  -- | Variant for 6-ary type constructors class Typeable6 t where   typeOf6 :: t a b c d e f -> TypeRep +#ifdef __GLASGOW_HASKELL__ -- | For defining a 'Typeable5' instance from any 'Typeable6' instance. typeOf5Default :: forall t a b c d e f. (Typeable6 t, Typeable a) => t a b c d e f -> TypeRep typeOf5Default = \_ -> rep@@ -398,11 +444,20 @@    rep = typeOf6 (undefined :: t a b c d e f) `mkAppTy`           typeOf  (undefined :: a)    -- Note [Memoising typeOf]+#else+-- | For defining a 'Typeable5' instance from any 'Typeable6' instance.+typeOf5Default :: (Typeable6 t, Typeable a) => t a b c d e f -> TypeRep+typeOf5Default x = typeOf6 x `mkAppTy` typeOf (argType x)+ where+   argType :: t a b c d e f -> a+   argType = undefined+#endif  -- | Variant for 7-ary type constructors class Typeable7 t where   typeOf7 :: t a b c d e f g -> TypeRep +#ifdef __GLASGOW_HASKELL__ -- | For defining a 'Typeable6' instance from any 'Typeable7' instance. typeOf6Default :: forall t a b c d e f g. (Typeable7 t, Typeable a) => t a b c d e f g -> TypeRep typeOf6Default = \_ -> rep@@ -410,6 +465,14 @@    rep = typeOf7 (undefined :: t a b c d e f g) `mkAppTy`           typeOf  (undefined :: a)    -- Note [Memoising typeOf]+#else+-- | For defining a 'Typeable6' instance from any 'Typeable7' instance.+typeOf6Default :: (Typeable7 t, Typeable a) => t a b c d e f g -> TypeRep+typeOf6Default x = typeOf7 x `mkAppTy` typeOf (argType x)+ where+   argType :: t a b c d e f g -> a+   argType = undefined+#endif  #ifdef __GLASGOW_HASKELL__ -- Given a @Typeable@/n/ instance for an /n/-ary type constructor,@@ -618,7 +681,7 @@                                         tc_tbl = empty_tc_tbl,                                          ap_tbl = empty_ap_tbl } #ifdef __GLASGOW_HASKELL__-                block $ do+                mask_ $ do                         stable_ref <- newStablePtr ret                         let ref = castStablePtrToPtr stable_ref                         ref2 <- getOrSetTypeableStore ref
Data/Unique.hs view
@@ -27,11 +27,16 @@ import GHC.Base import GHC.Num import GHC.Conc+import Data.Typeable #endif  -- | An abstract unique object.  Objects of type 'Unique' may be -- compared for equality and ordering and hashed into 'Int'.-newtype Unique = Unique Integer deriving (Eq,Ord)+newtype Unique = Unique Integer deriving (Eq,Ord+#ifdef __GLASGOW_HASKELL__+   ,Typeable+#endif+   )  uniqSource :: TVar Integer uniqSource = unsafePerformIO (newTVarIO 0)
Foreign.hs view
@@ -24,8 +24,10 @@         , module Foreign.Storable         , module Foreign.Marshal -        -- | For compatibility with the FFI addendum only.  The recommended-        -- place to get this from is "System.IO.Unsafe".+        -- | 'unsafePerformIO' is exported here for backwards+        -- compatibility reasons only.  For doing local marshalling in+        -- the FFI, use 'unsafeLocalState'.  For other uses, see+        -- 'System.IO.Unsafe.unsafePerformIO'.         , unsafePerformIO         ) where 
Foreign/C/Error.hs view
@@ -358,7 +358,7 @@           else throwErrno loc       else return res --- | as 'throwErrnoIfRetry', but additionlly if the operation +-- | as 'throwErrnoIfRetry', but additionally if the operation  -- yields the error code 'eAGAIN' or 'eWOULDBLOCK', an alternative -- action is executed before retrying. --@@ -490,7 +490,7 @@ -- conversion of an "errno" value into IO error -- -------------------------------------------- --- | Construct a Haskell 98 I\/O error based on the given 'Errno' value.+-- | Construct an 'IOError' based on the given 'Errno' value. -- The optional information can be used to improve the accuracy of -- error messages. --
Foreign/C/String.hs view
@@ -59,6 +59,11 @@   castCharToCChar,   -- :: Char -> CChar   castCCharToChar,   -- :: CChar -> Char +  castCharToCUChar,  -- :: Char -> CUChar+  castCUCharToChar,  -- :: CUChar -> Char+  castCharToCSChar,  -- :: Char -> CSChar+  castCSCharToChar,  -- :: CSChar -> Char+   peekCAString,      -- :: CString    -> IO String   peekCAStringLen,   -- :: CStringLen -> IO String   newCAString,       -- :: String -> IO CString@@ -198,6 +203,26 @@ -- This function is only safe on the first 256 characters. castCharToCChar :: Char -> CChar castCharToCChar ch = fromIntegral (ord ch)++-- | Convert a C @unsigned char@, representing a Latin-1 character, to+-- the corresponding Haskell character.+castCUCharToChar :: CUChar -> Char+castCUCharToChar ch = unsafeChr (fromIntegral (fromIntegral ch :: Word8))++-- | Convert a Haskell character to a C @unsigned char@.+-- This function is only safe on the first 256 characters.+castCharToCUChar :: Char -> CUChar+castCharToCUChar ch = fromIntegral (ord ch)++-- | Convert a C @signed char@, representing a Latin-1 character, to the+-- corresponding Haskell character.+castCSCharToChar :: CSChar -> Char+castCSCharToChar ch = unsafeChr (fromIntegral (fromIntegral ch :: Word8))++-- | Convert a Haskell character to a C @signed char@.+-- This function is only safe on the first 256 characters.+castCharToCSChar :: Char -> CSChar+castCharToCSChar ch = fromIntegral (ord ch)  -- | Marshal a NUL terminated C string into a Haskell string. --
Foreign/C/Types.hs view
@@ -43,6 +43,14 @@           -- 'Prelude.Show', 'Prelude.Enum', 'Typeable' and 'Storable'.         , CClock,   CTime +        -- extracted from CTime, because we don't want this comment in+        -- the Haskell 2010 report:++        -- | To convert 'CTime' to 'Data.Time.UTCTime', use the following formula:+        --+        -- >  posixSecondsToUTCTime (realToFrac :: POSIXTime)+        --+           -- ** Floating types           -- | These types are are represented as @newtype@s of           -- 'Prelude.Float' and 'Prelude.Double', and are instances of@@ -198,10 +206,6 @@ -- | Haskell type representing the C @clock_t@ type. ARITHMETIC_TYPE(CClock,tyConCClock,"CClock",HTYPE_CLOCK_T) -- | Haskell type representing the C @time_t@ type.------ To convert to a @Data.Time.UTCTime@, use the following formula:------ >  posixSecondsToUTCTime (realToFrac :: POSIXTime) -- ARITHMETIC_TYPE(CTime,tyConCTime,"CTime",HTYPE_TIME_T) 
Foreign/ForeignPtr.hs view
@@ -101,7 +101,7 @@ #ifndef __NHC__ newForeignPtr :: FinalizerPtr a -> Ptr a -> IO (ForeignPtr a) -- ^Turns a plain memory reference into a foreign pointer, and--- associates a finaliser with the reference.  The finaliser will be+-- associates a finalizer with the reference.  The finalizer will be -- executed after the last reference to the foreign object is dropped. -- There is no guarantee of promptness, however the finalizer will be -- executed before the program exits.
Foreign/Marshal.hs view
@@ -14,11 +14,16 @@ -----------------------------------------------------------------------------  module Foreign.Marshal-        ( module Foreign.Marshal.Alloc+        (+         -- | The module "Foreign.Marshal" re-exports the other modules in the+         -- @Foreign.Marshal@ hierarchy:+          module Foreign.Marshal.Alloc         , module Foreign.Marshal.Array         , module Foreign.Marshal.Error         , module Foreign.Marshal.Pool         , module Foreign.Marshal.Utils+         -- | and provides one function:+        , unsafeLocalState         ) where  import Foreign.Marshal.Alloc@@ -26,3 +31,30 @@ import Foreign.Marshal.Error import Foreign.Marshal.Pool import Foreign.Marshal.Utils++#ifdef __GLASGOW_HASKELL__+import GHC.IO+#else+import System.IO.Unsafe+#endif++{- |+Sometimes an external entity is a pure function, except that it passes+arguments and/or results via pointers.  The function+@unsafeLocalState@ permits the packaging of such entities as pure+functions.  ++The only IO operations allowed in the IO action passed to+@unsafeLocalState@ are (a) local allocation (@alloca@, @allocaBytes@+and derived operations such as @withArray@ and @withCString@), and (b)+pointer operations (@Foreign.Storable@ and @Foreign.Ptr@) on the+pointers to local storage, and (c) foreign functions whose only+observable effect is to read and/or write the locally allocated+memory.  Passing an IO operation that does not obey these rules+results in undefined behaviour.++It is expected that this operation will be+replaced in a future revision of Haskell.+-}+unsafeLocalState :: IO a -> a+unsafeLocalState = unsafePerformIO
Foreign/Marshal/Alloc.hs view
@@ -9,7 +9,29 @@ -- Stability   :  provisional -- Portability :  portable ----- Marshalling support: basic routines for memory allocation+-- The module "Foreign.Marshal.Alloc" provides operations to allocate and+-- deallocate blocks of raw memory (i.e., unstructured chunks of memory+-- outside of the area maintained by the Haskell storage manager).  These+-- memory blocks are commonly used to pass compound data structures to+-- foreign functions or to provide space in which compound result values+-- are obtained from foreign functions.+-- +-- If any of the allocation functions fails, a value of 'nullPtr' is+-- produced.  If 'free' or 'reallocBytes' is applied to a memory area+-- that has been allocated with 'alloca' or 'allocaBytes', the+-- behaviour is undefined.  Any further access to memory areas allocated with+-- 'alloca' or 'allocaBytes', after the computation that was passed to+-- the allocation function has terminated, leads to undefined behaviour.  Any+-- further access to the memory area referenced by a pointer passed to+-- 'realloc', 'reallocBytes', or 'free' entails undefined+-- behaviour.+-- +-- All storage allocated by functions that allocate based on a /size in bytes/+-- must be sufficiently aligned for any of the basic foreign types+-- that fits into the newly allocated storage. All storage allocated by+-- functions that allocate based on a specific type must be sufficiently+-- aligned for that type. Array allocation routines need to obey the same+-- alignment constraints for each array element. -- ----------------------------------------------------------------------------- @@ -18,6 +40,7 @@   -- ** Local allocation   alloca,       -- :: Storable a =>        (Ptr a -> IO b) -> IO b   allocaBytes,  -- ::               Int -> (Ptr a -> IO b) -> IO b+  allocaBytesAligned,  -- ::        Int -> Int -> (Ptr a -> IO b) -> IO b    -- ** Dynamic allocation   malloc,       -- :: Storable a =>        IO (Ptr a)@@ -45,7 +68,6 @@ import GHC.Ptr import GHC.Err import GHC.Base-import GHC.Num #elif defined(__NHC__) import NHC.FFI                  ( FinalizerPtr, CInt(..) ) import IO                       ( bracket )@@ -70,6 +92,7 @@ -- The memory may be deallocated using 'free' or 'finalizerFree' when -- no longer required. --+{-# INLINE malloc #-} malloc :: Storable a => IO (Ptr a) malloc  = doMalloc undefined   where@@ -93,6 +116,7 @@ -- The memory is freed when @f@ terminates (either normally or via an -- exception), so the pointer passed to @f@ must /not/ be used after this. --+{-# INLINE alloca #-} alloca :: Storable a => (Ptr a -> IO b) -> IO b alloca  = doAlloca undefined   where
Foreign/Marshal/Array.hs view
@@ -63,8 +63,8 @@ ) where  import Foreign.Ptr      (Ptr, plusPtr)-import Foreign.Storable (Storable(sizeOf,peekElemOff,pokeElemOff))-import Foreign.Marshal.Alloc (mallocBytes, allocaBytes, reallocBytes)+import Foreign.Storable (Storable(alignment,sizeOf,peekElemOff,pokeElemOff))+import Foreign.Marshal.Alloc (mallocBytes, allocaBytesAligned, reallocBytes) import Foreign.Marshal.Utils (copyBytes, moveBytes)  #ifdef __GLASGOW_HASKELL__@@ -101,13 +101,17 @@ allocaArray  = doAlloca undefined   where     doAlloca            :: Storable a' => a' -> Int -> (Ptr a' -> IO b') -> IO b'-    doAlloca dummy size  = allocaBytes (size * sizeOf dummy)+    doAlloca dummy size  = allocaBytesAligned (size * sizeOf dummy)+                                              (alignment dummy)  -- |Like 'allocaArray', but add an extra position to hold a special -- termination element. -- allocaArray0      :: Storable a => Int -> (Ptr a -> IO b) -> IO b allocaArray0 size  = allocaArray (size + 1)+{-# INLINE allocaArray0 #-}+  -- needed to get allocaArray to inline into withCString, for unknown+  -- reasons --SDM 23/4/2010, see #4004 for benchmark  -- |Adjust the size of an array --@@ -126,10 +130,8 @@ -- marshalling -- ----------- --- |Convert an array of given length into a Haskell list.  This version--- traverses the array backwards using an accumulating parameter,--- which uses constant stack space.  The previous version using mapM--- needed linear stack space.+-- |Convert an array of given length into a Haskell list.  The implementation+-- is tail-recursive and so uses constant stack space. -- peekArray          :: Storable a => Int -> Ptr a -> IO [a] peekArray size ptr | size <= 0 = return []
Foreign/Marshal/Pool.hs view
@@ -48,7 +48,7 @@ import GHC.Base              ( Int, Monad(..), (.), not ) import GHC.Err               ( undefined ) import GHC.Exception         ( throw )-import GHC.IO                ( IO, block, unblock, catchAny )+import GHC.IO                ( IO, mask, catchAny ) import GHC.IORef             ( IORef, newIORef, readIORef, writeIORef ) import GHC.List              ( elem, length ) import GHC.Num               ( Num(..) )@@ -97,10 +97,10 @@ withPool :: (Pool -> IO b) -> IO b #ifdef __GLASGOW_HASKELL__ withPool act =   -- ATTENTION: cut-n-paste from Control.Exception below!-   block (do+   mask (\restore -> do       pool <- newPool       val <- catchAny-                (unblock (act pool))+                (restore (act pool))                 (\e -> do freePool pool; throw e)       freePool pool       return val)
Foreign/Marshal/Utils.hs view
@@ -113,7 +113,7 @@ -- marshalling of Maybe values -- --------------------------- --- |Allocate storage and marshall a storable value wrapped into a 'Maybe'+-- |Allocate storage and marshal a storable value wrapped into a 'Maybe' -- -- * the 'nullPtr' is used to represent 'Nothing' --
Foreign/Ptr.hs view
@@ -105,12 +105,14 @@  # ifdef __GLASGOW_HASKELL__ -- | An unsigned integral type that can be losslessly converted to and from--- @Ptr@.+-- @Ptr@. This type is also compatible with the C99 type @uintptr_t@, and+-- can be marshalled to and from that type safely. INTEGRAL_TYPE(WordPtr,tyConWordPtr,"WordPtr",Word)         -- Word and Int are guaranteed pointer-sized in GHC  -- | A signed integral type that can be losslessly converted to and from--- @Ptr@.+-- @Ptr@.  This type is also compatible with the C99 type @intptr_t@, and+-- can be marshalled to and from that type safely. INTEGRAL_TYPE(IntPtr,tyConIntPtr,"IntPtr",Int)         -- Word and Int are guaranteed pointer-sized in GHC 
GHC/Arr.lhs view
@@ -49,13 +49,13 @@ -- An implementation is entitled to assume the following laws about these -- operations: ----- * @'inRange' (l,u) i == 'elem' i ('range' (l,u))@+-- * @'inRange' (l,u) i == 'elem' i ('range' (l,u))@ @ @ -- -- * @'range' (l,u) '!!' 'index' (l,u) i == i@, when @'inRange' (l,u) i@ ----- * @'map' ('index' (l,u)) ('range' (l,u))) == [0..'rangeSize' (l,u)-1]@+-- * @'map' ('index' (l,u)) ('range' (l,u))) == [0..'rangeSize' (l,u)-1]@ @ @ ----- * @'rangeSize' (l,u) == 'length' ('range' (l,u))@+-- * @'rangeSize' (l,u) == 'length' ('range' (l,u))@ @ @ -- -- Minimal complete instance: 'range', 'index' and 'inRange'. --@@ -76,8 +76,14 @@     unsafeRangeSize     :: (a,a) -> Int          -- Must specify one of index, unsafeIndex++	-- 'index' is typically over-ridden in instances, with essentially+	-- the same code, but using indexError instead of hopelessIndexError+	-- Reason: we have 'Show' at the instances+    {-# INLINE index #-}  -- See Note [Inlining index]     index b i | inRange b i = unsafeIndex b i   -              | otherwise   = error "Error in array index"+              | otherwise   = hopelessIndexError+     unsafeIndex b i = index b i      rangeSize b@(_l,h) | inRange b h = unsafeIndex b h + 1@@ -105,8 +111,54 @@ %*                                                      * %********************************************************* +Note [Inlining index]+~~~~~~~~~~~~~~~~~~~~~+We inline the 'index' operation, ++ * Partly because it generates much faster code +   (although bigger); see Trac #1216++ * Partly because it exposes the bounds checks to the simplifier which+   might help a big.++If you make a per-instance index method, you may consider inlining it.++Note [Double bounds-checking of index values]+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+When you index an array, a!x, there are two possible bounds checks we might make:++  (A) Check that (inRange (bounds a) x) holds.  ++      (A) is checked in the method for 'index'++  (B) Check that (index (bounds a) x) lies in the range 0..n, +      where n is the size of the underlying array++      (B) is checked in the top-level function (!), in safeIndex.++Of course it *should* be the case that (A) holds iff (B) holds, but that +is a property of the particular instances of index, bounds, and inRange,+so GHC cannot guarantee it.++ * If you do (A) and not (B), then you might get a seg-fault, +   by indexing at some bizarre location.  Trac #1610++ * If you do (B) but not (A), you may get no complaint when you index+   an array out of its semantic bounds.  Trac #2120++At various times we have had (A) and not (B), or (B) and not (A); both+led to complaints.  So now we implement *both* checks (Trac #2669).++For 1-d, 2-d, and 3-d arrays of Int we have specialised instances to avoid this.++Note [Out-of-bounds error messages]+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+The default method for 'index' generates hoplelessIndexError, because+Ix doesn't have Show as a superclass.  For particular base types we+can do better, so we override the default method for index.+ \begin{code}--- abstract these errors from the relevant index functions so that+-- Abstract these errors from the relevant index functions so that -- the guts of the function will be small enough to inline.  {-# NOINLINE indexError #-}@@ -117,6 +169,9 @@            showString " out of range " $            showParen True (showsPrec 0 rng) "") +hopelessIndexError :: Int -- Try to use 'indexError' instead!+hopelessIndexError = error "Error in array index"+ ---------------------------------------------------------------------- instance  Ix Char  where     {-# INLINE range #-}@@ -125,6 +180,8 @@     {-# INLINE unsafeIndex #-}     unsafeIndex (m,_n) i = fromEnum i - fromEnum m +    {-# INLINE index #-}  -- See Note [Out-of-bounds error messages]+                          -- and Note [Inlining index]     index b i | inRange b i =  unsafeIndex b i               | otherwise   =  indexError b i "Char" @@ -140,6 +197,8 @@     {-# INLINE unsafeIndex #-}     unsafeIndex (m,_n) i = i - m +    {-# INLINE index #-}  -- See Note [Out-of-bounds error messages]+                          -- and Note [Inlining index]     index b i | inRange b i =  unsafeIndex b i               | otherwise   =  indexError b i "Int" @@ -154,6 +213,8 @@     {-# INLINE unsafeIndex #-}     unsafeIndex (m,_n) i   = fromInteger (i - m) +    {-# INLINE index #-}  -- See Note [Out-of-bounds error messages]+                          -- and Note [Inlining index]     index b i | inRange b i =  unsafeIndex b i               | otherwise   =  indexError b i "Integer" @@ -167,6 +228,8 @@     {-# INLINE unsafeIndex #-}     unsafeIndex (l,_) i = fromEnum i - fromEnum l +    {-# INLINE index #-}  -- See Note [Out-of-bounds error messages]+                          -- and Note [Inlining index]     index b i | inRange b i =  unsafeIndex b i               | otherwise   =  indexError b i "Bool" @@ -180,6 +243,8 @@     {-# INLINE unsafeIndex #-}     unsafeIndex (l,_) i = fromEnum i - fromEnum l +    {-# INLINE index #-}  -- See Note [Out-of-bounds error messages]+                          -- and Note [Inlining index]     index b i | inRange b i =  unsafeIndex b i               | otherwise   =  indexError b i "Ordering" @@ -193,7 +258,8 @@     unsafeIndex   ((), ()) () = 0     {-# INLINE inRange #-}     inRange ((), ()) () = True-    {-# INLINE index #-}++    {-# INLINE index #-}  -- See Note [Inlining index]     index b i = unsafeIndex b i  ----------------------------------------------------------------------@@ -288,7 +354,6 @@  -- | The type of immutable non-strict (boxed) arrays -- with indices in @i@ and elements in @e@.--- The Int is the number of elements in the Array. data Ix i => Array i e                  = Array !i         -- the lower bound, l                          !i         -- the upper bound, u@@ -346,7 +411,7 @@ -- -- Because the indices must be checked for these errors, 'array' is -- strict in the bounds argument and in the indices of the association--- list, but nonstrict in the values.  Thus, recurrences such as the+-- list, but non-strict in the values.  Thus, recurrences such as the -- following are possible: -- -- > a = array (1,100) ((1,1) : [(i, i * a!(i-1)) | i <- [2..100]])@@ -391,15 +456,18 @@  {-# INLINE fill #-} fill :: MutableArray# s e -> (Int, e) -> STRep s a -> STRep s a-fill marr# (I# i#, e) next s1# =-    case writeArray# marr# i# e s1#     of { s2# ->-    next s2# }+-- NB: put the \s after the "=" so that 'fill' +--     inlines when applied to three args +fill marr# (I# i#, e) next + = \s1# -> case writeArray# marr# i# e s1# of +             s2# -> next s2#   {-# INLINE done #-} done :: Ix i => i -> i -> Int -> MutableArray# s e -> STRep s (Array i e)-done l u n marr# s1# =-    case unsafeFreezeArray# marr# s1# of-        (# s2#, arr# #) -> (# s2#, Array l u n arr# #)+-- See NB on 'fill'+done l u n marr# +  = \s1# -> case unsafeFreezeArray# marr# s1# of+              (# s2#, arr# #) -> (# s2#, Array l u n arr# #)  -- This is inefficient and I'm not sure why: -- listArray (l,u) es = unsafeArray (l,u) (zip [0 .. rangeSize (l,u) - 1] es)@@ -430,17 +498,39 @@ {-# INLINE safeRangeSize #-} safeRangeSize :: Ix i => (i, i) -> Int safeRangeSize (l,u) = let r = rangeSize (l, u)-                      in if r < 0 then error "Negative range size"+                      in if r < 0 then negRange                                   else r -{-# INLINE safeIndex #-}+-- Don't inline this error message everywhere!!+negRange :: Int	  -- Uninformative, but Ix does not provide Show+negRange = error "Negative range size"++{-# INLINE[1] safeIndex #-}+-- See Note [Double bounds-checking of index values]+-- Inline *after* (!) so the rules can fire safeIndex :: Ix i => (i, i) -> Int -> i -> Int safeIndex (l,u) n i = let i' = index (l,u) i                       in if (0 <= i') && (i' < n)                          then i'-                         else error ("Error in array index; " ++ show i' ++-                                     " not in range [0.." ++ show n ++ ")")+                         else badSafeIndex i' n +-- See Note [Double bounds-checking of index values]+{-# RULES+"safeIndex/I"       safeIndex = lessSafeIndex :: (Int,Int) -> Int -> Int -> Int+"safeIndex/(I,I)"   safeIndex = lessSafeIndex :: ((Int,Int),(Int,Int)) -> Int -> (Int,Int) -> Int+"safeIndex/(I,I,I)" safeIndex = lessSafeIndex :: ((Int,Int,Int),(Int,Int,Int)) -> Int -> (Int,Int,Int) -> Int+  #-}++lessSafeIndex :: Ix i => (i, i) -> Int -> i -> Int+-- See Note [Double bounds-checking of index values]+-- Do only (A), the semantic check+lessSafeIndex (l,u) _ i = index (l,u) i  ++-- Don't inline this long error message everywhere!!+badSafeIndex :: Int -> Int -> Int+badSafeIndex i' n = error ("Error in array index; " ++ show i' +++                        " not in range [0.." ++ show n ++ ")")+ {-# INLINE unsafeAt #-} unsafeAt :: Ix i => Array i e -> Int -> e unsafeAt (Array _ _ _ arr#) (I# i#) =@@ -473,7 +563,7 @@ assocs arr@(Array l u _ _) =     [(i, arr ! i) | i <- range (l,u)] --- | The 'accumArray' deals with repeated indices in the association+-- | The 'accumArray' function deals with repeated indices in the association -- list using an /accumulating function/ which combines the values of -- associations with the same index. -- For example, given a list of values of some index type, @hist@@@ -511,11 +601,12 @@  {-# INLINE adjust #-} adjust :: (e -> a -> e) -> MutableArray# s e -> (Int, a) -> STRep s b -> STRep s b-adjust f marr# (I# i#, new) next s1# =-    case readArray# marr# i# s1# of-        (# s2#, old #) ->-            case writeArray# marr# i# (f old new) s2# of-                s3# -> next s3#+-- See NB on 'fill'+adjust f marr# (I# i#, new) next+  = \s1# -> case readArray# marr# i# s1# of+        	(# s2#, old #) ->+        	    case writeArray# marr# i# (f old new) s2# of+        	        s3# -> next s3#  -- | Constructs an array identical to the first argument except that it has -- been updated by the associations in the right argument.
GHC/Base.lhs view
@@ -63,6 +63,8 @@  \begin{code} {-# OPTIONS_GHC -XNoImplicitPrelude #-}+-- -fno-warn-orphans is needed for things like:+-- Orphan rule: "x# -# x#" ALWAYS forall x# :: Int# -# x# x# = 0 {-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_HADDOCK hide #-} -----------------------------------------------------------------------------@@ -171,7 +173,7 @@ > fmap (f . g)  ==  fmap f . fmap g  The instances of 'Functor' for lists, 'Data.Maybe.Maybe' and 'System.IO.IO'-defined in the "Prelude" satisfy these laws.+satisfy these laws. -}  class  Functor f  where@@ -224,6 +226,7 @@     -- failure in a @do@ expression.     fail        :: String -> m a +    {-# INLINE (>>) #-}     m >> k      = m >>= \_ -> k     fail s      = error s \end{code}@@ -236,24 +239,6 @@ %*********************************************************  \begin{code}--- do explicitly: deriving (Eq, Ord)--- to avoid weird names like con2tag_[]#--instance (Eq a) => Eq [a] where-    {-# SPECIALISE instance Eq [Char] #-}-    []     == []     = True-    (x:xs) == (y:ys) = x == y && xs == ys-    _xs    == _ys    = False--instance (Ord a) => Ord [a] where-    {-# SPECIALISE instance Ord [Char] #-}-    compare []     []     = EQ-    compare []     (_:_)  = LT-    compare (_:_)  []     = GT-    compare (x:xs) (y:ys) = case compare x y of-                                EQ    -> compare xs ys-                                other -> other- instance Functor [] where     fmap = map @@ -283,10 +268,12 @@ -- foldr f z (x:xs) =  f x (foldr f z xs) {-# INLINE [0] foldr #-} -- Inline only in the final stage, after the foldr/cons rule has had a chance-foldr k z xs = go xs-             where-               go []     = z-               go (y:ys) = y `k` go ys+-- Also note that we inline it when it has *two* parameters, which are the +-- ones we are keen about specialising!+foldr k z = go+          where+            go []     = z+            go (y:ys) = y `k` go ys  -- | A list producer that can be fused with 'foldr'. -- This function is merely@@ -374,7 +361,7 @@ -- Note eta expanded mapFB ::  (elt -> lst -> lst) -> (a -> elt) -> a -> lst -> lst {-# INLINE [0] mapFB #-}-mapFB c f x ys = c (f x) ys+mapFB c f = \x ys -> c (f x) ys  -- The rules for map work like this. -- @@ -431,30 +418,6 @@ %*********************************************************  \begin{code}--- |The 'Bool' type is an enumeration.  It is defined with 'False'--- first so that the corresponding 'Prelude.Enum' instance will give--- 'Prelude.fromEnum' 'False' the value zero, and--- 'Prelude.fromEnum' 'True' the value 1.--- The actual definition is in the ghc-prim package.---- XXX These don't work:--- deriving instance Eq Bool--- deriving instance Ord Bool--- <wired into compiler>:---     Illegal binding of built-in syntax: con2tag_Bool#--instance Eq Bool where-    True  == True  = True-    False == False = True-    _     == _     = False--instance Ord Bool where-    compare False True  = LT-    compare True  False = GT-    compare _     _     = EQ---- Read is in GHC.Read, Show in GHC.Show- -- |'otherwise' is defined as the value 'True'.  It helps to make -- guards more readable.  eg. --@@ -466,36 +429,6 @@  %********************************************************* %*                                                      *-\subsection{Type @Ordering@}-%*                                                      *-%*********************************************************--\begin{code}--- | Represents an ordering relationship between two values: less--- than, equal to, or greater than.  An 'Ordering' is returned by--- 'compare'.--- XXX These don't work:--- deriving instance Eq Ordering--- deriving instance Ord Ordering--- Illegal binding of built-in syntax: con2tag_Ordering#-instance Eq Ordering where-    EQ == EQ = True-    LT == LT = True-    GT == GT = True-    _  == _  = False-        -- Read in GHC.Read, Show in GHC.Show--instance Ord Ordering where-    LT <= _  = True-    _  <= LT = False-    EQ <= _  = True-    _  <= EQ = False-    GT <= GT = True-\end{code}---%*********************************************************-%*                                                      * \subsection{Type @Char@ and @String@} %*                                                      * %*********************************************************@@ -506,33 +439,6 @@ -- type String = [Char] -{-| The character type 'Char' is an enumeration whose values represent-Unicode (or equivalently ISO\/IEC 10646) characters-(see <http://www.unicode.org/> for details).-This set extends the ISO 8859-1 (Latin-1) character set-(the first 256 charachers), which is itself an extension of the ASCII-character set (the first 128 characters).-A character literal in Haskell has type 'Char'.--To convert a 'Char' to or from the corresponding 'Int' value defined-by Unicode, use 'Prelude.toEnum' and 'Prelude.fromEnum' from the-'Prelude.Enum' class respectively (or equivalently 'ord' and 'chr').--}---- We don't use deriving for Eq and Ord, because for Ord the derived--- instance defines only compare, which takes two primops.  Then--- '>' uses compare, and therefore takes two primops instead of one.--instance Eq Char where-    (C# c1) == (C# c2) = c1 `eqChar#` c2-    (C# c1) /= (C# c2) = c1 `neChar#` c2--instance Ord Char where-    (C# c1) >  (C# c2) = c1 `gtChar#` c2-    (C# c1) >= (C# c2) = c1 `geChar#` c2-    (C# c1) <= (C# c2) = c1 `leChar#` c2-    (C# c1) <  (C# c2) = c1 `ltChar#` c2- {-# RULES "x# `eqChar#` x#" forall x#. x# `eqChar#` x# = True "x# `neChar#` x#" forall x#. x# `neChar#` x# = False@@ -639,16 +545,6 @@ -- sees it as lazy.  Then the worker/wrapper phase inlines it. -- Result: happiness ---- | The call '(inline f)' reduces to 'f', but 'inline' has a BuiltInRule--- that tries to inline 'f' (if it has an unfolding) unconditionally--- The 'NOINLINE' pragma arranges that inline only gets inlined (and--- hence eliminated) late in compilation, after the rule has had--- a god chance to fire.-inline :: a -> a-{-# NOINLINE[0] inline #-}-inline x = x- -- Assertion function.  This simply ignores its boolean argument. -- The compiler may rewrite it to @('assertError' line)@. @@ -684,8 +580,10 @@  -- | Function composition. {-# INLINE (.) #-}-(.)       :: (b -> c) -> (a -> b) -> a -> c-(.) f g x = f (g x)+-- Make sure it has TWO args only on the left, so that it inlines+-- when applied to two functions, even if there is no final argument+(.)    :: (b -> c) -> (a -> b) -> a -> c+(.) f g = \x -> f (g x)  -- | @'flip' f@ takes its (first) two arguments in the reverse order of @f@. flip                    :: (a -> b -> c) -> b -> a -> c@@ -982,14 +880,21 @@         !ch = indexCharOffAddr# addr nh  unpackFoldrCString# :: Addr# -> (Char  -> a -> a) -> a -> a -{-# NOINLINE [0] unpackFoldrCString# #-}--- Unlike unpackCString#, there *is* some point in inlining unpackFoldrCString#, --- because we get better code for the function call.--- However, don't inline till right at the end;--- usually the unpack-list rule turns it into unpackCStringList++-- Usually the unpack-list rule turns unpackFoldrCString# into unpackCString#+ -- It also has a BuiltInRule in PrelRules.lhs: --      unpackFoldrCString# "foo" c (unpackFoldrCString# "baz" c n) --        =  unpackFoldrCString# "foobaz" c n++{-# NOINLINE unpackFoldrCString# #-}+-- At one stage I had NOINLINE [0] on the grounds that, unlike+-- unpackCString#, there *is* some point in inlining+-- unpackFoldrCString#, because we get better code for the+-- higher-order function call.  BUT there may be a lot of+-- literal strings, and making a separate 'unpack' loop for+-- each is highly gratuitous.  See nofib/real/anna/PrettyPrint.+ unpackFoldrCString# addr f z    = unpack 0#   where
GHC/Classes.hs view
@@ -1,5 +1,7 @@  {-# OPTIONS_GHC -XNoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+-- XXX -fno-warn-unused-imports needed for the GHC.Tuple import below. Sigh. {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- |@@ -18,7 +20,14 @@ module GHC.Classes where  import GHC.Bool+import GHC.Integer+-- GHC.Magic is used in some derived instances+import GHC.Magic () import GHC.Ordering+import GHC.Prim+import GHC.Tuple+import GHC.Types+import GHC.Unit  infix  4  ==, /=, <, <=, >=, > infixr 3  &&@@ -36,9 +45,68 @@ class  Eq a  where     (==), (/=)           :: a -> a -> Bool +    {-# INLINE (/=) #-}+    {-# INLINE (==) #-}     x /= y               = not (x == y)     x == y               = not (x /= y) +deriving instance Eq ()+deriving instance (Eq  a, Eq  b) => Eq  (a, b)+deriving instance (Eq  a, Eq  b, Eq  c) => Eq  (a, b, c)+deriving instance (Eq  a, Eq  b, Eq  c, Eq  d) => Eq  (a, b, c, d)+deriving instance (Eq  a, Eq  b, Eq  c, Eq  d, Eq  e) => Eq  (a, b, c, d, e)+deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f)+               => Eq (a, b, c, d, e, f)+deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g)+               => Eq (a, b, c, d, e, f, g)+deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,+                   Eq h)+               => Eq (a, b, c, d, e, f, g, h)+deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,+                   Eq h, Eq i)+               => Eq (a, b, c, d, e, f, g, h, i)+deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,+                   Eq h, Eq i, Eq j)+               => Eq (a, b, c, d, e, f, g, h, i, j)+deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,+                   Eq h, Eq i, Eq j, Eq k)+               => Eq (a, b, c, d, e, f, g, h, i, j, k)+deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,+                   Eq h, Eq i, Eq j, Eq k, Eq l)+               => Eq (a, b, c, d, e, f, g, h, i, j, k, l)+deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,+                   Eq h, Eq i, Eq j, Eq k, Eq l, Eq m)+               => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m)+deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,+                   Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n)+               => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n)+deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,+                   Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o)+               => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)++instance (Eq a) => Eq [a] where+    {-# SPECIALISE instance Eq [Char] #-}+    []     == []     = True+    (x:xs) == (y:ys) = x == y && xs == ys+    _xs    == _ys    = False++deriving instance Eq Bool+deriving instance Eq Ordering++instance Eq Char where+    (C# c1) == (C# c2) = c1 `eqChar#` c2+    (C# c1) /= (C# c2) = c1 `neChar#` c2++instance  Eq Integer  where+    (==) = eqInteger+    (/=) = neqInteger++instance Eq Float where+    (F# x) == (F# y) = x `eqFloat#` y++instance Eq Double where+    (D# x) == (D# y) = x ==## y+ -- | The 'Ord' class is used for totally ordered datatypes. -- -- Instances of 'Ord' can be derived for any user-defined@@ -71,6 +139,90 @@         -- because the latter is often more expensive     max x y = if x <= y then y else x     min x y = if x <= y then x else y++deriving instance Ord ()+deriving instance (Ord a, Ord b) => Ord (a, b)+deriving instance (Ord a, Ord b, Ord c) => Ord (a, b, c)+deriving instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)+deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)+deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f)+               => Ord (a, b, c, d, e, f)+deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g)+               => Ord (a, b, c, d, e, f, g)+deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,+                   Ord h)+               => Ord (a, b, c, d, e, f, g, h)+deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,+                   Ord h, Ord i)+               => Ord (a, b, c, d, e, f, g, h, i)+deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,+                   Ord h, Ord i, Ord j)+               => Ord (a, b, c, d, e, f, g, h, i, j)+deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,+                   Ord h, Ord i, Ord j, Ord k)+               => Ord (a, b, c, d, e, f, g, h, i, j, k)+deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,+                   Ord h, Ord i, Ord j, Ord k, Ord l)+               => Ord (a, b, c, d, e, f, g, h, i, j, k, l)+deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,+                   Ord h, Ord i, Ord j, Ord k, Ord l, Ord m)+               => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m)+deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,+                   Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n)+               => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n)+deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,+                   Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o)+               => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)++instance (Ord a) => Ord [a] where+    {-# SPECIALISE instance Ord [Char] #-}+    compare []     []     = EQ+    compare []     (_:_)  = LT+    compare (_:_)  []     = GT+    compare (x:xs) (y:ys) = case compare x y of+                                EQ    -> compare xs ys+                                other -> other++deriving instance Ord Bool+deriving instance Ord Ordering++-- We don't use deriving for Ord Char, because for Ord the derived+-- instance defines only compare, which takes two primops.  Then+-- '>' uses compare, and therefore takes two primops instead of one.+instance Ord Char where+    (C# c1) >  (C# c2) = c1 `gtChar#` c2+    (C# c1) >= (C# c2) = c1 `geChar#` c2+    (C# c1) <= (C# c2) = c1 `leChar#` c2+    (C# c1) <  (C# c2) = c1 `ltChar#` c2++instance Ord Integer where+    (<=) = leInteger+    (>)  = gtInteger+    (<)  = ltInteger+    (>=) = geInteger+    compare = compareInteger++instance Ord Float where+    (F# x) `compare` (F# y)+        = if      x `ltFloat#` y then LT+          else if x `eqFloat#` y then EQ+          else                        GT++    (F# x) <  (F# y) = x `ltFloat#`  y+    (F# x) <= (F# y) = x `leFloat#`  y+    (F# x) >= (F# y) = x `geFloat#`  y+    (F# x) >  (F# y) = x `gtFloat#`  y++instance Ord Double where+    (D# x) `compare` (D# y)+        = if      x <##  y then LT+          else if x ==## y then EQ+          else                  GT++    (D# x) <  (D# y) = x <##  y+    (D# x) <= (D# y) = x <=## y+    (D# x) >= (D# y) = x >=## y+    (D# x) >  (D# y) = x >##  y  -- OK, so they're technically not part of a class...: 
GHC/Conc.lhs view
@@ -29,1327 +29,80 @@          -- * Forking and suchlike         , forkIO        -- :: IO a -> IO ThreadId-        , forkOnIO      -- :: Int -> IO a -> IO ThreadId-        , numCapabilities -- :: Int-        , childHandler  -- :: Exception -> IO ()-        , myThreadId    -- :: IO ThreadId-        , killThread    -- :: ThreadId -> IO ()-        , throwTo       -- :: ThreadId -> Exception -> IO ()-        , par           -- :: a -> b -> b-        , pseq          -- :: a -> b -> b-        , runSparks-        , yield         -- :: IO ()-        , labelThread   -- :: ThreadId -> String -> IO ()--        , ThreadStatus(..), BlockReason(..)-        , threadStatus  -- :: ThreadId -> IO ThreadStatus--        -- * Waiting-        , threadDelay           -- :: Int -> IO ()-        , registerDelay         -- :: Int -> IO (TVar Bool)-        , threadWaitRead        -- :: Int -> IO ()-        , threadWaitWrite       -- :: Int -> IO ()--        -- * TVars-        , STM(..)-        , atomically    -- :: STM a -> IO a-        , retry         -- :: STM a-        , orElse        -- :: STM a -> STM a -> STM a-        , catchSTM      -- :: STM a -> (Exception -> STM a) -> STM a-        , alwaysSucceeds -- :: STM a -> STM ()-        , always        -- :: STM Bool -> STM ()-        , TVar(..)-        , newTVar       -- :: a -> STM (TVar a)-        , newTVarIO     -- :: a -> STM (TVar a)-        , readTVar      -- :: TVar a -> STM a-        , readTVarIO    -- :: TVar a -> IO a-        , writeTVar     -- :: a -> TVar a -> STM ()-        , unsafeIOToSTM -- :: IO a -> STM a--        -- * Miscellaneous-        , withMVar-#ifdef mingw32_HOST_OS-        , asyncRead     -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)-        , asyncWrite    -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)-        , asyncDoProc   -- :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int--        , asyncReadBA   -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)-        , asyncWriteBA  -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)-#endif--#ifndef mingw32_HOST_OS-        , Signal, HandlerFun, setHandler, runHandlers-#endif--        , ensureIOManagerIsRunning-#ifndef mingw32_HOST_OS-        , syncIOManager-#endif--#ifdef mingw32_HOST_OS-        , ConsoleEvent(..)-        , win32ConsoleHandler-        , toWin32ConsoleEvent-#endif-        , setUncaughtExceptionHandler      -- :: (Exception -> IO ()) -> IO ()-        , getUncaughtExceptionHandler      -- :: IO (Exception -> IO ())--        , reportError, reportStackOverflow-        ) where--import System.Posix.Types-#ifndef mingw32_HOST_OS-import System.Posix.Internals-#endif-import Foreign-import Foreign.C--#ifdef mingw32_HOST_OS-import Data.Typeable-#endif--#ifndef mingw32_HOST_OS-import Data.Dynamic-#endif-import Control.Monad-import Data.Maybe--import GHC.Base-#ifndef mingw32_HOST_OS-import GHC.Debug-#endif-import {-# SOURCE #-} GHC.IO.Handle ( hFlush )-import {-# SOURCE #-} GHC.IO.Handle.FD ( stdout )-import GHC.IO-import GHC.IO.Exception-import GHC.Exception-import GHC.IORef-import GHC.MVar-import GHC.Num          ( Num(..) )-import GHC.Real         ( fromIntegral )-#ifndef mingw32_HOST_OS-import GHC.IOArray-import GHC.Arr          ( inRange )-#endif-#ifdef mingw32_HOST_OS-import GHC.Real         ( div )-import GHC.Ptr-#endif-#ifdef mingw32_HOST_OS-import GHC.Read         ( Read )-import GHC.Enum         ( Enum )-#endif-import GHC.Pack         ( packCString# )-import GHC.Show         ( Show(..), showString )--infixr 0 `par`, `pseq`-\end{code}--%************************************************************************-%*                                                                      *-\subsection{@ThreadId@, @par@, and @fork@}-%*                                                                      *-%************************************************************************--\begin{code}-data ThreadId = ThreadId ThreadId# deriving( Typeable )--- ToDo: data ThreadId = ThreadId (Weak ThreadId#)--- But since ThreadId# is unlifted, the Weak type must use open--- type variables.-{- ^-A 'ThreadId' is an abstract type representing a handle to a thread.-'ThreadId' is an instance of 'Eq', 'Ord' and 'Show', where-the 'Ord' instance implements an arbitrary total ordering over-'ThreadId's. The 'Show' instance lets you convert an arbitrary-valued-'ThreadId' to string form; showing a 'ThreadId' value is occasionally-useful when debugging or diagnosing the behaviour of a concurrent-program.--/Note/: in GHC, if you have a 'ThreadId', you essentially have-a pointer to the thread itself.  This means the thread itself can\'t be-garbage collected until you drop the 'ThreadId'.-This misfeature will hopefully be corrected at a later date.--/Note/: Hugs does not provide any operations on other threads;-it defines 'ThreadId' as a synonym for ().--}--instance Show ThreadId where-   showsPrec d t = -        showString "ThreadId " . -        showsPrec d (getThreadId (id2TSO t))--foreign import ccall unsafe "rts_getThreadId" getThreadId :: ThreadId# -> CInt--id2TSO :: ThreadId -> ThreadId#-id2TSO (ThreadId t) = t--foreign import ccall unsafe "cmp_thread" cmp_thread :: ThreadId# -> ThreadId# -> CInt--- Returns -1, 0, 1--cmpThread :: ThreadId -> ThreadId -> Ordering-cmpThread t1 t2 = -   case cmp_thread (id2TSO t1) (id2TSO t2) of-      -1 -> LT-      0  -> EQ-      _  -> GT -- must be 1--instance Eq ThreadId where-   t1 == t2 = -      case t1 `cmpThread` t2 of-         EQ -> True-         _  -> False--instance Ord ThreadId where-   compare = cmpThread--{- |-Sparks off a new thread to run the 'IO' computation passed as the-first argument, and returns the 'ThreadId' of the newly created-thread.--The new thread will be a lightweight thread; if you want to use a foreign-library that uses thread-local storage, use 'Control.Concurrent.forkOS' instead.--GHC note: the new thread inherits the /blocked/ state of the parent -(see 'Control.Exception.block').--The newly created thread has an exception handler that discards the-exceptions 'BlockedIndefinitelyOnMVar', 'BlockedIndefinitelyOnSTM', and-'ThreadKilled', and passes all other exceptions to the uncaught-exception handler (see 'setUncaughtExceptionHandler').--}-forkIO :: IO () -> IO ThreadId-forkIO action = IO $ \ s -> -   case (fork# action_plus s) of (# s1, tid #) -> (# s1, ThreadId tid #)- where-  action_plus = catchException action childHandler--{- |-Like 'forkIO', but lets you specify on which CPU the thread is-created.  Unlike a `forkIO` thread, a thread created by `forkOnIO`-will stay on the same CPU for its entire lifetime (`forkIO` threads-can migrate between CPUs according to the scheduling policy).-`forkOnIO` is useful for overriding the scheduling policy when you-know in advance how best to distribute the threads.--The `Int` argument specifies the CPU number; it is interpreted modulo-'numCapabilities' (note that it actually specifies a capability number-rather than a CPU number, but to a first approximation the two are-equivalent).--}-forkOnIO :: Int -> IO () -> IO ThreadId-forkOnIO (I# cpu) action = IO $ \ s -> -   case (forkOn# cpu action_plus s) of (# s1, tid #) -> (# s1, ThreadId tid #)- where-  action_plus = catchException action childHandler---- | the value passed to the @+RTS -N@ flag.  This is the number of--- Haskell threads that can run truly simultaneously at any given--- time, and is typically set to the number of physical CPU cores on--- the machine.-numCapabilities :: Int-numCapabilities = unsafePerformIO $  do -                    n <- peek n_capabilities-                    return (fromIntegral n)--#if defined(mingw32_HOST_OS) && defined(__PIC__)-foreign import ccall "_imp__n_capabilities" n_capabilities :: Ptr CInt-#else-foreign import ccall "&n_capabilities" n_capabilities :: Ptr CInt-#endif-childHandler :: SomeException -> IO ()-childHandler err = catchException (real_handler err) childHandler--real_handler :: SomeException -> IO ()-real_handler se@(SomeException ex) =-  -- ignore thread GC and killThread exceptions:-  case cast ex of-  Just BlockedIndefinitelyOnMVar        -> return ()-  _ -> case cast ex of-       Just BlockedIndefinitelyOnSTM    -> return ()-       _ -> case cast ex of-            Just ThreadKilled           -> return ()-            _ -> case cast ex of-                 -- report all others:-                 Just StackOverflow     -> reportStackOverflow-                 _                      -> reportError se--{- | 'killThread' raises the 'ThreadKilled' exception in the given-thread (GHC only). --> killThread tid = throwTo tid ThreadKilled---}-killThread :: ThreadId -> IO ()-killThread tid = throwTo tid ThreadKilled--{- | 'throwTo' raises an arbitrary exception in the target thread (GHC only).--'throwTo' does not return until the exception has been raised in the-target thread. -The calling thread can thus be certain that the target-thread has received the exception.  This is a useful property to know-when dealing with race conditions: eg. if there are two threads that-can kill each other, it is guaranteed that only one of the threads-will get to kill the other.--Whatever work the target thread was doing when the exception was-raised is not lost: the computation is suspended until required by-another thread.--If the target thread is currently making a foreign call, then the-exception will not be raised (and hence 'throwTo' will not return)-until the call has completed.  This is the case regardless of whether-the call is inside a 'block' or not.--Important note: the behaviour of 'throwTo' differs from that described in-the paper \"Asynchronous exceptions in Haskell\"-(<http://research.microsoft.com/~simonpj/Papers/asynch-exns.htm>).-In the paper, 'throwTo' is non-blocking; but the library implementation adopts-a more synchronous design in which 'throwTo' does not return until the exception-is received by the target thread.  The trade-off is discussed in Section 9 of the paper.-Like any blocking operation, 'throwTo' is therefore interruptible (see Section 5.3 of-the paper).--There is no guarantee that the exception will be delivered promptly,-although the runtime will endeavour to ensure that arbitrary-delays don't occur.  In GHC, an exception can only be raised when a-thread reaches a /safe point/, where a safe point is where memory-allocation occurs.  Some loops do not perform any memory allocation-inside the loop and therefore cannot be interrupted by a 'throwTo'.--Blocked 'throwTo' is fair: if multiple threads are trying to throw an-exception to the same target thread, they will succeed in FIFO order.--  -}-throwTo :: Exception e => ThreadId -> e -> IO ()-throwTo (ThreadId tid) ex = IO $ \ s ->-   case (killThread# tid (toException ex) s) of s1 -> (# s1, () #)---- | Returns the 'ThreadId' of the calling thread (GHC only).-myThreadId :: IO ThreadId-myThreadId = IO $ \s ->-   case (myThreadId# s) of (# s1, tid #) -> (# s1, ThreadId tid #)----- |The 'yield' action allows (forces, in a co-operative multitasking--- implementation) a context-switch to any other currently runnable--- threads (if any), and is occasionally useful when implementing--- concurrency abstractions.-yield :: IO ()-yield = IO $ \s -> -   case (yield# s) of s1 -> (# s1, () #)--{- | 'labelThread' stores a string as identifier for this thread if-you built a RTS with debugging support. This identifier will be used in-the debugging output to make distinction of different threads easier-(otherwise you only have the thread state object\'s address in the heap).--Other applications like the graphical Concurrent Haskell Debugger-(<http://www.informatik.uni-kiel.de/~fhu/chd/>) may choose to overload-'labelThread' for their purposes as well.--}--labelThread :: ThreadId -> String -> IO ()-labelThread (ThreadId t) str = IO $ \ s ->-   let !ps  = packCString# str-       !adr = byteArrayContents# ps in-     case (labelThread# t adr s) of s1 -> (# s1, () #)----      Nota Bene: 'pseq' used to be 'seq'---                 but 'seq' is now defined in PrelGHC------ "pseq" is defined a bit weirdly (see below)------ The reason for the strange "lazy" call is that--- it fools the compiler into thinking that pseq  and par are non-strict in--- their second argument (even if it inlines pseq at the call site).--- If it thinks pseq is strict in "y", then it often evaluates--- "y" before "x", which is totally wrong.  --{-# INLINE pseq  #-}-pseq :: a -> b -> b-pseq  x y = x `seq` lazy y--{-# INLINE par  #-}-par :: a -> b -> b-par  x y = case (par# x) of { _ -> lazy y }---- | Internal function used by the RTS to run sparks.-runSparks :: IO ()-runSparks = IO loop-  where loop s = case getSpark# s of-                   (# s', n, p #) ->-                      if n ==# 0# then (# s', () #)-                                  else p `seq` loop s'--data BlockReason-  = BlockedOnMVar-        -- ^blocked on on 'MVar'-  | BlockedOnBlackHole-        -- ^blocked on a computation in progress by another thread-  | BlockedOnException-        -- ^blocked in 'throwTo'-  | BlockedOnSTM-        -- ^blocked in 'retry' in an STM transaction-  | BlockedOnForeignCall-        -- ^currently in a foreign call-  | BlockedOnOther-        -- ^blocked on some other resource.  Without @-threaded@,-        -- I\/O and 'threadDelay' show up as 'BlockedOnOther', with @-threaded@-        -- they show up as 'BlockedOnMVar'.-  deriving (Eq,Ord,Show)---- | The current status of a thread-data ThreadStatus-  = ThreadRunning-        -- ^the thread is currently runnable or running-  | ThreadFinished-        -- ^the thread has finished-  | ThreadBlocked  BlockReason-        -- ^the thread is blocked on some resource-  | ThreadDied-        -- ^the thread received an uncaught exception-  deriving (Eq,Ord,Show)--threadStatus :: ThreadId -> IO ThreadStatus-threadStatus (ThreadId t) = IO $ \s ->-   case threadStatus# t s of-     (# s', stat #) -> (# s', mk_stat (I# stat) #)-   where-        -- NB. keep these in sync with includes/Constants.h-     mk_stat 0  = ThreadRunning-     mk_stat 1  = ThreadBlocked BlockedOnMVar-     mk_stat 2  = ThreadBlocked BlockedOnBlackHole-     mk_stat 3  = ThreadBlocked BlockedOnException-     mk_stat 7  = ThreadBlocked BlockedOnSTM-     mk_stat 11 = ThreadBlocked BlockedOnForeignCall-     mk_stat 12 = ThreadBlocked BlockedOnForeignCall-     mk_stat 16 = ThreadFinished-     mk_stat 17 = ThreadDied-     mk_stat _  = ThreadBlocked BlockedOnOther-\end{code}---%************************************************************************-%*                                                                      *-\subsection[stm]{Transactional heap operations}-%*                                                                      *-%************************************************************************--TVars are shared memory locations which support atomic memory-transactions.--\begin{code}--- |A monad supporting atomic memory transactions.-newtype STM a = STM (State# RealWorld -> (# State# RealWorld, a #))--unSTM :: STM a -> (State# RealWorld -> (# State# RealWorld, a #))-unSTM (STM a) = a--INSTANCE_TYPEABLE1(STM,stmTc,"STM")--instance  Functor STM where-   fmap f x = x >>= (return . f)--instance  Monad STM  where-    {-# INLINE return #-}-    {-# INLINE (>>)   #-}-    {-# INLINE (>>=)  #-}-    m >> k      = thenSTM m k-    return x    = returnSTM x-    m >>= k     = bindSTM m k--bindSTM :: STM a -> (a -> STM b) -> STM b-bindSTM (STM m) k = STM ( \s ->-  case m s of -    (# new_s, a #) -> unSTM (k a) new_s-  )--thenSTM :: STM a -> STM b -> STM b-thenSTM (STM m) k = STM ( \s ->-  case m s of -    (# new_s, _ #) -> unSTM k new_s-  )--returnSTM :: a -> STM a-returnSTM x = STM (\s -> (# s, x #))---- | Unsafely performs IO in the STM monad.  Beware: this is a highly--- dangerous thing to do.  ------   * The STM implementation will often run transactions multiple---     times, so you need to be prepared for this if your IO has any---     side effects.------   * The STM implementation will abort transactions that are known to---     be invalid and need to be restarted.  This may happen in the middle---     of `unsafeIOToSTM`, so make sure you don't acquire any resources---     that need releasing (exception handlers are ignored when aborting---     the transaction).  That includes doing any IO using Handles, for---     example.  Getting this wrong will probably lead to random deadlocks.------   * The transaction may have seen an inconsistent view of memory when---     the IO runs.  Invariants that you expect to be true throughout---     your program may not be true inside a transaction, due to the---     way transactions are implemented.  Normally this wouldn't be visible---     to the programmer, but using `unsafeIOToSTM` can expose it.----unsafeIOToSTM :: IO a -> STM a-unsafeIOToSTM (IO m) = STM m---- |Perform a series of STM actions atomically.------ You cannot use 'atomically' inside an 'unsafePerformIO' or 'unsafeInterleaveIO'. --- Any attempt to do so will result in a runtime error.  (Reason: allowing--- this would effectively allow a transaction inside a transaction, depending--- on exactly when the thunk is evaluated.)------ However, see 'newTVarIO', which can be called inside 'unsafePerformIO',--- and which allows top-level TVars to be allocated.--atomically :: STM a -> IO a-atomically (STM m) = IO (\s -> (atomically# m) s )---- |Retry execution of the current memory transaction because it has seen--- values in TVars which mean that it should not continue (e.g. the TVars--- represent a shared buffer that is now empty).  The implementation may--- block the thread until one of the TVars that it has read from has been--- udpated. (GHC only)-retry :: STM a-retry = STM $ \s# -> retry# s#---- |Compose two alternative STM actions (GHC only).  If the first action--- completes without retrying then it forms the result of the orElse.--- Otherwise, if the first action retries, then the second action is--- tried in its place.  If both actions retry then the orElse as a--- whole retries.-orElse :: STM a -> STM a -> STM a-orElse (STM m) e = STM $ \s -> catchRetry# m (unSTM e) s---- |Exception handling within STM actions.-catchSTM :: STM a -> (SomeException -> STM a) -> STM a-catchSTM (STM m) k = STM $ \s -> catchSTM# m (\ex -> unSTM (k ex)) s---- | Low-level primitive on which always and alwaysSucceeds are built.--- checkInv differs form these in that (i) the invariant is not --- checked when checkInv is called, only at the end of this and--- subsequent transcations, (ii) the invariant failure is indicated--- by raising an exception.-checkInv :: STM a -> STM ()-checkInv (STM m) = STM (\s -> (check# m) s)---- | alwaysSucceeds adds a new invariant that must be true when passed--- to alwaysSucceeds, at the end of the current transaction, and at--- the end of every subsequent transaction.  If it fails at any--- of those points then the transaction violating it is aborted--- and the exception raised by the invariant is propagated.-alwaysSucceeds :: STM a -> STM ()-alwaysSucceeds i = do ( i >> retry ) `orElse` ( return () ) -                      checkInv i---- | always is a variant of alwaysSucceeds in which the invariant is--- expressed as an STM Bool action that must return True.  Returning--- False or raising an exception are both treated as invariant failures.-always :: STM Bool -> STM ()-always i = alwaysSucceeds ( do v <- i-                               if (v) then return () else ( error "Transacional invariant violation" ) )---- |Shared memory locations that support atomic memory transactions.-data TVar a = TVar (TVar# RealWorld a)--INSTANCE_TYPEABLE1(TVar,tvarTc,"TVar")--instance Eq (TVar a) where-        (TVar tvar1#) == (TVar tvar2#) = sameTVar# tvar1# tvar2#---- |Create a new TVar holding a value supplied-newTVar :: a -> STM (TVar a)-newTVar val = STM $ \s1# ->-    case newTVar# val s1# of-         (# s2#, tvar# #) -> (# s2#, TVar tvar# #)---- |@IO@ version of 'newTVar'.  This is useful for creating top-level--- 'TVar's using 'System.IO.Unsafe.unsafePerformIO', because using--- 'atomically' inside 'System.IO.Unsafe.unsafePerformIO' isn't--- possible.-newTVarIO :: a -> IO (TVar a)-newTVarIO val = IO $ \s1# ->-    case newTVar# val s1# of-         (# s2#, tvar# #) -> (# s2#, TVar tvar# #)---- |Return the current value stored in a TVar.--- This is equivalent to------ >  readTVarIO = atomically . readTVar------ but works much faster, because it doesn't perform a complete--- transaction, it just reads the current value of the 'TVar'.-readTVarIO :: TVar a -> IO a-readTVarIO (TVar tvar#) = IO $ \s# -> readTVarIO# tvar# s#---- |Return the current value stored in a TVar-readTVar :: TVar a -> STM a-readTVar (TVar tvar#) = STM $ \s# -> readTVar# tvar# s#---- |Write the supplied value into a TVar-writeTVar :: TVar a -> a -> STM ()-writeTVar (TVar tvar#) val = STM $ \s1# ->-    case writeTVar# tvar# val s1# of-         s2# -> (# s2#, () #)-  -\end{code}--MVar utilities--\begin{code}-withMVar :: MVar a -> (a -> IO b) -> IO b-withMVar m io = -  block $ do-    a <- takeMVar m-    b <- catchAny (unblock (io a))-            (\e -> do putMVar m a; throw e)-    putMVar m a-    return b--modifyMVar_ :: MVar a -> (a -> IO a) -> IO ()-modifyMVar_ m io =-  block $ do-    a <- takeMVar m-    a' <- catchAny (unblock (io a))-            (\e -> do putMVar m a; throw e)-    putMVar m a'-    return ()-\end{code}--%************************************************************************-%*                                                                      *-\subsection{Thread waiting}-%*                                                                      *-%************************************************************************--\begin{code}-#ifdef mingw32_HOST_OS---- Note: threadWaitRead and threadWaitWrite aren't really functional--- on Win32, but left in there because lib code (still) uses them (the manner--- in which they're used doesn't cause problems on a Win32 platform though.)--asyncRead :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)-asyncRead  (I# fd) (I# isSock) (I# len) (Ptr buf) =-  IO $ \s -> case asyncRead# fd isSock len buf s of -               (# s', len#, err# #) -> (# s', (I# len#, I# err#) #)--asyncWrite :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)-asyncWrite  (I# fd) (I# isSock) (I# len) (Ptr buf) =-  IO $ \s -> case asyncWrite# fd isSock len buf s of -               (# s', len#, err# #) -> (# s', (I# len#, I# err#) #)--asyncDoProc :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int-asyncDoProc (FunPtr proc) (Ptr param) = -    -- the 'length' value is ignored; simplifies implementation of-    -- the async*# primops to have them all return the same result.-  IO $ \s -> case asyncDoProc# proc param s  of -               (# s', _len#, err# #) -> (# s', I# err# #)---- to aid the use of these primops by the IO Handle implementation,--- provide the following convenience funs:---- this better be a pinned byte array!-asyncReadBA :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int,Int)-asyncReadBA fd isSock len off bufB = -  asyncRead fd isSock len ((Ptr (byteArrayContents# (unsafeCoerce# bufB))) `plusPtr` off)-  -asyncWriteBA :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int,Int)-asyncWriteBA fd isSock len off bufB = -  asyncWrite fd isSock len ((Ptr (byteArrayContents# (unsafeCoerce# bufB))) `plusPtr` off)--#endif---- -------------------------------------------------------------------------------- Thread IO API---- | Block the current thread until data is available to read on the--- given file descriptor (GHC only).-threadWaitRead :: Fd -> IO ()-threadWaitRead fd-#ifndef mingw32_HOST_OS-  | threaded  = waitForReadEvent fd-#endif-  | otherwise = IO $ \s -> -        case fromIntegral fd of { I# fd# ->-        case waitRead# fd# s of { s' -> (# s', () #)-        }}---- | Block the current thread until data can be written to the--- given file descriptor (GHC only).-threadWaitWrite :: Fd -> IO ()-threadWaitWrite fd-#ifndef mingw32_HOST_OS-  | threaded  = waitForWriteEvent fd-#endif-  | otherwise = IO $ \s -> -        case fromIntegral fd of { I# fd# ->-        case waitWrite# fd# s of { s' -> (# s', () #)-        }}---- | Suspends the current thread for a given number of microseconds--- (GHC only).------ There is no guarantee that the thread will be rescheduled promptly--- when the delay has expired, but the thread will never continue to--- run /earlier/ than specified.----threadDelay :: Int -> IO ()-threadDelay time-  | threaded  = waitForDelayEvent time-  | otherwise = IO $ \s -> -        case fromIntegral time of { I# time# ->-        case delay# time# s of { s' -> (# s', () #)-        }}----- | Set the value of returned TVar to True after a given number of--- microseconds. The caveats associated with threadDelay also apply.----registerDelay :: Int -> IO (TVar Bool)-registerDelay usecs -  | threaded = waitForDelayEventSTM usecs-  | otherwise = error "registerDelay: requires -threaded"--foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool--waitForDelayEvent :: Int -> IO ()-waitForDelayEvent usecs = do-  m <- newEmptyMVar-  target <- calculateTarget usecs-  atomicModifyIORef pendingDelays (\xs -> (Delay target m : xs, ()))-  prodServiceThread-  takeMVar m---- Delays for use in STM-waitForDelayEventSTM :: Int -> IO (TVar Bool)-waitForDelayEventSTM usecs = do-   t <- atomically $ newTVar False-   target <- calculateTarget usecs-   atomicModifyIORef pendingDelays (\xs -> (DelaySTM target t : xs, ()))-   prodServiceThread-   return t  -    -calculateTarget :: Int -> IO USecs-calculateTarget usecs = do-    now <- getUSecOfDay-    return $ now + (fromIntegral usecs)----- ------------------------------------------------------------------------------- Threaded RTS implementation of threadWaitRead, threadWaitWrite, threadDelay---- In the threaded RTS, we employ a single IO Manager thread to wait--- for all outstanding IO requests (threadWaitRead,threadWaitWrite)--- and delays (threadDelay).  ------ We can do this because in the threaded RTS the IO Manager can make--- a non-blocking call to select(), so we don't have to do select() in--- the scheduler as we have to in the non-threaded RTS.  We get performance--- benefits from doing it this way, because we only have to restart the select()--- when a new request arrives, rather than doing one select() each time--- around the scheduler loop.  Furthermore, the scheduler can be simplified--- by not having to check for completed IO requests.--#ifndef mingw32_HOST_OS-data IOReq-  = Read   {-# UNPACK #-} !Fd {-# UNPACK #-} !(MVar ())-  | Write  {-# UNPACK #-} !Fd {-# UNPACK #-} !(MVar ())-#endif--data DelayReq-  = Delay    {-# UNPACK #-} !USecs {-# UNPACK #-} !(MVar ())-  | DelaySTM {-# UNPACK #-} !USecs {-# UNPACK #-} !(TVar Bool)--#ifndef mingw32_HOST_OS-{-# NOINLINE pendingEvents #-}-pendingEvents :: IORef [IOReq]-pendingEvents = unsafePerformIO $ do-   m <- newIORef []-   sharedCAF m getOrSetGHCConcPendingEventsStore--foreign import ccall unsafe "getOrSetGHCConcPendingEventsStore"-    getOrSetGHCConcPendingEventsStore :: Ptr a -> IO (Ptr a)-#endif--{-# NOINLINE pendingDelays #-}-pendingDelays :: IORef [DelayReq]-pendingDelays = unsafePerformIO $ do-   m <- newIORef []-   sharedCAF m getOrSetGHCConcPendingDelaysStore--foreign import ccall unsafe "getOrSetGHCConcPendingDelaysStore"-    getOrSetGHCConcPendingDelaysStore :: Ptr a -> IO (Ptr a)--{-# NOINLINE ioManagerThread #-}-ioManagerThread :: MVar (Maybe ThreadId)-ioManagerThread = unsafePerformIO $ do-   m <- newMVar Nothing-   sharedCAF m getOrSetGHCConcIOManagerThreadStore--foreign import ccall unsafe "getOrSetGHCConcIOManagerThreadStore"-    getOrSetGHCConcIOManagerThreadStore :: Ptr a -> IO (Ptr a)--ensureIOManagerIsRunning :: IO ()-ensureIOManagerIsRunning -  | threaded  = startIOManagerThread-  | otherwise = return ()--startIOManagerThread :: IO ()-startIOManagerThread = do-  modifyMVar_ ioManagerThread $ \old -> do-    let create = do t <- forkIO ioManager; return (Just t)-    case old of-      Nothing -> create-      Just t  -> do-        s <- threadStatus t-        case s of-          ThreadFinished -> create-          ThreadDied     -> create-          _other         -> return (Just t)--insertDelay :: DelayReq -> [DelayReq] -> [DelayReq]-insertDelay d [] = [d]-insertDelay d1 ds@(d2 : rest)-  | delayTime d1 <= delayTime d2 = d1 : ds-  | otherwise                    = d2 : insertDelay d1 rest--delayTime :: DelayReq -> USecs-delayTime (Delay t _) = t-delayTime (DelaySTM t _) = t--type USecs = Word64--foreign import ccall unsafe "getUSecOfDay" -  getUSecOfDay :: IO USecs--{-# NOINLINE prodding #-}-prodding :: IORef Bool-prodding = unsafePerformIO $ do-   r <- newIORef False-   sharedCAF r getOrSetGHCConcProddingStore--foreign import ccall unsafe "getOrSetGHCConcProddingStore"-    getOrSetGHCConcProddingStore :: Ptr a -> IO (Ptr a)--prodServiceThread :: IO ()-prodServiceThread = do-  -- NB. use atomicModifyIORef here, otherwise there are race-  -- conditions in which prodding is left at True but the server is-  -- blocked in select().-  was_set <- atomicModifyIORef prodding $ \b -> (True,b)-  if (not (was_set)) then  wakeupIOManager else return ()---- Machinery needed to ensure that we only have one copy of certain--- CAFs in this module even when the base package is present twice, as--- it is when base is dynamically loaded into GHCi.  The RTS keeps--- track of the single true value of the CAF, so even when the CAFs in--- the dynamically-loaded base package are reverted, nothing bad--- happens.----sharedCAF :: a -> (Ptr a -> IO (Ptr a)) -> IO a-sharedCAF a get_or_set =-   block $ do-     stable_ref <- newStablePtr a-     let ref = castPtr (castStablePtrToPtr stable_ref)-     ref2 <- get_or_set ref-     if ref==ref2-        then return a-        else do freeStablePtr stable_ref-                deRefStablePtr (castPtrToStablePtr (castPtr ref2))--#ifdef mingw32_HOST_OS--- ------------------------------------------------------------------------------- Windows IO manager thread--ioManager :: IO ()-ioManager = do-  wakeup <- c_getIOManagerEvent-  service_loop wakeup []--service_loop :: HANDLE          -- read end of pipe-             -> [DelayReq]      -- current delay requests-             -> IO ()--service_loop wakeup old_delays = do-  -- pick up new delay requests-  new_delays <- atomicModifyIORef pendingDelays (\a -> ([],a))-  let  delays = foldr insertDelay old_delays new_delays--  now <- getUSecOfDay-  (delays', timeout) <- getDelay now delays--  r <- c_WaitForSingleObject wakeup timeout-  case r of-    0xffffffff -> do c_maperrno; throwErrno "service_loop"-    0 -> do-        r2 <- c_readIOManagerEvent-        exit <- -              case r2 of-                _ | r2 == io_MANAGER_WAKEUP -> return False-                _ | r2 == io_MANAGER_DIE    -> return True-                0 -> return False -- spurious wakeup-                _ -> do start_console_handler (r2 `shiftR` 1); return False-        unless exit $ service_cont wakeup delays'--    _other -> service_cont wakeup delays' -- probably timeout        --service_cont :: HANDLE -> [DelayReq] -> IO ()-service_cont wakeup delays = do-  r <- atomicModifyIORef prodding (\_ -> (False,False))-  r `seq` return () -- avoid space leak-  service_loop wakeup delays---- must agree with rts/win32/ThrIOManager.c-io_MANAGER_WAKEUP, io_MANAGER_DIE :: Word32-io_MANAGER_WAKEUP = 0xffffffff-io_MANAGER_DIE    = 0xfffffffe--data ConsoleEvent- = ControlC- | Break- | Close-    -- these are sent to Services only.- | Logoff- | Shutdown- deriving (Eq, Ord, Enum, Show, Read, Typeable)--start_console_handler :: Word32 -> IO ()-start_console_handler r =-  case toWin32ConsoleEvent r of-     Just x  -> withMVar win32ConsoleHandler $ \handler -> do-                    _ <- forkIO (handler x)-                    return ()-     Nothing -> return ()--toWin32ConsoleEvent :: Num a => a -> Maybe ConsoleEvent-toWin32ConsoleEvent ev = -   case ev of-       0 {- CTRL_C_EVENT-}        -> Just ControlC-       1 {- CTRL_BREAK_EVENT-}    -> Just Break-       2 {- CTRL_CLOSE_EVENT-}    -> Just Close-       5 {- CTRL_LOGOFF_EVENT-}   -> Just Logoff-       6 {- CTRL_SHUTDOWN_EVENT-} -> Just Shutdown-       _ -> Nothing--win32ConsoleHandler :: MVar (ConsoleEvent -> IO ())-win32ConsoleHandler = unsafePerformIO (newMVar (error "win32ConsoleHandler"))--wakeupIOManager :: IO ()-wakeupIOManager = c_sendIOManagerEvent io_MANAGER_WAKEUP---- Walk the queue of pending delays, waking up any that have passed--- and return the smallest delay to wait for.  The queue of pending--- delays is kept ordered.-getDelay :: USecs -> [DelayReq] -> IO ([DelayReq], DWORD)-getDelay _   [] = return ([], iNFINITE)-getDelay now all@(d : rest) -  = case d of-     Delay time m | now >= time -> do-        putMVar m ()-        getDelay now rest-     DelaySTM time t | now >= time -> do-        atomically $ writeTVar t True-        getDelay now rest-     _otherwise ->-        -- delay is in millisecs for WaitForSingleObject-        let micro_seconds = delayTime d - now-            milli_seconds = (micro_seconds + 999) `div` 1000-        in return (all, fromIntegral milli_seconds)---- ToDo: this just duplicates part of System.Win32.Types, which isn't--- available yet.  We should move some Win32 functionality down here,--- maybe as part of the grand reorganisation of the base package...-type HANDLE       = Ptr ()-type DWORD        = Word32--iNFINITE :: DWORD-iNFINITE = 0xFFFFFFFF -- urgh--foreign import ccall unsafe "getIOManagerEvent" -- in the RTS (ThrIOManager.c)-  c_getIOManagerEvent :: IO HANDLE--foreign import ccall unsafe "readIOManagerEvent" -- in the RTS (ThrIOManager.c)-  c_readIOManagerEvent :: IO Word32--foreign import ccall unsafe "sendIOManagerEvent" -- in the RTS (ThrIOManager.c)-  c_sendIOManagerEvent :: Word32 -> IO ()--foreign import ccall unsafe "maperrno"             -- in Win32Utils.c-   c_maperrno :: IO ()--foreign import stdcall "WaitForSingleObject"-   c_WaitForSingleObject :: HANDLE -> DWORD -> IO DWORD--#else--- ------------------------------------------------------------------------------- Unix IO manager thread, using select()--ioManager :: IO ()-ioManager = do-        allocaArray 2 $ \fds -> do-        throwErrnoIfMinus1_ "startIOManagerThread" (c_pipe fds)-        rd_end <- peekElemOff fds 0-        wr_end <- peekElemOff fds 1-        setNonBlockingFD wr_end True -- writes happen in a signal handler, we-                                     -- don't want them to block.-        setCloseOnExec rd_end-        setCloseOnExec wr_end-        c_setIOManagerPipe wr_end-        allocaBytes sizeofFdSet   $ \readfds -> do-        allocaBytes sizeofFdSet   $ \writefds -> do -        allocaBytes sizeofTimeVal $ \timeval -> do-        service_loop (fromIntegral rd_end) readfds writefds timeval [] []-        return ()--service_loop-   :: Fd                -- listen to this for wakeup calls-   -> Ptr CFdSet-   -> Ptr CFdSet-   -> Ptr CTimeVal-   -> [IOReq]-   -> [DelayReq]-   -> IO ()-service_loop wakeup readfds writefds ptimeval old_reqs old_delays = do--  -- reset prodding before we look at the new requests.  If a new-  -- client arrives after this point they will send a wakup which will-  -- cause the server to loop around again, so we can be sure to not-  -- miss any requests.-  ---  -- NB. it's important to do this in the *first* iteration of-  -- service_loop, rather than after calling select(), since a client-  -- may have set prodding to True without sending a wakeup byte down-  -- the pipe, because the pipe wasn't set up.-  atomicModifyIORef prodding (\_ -> (False, ()))--  -- pick up new IO requests-  new_reqs <- atomicModifyIORef pendingEvents (\a -> ([],a))-  let reqs = new_reqs ++ old_reqs--  -- pick up new delay requests-  new_delays <- atomicModifyIORef pendingDelays (\a -> ([],a))-  let  delays0 = foldr insertDelay old_delays new_delays--  -- build the FDSets for select()-  fdZero readfds-  fdZero writefds-  fdSet wakeup readfds-  maxfd <- buildFdSets 0 readfds writefds reqs--  -- perform the select()-  let do_select delays = do-          -- check the current time and wake up any thread in-          -- threadDelay whose timeout has expired.  Also find the-          -- timeout value for the select() call.-          now <- getUSecOfDay-          (delays', timeout) <- getDelay now ptimeval delays--          res <- c_select (fromIntegral ((max wakeup maxfd)+1)) readfds writefds -                        nullPtr timeout-          if (res == -1)-             then do-                err <- getErrno-                case err of-                  _ | err == eINTR ->  do_select delays'-                        -- EINTR: just redo the select()-                  _ | err == eBADF ->  return (True, delays)-                        -- EBADF: one of the file descriptors is closed or bad,-                        -- we don't know which one, so wake everyone up.-                  _ | otherwise    ->  throwErrno "select"-                        -- otherwise (ENOMEM or EINVAL) something has gone-                        -- wrong; report the error.-             else-                return (False,delays')--  (wakeup_all,delays') <- do_select delays0--  exit <--    if wakeup_all then return False-      else do-        b <- fdIsSet wakeup readfds-        if b == 0 -          then return False-          else alloca $ \p -> do -                 warnErrnoIfMinus1_ "service_loop" $-                     c_read (fromIntegral wakeup) p 1-                 s <- peek p            -                 case s of-                  _ | s == io_MANAGER_WAKEUP -> return False-                  _ | s == io_MANAGER_DIE    -> return True-                  _ | s == io_MANAGER_SYNC   -> do-                       mvars <- readIORef sync-                       mapM_ (flip putMVar ()) mvars-                       return False-                  _ -> do-                       fp <- mallocForeignPtrBytes (fromIntegral sizeof_siginfo_t)-                       withForeignPtr fp $ \p_siginfo -> do-                         r <- c_read (fromIntegral wakeup) (castPtr p_siginfo)-                                 sizeof_siginfo_t-                         when (r /= fromIntegral sizeof_siginfo_t) $-                            error "failed to read siginfo_t"-                       runHandlers' fp (fromIntegral s)-                       return False--  unless exit $ do--  reqs' <- if wakeup_all then do wakeupAll reqs; return []-                         else completeRequests reqs readfds writefds []--  service_loop wakeup readfds writefds ptimeval reqs' delays'--io_MANAGER_WAKEUP, io_MANAGER_DIE, io_MANAGER_SYNC :: Word8-io_MANAGER_WAKEUP = 0xff-io_MANAGER_DIE    = 0xfe-io_MANAGER_SYNC   = 0xfd--{-# NOINLINE sync #-}-sync :: IORef [MVar ()]-sync = unsafePerformIO (newIORef [])---- waits for the IO manager to drain the pipe-syncIOManager :: IO ()-syncIOManager = do-  m <- newEmptyMVar-  atomicModifyIORef sync (\old -> (m:old,()))-  c_ioManagerSync-  takeMVar m--foreign import ccall unsafe "ioManagerSync"   c_ioManagerSync :: IO ()-foreign import ccall unsafe "ioManagerWakeup" wakeupIOManager :: IO ()---- For the non-threaded RTS-runHandlers :: Ptr Word8 -> Int -> IO ()-runHandlers p_info sig = do-  fp <- mallocForeignPtrBytes (fromIntegral sizeof_siginfo_t)-  withForeignPtr fp $ \p -> do-    copyBytes p p_info (fromIntegral sizeof_siginfo_t)-    free p_info-  runHandlers' fp (fromIntegral sig)--runHandlers' :: ForeignPtr Word8 -> Signal -> IO ()-runHandlers' p_info sig = do-  let int = fromIntegral sig-  withMVar signal_handlers $ \arr ->-      if not (inRange (boundsIOArray arr) int)-         then return ()-         else do handler <- unsafeReadIOArray arr int-                 case handler of-                    Nothing -> return ()-                    Just (f,_)  -> do _ <- forkIO (f p_info)-                                      return ()--warnErrnoIfMinus1_ :: Num a => String -> IO a -> IO ()-warnErrnoIfMinus1_ what io-    = do r <- io-         when (r == -1) $ do-             errno <- getErrno-             str <- strerror errno >>= peekCString-             when (r == -1) $-                 debugErrLn ("Warning: " ++ what ++ " failed: " ++ str)--foreign import ccall unsafe "string.h" strerror :: Errno -> IO (Ptr CChar)--foreign import ccall "setIOManagerPipe"-  c_setIOManagerPipe :: CInt -> IO ()--foreign import ccall "__hscore_sizeof_siginfo_t"-  sizeof_siginfo_t :: CSize--type Signal = CInt--maxSig = 64 :: Int--type HandlerFun = ForeignPtr Word8 -> IO ()---- Lock used to protect concurrent access to signal_handlers.  Symptom of--- this race condition is #1922, although that bug was on Windows a similar--- bug also exists on Unix.-{-# NOINLINE signal_handlers #-}-signal_handlers :: MVar (IOArray Int (Maybe (HandlerFun,Dynamic)))-signal_handlers = unsafePerformIO $ do-   arr <- newIOArray (0,maxSig) Nothing-   m <- newMVar arr-   sharedCAF m getOrSetGHCConcSignalHandlerStore--foreign import ccall unsafe "getOrSetGHCConcSignalHandlerStore"-    getOrSetGHCConcSignalHandlerStore :: Ptr a -> IO (Ptr a)--setHandler :: Signal -> Maybe (HandlerFun,Dynamic) -> IO (Maybe (HandlerFun,Dynamic))-setHandler sig handler = do-  let int = fromIntegral sig-  withMVar signal_handlers $ \arr -> -     if not (inRange (boundsIOArray arr) int)-        then error "GHC.Conc.setHandler: signal out of range"-        else do old <- unsafeReadIOArray arr int-                unsafeWriteIOArray arr int handler-                return old---- -------------------------------------------------------------------------------- IO requests--buildFdSets :: Fd -> Ptr CFdSet -> Ptr CFdSet -> [IOReq] -> IO Fd-buildFdSets maxfd _       _        [] = return maxfd-buildFdSets maxfd readfds writefds (Read fd _ : reqs)-  | fd >= fD_SETSIZE =  error "buildFdSets: file descriptor out of range"-  | otherwise        =  do-        fdSet fd readfds-        buildFdSets (max maxfd fd) readfds writefds reqs-buildFdSets maxfd readfds writefds (Write fd _ : reqs)-  | fd >= fD_SETSIZE =  error "buildFdSets: file descriptor out of range"-  | otherwise        =  do-        fdSet fd writefds-        buildFdSets (max maxfd fd) readfds writefds reqs--completeRequests :: [IOReq] -> Ptr CFdSet -> Ptr CFdSet -> [IOReq]-                 -> IO [IOReq]-completeRequests [] _ _ reqs' = return reqs'-completeRequests (Read fd m : reqs) readfds writefds reqs' = do-  b <- fdIsSet fd readfds-  if b /= 0-    then do putMVar m (); completeRequests reqs readfds writefds reqs'-    else completeRequests reqs readfds writefds (Read fd m : reqs')-completeRequests (Write fd m : reqs) readfds writefds reqs' = do-  b <- fdIsSet fd writefds-  if b /= 0-    then do putMVar m (); completeRequests reqs readfds writefds reqs'-    else completeRequests reqs readfds writefds (Write fd m : reqs')--wakeupAll :: [IOReq] -> IO ()-wakeupAll [] = return ()-wakeupAll (Read  _ m : reqs) = do putMVar m (); wakeupAll reqs-wakeupAll (Write _ m : reqs) = do putMVar m (); wakeupAll reqs--waitForReadEvent :: Fd -> IO ()-waitForReadEvent fd = do-  m <- newEmptyMVar-  atomicModifyIORef pendingEvents (\xs -> (Read fd m : xs, ()))-  prodServiceThread-  takeMVar m--waitForWriteEvent :: Fd -> IO ()-waitForWriteEvent fd = do-  m <- newEmptyMVar-  atomicModifyIORef pendingEvents (\xs -> (Write fd m : xs, ()))-  prodServiceThread-  takeMVar m---- -------------------------------------------------------------------------------- Delays---- Walk the queue of pending delays, waking up any that have passed--- and return the smallest delay to wait for.  The queue of pending--- delays is kept ordered.-getDelay :: USecs -> Ptr CTimeVal -> [DelayReq] -> IO ([DelayReq], Ptr CTimeVal)-getDelay _   _        [] = return ([],nullPtr)-getDelay now ptimeval all@(d : rest) -  = case d of-     Delay time m | now >= time -> do-        putMVar m ()-        getDelay now ptimeval rest-     DelaySTM time t | now >= time -> do-        atomically $ writeTVar t True-        getDelay now ptimeval rest-     _otherwise -> do-        setTimevalTicks ptimeval (delayTime d - now)-        return (all,ptimeval)--data CTimeVal--foreign import ccall unsafe "sizeofTimeVal"-  sizeofTimeVal :: Int--foreign import ccall unsafe "setTimevalTicks" -  setTimevalTicks :: Ptr CTimeVal -> USecs -> IO ()--{- -  On Win32 we're going to have a single Pipe, and a-  waitForSingleObject with the delay time.  For signals, we send a-  byte down the pipe just like on Unix.--}---- ------------------------------------------------------------------------------- select() interface---- ToDo: move to System.Posix.Internals?--data CFdSet--foreign import ccall safe "__hscore_select"-  c_select :: CInt -> Ptr CFdSet -> Ptr CFdSet -> Ptr CFdSet -> Ptr CTimeVal-           -> IO CInt--foreign import ccall unsafe "hsFD_SETSIZE"-  c_fD_SETSIZE :: CInt--fD_SETSIZE :: Fd-fD_SETSIZE = fromIntegral c_fD_SETSIZE--foreign import ccall unsafe "hsFD_ISSET"-  c_fdIsSet :: CInt -> Ptr CFdSet -> IO CInt--fdIsSet :: Fd -> Ptr CFdSet -> IO CInt-fdIsSet (Fd fd) fdset = c_fdIsSet fd fdset--foreign import ccall unsafe "hsFD_SET"-  c_fdSet :: CInt -> Ptr CFdSet -> IO ()--fdSet :: Fd -> Ptr CFdSet -> IO ()-fdSet (Fd fd) fdset = c_fdSet fd fdset--foreign import ccall unsafe "hsFD_ZERO"-  fdZero :: Ptr CFdSet -> IO ()--foreign import ccall unsafe "sizeof_fd_set"-  sizeofFdSet :: Int--#endif--reportStackOverflow :: IO ()-reportStackOverflow = callStackOverflowHook--reportError :: SomeException -> IO ()-reportError ex = do-   handler <- getUncaughtExceptionHandler-   handler ex---- SUP: Are the hooks allowed to re-enter Haskell land?  If so, remove--- the unsafe below.-foreign import ccall unsafe "stackOverflow"-        callStackOverflowHook :: IO ()--{-# NOINLINE uncaughtExceptionHandler #-}-uncaughtExceptionHandler :: IORef (SomeException -> IO ())-uncaughtExceptionHandler = unsafePerformIO (newIORef defaultHandler)-   where-      defaultHandler :: SomeException -> IO ()-      defaultHandler se@(SomeException ex) = do-         (hFlush stdout) `catchAny` (\ _ -> return ())-         let msg = case cast ex of-               Just Deadlock -> "no threads to run:  infinite loop or deadlock?"-               _ -> case cast ex of-                    Just (ErrorCall s) -> s-                    _                  -> showsPrec 0 se ""-         withCString "%s" $ \cfmt ->-          withCString msg $ \cmsg ->-            errorBelch cfmt cmsg---- don't use errorBelch() directly, because we cannot call varargs functions--- using the FFI.-foreign import ccall unsafe "HsBase.h errorBelch2"-   errorBelch :: CString -> CString -> IO ()--setUncaughtExceptionHandler :: (SomeException -> IO ()) -> IO ()-setUncaughtExceptionHandler = writeIORef uncaughtExceptionHandler--getUncaughtExceptionHandler :: IO (SomeException -> IO ())-getUncaughtExceptionHandler = readIORef uncaughtExceptionHandler+        , forkIOUnmasked+        , forkOnIO      -- :: Int -> IO a -> IO ThreadId+        , forkOnIOUnmasked+        , numCapabilities -- :: Int+        , numSparks       -- :: IO Int+        , childHandler  -- :: Exception -> IO ()+        , myThreadId    -- :: IO ThreadId+        , killThread    -- :: ThreadId -> IO ()+        , throwTo       -- :: ThreadId -> Exception -> IO ()+        , par           -- :: a -> b -> b+        , pseq          -- :: a -> b -> b+        , runSparks+        , yield         -- :: IO ()+        , labelThread   -- :: ThreadId -> String -> IO ()++        , ThreadStatus(..), BlockReason(..)+        , threadStatus  -- :: ThreadId -> IO ThreadStatus++        -- * Waiting+        , threadDelay           -- :: Int -> IO ()+        , registerDelay         -- :: Int -> IO (TVar Bool)+        , threadWaitRead        -- :: Int -> IO ()+        , threadWaitWrite       -- :: Int -> IO ()++        -- * TVars+        , STM(..)+        , atomically    -- :: STM a -> IO a+        , retry         -- :: STM a+        , orElse        -- :: STM a -> STM a -> STM a+        , throwSTM      -- :: Exception e => e -> STM a+        , catchSTM      -- :: Exception e => STM a -> (e -> STM a) -> STM a+        , alwaysSucceeds -- :: STM a -> STM ()+        , always        -- :: STM Bool -> STM ()+        , TVar(..)+        , newTVar       -- :: a -> STM (TVar a)+        , newTVarIO     -- :: a -> STM (TVar a)+        , readTVar      -- :: TVar a -> STM a+        , readTVarIO    -- :: TVar a -> IO a+        , writeTVar     -- :: a -> TVar a -> STM ()+        , unsafeIOToSTM -- :: IO a -> STM a++        -- * Miscellaneous+        , withMVar+#ifdef mingw32_HOST_OS+        , asyncRead     -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)+        , asyncWrite    -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)+        , asyncDoProc   -- :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int++        , asyncReadBA   -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)+        , asyncWriteBA  -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)+#endif++#ifndef mingw32_HOST_OS+        , Signal, HandlerFun, setHandler, runHandlers+#endif++        , ensureIOManagerIsRunning++#ifdef mingw32_HOST_OS+        , ConsoleEvent(..)+        , win32ConsoleHandler+        , toWin32ConsoleEvent+#endif+        , setUncaughtExceptionHandler      -- :: (Exception -> IO ()) -> IO ()+        , getUncaughtExceptionHandler      -- :: IO (Exception -> IO ())++        , reportError, reportStackOverflow+        ) where++import GHC.Conc.IO+import GHC.Conc.Sync++#ifndef mingw32_HOST_OS+import GHC.Conc.Signal+#endif  \end{code}
+ GHC/Conc/IO.hs view
@@ -0,0 +1,126 @@+{-# OPTIONS_GHC -XNoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-missing-signatures #-}+{-# OPTIONS_HADDOCK not-home #-}+-----------------------------------------------------------------------------+-- |+-- Module      :  GHC.Conc.IO+-- Copyright   :  (c) The University of Glasgow, 1994-2002+-- License     :  see libraries/base/LICENSE+--+-- Maintainer  :  cvs-ghc@haskell.org+-- Stability   :  internal+-- Portability :  non-portable (GHC extensions)+--+-- Basic concurrency stuff.+--+-----------------------------------------------------------------------------++-- No: #hide, because bits of this module are exposed by the stm package.+-- However, we don't want this module to be the home location for the+-- bits it exports, we'd rather have Control.Concurrent and the other+-- higher level modules be the home.  Hence:++#include "Typeable.h"++-- #not-home+module GHC.Conc.IO+        ( ensureIOManagerIsRunning++        -- * Waiting+        , threadDelay           -- :: Int -> IO ()+        , registerDelay         -- :: Int -> IO (TVar Bool)+        , threadWaitRead        -- :: Int -> IO ()+        , threadWaitWrite       -- :: Int -> IO ()++#ifdef mingw32_HOST_OS+        , asyncRead     -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)+        , asyncWrite    -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)+        , asyncDoProc   -- :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int++        , asyncReadBA   -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)+        , asyncWriteBA  -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)++        , ConsoleEvent(..)+        , win32ConsoleHandler+        , toWin32ConsoleEvent+#endif+        ) where++import Foreign+import GHC.Base+import GHC.Conc.Sync as Sync+import GHC.Real ( fromIntegral )+import System.Posix.Types++#ifdef mingw32_HOST_OS+import qualified GHC.Conc.Windows as Windows+import GHC.Conc.Windows (asyncRead, asyncWrite, asyncDoProc, asyncReadBA,+                         asyncWriteBA, ConsoleEvent(..), win32ConsoleHandler,+                         toWin32ConsoleEvent)+#else+import qualified System.Event.Thread as Event+#endif++ensureIOManagerIsRunning :: IO ()+#ifndef mingw32_HOST_OS+ensureIOManagerIsRunning = Event.ensureIOManagerIsRunning+#else+ensureIOManagerIsRunning = Windows.ensureIOManagerIsRunning+#endif++-- | Block the current thread until data is available to read on the+-- given file descriptor (GHC only).+threadWaitRead :: Fd -> IO ()+threadWaitRead fd+#ifndef mingw32_HOST_OS+  | threaded  = Event.threadWaitRead fd+#endif+  | otherwise = IO $ \s ->+        case fromIntegral fd of { I# fd# ->+        case waitRead# fd# s of { s' -> (# s', () #)+        }}++-- | Block the current thread until data can be written to the+-- given file descriptor (GHC only).+threadWaitWrite :: Fd -> IO ()+threadWaitWrite fd+#ifndef mingw32_HOST_OS+  | threaded  = Event.threadWaitWrite fd+#endif+  | otherwise = IO $ \s ->+        case fromIntegral fd of { I# fd# ->+        case waitWrite# fd# s of { s' -> (# s', () #)+        }}++-- | Suspends the current thread for a given number of microseconds+-- (GHC only).+--+-- There is no guarantee that the thread will be rescheduled promptly+-- when the delay has expired, but the thread will never continue to+-- run /earlier/ than specified.+--+threadDelay :: Int -> IO ()+threadDelay time+#ifdef mingw32_HOST_OS+  | threaded  = Windows.threadDelay time+#else+  | threaded  = Event.threadDelay time+#endif+  | otherwise = IO $ \s ->+        case fromIntegral time of { I# time# ->+        case delay# time# s of { s' -> (# s', () #)+        }}++-- | Set the value of returned TVar to True after a given number of+-- microseconds. The caveats associated with threadDelay also apply.+--+registerDelay :: Int -> IO (TVar Bool)+registerDelay usecs+#ifdef mingw32_HOST_OS+  | threaded = Windows.registerDelay usecs+#else+  | threaded = Event.registerDelay usecs+#endif+  | otherwise = error "registerDelay: requires -threaded"++foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool
+ GHC/Conc/Signal.hs view
@@ -0,0 +1,90 @@+{-# LANGUAGE NoImplicitPrelude #-}++module GHC.Conc.Signal+        ( Signal+        , HandlerFun+        , setHandler+        , runHandlers+        ) where++import Control.Concurrent.MVar (MVar, newMVar, withMVar)+import Data.Dynamic (Dynamic)+import Data.Maybe (Maybe(..))+import Foreign.C.Types (CInt)+import Foreign.ForeignPtr (ForeignPtr)+import Foreign.StablePtr (castPtrToStablePtr, castStablePtrToPtr,+                          deRefStablePtr, freeStablePtr, newStablePtr)+import Foreign.Ptr (Ptr, castPtr)+import GHC.Arr (inRange)+import GHC.Base+import GHC.Conc.Sync (forkIO)+import GHC.IO (mask_, unsafePerformIO)+import GHC.IOArray (IOArray, boundsIOArray, newIOArray, unsafeReadIOArray,+                    unsafeWriteIOArray)+import GHC.Real (fromIntegral)+import GHC.Word (Word8)++------------------------------------------------------------------------+-- Signal handling++type Signal = CInt++maxSig :: Int+maxSig = 64++type HandlerFun = ForeignPtr Word8 -> IO ()++-- Lock used to protect concurrent access to signal_handlers.  Symptom+-- of this race condition is GHC bug #1922, although that bug was on+-- Windows a similar bug also exists on Unix.+signal_handlers :: MVar (IOArray Int (Maybe (HandlerFun,Dynamic)))+signal_handlers = unsafePerformIO $ do+  arr <- newIOArray (0, maxSig) Nothing+  m <- newMVar arr+  sharedCAF m getOrSetGHCConcSignalSignalHandlerStore+{-# NOINLINE signal_handlers #-}++foreign import ccall unsafe "getOrSetGHCConcSignalSignalHandlerStore"+  getOrSetGHCConcSignalSignalHandlerStore :: Ptr a -> IO (Ptr a)++setHandler :: Signal -> Maybe (HandlerFun, Dynamic)+           -> IO (Maybe (HandlerFun, Dynamic))+setHandler sig handler = do+  let int = fromIntegral sig+  withMVar signal_handlers $ \arr ->+    if not (inRange (boundsIOArray arr) int)+      then error "GHC.Conc.setHandler: signal out of range"+      else do old <- unsafeReadIOArray arr int+              unsafeWriteIOArray arr int handler+              return old++runHandlers :: ForeignPtr Word8 -> Signal -> IO ()+runHandlers p_info sig = do+  let int = fromIntegral sig+  withMVar signal_handlers $ \arr ->+    if not (inRange (boundsIOArray arr) int)+      then return ()+      else do handler <- unsafeReadIOArray arr int+              case handler of+                Nothing -> return ()+                Just (f,_)  -> do _ <- forkIO (f p_info)+                                  return ()++-- Machinery needed to ensure that we only have one copy of certain+-- CAFs in this module even when the base package is present twice, as+-- it is when base is dynamically loaded into GHCi.  The RTS keeps+-- track of the single true value of the CAF, so even when the CAFs in+-- the dynamically-loaded base package are reverted, nothing bad+-- happens.+--+sharedCAF :: a -> (Ptr a -> IO (Ptr a)) -> IO a+sharedCAF a get_or_set =+  mask_ $ do+    stable_ref <- newStablePtr a+    let ref = castPtr (castStablePtrToPtr stable_ref)+    ref2 <- get_or_set ref+    if ref == ref2+      then return a+      else do freeStablePtr stable_ref+              deRefStablePtr (castPtrToStablePtr (castPtr ref2))+
+ GHC/Conc/Sync.lhs view
@@ -0,0 +1,695 @@+\begin{code}+{-# OPTIONS_GHC -XNoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-missing-signatures #-}+{-# OPTIONS_HADDOCK not-home #-}+-----------------------------------------------------------------------------+-- |+-- Module      :  GHC.Conc.Sync+-- Copyright   :  (c) The University of Glasgow, 1994-2002+-- License     :  see libraries/base/LICENSE+--+-- Maintainer  :  cvs-ghc@haskell.org+-- Stability   :  internal+-- Portability :  non-portable (GHC extensions)+--+-- Basic concurrency stuff.+--+-----------------------------------------------------------------------------++-- No: #hide, because bits of this module are exposed by the stm package.+-- However, we don't want this module to be the home location for the+-- bits it exports, we'd rather have Control.Concurrent and the other+-- higher level modules be the home.  Hence:++#include "Typeable.h"++-- #not-home+module GHC.Conc.Sync+        ( ThreadId(..)++        -- * Forking and suchlike+        , forkIO        -- :: IO a -> IO ThreadId+        , forkIOUnmasked+        , forkOnIO      -- :: Int -> IO a -> IO ThreadId+        , forkOnIOUnmasked+        , numCapabilities -- :: Int+        , numSparks      -- :: IO Int+        , childHandler  -- :: Exception -> IO ()+        , myThreadId    -- :: IO ThreadId+        , killThread    -- :: ThreadId -> IO ()+        , throwTo       -- :: ThreadId -> Exception -> IO ()+        , par           -- :: a -> b -> b+        , pseq          -- :: a -> b -> b+        , runSparks+        , yield         -- :: IO ()+        , labelThread   -- :: ThreadId -> String -> IO ()++        , ThreadStatus(..), BlockReason(..)+        , threadStatus  -- :: ThreadId -> IO ThreadStatus++        -- * TVars+        , STM(..)+        , atomically    -- :: STM a -> IO a+        , retry         -- :: STM a+        , orElse        -- :: STM a -> STM a -> STM a+        , throwSTM      -- :: Exception e => e -> STM a+        , catchSTM      -- :: Exception e => STM a -> (e -> STM a) -> STM a+        , alwaysSucceeds -- :: STM a -> STM ()+        , always        -- :: STM Bool -> STM ()+        , TVar(..)+        , newTVar       -- :: a -> STM (TVar a)+        , newTVarIO     -- :: a -> STM (TVar a)+        , readTVar      -- :: TVar a -> STM a+        , readTVarIO    -- :: TVar a -> IO a+        , writeTVar     -- :: a -> TVar a -> STM ()+        , unsafeIOToSTM -- :: IO a -> STM a++        -- * Miscellaneous+        , withMVar+        , modifyMVar_++        , setUncaughtExceptionHandler      -- :: (Exception -> IO ()) -> IO ()+        , getUncaughtExceptionHandler      -- :: IO (Exception -> IO ())++        , reportError, reportStackOverflow++        , sharedCAF+        ) where++import Foreign hiding (unsafePerformIO)+import Foreign.C++#ifdef mingw32_HOST_OS+import Data.Typeable+#endif++#ifndef mingw32_HOST_OS+import Data.Dynamic+#endif+import Control.Monad+import Data.Maybe++import GHC.Base+import {-# SOURCE #-} GHC.IO.Handle ( hFlush )+import {-# SOURCE #-} GHC.IO.Handle.FD ( stdout )+import GHC.IO+import GHC.IO.Exception+import GHC.Exception+import GHC.IORef+import GHC.MVar+import GHC.Real         ( fromIntegral )+import GHC.Pack         ( packCString# )+import GHC.Show         ( Show(..), showString )++infixr 0 `par`, `pseq`+\end{code}++%************************************************************************+%*                                                                      *+\subsection{@ThreadId@, @par@, and @fork@}+%*                                                                      *+%************************************************************************++\begin{code}+data ThreadId = ThreadId ThreadId# deriving( Typeable )+-- ToDo: data ThreadId = ThreadId (Weak ThreadId#)+-- But since ThreadId# is unlifted, the Weak type must use open+-- type variables.+{- ^+A 'ThreadId' is an abstract type representing a handle to a thread.+'ThreadId' is an instance of 'Eq', 'Ord' and 'Show', where+the 'Ord' instance implements an arbitrary total ordering over+'ThreadId's. The 'Show' instance lets you convert an arbitrary-valued+'ThreadId' to string form; showing a 'ThreadId' value is occasionally+useful when debugging or diagnosing the behaviour of a concurrent+program.++/Note/: in GHC, if you have a 'ThreadId', you essentially have+a pointer to the thread itself.  This means the thread itself can\'t be+garbage collected until you drop the 'ThreadId'.+This misfeature will hopefully be corrected at a later date.++/Note/: Hugs does not provide any operations on other threads;+it defines 'ThreadId' as a synonym for ().+-}++instance Show ThreadId where+   showsPrec d t =+        showString "ThreadId " .+        showsPrec d (getThreadId (id2TSO t))++foreign import ccall unsafe "rts_getThreadId" getThreadId :: ThreadId# -> CInt++id2TSO :: ThreadId -> ThreadId#+id2TSO (ThreadId t) = t++foreign import ccall unsafe "cmp_thread" cmp_thread :: ThreadId# -> ThreadId# -> CInt+-- Returns -1, 0, 1++cmpThread :: ThreadId -> ThreadId -> Ordering+cmpThread t1 t2 =+   case cmp_thread (id2TSO t1) (id2TSO t2) of+      -1 -> LT+      0  -> EQ+      _  -> GT -- must be 1++instance Eq ThreadId where+   t1 == t2 =+      case t1 `cmpThread` t2 of+         EQ -> True+         _  -> False++instance Ord ThreadId where+   compare = cmpThread++{- |+Sparks off a new thread to run the 'IO' computation passed as the+first argument, and returns the 'ThreadId' of the newly created+thread.++The new thread will be a lightweight thread; if you want to use a foreign+library that uses thread-local storage, use 'Control.Concurrent.forkOS' instead.++GHC note: the new thread inherits the /masked/ state of the parent +(see 'Control.Exception.mask').++The newly created thread has an exception handler that discards the+exceptions 'BlockedIndefinitelyOnMVar', 'BlockedIndefinitelyOnSTM', and+'ThreadKilled', and passes all other exceptions to the uncaught+exception handler (see 'setUncaughtExceptionHandler').+-}+forkIO :: IO () -> IO ThreadId+forkIO action = IO $ \ s ->+   case (fork# action_plus s) of (# s1, tid #) -> (# s1, ThreadId tid #)+ where+  action_plus = catchException action childHandler++-- | Like 'forkIO', but the child thread is created with asynchronous exceptions+-- unmasked (see 'Control.Exception.mask').+forkIOUnmasked :: IO () -> IO ThreadId+forkIOUnmasked io = forkIO (unsafeUnmask io)++{- |+Like 'forkIO', but lets you specify on which CPU the thread is+created.  Unlike a `forkIO` thread, a thread created by `forkOnIO`+will stay on the same CPU for its entire lifetime (`forkIO` threads+can migrate between CPUs according to the scheduling policy).+`forkOnIO` is useful for overriding the scheduling policy when you+know in advance how best to distribute the threads.++The `Int` argument specifies the CPU number; it is interpreted modulo+'numCapabilities' (note that it actually specifies a capability number+rather than a CPU number, but to a first approximation the two are+equivalent).+-}+forkOnIO :: Int -> IO () -> IO ThreadId+forkOnIO (I# cpu) action = IO $ \ s ->+   case (forkOn# cpu action_plus s) of (# s1, tid #) -> (# s1, ThreadId tid #)+ where+  action_plus = catchException action childHandler++-- | Like 'forkOnIO', but the child thread is created with+-- asynchronous exceptions unmasked (see 'Control.Exception.mask').+forkOnIOUnmasked :: Int -> IO () -> IO ThreadId+forkOnIOUnmasked cpu io = forkOnIO cpu (unsafeUnmask io)++-- | the value passed to the @+RTS -N@ flag.  This is the number of+-- Haskell threads that can run truly simultaneously at any given+-- time, and is typically set to the number of physical CPU cores on+-- the machine.+numCapabilities :: Int+numCapabilities = unsafePerformIO $  do+                    n <- peek n_capabilities+                    return (fromIntegral n)++-- | Returns the number of sparks currently in the local spark pool+numSparks :: IO Int+numSparks = IO $ \s -> case numSparks# s of (# s', n #) -> (# s', I# n #)++#if defined(mingw32_HOST_OS) && defined(__PIC__)+foreign import ccall "_imp__n_capabilities" n_capabilities :: Ptr CInt+#else+foreign import ccall "&n_capabilities" n_capabilities :: Ptr CInt+#endif+childHandler :: SomeException -> IO ()+childHandler err = catchException (real_handler err) childHandler++real_handler :: SomeException -> IO ()+real_handler se@(SomeException ex) =+  -- ignore thread GC and killThread exceptions:+  case cast ex of+  Just BlockedIndefinitelyOnMVar        -> return ()+  _ -> case cast ex of+       Just BlockedIndefinitelyOnSTM    -> return ()+       _ -> case cast ex of+            Just ThreadKilled           -> return ()+            _ -> case cast ex of+                 -- report all others:+                 Just StackOverflow     -> reportStackOverflow+                 _                      -> reportError se++{- | 'killThread' raises the 'ThreadKilled' exception in the given+thread (GHC only).++> killThread tid = throwTo tid ThreadKilled++-}+killThread :: ThreadId -> IO ()+killThread tid = throwTo tid ThreadKilled++{- | 'throwTo' raises an arbitrary exception in the target thread (GHC only).++'throwTo' does not return until the exception has been raised in the+target thread.+The calling thread can thus be certain that the target+thread has received the exception.  This is a useful property to know+when dealing with race conditions: eg. if there are two threads that+can kill each other, it is guaranteed that only one of the threads+will get to kill the other.++Whatever work the target thread was doing when the exception was+raised is not lost: the computation is suspended until required by+another thread.++If the target thread is currently making a foreign call, then the+exception will not be raised (and hence 'throwTo' will not return)+until the call has completed.  This is the case regardless of whether+the call is inside a 'mask' or not.++Important note: the behaviour of 'throwTo' differs from that described in+the paper \"Asynchronous exceptions in Haskell\"+(<http://research.microsoft.com/~simonpj/Papers/asynch-exns.htm>).+In the paper, 'throwTo' is non-blocking; but the library implementation adopts+a more synchronous design in which 'throwTo' does not return until the exception+is received by the target thread.  The trade-off is discussed in Section 9 of the paper.+Like any blocking operation, 'throwTo' is therefore interruptible (see Section 5.3 of+the paper).  Unlike other interruptible operations, however, 'throwTo'+is /always/ interruptible, even if it does not actually block.++There is no guarantee that the exception will be delivered promptly,+although the runtime will endeavour to ensure that arbitrary+delays don't occur.  In GHC, an exception can only be raised when a+thread reaches a /safe point/, where a safe point is where memory+allocation occurs.  Some loops do not perform any memory allocation+inside the loop and therefore cannot be interrupted by a 'throwTo'.++Blocked 'throwTo' is fair: if multiple threads are trying to throw an+exception to the same target thread, they will succeed in FIFO order.++  -}+throwTo :: Exception e => ThreadId -> e -> IO ()+throwTo (ThreadId tid) ex = IO $ \ s ->+   case (killThread# tid (toException ex) s) of s1 -> (# s1, () #)++-- | Returns the 'ThreadId' of the calling thread (GHC only).+myThreadId :: IO ThreadId+myThreadId = IO $ \s ->+   case (myThreadId# s) of (# s1, tid #) -> (# s1, ThreadId tid #)+++-- |The 'yield' action allows (forces, in a co-operative multitasking+-- implementation) a context-switch to any other currently runnable+-- threads (if any), and is occasionally useful when implementing+-- concurrency abstractions.+yield :: IO ()+yield = IO $ \s ->+   case (yield# s) of s1 -> (# s1, () #)++{- | 'labelThread' stores a string as identifier for this thread if+you built a RTS with debugging support. This identifier will be used in+the debugging output to make distinction of different threads easier+(otherwise you only have the thread state object\'s address in the heap).++Other applications like the graphical Concurrent Haskell Debugger+(<http://www.informatik.uni-kiel.de/~fhu/chd/>) may choose to overload+'labelThread' for their purposes as well.+-}++labelThread :: ThreadId -> String -> IO ()+labelThread (ThreadId t) str = IO $ \ s ->+   let !ps  = packCString# str+       !adr = byteArrayContents# ps in+     case (labelThread# t adr s) of s1 -> (# s1, () #)++--      Nota Bene: 'pseq' used to be 'seq'+--                 but 'seq' is now defined in PrelGHC+--+-- "pseq" is defined a bit weirdly (see below)+--+-- The reason for the strange "lazy" call is that+-- it fools the compiler into thinking that pseq  and par are non-strict in+-- their second argument (even if it inlines pseq at the call site).+-- If it thinks pseq is strict in "y", then it often evaluates+-- "y" before "x", which is totally wrong.++{-# INLINE pseq  #-}+pseq :: a -> b -> b+pseq  x y = x `seq` lazy y++{-# INLINE par  #-}+par :: a -> b -> b+par  x y = case (par# x) of { _ -> lazy y }++-- | Internal function used by the RTS to run sparks.+runSparks :: IO ()+runSparks = IO loop+  where loop s = case getSpark# s of+                   (# s', n, p #) ->+                      if n ==# 0# then (# s', () #)+                                  else p `seq` loop s'++data BlockReason+  = BlockedOnMVar+        -- ^blocked on on 'MVar'+  | BlockedOnBlackHole+        -- ^blocked on a computation in progress by another thread+  | BlockedOnException+        -- ^blocked in 'throwTo'+  | BlockedOnSTM+        -- ^blocked in 'retry' in an STM transaction+  | BlockedOnForeignCall+        -- ^currently in a foreign call+  | BlockedOnOther+        -- ^blocked on some other resource.  Without @-threaded@,+        -- I\/O and 'threadDelay' show up as 'BlockedOnOther', with @-threaded@+        -- they show up as 'BlockedOnMVar'.+  deriving (Eq,Ord,Show)++-- | The current status of a thread+data ThreadStatus+  = ThreadRunning+        -- ^the thread is currently runnable or running+  | ThreadFinished+        -- ^the thread has finished+  | ThreadBlocked  BlockReason+        -- ^the thread is blocked on some resource+  | ThreadDied+        -- ^the thread received an uncaught exception+  deriving (Eq,Ord,Show)++threadStatus :: ThreadId -> IO ThreadStatus+threadStatus (ThreadId t) = IO $ \s ->+   case threadStatus# t s of+     (# s', stat #) -> (# s', mk_stat (I# stat) #)+   where+        -- NB. keep these in sync with includes/Constants.h+     mk_stat 0  = ThreadRunning+     mk_stat 1  = ThreadBlocked BlockedOnMVar+     mk_stat 2  = ThreadBlocked BlockedOnBlackHole+     mk_stat 3  = ThreadBlocked BlockedOnException+     mk_stat 7  = ThreadBlocked BlockedOnSTM+     mk_stat 11 = ThreadBlocked BlockedOnForeignCall+     mk_stat 12 = ThreadBlocked BlockedOnForeignCall+     mk_stat 16 = ThreadFinished+     mk_stat 17 = ThreadDied+     mk_stat _  = ThreadBlocked BlockedOnOther+\end{code}+++%************************************************************************+%*                                                                      *+\subsection[stm]{Transactional heap operations}+%*                                                                      *+%************************************************************************++TVars are shared memory locations which support atomic memory+transactions.++\begin{code}+-- |A monad supporting atomic memory transactions.+newtype STM a = STM (State# RealWorld -> (# State# RealWorld, a #))++unSTM :: STM a -> (State# RealWorld -> (# State# RealWorld, a #))+unSTM (STM a) = a++INSTANCE_TYPEABLE1(STM,stmTc,"STM")++instance  Functor STM where+   fmap f x = x >>= (return . f)++instance  Monad STM  where+    {-# INLINE return #-}+    {-# INLINE (>>)   #-}+    {-# INLINE (>>=)  #-}+    m >> k      = thenSTM m k+    return x    = returnSTM x+    m >>= k     = bindSTM m k++bindSTM :: STM a -> (a -> STM b) -> STM b+bindSTM (STM m) k = STM ( \s ->+  case m s of+    (# new_s, a #) -> unSTM (k a) new_s+  )++thenSTM :: STM a -> STM b -> STM b+thenSTM (STM m) k = STM ( \s ->+  case m s of+    (# new_s, _ #) -> unSTM k new_s+  )++returnSTM :: a -> STM a+returnSTM x = STM (\s -> (# s, x #))++instance MonadPlus STM where+  mzero = retry+  mplus = orElse++-- | Unsafely performs IO in the STM monad.  Beware: this is a highly+-- dangerous thing to do.+--+--   * The STM implementation will often run transactions multiple+--     times, so you need to be prepared for this if your IO has any+--     side effects.+--+--   * The STM implementation will abort transactions that are known to+--     be invalid and need to be restarted.  This may happen in the middle+--     of `unsafeIOToSTM`, so make sure you don't acquire any resources+--     that need releasing (exception handlers are ignored when aborting+--     the transaction).  That includes doing any IO using Handles, for+--     example.  Getting this wrong will probably lead to random deadlocks.+--+--   * The transaction may have seen an inconsistent view of memory when+--     the IO runs.  Invariants that you expect to be true throughout+--     your program may not be true inside a transaction, due to the+--     way transactions are implemented.  Normally this wouldn't be visible+--     to the programmer, but using `unsafeIOToSTM` can expose it.+--+unsafeIOToSTM :: IO a -> STM a+unsafeIOToSTM (IO m) = STM m++-- |Perform a series of STM actions atomically.+--+-- You cannot use 'atomically' inside an 'unsafePerformIO' or 'unsafeInterleaveIO'.+-- Any attempt to do so will result in a runtime error.  (Reason: allowing+-- this would effectively allow a transaction inside a transaction, depending+-- on exactly when the thunk is evaluated.)+--+-- However, see 'newTVarIO', which can be called inside 'unsafePerformIO',+-- and which allows top-level TVars to be allocated.++atomically :: STM a -> IO a+atomically (STM m) = IO (\s -> (atomically# m) s )++-- |Retry execution of the current memory transaction because it has seen+-- values in TVars which mean that it should not continue (e.g. the TVars+-- represent a shared buffer that is now empty).  The implementation may+-- block the thread until one of the TVars that it has read from has been+-- udpated. (GHC only)+retry :: STM a+retry = STM $ \s# -> retry# s#++-- |Compose two alternative STM actions (GHC only).  If the first action+-- completes without retrying then it forms the result of the orElse.+-- Otherwise, if the first action retries, then the second action is+-- tried in its place.  If both actions retry then the orElse as a+-- whole retries.+orElse :: STM a -> STM a -> STM a+orElse (STM m) e = STM $ \s -> catchRetry# m (unSTM e) s++-- | A variant of 'throw' that can only be used within the 'STM' monad.+--+-- Throwing an exception in @STM@ aborts the transaction and propagates the+-- exception.+--+-- Although 'throwSTM' has a type that is an instance of the type of 'throw', the+-- two functions are subtly different:+--+-- > throw e    `seq` x  ===> throw e+-- > throwSTM e `seq` x  ===> x+--+-- The first example will cause the exception @e@ to be raised,+-- whereas the second one won\'t.  In fact, 'throwSTM' will only cause+-- an exception to be raised when it is used within the 'STM' monad.+-- The 'throwSTM' variant should be used in preference to 'throw' to+-- raise an exception within the 'STM' monad because it guarantees+-- ordering with respect to other 'STM' operations, whereas 'throw'+-- does not.+throwSTM :: Exception e => e -> STM a+throwSTM e = STM $ raiseIO# (toException e)++-- |Exception handling within STM actions.+catchSTM :: Exception e => STM a -> (e -> STM a) -> STM a+catchSTM (STM m) handler = STM $ catchSTM# m handler'+    where+      handler' e = case fromException e of+                     Just e' -> unSTM (handler e')+                     Nothing -> raiseIO# e++-- | Low-level primitive on which always and alwaysSucceeds are built.+-- checkInv differs form these in that (i) the invariant is not+-- checked when checkInv is called, only at the end of this and+-- subsequent transcations, (ii) the invariant failure is indicated+-- by raising an exception.+checkInv :: STM a -> STM ()+checkInv (STM m) = STM (\s -> (check# m) s)++-- | alwaysSucceeds adds a new invariant that must be true when passed+-- to alwaysSucceeds, at the end of the current transaction, and at+-- the end of every subsequent transaction.  If it fails at any+-- of those points then the transaction violating it is aborted+-- and the exception raised by the invariant is propagated.+alwaysSucceeds :: STM a -> STM ()+alwaysSucceeds i = do ( i >> retry ) `orElse` ( return () )+                      checkInv i++-- | always is a variant of alwaysSucceeds in which the invariant is+-- expressed as an STM Bool action that must return True.  Returning+-- False or raising an exception are both treated as invariant failures.+always :: STM Bool -> STM ()+always i = alwaysSucceeds ( do v <- i+                               if (v) then return () else ( error "Transacional invariant violation" ) )++-- |Shared memory locations that support atomic memory transactions.+data TVar a = TVar (TVar# RealWorld a)++INSTANCE_TYPEABLE1(TVar,tvarTc,"TVar")++instance Eq (TVar a) where+        (TVar tvar1#) == (TVar tvar2#) = sameTVar# tvar1# tvar2#++-- |Create a new TVar holding a value supplied+newTVar :: a -> STM (TVar a)+newTVar val = STM $ \s1# ->+    case newTVar# val s1# of+         (# s2#, tvar# #) -> (# s2#, TVar tvar# #)++-- |@IO@ version of 'newTVar'.  This is useful for creating top-level+-- 'TVar's using 'System.IO.Unsafe.unsafePerformIO', because using+-- 'atomically' inside 'System.IO.Unsafe.unsafePerformIO' isn't+-- possible.+newTVarIO :: a -> IO (TVar a)+newTVarIO val = IO $ \s1# ->+    case newTVar# val s1# of+         (# s2#, tvar# #) -> (# s2#, TVar tvar# #)++-- |Return the current value stored in a TVar.+-- This is equivalent to+--+-- >  readTVarIO = atomically . readTVar+--+-- but works much faster, because it doesn't perform a complete+-- transaction, it just reads the current value of the 'TVar'.+readTVarIO :: TVar a -> IO a+readTVarIO (TVar tvar#) = IO $ \s# -> readTVarIO# tvar# s#++-- |Return the current value stored in a TVar+readTVar :: TVar a -> STM a+readTVar (TVar tvar#) = STM $ \s# -> readTVar# tvar# s#++-- |Write the supplied value into a TVar+writeTVar :: TVar a -> a -> STM ()+writeTVar (TVar tvar#) val = STM $ \s1# ->+    case writeTVar# tvar# val s1# of+         s2# -> (# s2#, () #)++\end{code}++MVar utilities++\begin{code}+withMVar :: MVar a -> (a -> IO b) -> IO b+withMVar m io =+  mask $ \restore -> do+    a <- takeMVar m+    b <- catchAny (restore (io a))+            (\e -> do putMVar m a; throw e)+    putMVar m a+    return b++modifyMVar_ :: MVar a -> (a -> IO a) -> IO ()+modifyMVar_ m io =+  mask $ \restore -> do+    a <- takeMVar m+    a' <- catchAny (restore (io a))+            (\e -> do putMVar m a; throw e)+    putMVar m a'+    return ()+\end{code}++%************************************************************************+%*                                                                      *+\subsection{Thread waiting}+%*                                                                      *+%************************************************************************++\begin{code}++-- Machinery needed to ensureb that we only have one copy of certain+-- CAFs in this module even when the base package is present twice, as+-- it is when base is dynamically loaded into GHCi.  The RTS keeps+-- track of the single true value of the CAF, so even when the CAFs in+-- the dynamically-loaded base package are reverted, nothing bad+-- happens.+--+sharedCAF :: a -> (Ptr a -> IO (Ptr a)) -> IO a+sharedCAF a get_or_set =+   mask_ $ do+     stable_ref <- newStablePtr a+     let ref = castPtr (castStablePtrToPtr stable_ref)+     ref2 <- get_or_set ref+     if ref==ref2+        then return a+        else do freeStablePtr stable_ref+                deRefStablePtr (castPtrToStablePtr (castPtr ref2))++reportStackOverflow :: IO ()+reportStackOverflow = callStackOverflowHook++reportError :: SomeException -> IO ()+reportError ex = do+   handler <- getUncaughtExceptionHandler+   handler ex++-- SUP: Are the hooks allowed to re-enter Haskell land?  If so, remove+-- the unsafe below.+foreign import ccall unsafe "stackOverflow"+        callStackOverflowHook :: IO ()++{-# NOINLINE uncaughtExceptionHandler #-}+uncaughtExceptionHandler :: IORef (SomeException -> IO ())+uncaughtExceptionHandler = unsafePerformIO (newIORef defaultHandler)+   where+      defaultHandler :: SomeException -> IO ()+      defaultHandler se@(SomeException ex) = do+         (hFlush stdout) `catchAny` (\ _ -> return ())+         let msg = case cast ex of+               Just Deadlock -> "no threads to run:  infinite loop or deadlock?"+               _ -> case cast ex of+                    Just (ErrorCall s) -> s+                    _                  -> showsPrec 0 se ""+         withCString "%s" $ \cfmt ->+          withCString msg $ \cmsg ->+            errorBelch cfmt cmsg++-- don't use errorBelch() directly, because we cannot call varargs functions+-- using the FFI.+foreign import ccall unsafe "HsBase.h errorBelch2"+   errorBelch :: CString -> CString -> IO ()++setUncaughtExceptionHandler :: (SomeException -> IO ()) -> IO ()+setUncaughtExceptionHandler = writeIORef uncaughtExceptionHandler++getUncaughtExceptionHandler :: IO (SomeException -> IO ())+getUncaughtExceptionHandler = readIORef uncaughtExceptionHandler++\end{code}
+ GHC/Conc/Windows.hs view
@@ -0,0 +1,335 @@+{-# OPTIONS_GHC -XNoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-missing-signatures #-}+{-# OPTIONS_HADDOCK not-home #-}+-----------------------------------------------------------------------------+-- |+-- Module      :  GHC.Conc.Windows+-- Copyright   :  (c) The University of Glasgow, 1994-2002+-- License     :  see libraries/base/LICENSE+--+-- Maintainer  :  cvs-ghc@haskell.org+-- Stability   :  internal+-- Portability :  non-portable (GHC extensions)+--+-- Windows I/O manager+--+-----------------------------------------------------------------------------++-- #not-home+module GHC.Conc.Windows+       ( ensureIOManagerIsRunning++       -- * Waiting+       , threadDelay+       , registerDelay++       -- * Miscellaneous+       , asyncRead     -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)+       , asyncWrite    -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)+       , asyncDoProc   -- :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int++       , asyncReadBA   -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)+       , asyncWriteBA  -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)++       , ConsoleEvent(..)+       , win32ConsoleHandler+       , toWin32ConsoleEvent+       ) where++import Control.Monad+import Data.Bits (shiftR)+import Data.Maybe (Maybe(..))+import Data.Typeable+import Foreign.C.Error (throwErrno)+import GHC.Base+import GHC.Conc.Sync+import GHC.Enum (Enum)+import GHC.IO (unsafePerformIO)+import GHC.IORef+import GHC.MVar+import GHC.Num (Num(..))+import GHC.Ptr+import GHC.Read (Read)+import GHC.Real (div, fromIntegral)+import GHC.Show (Show)+import GHC.Word (Word32, Word64)++-- ----------------------------------------------------------------------------+-- Thread waiting++-- Note: threadWaitRead and threadWaitWrite aren't really functional+-- on Win32, but left in there because lib code (still) uses them (the manner+-- in which they're used doesn't cause problems on a Win32 platform though.)++asyncRead :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)+asyncRead  (I# fd) (I# isSock) (I# len) (Ptr buf) =+  IO $ \s -> case asyncRead# fd isSock len buf s of+               (# s', len#, err# #) -> (# s', (I# len#, I# err#) #)++asyncWrite :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)+asyncWrite  (I# fd) (I# isSock) (I# len) (Ptr buf) =+  IO $ \s -> case asyncWrite# fd isSock len buf s of+               (# s', len#, err# #) -> (# s', (I# len#, I# err#) #)++asyncDoProc :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int+asyncDoProc (FunPtr proc) (Ptr param) =+    -- the 'length' value is ignored; simplifies implementation of+    -- the async*# primops to have them all return the same result.+  IO $ \s -> case asyncDoProc# proc param s  of+               (# s', _len#, err# #) -> (# s', I# err# #)++-- to aid the use of these primops by the IO Handle implementation,+-- provide the following convenience funs:++-- this better be a pinned byte array!+asyncReadBA :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int,Int)+asyncReadBA fd isSock len off bufB =+  asyncRead fd isSock len ((Ptr (byteArrayContents# (unsafeCoerce# bufB))) `plusPtr` off)++asyncWriteBA :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int,Int)+asyncWriteBA fd isSock len off bufB =+  asyncWrite fd isSock len ((Ptr (byteArrayContents# (unsafeCoerce# bufB))) `plusPtr` off)++-- ----------------------------------------------------------------------------+-- Threaded RTS implementation of threadDelay++-- | Suspends the current thread for a given number of microseconds+-- (GHC only).+--+-- There is no guarantee that the thread will be rescheduled promptly+-- when the delay has expired, but the thread will never continue to+-- run /earlier/ than specified.+--+threadDelay :: Int -> IO ()+threadDelay time+  | threaded  = waitForDelayEvent time+  | otherwise = IO $ \s ->+        case fromIntegral time of { I# time# ->+        case delay# time# s of { s' -> (# s', () #)+        }}++-- | Set the value of returned TVar to True after a given number of+-- microseconds. The caveats associated with threadDelay also apply.+--+registerDelay :: Int -> IO (TVar Bool)+registerDelay usecs+  | threaded = waitForDelayEventSTM usecs+  | otherwise = error "registerDelay: requires -threaded"++foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool++waitForDelayEvent :: Int -> IO ()+waitForDelayEvent usecs = do+  m <- newEmptyMVar+  target <- calculateTarget usecs+  atomicModifyIORef pendingDelays (\xs -> (Delay target m : xs, ()))+  prodServiceThread+  takeMVar m++-- Delays for use in STM+waitForDelayEventSTM :: Int -> IO (TVar Bool)+waitForDelayEventSTM usecs = do+   t <- atomically $ newTVar False+   target <- calculateTarget usecs+   atomicModifyIORef pendingDelays (\xs -> (DelaySTM target t : xs, ()))+   prodServiceThread+   return t++calculateTarget :: Int -> IO USecs+calculateTarget usecs = do+    now <- getUSecOfDay+    return $ now + (fromIntegral usecs)++data DelayReq+  = Delay    {-# UNPACK #-} !USecs {-# UNPACK #-} !(MVar ())+  | DelaySTM {-# UNPACK #-} !USecs {-# UNPACK #-} !(TVar Bool)++{-# NOINLINE pendingDelays #-}+pendingDelays :: IORef [DelayReq]+pendingDelays = unsafePerformIO $ do+   m <- newIORef []+   sharedCAF m getOrSetGHCConcWindowsPendingDelaysStore++foreign import ccall unsafe "getOrSetGHCConcWindowsPendingDelaysStore"+    getOrSetGHCConcWindowsPendingDelaysStore :: Ptr a -> IO (Ptr a)++{-# NOINLINE ioManagerThread #-}+ioManagerThread :: MVar (Maybe ThreadId)+ioManagerThread = unsafePerformIO $ do+   m <- newMVar Nothing+   sharedCAF m getOrSetGHCConcWindowsIOManagerThreadStore++foreign import ccall unsafe "getOrSetGHCConcWindowsIOManagerThreadStore"+    getOrSetGHCConcWindowsIOManagerThreadStore :: Ptr a -> IO (Ptr a)++ensureIOManagerIsRunning :: IO ()+ensureIOManagerIsRunning+  | threaded  = startIOManagerThread+  | otherwise = return ()++startIOManagerThread :: IO ()+startIOManagerThread = do+  modifyMVar_ ioManagerThread $ \old -> do+    let create = do t <- forkIO ioManager; return (Just t)+    case old of+      Nothing -> create+      Just t  -> do+        s <- threadStatus t+        case s of+          ThreadFinished -> create+          ThreadDied     -> create+          _other         -> return (Just t)++insertDelay :: DelayReq -> [DelayReq] -> [DelayReq]+insertDelay d [] = [d]+insertDelay d1 ds@(d2 : rest)+  | delayTime d1 <= delayTime d2 = d1 : ds+  | otherwise                    = d2 : insertDelay d1 rest++delayTime :: DelayReq -> USecs+delayTime (Delay t _) = t+delayTime (DelaySTM t _) = t++type USecs = Word64++foreign import ccall unsafe "getUSecOfDay"+  getUSecOfDay :: IO USecs++{-# NOINLINE prodding #-}+prodding :: IORef Bool+prodding = unsafePerformIO $ do+   r <- newIORef False+   sharedCAF r getOrSetGHCConcWindowsProddingStore++foreign import ccall unsafe "getOrSetGHCConcWindowsProddingStore"+    getOrSetGHCConcWindowsProddingStore :: Ptr a -> IO (Ptr a)++prodServiceThread :: IO ()+prodServiceThread = do+  -- NB. use atomicModifyIORef here, otherwise there are race+  -- conditions in which prodding is left at True but the server is+  -- blocked in select().+  was_set <- atomicModifyIORef prodding $ \b -> (True,b)+  unless was_set wakeupIOManager++-- ----------------------------------------------------------------------------+-- Windows IO manager thread++ioManager :: IO ()+ioManager = do+  wakeup <- c_getIOManagerEvent+  service_loop wakeup []++service_loop :: HANDLE          -- read end of pipe+             -> [DelayReq]      -- current delay requests+             -> IO ()++service_loop wakeup old_delays = do+  -- pick up new delay requests+  new_delays <- atomicModifyIORef pendingDelays (\a -> ([],a))+  let  delays = foldr insertDelay old_delays new_delays++  now <- getUSecOfDay+  (delays', timeout) <- getDelay now delays++  r <- c_WaitForSingleObject wakeup timeout+  case r of+    0xffffffff -> do c_maperrno; throwErrno "service_loop"+    0 -> do+        r2 <- c_readIOManagerEvent+        exit <-+              case r2 of+                _ | r2 == io_MANAGER_WAKEUP -> return False+                _ | r2 == io_MANAGER_DIE    -> return True+                0 -> return False -- spurious wakeup+                _ -> do start_console_handler (r2 `shiftR` 1); return False+        unless exit $ service_cont wakeup delays'++    _other -> service_cont wakeup delays' -- probably timeout++service_cont :: HANDLE -> [DelayReq] -> IO ()+service_cont wakeup delays = do+  r <- atomicModifyIORef prodding (\_ -> (False,False))+  r `seq` return () -- avoid space leak+  service_loop wakeup delays++-- must agree with rts/win32/ThrIOManager.c+io_MANAGER_WAKEUP, io_MANAGER_DIE :: Word32+io_MANAGER_WAKEUP = 0xffffffff+io_MANAGER_DIE    = 0xfffffffe++data ConsoleEvent+ = ControlC+ | Break+ | Close+    -- these are sent to Services only.+ | Logoff+ | Shutdown+ deriving (Eq, Ord, Enum, Show, Read, Typeable)++start_console_handler :: Word32 -> IO ()+start_console_handler r =+  case toWin32ConsoleEvent r of+     Just x  -> withMVar win32ConsoleHandler $ \handler -> do+                    _ <- forkIO (handler x)+                    return ()+     Nothing -> return ()++toWin32ConsoleEvent :: Num a => a -> Maybe ConsoleEvent+toWin32ConsoleEvent ev =+   case ev of+       0 {- CTRL_C_EVENT-}        -> Just ControlC+       1 {- CTRL_BREAK_EVENT-}    -> Just Break+       2 {- CTRL_CLOSE_EVENT-}    -> Just Close+       5 {- CTRL_LOGOFF_EVENT-}   -> Just Logoff+       6 {- CTRL_SHUTDOWN_EVENT-} -> Just Shutdown+       _ -> Nothing++win32ConsoleHandler :: MVar (ConsoleEvent -> IO ())+win32ConsoleHandler = unsafePerformIO (newMVar (error "win32ConsoleHandler"))++wakeupIOManager :: IO ()+wakeupIOManager = c_sendIOManagerEvent io_MANAGER_WAKEUP++-- Walk the queue of pending delays, waking up any that have passed+-- and return the smallest delay to wait for.  The queue of pending+-- delays is kept ordered.+getDelay :: USecs -> [DelayReq] -> IO ([DelayReq], DWORD)+getDelay _   [] = return ([], iNFINITE)+getDelay now all@(d : rest)+  = case d of+     Delay time m | now >= time -> do+        putMVar m ()+        getDelay now rest+     DelaySTM time t | now >= time -> do+        atomically $ writeTVar t True+        getDelay now rest+     _otherwise ->+        -- delay is in millisecs for WaitForSingleObject+        let micro_seconds = delayTime d - now+            milli_seconds = (micro_seconds + 999) `div` 1000+        in return (all, fromIntegral milli_seconds)++-- ToDo: this just duplicates part of System.Win32.Types, which isn't+-- available yet.  We should move some Win32 functionality down here,+-- maybe as part of the grand reorganisation of the base package...+type HANDLE       = Ptr ()+type DWORD        = Word32++iNFINITE :: DWORD+iNFINITE = 0xFFFFFFFF -- urgh++foreign import ccall unsafe "getIOManagerEvent" -- in the RTS (ThrIOManager.c)+  c_getIOManagerEvent :: IO HANDLE++foreign import ccall unsafe "readIOManagerEvent" -- in the RTS (ThrIOManager.c)+  c_readIOManagerEvent :: IO Word32++foreign import ccall unsafe "sendIOManagerEvent" -- in the RTS (ThrIOManager.c)+  c_sendIOManagerEvent :: Word32 -> IO ()++foreign import ccall unsafe "maperrno"             -- in Win32Utils.c+   c_maperrno :: IO ()++foreign import stdcall "WaitForSingleObject"+   c_WaitForSingleObject :: HANDLE -> DWORD -> IO DWORD
GHC/Exts.hs view
@@ -44,14 +44,18 @@         Down(..), groupWith, sortWith, the,          -- * Event logging-        traceEvent+        traceEvent, +        -- * SpecConstr annotations+        SpecConstrAnnotation(..)+        ) where  import Prelude  import GHC.Prim import GHC.Base+import GHC.Magic import GHC.Word import GHC.Int -- import GHC.Float@@ -59,6 +63,7 @@ import Data.String import Data.List import Foreign.C+import Data.Data  -- XXX This should really be in Data.Tuple, where the definitions are maxTupleSize :: Int@@ -109,3 +114,22 @@ traceEvent msg = do   withCString msg $ \(Ptr p) -> IO $ \s ->     case traceEvent# p s of s' -> (# s', () #)++++{- **********************************************************************+*									*+*              SpecConstr annotation                                    *+*									*+********************************************************************** -}++-- Annotating a type with NoSpecConstr will make SpecConstr +-- not specialise for arguments of that type.++-- This data type is defined here, rather than in the SpecConstr module+-- itself, so that importing it doesn't force stupidly linking the+-- entire ghc package at runtime++data SpecConstrAnnotation = NoSpecConstr | ForceSpecConstr+                deriving( Data, Typeable, Eq )+
GHC/Float.lhs view
@@ -1,5 +1,7 @@ \begin{code} {-# OPTIONS_GHC -XNoImplicitPrelude #-}+-- We believe we could deorphan this module, by moving lots of things+-- around, but we haven't got there yet: {-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_HADDOCK hide #-} -----------------------------------------------------------------------------@@ -7,7 +9,7 @@ -- Module      :  GHC.Float -- Copyright   :  (c) The University of Glasgow 1994-2002 -- License     :  see libraries/base/LICENSE--- +-- -- Maintainer  :  cvs-ghc@haskell.org -- Stability   :  internal -- Portability :  non-portable (GHC Extensions)@@ -57,6 +59,11 @@     sinh, cosh, tanh    :: a -> a     asinh, acosh, atanh :: a -> a +    {-# INLINE (**) #-}+    {-# INLINE logBase #-}+    {-# INLINE sqrt #-}+    {-# INLINE tan #-}+    {-# INLINE tanh #-}     x ** y              =  exp (log x * y)     logBase x y         =  log y / log x     sqrt x              =  x ** 0.5@@ -124,13 +131,24 @@     significand x       =  encodeFloat m (negate (floatDigits x))                            where (m,_) = decodeFloat x -    scaleFloat k x      =  encodeFloat m (n+k)+    scaleFloat k x      =  encodeFloat m (n + clamp b k)                            where (m,n) = decodeFloat x-                           +                                 (l,h) = floatRange x+                                 d     = floatDigits x+                                 b     = h - l + 4*d+                                 -- n+k may overflow, which would lead+                                 -- to wrong results, hence we clamp the+                                 -- scaling parameter.+                                 -- If n + k would be larger than h,+                                 -- n + clamp b k must be too, simliar+                                 -- for smaller than l - d.+                                 -- Add a little extra to keep clear+                                 -- from the boundary cases.+     atan2 y x       | x > 0            =  atan (y/x)       | x == 0 && y > 0  =  pi/2-      | x <  0 && y > 0  =  pi + atan (y/x) +      | x <  0 && y > 0  =  pi + atan (y/x)       |(x <= 0 && y < 0)            ||        (x <  0 && isNegativeZero y) ||        (isNegativeZero x && isNegativeZero y)@@ -149,19 +167,6 @@ %*********************************************************  \begin{code}-instance Eq Float where-    (F# x) == (F# y) = x `eqFloat#` y--instance Ord Float where-    (F# x) `compare` (F# y) | x `ltFloat#` y = LT-                            | x `eqFloat#` y = EQ-                            | otherwise      = GT--    (F# x) <  (F# y) = x `ltFloat#`  y-    (F# x) <= (F# y) = x `leFloat#`  y-    (F# x) >= (F# y) = x `geFloat#`  y-    (F# x) >  (F# y) = x `gtFloat#`  y- instance  Num Float  where     (+)         x y     =  plusFloat x y     (-)         x y     =  minusFloat x y@@ -255,7 +260,7 @@      asinh x = log (x + sqrt (1.0+x*x))     acosh x = log (x + (x+1.0) * sqrt ((x-1.0)/(x+1.0)))-    atanh x = log ((x+1.0) / sqrt (1.0-x*x))+    atanh x = 0.5 * log ((1.0+x) / (1.0-x))  instance  RealFloat Float  where     floatRadix _        =  FLT_RADIX        -- from float.h@@ -274,7 +279,9 @@                             (m,_) -> encodeFloat m (negate (floatDigits x))      scaleFloat k x      = case decodeFloat x of-                            (m,n) -> encodeFloat m (n+k)+                            (m,n) -> encodeFloat m (n + clamp bf k)+                        where bf = FLT_MAX_EXP - (FLT_MIN_EXP) + 4*FLT_MANT_DIG+     isNaN x          = 0 /= isFloatNaN x     isInfinite x     = 0 /= isFloatInfinite x     isDenormalized x = 0 /= isFloatDenormalized x@@ -283,7 +290,7 @@  instance  Show Float  where     showsPrec   x = showSignedFloat showFloat x-    showList = showList__ (showsPrec 0) +    showList = showList__ (showsPrec 0) \end{code}  %*********************************************************@@ -293,19 +300,6 @@ %*********************************************************  \begin{code}-instance Eq Double where-    (D# x) == (D# y) = x ==## y--instance Ord Double where-    (D# x) `compare` (D# y) | x <## y   = LT-                            | x ==## y  = EQ-                            | otherwise = GT--    (D# x) <  (D# y) = x <##  y-    (D# x) <= (D# y) = x <=## y-    (D# x) >= (D# y) = x >=## y-    (D# x) >  (D# y) = x >##  y- instance  Num Double  where     (+)         x y     =  plusDouble x y     (-)         x y     =  minusDouble x y@@ -350,7 +344,7 @@      asinh x = log (x + sqrt (1.0+x*x))     acosh x = log (x + (x+1.0) * sqrt ((x-1.0)/(x+1.0)))-    atanh x = log ((x+1.0) / sqrt (1.0-x*x))+    atanh x = 0.5 * log ((1.0+x) / (1.0-x))  {-# RULES "truncate/Double->Int" truncate = double2Int #-} instance  RealFrac Double  where@@ -414,7 +408,8 @@                             (m,_) -> encodeFloat m (negate (floatDigits x))      scaleFloat k x      = case decodeFloat x of-                            (m,n) -> encodeFloat m (n+k)+                            (m,n) -> encodeFloat m (n + clamp bd k)+                        where bd = DBL_MAX_EXP - (DBL_MIN_EXP) + 4*DBL_MANT_DIG      isNaN x             = 0 /= isDoubleNaN x     isInfinite x        = 0 /= isDoubleInfinite x@@ -424,7 +419,7 @@  instance  Show Double  where     showsPrec   x = showSignedFloat showFloat x-    showList = showList__ (showsPrec 0) +    showList = showList__ (showsPrec 0) \end{code}  %*********************************************************@@ -442,7 +437,7 @@  NOTE: The instances for Float and Double do not make use of the default methods for @enumFromTo@ and @enumFromThenTo@, as these rely on there being-a `non-lossy' conversion to and from Ints. Instead we make use of the +a `non-lossy' conversion to and from Ints. Instead we make use of the 1.2 default methods (back in the days when Enum had Ord as a superclass) for these (@numericEnumFromTo@ and @numericEnumFromThenTo@ below.) @@ -478,7 +473,7 @@  \begin{code} -- | Show a signed 'RealFloat' value to full precision--- using standard decimal notation for arguments whose absolute value lies +-- using standard decimal notation for arguments whose absolute value lies -- between @0.1@ and @9,999,999@, and scientific notation otherwise. showFloat :: (RealFloat a) => a -> ShowS showFloat x  =  showString (formatRealFloat FFGeneric Nothing x)@@ -493,7 +488,7 @@    | isInfinite x              = if x < 0 then "-Infinity" else "Infinity"    | x < 0 || isNegativeZero x = '-':doFmt fmt (floatToDigits (toInteger base) (-x))    | otherwise                 = doFmt fmt (floatToDigits (toInteger base) x)- where + where   base = 10    doFmt format (is, e) =@@ -574,7 +569,7 @@ -- This version uses a much slower logarithm estimator. It should be improved.  -- | 'floatToDigits' takes a base and a non-negative 'RealFloat' number,--- and returns a list of digits and an exponent. +-- and returns a list of digits and an exponent. -- In particular, if @x>=0@, and -- -- > floatToDigits base x = ([d1,d2,...,dn], e)@@ -590,7 +585,7 @@ floatToDigits :: (RealFloat a) => Integer -> a -> ([Int], Int) floatToDigits _ 0 = ([0], 0) floatToDigits base x =- let + let   (f0, e0) = decodeFloat x   (minExp0, _) = floatRange x   p = floatDigits x@@ -598,7 +593,7 @@   minExp = minExp0 - p -- the real minimum exponent   -- Haskell requires that f be adjusted so denormalized numbers   -- will have an impossibly low exponent.  Adjust for this.-  (f, e) = +  (f, e) =    let n = minExp - e0 in    if n > 0 then (f0 `div` (b^n), e0+n) else (f0, e0)   (r, s, mUp, mDn) =@@ -615,7 +610,7 @@       (f*2, b^(-e)*2, 1, 1)   k :: Int   k =-   let +   let     k0 :: Int     k0 =      if b == 2 && base == 10 then@@ -625,7 +620,7 @@         -- Haskell promises that p-1 <= logBase b f < p.         (p - 1 + e0) * 3 `div` 10      else-	-- f :: Integer, log :: Float -> Float, +	-- f :: Integer, log :: Float -> Float,         --               ceiling :: Float -> Int         ceiling ((log (fromInteger (f+1) :: Float) +                  fromIntegral e * log (fromInteger b)) /@@ -651,8 +646,8 @@     (False, True)  -> dn+1 : ds     (True,  True)  -> if rn' * 2 < sN then dn : ds else dn+1 : ds     (False, False) -> gen (dn:ds) rn' sN mUpN' mDnN'-  -  rds = ++  rds =    if k >= 0 then       gen [] r (s * expt base k) mUp mDn    else@@ -695,7 +690,7 @@ fromRat x = x'         where x' = f e ---              If the exponent of the nearest floating-point number to x +--              If the exponent of the nearest floating-point number to x --              is e, then the significand is the integer nearest xb^(-e), --              where b is the floating-point radix.  We start with a good --              guess for e, and if it is correct, the exponent of the@@ -758,7 +753,7 @@  -- Scale x until xMin <= x < xMax, or p (the exponent) <= minExp. scaleRat :: Rational -> Int -> Rational -> Rational -> Int -> Rational -> (Rational, Int)-scaleRat b minExp xMin xMax p x +scaleRat b minExp xMin xMax p x  | p <= minExp = (x, p)  | x >= xMax   = scaleRat b minExp xMin xMax (p+1) (x/b)  | x < xMin    = scaleRat b minExp xMin xMax (p-1) (x*b)@@ -941,36 +936,36 @@ Don found that the RULES for realToFrac/Int->Double and simliarly Float made a huge difference to some stream-fusion programs.  Here's an example-  +       import Data.Array.Vector-  +       n = 40000000-  +       main = do             let c = replicateU n (2::Double)                 a = mapU realToFrac (enumFromToU 0 (n-1) ) :: UArr Double             print (sumU (zipWithU (*) c a))-  + Without the RULE we get this loop body:-  +       case $wtoRational sc_sY4 of ww_aM7 { (# ww1_aM9, ww2_aMa #) ->       case $wfromRat ww1_aM9 ww2_aMa of tpl_X1P { D# ipv_sW3 ->       Main.$s$wfold         (+# sc_sY4 1)         (+# wild_X1i 1)         (+## sc2_sY6 (*## 2.0 ipv_sW3))-  + And with the rule:-  +      Main.$s$wfold         (+# sc_sXT 1)         (+# wild_X1h 1)         (+## sc2_sXV (*## 2.0 (int2Double# sc_sXT)))-  + The running time of the program goes from 120 seconds to 0.198 seconds with the native backend, and 0.143 seconds with the C backend.-  -A few more details in Trac #2251, and the patch message ++A few more details in Trac #2251, and the patch message "Add RULES for realToFrac from Int".  %*********************************************************@@ -989,4 +984,13 @@    | x < 0 || isNegativeZero x        = showParen (p > 6) (showChar '-' . showPos (-x))    | otherwise = showPos x+\end{code}++We need to prevent over/underflow of the exponent in encodeFloat when+called from scaleFloat, hence we clamp the scaling parameter.+We must have a large enough range to cover the maximum difference of+exponents returned by decodeFloat.+\begin{code}+clamp :: Int -> Int -> Int+clamp bd k = max (-bd) (min bd k) \end{code}
GHC/ForeignPtr.hs view
@@ -46,7 +46,6 @@ import GHC.STRef        ( STRef(..) ) import GHC.Ptr          ( Ptr(..), FunPtr(..) ) import GHC.Err-import GHC.Num          ( fromInteger )  #include "Typeable.h" @@ -100,7 +99,7 @@     showsPrec p f = showsPrec p (unsafeForeignPtrToPtr f)  --- |A Finalizer is represented as a pointer to a foreign function that, at+-- |A finalizer is represented as a pointer to a foreign function that, at -- finalisation time, gets as an argument a plain pointer variant of the -- foreign pointer that the finalizer is associated with. -- @@ -222,7 +221,7 @@   PlainForeignPtr r -> f r >> return ()   MallocPtr     _ r -> f r >> return ()   _ -> error "GHC.ForeignPtr: attempt to add a finalizer to a plain pointer"-  where+ where     f r =       noMixing CFinalizers r $         IO $ \s ->@@ -232,7 +231,7 @@  addForeignPtrFinalizerEnv ::   FinalizerEnvPtr env a -> Ptr env -> ForeignPtr a -> IO ()--- ^ like 'addForeignPtrFinalizerEnv' but allows the finalizer to be+-- ^ Like 'addForeignPtrFinalizerEnv' but allows the finalizer to be -- passed an additional environment parameter to be passed to the -- finalizer.  The environment passed to the finalizer is fixed by the -- second argument to 'addForeignPtrFinalizerEnv'@@ -240,7 +239,7 @@   PlainForeignPtr r -> f r >> return ()   MallocPtr     _ r -> f r >> return ()   _ -> error "GHC.ForeignPtr: attempt to add a finalizer to a plain pointer"-  where+ where     f r =       noMixing CFinalizers r $         IO $ \s ->@@ -357,7 +356,7 @@ -- To avoid subtle coding errors, hand written marshalling code -- should preferably use 'Foreign.ForeignPtr.withForeignPtr' rather -- than combinations of 'unsafeForeignPtrToPtr' and--- 'touchForeignPtr'.  However, the later routines+-- 'touchForeignPtr'.  However, the latter routines -- are occasionally preferred in tool generated marshalling code. unsafeForeignPtrToPtr (ForeignPtr fo _) = Ptr fo 
GHC/IO.hs view
@@ -1,5 +1,5 @@-{-# OPTIONS_GHC -fno-warn-orphans #-}-{-# OPTIONS_GHC -XNoImplicitPrelude -funbox-strict-fields -XBangPatterns #-}+{-# OPTIONS_GHC -funbox-strict-fields #-}+{-# LANGUAGE NoImplicitPrelude, BangPatterns, RankNTypes #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- |@@ -28,13 +28,16 @@     FilePath,      catchException, catchAny, throwIO,-    block, unblock, blocked,+    mask, mask_, uninterruptibleMask, uninterruptibleMask_, +    MaskingState(..), getMaskingState,+    block, unblock, blocked, unsafeUnmask,     onException, finally, evaluate   ) where  import GHC.Base import GHC.ST import GHC.Exception+import GHC.Show import Data.Maybe  import {-# SOURCE #-} GHC.IO.Exception ( userError )@@ -102,11 +105,15 @@ this to be safe, the 'IO' computation should be free of side effects and independent of its environment. -If the I\/O computation wrapped in 'unsafePerformIO'-performs side effects, then the relative order in which those side-effects take place (relative to the main I\/O trunk, or other calls to-'unsafePerformIO') is indeterminate.  You have to be careful when -writing and compiling modules that use 'unsafePerformIO':+If the I\/O computation wrapped in 'unsafePerformIO' performs side+effects, then the relative order in which those side effects take+place (relative to the main I\/O trunk, or other calls to+'unsafePerformIO') is indeterminate.  Furthermore, when using+'unsafePerformIO' to cause side-effects, you should take the following+precautions to ensure the side effects are performed as many times as+you expect them to be.  Note that these precautions are necessary for+GHC, but may not be sufficient, and other compilers may require+different precautions:    * Use @{\-\# NOINLINE foo \#-\}@ as a pragma on any function @foo@         that calls 'unsafePerformIO'.  If the call is inlined,@@ -117,7 +124,7 @@         two side effects that were meant to be separate.  A good example         is using multiple global variables (like @test@ in the example below). -  * Make sure that the either you switch off let-floating, or that the +  * Make sure that the either you switch off let-floating (@-fno-full-laziness@), or that the          call to 'unsafePerformIO' cannot float outside a lambda.  For example,          if you say:         @@@ -274,11 +281,14 @@ -- ----------------------------------------------------------------------------- -- Controlling asynchronous exception delivery --- | Applying 'block' to a computation will+{-# DEPRECATED block "use Control.Exception.mask instead" #-}+-- | Note: this function is deprecated, please use 'mask' instead.+--+-- Applying 'block' to a computation will -- execute that computation with asynchronous exceptions -- /blocked/.  That is, any thread which -- attempts to raise an exception in the current thread with 'Control.Exception.throwTo' will be--- blocked until asynchronous exceptions are enabled again.  There\'s+-- blocked until asynchronous exceptions are unblocked again.  There\'s -- no need to worry about re-enabling asynchronous exceptions; that is -- done automatically on exiting the scope of -- 'block'.@@ -289,37 +299,142 @@ -- establish an exception handler in the forked thread before any -- asynchronous exceptions are received. block :: IO a -> IO a+block (IO io) = IO $ maskAsyncExceptions# io --- | To re-enable asynchronous exceptions inside the scope of+{-# DEPRECATED unblock "use Control.Exception.mask instead" #-}+-- | Note: this function is deprecated, please use 'mask' instead.+--+-- To re-enable asynchronous exceptions inside the scope of -- 'block', 'unblock' can be -- used.  It scopes in exactly the same way, so on exit from -- 'unblock' asynchronous exception delivery will -- be disabled again. unblock :: IO a -> IO a+unblock = unsafeUnmask -block (IO io) = IO $ blockAsyncExceptions# io-unblock (IO io) = IO $ unblockAsyncExceptions# io+unsafeUnmask :: IO a -> IO a+unsafeUnmask (IO io) = IO $ unmaskAsyncExceptions# io +blockUninterruptible :: IO a -> IO a+blockUninterruptible (IO io) = IO $ maskUninterruptible# io++-- | Describes the behaviour of a thread when an asynchronous+-- exception is received.+data MaskingState+  = Unmasked -- ^ asynchronous exceptions are unmasked (the normal state)+  | MaskedInterruptible +      -- ^ the state during 'mask': asynchronous exceptions are masked, but blocking operations may still be interrupted+  | MaskedUninterruptible+      -- ^ the state during 'uninterruptibleMask': asynchronous exceptions are masked, and blocking operations may not be interrupted+ deriving (Eq,Show)++-- | Returns the 'MaskingState' for the current thread.+getMaskingState :: IO MaskingState+getMaskingState  = IO $ \s -> +  case getMaskingState# s of+     (# s', i #) -> (# s', case i of+                             0# -> Unmasked+                             1# -> MaskedUninterruptible+                             _  -> MaskedInterruptible #)+ -- | returns True if asynchronous exceptions are blocked in the -- current thread. blocked :: IO Bool-blocked = IO $ \s -> case asyncExceptionsBlocked# s of-                        (# s', i #) -> (# s', i /=# 0# #)+blocked = fmap (/= Unmasked) getMaskingState  onException :: IO a -> IO b -> IO a onException io what = io `catchException` \e -> do _ <- what                                                    throw (e :: SomeException) +-- | Executes an IO computation with asynchronous+-- exceptions /masked/.  That is, any thread which attempts to raise+-- an exception in the current thread with 'Control.Exception.throwTo'+-- will be blocked until asynchronous exceptions are unmasked again.+--+-- The argument passed to 'mask' is a function that takes as its+-- argument another function, which can be used to restore the+-- prevailing masking state within the context of the masked+-- computation.  For example, a common way to use 'mask' is to protect+-- the acquisition of a resource:+--+-- > mask $ \restore -> do+-- >     x <- acquire+-- >     restore (do_something_with x) `onException` release+-- >     release+--+-- This code guarantees that @acquire@ is paired with @release@, by masking+-- asynchronous exceptions for the critical parts. (Rather than write+-- this code yourself, it would be better to use+-- 'Control.Exception.bracket' which abstracts the general pattern).+--+-- Note that the @restore@ action passed to the argument to 'mask'+-- does not necessarily unmask asynchronous exceptions, it just+-- restores the masking state to that of the enclosing context.  Thus+-- if asynchronous exceptions are already masked, 'mask' cannot be used+-- to unmask exceptions again.  This is so that if you call a library function+-- with exceptions masked, you can be sure that the library call will not be+-- able to unmask exceptions again.  If you are writing library code and need+-- to use asynchronous exceptions, the only way is to create a new thread;+-- see 'Control.Concurrent.forkIOUnmasked'.+--+-- Asynchronous exceptions may still be received while in the masked+-- state if the masked thread /blocks/ in certain ways; see+-- "Control.Exception#interruptible".+--+-- Threads created by 'Control.Concurrent.forkIO' inherit the masked+-- state from the parent; that is, to start a thread in blocked mode,+-- use @mask_ $ forkIO ...@.  This is particularly useful if you need+-- to establish an exception handler in the forked thread before any+-- asynchronous exceptions are received.  To create a a new thread in+-- an unmasked state use 'Control.Concurrent.forkIOUnmasked'.+-- +mask  :: ((forall a. IO a -> IO a) -> IO b) -> IO b++-- | Like 'mask', but does not pass a @restore@ action to the argument.+mask_ :: IO a -> IO a++-- | Like 'mask', but the masked computation is not interruptible (see+-- "Control.Exception#interruptible").  THIS SHOULD BE USED WITH+-- GREAT CARE, because if a thread executing in 'uninterruptibleMask'+-- blocks for any reason, then the thread (and possibly the program,+-- if this is the main thread) will be unresponsive and unkillable.+-- This function should only be necessary if you need to mask+-- exceptions around an interruptible operation, and you can guarantee+-- that the interruptible operation will only block for a short period+-- of time.+--+uninterruptibleMask :: ((forall a. IO a -> IO a) -> IO b) -> IO b++-- | Like 'uninterruptibleMask', but does not pass a @restore@ action+-- to the argument.+uninterruptibleMask_ :: IO a -> IO a++mask_ io = mask $ \_ -> io++mask io = do+  b <- getMaskingState+  case b of+    Unmasked -> block $ io unblock+    _        -> io id++uninterruptibleMask_ io = uninterruptibleMask $ \_ -> io++uninterruptibleMask io = do+  b <- getMaskingState+  case b of+    Unmasked              -> blockUninterruptible $ io unblock+    MaskedInterruptible   -> blockUninterruptible $ io block+    MaskedUninterruptible -> io id+ finally :: IO a         -- ^ computation to run first         -> IO b         -- ^ computation to run afterward (even if an exception                         -- was raised)         -> IO a         -- returns the value from the first computation a `finally` sequel =-  block (do-    r <- unblock a `onException` sequel+  mask $ \restore -> do+    r <- restore a `onException` sequel     _ <- sequel     return r-  )  -- | Forces its argument to be evaluated to weak head normal form when -- the resultant 'IO' action is executed. It can be used to order
GHC/IO/Device.hs view
@@ -132,17 +132,41 @@ ioe_unsupportedOperation :: IO a ioe_unsupportedOperation = throwIO unsupportedOperation +-- | Type of a device that can be used to back a+-- 'GHC.IO.Handle.Handle' (see also 'GHC.IO.Handle.mkFileHandle'). The+-- standard libraries provide creation of 'GHC.IO.Handle.Handle's via+-- Posix file operations with file descriptors (see+-- 'GHC.IO.Handle.FD.mkHandleFromFD') with FD being the underlying+-- 'GHC.IO.Device.IODevice' instance.+--+-- Users may provide custom instances of 'GHC.IO.Device.IODevice'+-- which are expected to conform the following rules:+ data IODeviceType-  = Directory-  | Stream-  | RegularFile-  | RawDevice+  = Directory -- ^ The standard libraries do not have direct support+              -- for this device type, but a user implementation is+              -- expected to provide a list of file names in+              -- the directory, in any order, separated by @'\0'@+              -- characters, excluding the @"."@ and @".."@ names. See+              -- also 'System.Directory.getDirectoryContents'.  Seek+              -- operations are not supported on directories (other+              -- than to the zero position).+  | Stream    -- ^ A duplex communications channel (results in+              -- creation of a duplex 'GHC.IO.Handle.Handle'). The+              -- standard libraries use this device type when+              -- creating 'GHC.IO.Handle.Handle's for open sockets.+  | RegularFile -- ^ A file that may be read or written, and also+                -- may be seekable.+  | RawDevice -- ^ A "raw" (disk) device which supports block binary+              -- read and write operations and may be seekable only+              -- to positions of certain granularity (block-+              -- aligned).   deriving (Eq)  -- ----------------------------------------------------------------------------- -- SeekMode type --- | A mode that determines the effect of 'hSeek' @hdl mode i@, as follows:+-- | A mode that determines the effect of 'hSeek' @hdl mode i@. data SeekMode   = AbsoluteSeek        -- ^ the position of @hdl@ is set to @i@.   | RelativeSeek        -- ^ the position of @hdl@ is set to offset @i@
GHC/IO/Encoding/CodePage.hs view
@@ -8,6 +8,7 @@                             ) where  import GHC.Base+import GHC.Show import GHC.Num import GHC.Enum import GHC.Word@@ -53,11 +54,12 @@ codePageEncoding 1201 = utf16be codePageEncoding 12000 = utf32le codePageEncoding 12001 = utf32be-codePageEncoding cp = maybe latin1 buildEncoding (lookup cp codePageMap)+codePageEncoding cp = maybe latin1 (buildEncoding cp) (lookup cp codePageMap) -buildEncoding :: CodePageArrays -> TextEncoding-buildEncoding SingleByteCP {decoderArray = dec, encoderArray = enc}+buildEncoding :: Word32 -> CodePageArrays -> TextEncoding+buildEncoding cp SingleByteCP {decoderArray = dec, encoderArray = enc}   = TextEncoding {+    textEncodingName = "CP" ++ show cp,     mkTextDecoder = return $ simpleCodec         $ decodeFromSingleByte dec     , mkTextEncoder = return $ simpleCodec $ encodeToSingleByte enc
GHC/IO/Encoding/Iconv.hs view
@@ -30,9 +30,7 @@  #if !defined(mingw32_HOST_OS) -#undef DEBUG_DUMP--import Foreign+import Foreign hiding (unsafePerformIO) import Foreign.C import Data.Maybe import GHC.Base@@ -41,27 +39,22 @@ import GHC.Num import GHC.Show import GHC.Real-#ifdef DEBUG_DUMP+import System.IO.Unsafe (unsafePerformIO) import System.Posix.Internals-#endif -iconv_trace :: String -> IO ()--#ifdef DEBUG_DUMP+c_DEBUG_DUMP :: Bool+c_DEBUG_DUMP = False -iconv_trace s = puts s+iconv_trace :: String -> IO ()+iconv_trace s+ | c_DEBUG_DUMP = puts s+ | otherwise    = return ()  puts :: String -> IO ()-puts s = do withCStringLen (s++"\n") $ \(p, len) -> -                c_write 1 (castPtr p) (fromIntegral len)+puts s = do _ <- withCStringLen (s ++ "\n") $ \(p, len) ->+                     c_write 1 (castPtr p) (fromIntegral len)             return () -#else--iconv_trace _ = return ()--#endif- -- ----------------------------------------------------------------------------- -- iconv encoders/decoders @@ -100,14 +93,11 @@ {-# NOINLINE localeEncoding #-} localeEncoding :: TextEncoding localeEncoding = unsafePerformIO $ do-#if HAVE_LANGINFO_H-   cstr <- c_localeEncoding -- use nl_langinfo(CODESET) to get the encoding-                               -- if we have it+   -- Use locale_charset() or nl_langinfo(CODESET) to get the encoding+   -- if we have either of them.+   cstr <- c_localeEncoding    r <- peekCString cstr    mkTextEncoding r-#else-   mkTextEncoding "" -- GNU iconv accepts "" to mean the -- locale encoding.-#endif  -- We hope iconv_t is a storable type.  It should be, since it has at least the -- value -1, which is a possible return value from iconv_open.@@ -142,6 +132,7 @@ mkTextEncoding :: String -> IO TextEncoding mkTextEncoding charset = do   return (TextEncoding { +                textEncodingName = charset, 		mkTextDecoder = newIConv charset haskellChar iconvDecode, 		mkTextEncoder = newIConv haskellChar charset iconvEncode}) 
GHC/IO/Encoding/Latin1.hs view
@@ -39,7 +39,8 @@ -- Latin1  latin1 :: TextEncoding-latin1 = TextEncoding { mkTextDecoder = latin1_DF,+latin1 = TextEncoding { textEncodingName = "ISO8859-1",+                        mkTextDecoder = latin1_DF,                         mkTextEncoder = latin1_EF }  latin1_DF :: IO (TextDecoder ())@@ -61,7 +62,8 @@           })  latin1_checked :: TextEncoding-latin1_checked = TextEncoding { mkTextDecoder = latin1_DF,+latin1_checked = TextEncoding { textEncodingName = "ISO8859-1(checked)",+                                mkTextDecoder = latin1_DF,                                 mkTextEncoder = latin1_checked_EF }  latin1_checked_EF :: IO (TextEncoder ())
GHC/IO/Encoding/Types.hs view
@@ -22,6 +22,7 @@  import GHC.Base import GHC.Word+import GHC.Show -- import GHC.IO import GHC.IO.Buffer @@ -84,6 +85,13 @@ -- of bytes.  The 'TextEncoding' for UTF-8 is 'utf8'. data TextEncoding   = forall dstate estate . TextEncoding  {+        textEncodingName :: String,+                   -- ^ a string that can be passed to 'mkTextEncoding' to+                   -- create an equivalent 'TextEncoding'. 	mkTextDecoder :: IO (TextDecoder dstate), 	mkTextEncoder :: IO (TextEncoder estate)   }++instance Show TextEncoding where+  -- | Returns the value of 'textEncodingName'+  show te = textEncodingName te
GHC/IO/Encoding/UTF16.hs view
@@ -48,10 +48,11 @@ import System.Posix.Internals import Foreign.C import GHC.Show+import GHC.Ptr  puts :: String -> IO () puts s = do withCStringLen (s++"\n") $ \(p,len) -> -                c_write 1 p (fromIntegral len)+                c_write 1 (castPtr p) (fromIntegral len)             return () #endif @@ -59,7 +60,8 @@ -- The UTF-16 codec: either UTF16BE or UTF16LE with a BOM  utf16  :: TextEncoding-utf16 = TextEncoding { mkTextDecoder = utf16_DF,+utf16 = TextEncoding { textEncodingName = "UTF-16",+                       mkTextDecoder = utf16_DF,  	               mkTextEncoder = utf16_EF }  utf16_DF :: IO (TextDecoder (Maybe DecodeBuffer))@@ -138,7 +140,8 @@ -- UTF16LE and UTF16BE  utf16be :: TextEncoding-utf16be = TextEncoding { mkTextDecoder = utf16be_DF,+utf16be = TextEncoding { textEncodingName = "UTF-16BE",+                         mkTextDecoder = utf16be_DF,  	                 mkTextEncoder = utf16be_EF }  utf16be_DF :: IO (TextDecoder ())@@ -160,7 +163,8 @@           })  utf16le :: TextEncoding-utf16le = TextEncoding { mkTextDecoder = utf16le_DF,+utf16le = TextEncoding { textEncodingName = "UTF16-LE",+                         mkTextDecoder = utf16le_DF,  	                 mkTextEncoder = utf16le_EF }  utf16le_DF :: IO (TextDecoder ())
GHC/IO/Encoding/UTF32.hs view
@@ -48,7 +48,8 @@ -- The UTF-32 codec: either UTF-32BE or UTF-32LE with a BOM  utf32  :: TextEncoding-utf32 = TextEncoding { mkTextDecoder = utf32_DF,+utf32 = TextEncoding { textEncodingName = "UTF-32",+                       mkTextDecoder = utf32_DF,  	               mkTextEncoder = utf32_EF }  utf32_DF :: IO (TextDecoder (Maybe DecodeBuffer))@@ -130,7 +131,8 @@ -- UTF32LE and UTF32BE  utf32be :: TextEncoding-utf32be = TextEncoding { mkTextDecoder = utf32be_DF,+utf32be = TextEncoding { textEncodingName = "UTF-32BE",+                         mkTextDecoder = utf32be_DF,  	                 mkTextEncoder = utf32be_EF }  utf32be_DF :: IO (TextDecoder ())@@ -153,7 +155,8 @@   utf32le :: TextEncoding-utf32le = TextEncoding { mkTextDecoder = utf32le_DF,+utf32le = TextEncoding { textEncodingName = "UTF-32LE",+                         mkTextDecoder = utf32le_DF,  	                 mkTextEncoder = utf32le_EF }  utf32le_DF :: IO (TextDecoder ())
GHC/IO/Encoding/UTF8.hs view
@@ -36,7 +36,8 @@ import Data.Maybe  utf8 :: TextEncoding-utf8 = TextEncoding { mkTextDecoder = utf8_DF,+utf8 = TextEncoding { textEncodingName = "UTF-8",+                      mkTextDecoder = utf8_DF,  	              mkTextEncoder = utf8_EF }  utf8_DF :: IO (TextDecoder ())@@ -58,7 +59,8 @@           })  utf8_bom :: TextEncoding-utf8_bom = TextEncoding { mkTextDecoder = utf8_bom_DF,+utf8_bom = TextEncoding { textEncodingName = "UTF-8BOM",+                          mkTextDecoder = utf8_bom_DF,                           mkTextEncoder = utf8_bom_EF }  utf8_bom_DF :: IO (TextDecoder Bool)
GHC/IO/Exception.hs view
@@ -169,6 +169,7 @@ -- We need it here because it is used in ExitException in the -- Exception datatype (above). +-- | Defines the exit codes that a program can return. data ExitCode   = ExitSuccess -- ^ indicates successful termination;   | ExitFailure Int
GHC/IO/FD.hs view
@@ -22,17 +22,13 @@   stdin, stdout, stderr   ) where -#undef DEBUG_DUMP- import GHC.Base import GHC.Num import GHC.Real import GHC.Show import GHC.Enum import Data.Maybe-#ifndef mingw32_HOST_OS import Control.Monad-#endif import Data.Typeable  import GHC.IO@@ -41,7 +37,7 @@ import GHC.IO.BufferedIO import qualified GHC.IO.Device import GHC.IO.Device (SeekMode(..), IODeviceType(..))-import GHC.Conc+import GHC.Conc.IO import GHC.IO.Exception  import Foreign@@ -51,6 +47,9 @@ import System.Posix.Types -- import GHC.Ptr +c_DEBUG_DUMP :: Bool+c_DEBUG_DUMP = False+ -- ----------------------------------------------------------------------------- -- The file-descriptor IO device @@ -108,20 +107,17 @@  readBuf' :: FD -> Buffer Word8 -> IO (Int, Buffer Word8) readBuf' fd buf = do-#ifdef DEBUG_DUMP-  puts ("readBuf fd=" ++ show fd ++ " " ++ summaryBuffer buf ++ "\n")-#endif+  when c_DEBUG_DUMP $+      puts ("readBuf fd=" ++ show fd ++ " " ++ summaryBuffer buf ++ "\n")   (r,buf') <- readBuf fd buf-#ifdef DEBUG_DUMP-  puts ("after: " ++ summaryBuffer buf' ++ "\n")-#endif+  when c_DEBUG_DUMP $+      puts ("after: " ++ summaryBuffer buf' ++ "\n")   return (r,buf')  writeBuf' :: FD -> Buffer Word8 -> IO (Buffer Word8) writeBuf' fd buf = do-#ifdef DEBUG_DUMP-  puts ("writeBuf fd=" ++ show fd ++ " " ++ summaryBuffer buf ++ "\n")-#endif+  when c_DEBUG_DUMP $+      puts ("writeBuf fd=" ++ show fd ++ " " ++ summaryBuffer buf ++ "\n")   writeBuf fd buf  -- -----------------------------------------------------------------------------@@ -378,7 +374,12 @@ -- Terminal-related stuff  isTerminal :: FD -> IO Bool-isTerminal fd = c_isatty (fdFD fd) >>= return.toBool+isTerminal fd =+#if defined(mingw32_HOST_OS)+    is_console (fdFD fd) >>= return.toBool+#else+    c_isatty (fdFD fd) >>= return.toBool+#endif  setEcho :: FD -> Bool -> IO ()  setEcho fd on = System.Posix.Internals.setEcho (fdFD fd) on@@ -581,8 +582,20 @@   = fmap fromIntegral $ throwErrnoIfMinus1Retry loc $         if fdIsSocket fd            then c_safe_send  (fdFD fd) (buf `plusPtr` off) len 0-           else c_safe_write (fdFD fd) (buf `plusPtr` off) len+           else do+             r <- c_safe_write (fdFD fd) (buf `plusPtr` off) len+             when (r == -1) c_maperrno+             return r+      -- we don't trust write() to give us the correct errno, and+      -- instead do the errno conversion from GetLastError()+      -- ourselves.  The main reason is that we treat ERROR_NO_DATA+      -- (pipe is closing) as EPIPE, whereas write() returns EINVAL+      -- for this case.  We need to detect EPIPE correctly, because it+      -- shouldn't be reported as an error when it happens on stdout. +foreign import ccall unsafe "maperrno"             -- in Win32Utils.c+   c_maperrno :: IO ()+ -- NOTE: "safe" versions of the read/write calls for use by the threaded RTS. -- These calls may block, but that's ok. @@ -626,8 +639,7 @@   unlockFile :: CInt -> IO CInt #endif -#if defined(DEBUG_DUMP) puts :: String -> IO ()-puts s = do withCStringLen s $ \(p,len) -> c_write 1 p (fromIntegral len)+puts s = do _ <- withCStringLen s $ \(p,len) ->+                     c_write 1 (castPtr p) (fromIntegral len)             return ()-#endif
GHC/IO/Handle.hs view
@@ -270,6 +270,7 @@ hSetEncoding hdl encoding = do   withAllHandles__ "hSetEncoding" hdl $ \h_@Handle__{..} -> do     flushCharBuffer h_+    closeTextCodecs h_     openTextEncoding (Just encoding) haType $ \ mb_encoder mb_decoder -> do     bbuf <- readIORef haByteBuffer     ref <- newIORef (error "last_decode")@@ -393,6 +394,9 @@ -- -- This operation may fail with: --+--  * 'isIllegalOperationError' if the Handle is not seekable, or does+--     not support the requested seek mode.+-- --  * 'isPermissionError' if a system resource limit would be exceeded.  hSeek :: Handle -> SeekMode -> Integer -> IO () @@ -417,6 +421,15 @@     IODevice.seek haDevice mode offset  +-- | Computation 'hTell' @hdl@ returns the current position of the+-- handle @hdl@, as the number of bytes from the beginning of+-- the file.  The value returned may be subsequently passed to+-- 'hSeek' to reposition the handle to the current position.+-- +-- This operation may fail with:+--+--  * 'isIllegalOperationError' if the Handle is not seekable.+-- hTell :: Handle -> IO Integer hTell handle =      wantSeekableHandle "hGetPosn" handle $ \ handle_@Handle__{..} -> do@@ -561,6 +574,7 @@   withAllHandles__ "hSetBinaryMode" handle $ \ h_@Handle__{..} ->     do           flushCharBuffer h_+         closeTextCodecs h_           let mb_te | bin       = Nothing                    | otherwise = Just localeEncoding
GHC/IO/Handle/FD.hs view
@@ -21,7 +21,6 @@  ) where  import GHC.Base-import GHC.Num import GHC.Real import GHC.Show import Data.Maybe@@ -51,6 +50,7 @@  -- | A handle managing input from the Haskell program's standard input channel. stdin :: Handle+{-# NOINLINE stdin #-} stdin = unsafePerformIO $ do    -- ToDo: acquire lock    setBinaryMode FD.stdin@@ -60,6 +60,7 @@  -- | A handle managing output to the Haskell program's standard output channel. stdout :: Handle+{-# NOINLINE stdout #-} stdout = unsafePerformIO $ do    -- ToDo: acquire lock    setBinaryMode FD.stdout@@ -69,6 +70,7 @@  -- | A handle managing output to the Haskell program's standard error channel. stderr :: Handle+{-# NOINLINE stderr #-} stderr = unsafePerformIO $ do     -- ToDo: acquire lock    setBinaryMode FD.stderr@@ -81,6 +83,9 @@ stdHandleFinalizer fp m = do   h_ <- takeMVar m   flushWriteBuffer h_+  case haType h_ of +      ClosedHandle -> return ()+      _other       -> closeTextCodecs h_   putMVar m (ioe_finalizedHandle fp)  -- We have to put the FDs into binary mode on Windows to avoid the newline
GHC/IO/Handle/Internals.hs view
@@ -4,8 +4,6 @@ {-# OPTIONS_GHC -XRecordWildCards #-} {-# OPTIONS_HADDOCK hide #-} -#undef DEBUG_DUMP- ----------------------------------------------------------------------------- -- | -- Module      :  GHC.IO.Handle.Internals@@ -30,7 +28,7 @@   wantSeekableHandle,    mkHandle, mkFileHandle, mkDuplexHandle,-  openTextEncoding, initBufferState,+  openTextEncoding, closeTextCodecs, initBufferState,   dEFAULT_CHAR_BUFFER_SIZE,    flushBuffer, flushWriteBuffer, flushWriteBuffer_, flushCharReadBuffer,@@ -52,7 +50,7 @@  import GHC.IO import GHC.IO.IOMode-import GHC.IO.Encoding+import GHC.IO.Encoding as Encoding import GHC.IO.Handle.Types import GHC.IO.Buffer import GHC.IO.BufferedIO (BufferedIO)@@ -61,6 +59,7 @@ import qualified GHC.IO.Device as IODevice import qualified GHC.IO.BufferedIO as Buffered +import GHC.Conc.Sync import GHC.Real import GHC.Base import GHC.Exception@@ -71,14 +70,15 @@ import Data.Typeable import Control.Monad import Data.Maybe-import Foreign+import Foreign hiding (unsafePerformIO) -- import System.IO.Error import System.Posix.Internals hiding (FD) -#ifdef DEBUG_DUMP import Foreign.C-#endif +c_DEBUG_DUMP :: Bool+c_DEBUG_DUMP = False+ -- --------------------------------------------------------------------------- -- Creating a new handle @@ -124,11 +124,8 @@ withHandle' :: String -> Handle -> MVar Handle__    -> (Handle__ -> IO (Handle__,a)) -> IO a withHandle' fun h m act =-   block $ do-   h_ <- takeMVar m-   checkHandleInvariants h_-   (h',v)  <- (act h_ `catchAny` \err -> putMVar m h_ >> throw err)-              `catchException` \ex -> ioError (augmentIOError ex fun h)+ mask_ $ do+   (h',v)  <- do_operation fun h act m    checkHandleInvariants h'    putMVar m h'    return v@@ -139,15 +136,9 @@ withHandle_ fun h@(DuplexHandle _ m _) act = withHandle_' fun h m act  withHandle_' :: String -> Handle -> MVar Handle__ -> (Handle__ -> IO a) -> IO a-withHandle_' fun h m act =-   block $ do-   h_ <- takeMVar m-   checkHandleInvariants h_-   v  <- (act h_ `catchAny` \err -> putMVar m h_ >> throw err)-         `catchException` \ex -> ioError (augmentIOError ex fun h)-   checkHandleInvariants h_-   putMVar m h_-   return v+withHandle_' fun h m act = withHandle' fun h m $ \h_ -> do+                              a <- act h_+                              return (h_,a)  withAllHandles__ :: String -> Handle -> (Handle__ -> IO Handle__) -> IO () withAllHandles__ fun h@(FileHandle _ m)     act = withHandle__' fun h m act@@ -158,15 +149,62 @@ withHandle__' :: String -> Handle -> MVar Handle__ -> (Handle__ -> IO Handle__)               -> IO () withHandle__' fun h m act =-   block $ do-   h_ <- takeMVar m-   checkHandleInvariants h_-   h'  <- (act h_ `catchAny` \err -> putMVar m h_ >> throw err)-          `catchException` \ex -> ioError (augmentIOError ex fun h)+ mask_ $ do+   h'  <- do_operation fun h act m    checkHandleInvariants h'    putMVar m h'    return () +do_operation :: String -> Handle -> (Handle__ -> IO a) -> MVar Handle__ -> IO a+do_operation fun h act m = do+  h_ <- takeMVar m+  checkHandleInvariants h_+  act h_ `catchException` handler h_+  where+    handler h_ e = do+      putMVar m h_+      case () of+        _ | Just ioe <- fromException e ->+            ioError (augmentIOError ioe fun h)+        _ | Just async_ex <- fromException e -> do -- see Note [async]+            let _ = async_ex :: AsyncException+            t <- myThreadId+            throwTo t e+            do_operation fun h act m+        _otherwise ->+            throwIO e++-- Note [async]+--+-- If an asynchronous exception is raised during an I/O operation,+-- normally it is fine to just re-throw the exception synchronously.+-- However, if we are inside an unsafePerformIO or an+-- unsafeInterleaveIO, this would replace the enclosing thunk with the+-- exception raised, which is wrong (#3997).  We have to release the+-- lock on the Handle, but what do we replace the thunk with?  What+-- should happen when the thunk is subsequently demanded again?+--+-- The only sensible choice we have is to re-do the IO operation on+-- resumption, but then we have to be careful in the IO library that+-- this is always safe to do.  In particular we should+--+--    never perform any side-effects before an interruptible operation+--+-- because the interruptible operation may raise an asynchronous+-- exception, which may cause the operation and its side effects to be+-- subsequently performed again.+--+-- Re-doing the IO operation is achieved by:+--   - using throwTo to re-throw the asynchronous exception asynchronously+--     in the current thread+--   - on resumption, it will be as if throwTo returns.  In that case, we+--     recursively invoke the original operation (see do_operation above).+--+-- Interruptible operations in the I/O library are:+--    - threadWaitRead/threadWaitWrite+--    - fillReadBuffer/flushWriteBuffer+--    - readTextDevice/writeTextDevice+ augmentIOError :: IOException -> String -> Handle -> IOException augmentIOError ioe@IOError{ ioe_filename = fp } fun h   = ioe { ioe_handle = Just h, ioe_location = fun, ioe_filename = filepath }@@ -322,18 +360,25 @@ -- has become unreferenced and then resurrected (arguably in the -- latter case we shouldn't finalize the Handle...).  Anyway, -- we try to emit a helpful message which is better than nothing.+--+-- [later; 8/2010] However, a program like this can yield a strange+-- error message:+--+--   main = writeFile "out" loop+--   loop = let x = x in x+--+-- because the main thread and the Handle are both unreachable at the+-- same time, the Handle may get finalized before the main thread+-- receives the NonTermination exception, and the exception handler+-- will then report an error.  We'd rather this was not an error and+-- the program just prints "<<loop>>".  handleFinalizer :: FilePath -> MVar Handle__ -> IO () handleFinalizer fp m = do   handle_ <- takeMVar m-  case haType handle_ of-      ClosedHandle -> return ()-      _ -> do flushWriteBuffer handle_ `catchAny` \_ -> return ()-                -- ignore errors and async exceptions, and close the-                -- descriptor anyway...-              _ <- hClose_handle_ handle_-              return ()-  putMVar m (ioe_finalizedHandle fp)+  (handle_', _) <- hClose_help handle_+  putMVar m handle_'+  return ()  -- --------------------------------------------------------------------------- -- Allocating buffers@@ -545,7 +590,7 @@  -- | like 'mkFileHandle', except that a 'Handle' is created with two -- independent buffers, one for reading and one for writing.  Used for--- full-dupliex streams, such as network sockets.+-- full-duplex streams, such as network sockets. mkDuplexHandle :: (IODevice dev, BufferedIO dev, Typeable dev) => dev                -> FilePath -> Maybe TextEncoding -> NewlineMode -> IO Handle mkDuplexHandle dev filepath mb_codec tr_newlines = do@@ -594,6 +639,11 @@                      return Nothing     cont mb_encoder mb_decoder +closeTextCodecs :: Handle__ -> IO ()+closeTextCodecs Handle__{..} = do+  case haDecoder of Nothing -> return (); Just d -> Encoding.close d+  case haEncoder of Nothing -> return (); Just d -> Encoding.close d+ -- --------------------------------------------------------------------------- -- closing Handles @@ -619,7 +669,7 @@ trymaybe io = (do io; return Nothing) `catchException` \e -> return (Just e)  hClose_handle_ :: Handle__ -> IO (Handle__, Maybe SomeException)-hClose_handle_ Handle__{..} = do+hClose_handle_ h_@Handle__{..} = do      -- close the file descriptor, but not when this is the read     -- side of a duplex handle.@@ -638,8 +688,7 @@     writeIORef haByteBuffer noByteBuffer        -- release our encoder/decoder-    case haDecoder of Nothing -> return (); Just d -> close d-    case haEncoder of Nothing -> return (); Just d -> close d+    closeTextCodecs h_      -- we must set the fd to -1, because the finalizer is going     -- to run eventually and try to close/unlock it.@@ -674,13 +723,12 @@ -- debugging  debugIO :: String -> IO ()-#if defined(DEBUG_DUMP)-debugIO s = do -  withCStringLen (s++"\n") $ \(p,len) -> c_write 1 (castPtr p) (fromIntegral len)-  return ()-#else-debugIO s = return ()-#endif+debugIO s+ | c_DEBUG_DUMP+    = do _ <- withCStringLen (s ++ "\n") $+                  \(p, len) -> c_write 1 (castPtr p) (fromIntegral len)+         return ()+ | otherwise = return ()  -- ---------------------------------------------------------------------------- -- Text input/output
GHC/IO/Handle/Text.hs view
@@ -22,7 +22,7 @@ module GHC.IO.Handle.Text (     hWaitForInput, hGetChar, hGetLine, hGetContents, hPutChar, hPutStr,    commitBuffer',       -- hack, see below-   hGetBuf, hGetBufNonBlocking, hPutBuf, hPutBufNonBlocking,+   hGetBuf, hGetBufSome, hGetBufNonBlocking, hPutBuf, hPutBufNonBlocking,    memcpy,  ) where @@ -63,7 +63,10 @@ -- | Computation 'hWaitForInput' @hdl t@ -- waits until input is available on handle @hdl@. -- It returns 'True' as soon as input is available on @hdl@,--- or 'False' if no input is available within @t@ milliseconds.+-- or 'False' if no input is available within @t@ milliseconds.  Note that+-- 'hWaitForInput' waits until one or more full /characters/ are available,+-- which means that it needs to do decoding, and hence may fail+-- with a decoding error. -- -- If @t@ is less than zero, then @hWaitForInput@ waits indefinitely. --@@ -71,10 +74,14 @@ -- --  * 'isEOFError' if the end of file has been reached. --+--  * a decoding error, if the input begins with an invalid byte sequence+--    in this Handle's encoding.+-- -- NOTE for GHC users: unless you use the @-threaded@ flag, -- @hWaitForInput t@ where @t >= 0@ will block all other Haskell -- threads for the duration of the call.  It behaves like a -- @safe@ foreign call in this respect.+--  hWaitForInput :: Handle -> Int -> IO Bool hWaitForInput h msecs = do@@ -161,9 +168,6 @@ -- --------------------------------------------------------------------------- -- hGetLine --- ToDo: the unbuffered case is wrong: it doesn't lock the handle for--- the duration.- -- | Computation 'hGetLine' @hdl@ reads a line from the file or -- channel managed by @hdl@. --@@ -793,9 +797,6 @@ -- It returns the number of bytes actually read.  This may be zero if -- EOF was reached before any data was read (or if @count@ is zero). ----- 'hGetBuf' ignores whatever 'TextEncoding' the 'Handle' is currently--- using, and reads bytes directly from the underlying IO device.--- -- 'hGetBuf' never raises an EOF exception, instead it returns a value -- smaller than @count@. --@@ -810,34 +811,24 @@   | count == 0 = return 0   | count <  0 = illegalBufferSize h "hGetBuf" count   | otherwise = -      wantReadableHandle_ "hGetBuf" h $ \ h_ -> do+      wantReadableHandle_ "hGetBuf" h $ \ h_@Handle__{..} -> do          flushCharReadBuffer h_-         bufRead h_ (castPtr ptr) 0 count+         buf@Buffer{ bufRaw=raw, bufR=w, bufL=r, bufSize=sz }+            <- readIORef haByteBuffer+         if isEmptyBuffer buf+            then bufReadEmpty    h_ buf (castPtr ptr) 0 count+            else bufReadNonEmpty h_ buf (castPtr ptr) 0 count  -- small reads go through the buffer, large reads are satisfied by -- taking data first from the buffer and then direct from the file -- descriptor.-bufRead :: Handle__ -> Ptr Word8 -> Int -> Int -> IO Int-bufRead h_@Handle__{..} ptr so_far count =-  seq so_far $ seq count $ do -- strictness hack-  buf@Buffer{ bufRaw=raw, bufR=w, bufL=r, bufSize=sz } <- readIORef haByteBuffer-  if isEmptyBuffer buf-     then if count > sz  -- small read?-                then do rest <- readChunk h_ ptr count-                        return (so_far + rest)-                else do (r,buf') <- Buffered.fillReadBuffer haDevice buf-                        if r == 0 -                           then return so_far-                           else do writeIORef haByteBuffer buf'-                                   bufRead h_ ptr so_far count-     else do ++bufReadNonEmpty :: Handle__ -> Buffer Word8 -> Ptr Word8 -> Int -> Int -> IO Int+bufReadNonEmpty h_@Handle__{..}+                buf@Buffer{ bufRaw=raw, bufR=w, bufL=r, bufSize=sz }+                ptr !so_far !count + = do         let avail = w - r-        if (count == avail)-           then do -                copyFromRawBuffer ptr raw r count-                writeIORef haByteBuffer buf{ bufR=0, bufL=0 }-                return (so_far + count)-           else do         if (count < avail)            then do                  copyFromRawBuffer ptr raw r count@@ -846,31 +837,85 @@            else do            copyFromRawBuffer ptr raw (fromIntegral r) (fromIntegral avail)-        writeIORef haByteBuffer buf{ bufR=0, bufL=0 }+        let buf' = buf{ bufR=0, bufL=0 }+        writeIORef haByteBuffer buf'         let remaining = count - avail             so_far' = so_far + avail             ptr' = ptr `plusPtr` avail -        if remaining < sz-           then bufRead h_ ptr' so_far' remaining-           else do +        if remaining == 0 +           then return so_far'+           else bufReadEmpty h_ buf' ptr' so_far' remaining -        rest <- readChunk h_ ptr' remaining-        return (so_far' + rest) -readChunk :: Handle__ -> Ptr a -> Int -> IO Int-readChunk h_@Handle__{..} ptr bytes- | Just fd <- cast haDevice = loop fd 0 bytes- | otherwise = error "ToDo: hGetBuf"+bufReadEmpty :: Handle__ -> Buffer Word8 -> Ptr Word8 -> Int -> Int -> IO Int+bufReadEmpty h_@Handle__{..}+             buf@Buffer{ bufRaw=raw, bufR=w, bufL=r, bufSize=sz }+             ptr so_far count+ | count > sz, Just fd <- cast haDevice = loop fd 0 count+ | otherwise = do+     (r,buf') <- Buffered.fillReadBuffer haDevice buf+     if r == 0 +        then return so_far+        else do writeIORef haByteBuffer buf'+                bufReadNonEmpty h_ buf' ptr so_far count  where   loop :: FD -> Int -> Int -> IO Int-  loop fd off bytes | bytes <= 0 = return off+  loop fd off bytes | bytes <= 0 = return (so_far + off)   loop fd off bytes = do     r <- RawIO.read (fd::FD) (ptr `plusPtr` off) (fromIntegral bytes)     if r == 0-        then return off+        then return (so_far + off)         else loop fd (off + r) (bytes - r) +-- ---------------------------------------------------------------------------+-- hGetBufSome++-- | 'hGetBufSome' @hdl buf count@ reads data from the handle @hdl@+-- into the buffer @buf@.  If there is any data available to read,+-- then 'hGetBufSome' returns it immediately; it only blocks if there+-- is no data to be read.+--+-- It returns the number of bytes actually read.  This may be zero if+-- EOF was reached before any data was read (or if @count@ is zero).+--+-- 'hGetBufSome' never raises an EOF exception, instead it returns a value+-- smaller than @count@.+--+-- If the handle is a pipe or socket, and the writing end+-- is closed, 'hGetBufSome' will behave as if EOF was reached.+--+-- 'hGetBufSome' ignores the prevailing 'TextEncoding' and 'NewlineMode'+-- on the 'Handle', and reads bytes directly.++hGetBufSome :: Handle -> Ptr a -> Int -> IO Int+hGetBufSome h ptr count+  | count == 0 = return 0+  | count <  0 = illegalBufferSize h "hGetBufSome" count+  | otherwise =+      wantReadableHandle_ "hGetBufSome" h $ \ h_@Handle__{..} -> do+         flushCharReadBuffer h_+         buf@Buffer{ bufSize=sz } <- readIORef haByteBuffer+         if isEmptyBuffer buf+            then if count > sz  -- large read?+                    then do RawIO.read (haFD h_) (castPtr ptr) count+                    else do (r,buf') <- Buffered.fillReadBuffer haDevice buf+                            if r == 0+                               then return 0+                               else do writeIORef haByteBuffer buf'+                                       bufReadNBNonEmpty h_ buf' (castPtr ptr) 0 (min r count)+                                        -- new count is  (min r count), so+                                        -- that bufReadNBNonEmpty will not+                                        -- issue another read.+            else+              bufReadNBEmpty h_ buf (castPtr ptr) 0 count++haFD :: Handle__ -> FD+haFD h_@Handle__{..} =+   case cast haDevice of+             Nothing -> error "not an FD"+             Just fd -> fd+ -- | 'hGetBufNonBlocking' @hdl buf count@ reads data from the handle @hdl@ -- into the buffer @buf@ until either EOF is reached, or -- @count@ 8-bit bytes have been read, or there is no more data available@@ -881,52 +926,60 @@ -- only whatever data is available.  To wait for data to arrive before -- calling 'hGetBufNonBlocking', use 'hWaitForInput'. ----- 'hGetBufNonBlocking' ignores whatever 'TextEncoding' the 'Handle'--- is currently using, and reads bytes directly from the underlying IO--- device.--- -- If the handle is a pipe or socket, and the writing end -- is closed, 'hGetBufNonBlocking' will behave as if EOF was reached. -- -- 'hGetBufNonBlocking' ignores the prevailing 'TextEncoding' and -- 'NewlineMode' on the 'Handle', and reads bytes directly.+--+-- NOTE: on Windows, this function does not work correctly; it+-- behaves identically to 'hGetBuf'.  hGetBufNonBlocking :: Handle -> Ptr a -> Int -> IO Int hGetBufNonBlocking h ptr count   | count == 0 = return 0   | count <  0 = illegalBufferSize h "hGetBufNonBlocking" count   | otherwise = -      wantReadableHandle_ "hGetBufNonBlocking" h $ \ h_ -> do+      wantReadableHandle_ "hGetBufNonBlocking" h $ \ h_@Handle__{..} -> do          flushCharReadBuffer h_-         bufReadNonBlocking h_ (castPtr ptr) 0 count+         buf@Buffer{ bufRaw=raw, bufR=w, bufL=r, bufSize=sz }+            <- readIORef haByteBuffer+         if isEmptyBuffer buf+            then bufReadNBEmpty    h_ buf (castPtr ptr) 0 count+            else bufReadNBNonEmpty h_ buf (castPtr ptr) 0 count -bufReadNonBlocking :: Handle__ -> Ptr Word8 -> Int -> Int -> IO Int-bufReadNonBlocking h_@Handle__{..} ptr so_far count = -  seq so_far $ seq count $ do -- strictness hack-  buf@Buffer{ bufRaw=raw, bufR=w, bufL=r, bufSize=sz } <- readIORef haByteBuffer-  if isEmptyBuffer buf-     then if count > sz  -- large read?-                then do rest <- readChunkNonBlocking h_ ptr count-                        return (so_far + rest)-                else do (r,buf') <- Buffered.fillReadBuffer0 haDevice buf-                        case r of-                          Nothing -> return so_far-                          Just 0  -> return so_far-                          Just r  -> do-                            writeIORef haByteBuffer buf'-                            bufReadNonBlocking h_ ptr so_far (min count r)-                                  -- NOTE: new count is    min count w'-                                  -- so we will just copy the contents of the-                                  -- buffer in the recursive call, and not-                                  -- loop again.-     else do+bufReadNBEmpty :: Handle__ -> Buffer Word8 -> Ptr Word8 -> Int -> Int -> IO Int+bufReadNBEmpty   h_@Handle__{..}+                 buf@Buffer{ bufRaw=raw, bufR=w, bufL=r, bufSize=sz }+                 ptr so_far count+  | count > sz,+    Just fd <- cast haDevice = do+       m <- RawIO.readNonBlocking (fd::FD) ptr count+       case m of+         Nothing -> return so_far+         Just n  -> return (so_far + n)++ | otherwise = do+     buf <- readIORef haByteBuffer+     (r,buf') <- Buffered.fillReadBuffer0 haDevice buf+     case r of+       Nothing -> return so_far+       Just 0  -> return so_far+       Just r  -> do+         writeIORef haByteBuffer buf'+         bufReadNBNonEmpty h_ buf' ptr so_far (min count r)+                          -- NOTE: new count is    min count r+                          -- so we will just copy the contents of the+                          -- buffer in the recursive call, and not+                          -- loop again.+++bufReadNBNonEmpty :: Handle__ -> Buffer Word8 -> Ptr Word8 -> Int -> Int -> IO Int+bufReadNBNonEmpty h_@Handle__{..}+                  buf@Buffer{ bufRaw=raw, bufR=w, bufL=r, bufSize=sz }+                  ptr so_far count+  = do         let avail = w - r-        if (count == avail)-           then do -                copyFromRawBuffer ptr raw r count-                writeIORef haByteBuffer buf{ bufR=0, bufL=0 }-                return (so_far + count)-           else do         if (count < avail)            then do                  copyFromRawBuffer ptr raw r count@@ -935,28 +988,15 @@            else do          copyFromRawBuffer ptr raw (fromIntegral r) (fromIntegral avail)-        writeIORef haByteBuffer buf{ bufR=0, bufL=0 }+        let buf' = buf{ bufR=0, bufL=0 }+        writeIORef haByteBuffer buf'         let remaining = count - avail             so_far' = so_far + avail             ptr' = ptr `plusPtr` avail -        -- we haven't attempted to read anything yet if we get to here.-        if remaining < sz-           then bufReadNonBlocking h_ ptr' so_far' remaining-           else do --        rest <- readChunkNonBlocking h_ ptr' remaining-        return (so_far' + rest)---readChunkNonBlocking :: Handle__ -> Ptr Word8 -> Int -> IO Int-readChunkNonBlocking h_@Handle__{..} ptr bytes- | Just fd <- cast haDevice = do-     m <- RawIO.readNonBlocking (fd::FD) ptr bytes-     case m of-       Nothing -> return 0-       Just n  -> return n- | otherwise = error "ToDo: hGetBuf"+        if remaining == 0+           then return so_far'+           else bufReadNBEmpty h_ buf' ptr' so_far' remaining  -- --------------------------------------------------------------------------- -- memcpy wrappers
GHC/IO/Handle/Types.hs view
@@ -86,15 +86,6 @@ -- enough information to identify the handle for debugging.  A handle is -- equal according to '==' only to itself; no attempt -- is made to compare the internal state of different handles for equality.------ GHC note: a 'Handle' will be automatically closed when the garbage--- collector detects that it has become unreferenced by the program.--- However, relying on this behaviour is not generally recommended:--- the garbage collector is unpredictable.  If possible, use explicit--- an explicit 'hClose' to close 'Handle's when they are no longer--- required.  GHC does not currently attempt to free up file--- descriptors when they have run out, it is your responsibility to--- ensure that this doesn't happen.  data Handle    = FileHandle                          -- A normal handle to a file@@ -325,7 +316,7 @@ -- | The representation of a newline in the external file or stream. data Newline = LF    -- ^ '\n'              | CRLF  -- ^ '\r\n'-             deriving Eq+             deriving (Eq, Ord, Read, Show)  -- | Specifies the translation, if any, of newline characters between -- internal Strings and the external file or stream.  Haskell Strings@@ -338,7 +329,7 @@                   outputNL :: Newline                     -- ^ the representation of newlines on output                  }-             deriving Eq+             deriving (Eq, Ord, Read, Show)  -- | The native newline representation for the current platform: 'LF' -- on Unix systems, 'CRLF' on Windows.
GHC/IO/IOMode.hs view
@@ -22,5 +22,6 @@ import GHC.Arr import GHC.Enum +-- | See 'System.IO.openFile' data IOMode      =  ReadMode | WriteMode | AppendMode | ReadWriteMode                     deriving (Eq, Ord, Ix, Enum, Read, Show)
GHC/Int.hs view
@@ -40,6 +40,7 @@ import GHC.Err import GHC.Word hiding (uncheckedShiftL64#, uncheckedShiftRL64#) import GHC.Show+import GHC.Float ()     -- for RealFrac methods  ------------------------------------------------------------------------ -- type Int8@@ -147,16 +148,42 @@     bitSize  _                = 8     isSigned _                = True -    {-# INLINE shiftR #-}-    -- same as the default definition, but we want it inlined (#2376)-    x `shiftR`  i = x `shift`  (-i)- {-# RULES "fromIntegral/Int8->Int8" fromIntegral = id :: Int8 -> Int8 "fromIntegral/a->Int8"    fromIntegral = \x -> case fromIntegral x of I# x# -> I8# (narrow8Int# x#) "fromIntegral/Int8->a"    fromIntegral = \(I8# x#) -> fromIntegral (I# x#)   #-} +{-# RULES+"properFraction/Float->(Int8,Float)"+    forall x. properFraction (x :: Float) =+                      case properFraction x of {+                        (n, y) -> ((fromIntegral :: Int -> Int8) n, y) }+"truncate/Float->Int8"+    forall x. truncate (x :: Float) = (fromIntegral :: Int -> Int8) (truncate x)+"floor/Float->Int8"+    forall x. floor    (x :: Float) = (fromIntegral :: Int -> Int8) (floor x)+"ceiling/Float->Int8"+    forall x. ceiling  (x :: Float) = (fromIntegral :: Int -> Int8) (ceiling x)+"round/Float->Int8"+    forall x. round    (x :: Float) = (fromIntegral :: Int -> Int8) (round x)+  #-}++{-# RULES+"properFraction/Double->(Int8,Double)"+    forall x. properFraction (x :: Double) =+                      case properFraction x of {+                        (n, y) -> ((fromIntegral :: Int -> Int8) n, y) }+"truncate/Double->Int8"+    forall x. truncate (x :: Double) = (fromIntegral :: Int -> Int8) (truncate x)+"floor/Double->Int8"+    forall x. floor    (x :: Double) = (fromIntegral :: Int -> Int8) (floor x)+"ceiling/Double->Int8"+    forall x. ceiling  (x :: Double) = (fromIntegral :: Int -> Int8) (ceiling x)+"round/Double->Int8"+    forall x. round    (x :: Double) = (fromIntegral :: Int -> Int8) (round x)+  #-}+ ------------------------------------------------------------------------ -- type Int16 ------------------------------------------------------------------------@@ -263,9 +290,6 @@     bitSize  _                 = 16     isSigned _                 = True -    {-# INLINE shiftR #-}-    -- same as the default definition, but we want it inlined (#2376)-    x `shiftR`  i = x `shift`  (-i)  {-# RULES "fromIntegral/Word8->Int16"  fromIntegral = \(W8# x#) -> I16# (word2Int# x#)@@ -275,6 +299,36 @@ "fromIntegral/Int16->a"      fromIntegral = \(I16# x#) -> fromIntegral (I# x#)   #-} +{-# RULES+"properFraction/Float->(Int16,Float)"+    forall x. properFraction (x :: Float) =+                      case properFraction x of {+                        (n, y) -> ((fromIntegral :: Int -> Int16) n, y) }+"truncate/Float->Int16"+    forall x. truncate (x :: Float) = (fromIntegral :: Int -> Int16) (truncate x)+"floor/Float->Int16"+    forall x. floor    (x :: Float) = (fromIntegral :: Int -> Int16) (floor x)+"ceiling/Float->Int16"+    forall x. ceiling  (x :: Float) = (fromIntegral :: Int -> Int16) (ceiling x)+"round/Float->Int16"+    forall x. round    (x :: Float) = (fromIntegral :: Int -> Int16) (round x)+  #-}++{-# RULES+"properFraction/Double->(Int16,Double)"+    forall x. properFraction (x :: Double) =+                      case properFraction x of {+                        (n, y) -> ((fromIntegral :: Int -> Int16) n, y) }+"truncate/Double->Int16"+    forall x. truncate (x :: Double) = (fromIntegral :: Int -> Int16) (truncate x)+"floor/Double->Int16"+    forall x. floor    (x :: Double) = (fromIntegral :: Int -> Int16) (floor x)+"ceiling/Double->Int16"+    forall x. ceiling  (x :: Double) = (fromIntegral :: Int -> Int16) (ceiling x)+"round/Double->Int16"+    forall x. round    (x :: Double) = (fromIntegral :: Int -> Int16) (round x)+  #-}+ ------------------------------------------------------------------------ -- type Int32 ------------------------------------------------------------------------@@ -399,9 +453,6 @@     bitSize  _                 = 32     isSigned _                 = True -    {-# INLINE shiftR #-}-    -- same as the default definition, but we want it inlined (#2376)-    x `shiftR`  i = x `shift`  (-i)  {-# RULES "fromIntegral/Int->Int32"    fromIntegral = \(I#   x#) -> I32# (intToInt32# x#)@@ -413,7 +464,8 @@ "fromIntegral/Int32->Int32"  fromIntegral = id :: Int32 -> Int32   #-} -#else +-- No rules for RealFrac methods if Int32 is larger than Int+#else  -- Int32 is represented in the same way as Int. #if WORD_SIZE_IN_BITS > 32@@ -512,10 +564,6 @@     bitSize  _                 = 32     isSigned _                 = True -    {-# INLINE shiftR #-}-    -- same as the default definition, but we want it inlined (#2376)-    x `shiftR`  i = x `shift`  (-i)- {-# RULES "fromIntegral/Word8->Int32"  fromIntegral = \(W8# x#) -> I32# (word2Int# x#) "fromIntegral/Word16->Int32" fromIntegral = \(W16# x#) -> I32# (word2Int# x#)@@ -526,8 +574,38 @@ "fromIntegral/Int32->a"      fromIntegral = \(I32# x#) -> fromIntegral (I# x#)   #-} -#endif +{-# RULES+"properFraction/Float->(Int32,Float)"+    forall x. properFraction (x :: Float) =+                      case properFraction x of {+                        (n, y) -> ((fromIntegral :: Int -> Int32) n, y) }+"truncate/Float->Int32"+    forall x. truncate (x :: Float) = (fromIntegral :: Int -> Int32) (truncate x)+"floor/Float->Int32"+    forall x. floor    (x :: Float) = (fromIntegral :: Int -> Int32) (floor x)+"ceiling/Float->Int32"+    forall x. ceiling  (x :: Float) = (fromIntegral :: Int -> Int32) (ceiling x)+"round/Float->Int32"+    forall x. round    (x :: Float) = (fromIntegral :: Int -> Int32) (round x)+  #-} +{-# RULES+"properFraction/Double->(Int32,Double)"+    forall x. properFraction (x :: Double) =+                      case properFraction x of {+                        (n, y) -> ((fromIntegral :: Int -> Int32) n, y) }+"truncate/Double->Int32"+    forall x. truncate (x :: Double) = (fromIntegral :: Int -> Int32) (truncate x)+"floor/Double->Int32"+    forall x. floor    (x :: Double) = (fromIntegral :: Int -> Int32) (floor x)+"ceiling/Double->Int32"+    forall x. ceiling  (x :: Double) = (fromIntegral :: Int -> Int32) (ceiling x)+"round/Double->Int32"+    forall x. round    (x :: Double) = (fromIntegral :: Int -> Int32) (round x)+  #-}++#endif+ instance Real Int32 where     toRational x = toInteger x % 1 @@ -661,11 +739,6 @@     bitSize  _                 = 64     isSigned _                 = True -    {-# INLINE shiftR #-}-    -- same as the default definition, but we want it inlined (#2376)-    x `shiftR`  i = x `shift`  (-i)-- -- give the 64-bit shift operations the same treatment as the 32-bit -- ones (see GHC.Base), namely we wrap them in tests to catch the -- cases when we're shifting more than 64 bits to avoid unspecified@@ -691,7 +764,9 @@ "fromIntegral/Int64->Int64"  fromIntegral = id :: Int64 -> Int64   #-} -#else +-- No RULES for RealFrac methods if Int is smaller than Int64, we can't+-- go through Int and whether going through Integer is faster is uncertain.+#else  -- Int64 is represented in the same way as Int. -- Operations may assume and must ensure that it holds only values@@ -779,13 +854,39 @@     bitSize  _                 = 64     isSigned _                 = True -    {-# INLINE shiftR #-}-    -- same as the default definition, but we want it inlined (#2376)-    x `shiftR`  i = x `shift`  (-i)- {-# RULES "fromIntegral/a->Int64" fromIntegral = \x -> case fromIntegral x of I# x# -> I64# x# "fromIntegral/Int64->a" fromIntegral = \(I64# x#) -> fromIntegral (I# x#)+  #-}++{-# RULES+"properFraction/Float->(Int64,Float)"+    forall x. properFraction (x :: Float) =+                      case properFraction x of {+                        (n, y) -> ((fromIntegral :: Int -> Int64) n, y) }+"truncate/Float->Int64"+    forall x. truncate (x :: Float) = (fromIntegral :: Int -> Int64) (truncate x)+"floor/Float->Int64"+    forall x. floor    (x :: Float) = (fromIntegral :: Int -> Int64) (floor x)+"ceiling/Float->Int64"+    forall x. ceiling  (x :: Float) = (fromIntegral :: Int -> Int64) (ceiling x)+"round/Float->Int64"+    forall x. round    (x :: Float) = (fromIntegral :: Int -> Int64) (round x)+  #-}++{-# RULES+"properFraction/Double->(Int64,Double)"+    forall x. properFraction (x :: Double) =+                      case properFraction x of {+                        (n, y) -> ((fromIntegral :: Int -> Int64) n, y) }+"truncate/Double->Int64"+    forall x. truncate (x :: Double) = (fromIntegral :: Int -> Int64) (truncate x)+"floor/Double->Int64"+    forall x. floor    (x :: Double) = (fromIntegral :: Int -> Int64) (floor x)+"ceiling/Double->Int64"+    forall x. ceiling  (x :: Double) = (fromIntegral :: Int -> Int64) (ceiling x)+"round/Double->Int64"+    forall x. round    (x :: Double) = (fromIntegral :: Int -> Int64) (round x)   #-}  uncheckedIShiftL64# :: Int# -> Int# -> Int#
GHC/List.lhs view
@@ -503,11 +503,15 @@ #endif  -- | Applied to a predicate and a list, 'any' determines if any element--- of the list satisfies the predicate.+-- of the list satisfies the predicate.  For the result to be+-- 'False', the list must be finite; 'True', however, results from a 'True'+-- value for the predicate applied to an element at a finite index of a finite or infinite list. any                     :: (a -> Bool) -> [a] -> Bool  -- | Applied to a predicate and a list, 'all' determines if all elements--- of the list satisfy the predicate.+-- of the list satisfy the predicate. For the result to be+-- 'True', the list must be finite; 'False', however, results from a 'False'+-- value for the predicate applied to an element at a finite index of a finite or infinite list. all                     :: (a -> Bool) -> [a] -> Bool #ifdef USE_REPORT_PRELUDE any p                   =  or . map p@@ -527,7 +531,8 @@ #endif  -- | 'elem' is the list membership predicate, usually written in infix form,--- e.g., @x \`elem\` xs@.+-- e.g., @x \`elem\` xs@.  For the result to be+-- 'False', the list must be finite; 'True', however, results from an element equal to @x@ found at a finite index of a finite or infinite list. elem                    :: (Eq a) => a -> [a] -> Bool  -- | 'notElem' is the negation of 'elem'.@@ -647,7 +652,7 @@  {-# INLINE [0] zipFB #-} zipFB :: ((a, b) -> c -> d) -> a -> b -> c -> d-zipFB c x y r = (x,y) `c` r+zipFB c = \x y r -> (x,y) `c` r  {-# RULES "zip"      [~1] forall xs ys. zip xs ys = build (\c n -> foldr2 (zipFB c) n xs ys)@@ -680,9 +685,11 @@ zipWith f (a:as) (b:bs) = f a b : zipWith f as bs zipWith _ _      _      = [] +-- zipWithFB must have arity 2 since it gets two arguments in the "zipWith"+-- rule; it might not get inlined otherwise {-# INLINE [0] zipWithFB #-} zipWithFB :: (a -> b -> c) -> (d -> e -> a) -> d -> e -> b -> c-zipWithFB c f x y r = (x `f` y) `c` r+zipWithFB c f = \x y r -> (x `f` y) `c` r  {-# RULES "zipWith"       [~1] forall f xs ys.    zipWith f xs ys = build (\c n -> foldr2 (zipWithFB c f) n xs ys)
GHC/Num.lhs view
@@ -1,5 +1,7 @@ \begin{code} {-# OPTIONS_GHC -XNoImplicitPrelude #-}+-- We believe we could deorphan this module, by moving lots of things+-- around, but we haven't got there yet: {-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_HADDOCK hide #-} -----------------------------------------------------------------------------@@ -7,7 +9,7 @@ -- Module      :  GHC.Num -- Copyright   :  (c) The University of Glasgow 1994-2002 -- License     :  see libraries/base/LICENSE--- +-- -- Maintainer  :  cvs-ghc@haskell.org -- Stability   :  internal -- Portability :  non-portable (GHC Extensions)@@ -41,7 +43,7 @@ infixl 7  * infixl 6  +, - -default ()              -- Double isn't available yet, +default ()              -- Double isn't available yet,                         -- and we shouldn't be using defaults anyway \end{code} @@ -62,7 +64,7 @@     -- | Absolute value.     abs                 :: a -> a     -- | Sign of a number.-    -- The functions 'abs' and 'signum' should satisfy the law: +    -- The functions 'abs' and 'signum' should satisfy the law:     --     -- > abs x * signum x == x     --@@ -75,6 +77,8 @@     -- so such literals have type @('Num' a) => a@.     fromInteger         :: Integer -> a +    {-# INLINE (-) #-}+    {-# INLINE negate #-}     x - y               = x + negate y     negate x            = 0 - x @@ -117,27 +121,6 @@ divModInt x@(I# _) y@(I# _) = (x `divInt` y, x `modInt` y)     -- Stricter.  Sorry if you don't like it.  (WDP 94/10) \end{code}--%*********************************************************-%*                                                      *-\subsection{The @Integer@ instances for @Eq@, @Ord@}-%*                                                      *-%*********************************************************--\begin{code}-instance  Eq Integer  where-    (==) = eqInteger-    (/=) = neqInteger---------------------------------------------------------------------------instance Ord Integer where-    (<=) = leInteger-    (>)  = gtInteger-    (<)  = ltInteger-    (>=) = geInteger-    compare = compareInteger-\end{code}-  %********************************************************* %*                                                      *
GHC/Pack.lhs view
@@ -37,7 +37,6 @@ import GHC.Base import GHC.List ( length ) import GHC.ST-import GHC.Num import GHC.Ptr  data ByteArray ix              = ByteArray        ix ix ByteArray#
GHC/Ptr.lhs view
@@ -79,7 +79,7 @@ -- a function type with zero or more arguments where -- -- * the argument types are /marshallable foreign types/,---   i.e. 'Char', 'Int', 'Prelude.Double', 'Prelude.Float',+--   i.e. 'Char', 'Int', 'Double', 'Float', --   'Bool', 'Data.Int.Int8', 'Data.Int.Int16', 'Data.Int.Int32', --   'Data.Int.Int64', 'Data.Word.Word8', 'Data.Word.Word16', --   'Data.Word.Word32', 'Data.Word.Word64', @'Ptr' a@, @'FunPtr' a@,@@ -87,7 +87,7 @@ --   using @newtype@. --  -- * the return type is either a marshallable foreign type or has the form---   @'Prelude.IO' t@ where @t@ is a marshallable foreign type or @()@.+--   @'IO' t@ where @t@ is a marshallable foreign type or @()@. -- -- A value of type @'FunPtr' a@ may be a pointer to a foreign function, -- either returned by another foreign function or imported with a
GHC/Read.lhs view
@@ -314,10 +314,15 @@ -- ^ Parse the specified lexeme and continue as specified. -- Esp useful for nullary constructors; e.g. --    @choose [(\"A\", return A), (\"B\", return B)]@+-- We match both Ident and Symbol because the constructor+-- might be an operator eg (:=:) choose sps = foldr ((+++) . try_one) pfail sps            where-             try_one (s,p) = do { L.Ident s' <- lexP ;-                                  if s == s' then p else pfail }+             try_one (s,p) = do { token <- lexP ;+                                  case token of+                                    L.Ident s'  | s==s' -> p+                                    L.Symbol s' | s==s' -> p+                                    _other              -> pfail } \end{code}  @@ -446,28 +451,28 @@ %*********************************************************  \begin{code}-readNumber :: Num a => (L.Lexeme -> Maybe a) -> ReadPrec a+readNumber :: Num a => (L.Lexeme -> ReadPrec a) -> ReadPrec a -- Read a signed number readNumber convert =   parens   ( do x <- lexP        case x of-         L.Symbol "-" -> do n <- readNumber convert+         L.Symbol "-" -> do y <- lexP+                            n <- convert y                             return (negate n)-       -         _   -> case convert x of-                   Just n  -> return n-                   Nothing -> pfail++         _   -> convert x   ) -convertInt :: Num a => L.Lexeme -> Maybe a-convertInt (L.Int i) = Just (fromInteger i)-convertInt _         = Nothing -convertFrac :: Fractional a => L.Lexeme -> Maybe a-convertFrac (L.Int i) = Just (fromInteger i)-convertFrac (L.Rat r) = Just (fromRational r)-convertFrac _         = Nothing+convertInt :: Num a => L.Lexeme -> ReadPrec a+convertInt (L.Int i) = return (fromInteger i)+convertInt _         = pfail++convertFrac :: Fractional a => L.Lexeme -> ReadPrec a+convertFrac (L.Int i) = return (fromInteger i)+convertFrac (L.Rat r) = return (fromRational r)+convertFrac _         = pfail  instance Read Int where   readPrec     = readNumber convertInt
GHC/Real.lhs view
@@ -6,7 +6,7 @@ -- Module      :  GHC.Real -- Copyright   :  (c) The University of Glasgow, 1994-2002 -- License     :  see libraries/base/LICENSE--- +-- -- Maintainer  :  cvs-ghc@haskell.org -- Stability   :  internal -- Portability :  non-portable (GHC Extensions)@@ -30,7 +30,7 @@ infixl 7  /, `quot`, `rem`, `div`, `mod` infixl 7  % -default ()              -- Double isn't available yet, +default ()              -- Double isn't available yet,                         -- and we shouldn't be using defaults anyway \end{code} @@ -58,8 +58,8 @@ infinity   = 1 :% 0 notANumber = 0 :% 0 --- Use :%, not % for Inf/NaN; the latter would --- immediately lead to a runtime error, because it normalises. +-- Use :%, not % for Inf/NaN; the latter would+-- immediately lead to a runtime error, because it normalises. \end{code}  @@ -133,10 +133,15 @@     -- | conversion to 'Integer'     toInteger           :: a -> Integer +    {-# INLINE quot #-}+    {-# INLINE rem #-}+    {-# INLINE div #-}+    {-# INLINE mod #-}     n `quot` d          =  q  where (q,_) = quotRem n d     n `rem` d           =  r  where (_,r) = quotRem n d     n `div` d           =  q  where (q,_) = divMod n d     n `mod` d           =  r  where (_,r) = divMod n d+     divMod n d          =  if signum r == negate (signum d) then (q-1, r+d) else qr                            where qr@(q,r) = quotRem n d @@ -154,6 +159,8 @@     -- @('Fractional' a) => a@.     fromRational        :: Rational -> a +    {-# INLINE recip #-}+    {-# INLINE (/) #-}     recip x             =  1 / x     x / y               = x * recip y @@ -182,8 +189,9 @@     -- | @'floor' x@ returns the greatest integer not greater than @x@     floor               :: (Integral b) => a -> b +    {-# INLINE truncate #-}     truncate x          =  m  where (m,_) = properFraction x-    +     round x             =  let (n,r) = properFraction x                                m     = if r < 0 then n - 1 else n + 1                            in case signum (abs r - 0.5) of@@ -191,10 +199,10 @@                                 0  -> if even n then n else m                                 1  -> m                                 _  -> error "round default defn: Bad value"-    +     ceiling x           =  if r > 0 then n + 1 else n                            where (n,r) = properFraction x-    +     floor x             =  if r < 0 then n - 1 else n                            where (n,r) = properFraction x \end{code}@@ -320,11 +328,15 @@     signum (x:%_)       =  signum x :% 1     fromInteger x       =  fromInteger x :% 1 +{-# RULES "fromRational/id" fromRational = id :: Rational -> Rational #-} instance  (Integral a)  => Fractional (Ratio a)  where     {-# SPECIALIZE instance Fractional Rational #-}     (x:%y) / (x':%y')   =  (x*y') % (y*x')-    recip (x:%y)        =  y % x-    fromRational (x:%y) =  fromInteger x :% fromInteger y+    recip (0:%_)        = error "Ratio.%: zero denominator"+    recip (x:%y)+        | x < 0         = negate y :% negate x+        | otherwise     = y :% x+    fromRational (x:%y) =  fromInteger x % fromInteger y  instance  (Integral a)  => Real (Ratio a)  where     {-# SPECIALIZE instance Real Rational #-}@@ -338,7 +350,7 @@ instance  (Integral a)  => Show (Ratio a)  where     {-# SPECIALIZE instance Show Rational #-}     showsPrec p (x:%y)  =  showParen (p > ratioPrec) $-                           showsPrec ratioPrec1 x . +                           showsPrec ratioPrec1 x .                            showString " % " .                            -- H98 report has spaces round the %                            -- but we removed them [May 04]@@ -398,7 +410,7 @@   -> Int                -- ^ the precedence of the enclosing context   -> a                  -- ^ the value to show   -> ShowS-showSigned showPos p x +showSigned showPos p x    | x < 0     = showParen (p > 6) (showChar '-' . showPos (-x))    | otherwise = showPos x @@ -426,12 +438,68 @@                   | otherwise = g (x * x) ((y - 1) `quot` 2) (x * z)  -- | raise a number to an integral power-{-# SPECIALISE (^^) ::-        Rational -> Int -> Rational #-} (^^)            :: (Fractional a, Integral b) => a -> b -> a x ^^ n          =  if n >= 0 then x^n else recip (x^(negate n)) +-------------------------------------------------------+-- Special power functions for Rational+--+-- see #4337+--+-- Rationale:+-- For a legitimate Rational (n :% d), the numerator and denominator are+-- coprime, i.e. they have no common prime factor.+-- Therefore all powers (n ^ a) and (d ^ b) are also coprime, so it is+-- not necessary to compute the greatest common divisor, which would be+-- done in the default implementation at each multiplication step.+-- Since exponentiation quickly leads to very large numbers and+-- calculation of gcds is generally very slow for large numbers,+-- avoiding the gcd leads to an order of magnitude speedup relatively+-- soon (and an asymptotic improvement overall).+--+-- Note:+-- We cannot use these functions for general Ratio a because that would+-- change results in a multitude of cases.+-- The cause is that if a and b are coprime, their remainders by any+-- positive modulus generally aren't, so in the default implementation+-- reduction occurs.+--+-- Example:+-- (17 % 3) ^ 3 :: Ratio Word8+-- Default:+-- (17 % 3) ^ 3 = ((17 % 3) ^ 2) * (17 % 3)+--              = ((289 `mod` 256) % 9) * (17 % 3)+--              = (33 % 9) * (17 % 3)+--              = (11 % 3) * (17 % 3)+--              = (187 % 9)+-- But:+-- ((17^3) `mod` 256) % (3^3)   = (4913 `mod` 256) % 27+--                              = 49 % 27+--+-- TODO:+-- Find out whether special-casing for numerator, denominator or+-- exponent = 1 (or -1, where that may apply) gains something. +-- Special version of (^) for Rational base+{-# RULES "(^)/Rational"    (^) = (^%^) #-}+(^%^)           :: Integral a => Rational -> a -> Rational+(n :% d) ^%^ e+    | e < 0     = error "Negative exponent"+    | e == 0    = 1 :% 1+    | otherwise = (n ^ e) :% (d ^ e)++-- Special version of (^^) for Rational base+{-# RULES "(^^)/Rational"   (^^) = (^^%^^) #-}+(^^%^^)         :: Integral a => Rational -> a -> Rational+(n :% d) ^^%^^ e+    | e > 0     = (n ^ e) :% (d ^ e)+    | e == 0    = 1 :% 1+    | n > 0     = (d ^ (negate e)) :% (n ^ (negate e))+    | n == 0    = error "Ratio.%: zero denominator"+    | otherwise = let nn = d ^ (negate e)+                      dd = (negate n) ^ (negate e)+                  in if even e then (nn :% dd) else (negate nn :% dd)+ ------------------------------------------------------- -- | @'gcd' x y@ is the greatest (positive) integer that divides both @x@ -- and @y@; for example @'gcd' (-3) 6@ = @3@, @'gcd' (-3) (-6)@ = @3@,@@ -456,9 +524,6 @@ "lcm/Integer->Integer->Integer" lcm = lcmInteger  #-} --- XXX to use another Integer implementation, you might need to disable--- the gcd/Integer and lcm/Integer RULES above--- gcdInteger' :: Integer -> Integer -> Integer gcdInteger' 0 0 = error "GHC.Real.gcdInteger': gcd 0 0 is undefined" gcdInteger' a b = gcdInteger a b
GHC/ST.lhs view
@@ -20,7 +20,6 @@  import GHC.Base import GHC.Show-import GHC.Num  default () \end{code}
GHC/Unicode.hs view
@@ -31,7 +31,6 @@ import GHC.Base import GHC.Real        (fromIntegral) import Foreign.C.Types (CInt)-import GHC.Num         (fromInteger)  #include "HsBaseConfig.h" @@ -63,8 +62,8 @@ -- (letters, numbers, marks, punctuation, symbols and spaces). isPrint                 :: Char -> Bool --- | Selects white-space characters in the Latin-1 range.--- (In Unicode terms, this includes spaces and some control characters.)+-- | Returns 'True' for any Unicode space character, and the control+-- characters @\\t@, @\\n@, @\\r@, @\\f@, @\\v@. isSpace                 :: Char -> Bool -- isSpace includes non-breaking space -- Done with explicit equalities both for efficiency, and to avoid a tiresome
GHC/Word.hs view
@@ -42,6 +42,7 @@ import GHC.Arr import GHC.Show import GHC.Err+import GHC.Float ()     -- for RealFrac methods  ------------------------------------------------------------------------ -- Helper functions@@ -181,16 +182,16 @@     bitSize  _               = WORD_SIZE_IN_BITS     isSigned _               = False -    {-# INLINE shiftR #-}-    -- same as the default definition, but we want it inlined (#2376)-    x `shiftR`  i = x `shift`  (-i)- {-# RULES "fromIntegral/Int->Word"  fromIntegral = \(I# x#) -> W# (int2Word# x#) "fromIntegral/Word->Int"  fromIntegral = \(W# x#) -> I# (word2Int# x#) "fromIntegral/Word->Word" fromIntegral = id :: Word -> Word   #-} +-- No RULES for RealFrac unfortunately.+-- Going through Int isn't possible because Word's range is not+-- included in Int's, going through Integer may or may not be slower.+ ------------------------------------------------------------------------ -- type Word8 ------------------------------------------------------------------------@@ -285,10 +286,6 @@     bitSize  _                = 8     isSigned _                = False -    {-# INLINE shiftR #-}-    -- same as the default definition, but we want it inlined (#2376)-    x `shiftR`  i = x `shift`  (-i)- {-# RULES "fromIntegral/Word8->Word8"   fromIntegral = id :: Word8 -> Word8 "fromIntegral/Word8->Integer" fromIntegral = toInteger :: Word8 -> Integer@@ -296,6 +293,36 @@ "fromIntegral/Word8->a"       fromIntegral = \(W8# x#) -> fromIntegral (W# x#)   #-} +{-# RULES+"properFraction/Float->(Word8,Float)"+    forall x. properFraction (x :: Float) =+                      case properFraction x of {+                        (n, y) -> ((fromIntegral :: Int -> Word8) n, y) }+"truncate/Float->Word8"+    forall x. truncate (x :: Float) = (fromIntegral :: Int -> Word8) (truncate x)+"floor/Float->Word8"+    forall x. floor    (x :: Float) = (fromIntegral :: Int -> Word8) (floor x)+"ceiling/Float->Word8"+    forall x. ceiling  (x :: Float) = (fromIntegral :: Int -> Word8) (ceiling x)+"round/Float->Word8"+    forall x. round    (x :: Float) = (fromIntegral :: Int -> Word8) (round x)+  #-}++{-# RULES+"properFraction/Double->(Word8,Double)"+    forall x. properFraction (x :: Double) =+                      case properFraction x of {+                        (n, y) -> ((fromIntegral :: Int -> Word8) n, y) }+"truncate/Double->Word8"+    forall x. truncate (x :: Double) = (fromIntegral :: Int -> Word8) (truncate x)+"floor/Double->Word8"+    forall x. floor    (x :: Double) = (fromIntegral :: Int -> Word8) (floor x)+"ceiling/Double->Word8"+    forall x. ceiling  (x :: Double) = (fromIntegral :: Int -> Word8) (ceiling x)+"round/Double->Word8"+    forall x. round    (x :: Double) = (fromIntegral :: Int -> Word8) (round x)+  #-}+ ------------------------------------------------------------------------ -- type Word16 ------------------------------------------------------------------------@@ -390,10 +417,6 @@     bitSize  _                = 16     isSigned _                = False -    {-# INLINE shiftR #-}-    -- same as the default definition, but we want it inlined (#2376)-    x `shiftR`  i = x `shift`  (-i)- {-# RULES "fromIntegral/Word8->Word16"   fromIntegral = \(W8# x#) -> W16# x# "fromIntegral/Word16->Word16"  fromIntegral = id :: Word16 -> Word16@@ -402,6 +425,36 @@ "fromIntegral/Word16->a"       fromIntegral = \(W16# x#) -> fromIntegral (W# x#)   #-} +{-# RULES+"properFraction/Float->(Word16,Float)"+    forall x. properFraction (x :: Float) =+                      case properFraction x of {+                        (n, y) -> ((fromIntegral :: Int -> Word16) n, y) }+"truncate/Float->Word16"+    forall x. truncate (x :: Float) = (fromIntegral :: Int -> Word16) (truncate x)+"floor/Float->Word16"+    forall x. floor    (x :: Float) = (fromIntegral :: Int -> Word16) (floor x)+"ceiling/Float->Word16"+    forall x. ceiling  (x :: Float) = (fromIntegral :: Int -> Word16) (ceiling x)+"round/Float->Word16"+    forall x. round    (x :: Float) = (fromIntegral :: Int -> Word16) (round x)+  #-}++{-# RULES+"properFraction/Double->(Word16,Double)"+    forall x. properFraction (x :: Double) =+                      case properFraction x of {+                        (n, y) -> ((fromIntegral :: Int -> Word16) n, y) }+"truncate/Double->Word16"+    forall x. truncate (x :: Double) = (fromIntegral :: Int -> Word16) (truncate x)+"floor/Double->Word16"+    forall x. floor    (x :: Double) = (fromIntegral :: Int -> Word16) (floor x)+"ceiling/Double->Word16"+    forall x. ceiling  (x :: Double) = (fromIntegral :: Int -> Word16) (ceiling x)+"round/Double->Word16"+    forall x. round    (x :: Double) = (fromIntegral :: Int -> Word16) (round x)+  #-}+ ------------------------------------------------------------------------ -- type Word32 ------------------------------------------------------------------------@@ -493,10 +546,6 @@     bitSize  _                = 32     isSigned _                = False -    {-# INLINE shiftR #-}-    -- same as the default definition, but we want it inlined (#2376)-    x `shiftR`  i = x `shift`  (-i)- {-# RULES "fromIntegral/Int->Word32"    fromIntegral = \(I#   x#) -> W32# (int32ToWord32# (intToInt32# x#)) "fromIntegral/Word->Word32"   fromIntegral = \(W#   x#) -> W32# (wordToWord32# x#)@@ -511,6 +560,39 @@ #if WORD_SIZE_IN_BITS > 32 -- Operations may assume and must ensure that it holds only values -- from its logical range.++-- We can use rewrite rules for the RealFrac methods++{-# RULES+"properFraction/Float->(Word32,Float)"+    forall x. properFraction (x :: Float) =+                      case properFraction x of {+                        (n, y) -> ((fromIntegral :: Int -> Word32) n, y) }+"truncate/Float->Word32"+    forall x. truncate (x :: Float) = (fromIntegral :: Int -> Word32) (truncate x)+"floor/Float->Word32"+    forall x. floor    (x :: Float) = (fromIntegral :: Int -> Word32) (floor x)+"ceiling/Float->Word32"+    forall x. ceiling  (x :: Float) = (fromIntegral :: Int -> Word32) (ceiling x)+"round/Float->Word32"+    forall x. round    (x :: Float) = (fromIntegral :: Int -> Word32) (round x)+  #-}++{-# RULES+"properFraction/Double->(Word32,Double)"+    forall x. properFraction (x :: Double) =+                      case properFraction x of {+                        (n, y) -> ((fromIntegral :: Int -> Word32) n, y) }+"truncate/Double->Word32"+    forall x. truncate (x :: Double) = (fromIntegral :: Int -> Word32) (truncate x)+"floor/Double->Word32"+    forall x. floor    (x :: Double) = (fromIntegral :: Int -> Word32) (floor x)+"ceiling/Double->Word32"+    forall x. ceiling  (x :: Double) = (fromIntegral :: Int -> Word32) (ceiling x)+"round/Double->Word32"+    forall x. round    (x :: Double) = (fromIntegral :: Int -> Word32) (round x)+  #-}+ #endif  data Word32 = W32# Word# deriving (Eq, Ord)@@ -604,10 +686,6 @@     bitSize  _                = 32     isSigned _                = False -    {-# INLINE shiftR #-}-    -- same as the default definition, but we want it inlined (#2376)-    x `shiftR`  i = x `shift`  (-i)- {-# RULES "fromIntegral/Word8->Word32"   fromIntegral = \(W8# x#) -> W32# x# "fromIntegral/Word16->Word32"  fromIntegral = \(W16# x#) -> W32# x#@@ -734,10 +812,6 @@     bitSize  _                = 64     isSigned _                = False -    {-# INLINE shiftR #-}-    -- same as the default definition, but we want it inlined (#2376)-    x `shiftR`  i = x `shift`  (-i)- -- give the 64-bit shift operations the same treatment as the 32-bit -- ones (see GHC.Base), namely we wrap them in tests to catch the -- cases when we're shifting more than 64 bits to avoid unspecified@@ -841,10 +915,6 @@         !i'# = word2Int# (int2Word# i# `and#` int2Word# 63#)     bitSize  _                = 64     isSigned _                = False--    {-# INLINE shiftR #-}-    -- same as the default definition, but we want it inlined (#2376)-    x `shiftR`  i = x `shift`  (-i)  {-# RULES "fromIntegral/a->Word64" fromIntegral = \x -> case fromIntegral x of W# x# -> W64# x#
System/CPUTime.hsc view
@@ -31,8 +31,11 @@ #endif  #ifdef __GLASGOW_HASKELL__-import Foreign+import Foreign hiding (unsafePerformIO) import Foreign.C+#if !defined(CLK_TCK)+import System.IO.Unsafe (unsafePerformIO)+#endif  #include "HsBaseConfig.h" 
+ System/Event.hs view
@@ -0,0 +1,35 @@+module System.Event+    ( -- * Types+      EventManager++      -- * Creation+    , new++      -- * Running+    , loop++    -- ** Stepwise running+    , step+    , shutdown++      -- * Registering interest in I/O events+    , Event+    , evtRead+    , evtWrite+    , IOCallback+    , FdKey(keyFd)+    , registerFd+    , registerFd_+    , unregisterFd+    , unregisterFd_+    , fdWasClosed++      -- * Registering interest in timeout events+    , TimeoutCallback+    , TimeoutKey+    , registerTimeout+    , updateTimeout+    , unregisterTimeout+    ) where++import System.Event.Manager
+ System/Event/Array.hs view
@@ -0,0 +1,313 @@+{-# LANGUAGE BangPatterns, CPP, ForeignFunctionInterface, NoImplicitPrelude #-}++module System.Event.Array+    (+      Array+    , capacity+    , clear+    , concat+    , copy+    , duplicate+    , empty+    , ensureCapacity+    , findIndex+    , forM_+    , length+    , loop+    , new+    , removeAt+    , snoc+    , unsafeLoad+    , unsafeRead+    , unsafeWrite+    , useAsPtr+    ) where++import Control.Monad hiding (forM_)+import Data.Bits ((.|.), shiftR)+import Data.IORef (IORef, atomicModifyIORef, newIORef, readIORef, writeIORef)+import Data.Maybe+import Foreign.C.Types (CSize)+import Foreign.ForeignPtr (ForeignPtr, withForeignPtr)+import Foreign.Ptr (Ptr, nullPtr, plusPtr)+import Foreign.Storable (Storable(..))+import GHC.Base+import GHC.Err (undefined)+import GHC.ForeignPtr (mallocPlainForeignPtrBytes, newForeignPtr_)+import GHC.Num (Num(..))+import GHC.Real (fromIntegral)+import GHC.Show (show)++#include "MachDeps.h"++#define BOUNDS_CHECKING 1++#if defined(BOUNDS_CHECKING)+-- This fugly hack is brought by GHC's apparent reluctance to deal+-- with MagicHash and UnboxedTuples when inferring types. Eek!+#define CHECK_BOUNDS(_func_,_len_,_k_) \+if (_k_) < 0 || (_k_) >= (_len_) then error ("System.Event.Array." ++ (_func_) ++ ": bounds error, index " ++ show (_k_) ++ ", capacity " ++ show (_len_)) else+#else+#define CHECK_BOUNDS(_func_,_len_,_k_)+#endif++-- Invariant: size <= capacity+newtype Array a = Array (IORef (AC a))++-- The actual array content.+data AC a = AC+    !(ForeignPtr a)  -- Elements+    !Int      -- Number of elements (length)+    !Int      -- Maximum number of elements (capacity)++empty :: IO (Array a)+empty = do+  p <- newForeignPtr_ nullPtr+  Array `fmap` newIORef (AC p 0 0)++allocArray :: Storable a => Int -> IO (ForeignPtr a)+allocArray n = allocHack undefined+ where+  allocHack :: Storable a => a -> IO (ForeignPtr a)+  allocHack dummy = mallocPlainForeignPtrBytes (n * sizeOf dummy)++reallocArray :: Storable a => ForeignPtr a -> Int -> Int -> IO (ForeignPtr a)+reallocArray p newSize oldSize = reallocHack undefined p+ where+  reallocHack :: Storable a => a -> ForeignPtr a -> IO (ForeignPtr a)+  reallocHack dummy src = do+      let size = sizeOf dummy+      dst <- mallocPlainForeignPtrBytes (newSize * size)+      withForeignPtr src $ \s ->+        when (s /= nullPtr && oldSize > 0) .+          withForeignPtr dst $ \d -> do+            _ <- memcpy d s (fromIntegral (oldSize * size))+            return ()+      return dst++new :: Storable a => Int -> IO (Array a)+new c = do+    es <- allocArray cap+    fmap Array (newIORef (AC es 0 cap))+  where+    cap = firstPowerOf2 c++duplicate :: Storable a => Array a -> IO (Array a)+duplicate a = dupHack undefined a+ where+  dupHack :: Storable b => b -> Array b -> IO (Array b)+  dupHack dummy (Array ref) = do+    AC es len cap <- readIORef ref+    ary <- allocArray cap+    withForeignPtr ary $ \dest ->+      withForeignPtr es $ \src -> do+        _ <- memcpy dest src (fromIntegral (len * sizeOf dummy))+        return ()+    Array `fmap` newIORef (AC ary len cap)++length :: Array a -> IO Int+length (Array ref) = do+    AC _ len _ <- readIORef ref+    return len++capacity :: Array a -> IO Int+capacity (Array ref) = do+    AC _ _ cap <- readIORef ref+    return cap++unsafeRead :: Storable a => Array a -> Int -> IO a+unsafeRead (Array ref) ix = do+    AC es _ cap <- readIORef ref+    CHECK_BOUNDS("unsafeRead",cap,ix)+      withForeignPtr es $ \p ->+        peekElemOff p ix++unsafeWrite :: Storable a => Array a -> Int -> a -> IO ()+unsafeWrite (Array ref) ix a = do+    ac <- readIORef ref+    unsafeWrite' ac ix a++unsafeWrite' :: Storable a => AC a -> Int -> a -> IO ()+unsafeWrite' (AC es _ cap) ix a = do+    CHECK_BOUNDS("unsafeWrite'",cap,ix)+      withForeignPtr es $ \p ->+        pokeElemOff p ix a++unsafeLoad :: Storable a => Array a -> (Ptr a -> Int -> IO Int) -> IO Int+unsafeLoad (Array ref) load = do+    AC es _ cap <- readIORef ref+    len' <- withForeignPtr es $ \p -> load p cap+    writeIORef ref (AC es len' cap)+    return len'++ensureCapacity :: Storable a => Array a -> Int -> IO ()+ensureCapacity (Array ref) c = do+    ac@(AC _ _ cap) <- readIORef ref+    ac'@(AC _ _ cap') <- ensureCapacity' ac c+    when (cap' /= cap) $+      writeIORef ref ac'++ensureCapacity' :: Storable a => AC a -> Int -> IO (AC a)+ensureCapacity' ac@(AC es len cap) c = do+    if c > cap+      then do+        es' <- reallocArray es cap' cap+        return (AC es' len cap')+      else+        return ac+  where+    cap' = firstPowerOf2 c++useAsPtr :: Array a -> (Ptr a -> Int -> IO b) -> IO b+useAsPtr (Array ref) f = do+    AC es len _ <- readIORef ref+    withForeignPtr es $ \p -> f p len++snoc :: Storable a => Array a -> a -> IO ()+snoc (Array ref) e = do+    ac@(AC _ len _) <- readIORef ref+    let len' = len + 1+    ac'@(AC es _ cap) <- ensureCapacity' ac len'+    unsafeWrite' ac' len e+    writeIORef ref (AC es len' cap)++clear :: Storable a => Array a -> IO ()+clear (Array ref) = do+  !_ <- atomicModifyIORef ref $ \(AC es _ cap) ->+        let e = AC es 0 cap in (e, e)+  return ()++forM_ :: Storable a => Array a -> (a -> IO ()) -> IO ()+forM_ ary g = forHack ary g undefined+  where+    forHack :: Storable b => Array b -> (b -> IO ()) -> b -> IO ()+    forHack (Array ref) f dummy = do+      AC es len _ <- readIORef ref+      let size = sizeOf dummy+          offset = len * size+      withForeignPtr es $ \p -> do+        let go n | n >= offset = return ()+                 | otherwise = do+              f =<< peek (p `plusPtr` n)+              go (n + size)+        go 0++loop :: Storable a => Array a -> b -> (b -> a -> IO (b,Bool)) -> IO ()+loop ary z g = loopHack ary z g undefined+  where+    loopHack :: Storable b => Array b -> c -> (c -> b -> IO (c,Bool)) -> b+             -> IO ()+    loopHack (Array ref) y f dummy = do+      AC es len _ <- readIORef ref+      let size = sizeOf dummy+          offset = len * size+      withForeignPtr es $ \p -> do+        let go n k+                | n >= offset = return ()+                | otherwise = do+                      (k',cont) <- f k =<< peek (p `plusPtr` n)+                      when cont $ go (n + size) k'+        go 0 y++findIndex :: Storable a => (a -> Bool) -> Array a -> IO (Maybe (Int,a))+findIndex = findHack undefined+ where+  findHack :: Storable b => b -> (b -> Bool) -> Array b -> IO (Maybe (Int,b))+  findHack dummy p (Array ref) = do+    AC es len _ <- readIORef ref+    let size   = sizeOf dummy+        offset = len * size+    withForeignPtr es $ \ptr ->+      let go !n !i+            | n >= offset = return Nothing+            | otherwise = do+                val <- peek (ptr `plusPtr` n)+                if p val+                  then return $ Just (i, val)+                  else go (n + size) (i + 1)+      in  go 0 0++concat :: Storable a => Array a -> Array a -> IO ()+concat (Array d) (Array s) = do+  da@(AC _ dlen _) <- readIORef d+  sa@(AC _ slen _) <- readIORef s+  writeIORef d =<< copy' da dlen sa 0 slen++-- | Copy part of the source array into the destination array. The+-- destination array is resized if not large enough.+copy :: Storable a => Array a -> Int -> Array a -> Int -> Int -> IO ()+copy (Array d) dstart (Array s) sstart maxCount = do+  da <- readIORef d+  sa <- readIORef s+  writeIORef d =<< copy' da dstart sa sstart maxCount++-- | Copy part of the source array into the destination array. The+-- destination array is resized if not large enough.+copy' :: Storable a => AC a -> Int -> AC a -> Int -> Int -> IO (AC a)+copy' d dstart s sstart maxCount = copyHack d s undefined+ where+  copyHack :: Storable b => AC b -> AC b -> b -> IO (AC b)+  copyHack dac@(AC _ oldLen _) (AC src slen _) dummy = do+    when (maxCount < 0 || dstart < 0 || dstart > oldLen || sstart < 0 ||+          sstart > slen) $ error "copy: bad offsets or lengths"+    let size = sizeOf dummy+        count = min maxCount (slen - sstart)+    if count == 0+      then return dac+      else do+        AC dst dlen dcap <- ensureCapacity' dac (dstart + count)+        withForeignPtr dst $ \dptr ->+          withForeignPtr src $ \sptr -> do+            _ <- memcpy (dptr `plusPtr` (dstart * size))+                        (sptr `plusPtr` (sstart * size))+                        (fromIntegral (count * size))+            return $ AC dst (max dlen (dstart + count)) dcap++removeAt :: Storable a => Array a -> Int -> IO ()+removeAt a i = removeHack a undefined+ where+  removeHack :: Storable b => Array b -> b -> IO ()+  removeHack (Array ary) dummy = do+    AC fp oldLen cap <- readIORef ary+    when (i < 0 || i >= oldLen) $ error "removeAt: invalid index"+    let size   = sizeOf dummy+        newLen = oldLen - 1+    when (newLen > 0 && i < newLen) .+      withForeignPtr fp $ \ptr -> do+        _ <- memmove (ptr `plusPtr` (size * i))+                     (ptr `plusPtr` (size * (i+1)))+                     (fromIntegral (size * (newLen-i)))+        return ()+    writeIORef ary (AC fp newLen cap)++{-The firstPowerOf2 function works by setting all bits on the right-hand+side of the most significant flagged bit to 1, and then incrementing+the entire value at the end so it "rolls over" to the nearest power of+two.+-}++-- | Computes the next-highest power of two for a particular integer,+-- @n@.  If @n@ is already a power of two, returns @n@.  If @n@ is+-- zero, returns zero, even though zero is not a power of two.+firstPowerOf2 :: Int -> Int+firstPowerOf2 !n =+    let !n1 = n - 1+        !n2 = n1 .|. (n1 `shiftR` 1)+        !n3 = n2 .|. (n2 `shiftR` 2)+        !n4 = n3 .|. (n3 `shiftR` 4)+        !n5 = n4 .|. (n4 `shiftR` 8)+        !n6 = n5 .|. (n5 `shiftR` 16)+#if WORD_SIZE_IN_BITS == 32+    in n6 + 1+#elif WORD_SIZE_IN_BITS == 64+        !n7 = n6 .|. (n6 `shiftR` 32)+    in n7 + 1+#else+# error firstPowerOf2 not defined on this architecture+#endif++foreign import ccall unsafe "string.h memcpy"+    memcpy :: Ptr a -> Ptr a -> CSize -> IO (Ptr a)++foreign import ccall unsafe "string.h memmove"+    memmove :: Ptr a -> Ptr a -> CSize -> IO (Ptr a)
+ System/Event/Clock.hsc view
@@ -0,0 +1,48 @@+{-# LANGUAGE ForeignFunctionInterface #-}++module System.Event.Clock (getCurrentTime) where++#include <sys/time.h>++import Foreign (Ptr, Storable(..), nullPtr, with)+import Foreign.C.Error (throwErrnoIfMinus1_)+import Foreign.C.Types (CInt, CLong)+import GHC.Base+import GHC.Err+import GHC.Num+import GHC.Real++-- TODO: Implement this for Windows.++-- | Return the current time, in seconds since Jan. 1, 1970.+getCurrentTime :: IO Double+getCurrentTime = do+    tv <- with (CTimeval 0 0) $ \tvptr -> do+        throwErrnoIfMinus1_ "gettimeofday" (gettimeofday tvptr nullPtr)+        peek tvptr+    let !t = fromIntegral (sec tv) + fromIntegral (usec tv) / 1000000.0+    return t++------------------------------------------------------------------------+-- FFI binding++data CTimeval = CTimeval+    { sec  :: {-# UNPACK #-} !CLong+    , usec :: {-# UNPACK #-} !CLong+    }++instance Storable CTimeval where+    sizeOf _ = #size struct timeval+    alignment _ = alignment (undefined :: CLong)++    peek ptr = do+        sec' <- #{peek struct timeval, tv_sec} ptr+        usec' <- #{peek struct timeval, tv_usec} ptr+        return $ CTimeval sec' usec'++    poke ptr tv = do+        #{poke struct timeval, tv_sec} ptr (sec tv)+        #{poke struct timeval, tv_usec} ptr (usec tv)++foreign import ccall unsafe "sys/time.h gettimeofday" gettimeofday+    :: Ptr CTimeval -> Ptr () -> IO CInt
+ System/Event/Control.hs view
@@ -0,0 +1,210 @@+{-# LANGUAGE CPP, ForeignFunctionInterface, NoImplicitPrelude,+    ScopedTypeVariables #-}++module System.Event.Control+    (+    -- * Managing the IO manager+      Signal+    , ControlMessage(..)+    , Control+    , newControl+    , closeControl+    -- ** Control message reception+    , readControlMessage+    -- *** File descriptors+    , controlReadFd+    , wakeupReadFd+    -- ** Control message sending+    , sendWakeup+    , sendDie+    -- * Utilities+    , setNonBlockingFD+    ) where++#include "EventConfig.h"++import Control.Monad (when)+import Foreign.ForeignPtr (ForeignPtr)+import GHC.Base+import GHC.Conc.Signal (Signal)+import GHC.Real (fromIntegral)+import GHC.Show (Show)+import GHC.Word (Word8)+import Foreign.C.Error (throwErrnoIfMinus1_)+import Foreign.C.Types (CInt, CSize)+import Foreign.ForeignPtr (mallocForeignPtrBytes, withForeignPtr)+import Foreign.Marshal (alloca, allocaBytes)+import Foreign.Marshal.Array (allocaArray)+import Foreign.Ptr (castPtr)+import Foreign.Storable (peek, peekElemOff, poke)+import System.Posix.Internals (c_close, c_pipe, c_read, c_write,+                               setCloseOnExec, setNonBlockingFD)+import System.Posix.Types (Fd)++#if defined(HAVE_EVENTFD)+import Data.Word (Word64)+import Foreign.C.Error (throwErrnoIfMinus1)+#else+import Foreign.C.Error (eAGAIN, eWOULDBLOCK, getErrno, throwErrno)+#endif++data ControlMessage = CMsgWakeup+                    | CMsgDie+                    | CMsgSignal {-# UNPACK #-} !(ForeignPtr Word8)+                                 {-# UNPACK #-} !Signal+    deriving (Eq, Show)++-- | The structure used to tell the IO manager thread what to do.+data Control = W {+      controlReadFd  :: {-# UNPACK #-} !Fd+    , controlWriteFd :: {-# UNPACK #-} !Fd+#if defined(HAVE_EVENTFD)+    , controlEventFd :: {-# UNPACK #-} !Fd+#else+    , wakeupReadFd   :: {-# UNPACK #-} !Fd+    , wakeupWriteFd  :: {-# UNPACK #-} !Fd+#endif+    } deriving (Show)++#if defined(HAVE_EVENTFD)+wakeupReadFd :: Control -> Fd+wakeupReadFd = controlEventFd+{-# INLINE wakeupReadFd #-}+#endif++setNonBlock :: CInt -> IO ()+setNonBlock fd =+#if __GLASGOW_HASKELL__ >= 611+  setNonBlockingFD fd True+#else+  setNonBlockingFD fd+#endif++-- | Create the structure (usually a pipe) used for waking up the IO+-- manager thread from another thread.+newControl :: IO Control+newControl = allocaArray 2 $ \fds -> do+  let createPipe = do+        throwErrnoIfMinus1_ "pipe" $ c_pipe fds+        rd <- peekElemOff fds 0+        wr <- peekElemOff fds 1+        -- The write end must be non-blocking, since we may need to+        -- poke the event manager from a signal handler.+        setNonBlock wr+        setCloseOnExec rd+        setCloseOnExec wr+        return (rd, wr)+  (ctrl_rd, ctrl_wr) <- createPipe+  c_setIOManagerControlFd ctrl_wr+#if defined(HAVE_EVENTFD)+  ev <- throwErrnoIfMinus1 "eventfd" $ c_eventfd 0 0+  setNonBlock ev+  setCloseOnExec ev+  c_setIOManagerWakeupFd ev+#else+  (wake_rd, wake_wr) <- createPipe+  c_setIOManagerWakeupFd wake_wr+#endif+  return W { controlReadFd  = fromIntegral ctrl_rd+           , controlWriteFd = fromIntegral ctrl_wr+#if defined(HAVE_EVENTFD)+           , controlEventFd = fromIntegral ev+#else+           , wakeupReadFd   = fromIntegral wake_rd+           , wakeupWriteFd  = fromIntegral wake_wr+#endif+           }++-- | Close the control structure used by the IO manager thread.+closeControl :: Control -> IO ()+closeControl w = do+  _ <- c_close . fromIntegral . controlReadFd $ w+  _ <- c_close . fromIntegral . controlWriteFd $ w+#if defined(HAVE_EVENTFD)+  _ <- c_close . fromIntegral . controlEventFd $ w+#else+  _ <- c_close . fromIntegral . wakeupReadFd $ w+  _ <- c_close . fromIntegral . wakeupWriteFd $ w+#endif+  return ()++io_MANAGER_WAKEUP, io_MANAGER_DIE :: Word8+io_MANAGER_WAKEUP = 0xff+io_MANAGER_DIE    = 0xfe++foreign import ccall "__hscore_sizeof_siginfo_t"+    sizeof_siginfo_t :: CSize++readControlMessage :: Control -> Fd -> IO ControlMessage+readControlMessage ctrl fd+    | fd == wakeupReadFd ctrl = allocaBytes wakeupBufferSize $ \p -> do+                    throwErrnoIfMinus1_ "readWakeupMessage" $+                      c_read (fromIntegral fd) p (fromIntegral wakeupBufferSize)+                    return CMsgWakeup+    | otherwise =+        alloca $ \p -> do+            throwErrnoIfMinus1_ "readControlMessage" $+                c_read (fromIntegral fd) p 1+            s <- peek p+            case s of+                -- Wakeup messages shouldn't be sent on the control+                -- file descriptor but we handle them anyway.+                _ | s == io_MANAGER_WAKEUP -> return CMsgWakeup+                _ | s == io_MANAGER_DIE    -> return CMsgDie+                _ -> do  -- Signal+                    fp <- mallocForeignPtrBytes (fromIntegral sizeof_siginfo_t)+                    withForeignPtr fp $ \p_siginfo -> do+                        r <- c_read (fromIntegral fd) (castPtr p_siginfo)+                             sizeof_siginfo_t+                        when (r /= fromIntegral sizeof_siginfo_t) $+                            error "failed to read siginfo_t"+                        let !s' = fromIntegral s+                        return $ CMsgSignal fp s'++  where wakeupBufferSize =+#if defined(HAVE_EVENTFD)+            8+#else+            4096+#endif++sendWakeup :: Control -> IO ()+#if defined(HAVE_EVENTFD)+sendWakeup c = alloca $ \p -> do+  poke p (1 :: Word64)+  throwErrnoIfMinus1_ "sendWakeup" $+    c_write (fromIntegral (controlEventFd c)) (castPtr p) 8+#else+sendWakeup c = do+  n <- sendMessage (wakeupWriteFd c) CMsgWakeup+  case n of+    _ | n /= -1   -> return ()+      | otherwise -> do+                   errno <- getErrno+                   when (errno /= eAGAIN && errno /= eWOULDBLOCK) $+                     throwErrno "sendWakeup"+#endif++sendDie :: Control -> IO ()+sendDie c = throwErrnoIfMinus1_ "sendDie" $+            sendMessage (controlWriteFd c) CMsgDie++sendMessage :: Fd -> ControlMessage -> IO Int+sendMessage fd msg = alloca $ \p -> do+  case msg of+    CMsgWakeup        -> poke p io_MANAGER_WAKEUP+    CMsgDie           -> poke p io_MANAGER_DIE+    CMsgSignal _fp _s -> error "Signals can only be sent from within the RTS"+  fromIntegral `fmap` c_write (fromIntegral fd) p 1++#if defined(HAVE_EVENTFD)+foreign import ccall unsafe "sys/eventfd.h eventfd"+   c_eventfd :: CInt -> CInt -> IO CInt+#endif++-- Used to tell the RTS how it can send messages to the I/O manager.+foreign import ccall "setIOManagerControlFd"+   c_setIOManagerControlFd :: CInt -> IO ()++foreign import ccall "setIOManagerWakeupFd"+   c_setIOManagerWakeupFd :: CInt -> IO ()
+ System/Event/EPoll.hsc view
@@ -0,0 +1,213 @@+{-# LANGUAGE ForeignFunctionInterface, GeneralizedNewtypeDeriving,+    NoImplicitPrelude #-}++--+-- | A binding to the epoll I/O event notification facility+--+-- epoll is a variant of poll that can be used either as an edge-triggered or+-- a level-triggered interface and scales well to large numbers of watched file+-- descriptors.+--+-- epoll decouples monitor an fd from the process of registering it.+--+module System.Event.EPoll+    (+      new+    , available+    ) where++import qualified System.Event.Internal as E++#include "EventConfig.h"+#if !defined(HAVE_EPOLL)+import GHC.Base++new :: IO E.Backend+new = error "EPoll back end not implemented for this platform"++available :: Bool+available = False+{-# INLINE available #-}+#else++#include <sys/epoll.h>++import Control.Monad (when)+import Data.Bits (Bits, (.|.), (.&.))+import Data.Monoid (Monoid(..))+import Data.Word (Word32)+import Foreign.C.Error (throwErrnoIfMinus1, throwErrnoIfMinus1_)+import Foreign.C.Types (CInt)+import Foreign.Marshal.Utils (with)+import Foreign.Ptr (Ptr)+import Foreign.Storable (Storable(..))+import GHC.Base+import GHC.Err (undefined)+import GHC.Num (Num(..))+import GHC.Real (ceiling, fromIntegral)+import GHC.Show (Show)+import System.Posix.Internals (c_close)+#if !defined(HAVE_EPOLL_CREATE1)+import System.Posix.Internals (setCloseOnExec)+#endif+import System.Posix.Types (Fd(..))++import qualified System.Event.Array    as A+import           System.Event.Internal (Timeout(..))++available :: Bool+available = True+{-# INLINE available #-}++data EPoll = EPoll {+      epollFd     :: {-# UNPACK #-} !EPollFd+    , epollEvents :: {-# UNPACK #-} !(A.Array Event)+    }++-- | Create a new epoll backend.+new :: IO E.Backend+new = do+  epfd <- epollCreate+  evts <- A.new 64+  let !be = E.backend poll modifyFd delete (EPoll epfd evts)+  return be++delete :: EPoll -> IO ()+delete be = do+  _ <- c_close . fromEPollFd . epollFd $ be+  return ()++-- | Change the set of events we are interested in for a given file+-- descriptor.+modifyFd :: EPoll -> Fd -> E.Event -> E.Event -> IO ()+modifyFd ep fd oevt nevt = with (Event (fromEvent nevt) fd) $+                             epollControl (epollFd ep) op fd+  where op | oevt == mempty = controlOpAdd+           | nevt == mempty = controlOpDelete+           | otherwise      = controlOpModify++-- | Select a set of file descriptors which are ready for I/O+-- operations and call @f@ for all ready file descriptors, passing the+-- events that are ready.+poll :: EPoll                     -- ^ state+     -> Timeout                   -- ^ timeout in milliseconds+     -> (Fd -> E.Event -> IO ())  -- ^ I/O callback+     -> IO ()+poll ep timeout f = do+  let events = epollEvents ep++  -- Will return zero if the system call was interupted, in which case+  -- we just return (and try again later.)+  n <- A.unsafeLoad events $ \es cap ->+       epollWait (epollFd ep) es cap $ fromTimeout timeout++  when (n > 0) $ do+    A.forM_ events $ \e -> f (eventFd e) (toEvent (eventTypes e))+    cap <- A.capacity events+    when (cap == n) $ A.ensureCapacity events (2 * cap)++newtype EPollFd = EPollFd {+      fromEPollFd :: CInt+    } deriving (Eq, Show)++data Event = Event {+      eventTypes :: EventType+    , eventFd    :: Fd+    } deriving (Show)++instance Storable Event where+    sizeOf    _ = #size struct epoll_event+    alignment _ = alignment (undefined :: CInt)++    peek ptr = do+        ets <- #{peek struct epoll_event, events} ptr+        ed  <- #{peek struct epoll_event, data.fd}   ptr+        let !ev = Event (EventType ets) ed+        return ev++    poke ptr e = do+        #{poke struct epoll_event, events} ptr (unEventType $ eventTypes e)+        #{poke struct epoll_event, data.fd}   ptr (eventFd e)++newtype ControlOp = ControlOp CInt++#{enum ControlOp, ControlOp+ , controlOpAdd    = EPOLL_CTL_ADD+ , controlOpModify = EPOLL_CTL_MOD+ , controlOpDelete = EPOLL_CTL_DEL+ }++newtype EventType = EventType {+      unEventType :: Word32+    } deriving (Show, Eq, Num, Bits)++#{enum EventType, EventType+ , epollIn  = EPOLLIN+ , epollOut = EPOLLOUT+ , epollErr = EPOLLERR+ , epollHup = EPOLLHUP+ }++-- | Create a new epoll context, returning a file descriptor associated with the context.+-- The fd may be used for subsequent calls to this epoll context.+--+-- The size parameter to epoll_create is a hint about the expected number of handles.+--+-- The file descriptor returned from epoll_create() should be destroyed via+-- a call to close() after polling is finished+--+epollCreate :: IO EPollFd+epollCreate = do+  fd <- throwErrnoIfMinus1 "epollCreate" $+#if defined(HAVE_EPOLL_CREATE1)+        c_epoll_create1 (#const EPOLL_CLOEXEC)+#else+        c_epoll_create 256 -- argument is ignored+  setCloseOnExec fd+#endif+  let !epollFd' = EPollFd fd+  return epollFd'++epollControl :: EPollFd -> ControlOp -> Fd -> Ptr Event -> IO ()+epollControl (EPollFd epfd) (ControlOp op) (Fd fd) event =+    throwErrnoIfMinus1_ "epollControl" $ c_epoll_ctl epfd op fd event++epollWait :: EPollFd -> Ptr Event -> Int -> Int -> IO Int+epollWait (EPollFd epfd) events numEvents timeout =+    fmap fromIntegral .+    E.throwErrnoIfMinus1NoRetry "epollWait" $+    c_epoll_wait epfd events (fromIntegral numEvents) (fromIntegral timeout)++fromEvent :: E.Event -> EventType+fromEvent e = remap E.evtRead  epollIn .|.+              remap E.evtWrite epollOut+  where remap evt to+            | e `E.eventIs` evt = to+            | otherwise         = 0++toEvent :: EventType -> E.Event+toEvent e = remap (epollIn  .|. epollErr .|. epollHup) E.evtRead `mappend`+            remap (epollOut .|. epollErr .|. epollHup) E.evtWrite+  where remap evt to+            | e .&. evt /= 0 = to+            | otherwise      = mempty++fromTimeout :: Timeout -> Int+fromTimeout Forever     = -1+fromTimeout (Timeout s) = ceiling $ 1000 * s++#if defined(HAVE_EPOLL_CREATE1)+foreign import ccall unsafe "sys/epoll.h epoll_create1"+    c_epoll_create1 :: CInt -> IO CInt+#else+foreign import ccall unsafe "sys/epoll.h epoll_create"+    c_epoll_create :: CInt -> IO CInt+#endif++foreign import ccall unsafe "sys/epoll.h epoll_ctl"+    c_epoll_ctl :: CInt -> CInt -> CInt -> Ptr Event -> IO CInt++foreign import ccall safe "sys/epoll.h epoll_wait"+    c_epoll_wait :: CInt -> Ptr Event -> CInt -> CInt -> IO CInt++#endif /* defined(HAVE_EPOLL) */
+ System/Event/IntMap.hs view
@@ -0,0 +1,374 @@+{-# LANGUAGE CPP, MagicHash, NoImplicitPrelude #-}+-----------------------------------------------------------------------------+-- |+-- Module      :  System.Event.IntMap+-- Copyright   :  (c) Daan Leijen 2002+--                (c) Andriy Palamarchuk 2008+-- License     :  BSD-style+-- Maintainer  :  libraries@haskell.org+-- Stability   :  provisional+-- Portability :  portable+--+-- An efficient implementation of maps from integer keys to values.+--+-- Since many function names (but not the type name) clash with+-- "Prelude" names, this module is usually imported @qualified@, e.g.+--+-- >  import Data.IntMap (IntMap)+-- >  import qualified Data.IntMap as IntMap+--+-- The implementation is based on /big-endian patricia trees/.  This data+-- structure performs especially well on binary operations like 'union'+-- and 'intersection'.  However, my benchmarks show that it is also+-- (much) faster on insertions and deletions when compared to a generic+-- size-balanced map implementation (see "Data.Map").+--+--    * Chris Okasaki and Andy Gill,  \"/Fast Mergeable Integer Maps/\",+--      Workshop on ML, September 1998, pages 77-86,+--      <http://citeseer.ist.psu.edu/okasaki98fast.html>+--+--    * D.R. Morrison, \"/PATRICIA -- Practical Algorithm To Retrieve+--      Information Coded In Alphanumeric/\", Journal of the ACM, 15(4),+--      October 1968, pages 514-534.+--+-- Operation comments contain the operation time complexity in+-- the Big-O notation <http://en.wikipedia.org/wiki/Big_O_notation>.+-- Many operations have a worst-case complexity of /O(min(n,W))/.+-- This means that the operation can become linear in the number of+-- elements with a maximum of /W/ -- the number of bits in an 'Int'+-- (32 or 64).+-----------------------------------------------------------------------------++module System.Event.IntMap+    (+    -- * Map type+    IntMap+    , Key++    -- * Query+    , lookup+    , member++    -- * Construction+    , empty++    -- * Insertion+    , insertWith++    -- * Delete\/Update+    , delete+    , updateWith++    -- * Traversal+    -- ** Fold+    , foldWithKey++    -- * Conversion+    , keys+    ) where++import Data.Bits++import Data.Maybe (Maybe(..))+import GHC.Base hiding (foldr)+import GHC.Num (Num(..))+import GHC.Real (fromIntegral)+import GHC.Show (Show(showsPrec), showParen, shows, showString)++#if __GLASGOW_HASKELL__+import GHC.Word (Word(..))+#else+import Data.Word+#endif++-- | A @Nat@ is a natural machine word (an unsigned Int)+type Nat = Word++natFromInt :: Key -> Nat+natFromInt i = fromIntegral i++intFromNat :: Nat -> Key+intFromNat w = fromIntegral w++shiftRL :: Nat -> Key -> Nat+#if __GLASGOW_HASKELL__+-- GHC: use unboxing to get @shiftRL@ inlined.+shiftRL (W# x) (I# i) = W# (shiftRL# x i)+#else+shiftRL x i = shiftR x i+#endif++------------------------------------------------------------------------+-- Types++-- | A map of integers to values @a@.+data IntMap a = Nil+              | Tip {-# UNPACK #-} !Key !a+              | Bin {-# UNPACK #-} !Prefix+                    {-# UNPACK #-} !Mask+                    !(IntMap a)+                    !(IntMap a)++type Prefix = Int+type Mask   = Int+type Key    = Int++------------------------------------------------------------------------+-- Query++-- | /O(min(n,W))/ Lookup the value at a key in the map.  See also+-- 'Data.Map.lookup'.+lookup :: Key -> IntMap a -> Maybe a+lookup k t = let nk = natFromInt k in seq nk (lookupN nk t)++lookupN :: Nat -> IntMap a -> Maybe a+lookupN k t+  = case t of+      Bin _ m l r+        | zeroN k (natFromInt m) -> lookupN k l+        | otherwise              -> lookupN k r+      Tip kx x+        | (k == natFromInt kx)  -> Just x+        | otherwise             -> Nothing+      Nil -> Nothing++-- | /O(min(n,W))/. Is the key a member of the map?+--+-- > member 5 (fromList [(5,'a'), (3,'b')]) == True+-- > member 1 (fromList [(5,'a'), (3,'b')]) == False++member :: Key -> IntMap a -> Bool+member k m+  = case lookup k m of+      Nothing -> False+      Just _  -> True++------------------------------------------------------------------------+-- Construction++-- | /O(1)/ The empty map.+--+-- > empty      == fromList []+-- > size empty == 0+empty :: IntMap a+empty = Nil++------------------------------------------------------------------------+-- Insert++-- | /O(min(n,W))/ Insert with a function, combining new value and old+-- value.  @insertWith f key value mp@ will insert the pair (key,+-- value) into @mp@ if key does not exist in the map.  If the key does+-- exist, the function will insert the pair (key, f new_value+-- old_value).  The result is a pair where the first element is the+-- old value, if one was present, and the second is the modified map.+insertWith :: (a -> a -> a) -> Key -> a -> IntMap a -> (Maybe a, IntMap a)+insertWith f k x t = case t of+    Bin p m l r+        | nomatch k p m -> (Nothing, join k (Tip k x) p t)+        | zero k m      -> let (found, l') = insertWith f k x l+                           in (found, Bin p m l' r)+        | otherwise     -> let (found, r') = insertWith f k x r+                           in (found, Bin p m l r')+    Tip ky y+        | k == ky       -> (Just y, Tip k (f x y))+        | otherwise     -> (Nothing, join k (Tip k x) ky t)+    Nil                 -> (Nothing, Tip k x)+++------------------------------------------------------------------------+-- Delete/Update++-- | /O(min(n,W))/. Delete a key and its value from the map.  When the+-- key is not a member of the map, the original map is returned.  The+-- result is a pair where the first element is the value associated+-- with the deleted key, if one existed, and the second element is the+-- modified map.+delete :: Key -> IntMap a -> (Maybe a, IntMap a)+delete k t = case t of+   Bin p m l r+        | nomatch k p m -> (Nothing, t)+        | zero k m      -> let (found, l') = delete k l+                           in (found, bin p m l' r)+        | otherwise     -> let (found, r') = delete k r+                           in (found, bin p m l r')+   Tip ky y+        | k == ky       -> (Just y, Nil)+        | otherwise     -> (Nothing, t)+   Nil                  -> (Nothing, Nil)++updateWith :: (a -> Maybe a) -> Key -> IntMap a -> (Maybe a, IntMap a)+updateWith f k t = case t of+    Bin p m l r+        | nomatch k p m -> (Nothing, t)+        | zero k m      -> let (found, l') = updateWith f k l+                           in (found, bin p m l' r)+        | otherwise     -> let (found, r') = updateWith f k r+                           in (found, bin p m l r')+    Tip ky y+        | k == ky       -> case (f y) of+                               Just y' -> (Just y, Tip ky y')+                               Nothing -> (Just y, Nil)+        | otherwise     -> (Nothing, t)+    Nil                 -> (Nothing, Nil)+-- | /O(n)/. Fold the keys and values in the map, such that+-- @'foldWithKey' f z == 'Prelude.foldr' ('uncurry' f) z . 'toAscList'@.+-- For example,+--+-- > keys map = foldWithKey (\k x ks -> k:ks) [] map+--+-- > let f k a result = result ++ "(" ++ (show k) ++ ":" ++ a ++ ")"+-- > foldWithKey f "Map: " (fromList [(5,"a"), (3,"b")]) == "Map: (5:a)(3:b)"++foldWithKey :: (Key -> a -> b -> b) -> b -> IntMap a -> b+foldWithKey f z t+  = foldr f z t++-- | /O(n)/. Convert the map to a list of key\/value pairs.+--+-- > toList (fromList [(5,"a"), (3,"b")]) == [(3,"b"), (5,"a")]+-- > toList empty == []++toList :: IntMap a -> [(Key,a)]+toList t+  = foldWithKey (\k x xs -> (k,x):xs) [] t++foldr :: (Key -> a -> b -> b) -> b -> IntMap a -> b+foldr f z t+  = case t of+      Bin 0 m l r | m < 0 -> foldr' f (foldr' f z l) r  -- put negative numbers before.+      Bin _ _ _ _ -> foldr' f z t+      Tip k x     -> f k x z+      Nil         -> z++foldr' :: (Key -> a -> b -> b) -> b -> IntMap a -> b+foldr' f z t+  = case t of+      Bin _ _ l r -> foldr' f (foldr' f z r) l+      Tip k x     -> f k x z+      Nil         -> z++-- | /O(n)/. Return all keys of the map in ascending order.+--+-- > keys (fromList [(5,"a"), (3,"b")]) == [3,5]+-- > keys empty == []++keys  :: IntMap a -> [Key]+keys m+  = foldWithKey (\k _ ks -> k:ks) [] m++------------------------------------------------------------------------+-- Eq++instance Eq a => Eq (IntMap a) where+    t1 == t2 = equal t1 t2+    t1 /= t2 = nequal t1 t2++equal :: Eq a => IntMap a -> IntMap a -> Bool+equal (Bin p1 m1 l1 r1) (Bin p2 m2 l2 r2)+    = (m1 == m2) && (p1 == p2) && (equal l1 l2) && (equal r1 r2)+equal (Tip kx x) (Tip ky y)+    = (kx == ky) && (x==y)+equal Nil Nil = True+equal _   _   = False++nequal :: Eq a => IntMap a -> IntMap a -> Bool+nequal (Bin p1 m1 l1 r1) (Bin p2 m2 l2 r2)+    = (m1 /= m2) || (p1 /= p2) || (nequal l1 l2) || (nequal r1 r2)+nequal (Tip kx x) (Tip ky y)+    = (kx /= ky) || (x/=y)+nequal Nil Nil = False+nequal _   _   = True++instance Show a => Show (IntMap a) where+  showsPrec d m   = showParen (d > 10) $+    showString "fromList " . shows (toList m)++------------------------------------------------------------------------+-- Utility functions++join :: Prefix -> IntMap a -> Prefix -> IntMap a -> IntMap a+join p1 t1 p2 t2+  | zero p1 m = Bin p m t1 t2+  | otherwise = Bin p m t2 t1+  where+    m = branchMask p1 p2+    p = mask p1 m++-- | @bin@ assures that we never have empty trees within a tree.+bin :: Prefix -> Mask -> IntMap a -> IntMap a -> IntMap a+bin _ _ l Nil = l+bin _ _ Nil r = r+bin p m l r   = Bin p m l r++------------------------------------------------------------------------+-- Endian independent bit twiddling++zero :: Key -> Mask -> Bool+zero i m = (natFromInt i) .&. (natFromInt m) == 0++nomatch :: Key -> Prefix -> Mask -> Bool+nomatch i p m = (mask i m) /= p++mask :: Key -> Mask -> Prefix+mask i m = maskW (natFromInt i) (natFromInt m)++zeroN :: Nat -> Nat -> Bool+zeroN i m = (i .&. m) == 0++------------------------------------------------------------------------+-- Big endian operations++maskW :: Nat -> Nat -> Prefix+maskW i m = intFromNat (i .&. (complement (m-1) `xor` m))++branchMask :: Prefix -> Prefix -> Mask+branchMask p1 p2+    = intFromNat (highestBitMask (natFromInt p1 `xor` natFromInt p2))++{-+Finding the highest bit mask in a word [x] can be done efficiently in+three ways:++* convert to a floating point value and the mantissa tells us the+  [log2(x)] that corresponds with the highest bit position. The mantissa+  is retrieved either via the standard C function [frexp] or by some bit+  twiddling on IEEE compatible numbers (float). Note that one needs to+  use at least [double] precision for an accurate mantissa of 32 bit+  numbers.++* use bit twiddling, a logarithmic sequence of bitwise or's and shifts (bit).++* use processor specific assembler instruction (asm).++The most portable way would be [bit], but is it efficient enough?+I have measured the cycle counts of the different methods on an AMD+Athlon-XP 1800 (~ Pentium III 1.8Ghz) using the RDTSC instruction:++highestBitMask: method  cycles+                --------------+                 frexp   200+                 float    33+                 bit      11+                 asm      12++Wow, the bit twiddling is on today's RISC like machines even faster+than a single CISC instruction (BSR)!+-}++-- | @highestBitMask@ returns a word where only the highest bit is+-- set.  It is found by first setting all bits in lower positions than+-- the highest bit and than taking an exclusive or with the original+-- value.  Allthough the function may look expensive, GHC compiles+-- this into excellent C code that subsequently compiled into highly+-- efficient machine code. The algorithm is derived from Jorg Arndt's+-- FXT library.+highestBitMask :: Nat -> Nat+highestBitMask x0+  = case (x0 .|. shiftRL x0 1) of+     x1 -> case (x1 .|. shiftRL x1 2) of+      x2 -> case (x2 .|. shiftRL x2 4) of+       x3 -> case (x3 .|. shiftRL x3 8) of+        x4 -> case (x4 .|. shiftRL x4 16) of+         x5 -> case (x5 .|. shiftRL x5 32) of   -- for 64 bit platforms+          x6 -> (x6 `xor` (shiftRL x6 1))
+ System/Event/Internal.hs view
@@ -0,0 +1,129 @@+{-# LANGUAGE ExistentialQuantification, NoImplicitPrelude #-}++module System.Event.Internal+    (+    -- * Event back end+      Backend+    , backend+    , delete+    , poll+    , modifyFd+    -- * Event type+    , Event+    , evtRead+    , evtWrite+    , eventIs+    -- * Timeout type+    , Timeout(..)+    -- * Helpers+    , throwErrnoIfMinus1NoRetry+    ) where++import Data.Bits ((.|.), (.&.))+import Data.List (foldl', intercalate)+import Data.Monoid (Monoid(..))+import Foreign.C.Error (eINTR, getErrno, throwErrno)+import System.Posix.Types (Fd)+import GHC.Base+import GHC.Num (Num(..))+import GHC.Show (Show(..))+import GHC.List (filter, null)++-- | An I/O event.+newtype Event = Event Int+    deriving (Eq)++evtNothing :: Event+evtNothing = Event 0+{-# INLINE evtNothing #-}++evtRead :: Event+evtRead = Event 1+{-# INLINE evtRead #-}++evtWrite :: Event+evtWrite = Event 2+{-# INLINE evtWrite #-}++eventIs :: Event -> Event -> Bool+eventIs (Event a) (Event b) = a .&. b /= 0++instance Show Event where+    show e = '[' : (intercalate "," . filter (not . null) $+                    [evtRead `so` "evtRead", evtWrite `so` "evtWrite"]) ++ "]"+        where ev `so` disp | e `eventIs` ev = disp+                           | otherwise      = ""++instance Monoid Event where+    mempty  = evtNothing+    mappend = evtCombine+    mconcat = evtConcat++evtCombine :: Event -> Event -> Event+evtCombine (Event a) (Event b) = Event (a .|. b)+{-# INLINE evtCombine #-}++evtConcat :: [Event] -> Event+evtConcat = foldl' evtCombine evtNothing+{-# INLINE evtConcat #-}++-- | A type alias for timeouts, specified in seconds.+data Timeout = Timeout {-# UNPACK #-} !Double+             | Forever+               deriving (Show)++-- | Event notification backend.+data Backend = forall a. Backend {+      _beState :: !a++    -- | Poll backend for new events.  The provided callback is called+    -- once per file descriptor with new events.+    , _bePoll :: a                          -- backend state+              -> Timeout                    -- timeout in milliseconds+              -> (Fd -> Event -> IO ())     -- I/O callback+              -> IO ()++    -- | Register, modify, or unregister interest in the given events+    -- on the given file descriptor.+    , _beModifyFd :: a+                  -> Fd       -- file descriptor+                  -> Event    -- old events to watch for ('mempty' for new)+                  -> Event    -- new events to watch for ('mempty' to delete)+                  -> IO ()++    , _beDelete :: a -> IO ()+    }++backend :: (a -> Timeout -> (Fd -> Event -> IO ()) -> IO ())+        -> (a -> Fd -> Event -> Event -> IO ())+        -> (a -> IO ())+        -> a+        -> Backend+backend bPoll bModifyFd bDelete state = Backend state bPoll bModifyFd bDelete+{-# INLINE backend #-}++poll :: Backend -> Timeout -> (Fd -> Event -> IO ()) -> IO ()+poll (Backend bState bPoll _ _) = bPoll bState+{-# INLINE poll #-}++modifyFd :: Backend -> Fd -> Event -> Event -> IO ()+modifyFd (Backend bState _ bModifyFd _) = bModifyFd bState+{-# INLINE modifyFd #-}++delete :: Backend -> IO ()+delete (Backend bState _ _ bDelete) = bDelete bState+{-# INLINE delete #-}++-- | Throw an 'IOError' corresponding to the current value of+-- 'getErrno' if the result value of the 'IO' action is -1 and+-- 'getErrno' is not 'eINTR'.  If the result value is -1 and+-- 'getErrno' returns 'eINTR' 0 is returned.  Otherwise the result+-- value is returned.+throwErrnoIfMinus1NoRetry :: Num a => String -> IO a -> IO a+throwErrnoIfMinus1NoRetry loc f = do+    res <- f+    if res == -1+        then do+            err <- getErrno+            if err == eINTR then return 0 else throwErrno loc+        else return res
+ System/Event/KQueue.hsc view
@@ -0,0 +1,298 @@+{-# LANGUAGE ForeignFunctionInterface, GeneralizedNewtypeDeriving,+    NoImplicitPrelude, RecordWildCards #-}++module System.Event.KQueue+    (+      new+    , available+    ) where++import qualified System.Event.Internal as E++#include "EventConfig.h"+#if !defined(HAVE_KQUEUE)+import GHC.Base++new :: IO E.Backend+new = error "KQueue back end not implemented for this platform"++available :: Bool+available = False+{-# INLINE available #-}+#else++import Control.Concurrent.MVar (MVar, newMVar, swapMVar, withMVar)+import Control.Monad (when, unless)+import Data.Bits (Bits(..))+import Data.Word (Word16, Word32)+import Foreign.C.Error (throwErrnoIfMinus1)+import Foreign.C.Types (CInt, CLong, CTime)+import Foreign.Marshal.Alloc (alloca)+import Foreign.Ptr (Ptr, nullPtr)+import Foreign.Storable (Storable(..))+import GHC.Base+import GHC.Enum (toEnum)+import GHC.Err (undefined)+import GHC.Num (Num(..))+import GHC.Real (ceiling, floor, fromIntegral)+import GHC.Show (Show(show))+import System.Event.Internal (Timeout(..))+import System.Posix.Internals (c_close)+import System.Posix.Types (Fd(..))+import qualified System.Event.Array as A++#if defined(HAVE_KEVENT64)+import Data.Int (Int64)+import Data.Word (Word64)+import Foreign.C.Types (CUInt)+#else+import Foreign.C.Types (CIntPtr, CUIntPtr)+#endif++#include <sys/types.h>+#include <sys/event.h>+#include <sys/time.h>++-- Handle brokenness on some BSD variants, notably OS X up to at least+-- 10.6.  If NOTE_EOF isn't available, we have no way to receive a+-- notification from the kernel when we reach EOF on a plain file.+#ifndef NOTE_EOF+# define NOTE_EOF 0+#endif++available :: Bool+available = True+{-# INLINE available #-}++------------------------------------------------------------------------+-- Exported interface++data EventQueue = EventQueue {+      eqFd       :: {-# UNPACK #-} !QueueFd+    , eqChanges  :: {-# UNPACK #-} !(MVar (A.Array Event))+    , eqEvents   :: {-# UNPACK #-} !(A.Array Event)+    }++new :: IO E.Backend+new = do+  qfd <- kqueue+  changesArr <- A.empty+  changes <- newMVar changesArr +  events <- A.new 64+  let !be = E.backend poll modifyFd delete (EventQueue qfd changes events)+  return be++delete :: EventQueue -> IO ()+delete q = do+  _ <- c_close . fromQueueFd . eqFd $ q+  return ()++modifyFd :: EventQueue -> Fd -> E.Event -> E.Event -> IO ()+modifyFd q fd oevt nevt = withMVar (eqChanges q) $ \ch -> do+  let addChange filt flag = A.snoc ch $ event fd filt flag noteEOF+  when (oevt `E.eventIs` E.evtRead)  $ addChange filterRead flagDelete+  when (oevt `E.eventIs` E.evtWrite) $ addChange filterWrite flagDelete+  when (nevt `E.eventIs` E.evtRead)  $ addChange filterRead flagAdd+  when (nevt `E.eventIs` E.evtWrite) $ addChange filterWrite flagAdd++poll :: EventQueue+     -> Timeout+     -> (Fd -> E.Event -> IO ())+     -> IO ()+poll EventQueue{..} tout f = do+    changesArr <- A.empty+    changes <- swapMVar eqChanges changesArr+    changesLen <- A.length changes+    len <- A.length eqEvents+    when (changesLen > len) $ A.ensureCapacity eqEvents (2 * changesLen)+    n <- A.useAsPtr changes $ \changesPtr chLen ->+           A.unsafeLoad eqEvents $ \evPtr evCap ->+             withTimeSpec (fromTimeout tout) $+               kevent eqFd changesPtr chLen evPtr evCap++    unless (n == 0) $ do+        cap <- A.capacity eqEvents+        when (n == cap) $ A.ensureCapacity eqEvents (2 * cap)+        A.forM_ eqEvents $ \e -> f (fromIntegral (ident e)) (toEvent (filter e))++------------------------------------------------------------------------+-- FFI binding++newtype QueueFd = QueueFd {+      fromQueueFd :: CInt+    } deriving (Eq, Show)++#if defined(HAVE_KEVENT64)+data Event = KEvent64 {+      ident  :: {-# UNPACK #-} !Word64+    , filter :: {-# UNPACK #-} !Filter+    , flags  :: {-# UNPACK #-} !Flag+    , fflags :: {-# UNPACK #-} !FFlag+    , data_  :: {-# UNPACK #-} !Int64+    , udata  :: {-# UNPACK #-} !Word64+    , ext0   :: {-# UNPACK #-} !Word64+    , ext1   :: {-# UNPACK #-} !Word64+    } deriving Show++event :: Fd -> Filter -> Flag -> FFlag -> Event+event fd filt flag fflag = KEvent64 (fromIntegral fd) filt flag fflag 0 0 0 0++instance Storable Event where+    sizeOf _ = #size struct kevent64_s+    alignment _ = alignment (undefined :: CInt)++    peek ptr = do+        ident'  <- #{peek struct kevent64_s, ident} ptr+        filter' <- #{peek struct kevent64_s, filter} ptr+        flags'  <- #{peek struct kevent64_s, flags} ptr+        fflags' <- #{peek struct kevent64_s, fflags} ptr+        data'   <- #{peek struct kevent64_s, data} ptr+        udata'  <- #{peek struct kevent64_s, udata} ptr+        ext0'   <- #{peek struct kevent64_s, ext[0]} ptr+        ext1'   <- #{peek struct kevent64_s, ext[1]} ptr+        let !ev = KEvent64 ident' (Filter filter') (Flag flags') fflags' data'+                           udata' ext0' ext1'+        return ev++    poke ptr ev = do+        #{poke struct kevent64_s, ident} ptr (ident ev)+        #{poke struct kevent64_s, filter} ptr (filter ev)+        #{poke struct kevent64_s, flags} ptr (flags ev)+        #{poke struct kevent64_s, fflags} ptr (fflags ev)+        #{poke struct kevent64_s, data} ptr (data_ ev)+        #{poke struct kevent64_s, udata} ptr (udata ev)+        #{poke struct kevent64_s, ext[0]} ptr (ext0 ev)+        #{poke struct kevent64_s, ext[1]} ptr (ext1 ev)+#else+data Event = KEvent {+      ident  :: {-# UNPACK #-} !CUIntPtr+    , filter :: {-# UNPACK #-} !Filter+    , flags  :: {-# UNPACK #-} !Flag+    , fflags :: {-# UNPACK #-} !FFlag+    , data_  :: {-# UNPACK #-} !CIntPtr+    , udata  :: {-# UNPACK #-} !(Ptr ())+    } deriving Show++event :: Fd -> Filter -> Flag -> FFlag -> Event+event fd filt flag fflag = KEvent (fromIntegral fd) filt flag fflag 0 nullPtr++instance Storable Event where+    sizeOf _ = #size struct kevent+    alignment _ = alignment (undefined :: CInt)++    peek ptr = do+        ident'  <- #{peek struct kevent, ident} ptr+        filter' <- #{peek struct kevent, filter} ptr+        flags'  <- #{peek struct kevent, flags} ptr+        fflags' <- #{peek struct kevent, fflags} ptr+        data'   <- #{peek struct kevent, data} ptr+        udata'  <- #{peek struct kevent, udata} ptr+        let !ev = KEvent ident' (Filter filter') (Flag flags') fflags' data'+                         udata'+        return ev++    poke ptr ev = do+        #{poke struct kevent, ident} ptr (ident ev)+        #{poke struct kevent, filter} ptr (filter ev)+        #{poke struct kevent, flags} ptr (flags ev)+        #{poke struct kevent, fflags} ptr (fflags ev)+        #{poke struct kevent, data} ptr (data_ ev)+        #{poke struct kevent, udata} ptr (udata ev)+#endif++newtype FFlag = FFlag Word32+    deriving (Eq, Show, Storable)++#{enum FFlag, FFlag+ , noteEOF = NOTE_EOF+ }++newtype Flag = Flag Word16+    deriving (Eq, Show, Storable)++#{enum Flag, Flag+ , flagAdd     = EV_ADD+ , flagDelete  = EV_DELETE+ }++newtype Filter = Filter Word16+    deriving (Bits, Eq, Num, Show, Storable)++#{enum Filter, Filter+ , filterRead   = EVFILT_READ+ , filterWrite  = EVFILT_WRITE+ }++data TimeSpec = TimeSpec {+      tv_sec  :: {-# UNPACK #-} !CTime+    , tv_nsec :: {-# UNPACK #-} !CLong+    }++instance Storable TimeSpec where+    sizeOf _ = #size struct timespec+    alignment _ = alignment (undefined :: CInt)++    peek ptr = do+        tv_sec'  <- #{peek struct timespec, tv_sec} ptr+        tv_nsec' <- #{peek struct timespec, tv_nsec} ptr+        let !ts = TimeSpec tv_sec' tv_nsec'+        return ts++    poke ptr ts = do+        #{poke struct timespec, tv_sec} ptr (tv_sec ts)+        #{poke struct timespec, tv_nsec} ptr (tv_nsec ts)++kqueue :: IO QueueFd+kqueue = QueueFd `fmap` throwErrnoIfMinus1 "kqueue" c_kqueue++-- TODO: We cannot retry on EINTR as the timeout would be wrong.+-- Perhaps we should just return without calling any callbacks.+kevent :: QueueFd -> Ptr Event -> Int -> Ptr Event -> Int -> Ptr TimeSpec+       -> IO Int+kevent k chs chlen evs evlen ts+    = fmap fromIntegral $ E.throwErrnoIfMinus1NoRetry "kevent" $+#if defined(HAVE_KEVENT64)+      c_kevent64 k chs (fromIntegral chlen) evs (fromIntegral evlen) 0 ts+#else+      c_kevent k chs (fromIntegral chlen) evs (fromIntegral evlen) ts+#endif++withTimeSpec :: TimeSpec -> (Ptr TimeSpec -> IO a) -> IO a+withTimeSpec ts f =+    if tv_sec ts < 0 then+        f nullPtr+      else+        alloca $ \ptr -> poke ptr ts >> f ptr++fromTimeout :: Timeout -> TimeSpec+fromTimeout Forever     = TimeSpec (-1) (-1)+fromTimeout (Timeout s) = TimeSpec (toEnum sec) (toEnum nanosec)+  where+    sec :: Int+    sec     = floor s++    nanosec :: Int+    nanosec = ceiling $ (s - fromIntegral sec) * 1000000000++toEvent :: Filter -> E.Event+toEvent (Filter f)+    | f == (#const EVFILT_READ) = E.evtRead+    | f == (#const EVFILT_WRITE) = E.evtWrite+    | otherwise = error $ "toEvent: unknonwn filter " ++ show f++foreign import ccall unsafe "kqueue"+    c_kqueue :: IO CInt++#if defined(HAVE_KEVENT64)+foreign import ccall safe "kevent64"+    c_kevent64 :: QueueFd -> Ptr Event -> CInt -> Ptr Event -> CInt -> CUInt+               -> Ptr TimeSpec -> IO CInt+#elif defined(HAVE_KEVENT)+foreign import ccall safe "kevent"+    c_kevent :: QueueFd -> Ptr Event -> CInt -> Ptr Event -> CInt+             -> Ptr TimeSpec -> IO CInt+#else+#error no kevent system call available!?+#endif++#endif /* defined(HAVE_KQUEUE) */
+ System/Event/Manager.hs view
@@ -0,0 +1,391 @@+{-# LANGUAGE BangPatterns, CPP, ExistentialQuantification, NoImplicitPrelude,+    RecordWildCards, TypeSynonymInstances #-}+module System.Event.Manager+    ( -- * Types+      EventManager++      -- * Creation+    , new+    , newWith+    , newDefaultBackend++      -- * Running+    , finished+    , loop+    , step+    , shutdown+    , wakeManager++      -- * Registering interest in I/O events+    , Event+    , evtRead+    , evtWrite+    , IOCallback+    , FdKey(keyFd)+    , registerFd_+    , registerFd+    , unregisterFd_+    , unregisterFd+    , fdWasClosed++      -- * Registering interest in timeout events+    , TimeoutCallback+    , TimeoutKey+    , registerTimeout+    , updateTimeout+    , unregisterTimeout+    ) where++#include "EventConfig.h"++------------------------------------------------------------------------+-- Imports++import Control.Concurrent.MVar (MVar, modifyMVar, modifyMVar_, newMVar,+                                readMVar)+import Control.Exception (finally)+import Control.Monad ((=<<), forM_, liftM, sequence_, when)+import Data.IORef (IORef, atomicModifyIORef, mkWeakIORef, newIORef, readIORef,+                   writeIORef)+import Data.Maybe (Maybe(..))+import Data.Monoid (mconcat, mempty)+import GHC.Base+import GHC.Conc.Signal (runHandlers)+import GHC.List (filter)+import GHC.Num (Num(..))+import GHC.Real ((/), fromIntegral )+import GHC.Show (Show(..))+import System.Event.Clock (getCurrentTime)+import System.Event.Control+import System.Event.Internal (Backend, Event, evtRead, evtWrite, Timeout(..))+import System.Event.Unique (Unique, UniqueSource, newSource, newUnique)+import System.Posix.Types (Fd)++import qualified System.Event.IntMap as IM+import qualified System.Event.Internal as I+import qualified System.Event.PSQ as Q++#if defined(HAVE_KQUEUE)+import qualified System.Event.KQueue as KQueue+#elif defined(HAVE_EPOLL)+import qualified System.Event.EPoll  as EPoll+#elif defined(HAVE_POLL)+import qualified System.Event.Poll   as Poll+#else+# error not implemented for this operating system+#endif++------------------------------------------------------------------------+-- Types++data FdData = FdData {+      fdKey       :: {-# UNPACK #-} !FdKey+    , fdEvents    :: {-# UNPACK #-} !Event+    , _fdCallback :: !IOCallback+    } deriving (Show)++-- | A file descriptor registration cookie.+data FdKey = FdKey {+      keyFd     :: {-# UNPACK #-} !Fd+    , keyUnique :: {-# UNPACK #-} !Unique+    } deriving (Eq, Show)++-- | Callback invoked on I/O events.+type IOCallback = FdKey -> Event -> IO ()++instance Show IOCallback where+    show _ = "IOCallback"++newtype TimeoutKey   = TK Unique+    deriving (Eq)++-- | Callback invoked on timeout events.+type TimeoutCallback = IO ()++data State = Created+           | Running+           | Dying+           | Finished+             deriving (Eq, Show)++-- | A priority search queue, with timeouts as priorities.+type TimeoutQueue = Q.PSQ TimeoutCallback++{-+Instead of directly modifying the 'TimeoutQueue' in+e.g. 'registerTimeout' we keep a list of edits to perform, in the form+of a chain of function closures, and have the I/O manager thread+perform the edits later.  This exist to address the following GC+problem:++Since e.g. 'registerTimeout' doesn't force the evaluation of the+thunks inside the 'emTimeouts' IORef a number of thunks build up+inside the IORef.  If the I/O manager thread doesn't evaluate these+thunks soon enough they'll get promoted to the old generation and+become roots for all subsequent minor GCs.++When the thunks eventually get evaluated they will each create a new+intermediate 'TimeoutQueue' that immediately becomes garbage.  Since+the thunks serve as roots until the next major GC these intermediate+'TimeoutQueue's will get copied unnecesarily in the next minor GC,+increasing GC time.  This problem is known as "floating garbage".++Keeping a list of edits doesn't stop this from happening but makes the+amount of data that gets copied smaller.++TODO: Evaluate the content of the IORef to WHNF on each insert once+this bug is resolved: http://hackage.haskell.org/trac/ghc/ticket/3838+-}++-- | An edit to apply to a 'TimeoutQueue'.+type TimeoutEdit = TimeoutQueue -> TimeoutQueue++-- | The event manager state.+data EventManager = EventManager+    { emBackend      :: !Backend+    , emFds          :: {-# UNPACK #-} !(MVar (IM.IntMap [FdData]))+    , emTimeouts     :: {-# UNPACK #-} !(IORef TimeoutEdit)+    , emState        :: {-# UNPACK #-} !(IORef State)+    , emUniqueSource :: {-# UNPACK #-} !UniqueSource+    , emControl      :: {-# UNPACK #-} !Control+    }++------------------------------------------------------------------------+-- Creation++handleControlEvent :: EventManager -> FdKey -> Event -> IO ()+handleControlEvent mgr reg _evt = do+  msg <- readControlMessage (emControl mgr) (keyFd reg)+  case msg of+    CMsgWakeup      -> return ()+    CMsgDie         -> writeIORef (emState mgr) Finished+    CMsgSignal fp s -> runHandlers fp s++newDefaultBackend :: IO Backend+#if defined(HAVE_KQUEUE)+newDefaultBackend = KQueue.new+#elif defined(HAVE_EPOLL)+newDefaultBackend = EPoll.new+#elif defined(HAVE_POLL)+newDefaultBackend = Poll.new+#else+newDefaultBackend = error "no back end for this platform"+#endif++-- | Create a new event manager.+new :: IO EventManager+new = newWith =<< newDefaultBackend++newWith :: Backend -> IO EventManager+newWith be = do+  iofds <- newMVar IM.empty+  timeouts <- newIORef id+  ctrl <- newControl+  state <- newIORef Created+  us <- newSource+  _ <- mkWeakIORef state $ do+               st <- atomicModifyIORef state $ \s -> (Finished, s)+               when (st /= Finished) $ do+                 I.delete be+                 closeControl ctrl+  let mgr = EventManager { emBackend = be+                         , emFds = iofds+                         , emTimeouts = timeouts+                         , emState = state+                         , emUniqueSource = us+                         , emControl = ctrl+                         }+  _ <- registerFd_ mgr (handleControlEvent mgr) (controlReadFd ctrl) evtRead+  _ <- registerFd_ mgr (handleControlEvent mgr) (wakeupReadFd ctrl) evtRead+  return mgr++-- | Asynchronously shuts down the event manager, if running.+shutdown :: EventManager -> IO ()+shutdown mgr = do+  state <- atomicModifyIORef (emState mgr) $ \s -> (Dying, s)+  when (state == Running) $ sendDie (emControl mgr)++finished :: EventManager -> IO Bool+finished mgr = (== Finished) `liftM` readIORef (emState mgr)++cleanup :: EventManager -> IO ()+cleanup EventManager{..} = do+  writeIORef emState Finished+  I.delete emBackend+  closeControl emControl++------------------------------------------------------------------------+-- Event loop++-- | Start handling events.  This function loops until told to stop.+--+-- /Note/: This loop can only be run once per 'EventManager', as it+-- closes all of its control resources when it finishes.+loop :: EventManager -> IO ()+loop mgr@EventManager{..} = do+  state <- atomicModifyIORef emState $ \s -> case s of+    Created -> (Running, s)+    _       -> (s, s)+  case state of+    Created -> go Q.empty `finally` cleanup mgr+    Dying   -> cleanup mgr+    _       -> do cleanup mgr+                  error $ "System.Event.Manager.loop: state is already " +++                      show state+ where+  go q = do (running, q') <- step mgr q+            when running $ go q'++step :: EventManager -> TimeoutQueue -> IO (Bool, TimeoutQueue)+step mgr@EventManager{..} tq = do+  (timeout, q') <- mkTimeout tq+  I.poll emBackend timeout (onFdEvent mgr)+  state <- readIORef emState+  state `seq` return (state == Running, q')+ where++  -- | Call all expired timer callbacks and return the time to the+  -- next timeout.+  mkTimeout :: TimeoutQueue -> IO (Timeout, TimeoutQueue)+  mkTimeout q = do+      now <- getCurrentTime+      applyEdits <- atomicModifyIORef emTimeouts $ \f -> (id, f)+      let (expired, q'') = let q' = applyEdits q in q' `seq` Q.atMost now q'+      sequence_ $ map Q.value expired+      let timeout = case Q.minView q'' of+            Nothing             -> Forever+            Just (Q.E _ t _, _) ->+                -- This value will always be positive since the call+                -- to 'atMost' above removed any timeouts <= 'now'+                let t' = t - now in t' `seq` Timeout t'+      return (timeout, q'')++------------------------------------------------------------------------+-- Registering interest in I/O events++-- | Register interest in the given events, without waking the event+-- manager thread.  The 'Bool' return value indicates whether the+-- event manager ought to be woken.+registerFd_ :: EventManager -> IOCallback -> Fd -> Event+            -> IO (FdKey, Bool)+registerFd_ EventManager{..} cb fd evs = do+  u <- newUnique emUniqueSource+  modifyMVar emFds $ \oldMap -> do+    let fd'  = fromIntegral fd+        reg  = FdKey fd u+        !fdd = FdData reg evs cb+        (!newMap, (oldEvs, newEvs)) =+            case IM.insertWith (++) fd' [fdd] oldMap of+              (Nothing,   n) -> (n, (mempty, evs))+              (Just prev, n) -> (n, pairEvents prev newMap fd')+        modify = oldEvs /= newEvs+    when modify $ I.modifyFd emBackend fd oldEvs newEvs+    return (newMap, (reg, modify))+{-# INLINE registerFd_ #-}++-- | @registerFd mgr cb fd evs@ registers interest in the events @evs@+-- on the file descriptor @fd@.  @cb@ is called for each event that+-- occurs.  Returns a cookie that can be handed to 'unregisterFd'.+registerFd :: EventManager -> IOCallback -> Fd -> Event -> IO FdKey+registerFd mgr cb fd evs = do+  (r, wake) <- registerFd_ mgr cb fd evs+  when wake $ wakeManager mgr+  return r+{-# INLINE registerFd #-}++-- | Wake up the event manager.+wakeManager :: EventManager -> IO ()+wakeManager mgr = sendWakeup (emControl mgr)++eventsOf :: [FdData] -> Event+eventsOf = mconcat . map fdEvents++pairEvents :: [FdData] -> IM.IntMap [FdData] -> Int -> (Event, Event)+pairEvents prev m fd = let l = eventsOf prev+                           r = case IM.lookup fd m of+                                 Nothing  -> mempty+                                 Just fds -> eventsOf fds+                       in (l, r)++-- | Drop a previous file descriptor registration, without waking the+-- event manager thread.  The return value indicates whether the event+-- manager ought to be woken.+unregisterFd_ :: EventManager -> FdKey -> IO Bool+unregisterFd_ EventManager{..} (FdKey fd u) =+  modifyMVar emFds $ \oldMap -> do+    let dropReg cbs = case filter ((/= u) . keyUnique . fdKey) cbs of+                          []   -> Nothing+                          cbs' -> Just cbs'+        fd' = fromIntegral fd+        (!newMap, (oldEvs, newEvs)) =+            case IM.updateWith dropReg fd' oldMap of+              (Nothing,   _)    -> (oldMap, (mempty, mempty))+              (Just prev, newm) -> (newm, pairEvents prev newm fd')+        modify = oldEvs /= newEvs+    when modify $ I.modifyFd emBackend fd oldEvs newEvs+    return (newMap, modify)++-- | Drop a previous file descriptor registration.+unregisterFd :: EventManager -> FdKey -> IO ()+unregisterFd mgr reg = do+  wake <- unregisterFd_ mgr reg+  when wake $ wakeManager mgr++-- | Notify the event manager that a file descriptor has been closed.+fdWasClosed :: EventManager -> Fd -> IO ()+fdWasClosed mgr fd =+  modifyMVar_ (emFds mgr) $ \oldMap ->+    case IM.delete (fromIntegral fd) oldMap of+      (Nothing,  _)       -> return oldMap+      (Just fds, !newMap) -> do+        when (eventsOf fds /= mempty) $ wakeManager mgr+        return newMap++------------------------------------------------------------------------+-- Registering interest in timeout events++-- | Register a timeout in the given number of microseconds.+registerTimeout :: EventManager -> Int -> TimeoutCallback -> IO TimeoutKey+registerTimeout mgr us cb = do+  !key <- newUnique (emUniqueSource mgr)+  if us <= 0 then cb+    else do+      now <- getCurrentTime+      let expTime = fromIntegral us / 1000000.0 + now++      -- We intentionally do not evaluate the modified map to WHNF here.+      -- Instead, we leave a thunk inside the IORef and defer its+      -- evaluation until mkTimeout in the event loop.  This is a+      -- workaround for a nasty IORef contention problem that causes the+      -- thread-delay benchmark to take 20 seconds instead of 0.2.+      atomicModifyIORef (emTimeouts mgr) $ \f ->+          let f' = (Q.insert key expTime cb) . f in (f', ())+      wakeManager mgr+  return $ TK key++unregisterTimeout :: EventManager -> TimeoutKey -> IO ()+unregisterTimeout mgr (TK key) = do+  atomicModifyIORef (emTimeouts mgr) $ \f ->+      let f' = (Q.delete key) . f in (f', ())+  wakeManager mgr++updateTimeout :: EventManager -> TimeoutKey -> Int -> IO ()+updateTimeout mgr (TK key) us = do+  now <- getCurrentTime+  let expTime = fromIntegral us / 1000000.0 + now++  atomicModifyIORef (emTimeouts mgr) $ \f ->+      let f' = (Q.adjust (const expTime) key) . f in (f', ())+  wakeManager mgr++------------------------------------------------------------------------+-- Utilities++-- | Call the callbacks corresponding to the given file descriptor.+onFdEvent :: EventManager -> Fd -> Event -> IO ()+onFdEvent mgr fd evs = do+  fds <- readMVar (emFds mgr)+  case IM.lookup (fromIntegral fd) fds of+      Just cbs -> forM_ cbs $ \(FdData reg ev cb) ->+                    when (evs `I.eventIs` ev) $ cb reg evs+      Nothing  -> return ()
+ System/Event/PSQ.hs view
@@ -0,0 +1,483 @@+{-# LANGUAGE BangPatterns, NoImplicitPrelude #-}++-- Copyright (c) 2008, Ralf Hinze+-- All rights reserved.+--+-- Redistribution and use in source and binary forms, with or without+-- modification, are permitted provided that the following conditions+-- are met:+--+--     * Redistributions of source code must retain the above+--       copyright notice, this list of conditions and the following+--       disclaimer.+--+--     * Redistributions in binary form must reproduce the above+--       copyright notice, this list of conditions and the following+--       disclaimer in the documentation and/or other materials+--       provided with the distribution.+--+--     * The names of the contributors may not be used to endorse or+--       promote products derived from this software without specific+--       prior written permission.+--+-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS+-- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE+-- COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,+-- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES+-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR+-- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)+-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,+-- STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)+-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED+-- OF THE POSSIBILITY OF SUCH DAMAGE.++-- | A /priority search queue/ (henceforth /queue/) efficiently+-- supports the operations of both a search tree and a priority queue.+-- An 'Elem'ent is a product of a key, a priority, and a+-- value. Elements can be inserted, deleted, modified and queried in+-- logarithmic time, and the element with the least priority can be+-- retrieved in constant time.  A queue can be built from a list of+-- elements, sorted by keys, in linear time.+--+-- This implementation is due to Ralf Hinze with some modifications by+-- Scott Dillard and Johan Tibell.+--+-- * Hinze, R., /A Simple Implementation Technique for Priority Search+-- Queues/, ICFP 2001, pp. 110-121+--+-- <http://citeseer.ist.psu.edu/hinze01simple.html>+module System.Event.PSQ+    (+    -- * Binding Type+    Elem(..)+    , Key+    , Prio++    -- * Priority Search Queue Type+    , PSQ++    -- * Query+    , size+    , null+    , lookup++    -- * Construction+    , empty+    , singleton++    -- * Insertion+    , insert++    -- * Delete/Update+    , delete+    , adjust++    -- * Conversion+    , toList+    , toAscList+    , toDescList+    , fromList++    -- * Min+    , findMin+    , deleteMin+    , minView+    , atMost+    ) where++import Data.Maybe (Maybe(..))+import GHC.Base+import GHC.Num (Num(..))+import GHC.Show (Show(showsPrec))+import System.Event.Unique (Unique)++-- | @E k p@ binds the key @k@ with the priority @p@.+data Elem a = E+    { key   :: {-# UNPACK #-} !Key+    , prio  :: {-# UNPACK #-} !Prio+    , value :: a+    } deriving (Eq, Show)++------------------------------------------------------------------------+-- | A mapping from keys @k@ to priorites @p@.++type Prio = Double+type Key = Unique++data PSQ a = Void+           | Winner {-# UNPACK #-} !(Elem a)+                    !(LTree a)+                    {-# UNPACK #-} !Key  -- max key+           deriving (Eq, Show)++-- | /O(1)/ The number of elements in a queue.+size :: PSQ a -> Int+size Void            = 0+size (Winner _ lt _) = 1 + size' lt++-- | /O(1)/ True if the queue is empty.+null :: PSQ a -> Bool+null Void           = True+null (Winner _ _ _) = False++-- | /O(log n)/ The priority and value of a given key, or Nothing if+-- the key is not bound.+lookup :: Key -> PSQ a -> Maybe (Prio, a)+lookup k q = case tourView q of+    Null -> Nothing+    Single (E k' p v)+        | k == k'   -> Just (p, v)+        | otherwise -> Nothing+    tl `Play` tr+        | k <= maxKey tl -> lookup k tl+        | otherwise      -> lookup k tr++------------------------------------------------------------------------+-- Construction++empty :: PSQ a+empty = Void++-- | /O(1)/ Build a queue with one element.+singleton :: Key -> Prio -> a -> PSQ a+singleton k p v = Winner (E k p v) Start k++------------------------------------------------------------------------+-- Insertion++-- | /O(log n)/ Insert a new key, priority and value in the queue.  If+-- the key is already present in the queue, the associated priority+-- and value are replaced with the supplied priority and value.+insert :: Key -> Prio -> a -> PSQ a -> PSQ a+insert k p v q = case q of+    Void -> singleton k p v+    Winner (E k' p' v') Start _ -> case compare k k' of+        LT -> singleton k  p  v  `play` singleton k' p' v'+        EQ -> singleton k  p  v+        GT -> singleton k' p' v' `play` singleton k  p  v+    Winner e (RLoser _ e' tl m tr) m'+        | k <= m    -> insert k p v (Winner e tl m) `play` (Winner e' tr m')+        | otherwise -> (Winner e tl m) `play` insert k p v (Winner e' tr m')+    Winner e (LLoser _ e' tl m tr) m'+        | k <= m    -> insert k p v (Winner e' tl m) `play` (Winner e tr m')+        | otherwise -> (Winner e' tl m) `play` insert k p v (Winner e tr m')++------------------------------------------------------------------------+-- Delete/Update++-- | /O(log n)/ Delete a key and its priority and value from the+-- queue.  When the key is not a member of the queue, the original+-- queue is returned.+delete :: Key -> PSQ a -> PSQ a+delete k q = case q of+    Void -> empty+    Winner (E k' p v) Start _+        | k == k'   -> empty+        | otherwise -> singleton k' p v+    Winner e (RLoser _ e' tl m tr) m'+        | k <= m    -> delete k (Winner e tl m) `play` (Winner e' tr m')+        | otherwise -> (Winner e tl m) `play` delete k (Winner e' tr m')+    Winner e (LLoser _ e' tl m tr) m'+        | k <= m    -> delete k (Winner e' tl m) `play` (Winner e tr m')+        | otherwise -> (Winner e' tl m) `play` delete k (Winner e tr m')++-- | /O(log n)/ Update a priority at a specific key with the result+-- of the provided function.  When the key is not a member of the+-- queue, the original queue is returned.+adjust :: (Prio -> Prio) -> Key -> PSQ a -> PSQ a+adjust f k q0 =  go q0+  where+    go q = case q of+        Void -> empty+        Winner (E k' p v) Start _+            | k == k'   -> singleton k' (f p) v+            | otherwise -> singleton k' p v+        Winner e (RLoser _ e' tl m tr) m'+            | k <= m    -> go (Winner e tl m) `unsafePlay` (Winner e' tr m')+            | otherwise -> (Winner e tl m) `unsafePlay` go (Winner e' tr m')+        Winner e (LLoser _ e' tl m tr) m'+            | k <= m    -> go (Winner e' tl m) `unsafePlay` (Winner e tr m')+            | otherwise -> (Winner e' tl m) `unsafePlay` go (Winner e tr m')+{-# INLINE adjust #-}++------------------------------------------------------------------------+-- Conversion++-- | /O(n*log n)/ Build a queue from a list of key/priority/value+-- tuples.  If the list contains more than one priority and value for+-- the same key, the last priority and value for the key is retained.+fromList :: [Elem a] -> PSQ a+fromList = foldr (\(E k p v) q -> insert k p v q) empty++-- | /O(n)/ Convert to a list of key/priority/value tuples.+toList :: PSQ a -> [Elem a]+toList = toAscList++-- | /O(n)/ Convert to an ascending list.+toAscList :: PSQ a -> [Elem a]+toAscList q  = seqToList (toAscLists q)++toAscLists :: PSQ a -> Sequ (Elem a)+toAscLists q = case tourView q of+    Null         -> emptySequ+    Single e     -> singleSequ e+    tl `Play` tr -> toAscLists tl <> toAscLists tr++-- | /O(n)/ Convert to a descending list.+toDescList :: PSQ a -> [ Elem a ]+toDescList q = seqToList (toDescLists q)++toDescLists :: PSQ a -> Sequ (Elem a)+toDescLists q = case tourView q of+    Null         -> emptySequ+    Single e     -> singleSequ e+    tl `Play` tr -> toDescLists tr <> toDescLists tl++------------------------------------------------------------------------+-- Min++-- | /O(1)/ The element with the lowest priority.+findMin :: PSQ a -> Maybe (Elem a)+findMin Void           = Nothing+findMin (Winner e _ _) = Just e++-- | /O(log n)/ Delete the element with the lowest priority.  Returns+-- an empty queue if the queue is empty.+deleteMin :: PSQ a -> PSQ a+deleteMin Void           = Void+deleteMin (Winner _ t m) = secondBest t m++-- | /O(log n)/ Retrieve the binding with the least priority, and the+-- rest of the queue stripped of that binding.+minView :: PSQ a -> Maybe (Elem a, PSQ a)+minView Void           = Nothing+minView (Winner e t m) = Just (e, secondBest t m)++secondBest :: LTree a -> Key -> PSQ a+secondBest Start _                 = Void+secondBest (LLoser _ e tl m tr) m' = Winner e tl m `play` secondBest tr m'+secondBest (RLoser _ e tl m tr) m' = secondBest tl m `play` Winner e tr m'++-- | /O(r*(log n - log r))/ Return a list of elements ordered by+-- key whose priorities are at most @pt@.+atMost :: Prio -> PSQ a -> ([Elem a], PSQ a)+atMost pt q = let (sequ, q') = atMosts pt q+              in (seqToList sequ, q')++atMosts :: Prio -> PSQ a -> (Sequ (Elem a), PSQ a)+atMosts !pt q = case q of+    (Winner e _ _)+        | prio e > pt -> (emptySequ, q)+    Void              -> (emptySequ, Void)+    Winner e Start _  -> (singleSequ e, Void)+    Winner e (RLoser _ e' tl m tr) m' ->+        let (sequ, q')   = atMosts pt (Winner e tl m)+            (sequ', q'') = atMosts pt (Winner e' tr m')+        in (sequ <> sequ', q' `play` q'')+    Winner e (LLoser _ e' tl m tr) m' ->+        let (sequ, q')   = atMosts pt (Winner e' tl m)+            (sequ', q'') = atMosts pt (Winner e tr m')+        in (sequ <> sequ', q' `play` q'')++------------------------------------------------------------------------+-- Loser tree++type Size = Int++data LTree a = Start+             | LLoser {-# UNPACK #-} !Size+                      {-# UNPACK #-} !(Elem a)+                      !(LTree a)+                      {-# UNPACK #-} !Key  -- split key+                      !(LTree a)+             | RLoser {-# UNPACK #-} !Size+                      {-# UNPACK #-} !(Elem a)+                      !(LTree a)+                      {-# UNPACK #-} !Key  -- split key+                      !(LTree a)+             deriving (Eq, Show)++size' :: LTree a -> Size+size' Start              = 0+size' (LLoser s _ _ _ _) = s+size' (RLoser s _ _ _ _) = s++left, right :: LTree a -> LTree a++left Start                = moduleError "left" "empty loser tree"+left (LLoser _ _ tl _ _ ) = tl+left (RLoser _ _ tl _ _ ) = tl++right Start                = moduleError "right" "empty loser tree"+right (LLoser _ _ _  _ tr) = tr+right (RLoser _ _ _  _ tr) = tr++maxKey :: PSQ a -> Key+maxKey Void           = moduleError "maxKey" "empty queue"+maxKey (Winner _ _ m) = m++lloser, rloser :: Key -> Prio -> a -> LTree a -> Key -> LTree a -> LTree a+lloser k p v tl m tr = LLoser (1 + size' tl + size' tr) (E k p v) tl m tr+rloser k p v tl m tr = RLoser (1 + size' tl + size' tr) (E k p v) tl m tr++------------------------------------------------------------------------+-- Balancing++-- | Balance factor+omega :: Int+omega = 4++lbalance, rbalance :: Key -> Prio -> a -> LTree a -> Key -> LTree a -> LTree a++lbalance k p v l m r+    | size' l + size' r < 2     = lloser        k p v l m r+    | size' r > omega * size' l = lbalanceLeft  k p v l m r+    | size' l > omega * size' r = lbalanceRight k p v l m r+    | otherwise                 = lloser        k p v l m r++rbalance k p v l m r+    | size' l + size' r < 2     = rloser        k p v l m r+    | size' r > omega * size' l = rbalanceLeft  k p v l m r+    | size' l > omega * size' r = rbalanceRight k p v l m r+    | otherwise                 = rloser        k p v l m r++lbalanceLeft :: Key -> Prio -> a -> LTree a -> Key -> LTree a -> LTree a+lbalanceLeft  k p v l m r+    | size' (left r) < size' (right r) = lsingleLeft  k p v l m r+    | otherwise                        = ldoubleLeft  k p v l m r++lbalanceRight :: Key -> Prio -> a -> LTree a -> Key -> LTree a -> LTree a+lbalanceRight k p v l m r+    | size' (left l) > size' (right l) = lsingleRight k p v l m r+    | otherwise                        = ldoubleRight k p v l m r++rbalanceLeft :: Key -> Prio -> a -> LTree a -> Key -> LTree a -> LTree a+rbalanceLeft  k p v l m r+    | size' (left r) < size' (right r) = rsingleLeft  k p v l m r+    | otherwise                        = rdoubleLeft  k p v l m r++rbalanceRight :: Key -> Prio -> a -> LTree a -> Key -> LTree a -> LTree a+rbalanceRight k p v l m r+    | size' (left l) > size' (right l) = rsingleRight k p v l m r+    | otherwise                        = rdoubleRight k p v l m r++lsingleLeft :: Key -> Prio -> a -> LTree a -> Key -> LTree a -> LTree a+lsingleLeft k1 p1 v1 t1 m1 (LLoser _ (E k2 p2 v2) t2 m2 t3)+    | p1 <= p2  = lloser k1 p1 v1 (rloser k2 p2 v2 t1 m1 t2) m2 t3+    | otherwise = lloser k2 p2 v2 (lloser k1 p1 v1 t1 m1 t2) m2 t3+lsingleLeft k1 p1 v1 t1 m1 (RLoser _ (E k2 p2 v2) t2 m2 t3) =+    rloser k2 p2 v2 (lloser k1 p1 v1 t1 m1 t2) m2 t3+lsingleLeft _ _ _ _ _ _ = moduleError "lsingleLeft" "malformed tree"++rsingleLeft :: Key -> Prio -> a -> LTree a -> Key -> LTree a -> LTree a+rsingleLeft k1 p1 v1 t1 m1 (LLoser _ (E k2 p2 v2) t2 m2 t3) =+    rloser k1 p1 v1 (rloser k2 p2 v2 t1 m1 t2) m2 t3+rsingleLeft k1 p1 v1 t1 m1 (RLoser _ (E k2 p2 v2) t2 m2 t3) =+    rloser k2 p2 v2 (rloser k1 p1 v1 t1 m1 t2) m2 t3+rsingleLeft _ _ _ _ _ _ = moduleError "rsingleLeft" "malformed tree"++lsingleRight :: Key -> Prio -> a -> LTree a -> Key -> LTree a -> LTree a+lsingleRight k1 p1 v1 (LLoser _ (E k2 p2 v2) t1 m1 t2) m2 t3 =+    lloser k2 p2 v2 t1 m1 (lloser k1 p1 v1 t2 m2 t3)+lsingleRight k1 p1 v1 (RLoser _ (E k2 p2 v2) t1 m1 t2) m2 t3 =+    lloser k1 p1 v1 t1 m1 (lloser k2 p2 v2 t2 m2 t3)+lsingleRight _ _ _ _ _ _ = moduleError "lsingleRight" "malformed tree"++rsingleRight :: Key -> Prio -> a -> LTree a -> Key -> LTree a -> LTree a+rsingleRight k1 p1 v1 (LLoser _ (E k2 p2 v2) t1 m1 t2) m2 t3 =+    lloser k2 p2 v2 t1 m1 (rloser k1 p1 v1 t2 m2 t3)+rsingleRight k1 p1 v1 (RLoser _ (E k2 p2 v2) t1 m1 t2) m2 t3+    | p1 <= p2  = rloser k1 p1 v1 t1 m1 (lloser k2 p2 v2 t2 m2 t3)+    | otherwise = rloser k2 p2 v2 t1 m1 (rloser k1 p1 v1 t2 m2 t3)+rsingleRight _ _ _ _ _ _ = moduleError "rsingleRight" "malformed tree"++ldoubleLeft :: Key -> Prio -> a -> LTree a -> Key -> LTree a -> LTree a+ldoubleLeft k1 p1 v1 t1 m1 (LLoser _ (E k2 p2 v2) t2 m2 t3) =+    lsingleLeft k1 p1 v1 t1 m1 (lsingleRight k2 p2 v2 t2 m2 t3)+ldoubleLeft k1 p1 v1 t1 m1 (RLoser _ (E k2 p2 v2) t2 m2 t3) =+    lsingleLeft k1 p1 v1 t1 m1 (rsingleRight k2 p2 v2 t2 m2 t3)+ldoubleLeft _ _ _ _ _ _ = moduleError "ldoubleLeft" "malformed tree"++ldoubleRight :: Key -> Prio -> a -> LTree a -> Key -> LTree a -> LTree a+ldoubleRight k1 p1 v1 (LLoser _ (E k2 p2 v2) t1 m1 t2) m2 t3 =+    lsingleRight k1 p1 v1 (lsingleLeft k2 p2 v2 t1 m1 t2) m2 t3+ldoubleRight k1 p1 v1 (RLoser _ (E k2 p2 v2) t1 m1 t2) m2 t3 =+    lsingleRight k1 p1 v1 (rsingleLeft k2 p2 v2 t1 m1 t2) m2 t3+ldoubleRight _ _ _ _ _ _ = moduleError "ldoubleRight" "malformed tree"++rdoubleLeft :: Key -> Prio -> a -> LTree a -> Key -> LTree a -> LTree a+rdoubleLeft k1 p1 v1 t1 m1 (LLoser _ (E k2 p2 v2) t2 m2 t3) =+    rsingleLeft k1 p1 v1 t1 m1 (lsingleRight k2 p2 v2 t2 m2 t3)+rdoubleLeft k1 p1 v1 t1 m1 (RLoser _ (E k2 p2 v2) t2 m2 t3) =+    rsingleLeft k1 p1 v1 t1 m1 (rsingleRight k2 p2 v2 t2 m2 t3)+rdoubleLeft _ _ _ _ _ _ = moduleError "rdoubleLeft" "malformed tree"++rdoubleRight :: Key -> Prio -> a -> LTree a -> Key -> LTree a -> LTree a+rdoubleRight k1 p1 v1 (LLoser _ (E k2 p2 v2) t1 m1 t2) m2 t3 =+    rsingleRight k1 p1 v1 (lsingleLeft k2 p2 v2 t1 m1 t2) m2 t3+rdoubleRight k1 p1 v1 (RLoser _ (E k2 p2 v2) t1 m1 t2) m2 t3 =+    rsingleRight k1 p1 v1 (rsingleLeft k2 p2 v2 t1 m1 t2) m2 t3+rdoubleRight _ _ _ _ _ _ = moduleError "rdoubleRight" "malformed tree"++-- | Take two pennants and returns a new pennant that is the union of+-- the two with the precondition that the keys in the first tree are+-- strictly smaller than the keys in the second tree.+play :: PSQ a -> PSQ a -> PSQ a+Void `play` t' = t'+t `play` Void  = t+Winner e@(E k p v) t m `play` Winner e'@(E k' p' v') t' m'+    | p <= p'   = Winner e (rbalance k' p' v' t m t') m'+    | otherwise = Winner e' (lbalance k p v t m t') m'+{-# INLINE play #-}++-- | A version of 'play' that can be used if the shape of the tree has+-- not changed or if the tree is known to be balanced.+unsafePlay :: PSQ a -> PSQ a -> PSQ a+Void `unsafePlay` t' =  t'+t `unsafePlay` Void  =  t+Winner e@(E k p v) t m `unsafePlay` Winner e'@(E k' p' v') t' m'+    | p <= p'   = Winner e (rloser k' p' v' t m t') m'+    | otherwise = Winner e' (lloser k p v t m t') m'+{-# INLINE unsafePlay #-}++data TourView a = Null+                | Single {-# UNPACK #-} !(Elem a)+                | (PSQ a) `Play` (PSQ a)++tourView :: PSQ a -> TourView a+tourView Void               = Null+tourView (Winner e Start _) = Single e+tourView (Winner e (RLoser _ e' tl m tr) m') =+    Winner e tl m `Play` Winner e' tr m'+tourView (Winner e (LLoser _ e' tl m tr) m') =+    Winner e' tl m `Play` Winner e tr m'++------------------------------------------------------------------------+-- Utility functions++moduleError :: String -> String -> a+moduleError fun msg = error ("System.Event.PSQ." ++ fun ++ ':' : ' ' : msg)+{-# NOINLINE moduleError #-}++------------------------------------------------------------------------+-- Hughes's efficient sequence type++newtype Sequ a = Sequ ([a] -> [a])++emptySequ :: Sequ a+emptySequ = Sequ (\as -> as)++singleSequ :: a -> Sequ a+singleSequ a = Sequ (\as -> a : as)++(<>) :: Sequ a -> Sequ a -> Sequ a+Sequ x1 <> Sequ x2 = Sequ (\as -> x1 (x2 as))+infixr 5 <>++seqToList :: Sequ a -> [a]+seqToList (Sequ x) = x []++instance Show a => Show (Sequ a) where+    showsPrec d a = showsPrec d (seqToList a)
+ System/Event/Poll.hsc view
@@ -0,0 +1,149 @@+{-# LANGUAGE ForeignFunctionInterface, GeneralizedNewtypeDeriving,+    NoImplicitPrelude #-}++module System.Event.Poll+    (+      new+    , available+    ) where++#include "EventConfig.h"++#if !defined(HAVE_POLL_H)+import GHC.Base++new :: IO E.Backend+new = error "Poll back end not implemented for this platform"++available :: Bool+available = False+{-# INLINE available #-}+#else+#include <poll.h>++import Control.Concurrent.MVar (MVar, newMVar, swapMVar)+import Control.Monad ((=<<), liftM, liftM2, unless)+import Data.Bits (Bits, (.|.), (.&.))+import Data.Maybe (Maybe(..))+import Data.Monoid (Monoid(..))+import Foreign.C.Types (CInt, CShort, CULong)+import Foreign.Ptr (Ptr)+import Foreign.Storable (Storable(..))+import GHC.Base+import GHC.Conc.Sync (withMVar)+import GHC.Err (undefined)+import GHC.Num (Num(..))+import GHC.Real (ceiling, fromIntegral)+import GHC.Show (Show)+import System.Posix.Types (Fd(..))++import qualified System.Event.Array as A+import qualified System.Event.Internal as E++available :: Bool+available = True+{-# INLINE available #-}++data Poll = Poll {+      pollChanges :: {-# UNPACK #-} !(MVar (A.Array PollFd))+    , pollFd      :: {-# UNPACK #-} !(A.Array PollFd)+    }++new :: IO E.Backend+new = E.backend poll modifyFd (\_ -> return ()) `liftM`+      liftM2 Poll (newMVar =<< A.empty) A.empty++modifyFd :: Poll -> Fd -> E.Event -> E.Event -> IO ()+modifyFd p fd oevt nevt =+  withMVar (pollChanges p) $ \ary ->+    A.snoc ary $ PollFd fd (fromEvent nevt) (fromEvent oevt)++reworkFd :: Poll -> PollFd -> IO ()+reworkFd p (PollFd fd npevt opevt) = do+  let ary = pollFd p+  if opevt == 0+    then A.snoc ary $ PollFd fd npevt 0+    else do+      found <- A.findIndex ((== fd) . pfdFd) ary+      case found of+        Nothing        -> error "reworkFd: event not found"+        Just (i,_)+          | npevt /= 0 -> A.unsafeWrite ary i $ PollFd fd npevt 0+          | otherwise  -> A.removeAt ary i++poll :: Poll+     -> E.Timeout+     -> (Fd -> E.Event -> IO ())+     -> IO ()+poll p tout f = do+  let a = pollFd p+  mods <- swapMVar (pollChanges p) =<< A.empty+  A.forM_ mods (reworkFd p)+  n <- A.useAsPtr a $ \ptr len -> E.throwErrnoIfMinus1NoRetry "c_poll" $+         c_poll ptr (fromIntegral len) (fromIntegral (fromTimeout tout))+  unless (n == 0) $ do+    A.loop a 0 $ \i e -> do+      let r = pfdRevents e+      if r /= 0+        then do f (pfdFd e) (toEvent r)+                let i' = i + 1+                return (i', i' == n)+        else return (i, True)++fromTimeout :: E.Timeout -> Int+fromTimeout E.Forever     = -1+fromTimeout (E.Timeout s) = ceiling $ 1000 * s++data PollFd = PollFd {+      pfdFd      :: {-# UNPACK #-} !Fd+    , pfdEvents  :: {-# UNPACK #-} !Event+    , pfdRevents :: {-# UNPACK #-} !Event+    } deriving (Show)++newtype Event = Event CShort+    deriving (Eq, Show, Num, Storable, Bits)++#{enum Event, Event+ , pollIn    = POLLIN+ , pollOut   = POLLOUT+#ifdef POLLRDHUP+ , pollRdHup = POLLRDHUP+#endif+ , pollErr   = POLLERR+ , pollHup   = POLLHUP+ }++fromEvent :: E.Event -> Event+fromEvent e = remap E.evtRead  pollIn .|.+              remap E.evtWrite pollOut+  where remap evt to+            | e `E.eventIs` evt = to+            | otherwise         = 0++toEvent :: Event -> E.Event+toEvent e = remap (pollIn .|. pollErr .|. pollHup)  E.evtRead `mappend`+            remap (pollOut .|. pollErr .|. pollHup) E.evtWrite+  where remap evt to+            | e .&. evt /= 0 = to+            | otherwise      = mempty++instance Storable PollFd where+    sizeOf _    = #size struct pollfd+    alignment _ = alignment (undefined :: CInt)++    peek ptr = do+      fd <- #{peek struct pollfd, fd} ptr+      events <- #{peek struct pollfd, events} ptr+      revents <- #{peek struct pollfd, revents} ptr+      let !pollFd' = PollFd fd events revents+      return pollFd'++    poke ptr p = do+      #{poke struct pollfd, fd} ptr (pfdFd p)+      #{poke struct pollfd, events} ptr (pfdEvents p)+      #{poke struct pollfd, revents} ptr (pfdRevents p)++foreign import ccall safe "poll.h poll"+    c_poll :: Ptr PollFd -> CULong -> CInt -> IO CInt++#endif /* defined(HAVE_POLL_H) */
+ System/Event/Thread.hs view
@@ -0,0 +1,104 @@+{-# LANGUAGE BangPatterns, ForeignFunctionInterface, NoImplicitPrelude #-}++module System.Event.Thread+    (+      ensureIOManagerIsRunning+    , threadWaitRead+    , threadWaitWrite+    , threadDelay+    , registerDelay+    ) where++import Data.IORef (IORef, newIORef, readIORef, writeIORef)+import Data.Maybe (Maybe(..))+import Foreign.Ptr (Ptr)+import GHC.Base+import GHC.Conc.Sync (TVar, ThreadId, ThreadStatus(..), atomically, forkIO,+                      labelThread, modifyMVar_, newTVar, sharedCAF,+                      threadStatus, writeTVar)+import GHC.MVar (MVar, newEmptyMVar, newMVar, putMVar, takeMVar)+import System.Event.Manager (Event, EventManager, evtRead, evtWrite, loop,+                             new, registerFd, unregisterFd_, registerTimeout)+import System.IO.Unsafe (unsafePerformIO)+import System.Posix.Types (Fd)++-- | Suspends the current thread for a given number of microseconds+-- (GHC only).+--+-- There is no guarantee that the thread will be rescheduled promptly+-- when the delay has expired, but the thread will never continue to+-- run /earlier/ than specified.+threadDelay :: Int -> IO ()+threadDelay usecs = do+  Just mgr <- readIORef eventManager+  m <- newEmptyMVar+  _ <- registerTimeout mgr usecs (putMVar m ())+  takeMVar m++-- | Set the value of returned TVar to True after a given number of+-- microseconds. The caveats associated with threadDelay also apply.+--+registerDelay :: Int -> IO (TVar Bool)+registerDelay usecs = do+  t <- atomically $ newTVar False+  Just mgr <- readIORef eventManager+  _ <- registerTimeout mgr usecs . atomically $ writeTVar t True+  return t++-- | Block the current thread until data is available to read from the+-- given file descriptor.+threadWaitRead :: Fd -> IO ()+threadWaitRead = threadWait evtRead+{-# INLINE threadWaitRead #-}++-- | Block the current thread until the given file descriptor can+-- accept data to write.+threadWaitWrite :: Fd -> IO ()+threadWaitWrite = threadWait evtWrite+{-# INLINE threadWaitWrite #-}++threadWait :: Event -> Fd -> IO ()+threadWait evt fd = do+  m <- newEmptyMVar+  Just mgr <- readIORef eventManager+  _ <- registerFd mgr (\reg _ -> unregisterFd_ mgr reg >> putMVar m ()) fd evt+  takeMVar m++foreign import ccall unsafe "getOrSetSystemEventThreadEventManagerStore"+    getOrSetSystemEventThreadEventManagerStore :: Ptr a -> IO (Ptr a)++eventManager :: IORef (Maybe EventManager)+eventManager = unsafePerformIO $ do+    em <- newIORef Nothing+    sharedCAF em getOrSetSystemEventThreadEventManagerStore+{-# NOINLINE eventManager #-}++foreign import ccall unsafe "getOrSetSystemEventThreadIOManagerThreadStore"+    getOrSetSystemEventThreadIOManagerThreadStore :: Ptr a -> IO (Ptr a)++{-# NOINLINE ioManager #-}+ioManager :: MVar (Maybe ThreadId)+ioManager = unsafePerformIO $ do+   m <- newMVar Nothing+   sharedCAF m getOrSetSystemEventThreadIOManagerThreadStore++ensureIOManagerIsRunning :: IO ()+ensureIOManagerIsRunning+  | not threaded = return ()+  | otherwise = modifyMVar_ ioManager $ \old -> do+  let create = do+        !mgr <- new+        writeIORef eventManager $ Just mgr+        !t <- forkIO $ loop mgr+        labelThread t "IOManager"+        return $ Just t+  case old of+    Nothing            -> create+    st@(Just t) -> do+      s <- threadStatus t+      case s of+        ThreadFinished -> create+        ThreadDied     -> create+        _other         -> return st++foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool
+ System/Event/Unique.hs view
@@ -0,0 +1,40 @@+{-# LANGUAGE BangPatterns, GeneralizedNewtypeDeriving, NoImplicitPrelude #-}+module System.Event.Unique+    (+      UniqueSource+    , Unique(..)+    , newSource+    , newUnique+    ) where++import Data.Int (Int64)+import GHC.Base+import GHC.Conc.Sync (TVar, atomically, newTVarIO, readTVar, writeTVar)+import GHC.Num (Num(..))+import GHC.Show (Show(..))++-- We used to use IORefs here, but Simon switched us to STM when we+-- found that our use of atomicModifyIORef was subject to a severe RTS+-- performance problem when used in a tight loop from multiple+-- threads: http://hackage.haskell.org/trac/ghc/ticket/3838+--+-- There seems to be no performance cost to using a TVar instead.++newtype UniqueSource = US (TVar Int64)++newtype Unique = Unique { asInt64 :: Int64 }+    deriving (Eq, Ord, Num)++instance Show Unique where+    show = show . asInt64++newSource :: IO UniqueSource+newSource = US `fmap` newTVarIO 0++newUnique :: UniqueSource -> IO Unique+newUnique (US ref) = atomically $ do+  u <- readTVar ref+  let !u' = u+1+  writeTVar ref u'+  return $ Unique u'+{-# INLINE newUnique #-}
System/Exit.hs view
@@ -44,9 +44,13 @@  -- | Computation 'exitWith' @code@ throws 'ExitCode' @code@. -- Normally this terminates the program, returning @code@ to the--- program's caller.  Before the program terminates, any open or--- semi-closed handles are first closed.+-- program's caller. --+-- On program termination, the standard 'Handle's 'stdout' and+-- 'stderr' are flushed automatically; any other buffered 'Handle's+-- need to be flushed manually, otherwise the buffered data will be+-- discarded.+-- -- A program that fails in any other way is treated as if it had -- called 'exitFailure'. -- A program that terminates successfully without calling 'exitWith'@@ -82,6 +86,6 @@  -- | The computation 'exitSuccess' is equivalent to -- 'exitWith' 'ExitSuccess', It terminates the program--- sucessfully.+-- successfully. exitSuccess :: IO a exitSuccess = exitWith ExitSuccess
System/IO.hs view
@@ -25,6 +25,15 @@      Handle,             -- abstract, instance of: Eq, Show. +    -- | GHC note: a 'Handle' will be automatically closed when the garbage+    -- collector detects that it has become unreferenced by the program.+    -- However, relying on this behaviour is not generally recommended:+    -- the garbage collector is unpredictable.  If possible, use+    -- an explicit 'hClose' to close 'Handle's when they are no longer+    -- required.  GHC does not currently attempt to free up file+    -- descriptors when they have run out, it is your responsibility to+    -- ensure that this doesn't happen.+     -- ** Standard handles      -- | Three handles are allocated during program initialisation,@@ -151,6 +160,7 @@     hPutBuf,                   -- :: Handle -> Ptr a -> Int -> IO ()     hGetBuf,                   -- :: Handle -> Ptr a -> Int -> IO Int #if !defined(__NHC__) && !defined(__HUGS__)+    hGetBufSome,               -- :: Handle -> Ptr a -> Int -> IO Int     hPutBufNonBlocking,        -- :: Handle -> Ptr a -> Int -> IO Int     hGetBufNonBlocking,        -- :: Handle -> Ptr a -> Int -> IO Int #endif@@ -240,6 +250,7 @@ import GHC.IO.Handle.FD import qualified GHC.IO.FD as FD import GHC.IO.Handle+import GHC.IO.Handle.Text ( hGetBufSome ) import GHC.IORef import GHC.IO.Exception ( userError ) import GHC.IO.Encoding@@ -438,7 +449,9 @@ -- | @'withFile' name mode act@ opens a file using 'openFile' and passes -- the resulting handle to the computation @act@.  The handle will be -- closed on exit from 'withFile', whether by normal termination or by--- raising an exception.+-- raising an exception.  If closing the handle raises an exception, then+-- this exception will be raised by 'withFile' rather than any exception+-- raised by 'act'. withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r withFile name mode = bracket (openFile name mode) hClose @@ -470,6 +483,8 @@ -- Assume a unix platform, where text and binary I/O are identical. openBinaryFile = openFile hSetBinaryMode _ _ = return ()++type CMode = Int #endif  -- | The function creates a temporary file in ReadWrite mode.@@ -611,8 +626,7 @@ -- $locking -- Implementations should enforce as far as possible, at least locally to the -- Haskell process, multiple-reader single-writer locking on files.--- That is, /there may either be many handles on the same file which manage--- input, or just one handle on the file which manages output/.  If any+-- That is, /there may either be many handles on the same file which manage input, or just one handle on the file which manages output/.  If any -- open or semi-closed handle is managing a file for output, no new -- handle can be allocated for that file.  If any open or semi-closed -- handle is managing a file for input, new handles can only be allocated
System/IO/Error.hs view
@@ -419,6 +419,7 @@   ioe{ ioe_handle = hdl `mplus` ioe_handle ioe,        ioe_location = loc, ioe_filename = path `mplus` ioe_filename ioe }   where+    mplus :: Maybe a -> Maybe a -> Maybe a     Nothing `mplus` ys = ys     xs      `mplus` _  = xs #endif /* __GLASGOW_HASKELL__ || __HUGS__ */
System/IO/Unsafe.hs view
@@ -28,10 +28,6 @@ #endif  #ifdef __NHC__-import NHC.Internal (unsafePerformIO)+import NHC.Internal (unsafePerformIO, unsafeInterleaveIO) #endif -#if !__GLASGOW_HASKELL__ && !__HUGS__-unsafeInterleaveIO :: IO a -> IO a-unsafeInterleaveIO f = return (unsafePerformIO f)-#endif
System/Posix/Internals.hs view
@@ -311,6 +311,9 @@ foreign import ccall unsafe "consUtils.h get_console_echo__"    get_console_echo :: CInt -> IO CInt +foreign import ccall unsafe "consUtils.h is_console__"+   is_console :: CInt -> IO CInt+ #endif  -- ---------------------------------------------------------------------------@@ -321,12 +324,12 @@ setNonBlockingFD fd set = do   flags <- throwErrnoIfMinus1Retry "setNonBlockingFD"                  (c_fcntl_read fd const_f_getfl)-  -- An error when setting O_NONBLOCK isn't fatal: on some systems -  -- there are certain file handles on which this will fail (eg. /dev/null-  -- on FreeBSD) so we throw away the return code from fcntl_write.   let flags' | set       = flags .|. o_NONBLOCK              | otherwise = flags .&. complement o_NONBLOCK   unless (flags == flags') $ do+    -- An error when setting O_NONBLOCK isn't fatal: on some systems+    -- there are certain file handles on which this will fail (eg. /dev/null+    -- on FreeBSD) so we throw away the return code from fcntl_write.     _ <- c_fcntl_write fd const_f_setfl (fromIntegral flags')     return () #else@@ -390,16 +393,16 @@ foreign import ccall unsafe "HsBase.h __hscore_lstat"    lstat :: CFilePath -> Ptr CStat -> IO CInt -foreign import ccall unsafe "__hscore_open"+foreign import ccall unsafe "HsBase.h __hscore_open"    c_open :: CFilePath -> CInt -> CMode -> IO CInt  foreign import ccall unsafe "HsBase.h read"     c_read :: CInt -> Ptr Word8 -> CSize -> IO CSsize -foreign import ccall safe "read"+foreign import ccall safe "HsBase.h read"    c_safe_read :: CInt -> Ptr Word8 -> CSize -> IO CSsize -foreign import ccall unsafe "__hscore_stat"+foreign import ccall unsafe "HsBase.h __hscore_stat"    c_stat :: CFilePath -> Ptr CStat -> IO CInt  foreign import ccall unsafe "HsBase.h umask"@@ -408,7 +411,7 @@ foreign import ccall unsafe "HsBase.h write"     c_write :: CInt -> Ptr Word8 -> CSize -> IO CSsize -foreign import ccall safe "write"+foreign import ccall safe "HsBase.h write"    c_safe_write :: CInt -> Ptr Word8 -> CSize -> IO CSsize  foreign import ccall unsafe "HsBase.h __hscore_ftruncate"
System/Timeout.hs view
@@ -27,7 +27,6 @@ import Control.Exception   (Exception, handleJust, throwTo, bracket) import Data.Typeable import Data.Unique         (Unique, newUnique)-import GHC.Num  -- An internal type that is thrown as a dynamic exception to -- interrupt the running IO computation when the timeout has
Text/ParserCombinators/ReadP.hs view
@@ -255,9 +255,10 @@ --   in addition returns the exact characters read. --   IMPORTANT NOTE: 'gather' gives a runtime error if its first argument --   is built using any occurrences of readS_to_P. -gather (R m) =-  R (\k -> gath id (m (\a -> return (\s -> k (s,a)))))  +gather (R m)+  = R (\k -> gath id (m (\a -> return (\s -> k (s,a)))))    where+  gath :: (String -> String) -> P (String -> P b) -> P b   gath l (Get f)      = Get (\c -> gath (l.(c:)) (f c))   gath _ Fail         = Fail   gath l (Look f)     = Look (\s -> gath l (f s))@@ -307,7 +308,8 @@ --   Hence NOT the same as (many1 (satisfy p)) munch1 p =   do c <- get-     if p c then do s <- munch p; return (c:s) else pfail+     if p c then do s <- munch p; return (c:s)+            else pfail  choice :: [ReadP a] -> ReadP a -- ^ Combines all parsers in the specified list.
Text/Show/Functions.hs view
@@ -1,3 +1,4 @@+-- This module deliberately declares orphan instances: {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- |
aclocal.m4 view
@@ -179,7 +179,7 @@ # prototype text as its second argument. It also calls AC_LANG_PROGRAM # instead of AC_LANG_CALL AC_DEFUN([FP_SEARCH_LIBS_PROTO],-[AS_VAR_PUSHDEF([ac_Search], [ac_cv_search_$3])dnl+[AS_VAR_PUSHDEF([ac_Search], [ac_cv_search_$1])dnl AC_CACHE_CHECK([for library containing $1], [ac_Search], [ac_func_search_save_LIBS=$LIBS AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])])
base.cabal view
@@ -1,5 +1,5 @@ name:           base-version:        4.2.0.2+version:        4.3.0.0 license:        BSD3 license-file:   LICENSE maintainer:     libraries@haskell.org@@ -13,7 +13,7 @@ build-type: Configure extra-tmp-files:                 config.log config.status autom4te.cache-                include/HsBaseConfig.h+                include/HsBaseConfig.h include/EventConfig.h extra-source-files:                 config.guess config.sub install-sh                 aclocal.m4 configure.ac configure@@ -40,6 +40,9 @@             GHC.Base,             GHC.Classes,             GHC.Conc,+            GHC.Conc.IO,+            GHC.Conc.Signal,+            GHC.Conc.Sync,             GHC.ConsoleHandler,             GHC.Constants,             GHC.Desugar,@@ -95,6 +98,7 @@             System.Timeout         if os(windows)             exposed-modules: GHC.IO.Encoding.CodePage.Table+                             GHC.Conc.Windows         extensions: MagicHash, ExistentialQuantification, Rank2Types,                     ScopedTypeVariables, UnboxedTuples,                     ForeignFunctionInterface, UnliftedFFITypes,@@ -102,7 +106,7 @@                     FlexibleInstances, StandaloneDeriving,                     PatternGuards, EmptyDataDecls, NoImplicitPrelude -        if impl(ghc < 6.10) +        if impl(ghc < 6.10)            -- PatternSignatures was deprecated in 6.10            extensions: PatternSignatures     }@@ -206,9 +210,26 @@         cbits/primFloat.c     include-dirs: include     includes:    HsBase.h-    install-includes:    HsBase.h HsBaseConfig.h WCsubst.h consUtils.h Typeable.h+    install-includes:    HsBase.h HsBaseConfig.h EventConfig.h WCsubst.h consUtils.h Typeable.h     if os(windows) {         extra-libraries: wsock32, user32, shell32+    }+    if !os(windows) {+        exposed-modules:+            System.Event+        other-modules:+            System.Event.Array+            System.Event.Clock+            System.Event.Control+            System.Event.EPoll+            System.Event.IntMap+            System.Event.Internal+            System.Event.KQueue+            System.Event.Manager+            System.Event.PSQ+            System.Event.Poll+            System.Event.Thread+            System.Event.Unique     }     extensions: CPP     -- We need to set the package name to base (without a version number)
cbits/PrelIOUtils.c view
@@ -24,12 +24,28 @@     debugBelch(s,t); } -// Use a C wrapper for this because we avoid hsc2hs in base-#if HAVE_LANGINFO_H-#include <langinfo.h>-char *localeEncoding (void)+#if defined(HAVE_LIBCHARSET)+#  include <libcharset.h>+#elif defined(HAVE_LANGINFO_H)+#  include <langinfo.h>+#endif++#if !defined(mingw32_HOST_OS)+const char* localeEncoding(void) {+#if defined(HAVE_LIBCHARSET)+    return locale_charset();++#elif defined(HAVE_LANGINFO_H)     return nl_langinfo(CODESET);++#else+#warning Depending on the unportable behavior of GNU iconv due to absence of both libcharset and langinfo.h+    /* GNU iconv accepts "" to mean the current locale's+     * encoding. Warning: This isn't portable.+     */+    return "";+#endif } #endif 
cbits/Win32Utils.c view
@@ -61,7 +61,10 @@         {  ERROR_ALREADY_EXISTS,         EEXIST    },  /* 183 */         {  ERROR_FILENAME_EXCED_RANGE,   ENOENT    },  /* 206 */         {  ERROR_NESTING_NOT_ALLOWED,    EAGAIN    },  /* 215 */-        {  ERROR_NOT_ENOUGH_QUOTA,       ENOMEM    }    /* 1816 */+           /* Windows returns this when the read end of a pipe is+            * closed (or closing) and we write to it. */+        {  ERROR_NO_DATA,                EPIPE     },  /* 232 */+        {  ERROR_NOT_ENOUGH_QUOTA,       ENOMEM    }  /* 1816 */ };  /* size of the table */
cbits/consUtils.c view
@@ -14,6 +14,29 @@ #define _get_osfhandle get_osfhandle #endif +int is_console__(int fd) {+    DWORD st;+    HANDLE h;+    if (!_isatty(fd)) {+        /* TTY must be a character device */+        return 0;+    }+    h = (HANDLE)_get_osfhandle(fd);+    if (h == INVALID_HANDLE_VALUE) {+        /* Broken handle can't be terminal */+        return 0;+    }+    if (!GetConsoleMode(h, &st)) {+        /* GetConsoleMode appears to fail when it's not a TTY.  In+           particular, it's what most of our terminal functions+           assume works, so if it doesn't work for all intents+           and purposes we're not dealing with a terminal. */+        return 0;+    }+    return 1;+}++ int set_console_buffering__(int fd, int cooked) {
configure view
@@ -1,12612 +1,10113 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles.-# Generated by GNU Autoconf 2.61 for Haskell base package 1.0.-#-# Report bugs to <libraries@haskell.org>.-#-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.-# This configure script is free software; the Free Software Foundation-# gives unlimited permission to copy, distribute and modify it.-## --------------------- ##-## M4sh Initialization.  ##-## --------------------- ##--# Be more Bourne compatible-DUALCASE=1; export DUALCASE # for MKS sh-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then-  emulate sh-  NULLCMD=:-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which-  # is contrary to our usage.  Disable this feature.-  alias -g '${1+"$@"}'='"$@"'-  setopt NO_GLOB_SUBST-else-  case `(set -o) 2>/dev/null` in-  *posix*) set -o posix ;;-esac--fi-----# PATH needs CR-# Avoid depending upon Character Ranges.-as_cr_letters='abcdefghijklmnopqrstuvwxyz'-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'-as_cr_Letters=$as_cr_letters$as_cr_LETTERS-as_cr_digits='0123456789'-as_cr_alnum=$as_cr_Letters$as_cr_digits--# The user is always right.-if test "${PATH_SEPARATOR+set}" != set; then-  echo "#! /bin/sh" >conf$$.sh-  echo  "exit 0"   >>conf$$.sh-  chmod +x conf$$.sh-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then-    PATH_SEPARATOR=';'-  else-    PATH_SEPARATOR=:-  fi-  rm -f conf$$.sh-fi--# Support unset when possible.-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then-  as_unset=unset-else-  as_unset=false-fi---# IFS-# We need space, tab and new line, in precisely that order.  Quoting is-# there to prevent editors from complaining about space-tab.-# (If _AS_PATH_WALK were called with IFS unset, it would disable word-# splitting by setting IFS to empty value.)-as_nl='-'-IFS=" ""	$as_nl"--# Find who we are.  Look in the path if we contain no directory separator.-case $0 in-  *[\\/]* ) as_myself=$0 ;;-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break-done-IFS=$as_save_IFS--     ;;-esac-# We did not find ourselves, most probably we were run as `sh COMMAND'-# in which case we are not to be found in the path.-if test "x$as_myself" = x; then-  as_myself=$0-fi-if test ! -f "$as_myself"; then-  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2-  { (exit 1); exit 1; }-fi--# Work around bugs in pre-3.0 UWIN ksh.-for as_var in ENV MAIL MAILPATH-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var-done-PS1='$ '-PS2='> '-PS4='+ '--# NLS nuisances.-for as_var in \-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \-  LC_TELEPHONE LC_TIME-do-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then-    eval $as_var=C; export $as_var-  else-    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var-  fi-done--# Required to use basename.-if expr a : '\(a\)' >/dev/null 2>&1 &&-   test "X`expr 00001 : '.*\(...\)'`" = X001; then-  as_expr=expr-else-  as_expr=false-fi--if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then-  as_basename=basename-else-  as_basename=false-fi---# Name of the executable.-as_me=`$as_basename -- "$0" ||-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \-	 X"$0" : 'X\(//\)$' \| \-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||-echo X/"$0" |-    sed '/^.*\/\([^/][^/]*\)\/*$/{-	    s//\1/-	    q-	  }-	  /^X\/\(\/\/\)$/{-	    s//\1/-	    q-	  }-	  /^X\/\(\/\).*/{-	    s//\1/-	    q-	  }-	  s/.*/./; q'`--# CDPATH.-$as_unset CDPATH---if test "x$CONFIG_SHELL" = x; then-  if (eval ":") 2>/dev/null; then-  as_have_required=yes-else-  as_have_required=no-fi--  if test $as_have_required = yes && 	 (eval ":-(as_func_return () {-  (exit \$1)-}-as_func_success () {-  as_func_return 0-}-as_func_failure () {-  as_func_return 1-}-as_func_ret_success () {-  return 0-}-as_func_ret_failure () {-  return 1-}--exitcode=0-if as_func_success; then-  :-else-  exitcode=1-  echo as_func_success failed.-fi--if as_func_failure; then-  exitcode=1-  echo as_func_failure succeeded.-fi--if as_func_ret_success; then-  :-else-  exitcode=1-  echo as_func_ret_success failed.-fi--if as_func_ret_failure; then-  exitcode=1-  echo as_func_ret_failure succeeded.-fi--if ( set x; as_func_ret_success y && test x = \"\$1\" ); then-  :-else-  exitcode=1-  echo positional parameters were not saved.-fi--test \$exitcode = 0) || { (exit 1); exit 1; }--(-  as_lineno_1=\$LINENO-  as_lineno_2=\$LINENO-  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&-  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }-") 2> /dev/null; then-  :-else-  as_candidate_shells=-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-  case $as_dir in-	 /*)-	   for as_base in sh bash ksh sh5; do-	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"-	   done;;-       esac-done-IFS=$as_save_IFS---      for as_shell in $as_candidate_shells $SHELL; do-	 # Try only shells that exist, to save several forks.-	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&-		{ ("$as_shell") 2> /dev/null <<\_ASEOF-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then-  emulate sh-  NULLCMD=:-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which-  # is contrary to our usage.  Disable this feature.-  alias -g '${1+"$@"}'='"$@"'-  setopt NO_GLOB_SUBST-else-  case `(set -o) 2>/dev/null` in-  *posix*) set -o posix ;;-esac--fi---:-_ASEOF-}; then-  CONFIG_SHELL=$as_shell-	       as_have_required=yes-	       if { "$as_shell" 2> /dev/null <<\_ASEOF-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then-  emulate sh-  NULLCMD=:-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which-  # is contrary to our usage.  Disable this feature.-  alias -g '${1+"$@"}'='"$@"'-  setopt NO_GLOB_SUBST-else-  case `(set -o) 2>/dev/null` in-  *posix*) set -o posix ;;-esac--fi---:-(as_func_return () {-  (exit $1)-}-as_func_success () {-  as_func_return 0-}-as_func_failure () {-  as_func_return 1-}-as_func_ret_success () {-  return 0-}-as_func_ret_failure () {-  return 1-}--exitcode=0-if as_func_success; then-  :-else-  exitcode=1-  echo as_func_success failed.-fi--if as_func_failure; then-  exitcode=1-  echo as_func_failure succeeded.-fi--if as_func_ret_success; then-  :-else-  exitcode=1-  echo as_func_ret_success failed.-fi--if as_func_ret_failure; then-  exitcode=1-  echo as_func_ret_failure succeeded.-fi--if ( set x; as_func_ret_success y && test x = "$1" ); then-  :-else-  exitcode=1-  echo positional parameters were not saved.-fi--test $exitcode = 0) || { (exit 1); exit 1; }--(-  as_lineno_1=$LINENO-  as_lineno_2=$LINENO-  test "x$as_lineno_1" != "x$as_lineno_2" &&-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }--_ASEOF-}; then-  break-fi--fi--      done--      if test "x$CONFIG_SHELL" != x; then-  for as_var in BASH_ENV ENV-        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var-        done-        export CONFIG_SHELL-        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}-fi---    if test $as_have_required = no; then-  echo This script requires a shell more modern than all the-      echo shells that I found on your system.  Please install a-      echo modern shell, or manually run the script under such a-      echo shell if you do have one.-      { (exit 1); exit 1; }-fi---fi--fi----(eval "as_func_return () {-  (exit \$1)-}-as_func_success () {-  as_func_return 0-}-as_func_failure () {-  as_func_return 1-}-as_func_ret_success () {-  return 0-}-as_func_ret_failure () {-  return 1-}--exitcode=0-if as_func_success; then-  :-else-  exitcode=1-  echo as_func_success failed.-fi--if as_func_failure; then-  exitcode=1-  echo as_func_failure succeeded.-fi--if as_func_ret_success; then-  :-else-  exitcode=1-  echo as_func_ret_success failed.-fi--if as_func_ret_failure; then-  exitcode=1-  echo as_func_ret_failure succeeded.-fi--if ( set x; as_func_ret_success y && test x = \"\$1\" ); then-  :-else-  exitcode=1-  echo positional parameters were not saved.-fi--test \$exitcode = 0") || {-  echo No shell found that supports shell functions.-  echo Please tell autoconf@gnu.org about your system,-  echo including any error possibly output before this-  echo message-}----  as_lineno_1=$LINENO-  as_lineno_2=$LINENO-  test "x$as_lineno_1" != "x$as_lineno_2" &&-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {--  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO-  # uniformly replaced by the line number.  The first 'sed' inserts a-  # line-number line after each line using $LINENO; the second 'sed'-  # does the real work.  The second script uses 'N' to pair each-  # line-number line with the line containing $LINENO, and appends-  # trailing '-' during substitution so that $LINENO is not a special-  # case at line end.-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the-  # scripts with optimization help from Paolo Bonzini.  Blame Lee-  # E. McMahon (1931-1989) for sed's syntax.  :-)-  sed -n '-    p-    /[$]LINENO/=-  ' <$as_myself |-    sed '-      s/[$]LINENO.*/&-/-      t lineno-      b-      :lineno-      N-      :loop-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/-      t loop-      s/-\n.*//-    ' >$as_me.lineno &&-  chmod +x "$as_me.lineno" ||-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2-   { (exit 1); exit 1; }; }--  # Don't try to exec as it changes $[0], causing all sort of problems-  # (the dirname of $[0] is not the place where we might find the-  # original and so on.  Autoconf is especially sensitive to this).-  . "./$as_me.lineno"-  # Exit status is that of the last command.-  exit-}---if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then-  as_dirname=dirname-else-  as_dirname=false-fi--ECHO_C= ECHO_N= ECHO_T=-case `echo -n x` in--n*)-  case `echo 'x\c'` in-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.-  *)   ECHO_C='\c';;-  esac;;-*)-  ECHO_N='-n';;-esac--if expr a : '\(a\)' >/dev/null 2>&1 &&-   test "X`expr 00001 : '.*\(...\)'`" = X001; then-  as_expr=expr-else-  as_expr=false-fi--rm -f conf$$ conf$$.exe conf$$.file-if test -d conf$$.dir; then-  rm -f conf$$.dir/conf$$.file-else-  rm -f conf$$.dir-  mkdir conf$$.dir-fi-echo >conf$$.file-if ln -s conf$$.file conf$$ 2>/dev/null; then-  as_ln_s='ln -s'-  # ... but there are two gotchas:-  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.-  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.-  # In both cases, we have to default to `cp -p'.-  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||-    as_ln_s='cp -p'-elif ln conf$$.file conf$$ 2>/dev/null; then-  as_ln_s=ln-else-  as_ln_s='cp -p'-fi-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file-rmdir conf$$.dir 2>/dev/null--if mkdir -p . 2>/dev/null; then-  as_mkdir_p=:-else-  test -d ./-p && rmdir ./-p-  as_mkdir_p=false-fi--if test -x / >/dev/null 2>&1; then-  as_test_x='test -x'-else-  if ls -dL / >/dev/null 2>&1; then-    as_ls_L_option=L-  else-    as_ls_L_option=-  fi-  as_test_x='-    eval sh -c '\''-      if test -d "$1"; then-        test -d "$1/.";-      else-	case $1 in-        -*)set "./$1";;-	esac;-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in-	???[sx]*):;;*)false;;esac;fi-    '\'' sh-  '-fi-as_executable_p=$as_test_x--# Sed expression to map a string onto a valid CPP name.-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"--# Sed expression to map a string onto a valid variable name.-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"----exec 7<&0 </dev/null 6>&1--# Name of the host.-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,-# so uname gets run too.-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`--#-# Initializations.-#-ac_default_prefix=/usr/local-ac_clean_files=-ac_config_libobj_dir=.-LIBOBJS=-cross_compiling=no-subdirs=-MFLAGS=-MAKEFLAGS=-SHELL=${CONFIG_SHELL-/bin/sh}--# Identity of this package.-PACKAGE_NAME='Haskell base package'-PACKAGE_TARNAME='base'-PACKAGE_VERSION='1.0'-PACKAGE_STRING='Haskell base package 1.0'-PACKAGE_BUGREPORT='libraries@haskell.org'--ac_unique_file="include/HsBase.h"-# Factoring default headers for most tests.-ac_includes_default="\-#include <stdio.h>-#ifdef HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif-#ifdef HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif-#ifdef STDC_HEADERS-# include <stdlib.h>-# include <stddef.h>-#else-# ifdef HAVE_STDLIB_H-#  include <stdlib.h>-# endif-#endif-#ifdef HAVE_STRING_H-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H-#  include <memory.h>-# endif-# include <string.h>-#endif-#ifdef HAVE_STRINGS_H-# include <strings.h>-#endif-#ifdef HAVE_INTTYPES_H-# include <inttypes.h>-#endif-#ifdef HAVE_STDINT_H-# include <stdint.h>-#endif-#ifdef HAVE_UNISTD_H-# include <unistd.h>-#endif"--ac_subst_vars='SHELL-PATH_SEPARATOR-PACKAGE_NAME-PACKAGE_TARNAME-PACKAGE_VERSION-PACKAGE_STRING-PACKAGE_BUGREPORT-exec_prefix-prefix-program_transform_name-bindir-sbindir-libexecdir-datarootdir-datadir-sysconfdir-sharedstatedir-localstatedir-includedir-oldincludedir-docdir-infodir-htmldir-dvidir-pdfdir-psdir-libdir-localedir-mandir-DEFS-ECHO_C-ECHO_N-ECHO_T-LIBS-build_alias-host_alias-target_alias-CC-CFLAGS-LDFLAGS-CPPFLAGS-ac_ct_CC-EXEEXT-OBJEXT-CPP-GREP-EGREP-ICONV_INCLUDE_DIRS-ICONV_LIB_DIRS-EXTRA_LIBS-LIBOBJS-LTLIBOBJS'-ac_subst_files=''-      ac_precious_vars='build_alias-host_alias-target_alias-CC-CFLAGS-LDFLAGS-LIBS-CPPFLAGS-CPP'---# Initialize some variables set by options.-ac_init_help=-ac_init_version=false-# The variables have the same names as the options, with-# dashes changed to underlines.-cache_file=/dev/null-exec_prefix=NONE-no_create=-no_recursion=-prefix=NONE-program_prefix=NONE-program_suffix=NONE-program_transform_name=s,x,x,-silent=-site=-srcdir=-verbose=-x_includes=NONE-x_libraries=NONE--# Installation directory options.-# These are left unexpanded so users can "make install exec_prefix=/foo"-# and all the variables that are supposed to be based on exec_prefix-# by default will actually change.-# Use braces instead of parens because sh, perl, etc. also accept them.-# (The list follows the same order as the GNU Coding Standards.)-bindir='${exec_prefix}/bin'-sbindir='${exec_prefix}/sbin'-libexecdir='${exec_prefix}/libexec'-datarootdir='${prefix}/share'-datadir='${datarootdir}'-sysconfdir='${prefix}/etc'-sharedstatedir='${prefix}/com'-localstatedir='${prefix}/var'-includedir='${prefix}/include'-oldincludedir='/usr/include'-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'-infodir='${datarootdir}/info'-htmldir='${docdir}'-dvidir='${docdir}'-pdfdir='${docdir}'-psdir='${docdir}'-libdir='${exec_prefix}/lib'-localedir='${datarootdir}/locale'-mandir='${datarootdir}/man'--ac_prev=-ac_dashdash=-for ac_option-do-  # If the previous option needs an argument, assign it.-  if test -n "$ac_prev"; then-    eval $ac_prev=\$ac_option-    ac_prev=-    continue-  fi--  case $ac_option in-  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;-  *)	ac_optarg=yes ;;-  esac--  # Accept the important Cygnus configure options, so we can diagnose typos.--  case $ac_dashdash$ac_option in-  --)-    ac_dashdash=yes ;;--  -bindir | --bindir | --bindi | --bind | --bin | --bi)-    ac_prev=bindir ;;-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)-    bindir=$ac_optarg ;;--  -build | --build | --buil | --bui | --bu)-    ac_prev=build_alias ;;-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)-    build_alias=$ac_optarg ;;--  -cache-file | --cache-file | --cache-fil | --cache-fi \-  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)-    ac_prev=cache_file ;;-  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \-  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)-    cache_file=$ac_optarg ;;--  --config-cache | -C)-    cache_file=config.cache ;;--  -datadir | --datadir | --datadi | --datad)-    ac_prev=datadir ;;-  -datadir=* | --datadir=* | --datadi=* | --datad=*)-    datadir=$ac_optarg ;;--  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \-  | --dataroo | --dataro | --datar)-    ac_prev=datarootdir ;;-  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \-  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)-    datarootdir=$ac_optarg ;;--  -disable-* | --disable-*)-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`-    # Reject names that are not valid shell variable names.-    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2-   { (exit 1); exit 1; }; }-    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`-    eval enable_$ac_feature=no ;;--  -docdir | --docdir | --docdi | --doc | --do)-    ac_prev=docdir ;;-  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)-    docdir=$ac_optarg ;;--  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)-    ac_prev=dvidir ;;-  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)-    dvidir=$ac_optarg ;;--  -enable-* | --enable-*)-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`-    # Reject names that are not valid shell variable names.-    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2-   { (exit 1); exit 1; }; }-    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`-    eval enable_$ac_feature=\$ac_optarg ;;--  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \-  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \-  | --exec | --exe | --ex)-    ac_prev=exec_prefix ;;-  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \-  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \-  | --exec=* | --exe=* | --ex=*)-    exec_prefix=$ac_optarg ;;--  -gas | --gas | --ga | --g)-    # Obsolete; use --with-gas.-    with_gas=yes ;;--  -help | --help | --hel | --he | -h)-    ac_init_help=long ;;-  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)-    ac_init_help=recursive ;;-  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)-    ac_init_help=short ;;--  -host | --host | --hos | --ho)-    ac_prev=host_alias ;;-  -host=* | --host=* | --hos=* | --ho=*)-    host_alias=$ac_optarg ;;--  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)-    ac_prev=htmldir ;;-  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \-  | --ht=*)-    htmldir=$ac_optarg ;;--  -includedir | --includedir | --includedi | --included | --include \-  | --includ | --inclu | --incl | --inc)-    ac_prev=includedir ;;-  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \-  | --includ=* | --inclu=* | --incl=* | --inc=*)-    includedir=$ac_optarg ;;--  -infodir | --infodir | --infodi | --infod | --info | --inf)-    ac_prev=infodir ;;-  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)-    infodir=$ac_optarg ;;--  -libdir | --libdir | --libdi | --libd)-    ac_prev=libdir ;;-  -libdir=* | --libdir=* | --libdi=* | --libd=*)-    libdir=$ac_optarg ;;--  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \-  | --libexe | --libex | --libe)-    ac_prev=libexecdir ;;-  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \-  | --libexe=* | --libex=* | --libe=*)-    libexecdir=$ac_optarg ;;--  -localedir | --localedir | --localedi | --localed | --locale)-    ac_prev=localedir ;;-  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)-    localedir=$ac_optarg ;;--  -localstatedir | --localstatedir | --localstatedi | --localstated \-  | --localstate | --localstat | --localsta | --localst | --locals)-    ac_prev=localstatedir ;;-  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \-  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)-    localstatedir=$ac_optarg ;;--  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)-    ac_prev=mandir ;;-  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)-    mandir=$ac_optarg ;;--  -nfp | --nfp | --nf)-    # Obsolete; use --without-fp.-    with_fp=no ;;--  -no-create | --no-create | --no-creat | --no-crea | --no-cre \-  | --no-cr | --no-c | -n)-    no_create=yes ;;--  -no-recursion | --no-recursion | --no-recursio | --no-recursi \-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)-    no_recursion=yes ;;--  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \-  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \-  | --oldin | --oldi | --old | --ol | --o)-    ac_prev=oldincludedir ;;-  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \-  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \-  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)-    oldincludedir=$ac_optarg ;;--  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)-    ac_prev=prefix ;;-  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)-    prefix=$ac_optarg ;;--  -program-prefix | --program-prefix | --program-prefi | --program-pref \-  | --program-pre | --program-pr | --program-p)-    ac_prev=program_prefix ;;-  -program-prefix=* | --program-prefix=* | --program-prefi=* \-  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)-    program_prefix=$ac_optarg ;;--  -program-suffix | --program-suffix | --program-suffi | --program-suff \-  | --program-suf | --program-su | --program-s)-    ac_prev=program_suffix ;;-  -program-suffix=* | --program-suffix=* | --program-suffi=* \-  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)-    program_suffix=$ac_optarg ;;--  -program-transform-name | --program-transform-name \-  | --program-transform-nam | --program-transform-na \-  | --program-transform-n | --program-transform- \-  | --program-transform | --program-transfor \-  | --program-transfo | --program-transf \-  | --program-trans | --program-tran \-  | --progr-tra | --program-tr | --program-t)-    ac_prev=program_transform_name ;;-  -program-transform-name=* | --program-transform-name=* \-  | --program-transform-nam=* | --program-transform-na=* \-  | --program-transform-n=* | --program-transform-=* \-  | --program-transform=* | --program-transfor=* \-  | --program-transfo=* | --program-transf=* \-  | --program-trans=* | --program-tran=* \-  | --progr-tra=* | --program-tr=* | --program-t=*)-    program_transform_name=$ac_optarg ;;--  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)-    ac_prev=pdfdir ;;-  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)-    pdfdir=$ac_optarg ;;--  -psdir | --psdir | --psdi | --psd | --ps)-    ac_prev=psdir ;;-  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)-    psdir=$ac_optarg ;;--  -q | -quiet | --quiet | --quie | --qui | --qu | --q \-  | -silent | --silent | --silen | --sile | --sil)-    silent=yes ;;--  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)-    ac_prev=sbindir ;;-  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \-  | --sbi=* | --sb=*)-    sbindir=$ac_optarg ;;--  -sharedstatedir | --sharedstatedir | --sharedstatedi \-  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \-  | --sharedst | --shareds | --shared | --share | --shar \-  | --sha | --sh)-    ac_prev=sharedstatedir ;;-  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \-  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \-  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \-  | --sha=* | --sh=*)-    sharedstatedir=$ac_optarg ;;--  -site | --site | --sit)-    ac_prev=site ;;-  -site=* | --site=* | --sit=*)-    site=$ac_optarg ;;--  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)-    ac_prev=srcdir ;;-  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)-    srcdir=$ac_optarg ;;--  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \-  | --syscon | --sysco | --sysc | --sys | --sy)-    ac_prev=sysconfdir ;;-  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \-  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)-    sysconfdir=$ac_optarg ;;--  -target | --target | --targe | --targ | --tar | --ta | --t)-    ac_prev=target_alias ;;-  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)-    target_alias=$ac_optarg ;;--  -v | -verbose | --verbose | --verbos | --verbo | --verb)-    verbose=yes ;;--  -version | --version | --versio | --versi | --vers | -V)-    ac_init_version=: ;;--  -with-* | --with-*)-    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`-    # Reject names that are not valid shell variable names.-    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&-      { echo "$as_me: error: invalid package name: $ac_package" >&2-   { (exit 1); exit 1; }; }-    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`-    eval with_$ac_package=\$ac_optarg ;;--  -without-* | --without-*)-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`-    # Reject names that are not valid shell variable names.-    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&-      { echo "$as_me: error: invalid package name: $ac_package" >&2-   { (exit 1); exit 1; }; }-    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`-    eval with_$ac_package=no ;;--  --x)-    # Obsolete; use --with-x.-    with_x=yes ;;--  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \-  | --x-incl | --x-inc | --x-in | --x-i)-    ac_prev=x_includes ;;-  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \-  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)-    x_includes=$ac_optarg ;;--  -x-libraries | --x-libraries | --x-librarie | --x-librari \-  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)-    ac_prev=x_libraries ;;-  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \-  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)-    x_libraries=$ac_optarg ;;--  -*) { echo "$as_me: error: unrecognized option: $ac_option-Try \`$0 --help' for more information." >&2-   { (exit 1); exit 1; }; }-    ;;--  *=*)-    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`-    # Reject names that are not valid shell variable names.-    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&-      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2-   { (exit 1); exit 1; }; }-    eval $ac_envvar=\$ac_optarg-    export $ac_envvar ;;--  *)-    # FIXME: should be removed in autoconf 3.0.-    echo "$as_me: WARNING: you should use --build, --host, --target" >&2-    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&-      echo "$as_me: WARNING: invalid host type: $ac_option" >&2-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}-    ;;--  esac-done--if test -n "$ac_prev"; then-  ac_option=--`echo $ac_prev | sed 's/_/-/g'`-  { echo "$as_me: error: missing argument to $ac_option" >&2-   { (exit 1); exit 1; }; }-fi--# Be sure to have absolute directory names.-for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \-		datadir sysconfdir sharedstatedir localstatedir includedir \-		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \-		libdir localedir mandir-do-  eval ac_val=\$$ac_var-  case $ac_val in-    [\\/$]* | ?:[\\/]* )  continue;;-    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;-  esac-  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2-   { (exit 1); exit 1; }; }-done--# There might be people who depend on the old broken behavior: `$host'-# used to hold the argument of --host etc.-# FIXME: To remove some day.-build=$build_alias-host=$host_alias-target=$target_alias--# FIXME: To remove some day.-if test "x$host_alias" != x; then-  if test "x$build_alias" = x; then-    cross_compiling=maybe-    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.-    If a cross compiler is detected then cross compile mode will be used." >&2-  elif test "x$build_alias" != "x$host_alias"; then-    cross_compiling=yes-  fi-fi--ac_tool_prefix=-test -n "$host_alias" && ac_tool_prefix=$host_alias---test "$silent" = yes && exec 6>/dev/null---ac_pwd=`pwd` && test -n "$ac_pwd" &&-ac_ls_di=`ls -di .` &&-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||-  { echo "$as_me: error: Working directory cannot be determined" >&2-   { (exit 1); exit 1; }; }-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||-  { echo "$as_me: error: pwd does not report name of working directory" >&2-   { (exit 1); exit 1; }; }---# Find the source files, if location was not specified.-if test -z "$srcdir"; then-  ac_srcdir_defaulted=yes-  # Try the directory containing this script, then the parent directory.-  ac_confdir=`$as_dirname -- "$0" ||-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \-	 X"$0" : 'X\(//\)[^/]' \| \-	 X"$0" : 'X\(//\)$' \| \-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||-echo X"$0" |-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{-	    s//\1/-	    q-	  }-	  /^X\(\/\/\)[^/].*/{-	    s//\1/-	    q-	  }-	  /^X\(\/\/\)$/{-	    s//\1/-	    q-	  }-	  /^X\(\/\).*/{-	    s//\1/-	    q-	  }-	  s/.*/./; q'`-  srcdir=$ac_confdir-  if test ! -r "$srcdir/$ac_unique_file"; then-    srcdir=..-  fi-else-  ac_srcdir_defaulted=no-fi-if test ! -r "$srcdir/$ac_unique_file"; then-  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."-  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2-   { (exit 1); exit 1; }; }-fi-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"-ac_abs_confdir=`(-	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2-   { (exit 1); exit 1; }; }-	pwd)`-# When building in place, set srcdir=.-if test "$ac_abs_confdir" = "$ac_pwd"; then-  srcdir=.-fi-# Remove unnecessary trailing slashes from srcdir.-# Double slashes in file names in object file debugging info-# mess up M-x gdb in Emacs.-case $srcdir in-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;-esac-for ac_var in $ac_precious_vars; do-  eval ac_env_${ac_var}_set=\${${ac_var}+set}-  eval ac_env_${ac_var}_value=\$${ac_var}-  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}-  eval ac_cv_env_${ac_var}_value=\$${ac_var}-done--#-# Report the --help message.-#-if test "$ac_init_help" = "long"; then-  # Omit some internal or obsolete options to make the list less imposing.-  # This message is too long to be a string in the A/UX 3.1 sh.-  cat <<_ACEOF-\`configure' configures Haskell base package 1.0 to adapt to many kinds of systems.--Usage: $0 [OPTION]... [VAR=VALUE]...--To assign environment variables (e.g., CC, CFLAGS...), specify them as-VAR=VALUE.  See below for descriptions of some of the useful variables.--Defaults for the options are specified in brackets.--Configuration:-  -h, --help              display this help and exit-      --help=short        display options specific to this package-      --help=recursive    display the short help of all the included packages-  -V, --version           display version information and exit-  -q, --quiet, --silent   do not print \`checking...' messages-      --cache-file=FILE   cache test results in FILE [disabled]-  -C, --config-cache      alias for \`--cache-file=config.cache'-  -n, --no-create         do not create output files-      --srcdir=DIR        find the sources in DIR [configure dir or \`..']--Installation directories:-  --prefix=PREFIX         install architecture-independent files in PREFIX-			  [$ac_default_prefix]-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX-			  [PREFIX]--By default, \`make install' will install all the files in-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify-an installation prefix other than \`$ac_default_prefix' using \`--prefix',-for instance \`--prefix=\$HOME'.--For better control, use the options below.--Fine tuning of the installation directories:-  --bindir=DIR           user executables [EPREFIX/bin]-  --sbindir=DIR          system admin executables [EPREFIX/sbin]-  --libexecdir=DIR       program executables [EPREFIX/libexec]-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]-  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]-  --libdir=DIR           object code libraries [EPREFIX/lib]-  --includedir=DIR       C header files [PREFIX/include]-  --oldincludedir=DIR    C header files for non-gcc [/usr/include]-  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]-  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]-  --infodir=DIR          info documentation [DATAROOTDIR/info]-  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]-  --mandir=DIR           man documentation [DATAROOTDIR/man]-  --docdir=DIR           documentation root [DATAROOTDIR/doc/base]-  --htmldir=DIR          html documentation [DOCDIR]-  --dvidir=DIR           dvi documentation [DOCDIR]-  --pdfdir=DIR           pdf documentation [DOCDIR]-  --psdir=DIR            ps documentation [DOCDIR]-_ACEOF--  cat <<\_ACEOF-_ACEOF-fi--if test -n "$ac_init_help"; then-  case $ac_init_help in-     short | recursive ) echo "Configuration of Haskell base package 1.0:";;-   esac-  cat <<\_ACEOF--Optional Features:-  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]-  --disable-largefile     omit support for large files--Optional Packages:-  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)-C compiler-  --with-iconv-includes   directory containing iconv.h-  --with-iconv-libraries  directory containing iconv library--Some influential environment variables:-  CC          C compiler command-  CFLAGS      C compiler flags-  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a-              nonstandard directory <lib dir>-  LIBS        libraries to pass to the linker, e.g. -l<library>-  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if-              you have headers in a nonstandard directory <include dir>-  CPP         C preprocessor--Use these variables to override the choices made by `configure' or to help-it to find libraries and programs with nonstandard names/locations.--Report bugs to <libraries@haskell.org>.-_ACEOF-ac_status=$?-fi--if test "$ac_init_help" = "recursive"; then-  # If there are subdirs, report their specific --help.-  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue-    test -d "$ac_dir" || continue-    ac_builddir=.--case "$ac_dir" in-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;-*)-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`-  # A ".." for each directory in $ac_dir_suffix.-  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`-  case $ac_top_builddir_sub in-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;-  esac ;;-esac-ac_abs_top_builddir=$ac_pwd-ac_abs_builddir=$ac_pwd$ac_dir_suffix-# for backward compatibility:-ac_top_builddir=$ac_top_build_prefix--case $srcdir in-  .)  # We are building in place.-    ac_srcdir=.-    ac_top_srcdir=$ac_top_builddir_sub-    ac_abs_top_srcdir=$ac_pwd ;;-  [\\/]* | ?:[\\/]* )  # Absolute name.-    ac_srcdir=$srcdir$ac_dir_suffix;-    ac_top_srcdir=$srcdir-    ac_abs_top_srcdir=$srcdir ;;-  *) # Relative name.-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix-    ac_top_srcdir=$ac_top_build_prefix$srcdir-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;-esac-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix--    cd "$ac_dir" || { ac_status=$?; continue; }-    # Check for guested configure.-    if test -f "$ac_srcdir/configure.gnu"; then-      echo &&-      $SHELL "$ac_srcdir/configure.gnu" --help=recursive-    elif test -f "$ac_srcdir/configure"; then-      echo &&-      $SHELL "$ac_srcdir/configure" --help=recursive-    else-      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2-    fi || ac_status=$?-    cd "$ac_pwd" || { ac_status=$?; break; }-  done-fi--test -n "$ac_init_help" && exit $ac_status-if $ac_init_version; then-  cat <<\_ACEOF-Haskell base package configure 1.0-generated by GNU Autoconf 2.61--Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.-This configure script is free software; the Free Software Foundation-gives unlimited permission to copy, distribute and modify it.-_ACEOF-  exit-fi-cat >config.log <<_ACEOF-This file contains any messages produced by compilers while-running configure, to aid debugging if configure makes a mistake.--It was created by Haskell base package $as_me 1.0, which was-generated by GNU Autoconf 2.61.  Invocation command line was--  $ $0 $@--_ACEOF-exec 5>>config.log-{-cat <<_ASUNAME-## --------- ##-## Platform. ##-## --------- ##--hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`-uname -m = `(uname -m) 2>/dev/null || echo unknown`-uname -r = `(uname -r) 2>/dev/null || echo unknown`-uname -s = `(uname -s) 2>/dev/null || echo unknown`-uname -v = `(uname -v) 2>/dev/null || echo unknown`--/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`--/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`-/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`-/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`-/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`--_ASUNAME--as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-  echo "PATH: $as_dir"-done-IFS=$as_save_IFS--} >&5--cat >&5 <<_ACEOF---## ----------- ##-## Core tests. ##-## ----------- ##--_ACEOF---# Keep a trace of the command line.-# Strip out --no-create and --no-recursion so they do not pile up.-# Strip out --silent because we don't want to record it for future runs.-# Also quote any args containing shell meta-characters.-# Make two passes to allow for proper duplicate-argument suppression.-ac_configure_args=-ac_configure_args0=-ac_configure_args1=-ac_must_keep_next=false-for ac_pass in 1 2-do-  for ac_arg-  do-    case $ac_arg in-    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;-    -q | -quiet | --quiet | --quie | --qui | --qu | --q \-    | -silent | --silent | --silen | --sile | --sil)-      continue ;;-    *\'*)-      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;-    esac-    case $ac_pass in-    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;-    2)-      ac_configure_args1="$ac_configure_args1 '$ac_arg'"-      if test $ac_must_keep_next = true; then-	ac_must_keep_next=false # Got value, back to normal.-      else-	case $ac_arg in-	  *=* | --config-cache | -C | -disable-* | --disable-* \-	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \-	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \-	  | -with-* | --with-* | -without-* | --without-* | --x)-	    case "$ac_configure_args0 " in-	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;-	    esac-	    ;;-	  -* ) ac_must_keep_next=true ;;-	esac-      fi-      ac_configure_args="$ac_configure_args '$ac_arg'"-      ;;-    esac-  done-done-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }--# When interrupted or exit'd, cleanup temporary files, and complete-# config.log.  We remove comments because anyway the quotes in there-# would cause problems or look ugly.-# WARNING: Use '\'' to represent an apostrophe within the trap.-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.-trap 'exit_status=$?-  # Save into config.log some information that might help in debugging.-  {-    echo--    cat <<\_ASBOX-## ---------------- ##-## Cache variables. ##-## ---------------- ##-_ASBOX-    echo-    # The following way of writing the cache mishandles newlines in values,-(-  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do-    eval ac_val=\$$ac_var-    case $ac_val in #(-    *${as_nl}*)-      case $ac_var in #(-      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;-      esac-      case $ac_var in #(-      _ | IFS | as_nl) ;; #(-      *) $as_unset $ac_var ;;-      esac ;;-    esac-  done-  (set) 2>&1 |-    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(-    *${as_nl}ac_space=\ *)-      sed -n \-	"s/'\''/'\''\\\\'\'''\''/g;-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"-      ;; #(-    *)-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"-      ;;-    esac |-    sort-)-    echo--    cat <<\_ASBOX-## ----------------- ##-## Output variables. ##-## ----------------- ##-_ASBOX-    echo-    for ac_var in $ac_subst_vars-    do-      eval ac_val=\$$ac_var-      case $ac_val in-      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;-      esac-      echo "$ac_var='\''$ac_val'\''"-    done | sort-    echo--    if test -n "$ac_subst_files"; then-      cat <<\_ASBOX-## ------------------- ##-## File substitutions. ##-## ------------------- ##-_ASBOX-      echo-      for ac_var in $ac_subst_files-      do-	eval ac_val=\$$ac_var-	case $ac_val in-	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;-	esac-	echo "$ac_var='\''$ac_val'\''"-      done | sort-      echo-    fi--    if test -s confdefs.h; then-      cat <<\_ASBOX-## ----------- ##-## confdefs.h. ##-## ----------- ##-_ASBOX-      echo-      cat confdefs.h-      echo-    fi-    test "$ac_signal" != 0 &&-      echo "$as_me: caught signal $ac_signal"-    echo "$as_me: exit $exit_status"-  } >&5-  rm -f core *.core core.conftest.* &&-    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&-    exit $exit_status-' 0-for ac_signal in 1 2 13 15; do-  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal-done-ac_signal=0--# confdefs.h avoids OS command line length limits that DEFS can exceed.-rm -f -r conftest* confdefs.h--# Predefined preprocessor variables.--cat >>confdefs.h <<_ACEOF-#define PACKAGE_NAME "$PACKAGE_NAME"-_ACEOF---cat >>confdefs.h <<_ACEOF-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"-_ACEOF---cat >>confdefs.h <<_ACEOF-#define PACKAGE_VERSION "$PACKAGE_VERSION"-_ACEOF---cat >>confdefs.h <<_ACEOF-#define PACKAGE_STRING "$PACKAGE_STRING"-_ACEOF---cat >>confdefs.h <<_ACEOF-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"-_ACEOF---# Let the site file select an alternate cache file if it wants to.-# Prefer explicitly selected file to automatically selected ones.-if test -n "$CONFIG_SITE"; then-  set x "$CONFIG_SITE"-elif test "x$prefix" != xNONE; then-  set x "$prefix/share/config.site" "$prefix/etc/config.site"-else-  set x "$ac_default_prefix/share/config.site" \-	"$ac_default_prefix/etc/config.site"-fi-shift-for ac_site_file-do-  if test -r "$ac_site_file"; then-    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5-echo "$as_me: loading site script $ac_site_file" >&6;}-    sed 's/^/| /' "$ac_site_file" >&5-    . "$ac_site_file"-  fi-done--if test -r "$cache_file"; then-  # Some versions of bash will fail to source /dev/null (special-  # files actually), so we avoid doing that.-  if test -f "$cache_file"; then-    { echo "$as_me:$LINENO: loading cache $cache_file" >&5-echo "$as_me: loading cache $cache_file" >&6;}-    case $cache_file in-      [\\/]* | ?:[\\/]* ) . "$cache_file";;-      *)                      . "./$cache_file";;-    esac-  fi-else-  { echo "$as_me:$LINENO: creating cache $cache_file" >&5-echo "$as_me: creating cache $cache_file" >&6;}-  >$cache_file-fi--# Check that the precious variables saved in the cache have kept the same-# value.-ac_cache_corrupted=false-for ac_var in $ac_precious_vars; do-  eval ac_old_set=\$ac_cv_env_${ac_var}_set-  eval ac_new_set=\$ac_env_${ac_var}_set-  eval ac_old_val=\$ac_cv_env_${ac_var}_value-  eval ac_new_val=\$ac_env_${ac_var}_value-  case $ac_old_set,$ac_new_set in-    set,)-      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}-      ac_cache_corrupted=: ;;-    ,set)-      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}-      ac_cache_corrupted=: ;;-    ,);;-    *)-      if test "x$ac_old_val" != "x$ac_new_val"; then-	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}-	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5-echo "$as_me:   former value:  $ac_old_val" >&2;}-	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5-echo "$as_me:   current value: $ac_new_val" >&2;}-	ac_cache_corrupted=:-      fi;;-  esac-  # Pass precious variables to config.status.-  if test "$ac_new_set" = set; then-    case $ac_new_val in-    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;-    *) ac_arg=$ac_var=$ac_new_val ;;-    esac-    case " $ac_configure_args " in-      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.-      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;-    esac-  fi-done-if $ac_cache_corrupted; then-  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5-echo "$as_me: error: changes in the environment can compromise the build" >&2;}-  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}-   { (exit 1); exit 1; }; }-fi--------------------------ac_ext=c-ac_cpp='$CPP $CPPFLAGS'-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'-ac_compiler_gnu=$ac_cv_c_compiler_gnu----# Safety check: Ensure that we are in the correct source directory.---ac_config_headers="$ac_config_headers include/HsBaseConfig.h"----# Check whether --with-cc was given.-if test "${with_cc+set}" = set; then-  withval=$with_cc; CC=$withval-fi--ac_ext=c-ac_cpp='$CPP $CPPFLAGS'-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'-ac_compiler_gnu=$ac_cv_c_compiler_gnu-if test -n "$ac_tool_prefix"; then-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.-set dummy ${ac_tool_prefix}gcc; ac_word=$2-{ echo "$as_me:$LINENO: checking for $ac_word" >&5-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }-if test "${ac_cv_prog_CC+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  if test -n "$CC"; then-  ac_cv_prog_CC="$CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-  for ac_exec_ext in '' $ac_executable_extensions; do-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then-    ac_cv_prog_CC="${ac_tool_prefix}gcc"-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5-    break 2-  fi-done-done-IFS=$as_save_IFS--fi-fi-CC=$ac_cv_prog_CC-if test -n "$CC"; then-  { echo "$as_me:$LINENO: result: $CC" >&5-echo "${ECHO_T}$CC" >&6; }-else-  { echo "$as_me:$LINENO: result: no" >&5-echo "${ECHO_T}no" >&6; }-fi---fi-if test -z "$ac_cv_prog_CC"; then-  ac_ct_CC=$CC-  # Extract the first word of "gcc", so it can be a program name with args.-set dummy gcc; ac_word=$2-{ echo "$as_me:$LINENO: checking for $ac_word" >&5-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  if test -n "$ac_ct_CC"; then-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-  for ac_exec_ext in '' $ac_executable_extensions; do-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then-    ac_cv_prog_ac_ct_CC="gcc"-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5-    break 2-  fi-done-done-IFS=$as_save_IFS--fi-fi-ac_ct_CC=$ac_cv_prog_ac_ct_CC-if test -n "$ac_ct_CC"; then-  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5-echo "${ECHO_T}$ac_ct_CC" >&6; }-else-  { echo "$as_me:$LINENO: result: no" >&5-echo "${ECHO_T}no" >&6; }-fi--  if test "x$ac_ct_CC" = x; then-    CC=""-  else-    case $cross_compiling:$ac_tool_warned in-yes:)-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools-whose name does not start with the host triplet.  If you think this-configuration is useful to you, please write to autoconf@gnu.org." >&5-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools-whose name does not start with the host triplet.  If you think this-configuration is useful to you, please write to autoconf@gnu.org." >&2;}-ac_tool_warned=yes ;;-esac-    CC=$ac_ct_CC-  fi-else-  CC="$ac_cv_prog_CC"-fi--if test -z "$CC"; then-          if test -n "$ac_tool_prefix"; then-    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.-set dummy ${ac_tool_prefix}cc; ac_word=$2-{ echo "$as_me:$LINENO: checking for $ac_word" >&5-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }-if test "${ac_cv_prog_CC+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  if test -n "$CC"; then-  ac_cv_prog_CC="$CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-  for ac_exec_ext in '' $ac_executable_extensions; do-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then-    ac_cv_prog_CC="${ac_tool_prefix}cc"-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5-    break 2-  fi-done-done-IFS=$as_save_IFS--fi-fi-CC=$ac_cv_prog_CC-if test -n "$CC"; then-  { echo "$as_me:$LINENO: result: $CC" >&5-echo "${ECHO_T}$CC" >&6; }-else-  { echo "$as_me:$LINENO: result: no" >&5-echo "${ECHO_T}no" >&6; }-fi---  fi-fi-if test -z "$CC"; then-  # Extract the first word of "cc", so it can be a program name with args.-set dummy cc; ac_word=$2-{ echo "$as_me:$LINENO: checking for $ac_word" >&5-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }-if test "${ac_cv_prog_CC+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  if test -n "$CC"; then-  ac_cv_prog_CC="$CC" # Let the user override the test.-else-  ac_prog_rejected=no-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-  for ac_exec_ext in '' $ac_executable_extensions; do-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then-       ac_prog_rejected=yes-       continue-     fi-    ac_cv_prog_CC="cc"-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5-    break 2-  fi-done-done-IFS=$as_save_IFS--if test $ac_prog_rejected = yes; then-  # We found a bogon in the path, so make sure we never use it.-  set dummy $ac_cv_prog_CC-  shift-  if test $# != 0; then-    # We chose a different compiler from the bogus one.-    # However, it has the same basename, so the bogon will be chosen-    # first if we set CC to just the basename; use the full file name.-    shift-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"-  fi-fi-fi-fi-CC=$ac_cv_prog_CC-if test -n "$CC"; then-  { echo "$as_me:$LINENO: result: $CC" >&5-echo "${ECHO_T}$CC" >&6; }-else-  { echo "$as_me:$LINENO: result: no" >&5-echo "${ECHO_T}no" >&6; }-fi---fi-if test -z "$CC"; then-  if test -n "$ac_tool_prefix"; then-  for ac_prog in cl.exe-  do-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.-set dummy $ac_tool_prefix$ac_prog; ac_word=$2-{ echo "$as_me:$LINENO: checking for $ac_word" >&5-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }-if test "${ac_cv_prog_CC+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  if test -n "$CC"; then-  ac_cv_prog_CC="$CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-  for ac_exec_ext in '' $ac_executable_extensions; do-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5-    break 2-  fi-done-done-IFS=$as_save_IFS--fi-fi-CC=$ac_cv_prog_CC-if test -n "$CC"; then-  { echo "$as_me:$LINENO: result: $CC" >&5-echo "${ECHO_T}$CC" >&6; }-else-  { echo "$as_me:$LINENO: result: no" >&5-echo "${ECHO_T}no" >&6; }-fi---    test -n "$CC" && break-  done-fi-if test -z "$CC"; then-  ac_ct_CC=$CC-  for ac_prog in cl.exe-do-  # Extract the first word of "$ac_prog", so it can be a program name with args.-set dummy $ac_prog; ac_word=$2-{ echo "$as_me:$LINENO: checking for $ac_word" >&5-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  if test -n "$ac_ct_CC"; then-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.-else-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-  for ac_exec_ext in '' $ac_executable_extensions; do-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then-    ac_cv_prog_ac_ct_CC="$ac_prog"-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5-    break 2-  fi-done-done-IFS=$as_save_IFS--fi-fi-ac_ct_CC=$ac_cv_prog_ac_ct_CC-if test -n "$ac_ct_CC"; then-  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5-echo "${ECHO_T}$ac_ct_CC" >&6; }-else-  { echo "$as_me:$LINENO: result: no" >&5-echo "${ECHO_T}no" >&6; }-fi---  test -n "$ac_ct_CC" && break-done--  if test "x$ac_ct_CC" = x; then-    CC=""-  else-    case $cross_compiling:$ac_tool_warned in-yes:)-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools-whose name does not start with the host triplet.  If you think this-configuration is useful to you, please write to autoconf@gnu.org." >&5-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools-whose name does not start with the host triplet.  If you think this-configuration is useful to you, please write to autoconf@gnu.org." >&2;}-ac_tool_warned=yes ;;-esac-    CC=$ac_ct_CC-  fi-fi--fi---test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH-See \`config.log' for more details." >&5-echo "$as_me: error: no acceptable C compiler found in \$PATH-See \`config.log' for more details." >&2;}-   { (exit 1); exit 1; }; }--# Provide some information about the compiler.-echo "$as_me:$LINENO: checking for C compiler version" >&5-ac_compiler=`set X $ac_compile; echo $2`-{ (ac_try="$ac_compiler --version >&5"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compiler --version >&5") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }-{ (ac_try="$ac_compiler -v >&5"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compiler -v >&5") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }-{ (ac_try="$ac_compiler -V >&5"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compiler -V >&5") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }--cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */--int-main ()-{--  ;-  return 0;-}-_ACEOF-ac_clean_files_save=$ac_clean_files-ac_clean_files="$ac_clean_files a.out a.exe b.out"-# Try to create an executable without -o first, disregard a.out.-# It will help us diagnose broken compilers, and finding out an intuition-# of exeext.-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`-#-# List of possible output files, starting from the most likely.-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)-# only as a last resort.  b.out is created by i960 compilers.-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'-#-# The IRIX 6 linker writes into existing files which may not be-# executable, retaining their permissions.  Remove them first so a-# subsequent execution test works.-ac_rmfiles=-for ac_file in $ac_files-do-  case $ac_file in-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;-    * ) ac_rmfiles="$ac_rmfiles $ac_file";;-  esac-done-rm -f $ac_rmfiles--if { (ac_try="$ac_link_default"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link_default") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; then-  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'-# in a Makefile.  We should not override ac_cv_exeext if it was cached,-# so that the user can short-circuit this test for compilers unknown to-# Autoconf.-for ac_file in $ac_files ''-do-  test -f "$ac_file" || continue-  case $ac_file in-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )-	;;-    [ab].out )-	# We found the default executable, but exeext='' is most-	# certainly right.-	break;;-    *.* )-        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;-	then :; else-	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`-	fi-	# We set ac_cv_exeext here because the later test for it is not-	# safe: cross compilers may not add the suffix if given an `-o'-	# argument, so we may need to know it at that point already.-	# Even if this section looks crufty: it has the advantage of-	# actually working.-	break;;-    * )-	break;;-  esac-done-test "$ac_cv_exeext" = no && ac_cv_exeext=--else-  ac_file=''-fi--{ echo "$as_me:$LINENO: result: $ac_file" >&5-echo "${ECHO_T}$ac_file" >&6; }-if test -z "$ac_file"; then-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--{ { echo "$as_me:$LINENO: error: C compiler cannot create executables-See \`config.log' for more details." >&5-echo "$as_me: error: C compiler cannot create executables-See \`config.log' for more details." >&2;}-   { (exit 77); exit 77; }; }-fi--ac_exeext=$ac_cv_exeext--# Check that the compiler produces executables we can run.  If not, either-# the compiler is broken, or we cross compile.-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0-# If not cross compiling, check that we can run a simple program.-if test "$cross_compiling" != yes; then-  if { ac_try='./$ac_file'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-    cross_compiling=no-  else-    if test "$cross_compiling" = maybe; then-	cross_compiling=yes-    else-	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.-If you meant to cross compile, use \`--host'.-See \`config.log' for more details." >&5-echo "$as_me: error: cannot run C compiled programs.-If you meant to cross compile, use \`--host'.-See \`config.log' for more details." >&2;}-   { (exit 1); exit 1; }; }-    fi-  fi-fi-{ echo "$as_me:$LINENO: result: yes" >&5-echo "${ECHO_T}yes" >&6; }--rm -f a.out a.exe conftest$ac_cv_exeext b.out-ac_clean_files=$ac_clean_files_save-# Check that the compiler produces executables we can run.  If not, either-# the compiler is broken, or we cross compile.-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5-echo "${ECHO_T}$cross_compiling" >&6; }--{ echo "$as_me:$LINENO: checking for suffix of executables" >&5-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; then-  # If both `conftest.exe' and `conftest' are `present' (well, observable)-# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will-# work properly (i.e., refer to `conftest.exe'), while it won't with-# `rm'.-for ac_file in conftest.exe conftest conftest.*; do-  test -f "$ac_file" || continue-  case $ac_file in-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`-	  break;;-    * ) break;;-  esac-done-else-  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link-See \`config.log' for more details." >&5-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link-See \`config.log' for more details." >&2;}-   { (exit 1); exit 1; }; }-fi--rm -f conftest$ac_cv_exeext-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5-echo "${ECHO_T}$ac_cv_exeext" >&6; }--rm -f conftest.$ac_ext-EXEEXT=$ac_cv_exeext-ac_exeext=$EXEEXT-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }-if test "${ac_cv_objext+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */--int-main ()-{--  ;-  return 0;-}-_ACEOF-rm -f conftest.o conftest.obj-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; then-  for ac_file in conftest.o conftest.obj conftest.*; do-  test -f "$ac_file" || continue;-  case $ac_file in-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;-    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`-       break;;-  esac-done-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile-See \`config.log' for more details." >&5-echo "$as_me: error: cannot compute suffix of object files: cannot compile-See \`config.log' for more details." >&2;}-   { (exit 1); exit 1; }; }-fi--rm -f conftest.$ac_cv_objext conftest.$ac_ext-fi-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5-echo "${ECHO_T}$ac_cv_objext" >&6; }-OBJEXT=$ac_cv_objext-ac_objext=$OBJEXT-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }-if test "${ac_cv_c_compiler_gnu+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */--int-main ()-{-#ifndef __GNUC__-       choke me-#endif--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_compiler_gnu=yes-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_compiler_gnu=no-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-ac_cv_c_compiler_gnu=$ac_compiler_gnu--fi-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }-GCC=`test $ac_compiler_gnu = yes && echo yes`-ac_test_CFLAGS=${CFLAGS+set}-ac_save_CFLAGS=$CFLAGS-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }-if test "${ac_cv_prog_cc_g+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  ac_save_c_werror_flag=$ac_c_werror_flag-   ac_c_werror_flag=yes-   ac_cv_prog_cc_g=no-   CFLAGS="-g"-   cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */--int-main ()-{--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_cv_prog_cc_g=yes-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	CFLAGS=""-      cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */--int-main ()-{--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  :-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_c_werror_flag=$ac_save_c_werror_flag-	 CFLAGS="-g"-	 cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */--int-main ()-{--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_cv_prog_cc_g=yes-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5---fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-   ac_c_werror_flag=$ac_save_c_werror_flag-fi-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }-if test "$ac_test_CFLAGS" = set; then-  CFLAGS=$ac_save_CFLAGS-elif test $ac_cv_prog_cc_g = yes; then-  if test "$GCC" = yes; then-    CFLAGS="-g -O2"-  else-    CFLAGS="-g"-  fi-else-  if test "$GCC" = yes; then-    CFLAGS="-O2"-  else-    CFLAGS=-  fi-fi-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }-if test "${ac_cv_prog_cc_c89+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  ac_cv_prog_cc_c89=no-ac_save_CC=$CC-cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdarg.h>-#include <stdio.h>-#include <sys/types.h>-#include <sys/stat.h>-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */-struct buf { int x; };-FILE * (*rcsopen) (struct buf *, struct stat *, int);-static char *e (p, i)-     char **p;-     int i;-{-  return p[i];-}-static char *f (char * (*g) (char **, int), char **p, ...)-{-  char *s;-  va_list v;-  va_start (v,p);-  s = g (p, va_arg (v,int));-  va_end (v);-  return s;-}--/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has-   function prototypes and stuff, but not '\xHH' hex character constants.-   These don't provoke an error unfortunately, instead are silently treated-   as 'x'.  The following induces an error, until -std is added to get-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an-   array size at least.  It's necessary to write '\x00'==0 to get something-   that's true only with -std.  */-int osf4_cc_array ['\x00' == 0 ? 1 : -1];--/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters-   inside strings and character constants.  */-#define FOO(x) 'x'-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];--int test (int i, double x);-struct s1 {int (*f) (int a);};-struct s2 {int (*f) (double a);};-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);-int argc;-char **argv;-int-main ()-{-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];-  ;-  return 0;-}-_ACEOF-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \-	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"-do-  CC="$ac_save_CC $ac_arg"-  rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_cv_prog_cc_c89=$ac_arg-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5---fi--rm -f core conftest.err conftest.$ac_objext-  test "x$ac_cv_prog_cc_c89" != "xno" && break-done-rm -f conftest.$ac_ext-CC=$ac_save_CC--fi-# AC_CACHE_VAL-case "x$ac_cv_prog_cc_c89" in-  x)-    { echo "$as_me:$LINENO: result: none needed" >&5-echo "${ECHO_T}none needed" >&6; } ;;-  xno)-    { echo "$as_me:$LINENO: result: unsupported" >&5-echo "${ECHO_T}unsupported" >&6; } ;;-  *)-    CC="$CC $ac_cv_prog_cc_c89"-    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;-esac---ac_ext=c-ac_cpp='$CPP $CPPFLAGS'-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'-ac_compiler_gnu=$ac_cv_c_compiler_gnu---# do we have long longs?--ac_ext=c-ac_cpp='$CPP $CPPFLAGS'-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'-ac_compiler_gnu=$ac_cv_c_compiler_gnu-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }-# On Suns, sometimes $CPP names a directory.-if test -n "$CPP" && test -d "$CPP"; then-  CPP=-fi-if test -z "$CPP"; then-  if test "${ac_cv_prog_CPP+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-      # Double quotes because CPP needs to be expanded-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"-    do-      ac_preproc_ok=false-for ac_c_preproc_warn_flag in '' yes-do-  # Use a header file that comes with gcc, so configuring glibc-  # with a fresh cross-compiler works.-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since-  # <limits.h> exists even on freestanding compilers.-  # On the NeXT, cc -E runs the code through the compiler's parser,-  # not just through cpp. "Syntax error" is here to catch this case.-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#ifdef __STDC__-# include <limits.h>-#else-# include <assert.h>-#endif-		     Syntax error-_ACEOF-if { (ac_try="$ac_cpp conftest.$ac_ext"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } >/dev/null && {-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||-	 test ! -s conftest.err-       }; then-  :-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--  # Broken: fails on valid input.-continue-fi--rm -f conftest.err conftest.$ac_ext--  # OK, works on sane cases.  Now check whether nonexistent headers-  # can be detected and how.-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <ac_nonexistent.h>-_ACEOF-if { (ac_try="$ac_cpp conftest.$ac_ext"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } >/dev/null && {-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||-	 test ! -s conftest.err-       }; then-  # Broken: success on invalid input.-continue-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--  # Passes both tests.-ac_preproc_ok=:-break-fi--rm -f conftest.err conftest.$ac_ext--done-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.-rm -f conftest.err conftest.$ac_ext-if $ac_preproc_ok; then-  break-fi--    done-    ac_cv_prog_CPP=$CPP--fi-  CPP=$ac_cv_prog_CPP-else-  ac_cv_prog_CPP=$CPP-fi-{ echo "$as_me:$LINENO: result: $CPP" >&5-echo "${ECHO_T}$CPP" >&6; }-ac_preproc_ok=false-for ac_c_preproc_warn_flag in '' yes-do-  # Use a header file that comes with gcc, so configuring glibc-  # with a fresh cross-compiler works.-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since-  # <limits.h> exists even on freestanding compilers.-  # On the NeXT, cc -E runs the code through the compiler's parser,-  # not just through cpp. "Syntax error" is here to catch this case.-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#ifdef __STDC__-# include <limits.h>-#else-# include <assert.h>-#endif-		     Syntax error-_ACEOF-if { (ac_try="$ac_cpp conftest.$ac_ext"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } >/dev/null && {-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||-	 test ! -s conftest.err-       }; then-  :-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--  # Broken: fails on valid input.-continue-fi--rm -f conftest.err conftest.$ac_ext--  # OK, works on sane cases.  Now check whether nonexistent headers-  # can be detected and how.-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <ac_nonexistent.h>-_ACEOF-if { (ac_try="$ac_cpp conftest.$ac_ext"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } >/dev/null && {-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||-	 test ! -s conftest.err-       }; then-  # Broken: success on invalid input.-continue-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--  # Passes both tests.-ac_preproc_ok=:-break-fi--rm -f conftest.err conftest.$ac_ext--done-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.-rm -f conftest.err conftest.$ac_ext-if $ac_preproc_ok; then-  :-else-  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check-See \`config.log' for more details." >&5-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check-See \`config.log' for more details." >&2;}-   { (exit 1); exit 1; }; }-fi--ac_ext=c-ac_cpp='$CPP $CPPFLAGS'-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'-ac_compiler_gnu=$ac_cv_c_compiler_gnu---{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }-if test "${ac_cv_path_GREP+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  # Extract the first word of "grep ggrep" to use in msg output-if test -z "$GREP"; then-set dummy grep ggrep; ac_prog_name=$2-if test "${ac_cv_path_GREP+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  ac_path_GREP_found=false-# Loop through the user's path and test for each of PROGNAME-LIST-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-  for ac_prog in grep ggrep; do-  for ac_exec_ext in '' $ac_executable_extensions; do-    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"-    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue-    # Check for GNU ac_path_GREP and select it if it is found.-  # Check for GNU $ac_path_GREP-case `"$ac_path_GREP" --version 2>&1` in-*GNU*)-  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;-*)-  ac_count=0-  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"-  while :-  do-    cat "conftest.in" "conftest.in" >"conftest.tmp"-    mv "conftest.tmp" "conftest.in"-    cp "conftest.in" "conftest.nl"-    echo 'GREP' >> "conftest.nl"-    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break-    ac_count=`expr $ac_count + 1`-    if test $ac_count -gt ${ac_path_GREP_max-0}; then-      # Best one so far, save it but keep looking for a better one-      ac_cv_path_GREP="$ac_path_GREP"-      ac_path_GREP_max=$ac_count-    fi-    # 10*(2^10) chars as input seems more than enough-    test $ac_count -gt 10 && break-  done-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;-esac---    $ac_path_GREP_found && break 3-  done-done--done-IFS=$as_save_IFS---fi--GREP="$ac_cv_path_GREP"-if test -z "$GREP"; then-  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}-   { (exit 1); exit 1; }; }-fi--else-  ac_cv_path_GREP=$GREP-fi---fi-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }- GREP="$ac_cv_path_GREP"---{ echo "$as_me:$LINENO: checking for egrep" >&5-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }-if test "${ac_cv_path_EGREP+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1-   then ac_cv_path_EGREP="$GREP -E"-   else-     # Extract the first word of "egrep" to use in msg output-if test -z "$EGREP"; then-set dummy egrep; ac_prog_name=$2-if test "${ac_cv_path_EGREP+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  ac_path_EGREP_found=false-# Loop through the user's path and test for each of PROGNAME-LIST-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-  for ac_prog in egrep; do-  for ac_exec_ext in '' $ac_executable_extensions; do-    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"-    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue-    # Check for GNU ac_path_EGREP and select it if it is found.-  # Check for GNU $ac_path_EGREP-case `"$ac_path_EGREP" --version 2>&1` in-*GNU*)-  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;-*)-  ac_count=0-  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"-  while :-  do-    cat "conftest.in" "conftest.in" >"conftest.tmp"-    mv "conftest.tmp" "conftest.in"-    cp "conftest.in" "conftest.nl"-    echo 'EGREP' >> "conftest.nl"-    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break-    ac_count=`expr $ac_count + 1`-    if test $ac_count -gt ${ac_path_EGREP_max-0}; then-      # Best one so far, save it but keep looking for a better one-      ac_cv_path_EGREP="$ac_path_EGREP"-      ac_path_EGREP_max=$ac_count-    fi-    # 10*(2^10) chars as input seems more than enough-    test $ac_count -gt 10 && break-  done-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;-esac---    $ac_path_EGREP_found && break 3-  done-done--done-IFS=$as_save_IFS---fi--EGREP="$ac_cv_path_EGREP"-if test -z "$EGREP"; then-  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}-   { (exit 1); exit 1; }; }-fi--else-  ac_cv_path_EGREP=$EGREP-fi---   fi-fi-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }- EGREP="$ac_cv_path_EGREP"---{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }-if test "${ac_cv_header_stdc+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdlib.h>-#include <stdarg.h>-#include <string.h>-#include <float.h>--int-main ()-{--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_cv_header_stdc=yes-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_cv_header_stdc=no-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext--if test $ac_cv_header_stdc = yes; then-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <string.h>--_ACEOF-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |-  $EGREP "memchr" >/dev/null 2>&1; then-  :-else-  ac_cv_header_stdc=no-fi-rm -f conftest*--fi--if test $ac_cv_header_stdc = yes; then-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdlib.h>--_ACEOF-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |-  $EGREP "free" >/dev/null 2>&1; then-  :-else-  ac_cv_header_stdc=no-fi-rm -f conftest*--fi--if test $ac_cv_header_stdc = yes; then-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.-  if test "$cross_compiling" = yes; then-  :-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <ctype.h>-#include <stdlib.h>-#if ((' ' & 0x0FF) == 0x020)-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))-#else-# define ISLOWER(c) \-		   (('a' <= (c) && (c) <= 'i') \-		     || ('j' <= (c) && (c) <= 'r') \-		     || ('s' <= (c) && (c) <= 'z'))-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))-#endif--#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))-int-main ()-{-  int i;-  for (i = 0; i < 256; i++)-    if (XOR (islower (i), ISLOWER (i))-	|| toupper (i) != TOUPPER (i))-      return 2;-  return 0;-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  :-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-ac_cv_header_stdc=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---fi-fi-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }-if test $ac_cv_header_stdc = yes; then--cat >>confdefs.h <<\_ACEOF-#define STDC_HEADERS 1-_ACEOF--fi--# On IRIX 5.3, sys/types and inttypes.h are conflicting.----------for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \-		  inttypes.h stdint.h unistd.h-do-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`-{ echo "$as_me:$LINENO: checking for $ac_header" >&5-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-$ac_includes_default--#include <$ac_header>-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  eval "$as_ac_Header=yes"-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	eval "$as_ac_Header=no"-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-fi-ac_res=`eval echo '${'$as_ac_Header'}'`-	       { echo "$as_me:$LINENO: result: $ac_res" >&5-echo "${ECHO_T}$ac_res" >&6; }-if test `eval echo '${'$as_ac_Header'}'` = yes; then-  cat >>confdefs.h <<_ACEOF-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1-_ACEOF--fi--done---{ echo "$as_me:$LINENO: checking for long long" >&5-echo $ECHO_N "checking for long long... $ECHO_C" >&6; }-if test "${ac_cv_type_long_long+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-$ac_includes_default-typedef long long ac__type_new_;-int-main ()-{-if ((ac__type_new_ *) 0)-  return 0;-if (sizeof (ac__type_new_))-  return 0;-  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_cv_type_long_long=yes-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_cv_type_long_long=no-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-fi-{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5-echo "${ECHO_T}$ac_cv_type_long_long" >&6; }-if test $ac_cv_type_long_long = yes; then--cat >>confdefs.h <<_ACEOF-#define HAVE_LONG_LONG 1-_ACEOF---fi---{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }-if test "${ac_cv_header_stdc+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdlib.h>-#include <stdarg.h>-#include <string.h>-#include <float.h>--int-main ()-{--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_cv_header_stdc=yes-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_cv_header_stdc=no-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext--if test $ac_cv_header_stdc = yes; then-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <string.h>--_ACEOF-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |-  $EGREP "memchr" >/dev/null 2>&1; then-  :-else-  ac_cv_header_stdc=no-fi-rm -f conftest*--fi--if test $ac_cv_header_stdc = yes; then-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdlib.h>--_ACEOF-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |-  $EGREP "free" >/dev/null 2>&1; then-  :-else-  ac_cv_header_stdc=no-fi-rm -f conftest*--fi--if test $ac_cv_header_stdc = yes; then-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.-  if test "$cross_compiling" = yes; then-  :-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <ctype.h>-#include <stdlib.h>-#if ((' ' & 0x0FF) == 0x020)-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))-#else-# define ISLOWER(c) \-		   (('a' <= (c) && (c) <= 'i') \-		     || ('j' <= (c) && (c) <= 'r') \-		     || ('s' <= (c) && (c) <= 'z'))-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))-#endif--#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))-int-main ()-{-  int i;-  for (i = 0; i < 256; i++)-    if (XOR (islower (i), ISLOWER (i))-	|| toupper (i) != TOUPPER (i))-      return 2;-  return 0;-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  :-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-ac_cv_header_stdc=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---fi-fi-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }-if test $ac_cv_header_stdc = yes; then--cat >>confdefs.h <<\_ACEOF-#define STDC_HEADERS 1-_ACEOF--fi---# check for specific header (.h) files that we are interested in-------------------------for ac_header in ctype.h errno.h fcntl.h inttypes.h limits.h signal.h sys/resource.h sys/select.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/wait.h termios.h time.h unistd.h utime.h windows.h winsock.h langinfo.h-do-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then-  { echo "$as_me:$LINENO: checking for $ac_header" >&5-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-fi-ac_res=`eval echo '${'$as_ac_Header'}'`-	       { echo "$as_me:$LINENO: result: $ac_res" >&5-echo "${ECHO_T}$ac_res" >&6; }-else-  # Is the header compilable?-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }-cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-$ac_includes_default-#include <$ac_header>-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_header_compiler=yes-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_header_compiler=no-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5-echo "${ECHO_T}$ac_header_compiler" >&6; }--# Is the header present?-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }-cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <$ac_header>-_ACEOF-if { (ac_try="$ac_cpp conftest.$ac_ext"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } >/dev/null && {-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||-	 test ! -s conftest.err-       }; then-  ac_header_preproc=yes-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--  ac_header_preproc=no-fi--rm -f conftest.err conftest.$ac_ext-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5-echo "${ECHO_T}$ac_header_preproc" >&6; }--# So?  What about this header?-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in-  yes:no: )-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}-    ac_header_preproc=yes-    ;;-  no:yes:* )-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}-    ( cat <<\_ASBOX-## ------------------------------------ ##-## Report this to libraries@haskell.org ##-## ------------------------------------ ##-_ASBOX-     ) | sed "s/^/$as_me: WARNING:     /" >&2-    ;;-esac-{ echo "$as_me:$LINENO: checking for $ac_header" >&5-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  eval "$as_ac_Header=\$ac_header_preproc"-fi-ac_res=`eval echo '${'$as_ac_Header'}'`-	       { echo "$as_me:$LINENO: result: $ac_res" >&5-echo "${ECHO_T}$ac_res" >&6; }--fi-if test `eval echo '${'$as_ac_Header'}'` = yes; then-  cat >>confdefs.h <<_ACEOF-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1-_ACEOF--fi--done---# Enable large file support. Do this before testing the types ino_t, off_t, and-# rlim_t, because it will affect the result of that test.-# Check whether --enable-largefile was given.-if test "${enable_largefile+set}" = set; then-  enableval=$enable_largefile;-fi--if test "$enable_largefile" != no; then--  { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5-echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; }-if test "${ac_cv_sys_largefile_CC+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  ac_cv_sys_largefile_CC=no-     if test "$GCC" != yes; then-       ac_save_CC=$CC-       while :; do-	 # IRIX 6.2 and later do not support large files by default,-	 # so use the C compiler's -n32 option if that helps.-	 cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <sys/types.h>- /* Check that off_t can represent 2**63 - 1 correctly.-    We can't simply define LARGE_OFF_T to be 9223372036854775807,-    since some C++ compilers masquerading as C compilers-    incorrectly reject 9223372036854775807.  */-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721-		       && LARGE_OFF_T % 2147483647 == 1)-		      ? 1 : -1];-int-main ()-{--  ;-  return 0;-}-_ACEOF-	 rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  break-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5---fi--rm -f core conftest.err conftest.$ac_objext-	 CC="$CC -n32"-	 rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_cv_sys_largefile_CC=' -n32'; break-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5---fi--rm -f core conftest.err conftest.$ac_objext-	 break-       done-       CC=$ac_save_CC-       rm -f conftest.$ac_ext-    fi-fi-{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5-echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; }-  if test "$ac_cv_sys_largefile_CC" != no; then-    CC=$CC$ac_cv_sys_largefile_CC-  fi--  { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5-echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; }-if test "${ac_cv_sys_file_offset_bits+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  while :; do-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <sys/types.h>- /* Check that off_t can represent 2**63 - 1 correctly.-    We can't simply define LARGE_OFF_T to be 9223372036854775807,-    since some C++ compilers masquerading as C compilers-    incorrectly reject 9223372036854775807.  */-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721-		       && LARGE_OFF_T % 2147483647 == 1)-		      ? 1 : -1];-int-main ()-{--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_cv_sys_file_offset_bits=no; break-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5---fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#define _FILE_OFFSET_BITS 64-#include <sys/types.h>- /* Check that off_t can represent 2**63 - 1 correctly.-    We can't simply define LARGE_OFF_T to be 9223372036854775807,-    since some C++ compilers masquerading as C compilers-    incorrectly reject 9223372036854775807.  */-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721-		       && LARGE_OFF_T % 2147483647 == 1)-		      ? 1 : -1];-int-main ()-{--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_cv_sys_file_offset_bits=64; break-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5---fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  ac_cv_sys_file_offset_bits=unknown-  break-done-fi-{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5-echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; }-case $ac_cv_sys_file_offset_bits in #(-  no | unknown) ;;-  *)-cat >>confdefs.h <<_ACEOF-#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits-_ACEOF-;;-esac-rm -f conftest*-  if test $ac_cv_sys_file_offset_bits = unknown; then-    { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5-echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; }-if test "${ac_cv_sys_large_files+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  while :; do-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <sys/types.h>- /* Check that off_t can represent 2**63 - 1 correctly.-    We can't simply define LARGE_OFF_T to be 9223372036854775807,-    since some C++ compilers masquerading as C compilers-    incorrectly reject 9223372036854775807.  */-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721-		       && LARGE_OFF_T % 2147483647 == 1)-		      ? 1 : -1];-int-main ()-{--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_cv_sys_large_files=no; break-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5---fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#define _LARGE_FILES 1-#include <sys/types.h>- /* Check that off_t can represent 2**63 - 1 correctly.-    We can't simply define LARGE_OFF_T to be 9223372036854775807,-    since some C++ compilers masquerading as C compilers-    incorrectly reject 9223372036854775807.  */-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721-		       && LARGE_OFF_T % 2147483647 == 1)-		      ? 1 : -1];-int-main ()-{--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_cv_sys_large_files=1; break-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5---fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  ac_cv_sys_large_files=unknown-  break-done-fi-{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5-echo "${ECHO_T}$ac_cv_sys_large_files" >&6; }-case $ac_cv_sys_large_files in #(-  no | unknown) ;;-  *)-cat >>confdefs.h <<_ACEOF-#define _LARGE_FILES $ac_cv_sys_large_files-_ACEOF-;;-esac-rm -f conftest*-  fi-fi----for ac_header in wctype.h-do-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then-  { echo "$as_me:$LINENO: checking for $ac_header" >&5-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-fi-ac_res=`eval echo '${'$as_ac_Header'}'`-	       { echo "$as_me:$LINENO: result: $ac_res" >&5-echo "${ECHO_T}$ac_res" >&6; }-else-  # Is the header compilable?-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }-cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-$ac_includes_default-#include <$ac_header>-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_header_compiler=yes-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_header_compiler=no-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5-echo "${ECHO_T}$ac_header_compiler" >&6; }--# Is the header present?-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }-cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <$ac_header>-_ACEOF-if { (ac_try="$ac_cpp conftest.$ac_ext"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } >/dev/null && {-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||-	 test ! -s conftest.err-       }; then-  ac_header_preproc=yes-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--  ac_header_preproc=no-fi--rm -f conftest.err conftest.$ac_ext-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5-echo "${ECHO_T}$ac_header_preproc" >&6; }--# So?  What about this header?-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in-  yes:no: )-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}-    ac_header_preproc=yes-    ;;-  no:yes:* )-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}-    ( cat <<\_ASBOX-## ------------------------------------ ##-## Report this to libraries@haskell.org ##-## ------------------------------------ ##-_ASBOX-     ) | sed "s/^/$as_me: WARNING:     /" >&2-    ;;-esac-{ echo "$as_me:$LINENO: checking for $ac_header" >&5-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  eval "$as_ac_Header=\$ac_header_preproc"-fi-ac_res=`eval echo '${'$as_ac_Header'}'`-	       { echo "$as_me:$LINENO: result: $ac_res" >&5-echo "${ECHO_T}$ac_res" >&6; }--fi-if test `eval echo '${'$as_ac_Header'}'` = yes; then-  cat >>confdefs.h <<_ACEOF-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1-_ACEOF--for ac_func in iswspace-do-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`-{ echo "$as_me:$LINENO: checking for $ac_func" >&5-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */-#define $ac_func innocuous_$ac_func--/* System header to define __stub macros and hopefully few prototypes,-    which can conflict with char $ac_func (); below.-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since-    <limits.h> exists even on freestanding compilers.  */--#ifdef __STDC__-# include <limits.h>-#else-# include <assert.h>-#endif--#undef $ac_func--/* Override any GCC internal prototype to avoid an error.-   Use char because int might match the return type of a GCC-   builtin and then its argument prototype would still apply.  */-#ifdef __cplusplus-extern "C"-#endif-char $ac_func ();-/* The GNU C library defines this for functions which it implements-    to always fail with ENOSYS.  Some functions are actually named-    something starting with __ and the normal name is an alias.  */-#if defined __stub_$ac_func || defined __stub___$ac_func-choke me-#endif--int-main ()-{-return $ac_func ();-  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest$ac_exeext &&-       $as_test_x conftest$ac_exeext; then-  eval "$as_ac_var=yes"-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	eval "$as_ac_var=no"-fi--rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \-      conftest$ac_exeext conftest.$ac_ext-fi-ac_res=`eval echo '${'$as_ac_var'}'`-	       { echo "$as_me:$LINENO: result: $ac_res" >&5-echo "${ECHO_T}$ac_res" >&6; }-if test `eval echo '${'$as_ac_var'}'` = yes; then-  cat >>confdefs.h <<_ACEOF-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1-_ACEOF--fi-done--fi--done----for ac_func in lstat-do-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`-{ echo "$as_me:$LINENO: checking for $ac_func" >&5-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */-#define $ac_func innocuous_$ac_func--/* System header to define __stub macros and hopefully few prototypes,-    which can conflict with char $ac_func (); below.-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since-    <limits.h> exists even on freestanding compilers.  */--#ifdef __STDC__-# include <limits.h>-#else-# include <assert.h>-#endif--#undef $ac_func--/* Override any GCC internal prototype to avoid an error.-   Use char because int might match the return type of a GCC-   builtin and then its argument prototype would still apply.  */-#ifdef __cplusplus-extern "C"-#endif-char $ac_func ();-/* The GNU C library defines this for functions which it implements-    to always fail with ENOSYS.  Some functions are actually named-    something starting with __ and the normal name is an alias.  */-#if defined __stub_$ac_func || defined __stub___$ac_func-choke me-#endif--int-main ()-{-return $ac_func ();-  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest$ac_exeext &&-       $as_test_x conftest$ac_exeext; then-  eval "$as_ac_var=yes"-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	eval "$as_ac_var=no"-fi--rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \-      conftest$ac_exeext conftest.$ac_ext-fi-ac_res=`eval echo '${'$as_ac_var'}'`-	       { echo "$as_me:$LINENO: result: $ac_res" >&5-echo "${ECHO_T}$ac_res" >&6; }-if test `eval echo '${'$as_ac_var'}'` = yes; then-  cat >>confdefs.h <<_ACEOF-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1-_ACEOF--fi-done-----for ac_func in getclock getrusage times-do-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`-{ echo "$as_me:$LINENO: checking for $ac_func" >&5-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */-#define $ac_func innocuous_$ac_func--/* System header to define __stub macros and hopefully few prototypes,-    which can conflict with char $ac_func (); below.-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since-    <limits.h> exists even on freestanding compilers.  */--#ifdef __STDC__-# include <limits.h>-#else-# include <assert.h>-#endif--#undef $ac_func--/* Override any GCC internal prototype to avoid an error.-   Use char because int might match the return type of a GCC-   builtin and then its argument prototype would still apply.  */-#ifdef __cplusplus-extern "C"-#endif-char $ac_func ();-/* The GNU C library defines this for functions which it implements-    to always fail with ENOSYS.  Some functions are actually named-    something starting with __ and the normal name is an alias.  */-#if defined __stub_$ac_func || defined __stub___$ac_func-choke me-#endif--int-main ()-{-return $ac_func ();-  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest$ac_exeext &&-       $as_test_x conftest$ac_exeext; then-  eval "$as_ac_var=yes"-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	eval "$as_ac_var=no"-fi--rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \-      conftest$ac_exeext conftest.$ac_ext-fi-ac_res=`eval echo '${'$as_ac_var'}'`-	       { echo "$as_me:$LINENO: result: $ac_res" >&5-echo "${ECHO_T}$ac_res" >&6; }-if test `eval echo '${'$as_ac_var'}'` = yes; then-  cat >>confdefs.h <<_ACEOF-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1-_ACEOF--fi-done----for ac_func in _chsize ftruncate-do-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`-{ echo "$as_me:$LINENO: checking for $ac_func" >&5-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */-#define $ac_func innocuous_$ac_func--/* System header to define __stub macros and hopefully few prototypes,-    which can conflict with char $ac_func (); below.-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since-    <limits.h> exists even on freestanding compilers.  */--#ifdef __STDC__-# include <limits.h>-#else-# include <assert.h>-#endif--#undef $ac_func--/* Override any GCC internal prototype to avoid an error.-   Use char because int might match the return type of a GCC-   builtin and then its argument prototype would still apply.  */-#ifdef __cplusplus-extern "C"-#endif-char $ac_func ();-/* The GNU C library defines this for functions which it implements-    to always fail with ENOSYS.  Some functions are actually named-    something starting with __ and the normal name is an alias.  */-#if defined __stub_$ac_func || defined __stub___$ac_func-choke me-#endif--int-main ()-{-return $ac_func ();-  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest$ac_exeext &&-       $as_test_x conftest$ac_exeext; then-  eval "$as_ac_var=yes"-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	eval "$as_ac_var=no"-fi--rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \-      conftest$ac_exeext conftest.$ac_ext-fi-ac_res=`eval echo '${'$as_ac_var'}'`-	       { echo "$as_me:$LINENO: result: $ac_res" >&5-echo "${ECHO_T}$ac_res" >&6; }-if test `eval echo '${'$as_ac_var'}'` = yes; then-  cat >>confdefs.h <<_ACEOF-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1-_ACEOF--fi-done-----# Check whether --with-iconv-includes was given.-if test "${with_iconv_includes+set}" = set; then-  withval=$with_iconv_includes; ICONV_INCLUDE_DIRS=$withval; CPPFLAGS="-I$withval"-else-  ICONV_INCLUDE_DIRS=-fi----# Check whether --with-iconv-libraries was given.-if test "${with_iconv_libraries+set}" = set; then-  withval=$with_iconv_libraries; ICONV_LIB_DIRS=$withval; LDFLAGS="-L$withval"-else-  ICONV_LIB_DIRS=-fi------# map standard C types and ISO types to Haskell types-{ echo "$as_me:$LINENO: checking Haskell type for char" >&5-echo $ECHO_N "checking Haskell type for char... $ECHO_C" >&6; }-if test "${fptools_cv_htype_char+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_char=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_char=NotReallyATypeCross; fptools_cv_htype_sup_char=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef char testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_char=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_char=NotReallyAType; fptools_cv_htype_sup_char=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_char" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_char" >&5-echo "${ECHO_T}$fptools_cv_htype_char" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_CHAR $fptools_cv_htype_char-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for signed char" >&5-echo $ECHO_N "checking Haskell type for signed char... $ECHO_C" >&6; }-if test "${fptools_cv_htype_signed_char+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_signed_char=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_signed_char=NotReallyATypeCross; fptools_cv_htype_sup_signed_char=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef signed char testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_signed_char=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_signed_char=NotReallyAType; fptools_cv_htype_sup_signed_char=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_signed_char" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_signed_char" >&5-echo "${ECHO_T}$fptools_cv_htype_signed_char" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_SIGNED_CHAR $fptools_cv_htype_signed_char-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for unsigned char" >&5-echo $ECHO_N "checking Haskell type for unsigned char... $ECHO_C" >&6; }-if test "${fptools_cv_htype_unsigned_char+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_unsigned_char=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_unsigned_char=NotReallyATypeCross; fptools_cv_htype_sup_unsigned_char=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef unsigned char testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_unsigned_char=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_unsigned_char=NotReallyAType; fptools_cv_htype_sup_unsigned_char=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_unsigned_char" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_unsigned_char" >&5-echo "${ECHO_T}$fptools_cv_htype_unsigned_char" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UNSIGNED_CHAR $fptools_cv_htype_unsigned_char-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for short" >&5-echo $ECHO_N "checking Haskell type for short... $ECHO_C" >&6; }-if test "${fptools_cv_htype_short+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_short=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_short=NotReallyATypeCross; fptools_cv_htype_sup_short=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef short testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_short=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_short=NotReallyAType; fptools_cv_htype_sup_short=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_short" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_short" >&5-echo "${ECHO_T}$fptools_cv_htype_short" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_SHORT $fptools_cv_htype_short-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for unsigned short" >&5-echo $ECHO_N "checking Haskell type for unsigned short... $ECHO_C" >&6; }-if test "${fptools_cv_htype_unsigned_short+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_unsigned_short=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_unsigned_short=NotReallyATypeCross; fptools_cv_htype_sup_unsigned_short=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef unsigned short testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_unsigned_short=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_unsigned_short=NotReallyAType; fptools_cv_htype_sup_unsigned_short=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_unsigned_short" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_unsigned_short" >&5-echo "${ECHO_T}$fptools_cv_htype_unsigned_short" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UNSIGNED_SHORT $fptools_cv_htype_unsigned_short-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for int" >&5-echo $ECHO_N "checking Haskell type for int... $ECHO_C" >&6; }-if test "${fptools_cv_htype_int+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_int=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_int=NotReallyATypeCross; fptools_cv_htype_sup_int=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef int testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_int=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_int=NotReallyAType; fptools_cv_htype_sup_int=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_int" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_int" >&5-echo "${ECHO_T}$fptools_cv_htype_int" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_INT $fptools_cv_htype_int-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for unsigned int" >&5-echo $ECHO_N "checking Haskell type for unsigned int... $ECHO_C" >&6; }-if test "${fptools_cv_htype_unsigned_int+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_unsigned_int=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_unsigned_int=NotReallyATypeCross; fptools_cv_htype_sup_unsigned_int=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef unsigned int testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_unsigned_int=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_unsigned_int=NotReallyAType; fptools_cv_htype_sup_unsigned_int=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_unsigned_int" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_unsigned_int" >&5-echo "${ECHO_T}$fptools_cv_htype_unsigned_int" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UNSIGNED_INT $fptools_cv_htype_unsigned_int-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for long" >&5-echo $ECHO_N "checking Haskell type for long... $ECHO_C" >&6; }-if test "${fptools_cv_htype_long+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_long=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_long=NotReallyATypeCross; fptools_cv_htype_sup_long=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef long testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_long=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_long=NotReallyAType; fptools_cv_htype_sup_long=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_long" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_long" >&5-echo "${ECHO_T}$fptools_cv_htype_long" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_LONG $fptools_cv_htype_long-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for unsigned long" >&5-echo $ECHO_N "checking Haskell type for unsigned long... $ECHO_C" >&6; }-if test "${fptools_cv_htype_unsigned_long+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_unsigned_long=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_unsigned_long=NotReallyATypeCross; fptools_cv_htype_sup_unsigned_long=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef unsigned long testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_unsigned_long=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_unsigned_long=NotReallyAType; fptools_cv_htype_sup_unsigned_long=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_unsigned_long" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_unsigned_long" >&5-echo "${ECHO_T}$fptools_cv_htype_unsigned_long" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UNSIGNED_LONG $fptools_cv_htype_unsigned_long-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--if test "$ac_cv_type_long_long" = yes; then-{ echo "$as_me:$LINENO: checking Haskell type for long long" >&5-echo $ECHO_N "checking Haskell type for long long... $ECHO_C" >&6; }-if test "${fptools_cv_htype_long_long+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_long_long=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_long_long=NotReallyATypeCross; fptools_cv_htype_sup_long_long=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef long long testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_long_long=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_long_long=NotReallyAType; fptools_cv_htype_sup_long_long=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_long_long" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_long_long" >&5-echo "${ECHO_T}$fptools_cv_htype_long_long" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_LONG_LONG $fptools_cv_htype_long_long-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for unsigned long long" >&5-echo $ECHO_N "checking Haskell type for unsigned long long... $ECHO_C" >&6; }-if test "${fptools_cv_htype_unsigned_long_long+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_unsigned_long_long=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_unsigned_long_long=NotReallyATypeCross; fptools_cv_htype_sup_unsigned_long_long=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef unsigned long long testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_unsigned_long_long=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_unsigned_long_long=NotReallyAType; fptools_cv_htype_sup_unsigned_long_long=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_unsigned_long_long" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_unsigned_long_long" >&5-echo "${ECHO_T}$fptools_cv_htype_unsigned_long_long" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UNSIGNED_LONG_LONG $fptools_cv_htype_unsigned_long_long-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--fi-{ echo "$as_me:$LINENO: checking Haskell type for float" >&5-echo $ECHO_N "checking Haskell type for float... $ECHO_C" >&6; }-if test "${fptools_cv_htype_float+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_float=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_float=NotReallyATypeCross; fptools_cv_htype_sup_float=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef float testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_float=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_float=NotReallyAType; fptools_cv_htype_sup_float=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_float" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_float" >&5-echo "${ECHO_T}$fptools_cv_htype_float" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_FLOAT $fptools_cv_htype_float-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for double" >&5-echo $ECHO_N "checking Haskell type for double... $ECHO_C" >&6; }-if test "${fptools_cv_htype_double+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_double=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_double=NotReallyATypeCross; fptools_cv_htype_sup_double=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef double testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_double=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_double=NotReallyAType; fptools_cv_htype_sup_double=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_double" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_double" >&5-echo "${ECHO_T}$fptools_cv_htype_double" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_DOUBLE $fptools_cv_htype_double-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for ptrdiff_t" >&5-echo $ECHO_N "checking Haskell type for ptrdiff_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_ptrdiff_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_ptrdiff_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_ptrdiff_t=NotReallyATypeCross; fptools_cv_htype_sup_ptrdiff_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef ptrdiff_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_ptrdiff_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_ptrdiff_t=NotReallyAType; fptools_cv_htype_sup_ptrdiff_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_ptrdiff_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_ptrdiff_t" >&5-echo "${ECHO_T}$fptools_cv_htype_ptrdiff_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_PTRDIFF_T $fptools_cv_htype_ptrdiff_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for size_t" >&5-echo $ECHO_N "checking Haskell type for size_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_size_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_size_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_size_t=NotReallyATypeCross; fptools_cv_htype_sup_size_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef size_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_size_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_size_t=NotReallyAType; fptools_cv_htype_sup_size_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_size_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_size_t" >&5-echo "${ECHO_T}$fptools_cv_htype_size_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_SIZE_T $fptools_cv_htype_size_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for wchar_t" >&5-echo $ECHO_N "checking Haskell type for wchar_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_wchar_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_wchar_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_wchar_t=NotReallyATypeCross; fptools_cv_htype_sup_wchar_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef wchar_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_wchar_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_wchar_t=NotReallyAType; fptools_cv_htype_sup_wchar_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_wchar_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_wchar_t" >&5-echo "${ECHO_T}$fptools_cv_htype_wchar_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_WCHAR_T $fptools_cv_htype_wchar_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--# Int32 is a HACK for non-ISO C compilers-{ echo "$as_me:$LINENO: checking Haskell type for sig_atomic_t" >&5-echo $ECHO_N "checking Haskell type for sig_atomic_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_sig_atomic_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_sig_atomic_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_sig_atomic_t=NotReallyATypeCross; fptools_cv_htype_sup_sig_atomic_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef sig_atomic_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_sig_atomic_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_sig_atomic_t=Int32-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_sig_atomic_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_sig_atomic_t" >&5-echo "${ECHO_T}$fptools_cv_htype_sig_atomic_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_SIG_ATOMIC_T $fptools_cv_htype_sig_atomic_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for clock_t" >&5-echo $ECHO_N "checking Haskell type for clock_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_clock_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_clock_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_clock_t=NotReallyATypeCross; fptools_cv_htype_sup_clock_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef clock_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_clock_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_clock_t=NotReallyAType; fptools_cv_htype_sup_clock_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_clock_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_clock_t" >&5-echo "${ECHO_T}$fptools_cv_htype_clock_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_CLOCK_T $fptools_cv_htype_clock_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for time_t" >&5-echo $ECHO_N "checking Haskell type for time_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_time_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_time_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_time_t=NotReallyATypeCross; fptools_cv_htype_sup_time_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef time_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_time_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_time_t=NotReallyAType; fptools_cv_htype_sup_time_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_time_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_time_t" >&5-echo "${ECHO_T}$fptools_cv_htype_time_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_TIME_T $fptools_cv_htype_time_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for dev_t" >&5-echo $ECHO_N "checking Haskell type for dev_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_dev_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_dev_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_dev_t=NotReallyATypeCross; fptools_cv_htype_sup_dev_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef dev_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_dev_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_dev_t=Word32-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_dev_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_dev_t" >&5-echo "${ECHO_T}$fptools_cv_htype_dev_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_DEV_T $fptools_cv_htype_dev_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for ino_t" >&5-echo $ECHO_N "checking Haskell type for ino_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_ino_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_ino_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_ino_t=NotReallyATypeCross; fptools_cv_htype_sup_ino_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef ino_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_ino_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_ino_t=NotReallyAType; fptools_cv_htype_sup_ino_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_ino_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_ino_t" >&5-echo "${ECHO_T}$fptools_cv_htype_ino_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_INO_T $fptools_cv_htype_ino_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for mode_t" >&5-echo $ECHO_N "checking Haskell type for mode_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_mode_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_mode_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_mode_t=NotReallyATypeCross; fptools_cv_htype_sup_mode_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef mode_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_mode_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_mode_t=NotReallyAType; fptools_cv_htype_sup_mode_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_mode_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_mode_t" >&5-echo "${ECHO_T}$fptools_cv_htype_mode_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_MODE_T $fptools_cv_htype_mode_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for off_t" >&5-echo $ECHO_N "checking Haskell type for off_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_off_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_off_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_off_t=NotReallyATypeCross; fptools_cv_htype_sup_off_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef off_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_off_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_off_t=NotReallyAType; fptools_cv_htype_sup_off_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_off_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_off_t" >&5-echo "${ECHO_T}$fptools_cv_htype_off_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_OFF_T $fptools_cv_htype_off_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for pid_t" >&5-echo $ECHO_N "checking Haskell type for pid_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_pid_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_pid_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_pid_t=NotReallyATypeCross; fptools_cv_htype_sup_pid_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef pid_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_pid_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_pid_t=NotReallyAType; fptools_cv_htype_sup_pid_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_pid_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_pid_t" >&5-echo "${ECHO_T}$fptools_cv_htype_pid_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_PID_T $fptools_cv_htype_pid_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for gid_t" >&5-echo $ECHO_N "checking Haskell type for gid_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_gid_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_gid_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_gid_t=NotReallyATypeCross; fptools_cv_htype_sup_gid_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef gid_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_gid_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_gid_t=NotReallyAType; fptools_cv_htype_sup_gid_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_gid_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_gid_t" >&5-echo "${ECHO_T}$fptools_cv_htype_gid_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_GID_T $fptools_cv_htype_gid_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for uid_t" >&5-echo $ECHO_N "checking Haskell type for uid_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_uid_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_uid_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_uid_t=NotReallyATypeCross; fptools_cv_htype_sup_uid_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef uid_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_uid_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_uid_t=NotReallyAType; fptools_cv_htype_sup_uid_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_uid_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_uid_t" >&5-echo "${ECHO_T}$fptools_cv_htype_uid_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UID_T $fptools_cv_htype_uid_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for cc_t" >&5-echo $ECHO_N "checking Haskell type for cc_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_cc_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_cc_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_cc_t=NotReallyATypeCross; fptools_cv_htype_sup_cc_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef cc_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_cc_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_cc_t=NotReallyAType; fptools_cv_htype_sup_cc_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_cc_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_cc_t" >&5-echo "${ECHO_T}$fptools_cv_htype_cc_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_CC_T $fptools_cv_htype_cc_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for speed_t" >&5-echo $ECHO_N "checking Haskell type for speed_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_speed_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_speed_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_speed_t=NotReallyATypeCross; fptools_cv_htype_sup_speed_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef speed_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_speed_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_speed_t=NotReallyAType; fptools_cv_htype_sup_speed_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_speed_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_speed_t" >&5-echo "${ECHO_T}$fptools_cv_htype_speed_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_SPEED_T $fptools_cv_htype_speed_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for tcflag_t" >&5-echo $ECHO_N "checking Haskell type for tcflag_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_tcflag_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_tcflag_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_tcflag_t=NotReallyATypeCross; fptools_cv_htype_sup_tcflag_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef tcflag_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_tcflag_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_tcflag_t=NotReallyAType; fptools_cv_htype_sup_tcflag_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_tcflag_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_tcflag_t" >&5-echo "${ECHO_T}$fptools_cv_htype_tcflag_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_TCFLAG_T $fptools_cv_htype_tcflag_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for nlink_t" >&5-echo $ECHO_N "checking Haskell type for nlink_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_nlink_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_nlink_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_nlink_t=NotReallyATypeCross; fptools_cv_htype_sup_nlink_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef nlink_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_nlink_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_nlink_t=NotReallyAType; fptools_cv_htype_sup_nlink_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_nlink_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_nlink_t" >&5-echo "${ECHO_T}$fptools_cv_htype_nlink_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_NLINK_T $fptools_cv_htype_nlink_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for ssize_t" >&5-echo $ECHO_N "checking Haskell type for ssize_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_ssize_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_ssize_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_ssize_t=NotReallyATypeCross; fptools_cv_htype_sup_ssize_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef ssize_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_ssize_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_ssize_t=NotReallyAType; fptools_cv_htype_sup_ssize_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_ssize_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_ssize_t" >&5-echo "${ECHO_T}$fptools_cv_htype_ssize_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_SSIZE_T $fptools_cv_htype_ssize_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for rlim_t" >&5-echo $ECHO_N "checking Haskell type for rlim_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_rlim_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_rlim_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_rlim_t=NotReallyATypeCross; fptools_cv_htype_sup_rlim_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef rlim_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_rlim_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_rlim_t=NotReallyAType; fptools_cv_htype_sup_rlim_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_rlim_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_rlim_t" >&5-echo "${ECHO_T}$fptools_cv_htype_rlim_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_RLIM_T $fptools_cv_htype_rlim_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for wint_t" >&5-echo $ECHO_N "checking Haskell type for wint_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_wint_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_wint_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_wint_t=NotReallyATypeCross; fptools_cv_htype_sup_wint_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef wint_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_wint_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_wint_t=NotReallyAType; fptools_cv_htype_sup_wint_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_wint_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_wint_t" >&5-echo "${ECHO_T}$fptools_cv_htype_wint_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_WINT_T $fptools_cv_htype_wint_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi---{ echo "$as_me:$LINENO: checking Haskell type for intptr_t" >&5-echo $ECHO_N "checking Haskell type for intptr_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_intptr_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_intptr_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_intptr_t=NotReallyATypeCross; fptools_cv_htype_sup_intptr_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef intptr_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_intptr_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_intptr_t=NotReallyAType; fptools_cv_htype_sup_intptr_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_intptr_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_intptr_t" >&5-echo "${ECHO_T}$fptools_cv_htype_intptr_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_INTPTR_T $fptools_cv_htype_intptr_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for uintptr_t" >&5-echo $ECHO_N "checking Haskell type for uintptr_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_uintptr_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_uintptr_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_uintptr_t=NotReallyATypeCross; fptools_cv_htype_sup_uintptr_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef uintptr_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_uintptr_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_uintptr_t=NotReallyAType; fptools_cv_htype_sup_uintptr_t=no-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_uintptr_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_uintptr_t" >&5-echo "${ECHO_T}$fptools_cv_htype_uintptr_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UINTPTR_T $fptools_cv_htype_uintptr_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--# Workaround for OSes that don't have intmax_t and uintmax_t, e.g. OpenBSD.-if test "$ac_cv_type_long_long" = yes; then-  fptools_cv_default_htype_intmax=$fptools_cv_htype_long_long-  fptools_cv_default_htype_uintmax=$fptools_cv_htype_unsigned_long_long-else-  fptools_cv_default_htype_intmax=$fptools_cv_htype_long-  fptools_cv_default_htype_uintmax=$fptools_cv_htype_unsigned_long-fi-{ echo "$as_me:$LINENO: checking Haskell type for intmax_t" >&5-echo $ECHO_N "checking Haskell type for intmax_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_intmax_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_intmax_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_intmax_t=NotReallyATypeCross; fptools_cv_htype_sup_intmax_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef intmax_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_intmax_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_intmax_t=$fptools_cv_default_htype_intmax-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_intmax_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_intmax_t" >&5-echo "${ECHO_T}$fptools_cv_htype_intmax_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_INTMAX_T $fptools_cv_htype_intmax_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi--{ echo "$as_me:$LINENO: checking Haskell type for uintmax_t" >&5-echo $ECHO_N "checking Haskell type for uintmax_t... $ECHO_C" >&6; }-if test "${fptools_cv_htype_uintmax_t+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  fptools_cv_htype_sup_uintmax_t=yes-fp_check_htype_save_cppflags="$CPPFLAGS"-CPPFLAGS="$CPPFLAGS $X_CFLAGS"-if test "$cross_compiling" = yes; then-  fptools_cv_htype_uintmax_t=NotReallyATypeCross; fptools_cv_htype_sup_uintmax_t=no-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <stddef.h>--#if HAVE_SYS_TYPES_H-# include <sys/types.h>-#endif--#if HAVE_UNISTD_H-# include <unistd.h>-#endif--#if HAVE_SYS_STAT_H-# include <sys/stat.h>-#endif--#if HAVE_FCNTL_H-# include <fcntl.h>-#endif--#if HAVE_SIGNAL_H-# include <signal.h>-#endif--#if HAVE_TIME_H-# include <time.h>-#endif--#if HAVE_TERMIOS_H-# include <termios.h>-#endif--#if HAVE_STRING_H-# include <string.h>-#endif--#if HAVE_CTYPE_H-# include <ctype.h>-#endif--#if HAVE_INTTYPES_H-# include <inttypes.h>-#else-# if HAVE_STDINT_H-#  include <stdint.h>-# endif-#endif--#if defined(HAVE_GL_GL_H)-# include <GL/gl.h>-#elif defined(HAVE_OPENGL_GL_H)-# include <OpenGL/gl.h>-#endif--#if defined(HAVE_AL_AL_H)-# include <AL/al.h>-#elif defined(HAVE_OPENAL_AL_H)-# include <OpenAL/al.h>-#endif--#if defined(HAVE_AL_ALC_H)-# include <AL/alc.h>-#elif defined(HAVE_OPENAL_ALC_H)-# include <OpenAL/alc.h>-#endif--#if HAVE_SYS_RESOURCE_H-# include <sys/resource.h>-#endif--#include <stdlib.h>--typedef uintmax_t testing;--int main(void) {-  FILE *f=fopen("conftestval", "w");-  if (!f) exit(1);-  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {-    fprintf(f, "%s%d\n",-           ((testing)(-1) < (testing)0) ? "Int" : "Word",-           (int)(sizeof(testing)*8));-  } else {-    fprintf(f,"%s\n",-           (sizeof(testing) >  sizeof(double)) ? "LDouble" :-           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");-  }-  fclose(f);-  exit(0);-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fptools_cv_htype_uintmax_t=`cat conftestval`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fptools_cv_htype_uintmax_t=$fptools_cv_default_htype_uintmax-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi---CPPFLAGS="$fp_check_htype_save_cppflags"-fi- if test "$fptools_cv_htype_sup_uintmax_t" = yes; then-  { echo "$as_me:$LINENO: result: $fptools_cv_htype_uintmax_t" >&5-echo "${ECHO_T}$fptools_cv_htype_uintmax_t" >&6; }--cat >>confdefs.h <<_ACEOF-#define HTYPE_UINTMAX_T $fptools_cv_htype_uintmax_t-_ACEOF--else-  { echo "$as_me:$LINENO: result: not supported" >&5-echo "${ECHO_T}not supported" >&6; }-fi---# test errno values----------------------------------------------------------------------------------------------------for fp_const_name in E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EADV EAFNOSUPPORT EAGAIN EALREADY EBADF EBADMSG EBADRPC EBUSY ECHILD ECOMM ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDIRTY EDOM EDQUOT EEXIST EFAULT EFBIG EFTYPE EHOSTDOWN EHOSTUNREACH EIDRM EILSEQ EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENONET ENOPROTOOPT ENOSPC ENOSR ENOSTR ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROCUNAVAIL EPROGMISMATCH EPROGUNAVAIL EPROTO EPROTONOSUPPORT EPROTOTYPE ERANGE EREMCHG EREMOTE EROFS ERPCMISMATCH ERREMOTE ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESRMNT ESTALE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV ENOCIGAR-do-as_fp_Cache=`echo "fp_cv_const_$fp_const_name" | $as_tr_sh`-{ echo "$as_me:$LINENO: checking value of $fp_const_name" >&5-echo $ECHO_N "checking value of $fp_const_name... $ECHO_C" >&6; }-if { as_var=$as_fp_Cache; eval "test \"\${$as_var+set}\" = set"; }; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  if test "$cross_compiling" = yes; then-  # Depending upon the size, compute the lo and hi bounds.-cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <errno.h>--int-main ()-{-static int test_array [1 - 2 * !(($fp_const_name) >= 0)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_lo=0 ac_mid=0-  while :; do-    cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <errno.h>--int-main ()-{-static int test_array [1 - 2 * !(($fp_const_name) <= $ac_mid)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_hi=$ac_mid; break-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_lo=`expr $ac_mid + 1`-			if test $ac_lo -le $ac_mid; then-			  ac_lo= ac_hi=-			  break-			fi-			ac_mid=`expr 2 '*' $ac_mid + 1`-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  done-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <errno.h>--int-main ()-{-static int test_array [1 - 2 * !(($fp_const_name) < 0)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_hi=-1 ac_mid=-1-  while :; do-    cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <errno.h>--int-main ()-{-static int test_array [1 - 2 * !(($fp_const_name) >= $ac_mid)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_lo=$ac_mid; break-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_hi=`expr '(' $ac_mid ')' - 1`-			if test $ac_mid -le $ac_hi; then-			  ac_lo= ac_hi=-			  break-			fi-			ac_mid=`expr 2 '*' $ac_mid`-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  done-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_lo= ac_hi=-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-# Binary search between lo and hi bounds.-while test "x$ac_lo" != "x$ac_hi"; do-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <errno.h>--int-main ()-{-static int test_array [1 - 2 * !(($fp_const_name) <= $ac_mid)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_hi=$ac_mid-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_lo=`expr '(' $ac_mid ')' + 1`-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-done-case $ac_lo in-?*) fp_check_const_result=$ac_lo;;-'') fp_check_const_result='-1' ;;-esac-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <stdio.h>-#include <errno.h>--static long int longval () { return $fp_const_name; }-static unsigned long int ulongval () { return $fp_const_name; }-#include <stdio.h>-#include <stdlib.h>-int-main ()-{--  FILE *f = fopen ("conftest.val", "w");-  if (! f)-    return 1;-  if (($fp_const_name) < 0)-    {-      long int i = longval ();-      if (i != ($fp_const_name))-	return 1;-      fprintf (f, "%ld\n", i);-    }-  else-    {-      unsigned long int i = ulongval ();-      if (i != ($fp_const_name))-	return 1;-      fprintf (f, "%lu\n", i);-    }-  return ferror (f) || fclose (f) != 0;--  ;-  return 0;-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fp_check_const_result=`cat conftest.val`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fp_check_const_result='-1'-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi-rm -f conftest.val--eval "$as_fp_Cache=\$fp_check_const_result"-fi-ac_res=`eval echo '${'$as_fp_Cache'}'`-	       { echo "$as_me:$LINENO: result: $ac_res" >&5-echo "${ECHO_T}$ac_res" >&6; }-cat >>confdefs.h <<_ACEOF-#define `echo "CONST_$fp_const_name" | $as_tr_cpp` `eval echo '${'$as_fp_Cache'}'`-_ACEOF--done---# we need SIGINT in TopHandler.lhs--for fp_const_name in SIGINT-do-as_fp_Cache=`echo "fp_cv_const_$fp_const_name" | $as_tr_sh`-{ echo "$as_me:$LINENO: checking value of $fp_const_name" >&5-echo $ECHO_N "checking value of $fp_const_name... $ECHO_C" >&6; }-if { as_var=$as_fp_Cache; eval "test \"\${$as_var+set}\" = set"; }; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  if test "$cross_compiling" = yes; then-  # Depending upon the size, compute the lo and hi bounds.-cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */--#if HAVE_SIGNAL_H-#include <signal.h>-#endif--int-main ()-{-static int test_array [1 - 2 * !(($fp_const_name) >= 0)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_lo=0 ac_mid=0-  while :; do-    cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */--#if HAVE_SIGNAL_H-#include <signal.h>-#endif--int-main ()-{-static int test_array [1 - 2 * !(($fp_const_name) <= $ac_mid)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_hi=$ac_mid; break-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_lo=`expr $ac_mid + 1`-			if test $ac_lo -le $ac_mid; then-			  ac_lo= ac_hi=-			  break-			fi-			ac_mid=`expr 2 '*' $ac_mid + 1`-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  done-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */--#if HAVE_SIGNAL_H-#include <signal.h>-#endif--int-main ()-{-static int test_array [1 - 2 * !(($fp_const_name) < 0)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_hi=-1 ac_mid=-1-  while :; do-    cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */--#if HAVE_SIGNAL_H-#include <signal.h>-#endif--int-main ()-{-static int test_array [1 - 2 * !(($fp_const_name) >= $ac_mid)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_lo=$ac_mid; break-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_hi=`expr '(' $ac_mid ')' - 1`-			if test $ac_mid -le $ac_hi; then-			  ac_lo= ac_hi=-			  break-			fi-			ac_mid=`expr 2 '*' $ac_mid`-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  done-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_lo= ac_hi=-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-# Binary search between lo and hi bounds.-while test "x$ac_lo" != "x$ac_hi"; do-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */--#if HAVE_SIGNAL_H-#include <signal.h>-#endif--int-main ()-{-static int test_array [1 - 2 * !(($fp_const_name) <= $ac_mid)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_hi=$ac_mid-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_lo=`expr '(' $ac_mid ')' + 1`-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-done-case $ac_lo in-?*) fp_check_const_result=$ac_lo;;-'') fp_check_const_result='-1' ;;-esac-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */--#if HAVE_SIGNAL_H-#include <signal.h>-#endif--static long int longval () { return $fp_const_name; }-static unsigned long int ulongval () { return $fp_const_name; }-#include <stdio.h>-#include <stdlib.h>-int-main ()-{--  FILE *f = fopen ("conftest.val", "w");-  if (! f)-    return 1;-  if (($fp_const_name) < 0)-    {-      long int i = longval ();-      if (i != ($fp_const_name))-	return 1;-      fprintf (f, "%ld\n", i);-    }-  else-    {-      unsigned long int i = ulongval ();-      if (i != ($fp_const_name))-	return 1;-      fprintf (f, "%lu\n", i);-    }-  return ferror (f) || fclose (f) != 0;--  ;-  return 0;-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fp_check_const_result=`cat conftest.val`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fp_check_const_result='-1'-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi-rm -f conftest.val--eval "$as_fp_Cache=\$fp_check_const_result"-fi-ac_res=`eval echo '${'$as_fp_Cache'}'`-	       { echo "$as_me:$LINENO: result: $ac_res" >&5-echo "${ECHO_T}$ac_res" >&6; }-cat >>confdefs.h <<_ACEOF-#define `echo "CONST_$fp_const_name" | $as_tr_cpp` `eval echo '${'$as_fp_Cache'}'`-_ACEOF--done---{ echo "$as_me:$LINENO: checking value of O_BINARY" >&5-echo $ECHO_N "checking value of O_BINARY... $ECHO_C" >&6; }-if test "${fp_cv_const_O_BINARY+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  if test "$cross_compiling" = yes; then-  # Depending upon the size, compute the lo and hi bounds.-cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <fcntl.h>--int-main ()-{-static int test_array [1 - 2 * !((O_BINARY) >= 0)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_lo=0 ac_mid=0-  while :; do-    cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <fcntl.h>--int-main ()-{-static int test_array [1 - 2 * !((O_BINARY) <= $ac_mid)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_hi=$ac_mid; break-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_lo=`expr $ac_mid + 1`-			if test $ac_lo -le $ac_mid; then-			  ac_lo= ac_hi=-			  break-			fi-			ac_mid=`expr 2 '*' $ac_mid + 1`-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  done-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <fcntl.h>--int-main ()-{-static int test_array [1 - 2 * !((O_BINARY) < 0)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_hi=-1 ac_mid=-1-  while :; do-    cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <fcntl.h>--int-main ()-{-static int test_array [1 - 2 * !((O_BINARY) >= $ac_mid)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_lo=$ac_mid; break-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_hi=`expr '(' $ac_mid ')' - 1`-			if test $ac_mid -le $ac_hi; then-			  ac_lo= ac_hi=-			  break-			fi-			ac_mid=`expr 2 '*' $ac_mid`-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-  done-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_lo= ac_hi=-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-# Binary search between lo and hi bounds.-while test "x$ac_lo" != "x$ac_hi"; do-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <fcntl.h>--int-main ()-{-static int test_array [1 - 2 * !((O_BINARY) <= $ac_mid)];-test_array [0] = 0--  ;-  return 0;-}-_ACEOF-rm -f conftest.$ac_objext-if { (ac_try="$ac_compile"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_compile") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest.$ac_objext; then-  ac_hi=$ac_mid-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--	ac_lo=`expr '(' $ac_mid ')' + 1`-fi--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext-done-case $ac_lo in-?*) fp_check_const_result=$ac_lo;;-'') fp_check_const_result=0 ;;-esac-else-  cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */-#include <fcntl.h>--static long int longval () { return O_BINARY; }-static unsigned long int ulongval () { return O_BINARY; }-#include <stdio.h>-#include <stdlib.h>-int-main ()-{--  FILE *f = fopen ("conftest.val", "w");-  if (! f)-    return 1;-  if ((O_BINARY) < 0)-    {-      long int i = longval ();-      if (i != (O_BINARY))-	return 1;-      fprintf (f, "%ld\n", i);-    }-  else-    {-      unsigned long int i = ulongval ();-      if (i != (O_BINARY))-	return 1;-      fprintf (f, "%lu\n", i);-    }-  return ferror (f) || fclose (f) != 0;--  ;-  return 0;-}-_ACEOF-rm -f conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'-  { (case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_try") 2>&5-  ac_status=$?-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); }; }; then-  fp_check_const_result=`cat conftest.val`-else-  echo "$as_me: program exited with status $ac_status" >&5-echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5--( exit $ac_status )-fp_check_const_result=0-fi-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext-fi-rm -f conftest.val--fp_cv_const_O_BINARY=$fp_check_const_result-fi-{ echo "$as_me:$LINENO: result: $fp_cv_const_O_BINARY" >&5-echo "${ECHO_T}$fp_cv_const_O_BINARY" >&6; }-cat >>confdefs.h <<_ACEOF-#define CONST_O_BINARY $fp_cv_const_O_BINARY-_ACEOF---# We can't just use AC_SEARCH_LIBS for this, as on OpenBSD the iconv.h-# header needs to be included as iconv_open is #define'd to something-# else. We therefore use our own FP_SEARCH_LIBS_PROTO, which allows us-# to give prototype text.-{ echo "$as_me:$LINENO: checking for library containing iconv" >&5-echo $ECHO_N "checking for library containing iconv... $ECHO_C" >&6; }-if test "${ac_cv_search_iconv_t_cd________________________cd___iconv_open________________________________iconv_cd_NULL_NULL_NULL_NULL_________________________iconv_close_cd__+set}" = set; then-  echo $ECHO_N "(cached) $ECHO_C" >&6-else-  ac_func_search_save_LIBS=$LIBS-cat >conftest.$ac_ext <<_ACEOF-/* confdefs.h.  */-_ACEOF-cat confdefs.h >>conftest.$ac_ext-cat >>conftest.$ac_ext <<_ACEOF-/* end confdefs.h.  */--#include <stddef.h>-#include <iconv.h>--int-main ()-{-iconv_t cd;-                      cd = iconv_open("", "");-                      iconv(cd,NULL,NULL,NULL,NULL);-                      iconv_close(cd);-  ;-  return 0;-}-_ACEOF-for ac_lib in '' iconv; do-  if test -z "$ac_lib"; then-    ac_res="none required"-  else-    ac_res=-l$ac_lib-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"-  fi-  rm -f conftest.$ac_objext conftest$ac_exeext-if { (ac_try="$ac_link"-case "(($ac_try" in-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;-  *) ac_try_echo=$ac_try;;-esac-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5-  (eval "$ac_link") 2>conftest.er1-  ac_status=$?-  grep -v '^ *+' conftest.er1 >conftest.err-  rm -f conftest.er1-  cat conftest.err >&5-  echo "$as_me:$LINENO: \$? = $ac_status" >&5-  (exit $ac_status); } && {-	 test -z "$ac_c_werror_flag" ||-	 test ! -s conftest.err-       } && test -s conftest$ac_exeext &&-       $as_test_x conftest$ac_exeext; then-  ac_cv_search_iconv_t_cd________________________cd___iconv_open________________________________iconv_cd_NULL_NULL_NULL_NULL_________________________iconv_close_cd__=$ac_res-else-  echo "$as_me: failed program was:" >&5-sed 's/^/| /' conftest.$ac_ext >&5---fi--rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \-      conftest$ac_exeext-  if test "${ac_cv_search_iconv_t_cd________________________cd___iconv_open________________________________iconv_cd_NULL_NULL_NULL_NULL_________________________iconv_close_cd__+set}" = set; then-  break-fi--done-if test "${ac_cv_search_iconv_t_cd________________________cd___iconv_open________________________________iconv_cd_NULL_NULL_NULL_NULL_________________________iconv_close_cd__+set}" = set; then-  :-else-  ac_cv_search_iconv_t_cd________________________cd___iconv_open________________________________iconv_cd_NULL_NULL_NULL_NULL_________________________iconv_close_cd__=no-fi--rm conftest.$ac_ext-LIBS=$ac_func_search_save_LIBS-fi-{ echo "$as_me:$LINENO: result: $ac_cv_search_iconv_t_cd________________________cd___iconv_open________________________________iconv_cd_NULL_NULL_NULL_NULL_________________________iconv_close_cd__" >&5-echo "${ECHO_T}$ac_cv_search_iconv_t_cd________________________cd___iconv_open________________________________iconv_cd_NULL_NULL_NULL_NULL_________________________iconv_close_cd__" >&6; }-ac_res=$ac_cv_search_iconv_t_cd________________________cd___iconv_open________________________________iconv_cd_NULL_NULL_NULL_NULL_________________________iconv_close_cd__-if test "$ac_res" != no; then-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"-  EXTRA_LIBS="$EXTRA_LIBS $ac_lib"-else-  case `uname -s` in-                        MINGW*|CYGWIN*) ;;-                        *)-                             { { echo "$as_me:$LINENO: error: iconv is required on non-Windows platforms" >&5-echo "$as_me: error: iconv is required on non-Windows platforms" >&2;}-   { (exit 1); exit 1; }; };;-                      esac-fi----ac_config_files="$ac_config_files base.buildinfo"---cat >confcache <<\_ACEOF-# This file is a shell script that caches the results of configure-# tests run on this system so they can be shared between configure-# scripts and configure runs, see configure's option --config-cache.-# It is not useful on other systems.  If it contains results you don't-# want to keep, you may remove or edit it.-#-# config.status only pays attention to the cache file if you give it-# the --recheck option to rerun configure.-#-# `ac_cv_env_foo' variables (set or unset) will be overridden when-# loading this file, other *unset* `ac_cv_foo' will be assigned the-# following values.--_ACEOF--# The following way of writing the cache mishandles newlines in values,-# but we know of no workaround that is simple, portable, and efficient.-# So, we kill variables containing newlines.-# Ultrix sh set writes to stderr and can't be redirected directly,-# and sets the high bit in the cache file unless we assign to the vars.-(-  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do-    eval ac_val=\$$ac_var-    case $ac_val in #(-    *${as_nl}*)-      case $ac_var in #(-      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;-      esac-      case $ac_var in #(-      _ | IFS | as_nl) ;; #(-      *) $as_unset $ac_var ;;-      esac ;;-    esac-  done--  (set) 2>&1 |-    case $as_nl`(ac_space=' '; set) 2>&1` in #(-    *${as_nl}ac_space=\ *)-      # `set' does not quote correctly, so add quotes (double-quote-      # substitution turns \\\\ into \\, and sed turns \\ into \).-      sed -n \-	"s/'/'\\\\''/g;-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"-      ;; #(-    *)-      # `set' quotes correctly as required by POSIX, so do not add quotes.-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"-      ;;-    esac |-    sort-) |-  sed '-     /^ac_cv_env_/b end-     t clear-     :clear-     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/-     t end-     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/-     :end' >>confcache-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else-  if test -w "$cache_file"; then-    test "x$cache_file" != "x/dev/null" &&-      { echo "$as_me:$LINENO: updating cache $cache_file" >&5-echo "$as_me: updating cache $cache_file" >&6;}-    cat confcache >$cache_file-  else-    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5-echo "$as_me: not updating unwritable cache $cache_file" >&6;}-  fi-fi-rm -f confcache--test "x$prefix" = xNONE && prefix=$ac_default_prefix-# Let make expand exec_prefix.-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'--DEFS=-DHAVE_CONFIG_H--ac_libobjs=-ac_ltlibobjs=-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue-  # 1. Remove the extension, and $U if already installed.-  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'-  ac_i=`echo "$ac_i" | sed "$ac_script"`-  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR-  #    will be set to the directory where LIBOBJS objects are built.-  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"-  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'-done-LIBOBJS=$ac_libobjs--LTLIBOBJS=$ac_ltlibobjs----: ${CONFIG_STATUS=./config.status}-ac_clean_files_save=$ac_clean_files-ac_clean_files="$ac_clean_files $CONFIG_STATUS"-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5-echo "$as_me: creating $CONFIG_STATUS" >&6;}-cat >$CONFIG_STATUS <<_ACEOF-#! $SHELL-# Generated by $as_me.-# Run this file to recreate the current configuration.-# Compiler output produced by configure, useful for debugging-# configure, is in config.log if it exists.--debug=false-ac_cs_recheck=false-ac_cs_silent=false-SHELL=\${CONFIG_SHELL-$SHELL}-_ACEOF--cat >>$CONFIG_STATUS <<\_ACEOF-## --------------------- ##-## M4sh Initialization.  ##-## --------------------- ##--# Be more Bourne compatible-DUALCASE=1; export DUALCASE # for MKS sh-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then-  emulate sh-  NULLCMD=:-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which-  # is contrary to our usage.  Disable this feature.-  alias -g '${1+"$@"}'='"$@"'-  setopt NO_GLOB_SUBST-else-  case `(set -o) 2>/dev/null` in-  *posix*) set -o posix ;;-esac--fi-----# PATH needs CR-# Avoid depending upon Character Ranges.-as_cr_letters='abcdefghijklmnopqrstuvwxyz'-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'-as_cr_Letters=$as_cr_letters$as_cr_LETTERS-as_cr_digits='0123456789'-as_cr_alnum=$as_cr_Letters$as_cr_digits--# The user is always right.-if test "${PATH_SEPARATOR+set}" != set; then-  echo "#! /bin/sh" >conf$$.sh-  echo  "exit 0"   >>conf$$.sh-  chmod +x conf$$.sh-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then-    PATH_SEPARATOR=';'-  else-    PATH_SEPARATOR=:-  fi-  rm -f conf$$.sh-fi--# Support unset when possible.-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then-  as_unset=unset-else-  as_unset=false-fi---# IFS-# We need space, tab and new line, in precisely that order.  Quoting is-# there to prevent editors from complaining about space-tab.-# (If _AS_PATH_WALK were called with IFS unset, it would disable word-# splitting by setting IFS to empty value.)-as_nl='-'-IFS=" ""	$as_nl"--# Find who we are.  Look in the path if we contain no directory separator.-case $0 in-  *[\\/]* ) as_myself=$0 ;;-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do-  IFS=$as_save_IFS-  test -z "$as_dir" && as_dir=.-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break-done-IFS=$as_save_IFS--     ;;-esac-# We did not find ourselves, most probably we were run as `sh COMMAND'-# in which case we are not to be found in the path.-if test "x$as_myself" = x; then-  as_myself=$0-fi-if test ! -f "$as_myself"; then-  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2-  { (exit 1); exit 1; }-fi--# Work around bugs in pre-3.0 UWIN ksh.-for as_var in ENV MAIL MAILPATH-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var-done-PS1='$ '-PS2='> '-PS4='+ '--# NLS nuisances.-for as_var in \-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \-  LC_TELEPHONE LC_TIME-do-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then-    eval $as_var=C; export $as_var-  else-    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var-  fi-done--# Required to use basename.-if expr a : '\(a\)' >/dev/null 2>&1 &&-   test "X`expr 00001 : '.*\(...\)'`" = X001; then-  as_expr=expr-else-  as_expr=false-fi--if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then-  as_basename=basename-else-  as_basename=false-fi---# Name of the executable.-as_me=`$as_basename -- "$0" ||-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \-	 X"$0" : 'X\(//\)$' \| \-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||-echo X/"$0" |-    sed '/^.*\/\([^/][^/]*\)\/*$/{-	    s//\1/-	    q-	  }-	  /^X\/\(\/\/\)$/{-	    s//\1/-	    q-	  }-	  /^X\/\(\/\).*/{-	    s//\1/-	    q-	  }-	  s/.*/./; q'`--# CDPATH.-$as_unset CDPATH----  as_lineno_1=$LINENO-  as_lineno_2=$LINENO-  test "x$as_lineno_1" != "x$as_lineno_2" &&-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {--  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO-  # uniformly replaced by the line number.  The first 'sed' inserts a-  # line-number line after each line using $LINENO; the second 'sed'-  # does the real work.  The second script uses 'N' to pair each-  # line-number line with the line containing $LINENO, and appends-  # trailing '-' during substitution so that $LINENO is not a special-  # case at line end.-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the-  # scripts with optimization help from Paolo Bonzini.  Blame Lee-  # E. McMahon (1931-1989) for sed's syntax.  :-)-  sed -n '-    p-    /[$]LINENO/=-  ' <$as_myself |-    sed '-      s/[$]LINENO.*/&-/-      t lineno-      b-      :lineno-      N-      :loop-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/-      t loop-      s/-\n.*//-    ' >$as_me.lineno &&-  chmod +x "$as_me.lineno" ||-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2-   { (exit 1); exit 1; }; }--  # Don't try to exec as it changes $[0], causing all sort of problems-  # (the dirname of $[0] is not the place where we might find the-  # original and so on.  Autoconf is especially sensitive to this).-  . "./$as_me.lineno"-  # Exit status is that of the last command.-  exit-}---if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then-  as_dirname=dirname-else-  as_dirname=false-fi--ECHO_C= ECHO_N= ECHO_T=-case `echo -n x` in--n*)-  case `echo 'x\c'` in-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.-  *)   ECHO_C='\c';;-  esac;;-*)-  ECHO_N='-n';;-esac--if expr a : '\(a\)' >/dev/null 2>&1 &&-   test "X`expr 00001 : '.*\(...\)'`" = X001; then-  as_expr=expr-else-  as_expr=false-fi--rm -f conf$$ conf$$.exe conf$$.file-if test -d conf$$.dir; then-  rm -f conf$$.dir/conf$$.file-else-  rm -f conf$$.dir-  mkdir conf$$.dir-fi-echo >conf$$.file-if ln -s conf$$.file conf$$ 2>/dev/null; then-  as_ln_s='ln -s'-  # ... but there are two gotchas:-  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.-  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.-  # In both cases, we have to default to `cp -p'.-  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||-    as_ln_s='cp -p'-elif ln conf$$.file conf$$ 2>/dev/null; then-  as_ln_s=ln-else-  as_ln_s='cp -p'-fi-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file-rmdir conf$$.dir 2>/dev/null--if mkdir -p . 2>/dev/null; then-  as_mkdir_p=:-else-  test -d ./-p && rmdir ./-p-  as_mkdir_p=false-fi--if test -x / >/dev/null 2>&1; then-  as_test_x='test -x'-else-  if ls -dL / >/dev/null 2>&1; then-    as_ls_L_option=L-  else-    as_ls_L_option=-  fi-  as_test_x='-    eval sh -c '\''-      if test -d "$1"; then-        test -d "$1/.";-      else-	case $1 in-        -*)set "./$1";;-	esac;-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in-	???[sx]*):;;*)false;;esac;fi-    '\'' sh-  '-fi-as_executable_p=$as_test_x--# Sed expression to map a string onto a valid CPP name.-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"--# Sed expression to map a string onto a valid variable name.-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"---exec 6>&1--# Save the log message, to keep $[0] and so on meaningful, and to-# report actual input values of CONFIG_FILES etc. instead of their-# values after options handling.-ac_log="-This file was extended by Haskell base package $as_me 1.0, which was-generated by GNU Autoconf 2.61.  Invocation command line was--  CONFIG_FILES    = $CONFIG_FILES-  CONFIG_HEADERS  = $CONFIG_HEADERS-  CONFIG_LINKS    = $CONFIG_LINKS-  CONFIG_COMMANDS = $CONFIG_COMMANDS-  $ $0 $@--on `(hostname || uname -n) 2>/dev/null | sed 1q`-"--_ACEOF--cat >>$CONFIG_STATUS <<_ACEOF-# Files that config.status was made for.-config_files="$ac_config_files"-config_headers="$ac_config_headers"--_ACEOF--cat >>$CONFIG_STATUS <<\_ACEOF-ac_cs_usage="\-\`$as_me' instantiates files from templates according to the-current configuration.--Usage: $0 [OPTIONS] [FILE]...--  -h, --help       print this help, then exit-  -V, --version    print version number and configuration settings, then exit-  -q, --quiet      do not print progress messages-  -d, --debug      don't remove temporary files-      --recheck    update $as_me by reconfiguring in the same conditions-  --file=FILE[:TEMPLATE]-		   instantiate the configuration file FILE-  --header=FILE[:TEMPLATE]-		   instantiate the configuration header FILE--Configuration files:-$config_files--Configuration headers:-$config_headers--Report bugs to <bug-autoconf@gnu.org>."--_ACEOF-cat >>$CONFIG_STATUS <<_ACEOF-ac_cs_version="\\-Haskell base package config.status 1.0-configured by $0, generated by GNU Autoconf 2.61,-  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"--Copyright (C) 2006 Free Software Foundation, Inc.-This config.status script is free software; the Free Software Foundation-gives unlimited permission to copy, distribute and modify it."--ac_pwd='$ac_pwd'-srcdir='$srcdir'-_ACEOF--cat >>$CONFIG_STATUS <<\_ACEOF-# If no file are specified by the user, then we need to provide default-# value.  By we need to know if files were specified by the user.-ac_need_defaults=:-while test $# != 0-do-  case $1 in-  --*=*)-    ac_option=`expr "X$1" : 'X\([^=]*\)='`-    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`-    ac_shift=:-    ;;-  *)-    ac_option=$1-    ac_optarg=$2-    ac_shift=shift-    ;;-  esac--  case $ac_option in-  # Handling of the options.-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)-    ac_cs_recheck=: ;;-  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )-    echo "$ac_cs_version"; exit ;;-  --debug | --debu | --deb | --de | --d | -d )-    debug=: ;;-  --file | --fil | --fi | --f )-    $ac_shift-    CONFIG_FILES="$CONFIG_FILES $ac_optarg"-    ac_need_defaults=false;;-  --header | --heade | --head | --hea )-    $ac_shift-    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"-    ac_need_defaults=false;;-  --he | --h)-    # Conflict between --help and --header-    { echo "$as_me: error: ambiguous option: $1-Try \`$0 --help' for more information." >&2-   { (exit 1); exit 1; }; };;-  --help | --hel | -h )-    echo "$ac_cs_usage"; exit ;;-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \-  | -silent | --silent | --silen | --sile | --sil | --si | --s)-    ac_cs_silent=: ;;--  # This is an error.-  -*) { echo "$as_me: error: unrecognized option: $1-Try \`$0 --help' for more information." >&2-   { (exit 1); exit 1; }; } ;;--  *) ac_config_targets="$ac_config_targets $1"-     ac_need_defaults=false ;;--  esac-  shift-done--ac_configure_extra_args=--if $ac_cs_silent; then-  exec 6>/dev/null-  ac_configure_extra_args="$ac_configure_extra_args --silent"-fi--_ACEOF-cat >>$CONFIG_STATUS <<_ACEOF-if \$ac_cs_recheck; then-  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6-  CONFIG_SHELL=$SHELL-  export CONFIG_SHELL-  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion-fi--_ACEOF-cat >>$CONFIG_STATUS <<\_ACEOF-exec 5>>config.log-{-  echo-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX-## Running $as_me. ##-_ASBOX-  echo "$ac_log"-} >&5--_ACEOF-cat >>$CONFIG_STATUS <<_ACEOF-_ACEOF--cat >>$CONFIG_STATUS <<\_ACEOF--# Handling of arguments.-for ac_config_target in $ac_config_targets-do-  case $ac_config_target in-    "include/HsBaseConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/HsBaseConfig.h" ;;-    "base.buildinfo") CONFIG_FILES="$CONFIG_FILES base.buildinfo" ;;--  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}-   { (exit 1); exit 1; }; };;-  esac-done---# If the user did not use the arguments to specify the items to instantiate,-# then the envvar interface is used.  Set only those that are not.-# We use the long form for the default assignment because of an extremely-# bizarre bug on SunOS 4.1.3.-if $ac_need_defaults; then-  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files-  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers-fi--# Have a temporary directory for convenience.  Make it in the build tree-# simply because there is no reason against having it here, and in addition,-# creating and moving files from /tmp can sometimes cause problems.-# Hook for its removal unless debugging.-# Note that there is a small window in which the directory will not be cleaned:-# after its creation but before its name has been assigned to `$tmp'.-$debug ||-{-  tmp=-  trap 'exit_status=$?-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status-' 0-  trap '{ (exit 1); exit 1; }' 1 2 13 15-}-# Create a (secure) tmp directory for tmp files.--{-  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&-  test -n "$tmp" && test -d "$tmp"-}  ||-{-  tmp=./conf$$-$RANDOM-  (umask 077 && mkdir "$tmp")-} ||-{-   echo "$me: cannot create a temporary directory in ." >&2-   { (exit 1); exit 1; }-}--#-# Set up the sed scripts for CONFIG_FILES section.-#--# No need to generate the scripts if there are no CONFIG_FILES.-# This happens for instance when ./config.status config.h-if test -n "$CONFIG_FILES"; then--_ACEOF----ac_delim='%!_!# '-for ac_last_try in false false false false false :; do-  cat >conf$$subs.sed <<_ACEOF-SHELL!$SHELL$ac_delim-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim-PACKAGE_NAME!$PACKAGE_NAME$ac_delim-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim-PACKAGE_STRING!$PACKAGE_STRING$ac_delim-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim-exec_prefix!$exec_prefix$ac_delim-prefix!$prefix$ac_delim-program_transform_name!$program_transform_name$ac_delim-bindir!$bindir$ac_delim-sbindir!$sbindir$ac_delim-libexecdir!$libexecdir$ac_delim-datarootdir!$datarootdir$ac_delim-datadir!$datadir$ac_delim-sysconfdir!$sysconfdir$ac_delim-sharedstatedir!$sharedstatedir$ac_delim-localstatedir!$localstatedir$ac_delim-includedir!$includedir$ac_delim-oldincludedir!$oldincludedir$ac_delim-docdir!$docdir$ac_delim-infodir!$infodir$ac_delim-htmldir!$htmldir$ac_delim-dvidir!$dvidir$ac_delim-pdfdir!$pdfdir$ac_delim-psdir!$psdir$ac_delim-libdir!$libdir$ac_delim-localedir!$localedir$ac_delim-mandir!$mandir$ac_delim-DEFS!$DEFS$ac_delim-ECHO_C!$ECHO_C$ac_delim-ECHO_N!$ECHO_N$ac_delim-ECHO_T!$ECHO_T$ac_delim-LIBS!$LIBS$ac_delim-build_alias!$build_alias$ac_delim-host_alias!$host_alias$ac_delim-target_alias!$target_alias$ac_delim-CC!$CC$ac_delim-CFLAGS!$CFLAGS$ac_delim-LDFLAGS!$LDFLAGS$ac_delim-CPPFLAGS!$CPPFLAGS$ac_delim-ac_ct_CC!$ac_ct_CC$ac_delim-EXEEXT!$EXEEXT$ac_delim-OBJEXT!$OBJEXT$ac_delim-CPP!$CPP$ac_delim-GREP!$GREP$ac_delim-EGREP!$EGREP$ac_delim-ICONV_INCLUDE_DIRS!$ICONV_INCLUDE_DIRS$ac_delim-ICONV_LIB_DIRS!$ICONV_LIB_DIRS$ac_delim-EXTRA_LIBS!$EXTRA_LIBS$ac_delim-LIBOBJS!$LIBOBJS$ac_delim-LTLIBOBJS!$LTLIBOBJS$ac_delim-_ACEOF--  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then-    break-  elif $ac_last_try; then-    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}-   { (exit 1); exit 1; }; }-  else-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "-  fi-done--ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`-if test -n "$ac_eof"; then-  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`-  ac_eof=`expr $ac_eof + 1`-fi--cat >>$CONFIG_STATUS <<_ACEOF-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end-_ACEOF-sed '-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g-s/^/s,@/; s/!/@,|#_!!_#|/-:n-t n-s/'"$ac_delim"'$/,g/; t-s/$/\\/; p-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n-' >>$CONFIG_STATUS <conf$$subs.sed-rm -f conf$$subs.sed-cat >>$CONFIG_STATUS <<_ACEOF-:end-s/|#_!!_#|//g-CEOF$ac_eof-_ACEOF---# VPATH may cause trouble with some makes, so we remove $(srcdir),-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and-# trailing colons and then remove the whole line if VPATH becomes empty-# (actually we leave an empty line to preserve line numbers).-if test "x$srcdir" = x.; then-  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{-s/:*\$(srcdir):*/:/-s/:*\${srcdir}:*/:/-s/:*@srcdir@:*/:/-s/^\([^=]*=[	 ]*\):*/\1/-s/:*$//-s/^[^=]*=[	 ]*$//-}'-fi--cat >>$CONFIG_STATUS <<\_ACEOF-fi # test -n "$CONFIG_FILES"---for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS-do-  case $ac_tag in-  :[FHLC]) ac_mode=$ac_tag; continue;;-  esac-  case $ac_mode$ac_tag in-  :[FHL]*:*);;-  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5-echo "$as_me: error: Invalid tag $ac_tag." >&2;}-   { (exit 1); exit 1; }; };;-  :[FH]-) ac_tag=-:-;;-  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;-  esac-  ac_save_IFS=$IFS-  IFS=:-  set x $ac_tag-  IFS=$ac_save_IFS-  shift-  ac_file=$1-  shift--  case $ac_mode in-  :L) ac_source=$1;;-  :[FH])-    ac_file_inputs=-    for ac_f-    do-      case $ac_f in-      -) ac_f="$tmp/stdin";;-      *) # Look for the file first in the build tree, then in the source tree-	 # (if the path is not absolute).  The absolute path cannot be DOS-style,-	 # because $ac_f cannot contain `:'.-	 test -f "$ac_f" ||-	   case $ac_f in-	   [\\/$]*) false;;-	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;-	   esac ||-	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5-echo "$as_me: error: cannot find input file: $ac_f" >&2;}-   { (exit 1); exit 1; }; };;-      esac-      ac_file_inputs="$ac_file_inputs $ac_f"-    done--    # Let's still pretend it is `configure' which instantiates (i.e., don't-    # use $as_me), people would be surprised to read:-    #    /* config.h.  Generated by config.status.  */-    configure_input="Generated from "`IFS=:-	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."-    if test x"$ac_file" != x-; then-      configure_input="$ac_file.  $configure_input"-      { echo "$as_me:$LINENO: creating $ac_file" >&5-echo "$as_me: creating $ac_file" >&6;}-    fi--    case $ac_tag in-    *:-:* | *:-) cat >"$tmp/stdin";;-    esac-    ;;-  esac--  ac_dir=`$as_dirname -- "$ac_file" ||-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \-	 X"$ac_file" : 'X\(//\)[^/]' \| \-	 X"$ac_file" : 'X\(//\)$' \| \-	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||-echo X"$ac_file" |-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{-	    s//\1/-	    q-	  }-	  /^X\(\/\/\)[^/].*/{-	    s//\1/-	    q-	  }-	  /^X\(\/\/\)$/{-	    s//\1/-	    q-	  }-	  /^X\(\/\).*/{-	    s//\1/-	    q-	  }-	  s/.*/./; q'`-  { as_dir="$ac_dir"-  case $as_dir in #(-  -*) as_dir=./$as_dir;;-  esac-  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {-    as_dirs=-    while :; do-      case $as_dir in #(-      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(-      *) as_qdir=$as_dir;;-      esac-      as_dirs="'$as_qdir' $as_dirs"-      as_dir=`$as_dirname -- "$as_dir" ||-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \-	 X"$as_dir" : 'X\(//\)[^/]' \| \-	 X"$as_dir" : 'X\(//\)$' \| \-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||-echo X"$as_dir" |-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{-	    s//\1/-	    q-	  }-	  /^X\(\/\/\)[^/].*/{-	    s//\1/-	    q-	  }-	  /^X\(\/\/\)$/{-	    s//\1/-	    q-	  }-	  /^X\(\/\).*/{-	    s//\1/-	    q-	  }-	  s/.*/./; q'`-      test -d "$as_dir" && break-    done-    test -z "$as_dirs" || eval "mkdir $as_dirs"-  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5-echo "$as_me: error: cannot create directory $as_dir" >&2;}-   { (exit 1); exit 1; }; }; }-  ac_builddir=.--case "$ac_dir" in-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;-*)-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`-  # A ".." for each directory in $ac_dir_suffix.-  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`-  case $ac_top_builddir_sub in-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;-  esac ;;-esac-ac_abs_top_builddir=$ac_pwd-ac_abs_builddir=$ac_pwd$ac_dir_suffix-# for backward compatibility:-ac_top_builddir=$ac_top_build_prefix--case $srcdir in-  .)  # We are building in place.-    ac_srcdir=.-    ac_top_srcdir=$ac_top_builddir_sub-    ac_abs_top_srcdir=$ac_pwd ;;-  [\\/]* | ?:[\\/]* )  # Absolute name.-    ac_srcdir=$srcdir$ac_dir_suffix;-    ac_top_srcdir=$srcdir-    ac_abs_top_srcdir=$srcdir ;;-  *) # Relative name.-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix-    ac_top_srcdir=$ac_top_build_prefix$srcdir-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;-esac-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix---  case $ac_mode in-  :F)-  #-  # CONFIG_FILE-  #--_ACEOF--cat >>$CONFIG_STATUS <<\_ACEOF-# If the template does not know about datarootdir, expand it.-# FIXME: This hack should be removed a few years after 2.60.-ac_datarootdir_hack=; ac_datarootdir_seen=--case `sed -n '/datarootdir/ {-  p-  q-}-/@datadir@/p-/@docdir@/p-/@infodir@/p-/@localedir@/p-/@mandir@/p-' $ac_file_inputs` in-*datarootdir*) ac_datarootdir_seen=yes;;-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)-  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}-_ACEOF-cat >>$CONFIG_STATUS <<_ACEOF-  ac_datarootdir_hack='-  s&@datadir@&$datadir&g-  s&@docdir@&$docdir&g-  s&@infodir@&$infodir&g-  s&@localedir@&$localedir&g-  s&@mandir@&$mandir&g-    s&\\\${datarootdir}&$datarootdir&g' ;;-esac-_ACEOF--# Neutralize VPATH when `$srcdir' = `.'.-# Shell code in configure.ac might set extrasub.-# FIXME: do we really want to maintain this feature?-cat >>$CONFIG_STATUS <<_ACEOF-  sed "$ac_vpsub-$extrasub-_ACEOF-cat >>$CONFIG_STATUS <<\_ACEOF-:t-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b-s&@configure_input@&$configure_input&;t t-s&@top_builddir@&$ac_top_builddir_sub&;t t-s&@srcdir@&$ac_srcdir&;t t-s&@abs_srcdir@&$ac_abs_srcdir&;t t-s&@top_srcdir@&$ac_top_srcdir&;t t-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t-s&@builddir@&$ac_builddir&;t t-s&@abs_builddir@&$ac_abs_builddir&;t t-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t-$ac_datarootdir_hack-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out--test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&-  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'-which seems to be undefined.  Please make sure it is defined." >&5-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'-which seems to be undefined.  Please make sure it is defined." >&2;}--  rm -f "$tmp/stdin"-  case $ac_file in-  -) cat "$tmp/out"; rm -f "$tmp/out";;-  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;-  esac- ;;-  :H)-  #-  # CONFIG_HEADER-  #-_ACEOF--# Transform confdefs.h into a sed script `conftest.defines', that-# substitutes the proper values into config.h.in to produce config.h.-rm -f conftest.defines conftest.tail-# First, append a space to every undef/define line, to ease matching.-echo 's/$/ /' >conftest.defines-# Then, protect against being on the right side of a sed subst, or in-# an unquoted here document, in config.status.  If some macros were-# called several times there might be several #defines for the same-# symbol, which is useless.  But do not sort them, since the last-# AC_DEFINE must be honored.-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*-# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where-# NAME is the cpp macro being defined, VALUE is the value it is being given.-# PARAMS is the parameter list in the macro definition--in most cases, it's-# just an empty string.-ac_dA='s,^\\([	 #]*\\)[^	 ]*\\([	 ]*'-ac_dB='\\)[	 (].*,\\1define\\2'-ac_dC=' '-ac_dD=' ,'--uniq confdefs.h |-  sed -n '-	t rset-	:rset-	s/^[	 ]*#[	 ]*define[	 ][	 ]*//-	t ok-	d-	:ok-	s/[\\&,]/\\&/g-	s/^\('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p-	s/^\('"$ac_word_re"'\)[	 ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p-  ' >>conftest.defines--# Remove the space that was appended to ease matching.-# Then replace #undef with comments.  This is necessary, for-# example, in the case of _POSIX_SOURCE, which is predefined and required-# on some systems where configure will not decide to define it.-# (The regexp can be short, since the line contains either #define or #undef.)-echo 's/ $//-s,^[	 #]*u.*,/* & */,' >>conftest.defines--# Break up conftest.defines:-ac_max_sed_lines=50--# First sed command is:	 sed -f defines.sed $ac_file_inputs >"$tmp/out1"-# Second one is:	 sed -f defines.sed "$tmp/out1" >"$tmp/out2"-# Third one will be:	 sed -f defines.sed "$tmp/out2" >"$tmp/out1"-# et cetera.-ac_in='$ac_file_inputs'-ac_out='"$tmp/out1"'-ac_nxt='"$tmp/out2"'--while :-do-  # Write a here document:-    cat >>$CONFIG_STATUS <<_ACEOF-    # First, check the format of the line:-    cat >"\$tmp/defines.sed" <<\\CEOF-/^[	 ]*#[	 ]*undef[	 ][	 ]*$ac_word_re[	 ]*\$/b def-/^[	 ]*#[	 ]*define[	 ][	 ]*$ac_word_re[(	 ]/b def-b-:def-_ACEOF-  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS-  echo 'CEOF-    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS-  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in-  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail-  grep . conftest.tail >/dev/null || break-  rm -f conftest.defines-  mv conftest.tail conftest.defines-done-rm -f conftest.defines conftest.tail--echo "ac_result=$ac_in" >>$CONFIG_STATUS-cat >>$CONFIG_STATUS <<\_ACEOF-  if test x"$ac_file" != x-; then-    echo "/* $configure_input  */" >"$tmp/config.h"-    cat "$ac_result" >>"$tmp/config.h"-    if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then-      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5-echo "$as_me: $ac_file is unchanged" >&6;}-    else-      rm -f $ac_file-      mv "$tmp/config.h" $ac_file-    fi-  else-    echo "/* $configure_input  */"-    cat "$ac_result"-  fi-  rm -f "$tmp/out12"- ;;---  esac--done # for ac_tag---{ (exit 0); exit 0; }-_ACEOF-chmod +x $CONFIG_STATUS-ac_clean_files=$ac_clean_files_save---# configure is writing to config.log, and then calls config.status.-# config.status does its own redirection, appending to config.log.-# Unfortunately, on DOS this fails, as config.log is still kept open-# by configure, so config.status won't be able to write to it; its-# output is simply discarded.  So we exec the FD to /dev/null,-# effectively closing config.log, so it can be properly (re)opened and-# appended to by config.status.  When coming back to configure, we-# need to make the FD available again.-if test "$no_create" != yes; then-  ac_cs_success=:-  ac_config_status_args=-  test "$silent" = yes &&-    ac_config_status_args="$ac_config_status_args --quiet"-  exec 5>/dev/null-  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false-  exec 5>>config.log-  # Use ||, not &&, to avoid exiting from the if with $? = 1, which-  # would make configure fail if this is the last instruction.-  $ac_cs_success || { (exit 1); exit 1; }+# Generated by GNU Autoconf 2.65 for Haskell base package 1.0.+#+# Report bugs to <libraries@haskell.org>.+#+#+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,+# Inc.+#+#+# This configure script is free software; the Free Software Foundation+# gives unlimited permission to copy, distribute and modify it.+## -------------------- ##+## M4sh Initialization. ##+## -------------------- ##++# Be more Bourne compatible+DUALCASE=1; export DUALCASE # for MKS sh+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :+  emulate sh+  NULLCMD=:+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which+  # is contrary to our usage.  Disable this feature.+  alias -g '${1+"$@"}'='"$@"'+  setopt NO_GLOB_SUBST+else+  case `(set -o) 2>/dev/null` in #(+  *posix*) :+    set -o posix ;; #(+  *) :+     ;;+esac+fi+++as_nl='+'+export as_nl+# Printing a long string crashes Solaris 7 /usr/bin/printf.+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo+# Prefer a ksh shell builtin over an external printf program on Solaris,+# but without wasting forks for bash or zsh.+if test -z "$BASH_VERSION$ZSH_VERSION" \+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then+  as_echo='print -r --'+  as_echo_n='print -rn --'+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then+  as_echo='printf %s\n'+  as_echo_n='printf %s'+else+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'+    as_echo_n='/usr/ucb/echo -n'+  else+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'+    as_echo_n_body='eval+      arg=$1;+      case $arg in #(+      *"$as_nl"*)+	expr "X$arg" : "X\\(.*\\)$as_nl";+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;+      esac;+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"+    '+    export as_echo_n_body+    as_echo_n='sh -c $as_echo_n_body as_echo'+  fi+  export as_echo_body+  as_echo='sh -c $as_echo_body as_echo'+fi++# The user is always right.+if test "${PATH_SEPARATOR+set}" != set; then+  PATH_SEPARATOR=:+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||+      PATH_SEPARATOR=';'+  }+fi+++# IFS+# We need space, tab and new line, in precisely that order.  Quoting is+# there to prevent editors from complaining about space-tab.+# (If _AS_PATH_WALK were called with IFS unset, it would disable word+# splitting by setting IFS to empty value.)+IFS=" ""	$as_nl"++# Find who we are.  Look in the path if we contain no directory separator.+case $0 in #((+  *[\\/]* ) as_myself=$0 ;;+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break+  done+IFS=$as_save_IFS++     ;;+esac+# We did not find ourselves, most probably we were run as `sh COMMAND'+# in which case we are not to be found in the path.+if test "x$as_myself" = x; then+  as_myself=$0+fi+if test ! -f "$as_myself"; then+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2+  exit 1+fi++# Unset variables that we do not need and which cause bugs (e.g. in+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"+# suppresses any "Segmentation fault" message there.  '((' could+# trigger a bug in pdksh 5.2.14.+for as_var in BASH_ENV ENV MAIL MAILPATH+do eval test x\${$as_var+set} = xset \+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :+done+PS1='$ '+PS2='> '+PS4='+ '++# NLS nuisances.+LC_ALL=C+export LC_ALL+LANGUAGE=C+export LANGUAGE++# CDPATH.+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH++if test "x$CONFIG_SHELL" = x; then+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :+  emulate sh+  NULLCMD=:+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which+  # is contrary to our usage.  Disable this feature.+  alias -g '\${1+\"\$@\"}'='\"\$@\"'+  setopt NO_GLOB_SUBST+else+  case \`(set -o) 2>/dev/null\` in #(+  *posix*) :+    set -o posix ;; #(+  *) :+     ;;+esac+fi+"+  as_required="as_fn_return () { (exit \$1); }+as_fn_success () { as_fn_return 0; }+as_fn_failure () { as_fn_return 1; }+as_fn_ret_success () { return 0; }+as_fn_ret_failure () { return 1; }++exitcode=0+as_fn_success || { exitcode=1; echo as_fn_success failed.; }+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :++else+  exitcode=1; echo positional parameters were not saved.+fi+test x\$exitcode = x0 || exit 1"+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1+test \$(( 1 + 1 )) = 2 || exit 1"+  if (eval "$as_required") 2>/dev/null; then :+  as_have_required=yes+else+  as_have_required=no+fi+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :++else+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+as_found=false+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+  as_found=:+  case $as_dir in #(+	 /*)+	   for as_base in sh bash ksh sh5; do+	     # Try only shells that exist, to save several forks.+	     as_shell=$as_dir/$as_base+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :+  CONFIG_SHELL=$as_shell as_have_required=yes+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :+  break 2+fi+fi+	   done;;+       esac+  as_found=false+done+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :+  CONFIG_SHELL=$SHELL as_have_required=yes+fi; }+IFS=$as_save_IFS+++      if test "x$CONFIG_SHELL" != x; then :+  # We cannot yet assume a decent shell, so we have to provide a+	# neutralization value for shells without unset; and this also+	# works around shells that cannot unset nonexistent variables.+	BASH_ENV=/dev/null+	ENV=/dev/null+	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV+	export CONFIG_SHELL+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}+fi++    if test x$as_have_required = xno; then :+  $as_echo "$0: This script requires a shell more modern than all"+  $as_echo "$0: the shells that I found on your system."+  if test x${ZSH_VERSION+set} = xset ; then+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."+  else+    $as_echo "$0: Please tell bug-autoconf@gnu.org and+$0: libraries@haskell.org about your system, including any+$0: error possibly output before this message. Then install+$0: a modern shell, or manually run the script under such a+$0: shell if you do have one."+  fi+  exit 1+fi+fi+fi+SHELL=${CONFIG_SHELL-/bin/sh}+export SHELL+# Unset more variables known to interfere with behavior of common tools.+CLICOLOR_FORCE= GREP_OPTIONS=+unset CLICOLOR_FORCE GREP_OPTIONS++## --------------------- ##+## M4sh Shell Functions. ##+## --------------------- ##+# as_fn_unset VAR+# ---------------+# Portably unset VAR.+as_fn_unset ()+{+  { eval $1=; unset $1;}+}+as_unset=as_fn_unset++# as_fn_set_status STATUS+# -----------------------+# Set $? to STATUS, without forking.+as_fn_set_status ()+{+  return $1+} # as_fn_set_status++# as_fn_exit STATUS+# -----------------+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.+as_fn_exit ()+{+  set +e+  as_fn_set_status $1+  exit $1+} # as_fn_exit++# as_fn_mkdir_p+# -------------+# Create "$as_dir" as a directory, including parents if necessary.+as_fn_mkdir_p ()+{++  case $as_dir in #(+  -*) as_dir=./$as_dir;;+  esac+  test -d "$as_dir" || eval $as_mkdir_p || {+    as_dirs=+    while :; do+      case $as_dir in #(+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(+      *) as_qdir=$as_dir;;+      esac+      as_dirs="'$as_qdir' $as_dirs"+      as_dir=`$as_dirname -- "$as_dir" ||+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+	 X"$as_dir" : 'X\(//\)[^/]' \| \+	 X"$as_dir" : 'X\(//\)$' \| \+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X"$as_dir" |+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)[^/].*/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\).*/{+	    s//\1/+	    q+	  }+	  s/.*/./; q'`+      test -d "$as_dir" && break+    done+    test -z "$as_dirs" || eval "mkdir $as_dirs"+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"+++} # as_fn_mkdir_p+# as_fn_append VAR VALUE+# ----------------------+# Append the text in VALUE to the end of the definition contained in VAR. Take+# advantage of any shell optimizations that allow amortized linear growth over+# repeated appends, instead of the typical quadratic growth present in naive+# implementations.+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :+  eval 'as_fn_append ()+  {+    eval $1+=\$2+  }'+else+  as_fn_append ()+  {+    eval $1=\$$1\$2+  }+fi # as_fn_append++# as_fn_arith ARG...+# ------------------+# Perform arithmetic evaluation on the ARGs, and store the result in the+# global $as_val. Take advantage of shells that can avoid forks. The arguments+# must be portable across $(()) and expr.+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :+  eval 'as_fn_arith ()+  {+    as_val=$(( $* ))+  }'+else+  as_fn_arith ()+  {+    as_val=`expr "$@" || test $? -eq 1`+  }+fi # as_fn_arith+++# as_fn_error ERROR [LINENO LOG_FD]+# ---------------------------------+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the+# script with status $?, using 1 if that was 0.+as_fn_error ()+{+  as_status=$?; test $as_status -eq 0 && as_status=1+  if test "$3"; then+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3+  fi+  $as_echo "$as_me: error: $1" >&2+  as_fn_exit $as_status+} # as_fn_error++if expr a : '\(a\)' >/dev/null 2>&1 &&+   test "X`expr 00001 : '.*\(...\)'`" = X001; then+  as_expr=expr+else+  as_expr=false+fi++if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then+  as_basename=basename+else+  as_basename=false+fi++if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then+  as_dirname=dirname+else+  as_dirname=false+fi++as_me=`$as_basename -- "$0" ||+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \+	 X"$0" : 'X\(//\)$' \| \+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X/"$0" |+    sed '/^.*\/\([^/][^/]*\)\/*$/{+	    s//\1/+	    q+	  }+	  /^X\/\(\/\/\)$/{+	    s//\1/+	    q+	  }+	  /^X\/\(\/\).*/{+	    s//\1/+	    q+	  }+	  s/.*/./; q'`++# Avoid depending upon Character Ranges.+as_cr_letters='abcdefghijklmnopqrstuvwxyz'+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'+as_cr_Letters=$as_cr_letters$as_cr_LETTERS+as_cr_digits='0123456789'+as_cr_alnum=$as_cr_Letters$as_cr_digits+++  as_lineno_1=$LINENO as_lineno_1a=$LINENO+  as_lineno_2=$LINENO as_lineno_2a=$LINENO+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)+  sed -n '+    p+    /[$]LINENO/=+  ' <$as_myself |+    sed '+      s/[$]LINENO.*/&-/+      t lineno+      b+      :lineno+      N+      :loop+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/+      t loop+      s/-\n.*//+    ' >$as_me.lineno &&+  chmod +x "$as_me.lineno" ||+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }++  # Don't try to exec as it changes $[0], causing all sort of problems+  # (the dirname of $[0] is not the place where we might find the+  # original and so on.  Autoconf is especially sensitive to this).+  . "./$as_me.lineno"+  # Exit status is that of the last command.+  exit+}++ECHO_C= ECHO_N= ECHO_T=+case `echo -n x` in #(((((+-n*)+  case `echo 'xy\c'` in+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.+  xy)  ECHO_C='\c';;+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null+       ECHO_T='	';;+  esac;;+*)+  ECHO_N='-n';;+esac++rm -f conf$$ conf$$.exe conf$$.file+if test -d conf$$.dir; then+  rm -f conf$$.dir/conf$$.file+else+  rm -f conf$$.dir+  mkdir conf$$.dir 2>/dev/null+fi+if (echo >conf$$.file) 2>/dev/null; then+  if ln -s conf$$.file conf$$ 2>/dev/null; then+    as_ln_s='ln -s'+    # ... but there are two gotchas:+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.+    # In both cases, we have to default to `cp -p'.+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||+      as_ln_s='cp -p'+  elif ln conf$$.file conf$$ 2>/dev/null; then+    as_ln_s=ln+  else+    as_ln_s='cp -p'+  fi+else+  as_ln_s='cp -p'+fi+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file+rmdir conf$$.dir 2>/dev/null++if mkdir -p . 2>/dev/null; then+  as_mkdir_p='mkdir -p "$as_dir"'+else+  test -d ./-p && rmdir ./-p+  as_mkdir_p=false+fi++if test -x / >/dev/null 2>&1; then+  as_test_x='test -x'+else+  if ls -dL / >/dev/null 2>&1; then+    as_ls_L_option=L+  else+    as_ls_L_option=+  fi+  as_test_x='+    eval sh -c '\''+      if test -d "$1"; then+	test -d "$1/.";+      else+	case $1 in #(+	-*)set "./$1";;+	esac;+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((+	???[sx]*):;;*)false;;esac;fi+    '\'' sh+  '+fi+as_executable_p=$as_test_x++# Sed expression to map a string onto a valid CPP name.+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"++# Sed expression to map a string onto a valid variable name.+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"+++test -n "$DJDIR" || exec 7<&0 </dev/null+exec 6>&1++# Name of the host.+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,+# so uname gets run too.+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`++#+# Initializations.+#+ac_default_prefix=/usr/local+ac_clean_files=+ac_config_libobj_dir=.+LIBOBJS=+cross_compiling=no+subdirs=+MFLAGS=+MAKEFLAGS=++# Identity of this package.+PACKAGE_NAME='Haskell base package'+PACKAGE_TARNAME='base'+PACKAGE_VERSION='1.0'+PACKAGE_STRING='Haskell base package 1.0'+PACKAGE_BUGREPORT='libraries@haskell.org'+PACKAGE_URL=''++ac_unique_file="include/HsBase.h"+# Factoring default headers for most tests.+ac_includes_default="\+#include <stdio.h>+#ifdef HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif+#ifdef HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif+#ifdef STDC_HEADERS+# include <stdlib.h>+# include <stddef.h>+#else+# ifdef HAVE_STDLIB_H+#  include <stdlib.h>+# endif+#endif+#ifdef HAVE_STRING_H+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H+#  include <memory.h>+# endif+# include <string.h>+#endif+#ifdef HAVE_STRINGS_H+# include <strings.h>+#endif+#ifdef HAVE_INTTYPES_H+# include <inttypes.h>+#endif+#ifdef HAVE_STDINT_H+# include <stdint.h>+#endif+#ifdef HAVE_UNISTD_H+# include <unistd.h>+#endif"++ac_subst_vars='LTLIBOBJS+LIBOBJS+EXTRA_LIBS+ICONV_LIB_DIRS+ICONV_INCLUDE_DIRS+EGREP+GREP+CPP+OBJEXT+EXEEXT+ac_ct_CC+CPPFLAGS+LDFLAGS+CFLAGS+CC+target_alias+host_alias+build_alias+LIBS+ECHO_T+ECHO_N+ECHO_C+DEFS+mandir+localedir+libdir+psdir+pdfdir+dvidir+htmldir+infodir+docdir+oldincludedir+includedir+localstatedir+sharedstatedir+sysconfdir+datadir+datarootdir+libexecdir+sbindir+bindir+program_transform_name+prefix+exec_prefix+PACKAGE_URL+PACKAGE_BUGREPORT+PACKAGE_STRING+PACKAGE_VERSION+PACKAGE_TARNAME+PACKAGE_NAME+PATH_SEPARATOR+SHELL'+ac_subst_files=''+ac_user_opts='+enable_option_checking+with_cc+enable_largefile+with_iconv_includes+with_iconv_libraries+'+      ac_precious_vars='build_alias+host_alias+target_alias+CC+CFLAGS+LDFLAGS+LIBS+CPPFLAGS+CPP'+++# Initialize some variables set by options.+ac_init_help=+ac_init_version=false+ac_unrecognized_opts=+ac_unrecognized_sep=+# The variables have the same names as the options, with+# dashes changed to underlines.+cache_file=/dev/null+exec_prefix=NONE+no_create=+no_recursion=+prefix=NONE+program_prefix=NONE+program_suffix=NONE+program_transform_name=s,x,x,+silent=+site=+srcdir=+verbose=+x_includes=NONE+x_libraries=NONE++# Installation directory options.+# These are left unexpanded so users can "make install exec_prefix=/foo"+# and all the variables that are supposed to be based on exec_prefix+# by default will actually change.+# Use braces instead of parens because sh, perl, etc. also accept them.+# (The list follows the same order as the GNU Coding Standards.)+bindir='${exec_prefix}/bin'+sbindir='${exec_prefix}/sbin'+libexecdir='${exec_prefix}/libexec'+datarootdir='${prefix}/share'+datadir='${datarootdir}'+sysconfdir='${prefix}/etc'+sharedstatedir='${prefix}/com'+localstatedir='${prefix}/var'+includedir='${prefix}/include'+oldincludedir='/usr/include'+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'+infodir='${datarootdir}/info'+htmldir='${docdir}'+dvidir='${docdir}'+pdfdir='${docdir}'+psdir='${docdir}'+libdir='${exec_prefix}/lib'+localedir='${datarootdir}/locale'+mandir='${datarootdir}/man'++ac_prev=+ac_dashdash=+for ac_option+do+  # If the previous option needs an argument, assign it.+  if test -n "$ac_prev"; then+    eval $ac_prev=\$ac_option+    ac_prev=+    continue+  fi++  case $ac_option in+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;+  *)	ac_optarg=yes ;;+  esac++  # Accept the important Cygnus configure options, so we can diagnose typos.++  case $ac_dashdash$ac_option in+  --)+    ac_dashdash=yes ;;++  -bindir | --bindir | --bindi | --bind | --bin | --bi)+    ac_prev=bindir ;;+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)+    bindir=$ac_optarg ;;++  -build | --build | --buil | --bui | --bu)+    ac_prev=build_alias ;;+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)+    build_alias=$ac_optarg ;;++  -cache-file | --cache-file | --cache-fil | --cache-fi \+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)+    ac_prev=cache_file ;;+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)+    cache_file=$ac_optarg ;;++  --config-cache | -C)+    cache_file=config.cache ;;++  -datadir | --datadir | --datadi | --datad)+    ac_prev=datadir ;;+  -datadir=* | --datadir=* | --datadi=* | --datad=*)+    datadir=$ac_optarg ;;++  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \+  | --dataroo | --dataro | --datar)+    ac_prev=datarootdir ;;+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)+    datarootdir=$ac_optarg ;;++  -disable-* | --disable-*)+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`+    # Reject names that are not valid shell variable names.+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&+      as_fn_error "invalid feature name: $ac_useropt"+    ac_useropt_orig=$ac_useropt+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`+    case $ac_user_opts in+      *"+"enable_$ac_useropt"+"*) ;;+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"+	 ac_unrecognized_sep=', ';;+    esac+    eval enable_$ac_useropt=no ;;++  -docdir | --docdir | --docdi | --doc | --do)+    ac_prev=docdir ;;+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)+    docdir=$ac_optarg ;;++  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)+    ac_prev=dvidir ;;+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)+    dvidir=$ac_optarg ;;++  -enable-* | --enable-*)+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`+    # Reject names that are not valid shell variable names.+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&+      as_fn_error "invalid feature name: $ac_useropt"+    ac_useropt_orig=$ac_useropt+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`+    case $ac_user_opts in+      *"+"enable_$ac_useropt"+"*) ;;+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"+	 ac_unrecognized_sep=', ';;+    esac+    eval enable_$ac_useropt=\$ac_optarg ;;++  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \+  | --exec | --exe | --ex)+    ac_prev=exec_prefix ;;+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \+  | --exec=* | --exe=* | --ex=*)+    exec_prefix=$ac_optarg ;;++  -gas | --gas | --ga | --g)+    # Obsolete; use --with-gas.+    with_gas=yes ;;++  -help | --help | --hel | --he | -h)+    ac_init_help=long ;;+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)+    ac_init_help=recursive ;;+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)+    ac_init_help=short ;;++  -host | --host | --hos | --ho)+    ac_prev=host_alias ;;+  -host=* | --host=* | --hos=* | --ho=*)+    host_alias=$ac_optarg ;;++  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)+    ac_prev=htmldir ;;+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \+  | --ht=*)+    htmldir=$ac_optarg ;;++  -includedir | --includedir | --includedi | --included | --include \+  | --includ | --inclu | --incl | --inc)+    ac_prev=includedir ;;+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \+  | --includ=* | --inclu=* | --incl=* | --inc=*)+    includedir=$ac_optarg ;;++  -infodir | --infodir | --infodi | --infod | --info | --inf)+    ac_prev=infodir ;;+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)+    infodir=$ac_optarg ;;++  -libdir | --libdir | --libdi | --libd)+    ac_prev=libdir ;;+  -libdir=* | --libdir=* | --libdi=* | --libd=*)+    libdir=$ac_optarg ;;++  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \+  | --libexe | --libex | --libe)+    ac_prev=libexecdir ;;+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \+  | --libexe=* | --libex=* | --libe=*)+    libexecdir=$ac_optarg ;;++  -localedir | --localedir | --localedi | --localed | --locale)+    ac_prev=localedir ;;+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)+    localedir=$ac_optarg ;;++  -localstatedir | --localstatedir | --localstatedi | --localstated \+  | --localstate | --localstat | --localsta | --localst | --locals)+    ac_prev=localstatedir ;;+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)+    localstatedir=$ac_optarg ;;++  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)+    ac_prev=mandir ;;+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)+    mandir=$ac_optarg ;;++  -nfp | --nfp | --nf)+    # Obsolete; use --without-fp.+    with_fp=no ;;++  -no-create | --no-create | --no-creat | --no-crea | --no-cre \+  | --no-cr | --no-c | -n)+    no_create=yes ;;++  -no-recursion | --no-recursion | --no-recursio | --no-recursi \+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)+    no_recursion=yes ;;++  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \+  | --oldin | --oldi | --old | --ol | --o)+    ac_prev=oldincludedir ;;+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)+    oldincludedir=$ac_optarg ;;++  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)+    ac_prev=prefix ;;+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)+    prefix=$ac_optarg ;;++  -program-prefix | --program-prefix | --program-prefi | --program-pref \+  | --program-pre | --program-pr | --program-p)+    ac_prev=program_prefix ;;+  -program-prefix=* | --program-prefix=* | --program-prefi=* \+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)+    program_prefix=$ac_optarg ;;++  -program-suffix | --program-suffix | --program-suffi | --program-suff \+  | --program-suf | --program-su | --program-s)+    ac_prev=program_suffix ;;+  -program-suffix=* | --program-suffix=* | --program-suffi=* \+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)+    program_suffix=$ac_optarg ;;++  -program-transform-name | --program-transform-name \+  | --program-transform-nam | --program-transform-na \+  | --program-transform-n | --program-transform- \+  | --program-transform | --program-transfor \+  | --program-transfo | --program-transf \+  | --program-trans | --program-tran \+  | --progr-tra | --program-tr | --program-t)+    ac_prev=program_transform_name ;;+  -program-transform-name=* | --program-transform-name=* \+  | --program-transform-nam=* | --program-transform-na=* \+  | --program-transform-n=* | --program-transform-=* \+  | --program-transform=* | --program-transfor=* \+  | --program-transfo=* | --program-transf=* \+  | --program-trans=* | --program-tran=* \+  | --progr-tra=* | --program-tr=* | --program-t=*)+    program_transform_name=$ac_optarg ;;++  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)+    ac_prev=pdfdir ;;+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)+    pdfdir=$ac_optarg ;;++  -psdir | --psdir | --psdi | --psd | --ps)+    ac_prev=psdir ;;+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+    psdir=$ac_optarg ;;++  -q | -quiet | --quiet | --quie | --qui | --qu | --q \+  | -silent | --silent | --silen | --sile | --sil)+    silent=yes ;;++  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)+    ac_prev=sbindir ;;+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \+  | --sbi=* | --sb=*)+    sbindir=$ac_optarg ;;++  -sharedstatedir | --sharedstatedir | --sharedstatedi \+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \+  | --sharedst | --shareds | --shared | --share | --shar \+  | --sha | --sh)+    ac_prev=sharedstatedir ;;+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \+  | --sha=* | --sh=*)+    sharedstatedir=$ac_optarg ;;++  -site | --site | --sit)+    ac_prev=site ;;+  -site=* | --site=* | --sit=*)+    site=$ac_optarg ;;++  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)+    ac_prev=srcdir ;;+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)+    srcdir=$ac_optarg ;;++  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \+  | --syscon | --sysco | --sysc | --sys | --sy)+    ac_prev=sysconfdir ;;+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)+    sysconfdir=$ac_optarg ;;++  -target | --target | --targe | --targ | --tar | --ta | --t)+    ac_prev=target_alias ;;+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)+    target_alias=$ac_optarg ;;++  -v | -verbose | --verbose | --verbos | --verbo | --verb)+    verbose=yes ;;++  -version | --version | --versio | --versi | --vers | -V)+    ac_init_version=: ;;++  -with-* | --with-*)+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`+    # Reject names that are not valid shell variable names.+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&+      as_fn_error "invalid package name: $ac_useropt"+    ac_useropt_orig=$ac_useropt+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`+    case $ac_user_opts in+      *"+"with_$ac_useropt"+"*) ;;+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"+	 ac_unrecognized_sep=', ';;+    esac+    eval with_$ac_useropt=\$ac_optarg ;;++  -without-* | --without-*)+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`+    # Reject names that are not valid shell variable names.+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&+      as_fn_error "invalid package name: $ac_useropt"+    ac_useropt_orig=$ac_useropt+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`+    case $ac_user_opts in+      *"+"with_$ac_useropt"+"*) ;;+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"+	 ac_unrecognized_sep=', ';;+    esac+    eval with_$ac_useropt=no ;;++  --x)+    # Obsolete; use --with-x.+    with_x=yes ;;++  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \+  | --x-incl | --x-inc | --x-in | --x-i)+    ac_prev=x_includes ;;+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)+    x_includes=$ac_optarg ;;++  -x-libraries | --x-libraries | --x-librarie | --x-librari \+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)+    ac_prev=x_libraries ;;+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)+    x_libraries=$ac_optarg ;;++  -*) as_fn_error "unrecognized option: \`$ac_option'+Try \`$0 --help' for more information."+    ;;++  *=*)+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`+    # Reject names that are not valid shell variable names.+    case $ac_envvar in #(+      '' | [0-9]* | *[!_$as_cr_alnum]* )+      as_fn_error "invalid variable name: \`$ac_envvar'" ;;+    esac+    eval $ac_envvar=\$ac_optarg+    export $ac_envvar ;;++  *)+    # FIXME: should be removed in autoconf 3.0.+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}+    ;;++  esac+done++if test -n "$ac_prev"; then+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`+  as_fn_error "missing argument to $ac_option"+fi++if test -n "$ac_unrecognized_opts"; then+  case $enable_option_checking in+    no) ;;+    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;+  esac+fi++# Check all directory arguments for consistency.+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \+		datadir sysconfdir sharedstatedir localstatedir includedir \+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \+		libdir localedir mandir+do+  eval ac_val=\$$ac_var+  # Remove trailing slashes.+  case $ac_val in+    */ )+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`+      eval $ac_var=\$ac_val;;+  esac+  # Be sure to have absolute directory names.+  case $ac_val in+    [\\/$]* | ?:[\\/]* )  continue;;+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;+  esac+  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"+done++# There might be people who depend on the old broken behavior: `$host'+# used to hold the argument of --host etc.+# FIXME: To remove some day.+build=$build_alias+host=$host_alias+target=$target_alias++# FIXME: To remove some day.+if test "x$host_alias" != x; then+  if test "x$build_alias" = x; then+    cross_compiling=maybe+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.+    If a cross compiler is detected then cross compile mode will be used." >&2+  elif test "x$build_alias" != "x$host_alias"; then+    cross_compiling=yes+  fi+fi++ac_tool_prefix=+test -n "$host_alias" && ac_tool_prefix=$host_alias-++test "$silent" = yes && exec 6>/dev/null+++ac_pwd=`pwd` && test -n "$ac_pwd" &&+ac_ls_di=`ls -di .` &&+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||+  as_fn_error "working directory cannot be determined"+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||+  as_fn_error "pwd does not report name of working directory"+++# Find the source files, if location was not specified.+if test -z "$srcdir"; then+  ac_srcdir_defaulted=yes+  # Try the directory containing this script, then the parent directory.+  ac_confdir=`$as_dirname -- "$as_myself" ||+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+	 X"$as_myself" : 'X\(//\)[^/]' \| \+	 X"$as_myself" : 'X\(//\)$' \| \+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X"$as_myself" |+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)[^/].*/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\).*/{+	    s//\1/+	    q+	  }+	  s/.*/./; q'`+  srcdir=$ac_confdir+  if test ! -r "$srcdir/$ac_unique_file"; then+    srcdir=..+  fi+else+  ac_srcdir_defaulted=no+fi+if test ! -r "$srcdir/$ac_unique_file"; then+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."+  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"+fi+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"+ac_abs_confdir=`(+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"+	pwd)`+# When building in place, set srcdir=.+if test "$ac_abs_confdir" = "$ac_pwd"; then+  srcdir=.+fi+# Remove unnecessary trailing slashes from srcdir.+# Double slashes in file names in object file debugging info+# mess up M-x gdb in Emacs.+case $srcdir in+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;+esac+for ac_var in $ac_precious_vars; do+  eval ac_env_${ac_var}_set=\${${ac_var}+set}+  eval ac_env_${ac_var}_value=\$${ac_var}+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}+  eval ac_cv_env_${ac_var}_value=\$${ac_var}+done++#+# Report the --help message.+#+if test "$ac_init_help" = "long"; then+  # Omit some internal or obsolete options to make the list less imposing.+  # This message is too long to be a string in the A/UX 3.1 sh.+  cat <<_ACEOF+\`configure' configures Haskell base package 1.0 to adapt to many kinds of systems.++Usage: $0 [OPTION]... [VAR=VALUE]...++To assign environment variables (e.g., CC, CFLAGS...), specify them as+VAR=VALUE.  See below for descriptions of some of the useful variables.++Defaults for the options are specified in brackets.++Configuration:+  -h, --help              display this help and exit+      --help=short        display options specific to this package+      --help=recursive    display the short help of all the included packages+  -V, --version           display version information and exit+  -q, --quiet, --silent   do not print \`checking...' messages+      --cache-file=FILE   cache test results in FILE [disabled]+  -C, --config-cache      alias for \`--cache-file=config.cache'+  -n, --no-create         do not create output files+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']++Installation directories:+  --prefix=PREFIX         install architecture-independent files in PREFIX+                          [$ac_default_prefix]+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX+                          [PREFIX]++By default, \`make install' will install all the files in+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify+an installation prefix other than \`$ac_default_prefix' using \`--prefix',+for instance \`--prefix=\$HOME'.++For better control, use the options below.++Fine tuning of the installation directories:+  --bindir=DIR            user executables [EPREFIX/bin]+  --sbindir=DIR           system admin executables [EPREFIX/sbin]+  --libexecdir=DIR        program executables [EPREFIX/libexec]+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]+  --libdir=DIR            object code libraries [EPREFIX/lib]+  --includedir=DIR        C header files [PREFIX/include]+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]+  --infodir=DIR           info documentation [DATAROOTDIR/info]+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]+  --mandir=DIR            man documentation [DATAROOTDIR/man]+  --docdir=DIR            documentation root [DATAROOTDIR/doc/base]+  --htmldir=DIR           html documentation [DOCDIR]+  --dvidir=DIR            dvi documentation [DOCDIR]+  --pdfdir=DIR            pdf documentation [DOCDIR]+  --psdir=DIR             ps documentation [DOCDIR]+_ACEOF++  cat <<\_ACEOF+_ACEOF+fi++if test -n "$ac_init_help"; then+  case $ac_init_help in+     short | recursive ) echo "Configuration of Haskell base package 1.0:";;+   esac+  cat <<\_ACEOF++Optional Features:+  --disable-option-checking  ignore unrecognized --enable/--with options+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]+  --disable-largefile     omit support for large files++Optional Packages:+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)+C compiler+  --with-iconv-includes   directory containing iconv.h+  --with-iconv-libraries  directory containing iconv library++Some influential environment variables:+  CC          C compiler command+  CFLAGS      C compiler flags+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a+              nonstandard directory <lib dir>+  LIBS        libraries to pass to the linker, e.g. -l<library>+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if+              you have headers in a nonstandard directory <include dir>+  CPP         C preprocessor++Use these variables to override the choices made by `configure' or to help+it to find libraries and programs with nonstandard names/locations.++Report bugs to <libraries@haskell.org>.+_ACEOF+ac_status=$?+fi++if test "$ac_init_help" = "recursive"; then+  # If there are subdirs, report their specific --help.+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue+    test -d "$ac_dir" ||+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||+      continue+    ac_builddir=.++case "$ac_dir" in+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;+*)+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`+  # A ".." for each directory in $ac_dir_suffix.+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`+  case $ac_top_builddir_sub in+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;+  esac ;;+esac+ac_abs_top_builddir=$ac_pwd+ac_abs_builddir=$ac_pwd$ac_dir_suffix+# for backward compatibility:+ac_top_builddir=$ac_top_build_prefix++case $srcdir in+  .)  # We are building in place.+    ac_srcdir=.+    ac_top_srcdir=$ac_top_builddir_sub+    ac_abs_top_srcdir=$ac_pwd ;;+  [\\/]* | ?:[\\/]* )  # Absolute name.+    ac_srcdir=$srcdir$ac_dir_suffix;+    ac_top_srcdir=$srcdir+    ac_abs_top_srcdir=$srcdir ;;+  *) # Relative name.+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix+    ac_top_srcdir=$ac_top_build_prefix$srcdir+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;+esac+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix++    cd "$ac_dir" || { ac_status=$?; continue; }+    # Check for guested configure.+    if test -f "$ac_srcdir/configure.gnu"; then+      echo &&+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive+    elif test -f "$ac_srcdir/configure"; then+      echo &&+      $SHELL "$ac_srcdir/configure" --help=recursive+    else+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2+    fi || ac_status=$?+    cd "$ac_pwd" || { ac_status=$?; break; }+  done+fi++test -n "$ac_init_help" && exit $ac_status+if $ac_init_version; then+  cat <<\_ACEOF+Haskell base package configure 1.0+generated by GNU Autoconf 2.65++Copyright (C) 2009 Free Software Foundation, Inc.+This configure script is free software; the Free Software Foundation+gives unlimited permission to copy, distribute and modify it.+_ACEOF+  exit+fi++## ------------------------ ##+## Autoconf initialization. ##+## ------------------------ ##++# ac_fn_c_try_compile LINENO+# --------------------------+# Try to compile conftest.$ac_ext, and return whether this succeeded.+ac_fn_c_try_compile ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  rm -f conftest.$ac_objext+  if { { ac_try="$ac_compile"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_compile") 2>conftest.err+  ac_status=$?+  if test -s conftest.err; then+    grep -v '^ *+' conftest.err >conftest.er1+    cat conftest.er1 >&5+    mv -f conftest.er1 conftest.err+  fi+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; } && {+	 test -z "$ac_c_werror_flag" ||+	 test ! -s conftest.err+       } && test -s conftest.$ac_objext; then :+  ac_retval=0+else+  $as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++	ac_retval=1+fi+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}+  as_fn_set_status $ac_retval++} # ac_fn_c_try_compile++# ac_fn_c_check_type LINENO TYPE VAR INCLUDES+# -------------------------------------------+# Tests whether TYPE exists after having included INCLUDES, setting cache+# variable VAR accordingly.+ac_fn_c_check_type ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5+$as_echo_n "checking for $2... " >&6; }+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :+  $as_echo_n "(cached) " >&6+else+  eval "$3=no"+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+int+main ()+{+if (sizeof ($2))+	 return 0;+  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+int+main ()+{+if (sizeof (($2)))+	    return 0;+  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :++else+  eval "$3=yes"+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+eval ac_res=\$$3+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}++} # ac_fn_c_check_type++# ac_fn_c_try_cpp LINENO+# ----------------------+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.+ac_fn_c_try_cpp ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  if { { ac_try="$ac_cpp conftest.$ac_ext"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err+  ac_status=$?+  if test -s conftest.err; then+    grep -v '^ *+' conftest.err >conftest.er1+    cat conftest.er1 >&5+    mv -f conftest.er1 conftest.err+  fi+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; } >/dev/null && {+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||+	 test ! -s conftest.err+       }; then :+  ac_retval=0+else+  $as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++    ac_retval=1+fi+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}+  as_fn_set_status $ac_retval++} # ac_fn_c_try_cpp++# ac_fn_c_try_run LINENO+# ----------------------+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes+# that executables *can* be run.+ac_fn_c_try_run ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  if { { ac_try="$ac_link"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_link") 2>&5+  ac_status=$?+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'+  { { case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_try") 2>&5+  ac_status=$?+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; }; }; then :+  ac_retval=0+else+  $as_echo "$as_me: program exited with status $ac_status" >&5+       $as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++       ac_retval=$ac_status+fi+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}+  as_fn_set_status $ac_retval++} # ac_fn_c_try_run++# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES+# -------------------------------------------------------+# Tests whether HEADER exists and can be compiled using the include files in+# INCLUDES, setting the cache variable VAR accordingly.+ac_fn_c_check_header_compile ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5+$as_echo_n "checking for $2... " >&6; }+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :+  $as_echo_n "(cached) " >&6+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+#include <$2>+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  eval "$3=yes"+else+  eval "$3=no"+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+eval ac_res=\$$3+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}++} # ac_fn_c_check_header_compile++# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES+# -------------------------------------------------------+# Tests whether HEADER exists, giving a warning if it cannot be compiled using+# the include files in INCLUDES and setting the cache variable VAR+# accordingly.+ac_fn_c_check_header_mongrel ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5+$as_echo_n "checking for $2... " >&6; }+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :+  $as_echo_n "(cached) " >&6+fi+eval ac_res=\$$3+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+else+  # Is the header compilable?+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5+$as_echo_n "checking $2 usability... " >&6; }+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+#include <$2>+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_header_compiler=yes+else+  ac_header_compiler=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5+$as_echo "$ac_header_compiler" >&6; }++# Is the header present?+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5+$as_echo_n "checking $2 presence... " >&6; }+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <$2>+_ACEOF+if ac_fn_c_try_cpp "$LINENO"; then :+  ac_header_preproc=yes+else+  ac_header_preproc=no+fi+rm -f conftest.err conftest.$ac_ext+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5+$as_echo "$ac_header_preproc" >&6; }++# So?  What about this header?+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((+  yes:no: )+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}+    ;;+  no:yes:* )+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}+( cat <<\_ASBOX+## ------------------------------------ ##+## Report this to libraries@haskell.org ##+## ------------------------------------ ##+_ASBOX+     ) | sed "s/^/$as_me: WARNING:     /" >&2+    ;;+esac+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5+$as_echo_n "checking for $2... " >&6; }+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :+  $as_echo_n "(cached) " >&6+else+  eval "$3=\$ac_header_compiler"+fi+eval ac_res=\$$3+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+fi+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}++} # ac_fn_c_check_header_mongrel++# ac_fn_c_try_link LINENO+# -----------------------+# Try to link conftest.$ac_ext, and return whether this succeeded.+ac_fn_c_try_link ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  rm -f conftest.$ac_objext conftest$ac_exeext+  if { { ac_try="$ac_link"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_link") 2>conftest.err+  ac_status=$?+  if test -s conftest.err; then+    grep -v '^ *+' conftest.err >conftest.er1+    cat conftest.er1 >&5+    mv -f conftest.er1 conftest.err+  fi+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; } && {+	 test -z "$ac_c_werror_flag" ||+	 test ! -s conftest.err+       } && test -s conftest$ac_exeext && {+	 test "$cross_compiling" = yes ||+	 $as_test_x conftest$ac_exeext+       }; then :+  ac_retval=0+else+  $as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++	ac_retval=1+fi+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would+  # interfere with the next link command; also delete a directory that is+  # left behind by Apple's compiler.  We do this before executing the actions.+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}+  as_fn_set_status $ac_retval++} # ac_fn_c_try_link++# ac_fn_c_check_func LINENO FUNC VAR+# ----------------------------------+# Tests whether FUNC exists, setting the cache variable VAR accordingly+ac_fn_c_check_func ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5+$as_echo_n "checking for $2... " >&6; }+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :+  $as_echo_n "(cached) " >&6+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */+#define $2 innocuous_$2++/* System header to define __stub macros and hopefully few prototypes,+    which can conflict with char $2 (); below.+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since+    <limits.h> exists even on freestanding compilers.  */++#ifdef __STDC__+# include <limits.h>+#else+# include <assert.h>+#endif++#undef $2++/* Override any GCC internal prototype to avoid an error.+   Use char because int might match the return type of a GCC+   builtin and then its argument prototype would still apply.  */+#ifdef __cplusplus+extern "C"+#endif+char $2 ();+/* The GNU C library defines this for functions which it implements+    to always fail with ENOSYS.  Some functions are actually named+    something starting with __ and the normal name is an alias.  */+#if defined __stub_$2 || defined __stub___$2+choke me+#endif++int+main ()+{+return $2 ();+  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_link "$LINENO"; then :+  eval "$3=yes"+else+  eval "$3=no"+fi+rm -f core conftest.err conftest.$ac_objext \+    conftest$ac_exeext conftest.$ac_ext+fi+eval ac_res=\$$3+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}++} # ac_fn_c_check_func++# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES+# --------------------------------------------+# Tries to find the compile-time value of EXPR in a program that includes+# INCLUDES, setting VAR accordingly. Returns whether the value could be+# computed+ac_fn_c_compute_int ()+{+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+  if test "$cross_compiling" = yes; then+    # Depending upon the size, compute the lo and hi bounds.+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+int+main ()+{+static int test_array [1 - 2 * !(($2) >= 0)];+test_array [0] = 0++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_lo=0 ac_mid=0+  while :; do+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+int+main ()+{+static int test_array [1 - 2 * !(($2) <= $ac_mid)];+test_array [0] = 0++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_hi=$ac_mid; break+else+  as_fn_arith $ac_mid + 1 && ac_lo=$as_val+			if test $ac_lo -le $ac_mid; then+			  ac_lo= ac_hi=+			  break+			fi+			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+  done+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+int+main ()+{+static int test_array [1 - 2 * !(($2) < 0)];+test_array [0] = 0++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_hi=-1 ac_mid=-1+  while :; do+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+int+main ()+{+static int test_array [1 - 2 * !(($2) >= $ac_mid)];+test_array [0] = 0++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_lo=$ac_mid; break+else+  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val+			if test $ac_mid -le $ac_hi; then+			  ac_lo= ac_hi=+			  break+			fi+			as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+  done+else+  ac_lo= ac_hi=+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+# Binary search between lo and hi bounds.+while test "x$ac_lo" != "x$ac_hi"; do+  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+int+main ()+{+static int test_array [1 - 2 * !(($2) <= $ac_mid)];+test_array [0] = 0++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_hi=$ac_mid+else+  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+done+case $ac_lo in #((+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;+'') ac_retval=1 ;;+esac+  else+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+$4+static long int longval () { return $2; }+static unsigned long int ulongval () { return $2; }+#include <stdio.h>+#include <stdlib.h>+int+main ()+{++  FILE *f = fopen ("conftest.val", "w");+  if (! f)+    return 1;+  if (($2) < 0)+    {+      long int i = longval ();+      if (i != ($2))+	return 1;+      fprintf (f, "%ld", i);+    }+  else+    {+      unsigned long int i = ulongval ();+      if (i != ($2))+	return 1;+      fprintf (f, "%lu", i);+    }+  /* Do not output a trailing newline, as this causes \r\n confusion+     on some platforms.  */+  return ferror (f) || fclose (f) != 0;++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  echo >>conftest.val; read $3 <conftest.val; ac_retval=0+else+  ac_retval=1+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+rm -f conftest.val++  fi+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}+  as_fn_set_status $ac_retval++} # ac_fn_c_compute_int+cat >config.log <<_ACEOF+This file contains any messages produced by compilers while+running configure, to aid debugging if configure makes a mistake.++It was created by Haskell base package $as_me 1.0, which was+generated by GNU Autoconf 2.65.  Invocation command line was++  $ $0 $@++_ACEOF+exec 5>>config.log+{+cat <<_ASUNAME+## --------- ##+## Platform. ##+## --------- ##++hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`+uname -m = `(uname -m) 2>/dev/null || echo unknown`+uname -r = `(uname -r) 2>/dev/null || echo unknown`+uname -s = `(uname -s) 2>/dev/null || echo unknown`+uname -v = `(uname -v) 2>/dev/null || echo unknown`++/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`++/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`++_ASUNAME++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    $as_echo "PATH: $as_dir"+  done+IFS=$as_save_IFS++} >&5++cat >&5 <<_ACEOF+++## ----------- ##+## Core tests. ##+## ----------- ##++_ACEOF+++# Keep a trace of the command line.+# Strip out --no-create and --no-recursion so they do not pile up.+# Strip out --silent because we don't want to record it for future runs.+# Also quote any args containing shell meta-characters.+# Make two passes to allow for proper duplicate-argument suppression.+ac_configure_args=+ac_configure_args0=+ac_configure_args1=+ac_must_keep_next=false+for ac_pass in 1 2+do+  for ac_arg+  do+    case $ac_arg in+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \+    | -silent | --silent | --silen | --sile | --sil)+      continue ;;+    *\'*)+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;+    esac+    case $ac_pass in+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;+    2)+      as_fn_append ac_configure_args1 " '$ac_arg'"+      if test $ac_must_keep_next = true; then+	ac_must_keep_next=false # Got value, back to normal.+      else+	case $ac_arg in+	  *=* | --config-cache | -C | -disable-* | --disable-* \+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \+	  | -with-* | --with-* | -without-* | --without-* | --x)+	    case "$ac_configure_args0 " in+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;+	    esac+	    ;;+	  -* ) ac_must_keep_next=true ;;+	esac+      fi+      as_fn_append ac_configure_args " '$ac_arg'"+      ;;+    esac+  done+done+{ ac_configure_args0=; unset ac_configure_args0;}+{ ac_configure_args1=; unset ac_configure_args1;}++# When interrupted or exit'd, cleanup temporary files, and complete+# config.log.  We remove comments because anyway the quotes in there+# would cause problems or look ugly.+# WARNING: Use '\'' to represent an apostrophe within the trap.+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.+trap 'exit_status=$?+  # Save into config.log some information that might help in debugging.+  {+    echo++    cat <<\_ASBOX+## ---------------- ##+## Cache variables. ##+## ---------------- ##+_ASBOX+    echo+    # The following way of writing the cache mishandles newlines in values,+(+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do+    eval ac_val=\$$ac_var+    case $ac_val in #(+    *${as_nl}*)+      case $ac_var in #(+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;+      esac+      case $ac_var in #(+      _ | IFS | as_nl) ;; #(+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(+      *) { eval $ac_var=; unset $ac_var;} ;;+      esac ;;+    esac+  done+  (set) 2>&1 |+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(+    *${as_nl}ac_space=\ *)+      sed -n \+	"s/'\''/'\''\\\\'\'''\''/g;+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"+      ;; #(+    *)+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"+      ;;+    esac |+    sort+)+    echo++    cat <<\_ASBOX+## ----------------- ##+## Output variables. ##+## ----------------- ##+_ASBOX+    echo+    for ac_var in $ac_subst_vars+    do+      eval ac_val=\$$ac_var+      case $ac_val in+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;+      esac+      $as_echo "$ac_var='\''$ac_val'\''"+    done | sort+    echo++    if test -n "$ac_subst_files"; then+      cat <<\_ASBOX+## ------------------- ##+## File substitutions. ##+## ------------------- ##+_ASBOX+      echo+      for ac_var in $ac_subst_files+      do+	eval ac_val=\$$ac_var+	case $ac_val in+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;+	esac+	$as_echo "$ac_var='\''$ac_val'\''"+      done | sort+      echo+    fi++    if test -s confdefs.h; then+      cat <<\_ASBOX+## ----------- ##+## confdefs.h. ##+## ----------- ##+_ASBOX+      echo+      cat confdefs.h+      echo+    fi+    test "$ac_signal" != 0 &&+      $as_echo "$as_me: caught signal $ac_signal"+    $as_echo "$as_me: exit $exit_status"+  } >&5+  rm -f core *.core core.conftest.* &&+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&+    exit $exit_status+' 0+for ac_signal in 1 2 13 15; do+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal+done+ac_signal=0++# confdefs.h avoids OS command line length limits that DEFS can exceed.+rm -f -r conftest* confdefs.h++$as_echo "/* confdefs.h */" > confdefs.h++# Predefined preprocessor variables.++cat >>confdefs.h <<_ACEOF+#define PACKAGE_NAME "$PACKAGE_NAME"+_ACEOF++cat >>confdefs.h <<_ACEOF+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"+_ACEOF++cat >>confdefs.h <<_ACEOF+#define PACKAGE_VERSION "$PACKAGE_VERSION"+_ACEOF++cat >>confdefs.h <<_ACEOF+#define PACKAGE_STRING "$PACKAGE_STRING"+_ACEOF++cat >>confdefs.h <<_ACEOF+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"+_ACEOF++cat >>confdefs.h <<_ACEOF+#define PACKAGE_URL "$PACKAGE_URL"+_ACEOF+++# Let the site file select an alternate cache file if it wants to.+# Prefer an explicitly selected file to automatically selected ones.+ac_site_file1=NONE+ac_site_file2=NONE+if test -n "$CONFIG_SITE"; then+  ac_site_file1=$CONFIG_SITE+elif test "x$prefix" != xNONE; then+  ac_site_file1=$prefix/share/config.site+  ac_site_file2=$prefix/etc/config.site+else+  ac_site_file1=$ac_default_prefix/share/config.site+  ac_site_file2=$ac_default_prefix/etc/config.site+fi+for ac_site_file in "$ac_site_file1" "$ac_site_file2"+do+  test "x$ac_site_file" = xNONE && continue+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5+$as_echo "$as_me: loading site script $ac_site_file" >&6;}+    sed 's/^/| /' "$ac_site_file" >&5+    . "$ac_site_file"+  fi+done++if test -r "$cache_file"; then+  # Some versions of bash will fail to source /dev/null (special files+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5+$as_echo "$as_me: loading cache $cache_file" >&6;}+    case $cache_file in+      [\\/]* | ?:[\\/]* ) . "$cache_file";;+      *)                      . "./$cache_file";;+    esac+  fi+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5+$as_echo "$as_me: creating cache $cache_file" >&6;}+  >$cache_file+fi++# Check that the precious variables saved in the cache have kept the same+# value.+ac_cache_corrupted=false+for ac_var in $ac_precious_vars; do+  eval ac_old_set=\$ac_cv_env_${ac_var}_set+  eval ac_new_set=\$ac_env_${ac_var}_set+  eval ac_old_val=\$ac_cv_env_${ac_var}_value+  eval ac_new_val=\$ac_env_${ac_var}_value+  case $ac_old_set,$ac_new_set in+    set,)+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}+      ac_cache_corrupted=: ;;+    ,set)+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}+      ac_cache_corrupted=: ;;+    ,);;+    *)+      if test "x$ac_old_val" != "x$ac_new_val"; then+	# differences in whitespace do not lead to failure.+	ac_old_val_w=`echo x $ac_old_val`+	ac_new_val_w=`echo x $ac_new_val`+	if test "$ac_old_val_w" != "$ac_new_val_w"; then+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}+	  ac_cache_corrupted=:+	else+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}+	  eval $ac_var=\$ac_old_val+	fi+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}+      fi;;+  esac+  # Pass precious variables to config.status.+  if test "$ac_new_set" = set; then+    case $ac_new_val in+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;+    *) ac_arg=$ac_var=$ac_new_val ;;+    esac+    case " $ac_configure_args " in+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;+    esac+  fi+done+if $ac_cache_corrupted; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}+  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5+fi+## -------------------- ##+## Main body of script. ##+## -------------------- ##++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu++++# Safety check: Ensure that we are in the correct source directory.+++ac_config_headers="$ac_config_headers include/HsBaseConfig.h include/EventConfig.h"++++# Check whether --with-cc was given.+if test "${with_cc+set}" = set; then :+  withval=$with_cc; CC=$withval+fi++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+if test -n "$ac_tool_prefix"; then+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.+set dummy ${ac_tool_prefix}gcc; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if test "${ac_cv_prog_CC+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  if test -n "$CC"; then+  ac_cv_prog_CC="$CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_exec_ext in '' $ac_executable_extensions; do+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then+    ac_cv_prog_CC="${ac_tool_prefix}gcc"+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+    break 2+  fi+done+  done+IFS=$as_save_IFS++fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5+$as_echo "$CC" >&6; }+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++fi+if test -z "$ac_cv_prog_CC"; then+  ac_ct_CC=$CC+  # Extract the first word of "gcc", so it can be a program name with args.+set dummy gcc; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  if test -n "$ac_ct_CC"; then+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_exec_ext in '' $ac_executable_extensions; do+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then+    ac_cv_prog_ac_ct_CC="gcc"+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+    break 2+  fi+done+  done+IFS=$as_save_IFS++fi+fi+ac_ct_CC=$ac_cv_prog_ac_ct_CC+if test -n "$ac_ct_CC"; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5+$as_echo "$ac_ct_CC" >&6; }+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi++  if test "x$ac_ct_CC" = x; then+    CC=""+  else+    case $cross_compiling:$ac_tool_warned in+yes:)+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}+ac_tool_warned=yes ;;+esac+    CC=$ac_ct_CC+  fi+else+  CC="$ac_cv_prog_CC"+fi++if test -z "$CC"; then+          if test -n "$ac_tool_prefix"; then+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.+set dummy ${ac_tool_prefix}cc; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if test "${ac_cv_prog_CC+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  if test -n "$CC"; then+  ac_cv_prog_CC="$CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_exec_ext in '' $ac_executable_extensions; do+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then+    ac_cv_prog_CC="${ac_tool_prefix}cc"+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+    break 2+  fi+done+  done+IFS=$as_save_IFS++fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5+$as_echo "$CC" >&6; }+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++  fi+fi+if test -z "$CC"; then+  # Extract the first word of "cc", so it can be a program name with args.+set dummy cc; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if test "${ac_cv_prog_CC+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  if test -n "$CC"; then+  ac_cv_prog_CC="$CC" # Let the user override the test.+else+  ac_prog_rejected=no+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_exec_ext in '' $ac_executable_extensions; do+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then+       ac_prog_rejected=yes+       continue+     fi+    ac_cv_prog_CC="cc"+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+    break 2+  fi+done+  done+IFS=$as_save_IFS++if test $ac_prog_rejected = yes; then+  # We found a bogon in the path, so make sure we never use it.+  set dummy $ac_cv_prog_CC+  shift+  if test $# != 0; then+    # We chose a different compiler from the bogus one.+    # However, it has the same basename, so the bogon will be chosen+    # first if we set CC to just the basename; use the full file name.+    shift+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"+  fi+fi+fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5+$as_echo "$CC" >&6; }+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++fi+if test -z "$CC"; then+  if test -n "$ac_tool_prefix"; then+  for ac_prog in cl.exe+  do+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.+set dummy $ac_tool_prefix$ac_prog; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if test "${ac_cv_prog_CC+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  if test -n "$CC"; then+  ac_cv_prog_CC="$CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_exec_ext in '' $ac_executable_extensions; do+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+    break 2+  fi+done+  done+IFS=$as_save_IFS++fi+fi+CC=$ac_cv_prog_CC+if test -n "$CC"; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5+$as_echo "$CC" >&6; }+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++    test -n "$CC" && break+  done+fi+if test -z "$CC"; then+  ac_ct_CC=$CC+  for ac_prog in cl.exe+do+  # Extract the first word of "$ac_prog", so it can be a program name with args.+set dummy $ac_prog; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  if test -n "$ac_ct_CC"; then+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.+else+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_exec_ext in '' $ac_executable_extensions; do+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then+    ac_cv_prog_ac_ct_CC="$ac_prog"+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+    break 2+  fi+done+  done+IFS=$as_save_IFS++fi+fi+ac_ct_CC=$ac_cv_prog_ac_ct_CC+if test -n "$ac_ct_CC"; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5+$as_echo "$ac_ct_CC" >&6; }+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++  test -n "$ac_ct_CC" && break+done++  if test "x$ac_ct_CC" = x; then+    CC=""+  else+    case $cross_compiling:$ac_tool_warned in+yes:)+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}+ac_tool_warned=yes ;;+esac+    CC=$ac_ct_CC+  fi+fi++fi+++test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error "no acceptable C compiler found in \$PATH+See \`config.log' for more details." "$LINENO" 5; }++# Provide some information about the compiler.+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5+set X $ac_compile+ac_compiler=$2+for ac_option in --version -v -V -qversion; do+  { { ac_try="$ac_compiler $ac_option >&5"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err+  ac_status=$?+  if test -s conftest.err; then+    sed '10a\+... rest of stderr output deleted ...+         10q' conftest.err >conftest.er1+    cat conftest.er1 >&5+  fi+  rm -f conftest.er1 conftest.err+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; }+done++cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */++int+main ()+{++  ;+  return 0;+}+_ACEOF+ac_clean_files_save=$ac_clean_files+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"+# Try to create an executable without -o first, disregard a.out.+# It will help us diagnose broken compilers, and finding out an intuition+# of exeext.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5+$as_echo_n "checking whether the C compiler works... " >&6; }+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`++# The possible output files:+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"++ac_rmfiles=+for ac_file in $ac_files+do+  case $ac_file in+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;+  esac+done+rm -f $ac_rmfiles++if { { ac_try="$ac_link_default"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_link_default") 2>&5+  ac_status=$?+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; }; then :+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'+# in a Makefile.  We should not override ac_cv_exeext if it was cached,+# so that the user can short-circuit this test for compilers unknown to+# Autoconf.+for ac_file in $ac_files ''+do+  test -f "$ac_file" || continue+  case $ac_file in+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )+	;;+    [ab].out )+	# We found the default executable, but exeext='' is most+	# certainly right.+	break;;+    *.* )+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;+	then :; else+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`+	fi+	# We set ac_cv_exeext here because the later test for it is not+	# safe: cross compilers may not add the suffix if given an `-o'+	# argument, so we may need to know it at that point already.+	# Even if this section looks crufty: it has the advantage of+	# actually working.+	break;;+    * )+	break;;+  esac+done+test "$ac_cv_exeext" = no && ac_cv_exeext=++else+  ac_file=''+fi+if test -z "$ac_file"; then :+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+$as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+{ as_fn_set_status 77+as_fn_error "C compiler cannot create executables+See \`config.log' for more details." "$LINENO" 5; }; }+else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5+$as_echo "yes" >&6; }+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5+$as_echo_n "checking for C compiler default output file name... " >&6; }+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5+$as_echo "$ac_file" >&6; }+ac_exeext=$ac_cv_exeext++rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out+ac_clean_files=$ac_clean_files_save+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5+$as_echo_n "checking for suffix of executables... " >&6; }+if { { ac_try="$ac_link"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_link") 2>&5+  ac_status=$?+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; }; then :+  # If both `conftest.exe' and `conftest' are `present' (well, observable)+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will+# work properly (i.e., refer to `conftest.exe'), while it won't with+# `rm'.+for ac_file in conftest.exe conftest conftest.*; do+  test -f "$ac_file" || continue+  case $ac_file in+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`+	  break;;+    * ) break;;+  esac+done+else+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error "cannot compute suffix of executables: cannot compile and link+See \`config.log' for more details." "$LINENO" 5; }+fi+rm -f conftest conftest$ac_cv_exeext+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5+$as_echo "$ac_cv_exeext" >&6; }++rm -f conftest.$ac_ext+EXEEXT=$ac_cv_exeext+ac_exeext=$EXEEXT+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+int+main ()+{+FILE *f = fopen ("conftest.out", "w");+ return ferror (f) || fclose (f) != 0;++  ;+  return 0;+}+_ACEOF+ac_clean_files="$ac_clean_files conftest.out"+# Check that the compiler produces executables we can run.  If not, either+# the compiler is broken, or we cross compile.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5+$as_echo_n "checking whether we are cross compiling... " >&6; }+if test "$cross_compiling" != yes; then+  { { ac_try="$ac_link"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_link") 2>&5+  ac_status=$?+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; }+  if { ac_try='./conftest$ac_cv_exeext'+  { { case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_try") 2>&5+  ac_status=$?+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; }; }; then+    cross_compiling=no+  else+    if test "$cross_compiling" = maybe; then+	cross_compiling=yes+    else+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error "cannot run C compiled programs.+If you meant to cross compile, use \`--host'.+See \`config.log' for more details." "$LINENO" 5; }+    fi+  fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5+$as_echo "$cross_compiling" >&6; }++rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out+ac_clean_files=$ac_clean_files_save+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5+$as_echo_n "checking for suffix of object files... " >&6; }+if test "${ac_cv_objext+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */++int+main ()+{++  ;+  return 0;+}+_ACEOF+rm -f conftest.o conftest.obj+if { { ac_try="$ac_compile"+case "(($ac_try" in+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;+  *) ac_try_echo=$ac_try;;+esac+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""+$as_echo "$ac_try_echo"; } >&5+  (eval "$ac_compile") 2>&5+  ac_status=$?+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5+  test $ac_status = 0; }; then :+  for ac_file in conftest.o conftest.obj conftest.*; do+  test -f "$ac_file" || continue;+  case $ac_file in+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`+       break;;+  esac+done+else+  $as_echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error "cannot compute suffix of object files: cannot compile+See \`config.log' for more details." "$LINENO" 5; }+fi+rm -f conftest.$ac_cv_objext conftest.$ac_ext+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5+$as_echo "$ac_cv_objext" >&6; }+OBJEXT=$ac_cv_objext+ac_objext=$OBJEXT+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }+if test "${ac_cv_c_compiler_gnu+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */++int+main ()+{+#ifndef __GNUC__+       choke me+#endif++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_compiler_gnu=yes+else+  ac_compiler_gnu=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+ac_cv_c_compiler_gnu=$ac_compiler_gnu++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5+$as_echo "$ac_cv_c_compiler_gnu" >&6; }+if test $ac_compiler_gnu = yes; then+  GCC=yes+else+  GCC=+fi+ac_test_CFLAGS=${CFLAGS+set}+ac_save_CFLAGS=$CFLAGS+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5+$as_echo_n "checking whether $CC accepts -g... " >&6; }+if test "${ac_cv_prog_cc_g+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  ac_save_c_werror_flag=$ac_c_werror_flag+   ac_c_werror_flag=yes+   ac_cv_prog_cc_g=no+   CFLAGS="-g"+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */++int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_prog_cc_g=yes+else+  CFLAGS=""+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */++int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :++else+  ac_c_werror_flag=$ac_save_c_werror_flag+	 CFLAGS="-g"+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */++int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_prog_cc_g=yes+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+   ac_c_werror_flag=$ac_save_c_werror_flag+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5+$as_echo "$ac_cv_prog_cc_g" >&6; }+if test "$ac_test_CFLAGS" = set; then+  CFLAGS=$ac_save_CFLAGS+elif test $ac_cv_prog_cc_g = yes; then+  if test "$GCC" = yes; then+    CFLAGS="-g -O2"+  else+    CFLAGS="-g"+  fi+else+  if test "$GCC" = yes; then+    CFLAGS="-O2"+  else+    CFLAGS=+  fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }+if test "${ac_cv_prog_cc_c89+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  ac_cv_prog_cc_c89=no+ac_save_CC=$CC+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdarg.h>+#include <stdio.h>+#include <sys/types.h>+#include <sys/stat.h>+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */+struct buf { int x; };+FILE * (*rcsopen) (struct buf *, struct stat *, int);+static char *e (p, i)+     char **p;+     int i;+{+  return p[i];+}+static char *f (char * (*g) (char **, int), char **p, ...)+{+  char *s;+  va_list v;+  va_start (v,p);+  s = g (p, va_arg (v,int));+  va_end (v);+  return s;+}++/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has+   function prototypes and stuff, but not '\xHH' hex character constants.+   These don't provoke an error unfortunately, instead are silently treated+   as 'x'.  The following induces an error, until -std is added to get+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an+   array size at least.  It's necessary to write '\x00'==0 to get something+   that's true only with -std.  */+int osf4_cc_array ['\x00' == 0 ? 1 : -1];++/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters+   inside strings and character constants.  */+#define FOO(x) 'x'+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];++int test (int i, double x);+struct s1 {int (*f) (int a);};+struct s2 {int (*f) (double a);};+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);+int argc;+char **argv;+int+main ()+{+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];+  ;+  return 0;+}+_ACEOF+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"+do+  CC="$ac_save_CC $ac_arg"+  if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_prog_cc_c89=$ac_arg+fi+rm -f core conftest.err conftest.$ac_objext+  test "x$ac_cv_prog_cc_c89" != "xno" && break+done+rm -f conftest.$ac_ext+CC=$ac_save_CC++fi+# AC_CACHE_VAL+case "x$ac_cv_prog_cc_c89" in+  x)+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5+$as_echo "none needed" >&6; } ;;+  xno)+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5+$as_echo "unsupported" >&6; } ;;+  *)+    CC="$CC $ac_cv_prog_cc_c89"+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;+esac+if test "x$ac_cv_prog_cc_c89" != xno; then :++fi++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+++# do we have long longs?++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5+$as_echo_n "checking how to run the C preprocessor... " >&6; }+# On Suns, sometimes $CPP names a directory.+if test -n "$CPP" && test -d "$CPP"; then+  CPP=+fi+if test -z "$CPP"; then+  if test "${ac_cv_prog_CPP+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+      # Double quotes because CPP needs to be expanded+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"+    do+      ac_preproc_ok=false+for ac_c_preproc_warn_flag in '' yes+do+  # Use a header file that comes with gcc, so configuring glibc+  # with a fresh cross-compiler works.+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since+  # <limits.h> exists even on freestanding compilers.+  # On the NeXT, cc -E runs the code through the compiler's parser,+  # not just through cpp. "Syntax error" is here to catch this case.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#ifdef __STDC__+# include <limits.h>+#else+# include <assert.h>+#endif+		     Syntax error+_ACEOF+if ac_fn_c_try_cpp "$LINENO"; then :++else+  # Broken: fails on valid input.+continue+fi+rm -f conftest.err conftest.$ac_ext++  # OK, works on sane cases.  Now check whether nonexistent headers+  # can be detected and how.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <ac_nonexistent.h>+_ACEOF+if ac_fn_c_try_cpp "$LINENO"; then :+  # Broken: success on invalid input.+continue+else+  # Passes both tests.+ac_preproc_ok=:+break+fi+rm -f conftest.err conftest.$ac_ext++done+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.+rm -f conftest.err conftest.$ac_ext+if $ac_preproc_ok; then :+  break+fi++    done+    ac_cv_prog_CPP=$CPP++fi+  CPP=$ac_cv_prog_CPP+else+  ac_cv_prog_CPP=$CPP+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5+$as_echo "$CPP" >&6; }+ac_preproc_ok=false+for ac_c_preproc_warn_flag in '' yes+do+  # Use a header file that comes with gcc, so configuring glibc+  # with a fresh cross-compiler works.+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since+  # <limits.h> exists even on freestanding compilers.+  # On the NeXT, cc -E runs the code through the compiler's parser,+  # not just through cpp. "Syntax error" is here to catch this case.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#ifdef __STDC__+# include <limits.h>+#else+# include <assert.h>+#endif+		     Syntax error+_ACEOF+if ac_fn_c_try_cpp "$LINENO"; then :++else+  # Broken: fails on valid input.+continue+fi+rm -f conftest.err conftest.$ac_ext++  # OK, works on sane cases.  Now check whether nonexistent headers+  # can be detected and how.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <ac_nonexistent.h>+_ACEOF+if ac_fn_c_try_cpp "$LINENO"; then :+  # Broken: success on invalid input.+continue+else+  # Passes both tests.+ac_preproc_ok=:+break+fi+rm -f conftest.err conftest.$ac_ext++done+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.+rm -f conftest.err conftest.$ac_ext+if $ac_preproc_ok; then :++else+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}+as_fn_error "C preprocessor \"$CPP\" fails sanity check+See \`config.log' for more details." "$LINENO" 5; }+fi++ac_ext=c+ac_cpp='$CPP $CPPFLAGS'+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'+ac_compiler_gnu=$ac_cv_c_compiler_gnu+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }+if test "${ac_cv_path_GREP+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  if test -z "$GREP"; then+  ac_path_GREP_found=false+  # Loop through the user's path and test for each of PROGNAME-LIST+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_prog in grep ggrep; do+    for ac_exec_ext in '' $ac_executable_extensions; do+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue+# Check for GNU ac_path_GREP and select it if it is found.+  # Check for GNU $ac_path_GREP+case `"$ac_path_GREP" --version 2>&1` in+*GNU*)+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;+*)+  ac_count=0+  $as_echo_n 0123456789 >"conftest.in"+  while :+  do+    cat "conftest.in" "conftest.in" >"conftest.tmp"+    mv "conftest.tmp" "conftest.in"+    cp "conftest.in" "conftest.nl"+    $as_echo 'GREP' >> "conftest.nl"+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break+    as_fn_arith $ac_count + 1 && ac_count=$as_val+    if test $ac_count -gt ${ac_path_GREP_max-0}; then+      # Best one so far, save it but keep looking for a better one+      ac_cv_path_GREP="$ac_path_GREP"+      ac_path_GREP_max=$ac_count+    fi+    # 10*(2^10) chars as input seems more than enough+    test $ac_count -gt 10 && break+  done+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;+esac++      $ac_path_GREP_found && break 3+    done+  done+  done+IFS=$as_save_IFS+  if test -z "$ac_cv_path_GREP"; then+    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5+  fi+else+  ac_cv_path_GREP=$GREP+fi++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5+$as_echo "$ac_cv_path_GREP" >&6; }+ GREP="$ac_cv_path_GREP"+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5+$as_echo_n "checking for egrep... " >&6; }+if test "${ac_cv_path_EGREP+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1+   then ac_cv_path_EGREP="$GREP -E"+   else+     if test -z "$EGREP"; then+  ac_path_EGREP_found=false+  # Loop through the user's path and test for each of PROGNAME-LIST+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    for ac_prog in egrep; do+    for ac_exec_ext in '' $ac_executable_extensions; do+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue+# Check for GNU ac_path_EGREP and select it if it is found.+  # Check for GNU $ac_path_EGREP+case `"$ac_path_EGREP" --version 2>&1` in+*GNU*)+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;+*)+  ac_count=0+  $as_echo_n 0123456789 >"conftest.in"+  while :+  do+    cat "conftest.in" "conftest.in" >"conftest.tmp"+    mv "conftest.tmp" "conftest.in"+    cp "conftest.in" "conftest.nl"+    $as_echo 'EGREP' >> "conftest.nl"+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break+    as_fn_arith $ac_count + 1 && ac_count=$as_val+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then+      # Best one so far, save it but keep looking for a better one+      ac_cv_path_EGREP="$ac_path_EGREP"+      ac_path_EGREP_max=$ac_count+    fi+    # 10*(2^10) chars as input seems more than enough+    test $ac_count -gt 10 && break+  done+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;+esac++      $ac_path_EGREP_found && break 3+    done+  done+  done+IFS=$as_save_IFS+  if test -z "$ac_cv_path_EGREP"; then+    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5+  fi+else+  ac_cv_path_EGREP=$EGREP+fi++   fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5+$as_echo "$ac_cv_path_EGREP" >&6; }+ EGREP="$ac_cv_path_EGREP"+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5+$as_echo_n "checking for ANSI C header files... " >&6; }+if test "${ac_cv_header_stdc+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdlib.h>+#include <stdarg.h>+#include <string.h>+#include <float.h>++int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_header_stdc=yes+else+  ac_cv_header_stdc=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++if test $ac_cv_header_stdc = yes; then+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <string.h>++_ACEOF+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |+  $EGREP "memchr" >/dev/null 2>&1; then :++else+  ac_cv_header_stdc=no+fi+rm -f conftest*++fi++if test $ac_cv_header_stdc = yes; then+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdlib.h>++_ACEOF+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |+  $EGREP "free" >/dev/null 2>&1; then :++else+  ac_cv_header_stdc=no+fi+rm -f conftest*++fi++if test $ac_cv_header_stdc = yes; then+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.+  if test "$cross_compiling" = yes; then :+  :+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <ctype.h>+#include <stdlib.h>+#if ((' ' & 0x0FF) == 0x020)+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))+#else+# define ISLOWER(c) \+		   (('a' <= (c) && (c) <= 'i') \+		     || ('j' <= (c) && (c) <= 'r') \+		     || ('s' <= (c) && (c) <= 'z'))+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))+#endif++#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))+int+main ()+{+  int i;+  for (i = 0; i < 256; i++)+    if (XOR (islower (i), ISLOWER (i))+	|| toupper (i) != TOUPPER (i))+      return 2;+  return 0;+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :++else+  ac_cv_header_stdc=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5+$as_echo "$ac_cv_header_stdc" >&6; }+if test $ac_cv_header_stdc = yes; then++$as_echo "#define STDC_HEADERS 1" >>confdefs.h++fi++# On IRIX 5.3, sys/types and inttypes.h are conflicting.+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \+		  inttypes.h stdint.h unistd.h+do :+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default+"+eval as_val=\$$as_ac_Header+   if test "x$as_val" = x""yes; then :+  cat >>confdefs.h <<_ACEOF+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1+_ACEOF++fi++done+++ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default"+if test "x$ac_cv_type_long_long" = x""yes; then :++cat >>confdefs.h <<_ACEOF+#define HAVE_LONG_LONG 1+_ACEOF+++fi+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5+$as_echo_n "checking for ANSI C header files... " >&6; }+if test "${ac_cv_header_stdc+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdlib.h>+#include <stdarg.h>+#include <string.h>+#include <float.h>++int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_header_stdc=yes+else+  ac_cv_header_stdc=no+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext++if test $ac_cv_header_stdc = yes; then+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <string.h>++_ACEOF+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |+  $EGREP "memchr" >/dev/null 2>&1; then :++else+  ac_cv_header_stdc=no+fi+rm -f conftest*++fi++if test $ac_cv_header_stdc = yes; then+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdlib.h>++_ACEOF+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |+  $EGREP "free" >/dev/null 2>&1; then :++else+  ac_cv_header_stdc=no+fi+rm -f conftest*++fi++if test $ac_cv_header_stdc = yes; then+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.+  if test "$cross_compiling" = yes; then :+  :+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <ctype.h>+#include <stdlib.h>+#if ((' ' & 0x0FF) == 0x020)+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))+#else+# define ISLOWER(c) \+		   (('a' <= (c) && (c) <= 'i') \+		     || ('j' <= (c) && (c) <= 'r') \+		     || ('s' <= (c) && (c) <= 'z'))+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))+#endif++#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))+int+main ()+{+  int i;+  for (i = 0; i < 256; i++)+    if (XOR (islower (i), ISLOWER (i))+	|| toupper (i) != TOUPPER (i))+      return 2;+  return 0;+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :++else+  ac_cv_header_stdc=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5+$as_echo "$ac_cv_header_stdc" >&6; }+if test $ac_cv_header_stdc = yes; then++$as_echo "#define STDC_HEADERS 1" >>confdefs.h++fi+++# check for specific header (.h) files that we are interested in+for ac_header in ctype.h errno.h fcntl.h inttypes.h limits.h signal.h sys/resource.h sys/select.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/wait.h termios.h time.h unistd.h utime.h windows.h winsock.h langinfo.h poll.h sys/epoll.h sys/event.h sys/eventfd.h+do :+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"+eval as_val=\$$as_ac_Header+   if test "x$as_val" = x""yes; then :+  cat >>confdefs.h <<_ACEOF+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1+_ACEOF++fi++done+++# Enable large file support. Do this before testing the types ino_t, off_t, and+# rlim_t, because it will affect the result of that test.+# Check whether --enable-largefile was given.+if test "${enable_largefile+set}" = set; then :+  enableval=$enable_largefile;+fi++if test "$enable_largefile" != no; then++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }+if test "${ac_cv_sys_largefile_CC+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  ac_cv_sys_largefile_CC=no+     if test "$GCC" != yes; then+       ac_save_CC=$CC+       while :; do+	 # IRIX 6.2 and later do not support large files by default,+	 # so use the C compiler's -n32 option if that helps.+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <sys/types.h>+ /* Check that off_t can represent 2**63 - 1 correctly.+    We can't simply define LARGE_OFF_T to be 9223372036854775807,+    since some C++ compilers masquerading as C compilers+    incorrectly reject 9223372036854775807.  */+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721+		       && LARGE_OFF_T % 2147483647 == 1)+		      ? 1 : -1];+int+main ()+{++  ;+  return 0;+}+_ACEOF+	 if ac_fn_c_try_compile "$LINENO"; then :+  break+fi+rm -f core conftest.err conftest.$ac_objext+	 CC="$CC -n32"+	 if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_sys_largefile_CC=' -n32'; break+fi+rm -f core conftest.err conftest.$ac_objext+	 break+       done+       CC=$ac_save_CC+       rm -f conftest.$ac_ext+    fi+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5+$as_echo "$ac_cv_sys_largefile_CC" >&6; }+  if test "$ac_cv_sys_largefile_CC" != no; then+    CC=$CC$ac_cv_sys_largefile_CC+  fi++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }+if test "${ac_cv_sys_file_offset_bits+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  while :; do+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <sys/types.h>+ /* Check that off_t can represent 2**63 - 1 correctly.+    We can't simply define LARGE_OFF_T to be 9223372036854775807,+    since some C++ compilers masquerading as C compilers+    incorrectly reject 9223372036854775807.  */+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721+		       && LARGE_OFF_T % 2147483647 == 1)+		      ? 1 : -1];+int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_sys_file_offset_bits=no; break+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#define _FILE_OFFSET_BITS 64+#include <sys/types.h>+ /* Check that off_t can represent 2**63 - 1 correctly.+    We can't simply define LARGE_OFF_T to be 9223372036854775807,+    since some C++ compilers masquerading as C compilers+    incorrectly reject 9223372036854775807.  */+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721+		       && LARGE_OFF_T % 2147483647 == 1)+		      ? 1 : -1];+int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_sys_file_offset_bits=64; break+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+  ac_cv_sys_file_offset_bits=unknown+  break+done+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }+case $ac_cv_sys_file_offset_bits in #(+  no | unknown) ;;+  *)+cat >>confdefs.h <<_ACEOF+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits+_ACEOF+;;+esac+rm -rf conftest*+  if test $ac_cv_sys_file_offset_bits = unknown; then+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }+if test "${ac_cv_sys_large_files+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  while :; do+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <sys/types.h>+ /* Check that off_t can represent 2**63 - 1 correctly.+    We can't simply define LARGE_OFF_T to be 9223372036854775807,+    since some C++ compilers masquerading as C compilers+    incorrectly reject 9223372036854775807.  */+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721+		       && LARGE_OFF_T % 2147483647 == 1)+		      ? 1 : -1];+int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_sys_large_files=no; break+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#define _LARGE_FILES 1+#include <sys/types.h>+ /* Check that off_t can represent 2**63 - 1 correctly.+    We can't simply define LARGE_OFF_T to be 9223372036854775807,+    since some C++ compilers masquerading as C compilers+    incorrectly reject 9223372036854775807.  */+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721+		       && LARGE_OFF_T % 2147483647 == 1)+		      ? 1 : -1];+int+main ()+{++  ;+  return 0;+}+_ACEOF+if ac_fn_c_try_compile "$LINENO"; then :+  ac_cv_sys_large_files=1; break+fi+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext+  ac_cv_sys_large_files=unknown+  break+done+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5+$as_echo "$ac_cv_sys_large_files" >&6; }+case $ac_cv_sys_large_files in #(+  no | unknown) ;;+  *)+cat >>confdefs.h <<_ACEOF+#define _LARGE_FILES $ac_cv_sys_large_files+_ACEOF+;;+esac+rm -rf conftest*+  fi+fi+++for ac_header in wctype.h+do :+  ac_fn_c_check_header_mongrel "$LINENO" "wctype.h" "ac_cv_header_wctype_h" "$ac_includes_default"+if test "x$ac_cv_header_wctype_h" = x""yes; then :+  cat >>confdefs.h <<_ACEOF+#define HAVE_WCTYPE_H 1+_ACEOF+ for ac_func in iswspace+do :+  ac_fn_c_check_func "$LINENO" "iswspace" "ac_cv_func_iswspace"+if test "x$ac_cv_func_iswspace" = x""yes; then :+  cat >>confdefs.h <<_ACEOF+#define HAVE_ISWSPACE 1+_ACEOF++fi+done++fi++done+++for ac_func in lstat+do :+  ac_fn_c_check_func "$LINENO" "lstat" "ac_cv_func_lstat"+if test "x$ac_cv_func_lstat" = x""yes; then :+  cat >>confdefs.h <<_ACEOF+#define HAVE_LSTAT 1+_ACEOF++fi+done++for ac_func in getclock getrusage times+do :+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"+eval as_val=\$$as_ac_var+   if test "x$as_val" = x""yes; then :+  cat >>confdefs.h <<_ACEOF+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1+_ACEOF++fi+done++for ac_func in _chsize ftruncate+do :+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"+eval as_val=\$$as_ac_var+   if test "x$as_val" = x""yes; then :+  cat >>confdefs.h <<_ACEOF+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1+_ACEOF++fi+done+++for ac_func in epoll_create1 epoll_ctl eventfd kevent kevent64 kqueue poll+do :+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"+eval as_val=\$$as_ac_var+   if test "x$as_val" = x""yes; then :+  cat >>confdefs.h <<_ACEOF+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1+_ACEOF++fi+done+++# event-related fun++if test "$ac_cv_header_sys_epoll_h" = yes -a "$ac_cv_func_epoll_ctl" = yes; then++$as_echo "#define HAVE_EPOLL 1" >>confdefs.h++fi++if test "$ac_cv_header_sys_event_h" = yes -a "$ac_cv_func_kqueue" = yes; then++$as_echo "#define HAVE_KQUEUE 1" >>confdefs.h++fi++if test "$ac_cv_header_poll_h" = yes -a "$ac_cv_func_poll" = yes; then++$as_echo "#define HAVE_POLL 1" >>confdefs.h++fi++++# Check whether --with-iconv-includes was given.+if test "${with_iconv_includes+set}" = set; then :+  withval=$with_iconv_includes; ICONV_INCLUDE_DIRS=$withval; CPPFLAGS="-I$withval"+else+  ICONV_INCLUDE_DIRS=+fi++++# Check whether --with-iconv-libraries was given.+if test "${with_iconv_libraries+set}" = set; then :+  withval=$with_iconv_libraries; ICONV_LIB_DIRS=$withval; LDFLAGS="-L$withval"+else+  ICONV_LIB_DIRS=+fi++++++# map standard C types and ISO types to Haskell types+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for char" >&5+$as_echo_n "checking Haskell type for char... " >&6; }+if test "${fptools_cv_htype_char+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_char=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_char=NotReallyATypeCross; fptools_cv_htype_sup_char=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef char testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_char=`cat conftestval`+else+  fptools_cv_htype_char=NotReallyAType; fptools_cv_htype_sup_char=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_char" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_char" >&5+$as_echo "$fptools_cv_htype_char" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_CHAR $fptools_cv_htype_char+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for signed char" >&5+$as_echo_n "checking Haskell type for signed char... " >&6; }+if test "${fptools_cv_htype_signed_char+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_signed_char=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_signed_char=NotReallyATypeCross; fptools_cv_htype_sup_signed_char=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef signed char testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_signed_char=`cat conftestval`+else+  fptools_cv_htype_signed_char=NotReallyAType; fptools_cv_htype_sup_signed_char=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_signed_char" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_signed_char" >&5+$as_echo "$fptools_cv_htype_signed_char" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SIGNED_CHAR $fptools_cv_htype_signed_char+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned char" >&5+$as_echo_n "checking Haskell type for unsigned char... " >&6; }+if test "${fptools_cv_htype_unsigned_char+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_unsigned_char=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_unsigned_char=NotReallyATypeCross; fptools_cv_htype_sup_unsigned_char=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef unsigned char testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_unsigned_char=`cat conftestval`+else+  fptools_cv_htype_unsigned_char=NotReallyAType; fptools_cv_htype_sup_unsigned_char=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_unsigned_char" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_char" >&5+$as_echo "$fptools_cv_htype_unsigned_char" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UNSIGNED_CHAR $fptools_cv_htype_unsigned_char+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for short" >&5+$as_echo_n "checking Haskell type for short... " >&6; }+if test "${fptools_cv_htype_short+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_short=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_short=NotReallyATypeCross; fptools_cv_htype_sup_short=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef short testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_short=`cat conftestval`+else+  fptools_cv_htype_short=NotReallyAType; fptools_cv_htype_sup_short=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_short" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_short" >&5+$as_echo "$fptools_cv_htype_short" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SHORT $fptools_cv_htype_short+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned short" >&5+$as_echo_n "checking Haskell type for unsigned short... " >&6; }+if test "${fptools_cv_htype_unsigned_short+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_unsigned_short=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_unsigned_short=NotReallyATypeCross; fptools_cv_htype_sup_unsigned_short=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef unsigned short testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_unsigned_short=`cat conftestval`+else+  fptools_cv_htype_unsigned_short=NotReallyAType; fptools_cv_htype_sup_unsigned_short=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_unsigned_short" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_short" >&5+$as_echo "$fptools_cv_htype_unsigned_short" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UNSIGNED_SHORT $fptools_cv_htype_unsigned_short+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for int" >&5+$as_echo_n "checking Haskell type for int... " >&6; }+if test "${fptools_cv_htype_int+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_int=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_int=NotReallyATypeCross; fptools_cv_htype_sup_int=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef int testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_int=`cat conftestval`+else+  fptools_cv_htype_int=NotReallyAType; fptools_cv_htype_sup_int=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_int" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_int" >&5+$as_echo "$fptools_cv_htype_int" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_INT $fptools_cv_htype_int+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned int" >&5+$as_echo_n "checking Haskell type for unsigned int... " >&6; }+if test "${fptools_cv_htype_unsigned_int+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_unsigned_int=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_unsigned_int=NotReallyATypeCross; fptools_cv_htype_sup_unsigned_int=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef unsigned int testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_unsigned_int=`cat conftestval`+else+  fptools_cv_htype_unsigned_int=NotReallyAType; fptools_cv_htype_sup_unsigned_int=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_unsigned_int" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_int" >&5+$as_echo "$fptools_cv_htype_unsigned_int" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UNSIGNED_INT $fptools_cv_htype_unsigned_int+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for long" >&5+$as_echo_n "checking Haskell type for long... " >&6; }+if test "${fptools_cv_htype_long+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_long=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_long=NotReallyATypeCross; fptools_cv_htype_sup_long=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef long testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_long=`cat conftestval`+else+  fptools_cv_htype_long=NotReallyAType; fptools_cv_htype_sup_long=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_long" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_long" >&5+$as_echo "$fptools_cv_htype_long" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_LONG $fptools_cv_htype_long+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned long" >&5+$as_echo_n "checking Haskell type for unsigned long... " >&6; }+if test "${fptools_cv_htype_unsigned_long+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_unsigned_long=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_unsigned_long=NotReallyATypeCross; fptools_cv_htype_sup_unsigned_long=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef unsigned long testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_unsigned_long=`cat conftestval`+else+  fptools_cv_htype_unsigned_long=NotReallyAType; fptools_cv_htype_sup_unsigned_long=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_unsigned_long" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_long" >&5+$as_echo "$fptools_cv_htype_unsigned_long" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UNSIGNED_LONG $fptools_cv_htype_unsigned_long+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++if test "$ac_cv_type_long_long" = yes; then+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for long long" >&5+$as_echo_n "checking Haskell type for long long... " >&6; }+if test "${fptools_cv_htype_long_long+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_long_long=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_long_long=NotReallyATypeCross; fptools_cv_htype_sup_long_long=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef long long testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_long_long=`cat conftestval`+else+  fptools_cv_htype_long_long=NotReallyAType; fptools_cv_htype_sup_long_long=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_long_long" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_long_long" >&5+$as_echo "$fptools_cv_htype_long_long" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_LONG_LONG $fptools_cv_htype_long_long+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for unsigned long long" >&5+$as_echo_n "checking Haskell type for unsigned long long... " >&6; }+if test "${fptools_cv_htype_unsigned_long_long+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_unsigned_long_long=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_unsigned_long_long=NotReallyATypeCross; fptools_cv_htype_sup_unsigned_long_long=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef unsigned long long testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_unsigned_long_long=`cat conftestval`+else+  fptools_cv_htype_unsigned_long_long=NotReallyAType; fptools_cv_htype_sup_unsigned_long_long=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_unsigned_long_long" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_unsigned_long_long" >&5+$as_echo "$fptools_cv_htype_unsigned_long_long" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UNSIGNED_LONG_LONG $fptools_cv_htype_unsigned_long_long+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for float" >&5+$as_echo_n "checking Haskell type for float... " >&6; }+if test "${fptools_cv_htype_float+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_float=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_float=NotReallyATypeCross; fptools_cv_htype_sup_float=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef float testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_float=`cat conftestval`+else+  fptools_cv_htype_float=NotReallyAType; fptools_cv_htype_sup_float=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_float" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_float" >&5+$as_echo "$fptools_cv_htype_float" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_FLOAT $fptools_cv_htype_float+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for double" >&5+$as_echo_n "checking Haskell type for double... " >&6; }+if test "${fptools_cv_htype_double+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_double=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_double=NotReallyATypeCross; fptools_cv_htype_sup_double=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef double testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_double=`cat conftestval`+else+  fptools_cv_htype_double=NotReallyAType; fptools_cv_htype_sup_double=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_double" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_double" >&5+$as_echo "$fptools_cv_htype_double" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_DOUBLE $fptools_cv_htype_double+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for ptrdiff_t" >&5+$as_echo_n "checking Haskell type for ptrdiff_t... " >&6; }+if test "${fptools_cv_htype_ptrdiff_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_ptrdiff_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_ptrdiff_t=NotReallyATypeCross; fptools_cv_htype_sup_ptrdiff_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef ptrdiff_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_ptrdiff_t=`cat conftestval`+else+  fptools_cv_htype_ptrdiff_t=NotReallyAType; fptools_cv_htype_sup_ptrdiff_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_ptrdiff_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_ptrdiff_t" >&5+$as_echo "$fptools_cv_htype_ptrdiff_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_PTRDIFF_T $fptools_cv_htype_ptrdiff_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for size_t" >&5+$as_echo_n "checking Haskell type for size_t... " >&6; }+if test "${fptools_cv_htype_size_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_size_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_size_t=NotReallyATypeCross; fptools_cv_htype_sup_size_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef size_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_size_t=`cat conftestval`+else+  fptools_cv_htype_size_t=NotReallyAType; fptools_cv_htype_sup_size_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_size_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_size_t" >&5+$as_echo "$fptools_cv_htype_size_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SIZE_T $fptools_cv_htype_size_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for wchar_t" >&5+$as_echo_n "checking Haskell type for wchar_t... " >&6; }+if test "${fptools_cv_htype_wchar_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_wchar_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_wchar_t=NotReallyATypeCross; fptools_cv_htype_sup_wchar_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef wchar_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_wchar_t=`cat conftestval`+else+  fptools_cv_htype_wchar_t=NotReallyAType; fptools_cv_htype_sup_wchar_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_wchar_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_wchar_t" >&5+$as_echo "$fptools_cv_htype_wchar_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_WCHAR_T $fptools_cv_htype_wchar_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++# Int32 is a HACK for non-ISO C compilers+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for sig_atomic_t" >&5+$as_echo_n "checking Haskell type for sig_atomic_t... " >&6; }+if test "${fptools_cv_htype_sig_atomic_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_sig_atomic_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_sig_atomic_t=NotReallyATypeCross; fptools_cv_htype_sup_sig_atomic_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef sig_atomic_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_sig_atomic_t=`cat conftestval`+else+  fptools_cv_htype_sig_atomic_t=Int32+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_sig_atomic_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_sig_atomic_t" >&5+$as_echo "$fptools_cv_htype_sig_atomic_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SIG_ATOMIC_T $fptools_cv_htype_sig_atomic_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for clock_t" >&5+$as_echo_n "checking Haskell type for clock_t... " >&6; }+if test "${fptools_cv_htype_clock_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_clock_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_clock_t=NotReallyATypeCross; fptools_cv_htype_sup_clock_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef clock_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_clock_t=`cat conftestval`+else+  fptools_cv_htype_clock_t=NotReallyAType; fptools_cv_htype_sup_clock_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_clock_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_clock_t" >&5+$as_echo "$fptools_cv_htype_clock_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_CLOCK_T $fptools_cv_htype_clock_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for time_t" >&5+$as_echo_n "checking Haskell type for time_t... " >&6; }+if test "${fptools_cv_htype_time_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_time_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_time_t=NotReallyATypeCross; fptools_cv_htype_sup_time_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef time_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_time_t=`cat conftestval`+else+  fptools_cv_htype_time_t=NotReallyAType; fptools_cv_htype_sup_time_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_time_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_time_t" >&5+$as_echo "$fptools_cv_htype_time_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_TIME_T $fptools_cv_htype_time_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for dev_t" >&5+$as_echo_n "checking Haskell type for dev_t... " >&6; }+if test "${fptools_cv_htype_dev_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_dev_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_dev_t=NotReallyATypeCross; fptools_cv_htype_sup_dev_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef dev_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_dev_t=`cat conftestval`+else+  fptools_cv_htype_dev_t=Word32+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_dev_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_dev_t" >&5+$as_echo "$fptools_cv_htype_dev_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_DEV_T $fptools_cv_htype_dev_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for ino_t" >&5+$as_echo_n "checking Haskell type for ino_t... " >&6; }+if test "${fptools_cv_htype_ino_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_ino_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_ino_t=NotReallyATypeCross; fptools_cv_htype_sup_ino_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef ino_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_ino_t=`cat conftestval`+else+  fptools_cv_htype_ino_t=NotReallyAType; fptools_cv_htype_sup_ino_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_ino_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_ino_t" >&5+$as_echo "$fptools_cv_htype_ino_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_INO_T $fptools_cv_htype_ino_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for mode_t" >&5+$as_echo_n "checking Haskell type for mode_t... " >&6; }+if test "${fptools_cv_htype_mode_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_mode_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_mode_t=NotReallyATypeCross; fptools_cv_htype_sup_mode_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef mode_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_mode_t=`cat conftestval`+else+  fptools_cv_htype_mode_t=NotReallyAType; fptools_cv_htype_sup_mode_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_mode_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_mode_t" >&5+$as_echo "$fptools_cv_htype_mode_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_MODE_T $fptools_cv_htype_mode_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for off_t" >&5+$as_echo_n "checking Haskell type for off_t... " >&6; }+if test "${fptools_cv_htype_off_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_off_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_off_t=NotReallyATypeCross; fptools_cv_htype_sup_off_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef off_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_off_t=`cat conftestval`+else+  fptools_cv_htype_off_t=NotReallyAType; fptools_cv_htype_sup_off_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_off_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_off_t" >&5+$as_echo "$fptools_cv_htype_off_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_OFF_T $fptools_cv_htype_off_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for pid_t" >&5+$as_echo_n "checking Haskell type for pid_t... " >&6; }+if test "${fptools_cv_htype_pid_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_pid_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_pid_t=NotReallyATypeCross; fptools_cv_htype_sup_pid_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef pid_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_pid_t=`cat conftestval`+else+  fptools_cv_htype_pid_t=NotReallyAType; fptools_cv_htype_sup_pid_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_pid_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_pid_t" >&5+$as_echo "$fptools_cv_htype_pid_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_PID_T $fptools_cv_htype_pid_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for gid_t" >&5+$as_echo_n "checking Haskell type for gid_t... " >&6; }+if test "${fptools_cv_htype_gid_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_gid_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_gid_t=NotReallyATypeCross; fptools_cv_htype_sup_gid_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef gid_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_gid_t=`cat conftestval`+else+  fptools_cv_htype_gid_t=NotReallyAType; fptools_cv_htype_sup_gid_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_gid_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_gid_t" >&5+$as_echo "$fptools_cv_htype_gid_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_GID_T $fptools_cv_htype_gid_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for uid_t" >&5+$as_echo_n "checking Haskell type for uid_t... " >&6; }+if test "${fptools_cv_htype_uid_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_uid_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_uid_t=NotReallyATypeCross; fptools_cv_htype_sup_uid_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef uid_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_uid_t=`cat conftestval`+else+  fptools_cv_htype_uid_t=NotReallyAType; fptools_cv_htype_sup_uid_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_uid_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_uid_t" >&5+$as_echo "$fptools_cv_htype_uid_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UID_T $fptools_cv_htype_uid_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for cc_t" >&5+$as_echo_n "checking Haskell type for cc_t... " >&6; }+if test "${fptools_cv_htype_cc_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_cc_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_cc_t=NotReallyATypeCross; fptools_cv_htype_sup_cc_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef cc_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_cc_t=`cat conftestval`+else+  fptools_cv_htype_cc_t=NotReallyAType; fptools_cv_htype_sup_cc_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_cc_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_cc_t" >&5+$as_echo "$fptools_cv_htype_cc_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_CC_T $fptools_cv_htype_cc_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for speed_t" >&5+$as_echo_n "checking Haskell type for speed_t... " >&6; }+if test "${fptools_cv_htype_speed_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_speed_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_speed_t=NotReallyATypeCross; fptools_cv_htype_sup_speed_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef speed_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_speed_t=`cat conftestval`+else+  fptools_cv_htype_speed_t=NotReallyAType; fptools_cv_htype_sup_speed_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_speed_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_speed_t" >&5+$as_echo "$fptools_cv_htype_speed_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SPEED_T $fptools_cv_htype_speed_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for tcflag_t" >&5+$as_echo_n "checking Haskell type for tcflag_t... " >&6; }+if test "${fptools_cv_htype_tcflag_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_tcflag_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_tcflag_t=NotReallyATypeCross; fptools_cv_htype_sup_tcflag_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef tcflag_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_tcflag_t=`cat conftestval`+else+  fptools_cv_htype_tcflag_t=NotReallyAType; fptools_cv_htype_sup_tcflag_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_tcflag_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_tcflag_t" >&5+$as_echo "$fptools_cv_htype_tcflag_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_TCFLAG_T $fptools_cv_htype_tcflag_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for nlink_t" >&5+$as_echo_n "checking Haskell type for nlink_t... " >&6; }+if test "${fptools_cv_htype_nlink_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_nlink_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_nlink_t=NotReallyATypeCross; fptools_cv_htype_sup_nlink_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef nlink_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_nlink_t=`cat conftestval`+else+  fptools_cv_htype_nlink_t=NotReallyAType; fptools_cv_htype_sup_nlink_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_nlink_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_nlink_t" >&5+$as_echo "$fptools_cv_htype_nlink_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_NLINK_T $fptools_cv_htype_nlink_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for ssize_t" >&5+$as_echo_n "checking Haskell type for ssize_t... " >&6; }+if test "${fptools_cv_htype_ssize_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_ssize_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_ssize_t=NotReallyATypeCross; fptools_cv_htype_sup_ssize_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef ssize_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_ssize_t=`cat conftestval`+else+  fptools_cv_htype_ssize_t=NotReallyAType; fptools_cv_htype_sup_ssize_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_ssize_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_ssize_t" >&5+$as_echo "$fptools_cv_htype_ssize_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_SSIZE_T $fptools_cv_htype_ssize_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for rlim_t" >&5+$as_echo_n "checking Haskell type for rlim_t... " >&6; }+if test "${fptools_cv_htype_rlim_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_rlim_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_rlim_t=NotReallyATypeCross; fptools_cv_htype_sup_rlim_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef rlim_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_rlim_t=`cat conftestval`+else+  fptools_cv_htype_rlim_t=NotReallyAType; fptools_cv_htype_sup_rlim_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_rlim_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_rlim_t" >&5+$as_echo "$fptools_cv_htype_rlim_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_RLIM_T $fptools_cv_htype_rlim_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for wint_t" >&5+$as_echo_n "checking Haskell type for wint_t... " >&6; }+if test "${fptools_cv_htype_wint_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_wint_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_wint_t=NotReallyATypeCross; fptools_cv_htype_sup_wint_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef wint_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_wint_t=`cat conftestval`+else+  fptools_cv_htype_wint_t=NotReallyAType; fptools_cv_htype_sup_wint_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_wint_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_wint_t" >&5+$as_echo "$fptools_cv_htype_wint_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_WINT_T $fptools_cv_htype_wint_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for intptr_t" >&5+$as_echo_n "checking Haskell type for intptr_t... " >&6; }+if test "${fptools_cv_htype_intptr_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_intptr_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_intptr_t=NotReallyATypeCross; fptools_cv_htype_sup_intptr_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef intptr_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_intptr_t=`cat conftestval`+else+  fptools_cv_htype_intptr_t=NotReallyAType; fptools_cv_htype_sup_intptr_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_intptr_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_intptr_t" >&5+$as_echo "$fptools_cv_htype_intptr_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_INTPTR_T $fptools_cv_htype_intptr_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for uintptr_t" >&5+$as_echo_n "checking Haskell type for uintptr_t... " >&6; }+if test "${fptools_cv_htype_uintptr_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_uintptr_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_uintptr_t=NotReallyATypeCross; fptools_cv_htype_sup_uintptr_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef uintptr_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_uintptr_t=`cat conftestval`+else+  fptools_cv_htype_uintptr_t=NotReallyAType; fptools_cv_htype_sup_uintptr_t=no+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_uintptr_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_uintptr_t" >&5+$as_echo "$fptools_cv_htype_uintptr_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UINTPTR_T $fptools_cv_htype_uintptr_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++# Workaround for OSes that don't have intmax_t and uintmax_t, e.g. OpenBSD.+if test "$ac_cv_type_long_long" = yes; then+  fptools_cv_default_htype_intmax=$fptools_cv_htype_long_long+  fptools_cv_default_htype_uintmax=$fptools_cv_htype_unsigned_long_long+else+  fptools_cv_default_htype_intmax=$fptools_cv_htype_long+  fptools_cv_default_htype_uintmax=$fptools_cv_htype_unsigned_long+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for intmax_t" >&5+$as_echo_n "checking Haskell type for intmax_t... " >&6; }+if test "${fptools_cv_htype_intmax_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_intmax_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_intmax_t=NotReallyATypeCross; fptools_cv_htype_sup_intmax_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef intmax_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_intmax_t=`cat conftestval`+else+  fptools_cv_htype_intmax_t=$fptools_cv_default_htype_intmax+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_intmax_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_intmax_t" >&5+$as_echo "$fptools_cv_htype_intmax_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_INTMAX_T $fptools_cv_htype_intmax_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Haskell type for uintmax_t" >&5+$as_echo_n "checking Haskell type for uintmax_t... " >&6; }+if test "${fptools_cv_htype_uintmax_t+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  fptools_cv_htype_sup_uintmax_t=yes+fp_check_htype_save_cppflags="$CPPFLAGS"+CPPFLAGS="$CPPFLAGS $X_CFLAGS"+if test "$cross_compiling" = yes; then :+  fptools_cv_htype_uintmax_t=NotReallyATypeCross; fptools_cv_htype_sup_uintmax_t=no+else+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <stdio.h>+#include <stddef.h>++#if HAVE_SYS_TYPES_H+# include <sys/types.h>+#endif++#if HAVE_UNISTD_H+# include <unistd.h>+#endif++#if HAVE_SYS_STAT_H+# include <sys/stat.h>+#endif++#if HAVE_FCNTL_H+# include <fcntl.h>+#endif++#if HAVE_SIGNAL_H+# include <signal.h>+#endif++#if HAVE_TIME_H+# include <time.h>+#endif++#if HAVE_TERMIOS_H+# include <termios.h>+#endif++#if HAVE_STRING_H+# include <string.h>+#endif++#if HAVE_CTYPE_H+# include <ctype.h>+#endif++#if HAVE_INTTYPES_H+# include <inttypes.h>+#else+# if HAVE_STDINT_H+#  include <stdint.h>+# endif+#endif++#if defined(HAVE_GL_GL_H)+# include <GL/gl.h>+#elif defined(HAVE_OPENGL_GL_H)+# include <OpenGL/gl.h>+#endif++#if defined(HAVE_AL_AL_H)+# include <AL/al.h>+#elif defined(HAVE_OPENAL_AL_H)+# include <OpenAL/al.h>+#endif++#if defined(HAVE_AL_ALC_H)+# include <AL/alc.h>+#elif defined(HAVE_OPENAL_ALC_H)+# include <OpenAL/alc.h>+#endif++#if HAVE_SYS_RESOURCE_H+# include <sys/resource.h>+#endif++#include <stdlib.h>++typedef uintmax_t testing;++int main(void) {+  FILE *f=fopen("conftestval", "w");+  if (!f) exit(1);+  if (((testing)((int)((testing)1.4))) == ((testing)1.4)) {+    fprintf(f, "%s%d\n",+           ((testing)(-1) < (testing)0) ? "Int" : "Word",+           (int)(sizeof(testing)*8));+  } else {+    fprintf(f,"%s\n",+           (sizeof(testing) >  sizeof(double)) ? "LDouble" :+           (sizeof(testing) == sizeof(double)) ? "Double"  : "Float");+  }+  fclose(f);+  exit(0);+}+_ACEOF+if ac_fn_c_try_run "$LINENO"; then :+  fptools_cv_htype_uintmax_t=`cat conftestval`+else+  fptools_cv_htype_uintmax_t=$fptools_cv_default_htype_uintmax+fi+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \+  conftest.$ac_objext conftest.beam conftest.$ac_ext+fi++CPPFLAGS="$fp_check_htype_save_cppflags"+fi+ if test "$fptools_cv_htype_sup_uintmax_t" = yes; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fptools_cv_htype_uintmax_t" >&5+$as_echo "$fptools_cv_htype_uintmax_t" >&6; }++cat >>confdefs.h <<_ACEOF+#define HTYPE_UINTMAX_T $fptools_cv_htype_uintmax_t+_ACEOF++else+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5+$as_echo "not supported" >&6; }+fi+++# test errno values+for fp_const_name in E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EADV EAFNOSUPPORT EAGAIN EALREADY EBADF EBADMSG EBADRPC EBUSY ECHILD ECOMM ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDIRTY EDOM EDQUOT EEXIST EFAULT EFBIG EFTYPE EHOSTDOWN EHOSTUNREACH EIDRM EILSEQ EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENONET ENOPROTOOPT ENOSPC ENOSR ENOSTR ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROCUNAVAIL EPROGMISMATCH EPROGUNAVAIL EPROTO EPROTONOSUPPORT EPROTOTYPE ERANGE EREMCHG EREMOTE EROFS ERPCMISMATCH ERREMOTE ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESRMNT ESTALE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV ENOCIGAR+do+as_fp_Cache=`$as_echo "fp_cv_const_$fp_const_name" | $as_tr_sh`+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of $fp_const_name" >&5+$as_echo_n "checking value of $fp_const_name... " >&6; }+if { as_var=$as_fp_Cache; eval "test \"\${$as_var+set}\" = set"; }; then :+  $as_echo_n "(cached) " >&6+else+  if ac_fn_c_compute_int "$LINENO" "$fp_const_name" "fp_check_const_result"        "#include <stdio.h>+#include <errno.h>+"; then :++else+  fp_check_const_result='-1'+fi+++eval "$as_fp_Cache=\$fp_check_const_result"+fi+eval ac_res=\$$as_fp_Cache+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+cat >>confdefs.h <<_ACEOF+#define `$as_echo "CONST_$fp_const_name" | $as_tr_cpp` `eval 'as_val=${'$as_fp_Cache'};$as_echo "$as_val"'`+_ACEOF++done+++# we need SIGINT in TopHandler.lhs+for fp_const_name in SIGINT+do+as_fp_Cache=`$as_echo "fp_cv_const_$fp_const_name" | $as_tr_sh`+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of $fp_const_name" >&5+$as_echo_n "checking value of $fp_const_name... " >&6; }+if { as_var=$as_fp_Cache; eval "test \"\${$as_var+set}\" = set"; }; then :+  $as_echo_n "(cached) " >&6+else+  if ac_fn_c_compute_int "$LINENO" "$fp_const_name" "fp_check_const_result"        "+#if HAVE_SIGNAL_H+#include <signal.h>+#endif+"; then :++else+  fp_check_const_result='-1'+fi+++eval "$as_fp_Cache=\$fp_check_const_result"+fi+eval ac_res=\$$as_fp_Cache+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5+$as_echo "$ac_res" >&6; }+cat >>confdefs.h <<_ACEOF+#define `$as_echo "CONST_$fp_const_name" | $as_tr_cpp` `eval 'as_val=${'$as_fp_Cache'};$as_echo "$as_val"'`+_ACEOF++done+++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking value of O_BINARY" >&5+$as_echo_n "checking value of O_BINARY... " >&6; }+if test "${fp_cv_const_O_BINARY+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  if ac_fn_c_compute_int "$LINENO" "O_BINARY" "fp_check_const_result"        "#include <fcntl.h>+"; then :++else+  fp_check_const_result=0+fi+++fp_cv_const_O_BINARY=$fp_check_const_result+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fp_cv_const_O_BINARY" >&5+$as_echo "$fp_cv_const_O_BINARY" >&6; }+cat >>confdefs.h <<_ACEOF+#define CONST_O_BINARY $fp_cv_const_O_BINARY+_ACEOF+++# We can't just use AC_SEARCH_LIBS for this, as on OpenBSD the iconv.h+# header needs to be included as iconv_open is #define'd to something+# else. We therefore use our own FP_SEARCH_LIBS_PROTO, which allows us+# to give prototype text.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing iconv" >&5+$as_echo_n "checking for library containing iconv... " >&6; }+if test "${ac_cv_search_iconv+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  ac_func_search_save_LIBS=$LIBS+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */++#include <stddef.h>+#include <iconv.h>++int+main ()+{+iconv_t cd;+                      cd = iconv_open("", "");+                      iconv(cd,NULL,NULL,NULL,NULL);+                      iconv_close(cd);+  ;+  return 0;+}+_ACEOF+for ac_lib in '' iconv; do+  if test -z "$ac_lib"; then+    ac_res="none required"+  else+    ac_res=-l$ac_lib+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"+  fi+  if ac_fn_c_try_link "$LINENO"; then :+  ac_cv_search_iconv=$ac_res+fi+rm -f core conftest.err conftest.$ac_objext \+    conftest$ac_exeext+  if test "${ac_cv_search_iconv+set}" = set; then :+  break+fi+done+if test "${ac_cv_search_iconv+set}" = set; then :++else+  ac_cv_search_iconv=no+fi+rm conftest.$ac_ext+LIBS=$ac_func_search_save_LIBS+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_iconv" >&5+$as_echo "$ac_cv_search_iconv" >&6; }+ac_res=$ac_cv_search_iconv+if test "$ac_res" != no; then :+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"+  EXTRA_LIBS="$EXTRA_LIBS $ac_lib"+else+  case `uname -s` in+                        MINGW*|CYGWIN*) ;;+                        *)+                             as_fn_error "iconv is required on non-Windows platforms" "$LINENO" 5;;+                      esac+fi++# If possible, we use libcharset instead of nl_langinfo(CODESET) to+# determine the current locale's character encoding.+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing locale_charset" >&5+$as_echo_n "checking for library containing locale_charset... " >&6; }+if test "${ac_cv_search_locale_charset+set}" = set; then :+  $as_echo_n "(cached) " >&6+else+  ac_func_search_save_LIBS=$LIBS+cat confdefs.h - <<_ACEOF >conftest.$ac_ext+/* end confdefs.h.  */+#include <libcharset.h>+int+main ()+{+const char* charset = locale_charset();+  ;+  return 0;+}+_ACEOF+for ac_lib in '' charset; do+  if test -z "$ac_lib"; then+    ac_res="none required"+  else+    ac_res=-l$ac_lib+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"+  fi+  if ac_fn_c_try_link "$LINENO"; then :+  ac_cv_search_locale_charset=$ac_res+fi+rm -f core conftest.err conftest.$ac_objext \+    conftest$ac_exeext+  if test "${ac_cv_search_locale_charset+set}" = set; then :+  break+fi+done+if test "${ac_cv_search_locale_charset+set}" = set; then :++else+  ac_cv_search_locale_charset=no+fi+rm conftest.$ac_ext+LIBS=$ac_func_search_save_LIBS+fi+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_locale_charset" >&5+$as_echo "$ac_cv_search_locale_charset" >&6; }+ac_res=$ac_cv_search_locale_charset+if test "$ac_res" != no; then :+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"++$as_echo "#define HAVE_LIBCHARSET 1" >>confdefs.h++     EXTRA_LIBS="$EXTRA_LIBS $ac_lib"+fi++++ac_config_files="$ac_config_files base.buildinfo"+++cat >confcache <<\_ACEOF+# This file is a shell script that caches the results of configure+# tests run on this system so they can be shared between configure+# scripts and configure runs, see configure's option --config-cache.+# It is not useful on other systems.  If it contains results you don't+# want to keep, you may remove or edit it.+#+# config.status only pays attention to the cache file if you give it+# the --recheck option to rerun configure.+#+# `ac_cv_env_foo' variables (set or unset) will be overridden when+# loading this file, other *unset* `ac_cv_foo' will be assigned the+# following values.++_ACEOF++# The following way of writing the cache mishandles newlines in values,+# but we know of no workaround that is simple, portable, and efficient.+# So, we kill variables containing newlines.+# Ultrix sh set writes to stderr and can't be redirected directly,+# and sets the high bit in the cache file unless we assign to the vars.+(+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do+    eval ac_val=\$$ac_var+    case $ac_val in #(+    *${as_nl}*)+      case $ac_var in #(+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;+      esac+      case $ac_var in #(+      _ | IFS | as_nl) ;; #(+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(+      *) { eval $ac_var=; unset $ac_var;} ;;+      esac ;;+    esac+  done++  (set) 2>&1 |+    case $as_nl`(ac_space=' '; set) 2>&1` in #(+    *${as_nl}ac_space=\ *)+      # `set' does not quote correctly, so add quotes: double-quote+      # substitution turns \\\\ into \\, and sed turns \\ into \.+      sed -n \+	"s/'/'\\\\''/g;+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"+      ;; #(+    *)+      # `set' quotes correctly as required by POSIX, so do not add quotes.+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"+      ;;+    esac |+    sort+) |+  sed '+     /^ac_cv_env_/b end+     t clear+     :clear+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/+     t end+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/+     :end' >>confcache+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else+  if test -w "$cache_file"; then+    test "x$cache_file" != "x/dev/null" &&+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5+$as_echo "$as_me: updating cache $cache_file" >&6;}+    cat confcache >$cache_file+  else+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}+  fi+fi+rm -f confcache++test "x$prefix" = xNONE && prefix=$ac_default_prefix+# Let make expand exec_prefix.+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'++DEFS=-DHAVE_CONFIG_H++ac_libobjs=+ac_ltlibobjs=+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue+  # 1. Remove the extension, and $U if already installed.+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR+  #    will be set to the directory where LIBOBJS objects are built.+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'+done+LIBOBJS=$ac_libobjs++LTLIBOBJS=$ac_ltlibobjs++++: ${CONFIG_STATUS=./config.status}+ac_write_fail=0+ac_clean_files_save=$ac_clean_files+ac_clean_files="$ac_clean_files $CONFIG_STATUS"+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}+as_write_fail=0+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1+#! $SHELL+# Generated by $as_me.+# Run this file to recreate the current configuration.+# Compiler output produced by configure, useful for debugging+# configure, is in config.log if it exists.++debug=false+ac_cs_recheck=false+ac_cs_silent=false++SHELL=\${CONFIG_SHELL-$SHELL}+export SHELL+_ASEOF+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1+## -------------------- ##+## M4sh Initialization. ##+## -------------------- ##++# Be more Bourne compatible+DUALCASE=1; export DUALCASE # for MKS sh+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :+  emulate sh+  NULLCMD=:+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which+  # is contrary to our usage.  Disable this feature.+  alias -g '${1+"$@"}'='"$@"'+  setopt NO_GLOB_SUBST+else+  case `(set -o) 2>/dev/null` in #(+  *posix*) :+    set -o posix ;; #(+  *) :+     ;;+esac+fi+++as_nl='+'+export as_nl+# Printing a long string crashes Solaris 7 /usr/bin/printf.+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo+# Prefer a ksh shell builtin over an external printf program on Solaris,+# but without wasting forks for bash or zsh.+if test -z "$BASH_VERSION$ZSH_VERSION" \+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then+  as_echo='print -r --'+  as_echo_n='print -rn --'+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then+  as_echo='printf %s\n'+  as_echo_n='printf %s'+else+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'+    as_echo_n='/usr/ucb/echo -n'+  else+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'+    as_echo_n_body='eval+      arg=$1;+      case $arg in #(+      *"$as_nl"*)+	expr "X$arg" : "X\\(.*\\)$as_nl";+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;+      esac;+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"+    '+    export as_echo_n_body+    as_echo_n='sh -c $as_echo_n_body as_echo'+  fi+  export as_echo_body+  as_echo='sh -c $as_echo_body as_echo'+fi++# The user is always right.+if test "${PATH_SEPARATOR+set}" != set; then+  PATH_SEPARATOR=:+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||+      PATH_SEPARATOR=';'+  }+fi+++# IFS+# We need space, tab and new line, in precisely that order.  Quoting is+# there to prevent editors from complaining about space-tab.+# (If _AS_PATH_WALK were called with IFS unset, it would disable word+# splitting by setting IFS to empty value.)+IFS=" ""	$as_nl"++# Find who we are.  Look in the path if we contain no directory separator.+case $0 in #((+  *[\\/]* ) as_myself=$0 ;;+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break+  done+IFS=$as_save_IFS++     ;;+esac+# We did not find ourselves, most probably we were run as `sh COMMAND'+# in which case we are not to be found in the path.+if test "x$as_myself" = x; then+  as_myself=$0+fi+if test ! -f "$as_myself"; then+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2+  exit 1+fi++# Unset variables that we do not need and which cause bugs (e.g. in+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"+# suppresses any "Segmentation fault" message there.  '((' could+# trigger a bug in pdksh 5.2.14.+for as_var in BASH_ENV ENV MAIL MAILPATH+do eval test x\${$as_var+set} = xset \+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :+done+PS1='$ '+PS2='> '+PS4='+ '++# NLS nuisances.+LC_ALL=C+export LC_ALL+LANGUAGE=C+export LANGUAGE++# CDPATH.+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH+++# as_fn_error ERROR [LINENO LOG_FD]+# ---------------------------------+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the+# script with status $?, using 1 if that was 0.+as_fn_error ()+{+  as_status=$?; test $as_status -eq 0 && as_status=1+  if test "$3"; then+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3+  fi+  $as_echo "$as_me: error: $1" >&2+  as_fn_exit $as_status+} # as_fn_error+++# as_fn_set_status STATUS+# -----------------------+# Set $? to STATUS, without forking.+as_fn_set_status ()+{+  return $1+} # as_fn_set_status++# as_fn_exit STATUS+# -----------------+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.+as_fn_exit ()+{+  set +e+  as_fn_set_status $1+  exit $1+} # as_fn_exit++# as_fn_unset VAR+# ---------------+# Portably unset VAR.+as_fn_unset ()+{+  { eval $1=; unset $1;}+}+as_unset=as_fn_unset+# as_fn_append VAR VALUE+# ----------------------+# Append the text in VALUE to the end of the definition contained in VAR. Take+# advantage of any shell optimizations that allow amortized linear growth over+# repeated appends, instead of the typical quadratic growth present in naive+# implementations.+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :+  eval 'as_fn_append ()+  {+    eval $1+=\$2+  }'+else+  as_fn_append ()+  {+    eval $1=\$$1\$2+  }+fi # as_fn_append++# as_fn_arith ARG...+# ------------------+# Perform arithmetic evaluation on the ARGs, and store the result in the+# global $as_val. Take advantage of shells that can avoid forks. The arguments+# must be portable across $(()) and expr.+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :+  eval 'as_fn_arith ()+  {+    as_val=$(( $* ))+  }'+else+  as_fn_arith ()+  {+    as_val=`expr "$@" || test $? -eq 1`+  }+fi # as_fn_arith+++if expr a : '\(a\)' >/dev/null 2>&1 &&+   test "X`expr 00001 : '.*\(...\)'`" = X001; then+  as_expr=expr+else+  as_expr=false+fi++if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then+  as_basename=basename+else+  as_basename=false+fi++if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then+  as_dirname=dirname+else+  as_dirname=false+fi++as_me=`$as_basename -- "$0" ||+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \+	 X"$0" : 'X\(//\)$' \| \+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X/"$0" |+    sed '/^.*\/\([^/][^/]*\)\/*$/{+	    s//\1/+	    q+	  }+	  /^X\/\(\/\/\)$/{+	    s//\1/+	    q+	  }+	  /^X\/\(\/\).*/{+	    s//\1/+	    q+	  }+	  s/.*/./; q'`++# Avoid depending upon Character Ranges.+as_cr_letters='abcdefghijklmnopqrstuvwxyz'+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'+as_cr_Letters=$as_cr_letters$as_cr_LETTERS+as_cr_digits='0123456789'+as_cr_alnum=$as_cr_Letters$as_cr_digits++ECHO_C= ECHO_N= ECHO_T=+case `echo -n x` in #(((((+-n*)+  case `echo 'xy\c'` in+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.+  xy)  ECHO_C='\c';;+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null+       ECHO_T='	';;+  esac;;+*)+  ECHO_N='-n';;+esac++rm -f conf$$ conf$$.exe conf$$.file+if test -d conf$$.dir; then+  rm -f conf$$.dir/conf$$.file+else+  rm -f conf$$.dir+  mkdir conf$$.dir 2>/dev/null+fi+if (echo >conf$$.file) 2>/dev/null; then+  if ln -s conf$$.file conf$$ 2>/dev/null; then+    as_ln_s='ln -s'+    # ... but there are two gotchas:+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.+    # In both cases, we have to default to `cp -p'.+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||+      as_ln_s='cp -p'+  elif ln conf$$.file conf$$ 2>/dev/null; then+    as_ln_s=ln+  else+    as_ln_s='cp -p'+  fi+else+  as_ln_s='cp -p'+fi+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file+rmdir conf$$.dir 2>/dev/null+++# as_fn_mkdir_p+# -------------+# Create "$as_dir" as a directory, including parents if necessary.+as_fn_mkdir_p ()+{++  case $as_dir in #(+  -*) as_dir=./$as_dir;;+  esac+  test -d "$as_dir" || eval $as_mkdir_p || {+    as_dirs=+    while :; do+      case $as_dir in #(+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(+      *) as_qdir=$as_dir;;+      esac+      as_dirs="'$as_qdir' $as_dirs"+      as_dir=`$as_dirname -- "$as_dir" ||+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+	 X"$as_dir" : 'X\(//\)[^/]' \| \+	 X"$as_dir" : 'X\(//\)$' \| \+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X"$as_dir" |+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)[^/].*/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\).*/{+	    s//\1/+	    q+	  }+	  s/.*/./; q'`+      test -d "$as_dir" && break+    done+    test -z "$as_dirs" || eval "mkdir $as_dirs"+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"+++} # as_fn_mkdir_p+if mkdir -p . 2>/dev/null; then+  as_mkdir_p='mkdir -p "$as_dir"'+else+  test -d ./-p && rmdir ./-p+  as_mkdir_p=false+fi++if test -x / >/dev/null 2>&1; then+  as_test_x='test -x'+else+  if ls -dL / >/dev/null 2>&1; then+    as_ls_L_option=L+  else+    as_ls_L_option=+  fi+  as_test_x='+    eval sh -c '\''+      if test -d "$1"; then+	test -d "$1/.";+      else+	case $1 in #(+	-*)set "./$1";;+	esac;+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((+	???[sx]*):;;*)false;;esac;fi+    '\'' sh+  '+fi+as_executable_p=$as_test_x++# Sed expression to map a string onto a valid CPP name.+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"++# Sed expression to map a string onto a valid variable name.+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"+++exec 6>&1+## ----------------------------------- ##+## Main body of $CONFIG_STATUS script. ##+## ----------------------------------- ##+_ASEOF+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+# Save the log message, to keep $0 and so on meaningful, and to+# report actual input values of CONFIG_FILES etc. instead of their+# values after options handling.+ac_log="+This file was extended by Haskell base package $as_me 1.0, which was+generated by GNU Autoconf 2.65.  Invocation command line was++  CONFIG_FILES    = $CONFIG_FILES+  CONFIG_HEADERS  = $CONFIG_HEADERS+  CONFIG_LINKS    = $CONFIG_LINKS+  CONFIG_COMMANDS = $CONFIG_COMMANDS+  $ $0 $@++on `(hostname || uname -n) 2>/dev/null | sed 1q`+"++_ACEOF++case $ac_config_files in *"+"*) set x $ac_config_files; shift; ac_config_files=$*;;+esac++case $ac_config_headers in *"+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;+esac+++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+# Files that config.status was made for.+config_files="$ac_config_files"+config_headers="$ac_config_headers"++_ACEOF++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+ac_cs_usage="\+\`$as_me' instantiates files and other configuration actions+from templates according to the current configuration.  Unless the files+and actions are specified as TAGs, all are instantiated by default.++Usage: $0 [OPTION]... [TAG]...++  -h, --help       print this help, then exit+  -V, --version    print version number and configuration settings, then exit+      --config     print configuration, then exit+  -q, --quiet, --silent+                   do not print progress messages+  -d, --debug      don't remove temporary files+      --recheck    update $as_me by reconfiguring in the same conditions+      --file=FILE[:TEMPLATE]+                   instantiate the configuration file FILE+      --header=FILE[:TEMPLATE]+                   instantiate the configuration header FILE++Configuration files:+$config_files++Configuration headers:+$config_headers++Report bugs to <libraries@haskell.org>."++_ACEOF+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"+ac_cs_version="\\+Haskell base package config.status 1.0+configured by $0, generated by GNU Autoconf 2.65,+  with options \\"\$ac_cs_config\\"++Copyright (C) 2009 Free Software Foundation, Inc.+This config.status script is free software; the Free Software Foundation+gives unlimited permission to copy, distribute and modify it."++ac_pwd='$ac_pwd'+srcdir='$srcdir'+test -n "\$AWK" || AWK=awk+_ACEOF++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+# The default lists apply if the user does not specify any file.+ac_need_defaults=:+while test $# != 0+do+  case $1 in+  --*=*)+    ac_option=`expr "X$1" : 'X\([^=]*\)='`+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`+    ac_shift=:+    ;;+  *)+    ac_option=$1+    ac_optarg=$2+    ac_shift=shift+    ;;+  esac++  case $ac_option in+  # Handling of the options.+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)+    ac_cs_recheck=: ;;+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )+    $as_echo "$ac_cs_version"; exit ;;+  --config | --confi | --conf | --con | --co | --c )+    $as_echo "$ac_cs_config"; exit ;;+  --debug | --debu | --deb | --de | --d | -d )+    debug=: ;;+  --file | --fil | --fi | --f )+    $ac_shift+    case $ac_optarg in+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;+    esac+    as_fn_append CONFIG_FILES " '$ac_optarg'"+    ac_need_defaults=false;;+  --header | --heade | --head | --hea )+    $ac_shift+    case $ac_optarg in+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;+    esac+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"+    ac_need_defaults=false;;+  --he | --h)+    # Conflict between --help and --header+    as_fn_error "ambiguous option: \`$1'+Try \`$0 --help' for more information.";;+  --help | --hel | -h )+    $as_echo "$ac_cs_usage"; exit ;;+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \+  | -silent | --silent | --silen | --sile | --sil | --si | --s)+    ac_cs_silent=: ;;++  # This is an error.+  -*) as_fn_error "unrecognized option: \`$1'+Try \`$0 --help' for more information." ;;++  *) as_fn_append ac_config_targets " $1"+     ac_need_defaults=false ;;++  esac+  shift+done++ac_configure_extra_args=++if $ac_cs_silent; then+  exec 6>/dev/null+  ac_configure_extra_args="$ac_configure_extra_args --silent"+fi++_ACEOF+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+if \$ac_cs_recheck; then+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion+  shift+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6+  CONFIG_SHELL='$SHELL'+  export CONFIG_SHELL+  exec "\$@"+fi++_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+exec 5>>config.log+{+  echo+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX+## Running $as_me. ##+_ASBOX+  $as_echo "$ac_log"+} >&5++_ACEOF+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+_ACEOF++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1++# Handling of arguments.+for ac_config_target in $ac_config_targets+do+  case $ac_config_target in+    "include/HsBaseConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/HsBaseConfig.h" ;;+    "include/EventConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/EventConfig.h" ;;+    "base.buildinfo") CONFIG_FILES="$CONFIG_FILES base.buildinfo" ;;++  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;+  esac+done+++# If the user did not use the arguments to specify the items to instantiate,+# then the envvar interface is used.  Set only those that are not.+# We use the long form for the default assignment because of an extremely+# bizarre bug on SunOS 4.1.3.+if $ac_need_defaults; then+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers+fi++# Have a temporary directory for convenience.  Make it in the build tree+# simply because there is no reason against having it here, and in addition,+# creating and moving files from /tmp can sometimes cause problems.+# Hook for its removal unless debugging.+# Note that there is a small window in which the directory will not be cleaned:+# after its creation but before its name has been assigned to `$tmp'.+$debug ||+{+  tmp=+  trap 'exit_status=$?+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status+' 0+  trap 'as_fn_exit 1' 1 2 13 15+}+# Create a (secure) tmp directory for tmp files.++{+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&+  test -n "$tmp" && test -d "$tmp"+}  ||+{+  tmp=./conf$$-$RANDOM+  (umask 077 && mkdir "$tmp")+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5++# Set up the scripts for CONFIG_FILES section.+# No need to generate them if there are no CONFIG_FILES.+# This happens for instance with `./config.status config.h'.+if test -n "$CONFIG_FILES"; then+++ac_cr=`echo X | tr X '\015'`+# On cygwin, bash can eat \r inside `` if the user requested igncr.+# But we know of no other shell where ac_cr would be empty at this+# point, so we can use a bashism as a fallback.+if test "x$ac_cr" = x; then+  eval ac_cr=\$\'\\r\'+fi+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then+  ac_cs_awk_cr='\r'+else+  ac_cs_awk_cr=$ac_cr+fi++echo 'BEGIN {' >"$tmp/subs1.awk" &&+_ACEOF+++{+  echo "cat >conf$$subs.awk <<_ACEOF" &&+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&+  echo "_ACEOF"+} >conf$$subs.sh ||+  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`+ac_delim='%!_!# '+for ac_last_try in false false false false false :; do+  . ./conf$$subs.sh ||+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5++  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`+  if test $ac_delim_n = $ac_delim_num; then+    break+  elif $ac_last_try; then+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5+  else+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "+  fi+done+rm -f conf$$subs.sh++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&+_ACEOF+sed -n '+h+s/^/S["/; s/!.*/"]=/+p+g+s/^[^!]*!//+:repl+t repl+s/'"$ac_delim"'$//+t delim+:nl+h+s/\(.\{148\}\)..*/\1/+t more1+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/+p+n+b repl+:more1+s/["\\]/\\&/g; s/^/"/; s/$/"\\/+p+g+s/.\{148\}//+t nl+:delim+h+s/\(.\{148\}\)..*/\1/+t more2+s/["\\]/\\&/g; s/^/"/; s/$/"/+p+b+:more2+s/["\\]/\\&/g; s/^/"/; s/$/"\\/+p+g+s/.\{148\}//+t delim+' <conf$$subs.awk | sed '+/^[^""]/{+  N+  s/\n//+}+' >>$CONFIG_STATUS || ac_write_fail=1+rm -f conf$$subs.awk+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+_ACAWK+cat >>"\$tmp/subs1.awk" <<_ACAWK &&+  for (key in S) S_is_set[key] = 1+  FS = ""++}+{+  line = $ 0+  nfields = split(line, field, "@")+  substed = 0+  len = length(field[1])+  for (i = 2; i < nfields; i++) {+    key = field[i]+    keylen = length(key)+    if (S_is_set[key]) {+      value = S[key]+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)+      len += length(value) + length(field[++i])+      substed = 1+    } else+      len += 1 + keylen+  }++  print line+}++_ACAWK+_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"+else+  cat+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \+  || as_fn_error "could not setup config files machinery" "$LINENO" 5+_ACEOF++# VPATH may cause trouble with some makes, so we remove $(srcdir),+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and+# trailing colons and then remove the whole line if VPATH becomes empty+# (actually we leave an empty line to preserve line numbers).+if test "x$srcdir" = x.; then+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{+s/:*\$(srcdir):*/:/+s/:*\${srcdir}:*/:/+s/:*@srcdir@:*/:/+s/^\([^=]*=[	 ]*\):*/\1/+s/:*$//+s/^[^=]*=[	 ]*$//+}'+fi++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+fi # test -n "$CONFIG_FILES"++# Set up the scripts for CONFIG_HEADERS section.+# No need to generate them if there are no CONFIG_HEADERS.+# This happens for instance with `./config.status Makefile'.+if test -n "$CONFIG_HEADERS"; then+cat >"$tmp/defines.awk" <<\_ACAWK ||+BEGIN {+_ACEOF++# Transform confdefs.h into an awk script `defines.awk', embedded as+# here-document in config.status, that substitutes the proper values into+# config.h.in to produce config.h.++# Create a delimiter string that does not exist in confdefs.h, to ease+# handling of long lines.+ac_delim='%!_!# '+for ac_last_try in false false :; do+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`+  if test -z "$ac_t"; then+    break+  elif $ac_last_try; then+    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5+  else+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "+  fi+done++# For the awk script, D is an array of macro values keyed by name,+# likewise P contains macro parameters if any.  Preserve backslash+# newline sequences.++ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*+sed -n '+s/.\{148\}/&'"$ac_delim"'/g+t rset+:rset+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /+t def+d+:def+s/\\$//+t bsnl+s/["\\]/\\&/g+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\+D["\1"]=" \3"/p+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p+d+:bsnl+s/["\\]/\\&/g+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\+D["\1"]=" \3\\\\\\n"\\/p+t cont+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p+t cont+d+:cont+n+s/.\{148\}/&'"$ac_delim"'/g+t clear+:clear+s/\\$//+t bsnlc+s/["\\]/\\&/g; s/^/"/; s/$/"/p+d+:bsnlc+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p+b cont+' <confdefs.h | sed '+s/'"$ac_delim"'/"\\\+"/g' >>$CONFIG_STATUS || ac_write_fail=1++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+  for (key in D) D_is_set[key] = 1+  FS = ""+}+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {+  line = \$ 0+  split(line, arg, " ")+  if (arg[1] == "#") {+    defundef = arg[2]+    mac1 = arg[3]+  } else {+    defundef = substr(arg[1], 2)+    mac1 = arg[2]+  }+  split(mac1, mac2, "(") #)+  macro = mac2[1]+  prefix = substr(line, 1, index(line, defundef) - 1)+  if (D_is_set[macro]) {+    # Preserve the white space surrounding the "#".+    print prefix "define", macro P[macro] D[macro]+    next+  } else {+    # Replace #undef with comments.  This is necessary, for example,+    # in the case of _POSIX_SOURCE, which is predefined and required+    # on some systems where configure will not decide to define it.+    if (defundef == "undef") {+      print "/*", prefix defundef, macro, "*/"+      next+    }+  }+}+{ print }+_ACAWK+_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+  as_fn_error "could not setup config headers machinery" "$LINENO" 5+fi # test -n "$CONFIG_HEADERS"+++eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    "+shift+for ac_tag+do+  case $ac_tag in+  :[FHLC]) ac_mode=$ac_tag; continue;;+  esac+  case $ac_mode$ac_tag in+  :[FHL]*:*);;+  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;+  :[FH]-) ac_tag=-:-;;+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;+  esac+  ac_save_IFS=$IFS+  IFS=:+  set x $ac_tag+  IFS=$ac_save_IFS+  shift+  ac_file=$1+  shift++  case $ac_mode in+  :L) ac_source=$1;;+  :[FH])+    ac_file_inputs=+    for ac_f+    do+      case $ac_f in+      -) ac_f="$tmp/stdin";;+      *) # Look for the file first in the build tree, then in the source tree+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,+	 # because $ac_f cannot contain `:'.+	 test -f "$ac_f" ||+	   case $ac_f in+	   [\\/$]*) false;;+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;+	   esac ||+	   as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;+      esac+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac+      as_fn_append ac_file_inputs " '$ac_f'"+    done++    # Let's still pretend it is `configure' which instantiates (i.e., don't+    # use $as_me), people would be surprised to read:+    #    /* config.h.  Generated by config.status.  */+    configure_input='Generated from '`+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'+	`' by configure.'+    if test x"$ac_file" != x-; then+      configure_input="$ac_file.  $configure_input"+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5+$as_echo "$as_me: creating $ac_file" >&6;}+    fi+    # Neutralize special characters interpreted by sed in replacement strings.+    case $configure_input in #(+    *\&* | *\|* | *\\* )+       ac_sed_conf_input=`$as_echo "$configure_input" |+       sed 's/[\\\\&|]/\\\\&/g'`;; #(+    *) ac_sed_conf_input=$configure_input;;+    esac++    case $ac_tag in+    *:-:* | *:-) cat >"$tmp/stdin" \+      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;+    esac+    ;;+  esac++  ac_dir=`$as_dirname -- "$ac_file" ||+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+	 X"$ac_file" : 'X\(//\)[^/]' \| \+	 X"$ac_file" : 'X\(//\)$' \| \+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||+$as_echo X"$ac_file" |+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)[^/].*/{+	    s//\1/+	    q+	  }+	  /^X\(\/\/\)$/{+	    s//\1/+	    q+	  }+	  /^X\(\/\).*/{+	    s//\1/+	    q+	  }+	  s/.*/./; q'`+  as_dir="$ac_dir"; as_fn_mkdir_p+  ac_builddir=.++case "$ac_dir" in+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;+*)+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`+  # A ".." for each directory in $ac_dir_suffix.+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`+  case $ac_top_builddir_sub in+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;+  esac ;;+esac+ac_abs_top_builddir=$ac_pwd+ac_abs_builddir=$ac_pwd$ac_dir_suffix+# for backward compatibility:+ac_top_builddir=$ac_top_build_prefix++case $srcdir in+  .)  # We are building in place.+    ac_srcdir=.+    ac_top_srcdir=$ac_top_builddir_sub+    ac_abs_top_srcdir=$ac_pwd ;;+  [\\/]* | ?:[\\/]* )  # Absolute name.+    ac_srcdir=$srcdir$ac_dir_suffix;+    ac_top_srcdir=$srcdir+    ac_abs_top_srcdir=$srcdir ;;+  *) # Relative name.+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix+    ac_top_srcdir=$ac_top_build_prefix$srcdir+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;+esac+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix+++  case $ac_mode in+  :F)+  #+  # CONFIG_FILE+  #++_ACEOF++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+# If the template does not know about datarootdir, expand it.+# FIXME: This hack should be removed a few years after 2.60.+ac_datarootdir_hack=; ac_datarootdir_seen=+ac_sed_dataroot='+/datarootdir/ {+  p+  q+}+/@datadir@/p+/@docdir@/p+/@infodir@/p+/@localedir@/p+/@mandir@/p'+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in+*datarootdir*) ac_datarootdir_seen=yes;;+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}+_ACEOF+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+  ac_datarootdir_hack='+  s&@datadir@&$datadir&g+  s&@docdir@&$docdir&g+  s&@infodir@&$infodir&g+  s&@localedir@&$localedir&g+  s&@mandir@&$mandir&g+  s&\\\${datarootdir}&$datarootdir&g' ;;+esac+_ACEOF++# Neutralize VPATH when `$srcdir' = `.'.+# Shell code in configure.ac might set extrasub.+# FIXME: do we really want to maintain this feature?+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1+ac_sed_extra="$ac_vpsub+$extrasub+_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1+:t+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b+s|@configure_input@|$ac_sed_conf_input|;t t+s&@top_builddir@&$ac_top_builddir_sub&;t t+s&@top_build_prefix@&$ac_top_build_prefix&;t t+s&@srcdir@&$ac_srcdir&;t t+s&@abs_srcdir@&$ac_abs_srcdir&;t t+s&@top_srcdir@&$ac_top_srcdir&;t t+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t+s&@builddir@&$ac_builddir&;t t+s&@abs_builddir@&$ac_abs_builddir&;t t+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t+$ac_datarootdir_hack+"+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \+  || as_fn_error "could not create $ac_file" "$LINENO" 5++test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'+which seems to be undefined.  Please make sure it is defined." >&5+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'+which seems to be undefined.  Please make sure it is defined." >&2;}++  rm -f "$tmp/stdin"+  case $ac_file in+  -) cat "$tmp/out" && rm -f "$tmp/out";;+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;+  esac \+  || as_fn_error "could not create $ac_file" "$LINENO" 5+ ;;+  :H)+  #+  # CONFIG_HEADER+  #+  if test x"$ac_file" != x-; then+    {+      $as_echo "/* $configure_input  */" \+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"+    } >"$tmp/config.h" \+      || as_fn_error "could not create $ac_file" "$LINENO" 5+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5+$as_echo "$as_me: $ac_file is unchanged" >&6;}+    else+      rm -f "$ac_file"+      mv "$tmp/config.h" "$ac_file" \+	|| as_fn_error "could not create $ac_file" "$LINENO" 5+    fi+  else+    $as_echo "/* $configure_input  */" \+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \+      || as_fn_error "could not create -" "$LINENO" 5+  fi+ ;;+++  esac++done # for ac_tag+++as_fn_exit 0+_ACEOF+ac_clean_files=$ac_clean_files_save++test $ac_write_fail = 0 ||+  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5+++# configure is writing to config.log, and then calls config.status.+# config.status does its own redirection, appending to config.log.+# Unfortunately, on DOS this fails, as config.log is still kept open+# by configure, so config.status won't be able to write to it; its+# output is simply discarded.  So we exec the FD to /dev/null,+# effectively closing config.log, so it can be properly (re)opened and+# appended to by config.status.  When coming back to configure, we+# need to make the FD available again.+if test "$no_create" != yes; then+  ac_cs_success=:+  ac_config_status_args=+  test "$silent" = yes &&+    ac_config_status_args="$ac_config_status_args --quiet"+  exec 5>/dev/null+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false+  exec 5>>config.log+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which+  # would make configure fail if this is the last instruction.+  $ac_cs_success || as_fn_exit $?+fi+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi 
configure.ac view
@@ -3,7 +3,7 @@ # Safety check: Ensure that we are in the correct source directory. AC_CONFIG_SRCDIR([include/HsBase.h]) -AC_CONFIG_HEADERS([include/HsBaseConfig.h])+AC_CONFIG_HEADERS([include/HsBaseConfig.h include/EventConfig.h])  AC_ARG_WITH([cc],             [C compiler],@@ -17,7 +17,7 @@ AC_HEADER_STDC  # check for specific header (.h) files that we are interested in-AC_CHECK_HEADERS([ctype.h errno.h fcntl.h inttypes.h limits.h signal.h sys/resource.h sys/select.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/wait.h termios.h time.h unistd.h utime.h windows.h winsock.h langinfo.h])+AC_CHECK_HEADERS([ctype.h errno.h fcntl.h inttypes.h limits.h signal.h sys/resource.h sys/select.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/wait.h termios.h time.h unistd.h utime.h windows.h winsock.h langinfo.h poll.h sys/epoll.h sys/event.h sys/eventfd.h])  # Enable large file support. Do this before testing the types ino_t, off_t, and # rlim_t, because it will affect the result of that test.@@ -32,6 +32,22 @@ AC_CHECK_FUNCS([getclock getrusage times]) AC_CHECK_FUNCS([_chsize ftruncate]) +AC_CHECK_FUNCS([epoll_create1 epoll_ctl eventfd kevent kevent64 kqueue poll])++# event-related fun++if test "$ac_cv_header_sys_epoll_h" = yes -a "$ac_cv_func_epoll_ctl" = yes; then+  AC_DEFINE([HAVE_EPOLL], [1], [Define if you have epoll support.])+fi++if test "$ac_cv_header_sys_event_h" = yes -a "$ac_cv_func_kqueue" = yes; then+  AC_DEFINE([HAVE_KQUEUE], [1], [Define if you have kqueue support.])+fi++if test "$ac_cv_header_poll_h" = yes -a "$ac_cv_func_poll" = yes; then+  AC_DEFINE([HAVE_POLL], [1], [Define if you have poll support.])+fi+ dnl-------------------------------------------------------------------- dnl * Deal with arguments telling us iconv is somewhere odd dnl--------------------------------------------------------------------@@ -135,6 +151,17 @@                         *)                              AC_MSG_ERROR([iconv is required on non-Windows platforms]);;                       esac])++# If possible, we use libcharset instead of nl_langinfo(CODESET) to+# determine the current locale's character encoding.+FP_SEARCH_LIBS_PROTO(+    [locale_charset],+    [#include <libcharset.h>],+    [const char* charset = locale_charset();],+    [charset],+    [AC_DEFINE([HAVE_LIBCHARSET], [1], [Define to 1 if you have libcharset.])+     EXTRA_LIBS="$EXTRA_LIBS $ac_lib"])+  AC_SUBST(EXTRA_LIBS) AC_CONFIG_FILES([base.buildinfo])
+ include/EventConfig.h view
@@ -0,0 +1,86 @@+/* include/EventConfig.h.  Generated from EventConfig.h.in by configure.  */+/* include/EventConfig.h.in.  Generated from configure.ac by autoheader.  */++/* Define if you have epoll support. */+#define HAVE_EPOLL 1++/* Define to 1 if you have the `epoll_create1' function. */+#define HAVE_EPOLL_CREATE1 1++/* Define to 1 if you have the `epoll_ctl' function. */+#define HAVE_EPOLL_CTL 1++/* Define to 1 if you have the `eventfd' function. */+#define HAVE_EVENTFD 1++/* Define to 1 if you have the <inttypes.h> header file. */+#define HAVE_INTTYPES_H 1++/* Define to 1 if you have the `kevent' function. */+/* #undef HAVE_KEVENT */++/* Define to 1 if you have the `kevent64' function. */+/* #undef HAVE_KEVENT64 */++/* Define if you have kqueue support. */+/* #undef HAVE_KQUEUE */++/* Define to 1 if you have the <memory.h> header file. */+#define HAVE_MEMORY_H 1++/* Define if you have poll support. */+#define HAVE_POLL 1++/* Define to 1 if you have the <poll.h> header file. */+#define HAVE_POLL_H 1++/* Define to 1 if you have the <signal.h> header file. */+#define HAVE_SIGNAL_H 1++/* Define to 1 if you have the <stdint.h> header file. */+#define HAVE_STDINT_H 1++/* Define to 1 if you have the <stdlib.h> header file. */+#define HAVE_STDLIB_H 1++/* Define to 1 if you have the <strings.h> header file. */+#define HAVE_STRINGS_H 1++/* Define to 1 if you have the <string.h> header file. */+#define HAVE_STRING_H 1++/* Define to 1 if you have the <sys/epoll.h> header file. */+#define HAVE_SYS_EPOLL_H 1++/* Define to 1 if you have the <sys/eventfd.h> header file. */+#define HAVE_SYS_EVENTFD_H 1++/* Define to 1 if you have the <sys/event.h> header file. */+/* #undef HAVE_SYS_EVENT_H */++/* Define to 1 if you have the <sys/stat.h> header file. */+#define HAVE_SYS_STAT_H 1++/* Define to 1 if you have the <sys/types.h> header file. */+#define HAVE_SYS_TYPES_H 1++/* Define to 1 if you have the <unistd.h> header file. */+#define HAVE_UNISTD_H 1++/* Define to the address where bug reports for this package should be sent. */+#define PACKAGE_BUGREPORT "libraries@haskell.org"++/* Define to the full name of this package. */+#define PACKAGE_NAME "Haskell base package"++/* Define to the full name and version of this package. */+#define PACKAGE_STRING "Haskell base package 1.0"++/* Define to the one symbol short name of this package. */+#define PACKAGE_TARNAME "base"++/* Define to the version of this package. */+#define PACKAGE_VERSION "1.0"++/* Define to 1 if you have the ANSI C header files. */+#define STDC_HEADERS 1
include/HsBaseConfig.h view
@@ -307,9 +307,21 @@ /* Define to 1 if you have the <ctype.h> header file. */ #define HAVE_CTYPE_H 1 +/* Define if you have epoll support. */+#define HAVE_EPOLL 1++/* Define to 1 if you have the `epoll_create1' function. */+#define HAVE_EPOLL_CREATE1 1++/* Define to 1 if you have the `epoll_ctl' function. */+#define HAVE_EPOLL_CTL 1+ /* Define to 1 if you have the <errno.h> header file. */ #define HAVE_ERRNO_H 1 +/* Define to 1 if you have the `eventfd' function. */+#define HAVE_EVENTFD 1+ /* Define to 1 if you have the <fcntl.h> header file. */ #define HAVE_FCNTL_H 1 @@ -328,9 +340,21 @@ /* Define to 1 if you have the `iswspace' function. */ #define HAVE_ISWSPACE 1 +/* Define to 1 if you have the `kevent' function. */+/* #undef HAVE_KEVENT */++/* Define to 1 if you have the `kevent64' function. */+/* #undef HAVE_KEVENT64 */++/* Define if you have kqueue support. */+/* #undef HAVE_KQUEUE */+ /* Define to 1 if you have the <langinfo.h> header file. */ #define HAVE_LANGINFO_H 1 +/* Define to 1 if you have libcharset. */+/* #undef HAVE_LIBCHARSET */+ /* Define to 1 if you have the <limits.h> header file. */ #define HAVE_LIMITS_H 1 @@ -343,6 +367,12 @@ /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 +/* Define if you have poll support. */+#define HAVE_POLL 1++/* Define to 1 if you have the <poll.h> header file. */+#define HAVE_POLL_H 1+ /* Define to 1 if you have the <signal.h> header file. */ #define HAVE_SIGNAL_H 1 @@ -358,6 +388,15 @@ /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the <sys/epoll.h> header file. */+#define HAVE_SYS_EPOLL_H 1++/* Define to 1 if you have the <sys/eventfd.h> header file. */+#define HAVE_SYS_EVENTFD_H 1++/* Define to 1 if you have the <sys/event.h> header file. */+/* #undef HAVE_SYS_EVENT_H */+ /* Define to 1 if you have the <sys/resource.h> header file. */ #define HAVE_SYS_RESOURCE_H 1 @@ -425,7 +464,7 @@ #define HTYPE_CHAR Int8  /* Define to Haskell type for clock_t */-#define HTYPE_CLOCK_T Int64+#define HTYPE_CLOCK_T Int32  /* Define to Haskell type for dev_t */ #define HTYPE_DEV_T Word64@@ -449,10 +488,10 @@ #define HTYPE_INTMAX_T Int64  /* Define to Haskell type for intptr_t */-#define HTYPE_INTPTR_T Int64+#define HTYPE_INTPTR_T Int32  /* Define to Haskell type for long */-#define HTYPE_LONG Int64+#define HTYPE_LONG Int32  /* Define to Haskell type for long long */ #define HTYPE_LONG_LONG Int64@@ -461,7 +500,7 @@ #define HTYPE_MODE_T Word32  /* Define to Haskell type for nlink_t */-#define HTYPE_NLINK_T Word64+#define HTYPE_NLINK_T Word32  /* Define to Haskell type for off_t */ #define HTYPE_OFF_T Int64@@ -470,7 +509,7 @@ #define HTYPE_PID_T Int32  /* Define to Haskell type for ptrdiff_t */-#define HTYPE_PTRDIFF_T Int64+#define HTYPE_PTRDIFF_T Int32  /* Define to Haskell type for rlim_t */ #define HTYPE_RLIM_T Word64@@ -485,19 +524,19 @@ #define HTYPE_SIG_ATOMIC_T Int32  /* Define to Haskell type for size_t */-#define HTYPE_SIZE_T Word64+#define HTYPE_SIZE_T Word32  /* Define to Haskell type for speed_t */ #define HTYPE_SPEED_T Word32  /* Define to Haskell type for ssize_t */-#define HTYPE_SSIZE_T Int64+#define HTYPE_SSIZE_T Int32  /* Define to Haskell type for tcflag_t */ #define HTYPE_TCFLAG_T Word32  /* Define to Haskell type for time_t */-#define HTYPE_TIME_T Int64+#define HTYPE_TIME_T Int32  /* Define to Haskell type for uid_t */ #define HTYPE_UID_T Word32@@ -506,7 +545,7 @@ #define HTYPE_UINTMAX_T Word64  /* Define to Haskell type for uintptr_t */-#define HTYPE_UINTPTR_T Word64+#define HTYPE_UINTPTR_T Word32  /* Define to Haskell type for unsigned char */ #define HTYPE_UNSIGNED_CHAR Word8@@ -515,7 +554,7 @@ #define HTYPE_UNSIGNED_INT Word32  /* Define to Haskell type for unsigned long */-#define HTYPE_UNSIGNED_LONG Word64+#define HTYPE_UNSIGNED_LONG Word32  /* Define to Haskell type for unsigned long long */ #define HTYPE_UNSIGNED_LONG_LONG Word64@@ -541,6 +580,9 @@ /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "base" +/* Define to the home page for this package. */+#define PACKAGE_URL ""+ /* Define to the version of this package. */ #define PACKAGE_VERSION "1.0" @@ -548,7 +590,7 @@ #define STDC_HEADERS 1  /* Number of bits in a file offset, on hosts where this is settable. */-/* #undef _FILE_OFFSET_BITS */+#define _FILE_OFFSET_BITS 64  /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */
include/consUtils.h view
@@ -5,6 +5,7 @@  */ #ifndef __CONSUTILS_H__ #define __CONSUTILS_H__+extern int is_console__(int fd); extern int set_console_buffering__(int fd, int cooked); extern int set_console_echo__(int fd, int on); extern int get_console_echo__(int fd);