Commit 58e156a6 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Merge branch 'master' of http://darcs.haskell.org/ghc

parents 90a8c94e e9bc0dde
......@@ -78,6 +78,58 @@ AC_DEFUN([FPTOOLS_SET_PLATFORM_VARS],
GHC_CONVERT_VENDOR([$target_vendor], [TargetVendor])
GHC_CONVERT_OS([$target_os], [TargetOS])
fi
windows=NO
exeext=''
soext='.so'
case $host in
*-unknown-cygwin32)
AC_MSG_WARN([GHC does not support the Cygwin target at the moment])
AC_MSG_WARN([I'm assuming you wanted to build for i386-unknown-mingw32])
exit 1
;;
*-unknown-mingw32)
windows=YES
exeext='.exe'
soext='.dll'
;;
i386-apple-darwin|powerpc-apple-darwin)
soext='.dylib'
;;
x86_64-apple-darwin)
soext='.dylib'
;;
esac
])
# FP_SETTINGS
# ----------------------------------
# Set the variables used in the settings file
AC_DEFUN([FP_SETTINGS],
[
if test "$windows" = YES
then
SettingsCCompilerCommand='$topdir/../mingw/bin/gcc.exe'
SettingsCCompilerFlags=''
SettingsPerlCommand='$topdir/../perl/perl.exe'
SettingsDllWrapCommand='$topdir/../mingw/bin/dllwrap.exe'
SettingsWindresCommand='$topdir/../mingw/bin/windres.exe'
SettingsTouchCommand='$topdir/touch.exe'
else
SettingsCCompilerCommand="$WhatGccIsCalled"
SettingsCCompilerFlags="$CONF_CC_OPTS_STAGE2"
SettingsPerlCommand="$PerlCmd"
SettingsDllWrapCommand="/bin/false"
SettingsWindresCommand="/bin/false"
SettingsTouchCommand='touch'
fi
AC_SUBST(SettingsCCompilerCommand)
AC_SUBST(SettingsCCompilerFlags)
AC_SUBST(SettingsPerlCommand)
AC_SUBST(SettingsDllWrapCommand)
AC_SUBST(SettingsWindresCommand)
AC_SUBST(SettingsTouchCommand)
])
......
......@@ -24,6 +24,7 @@ module CmmOpt (
#include "HsVersions.h"
import OldCmm
import CmmNode (wrapRecExp)
import CmmUtils
import CLabel
import StaticFlags
......@@ -180,8 +181,7 @@ cmmMiniInlineStmts uses (stmt@(CmmAssign (CmmLocal (LocalReg u _)) expr) : stmts
-- used (foldable to literal): try to inline at all the use sites
| Just n <- lookupUFM uses u,
CmmMachOp op es <- expr,
e@(CmmLit _) <- cmmMachOpFold op es
e@(CmmLit _) <- wrapRecExp foldExp expr
=
#ifdef NCG_DEBUG
trace ("nativeGen: inlining " ++ showSDoc (pprStmt stmt)) $
......@@ -200,6 +200,9 @@ cmmMiniInlineStmts uses (stmt@(CmmAssign (CmmLocal (LocalReg u _)) expr) : stmts
trace ("nativeGen: inlining " ++ showSDoc (pprStmt stmt)) $
#endif
cmmMiniInlineStmts uses stmts'
where
foldExp (CmmMachOp op args) = cmmMachOpFold op args
foldExp e = e
cmmMiniInlineStmts uses (stmt:stmts)
= stmt : cmmMiniInlineStmts uses stmts
......
......@@ -94,8 +94,6 @@ compiler/stage%/build/Config.hs : mk/config.mk mk/project.mk | $$(dir $$@)/.
@echo 'cLeadingUnderscore = "$(LeadingUnderscore)"' >> $@
@echo 'cRAWCPP_FLAGS :: String' >> $@
@echo 'cRAWCPP_FLAGS = "$(RAWCPP_FLAGS)"' >> $@
@echo 'cMKDLL :: String' >> $@
@echo 'cMKDLL = "$(BLD_DLL)"' >> $@
@echo 'cLdIsGNULd :: String' >> $@
@echo 'cLdIsGNULd = "$(LdIsGNULd)"' >> $@
@echo 'cLdHasBuildId :: String' >> $@
......
......@@ -162,8 +162,6 @@ initSysTools mbMinusB
; let settingsFile = top_dir </> "settings"
installed :: FilePath -> FilePath
installed file = top_dir </> file
installed_mingw_bin file = top_dir </> ".." </> "mingw" </> "bin" </> file
installed_perl_bin file = top_dir </> ".." </> "perl" </> file
; settingsStr <- readFile settingsFile
; mySettings <- case maybeReadFuzzy settingsStr of
......@@ -173,7 +171,14 @@ initSysTools mbMinusB
pgmError ("Can't parse " ++ show settingsFile)
; let getSetting key = case lookup key mySettings of
Just xs ->
return xs
return $ case stripPrefix "$topdir" xs of
Just [] ->
top_dir
Just xs'@(c:_)
| isPathSeparator c ->
top_dir ++ xs'
_ ->
xs
Nothing -> pgmError ("No entry for " ++ show key ++ " in " ++ show settingsFile)
; myExtraGccViaCFlags <- getSetting "GCC extra via C opts"
-- On Windows, mingw is distributed with GHC,
......@@ -181,14 +186,10 @@ initSysTools mbMinusB
-- It would perhaps be nice to be able to override this
-- with the settings file, but it would be a little fiddly
-- to make that possible, so for now you can't.
; gcc_prog <- if isWindowsHost then return $ installed_mingw_bin "gcc"
else getSetting "C compiler command"
; gcc_args_str <- if isWindowsHost then return []
else getSetting "C compiler flags"
; gcc_prog <- getSetting "C compiler command"
; gcc_args_str <- getSetting "C compiler flags"
; let gcc_args = map Option (words gcc_args_str)
; perl_path <- if isWindowsHost
then return $ installed_perl_bin "perl"
else getSetting "perl command"
; perl_path <- getSetting "perl command"
; let pkgconfig_path = installed "package.conf.d"
ghc_usage_msg_path = installed "ghc-usage.txt"
......@@ -201,16 +202,13 @@ initSysTools mbMinusB
-- split is a Perl script
split_script = installed cGHC_SPLIT_PGM
windres_path = installed_mingw_bin "windres"
; windres_path <- getSetting "windres command"
; tmpdir <- getTemporaryDirectory
; let
-- 'touch' is a GHC util for Windows
touch_path
| isWindowsHost = installed cGHC_TOUCHY_PGM
| otherwise = "touch"
-- On Win32 we don't want to rely on #!/bin/perl, so we prepend
; touch_path <- getSetting "touch command"
; let -- On Win32 we don't want to rely on #!/bin/perl, so we prepend
-- a call to Perl to get the invocation of split.
-- On Unix, scripts are invoked using the '#!' method. Binary
-- installations of GHC on Unix place the correct line on the
......@@ -219,11 +217,8 @@ initSysTools mbMinusB
(split_prog, split_args)
| isWindowsHost = (perl_path, [Option split_script])
| otherwise = (split_script, [])
(mkdll_prog, mkdll_args)
| not isWindowsHost
= panic "Can't build DLLs on a non-Win32 system"
| otherwise =
(installed_mingw_bin cMKDLL, [])
; mkdll_prog <- getSetting "dllwrap command"
; let mkdll_args = []
-- cpp is derived from gcc on all platforms
-- HACK, see setPgmP below. We keep 'words' here to remember to fix
......
......@@ -207,26 +207,6 @@ AC_CANONICAL_TARGET
FPTOOLS_SET_PLATFORM_VARS
exeext=''
soext='.so'
case $host in
*-unknown-cygwin32)
AC_MSG_WARN([GHC does not support the Cygwin target at the moment])
AC_MSG_WARN([I'm assuming you wanted to build for i386-unknown-mingw32])
exit 1
;;
*-unknown-mingw32)
exeext='.exe'
soext='.dll'
;;
i386-apple-darwin|powerpc-apple-darwin)
soext='.dylib'
;;
x86_64-apple-darwin)
soext='.dylib'
;;
esac
# Testing if we shall enable shared libs support on Solaris.
# Anything older than SunOS 5.11 aka Solaris 11 (Express) is broken.
......@@ -570,6 +550,8 @@ AC_SUBST(CONF_CPP_OPTS_STAGE0)
AC_SUBST(CONF_CPP_OPTS_STAGE1)
AC_SUBST(CONF_CPP_OPTS_STAGE2)
FP_SETTINGS
dnl ** figure out how to do context diffs
FP_PROG_CONTEXT_DIFF
......
......@@ -82,6 +82,8 @@ AC_SUBST(CONF_CPP_OPTS_STAGE0)
AC_SUBST(CONF_CPP_OPTS_STAGE1)
AC_SUBST(CONF_CPP_OPTS_STAGE2)
FP_SETTINGS
#
dnl ** how to invoke `ar' and `ranlib'
#
......
......@@ -417,9 +417,6 @@ SRC_HC_OPTS += -H32m -O
# These flags make flex 8-bit
SRC_FLEX_OPTS += -8
# Default fptools options for dllwrap.
SRC_BLD_DLL_OPTS += --target=i386-mingw32
# Flags for CPP when running GreenCard on .pgc files
GC_CPP_OPTS += -P -E -x c -traditional -D__GLASGOW_HASKELL__
......@@ -742,8 +739,6 @@ XSLTPROC_LABEL_OPTS = --stringparam toc.section.depth 3 \
#-----------------------------------------------------------------------------
# FPtools support software
BLD_DLL = dllwrap
#
# ghc-pkg
#
......
[("GCC extra via C opts", "@GccExtraViaCOpts@"),
("C compiler command", "@WhatGccIsCalled@"),
("C compiler flags", "@CONF_CC_OPTS_STAGE2@"),
("C compiler command", "@SettingsCCompilerCommand@"),
("C compiler flags", "@SettingsCCompilerFlags@"),
("ar command", "@ArCmd@"),
("ar flags", "@ArArgs@"),
("ar supports at file", "@ArSupportsAtFile@"),
("perl command", "@PerlCmd@")]
("touch command", "@SettingsTouchCommand@"),
("dllwrap command", "@SettingsDllWrapCommand@"),
("windres command", "@SettingsWindresCommand@"),
("perl command", "@SettingsPerlCommand@")]
......@@ -368,6 +368,7 @@ sub scmall {
}
elsif ($command =~ /^remote$/) {
my @scm_args;
$ignore_failure = 1;
if ($subcommand eq 'add') {
@scm_args = ("remote", "add", $branch_name, $path);
} elsif ($subcommand eq 'rm') {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment