Move the register-inplace special-case stuff into the ghc-prim package
authorIan Lynagh <igloo@earth.li>
Sat, 17 May 2008 00:22:24 +0000 (00:22 +0000)
committerIan Lynagh <igloo@earth.li>
Sat, 17 May 2008 00:22:24 +0000 (00:22 +0000)
libraries/Makefile
libraries/installPackage.hs

index 20a039c..6a38e3d 100644 (file)
@@ -303,7 +303,7 @@ make.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \
          setup/Setup makefile -f GNUmakefile; \
          cmp -s GNUmakefile GNUmakefile.tmp && mv GNUmakefile.tmp GNUmakefile; \
          $(MAKE) $(MFLAGS) && \
-         ../installPackage/installPackage register --inplace; \
+         setup/Setup register --inplace; \
        fi
 
 # Hack for ndp, as described above
@@ -316,7 +316,7 @@ build.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \
        if ifBuildable/ifBuildable $*; then \
          cd $* && \
          setup/Setup build $(addprefix --ghc-option=,$(GhcLibHcOpts)); \
-         ../installPackage/installPackage register --inplace; \
+         setup/Setup register --inplace; \
        fi
 
 .PHONY: doc html
index 2a13e0b..00560a7 100644 (file)
@@ -19,9 +19,6 @@ main :: IO ()
 main
   = do args <- getArgs
        case args of
-           "register" : "--inplace" :args' ->
-               let verbosity = mkVerbosity args'
-               in doRegisterInplace verbosity
            "install" : ghcpkg : ghcpkgconf : destdir : topdir :
                     iprefix : ibindir : ilibdir : ilibexecdir : idynlibdir :
                     idatadir : idocdir : ihtmldir : ihaddockdir :
@@ -38,23 +35,6 @@ mkVerbosity [] = normal
 mkVerbosity ['-':'v':v] = readEOrFail flagToVerbosity v
 mkVerbosity args = error ("Bad arguments: " ++ show args)
 
-doRegisterInplace :: Verbosity -> IO ()
-doRegisterInplace verbosity =
-       do lbi <- getConfig verbosity
-          let registerFlags = defaultRegisterFlags { regInPlace = toFlag True }
-              pd = localPkgDescr lbi
-              pd_reg = if pkgName (package pd) == "ghc-prim"
-                       then case library pd of
-                            Just lib ->
-                                let ems = "GHC.Prim" : exposedModules lib
-                                    lib' = lib { exposedModules = ems }
-                                in pd { library = Just lib' }
-                            Nothing ->
-                                error "Expected a library, but none found"
-                       else pd
-          (regHook simpleUserHooks) pd_reg lbi simpleUserHooks registerFlags
-          return ()
-
 doInstall :: Verbosity -> FilePath -> FilePath -> FilePath -> FilePath
           -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath
           -> FilePath -> FilePath -> FilePath -> FilePath