summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/ghc-pkg/Main.hs10
-rw-r--r--utils/ghc-pkg/Makefile2
-rw-r--r--utils/hsc2hs/Main.hs6
-rw-r--r--utils/runghc/runghc.hs9
4 files changed, 22 insertions, 5 deletions
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index a54101c0cd..19be560ea0 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -21,8 +21,14 @@ import Distribution.Compat.ReadP
import Distribution.ParseUtils
import Distribution.Package
import Distribution.Version
-import Compat.Directory ( getAppUserDataDirectory, createDirectoryIfMissing )
-import Compat.RawSystem ( rawSystem )
+
+#ifdef USING_COMPAT
+import Compat.Directory ( getAppUserDataDirectory, createDirectoryIfMissing )
+import Compat.RawSystem ( rawSystem )
+#else
+import System.Directory ( getAppUserDataDirectory, createDirectoryIfMissing )
+import System.Cmd ( rawSystem )
+#endif
import Prelude
diff --git a/utils/ghc-pkg/Makefile b/utils/ghc-pkg/Makefile
index f30b08772b..19d5a12aff 100644
--- a/utils/ghc-pkg/Makefile
+++ b/utils/ghc-pkg/Makefile
@@ -12,6 +12,8 @@ SRC_HC_OPTS += -cpp -Wall -fno-warn-name-shadowing -fno-warn-unused-matches
# This causes libghccompat.a to be used:
include $(GHC_COMPAT_DIR)/compat.mk
+SRC_HC_OPTS += $(PACKAGE_CABAL)
+
# This is required because libghccompat.a must be built with
# $(GhcHcOpts) because it is linked to the compiler, and hence
# we must also build with $(GhcHcOpts) here:
diff --git a/utils/hsc2hs/Main.hs b/utils/hsc2hs/Main.hs
index 75ea57b555..77b948f37a 100644
--- a/utils/hsc2hs/Main.hs
+++ b/utils/hsc2hs/Main.hs
@@ -42,7 +42,11 @@ import System.IO ( openFile, IOMode(..), hClose )
#endif
#if defined(__GLASGOW_HASKELL__) && !defined(BUILD_NHC)
-import Compat.RawSystem ( rawSystem )
+#ifdef USING_COMPAT
+import Compat.RawSystem ( rawSystem )
+#else
+import System.Cmd ( rawSystem )
+#endif
#define HAVE_rawSystem
#elif __NHC__ >= 117
import System.Cmd ( rawSystem )
diff --git a/utils/runghc/runghc.hs b/utils/runghc/runghc.hs
index 1d4907dd47..83163bd401 100644
--- a/utils/runghc/runghc.hs
+++ b/utils/runghc/runghc.hs
@@ -28,8 +28,13 @@ import Data.List
import System.Exit
import Data.Char
-import Compat.RawSystem ( rawSystem )
-import Compat.Directory ( findExecutable )
+#ifdef USING_COMPAT
+import Compat.RawSystem ( rawSystem )
+import Compat.Directory ( findExecutable )
+#else
+import System.Cmd ( rawSystem )
+import System.Directory ( findExecutable )
+#endif
main = do
args <- getArgs