Permalink
Browse files

Make ghcjs install the files that used to be installed ghcjs-rts back…

… into ghc.

Since we are now using ghcjs repository to build the the integrated ghc+ghcjs there seems little reason to maintain two copies of the rts files.
  • Loading branch information...
1 parent 3d12429 commit d79d864324d04f656d35b55ace294e5ccd5a8c77 @hamishmack hamishmack committed May 8, 2012
View
@@ -6,4 +6,4 @@
/examples/main/*.c
/examples/main/*.h
/examples/main/*.js
-
+/package.lkshf
View
@@ -1,6 +1,41 @@
-import Distribution.Simple (defaultMainWithHooks, simpleUserHooks, hookedPrograms)
+import Distribution.Simple (defaultMainWithHooks, simpleUserHooks, hookedPrograms, instHook, copyHook)
import Distribution.Simple.Program.Types (simpleProgram)
+import Distribution.Simple.Setup (CopyDest(..), installVerbosity, copyVerbosity, fromFlag)
+import Distribution.Simple.Utils (createDirectoryIfMissingVerbose, installOrdinaryFile)
+import Distribution.Simple.LocalBuildInfo (buildDir, absoluteInstallDirs, InstallDirs(..))
+import System.FilePath ((</>))
main = defaultMainWithHooks simpleUserHooks {
hookedPrograms = [simpleProgram "java"]
+ , instHook = (\pkg_descr lbi hooks flags -> do
+ -- Run the normal install
+ instHook simpleUserHooks pkg_descr lbi hooks flags
+
+ -- Also copy the JavaScript RTS files
+ let lib = libdir $absoluteInstallDirs pkg_descr lbi NoCopyDest
+ destination = lib </> "rts.jso"
+ verbosity = fromFlag (installVerbosity flags)
+ copy n = installOrdinaryFile verbosity ("rts" </> n) (destination </> n)
+
+ createDirectoryIfMissingVerbose verbosity True destination
+ copy "rts-options.js"
+ copy "rts-common.js"
+ copy "rts-plain.js"
+ copy "rts-trampoline.js")
+
+ , copyHook = (\pkg_descr lbi hooks flags -> do
+ -- Run the normal copy
+ copyHook simpleUserHooks pkg_descr lbi hooks flags
+
+ -- Also copy the JavaScript RTS files
+ let lib = libdir $absoluteInstallDirs pkg_descr lbi NoCopyDest
+ destination = lib </> "rts.jso"
+ verbosity = fromFlag (copyVerbosity flags)
+ copy n = installOrdinaryFile verbosity ("rts" </> n) (destination </> n)
+
+ createDirectoryIfMissingVerbose verbosity True destination
+ copy "rts-options.js"
+ copy "rts-common.js"
+ copy "rts-plain.js"
+ copy "rts-trampoline.js")
}
View
@@ -61,11 +61,11 @@ main = do
"--js", "~/closure-library/closure/goog/debug/logbuffer.js",
"--js", "~/closure-library/closure/goog/debug/logger.js",
"--js", "~/closure-library/closure/goog/debug/console.js",
- "--js", concat [dstPath env, "/rts-options.js"],
+ "--js", concat [dstPath env, "../rts/rts-options.js"],
"--define='HS_DEBUG=false'",
"--define='HS_TRAMPOLINE="++(if conv == "trampoline" then "true" else "false")++ "'",
- "--js", concat [dstPath env, "/rts-common.js"],
- "--js", concat [dstPath env, "/rts-", conv, ".js"],
+ "--js", concat [dstPath env, "../rts/rts-common.js"],
+ "--js", concat [dstPath env, "../rts/rts-", conv, ".js"],
"--module", "rts:24:",
"--hjs", concat [dstPath env, "/ghc-prim"],
"--hjs", concat [dstPath env, "/integer-gmp"],
View
@@ -11,9 +11,9 @@
goog.require('goog.testing.jsunit');
goog.require('goog.testing.recordFunction');
</script>
- <script type="text/javascript" src="rts-options.js"></script>
- <script type="text/javascript" src="rts-common.js"></script>
- <script type="text/javascript" src="rts-trampoline.js"></script>
+ <script type="text/javascript" src="../rts-options.js"></script>
+ <script type="text/javascript" src="../rts-common.js"></script>
+ <script type="text/javascript" src="../rts-trampoline.js"></script>
<script type="text/javascript" src="hsloader.js"></script>
<script type="text/javascript" src="TestJS.js"></script>
</head>
View
@@ -12,6 +12,13 @@ Cabal-Version: >= 1.10
flag ghc7
+Library
+ build-depends: base -any
+ exposed-modules: GHCJS
+ exposed: True
+ buildable: True
+ hs-source-dirs: rts
+
Executable ghcjs
Main-Is: Compiler/Main.hs
Default-Language: Haskell2010
View
@@ -0,0 +1,19 @@
+-----------------------------------------------------------------------------
+--
+-- Module : GHCJS
+-- Copyright :
+-- License : BSD3
+--
+-- Maintainer : hamish.k.mackenzie@googlemail.com
+-- Stability :
+-- Portability :
+--
+-- |
+--
+-----------------------------------------------------------------------------
+
+module GHCJS (
+
+) where
+
+
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d79d864

Please sign in to comment.