first experimental MSYS (no cygwin) support
This commit is contained in:
parent
df6e070281
commit
7aefa55fde
19
configure.ac
19
configure.ac
@ -12,16 +12,21 @@ AC_PREREQ(2.53)
|
||||
# Find out what type of system we're running on
|
||||
AC_CANONICAL_BUILD
|
||||
|
||||
# This isn't right for cygwin.
|
||||
Platform="$build_cpu-$build_vendor-$build_os"
|
||||
|
||||
# This isn't right for msys mingw.
|
||||
PREFIX="$prefix"
|
||||
if test "$prefix" = "NONE"
|
||||
then
|
||||
if test "$build_os" = "cygwin"
|
||||
then
|
||||
PREFIX="c:/cygwin$ac_default_prefix"
|
||||
else
|
||||
PREFIX="$ac_default_prefix"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(PREFIX)
|
||||
|
||||
Platform="$build_cpu-$build_vendor-$build_os"
|
||||
|
||||
case $Platform in
|
||||
powerpc-apple-darwin*)
|
||||
MACOSX=yes
|
||||
@ -42,6 +47,14 @@ fi
|
||||
AC_SUBST(WHOLE_ARCHIVE_FLAG)
|
||||
AC_SUBST(LEADING_UNDERSCORE)
|
||||
|
||||
if test "$build_os" = "mingw32"
|
||||
then
|
||||
LEADING_UNDERSCORE=1
|
||||
SYMS="$SYMS -D__MINGW32__"
|
||||
fi
|
||||
AC_SUBST(LEADING_UNDERSCORE)
|
||||
AC_SUBST(SYMS)
|
||||
|
||||
if test "$build_os" = "cygwin"
|
||||
then
|
||||
LEADING_UNDERSCORE=1
|
||||
|
@ -1,4 +1,4 @@
|
||||
{-# GLOBALOPTIONS -package posix #-}
|
||||
{-# GLOBALOPTIONS -package mtl #-}
|
||||
|
||||
module M ( resource ) where
|
||||
|
||||
|
@ -57,7 +57,7 @@ import Data.List ( isPrefixOf, nub )
|
||||
|
||||
import System.IO.Unsafe ( unsafePerformIO )
|
||||
import System.Directory ( doesFileExist )
|
||||
#ifdef CYGWIN
|
||||
#if defined(CYGWIN) || defined(__MINGW32__)
|
||||
import System.Environment ( getEnv )
|
||||
|
||||
import Control.Monad ( liftM )
|
||||
@ -310,7 +310,7 @@ lookupPkg' p = withPkgEnvs env $ \fms -> go fms p
|
||||
Nothing -> go fms q -- look in other pkgs
|
||||
|
||||
Just package -> do
|
||||
#ifdef CYGWIN
|
||||
#if defined(CYGWIN) || defined(__MINGW32__)
|
||||
let libdirs = fix_topdir $ libraryDirs package
|
||||
#else
|
||||
let libdirs = libraryDirs package
|
||||
@ -319,7 +319,7 @@ lookupPkg' p = withPkgEnvs env $ \fms -> go fms p
|
||||
extras = extraLibraries package
|
||||
deppkgs = packageDeps package
|
||||
libs <- mapM (findHSlib libdirs) (hslibs ++ extras)
|
||||
#ifdef CYGWIN
|
||||
#if defined(CYGWIN) || defined(__MINGW32__)
|
||||
syslibdir <- liftM ( \x -> x ++ "/SYSTEM") (getEnv "SYSTEMROOT")
|
||||
libs' <- mapM (findDLL $ syslibdir : libdirs) extras
|
||||
#else
|
||||
@ -330,7 +330,7 @@ lookupPkg' p = withPkgEnvs env $ \fms -> go fms p
|
||||
-- anything about that.
|
||||
return (deppkgs, (filterJust libs,filterJust libs') )
|
||||
|
||||
#ifdef CYGWIN
|
||||
#if defined(CYGWIN) || defined(__MINGW32__)
|
||||
-- replace $topdir
|
||||
fix_topdir [] = []
|
||||
fix_topdir (x:xs) = replace_topdir x : fix_topdir xs
|
||||
|
@ -42,7 +42,11 @@ import Control.Monad ( liftM )
|
||||
import Control.Exception ( handleJust )
|
||||
import System.Directory ( doesDirectoryExist, doesFileExist, createDirectory )
|
||||
import System.IO
|
||||
#ifndef __MINGW32__
|
||||
import System.IO.Error ( isAlreadyExistsError )
|
||||
#else
|
||||
import System.IO.Error ( isAlreadyExistsError, isAlreadyInUseError, isPermissionError )
|
||||
#endif
|
||||
|
||||
import GHC.IOBase ( IOException(IOError),
|
||||
Exception(IOException),
|
||||
|
Loading…
x
Reference in New Issue
Block a user