From: panne Date: Sun, 15 Feb 2004 12:20:27 +0000 (+0000) Subject: [project @ 2004-02-15 12:20:26 by panne] X-Git-Tag: Approx_11550_changesets_converted~85 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;ds=sidebyside;h=f04449358ab25d8dbf606b0dc8ba9266a03f7f92;p=ghc-hetmet.git [project @ 2004-02-15 12:20:26 by panne] I'm giving up here: The various quoting-related changes in rawSystem & friends make it impossible to pass $(exeext) with double quotes via cpp to Main.hs in a backwards-compatible way, so we revert to a cruel hack here. >:-( Improvements are highly welcome... --- diff --git a/ghc/utils/hsc2hs/Main.hs b/ghc/utils/hsc2hs/Main.hs index bf77f9d..8e758b6 100644 --- a/ghc/utils/hsc2hs/Main.hs +++ b/ghc/utils/hsc2hs/Main.hs @@ -1,7 +1,7 @@ {-# OPTIONS -fffi #-} ------------------------------------------------------------------------ --- $Id: Main.hs,v 1.52 2004/02/09 17:23:20 ross Exp $ +-- $Id: Main.hs,v 1.53 2004/02/15 12:20:26 panne Exp $ -- -- Program for converting .hsc files to .hs files, by converting the -- file into a C program which is run to generate the Haskell source. @@ -494,7 +494,12 @@ output flags name toks = do let cProgName = outDir++outBase++"_hsc_make.c" oProgName = outDir++outBase++"_hsc_make.o" - progName = outDir++outBase++"_hsc_make" ++ EXEEXT + progName = outDir++outBase++"_hsc_make" +#if defined(mingw32_HOST_OS) +-- This is a real hack, but the quoting mechanism used for calling the C preprocesseor +-- via GHC has changed a few times, so this seems to be the only way... :-P * * * + ++ ".exe" +#endif outHFile = outBase++"_hsc.h" outHName = outDir++outHFile outCName = outDir++outBase++"_hsc.c" diff --git a/ghc/utils/hsc2hs/Makefile b/ghc/utils/hsc2hs/Makefile index aaf71b4..8ccde7f 100644 --- a/ghc/utils/hsc2hs/Makefile +++ b/ghc/utils/hsc2hs/Makefile @@ -1,6 +1,6 @@ # ----------------------------------------------------------------------------- # To compile with nhc98 on unix: -# nhc98 -cpp -DEXEEXT="\"\"" -package base -o hsc2hs-bin Main.hs +# nhc98 -cpp -package base -o hsc2hs-bin Main.hs TOP=../.. include $(TOP)/mk/boilerplate.mk @@ -24,7 +24,10 @@ ifeq "$(ghc_ge_504)" "NO" SRC_HC_OPTS += -package util endif -SRC_HC_OPTS += -Wall -cpp '-DEXEEXT="$(exeext)"' +# Note: Somehow we should pass $(exeext) here, but the history of changes used +# for calling the C preprocessor via GHC has changed a few times, making a +# clean solution impossible. So we revert to a hack in Main.hs... +SRC_HC_OPTS += -Wall -cpp ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32" SRC_HC_OPTS += -Dmingw32_HOST_OS=1 endif