Fix hsc2hs finding its template file on Windows
authorIan Lynagh <igloo@earth.li>
Sat, 5 Jul 2008 18:58:29 +0000 (18:58 +0000)
committerIan Lynagh <igloo@earth.li>
Sat, 5 Jul 2008 18:58:29 +0000 (18:58 +0000)
mk/cabal-flags.mk
utils/hsc2hs/Main.hs
utils/hsc2hs/Makefile
utils/hsc2hs/hsc2hs.cabal

index 1d63e1a..7a9f9f0 100644 (file)
@@ -53,6 +53,7 @@ INPLACE_CONFIGURE_FLAGS = \
     --prefix=`$(TOP)/utils/pwd/pwd forwardslash`/install-inplace \
     --with-compiler=$(GHC) \
     --with-hc-pkg=$(GHC_PKG) \
+       --package-db $(FPTOOLS_TOP_ABS)/libraries/bootstrapping.conf \
     $(COMMON_CONFIGURE_FLAGS)
 
 # XXX
index b291fd2..b422986 100644 (file)
@@ -58,6 +58,9 @@ import System                   ( system )
 #endif
 #endif
 
+import Distribution.Text
+import qualified Paths_hsc2hs
+
 version :: String
 version = "hsc2hs version 0.66\n"
 
@@ -137,7 +140,10 @@ main = do
                            case mb_path of
                              Nothing   -> return id
                              Just path -> do
-                               let templ = path ++ "/template-hsc.h"
+                              -- Euch, this is horrible. Unfortunately
+                              -- Paths_hsc2hs isn't too useful for a
+                              -- relocatable binary, though.
+                               let templ = path ++ "/hsc2hs-" ++ display Paths_hsc2hs.version ++ "/template-hsc.h"
                                flg <- doesFileExist templ
                                if flg
                                 then return ((Template templ):)
index 4604171..3eeafa2 100644 (file)
@@ -3,7 +3,9 @@ TOP=../..
 include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/cabal-flags.mk
 
-SRC_HC_OPTS      += -Wall
+# XXX We would like to turn thsi on, but Cabal generates paths files
+#     that are not -Wall clean!
+# SRC_HC_OPTS      += -Wall
 
 CABAL = $(FPTOOLS_TOP_ABS)/libraries/cabal-bin \
             $(GHC) $(FPTOOLS_TOP_ABS)/libraries/bootstrapping.conf
index 1e84ff3..8d06366 100644 (file)
@@ -34,9 +34,8 @@ Executable hsc2hs
     if flag(base3)
         Build-Depends: base       >= 3   && < 4,
                        directory  >= 1   && < 1.1,
-                       process    >= 1   && < 1.1,
-                       haskell98
+                       process    >= 1   && < 1.1
     else
-        Build-Depends: base < 3,
-                       haskell98
+        Build-Depends: base < 3
+    Build-Depends: haskell98, Cabal