1diff --git a/src-bin/Boot.hs b/src-bin/Boot.hs
2index 3c68dcf..64f3cf7 100644
3--- a/src-bin/Boot.hs
4+++ b/src-bin/Boot.hs
5@@ -512,9 +512,7 @@ initPackageDB :: B ()
6 initPackageDB = do
7 msg info "creating package databases"
8 initDB "--global" <^> beLocations . blGlobalDB
9- traverseOf_ _Just initUser <^> beLocations . blUserDBDir
10 where
11- initUser dir = rm_f (dir </> "package.conf") >> initDB "--user" (dir </> "package.conf.d")
12 initDB dbName db = do
13 rm_rf db >> mkdir_p db
14 ghcjs_pkg_ ["init", toTextI db] `catchAny_` return ()
15@@ -538,29 +536,22 @@ installDevelopmentTree = subTop $ do
16 msgD info $ "preparing development boot tree"
17 checkpoint' "ghcjs-boot-git" "ghcjs-boot repository already cloned and prepared" $ do
18 testGit "ghcjs-boot" >>= \case
19- Just False -> failWith "ghcjs-boot already exists and is not a git repository"
20- Just True -> do
21- msg info "ghcjs-boot repository already exists but checkpoint not reached, cleaning first, then cloning"
22- rm_rf "ghcjs-boot"
23+ Just _ -> do
24+ msg info "ghcjs-boot repository already exists; initializing ghcjs-boot"
25 initGhcjsBoot
26 Nothing -> do
27 msgD info "cloning ghcjs-boot git repository"
28 initGhcjsBoot
29 checkpoint' "shims-git" "shims repository already cloned" $ do
30 testGit "shims" >>= \case
31- Just False -> failWith "shims already exists and is not a git repository"
32- Just True -> do
33- msgD info "shims repository already exists but checkpoint not reached, cleaning first, then cloning"
34- rm_rf "shims"
35- cloneGit shimsDescr "shims" bsrcShimsDevBranch bsrcShimsDev
36+ Just _ -> do
37+ msgD info "shims repository already exists; moving on"
38 Nothing -> do
39 msgD info "cloning shims git repository"
40 cloneGit shimsDescr "shims" bsrcShimsDevBranch bsrcShimsDev
41 where
42 initGhcjsBoot = sub $ do
43- cloneGit bootDescr "ghcjs-boot" bsrcBootDevBranch bsrcBootDev
44 cd "ghcjs-boot"
45- git_ ["submodule", "update", "--init", "--recursive"]
46 mapM_ patchPackage =<< allPackages
47 preparePrimops
48 buildGenPrim
49@@ -1085,8 +1076,11 @@ cabalInstallFlags parmakeGhcjs = do
50 , "--avoid-reinstalls"
51 , "--builddir", "dist"
52 , "--with-compiler", ghcjs ^. pgmLocText
53+ , "--with-gcc", "@CC@"
54 , "--with-hc-pkg", ghcjsPkg ^. pgmLocText
55- , "--prefix", toTextI instDir
56+ , "--prefix", "@PREFIX@"
57+ , "--libdir", "$prefix/lib/$compiler"
58+ , "--libsubdir", "$pkgid"
59 , bool haddock "--enable-documentation" "--disable-documentation"
60 , "--haddock-html"
61 -- workaround for hoogle support being broken in haddock for GHC 7.10RC1
62diff --git a/src/Compiler/Info.hs b/src/Compiler/Info.hs
63index 33a401f..79833c5 100644
64--- a/src/Compiler/Info.hs
65+++ b/src/Compiler/Info.hs
66@@ -48,13 +48,7 @@ compilerInfo nativeToo dflags = do
67
68 -- | the directory to use if started without -B flag
69 getDefaultTopDir :: IO FilePath
70-getDefaultTopDir = do
71- appdir <- getAppUserDataDirectory "ghcjs"
72- return (appdir </> subdir </> "ghcjs")
73- where
74- targetARCH = arch
75- targetOS = os
76- subdir = targetARCH ++ '-':targetOS ++ '-':getFullCompilerVersion
77+getDefaultTopDir = return "@PREFIX@/lib/ghcjs-@VERSION@"
78
79 getDefaultLibDir :: IO FilePath
80 getDefaultLibDir = getDefaultTopDir