X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdriver%2FPackageSrc.hs;h=bdd4c30103bd446dcfed7fedf201fc33e7acdeb2;hb=a0813f934bb8a3510751c9a552fdd6bb9e922b64;hp=dcc7508c0820fe8092fffa12dcebcd5389704ce0;hpb=8419fa6df5314e2a8195d9f67b775f2f653fbbeb;p=ghc-hetmet.git diff --git a/ghc/driver/PackageSrc.hs b/ghc/driver/PackageSrc.hs index dcc7508..bdd4c30 100644 --- a/ghc/driver/PackageSrc.hs +++ b/ghc/driver/PackageSrc.hs @@ -6,24 +6,35 @@ import Utils import IO import System -import Config import Package main :: IO () main = do args <- getArgs case args of - [ "install" ] -> do { putStrLn (dumpPackages (package_details True)) } - [ "in-place" ] -> do { putStrLn (dumpPackages (package_details False)) } - _ -> do hPutStr stderr "usage: pkgconf (install | in-place)\n" - exitWith (ExitFailure 1) + ("install":rest) -> do { putStrLn (dumpPackages (package_details True rest)) } + ("in-place":rest) -> do { putStrLn (dumpPackages (package_details False rest)) } + _ -> do hPutStr stderr "usage: pkgconf (install | in-place) ...\n" + exitWith (ExitFailure 1) + +package_details :: Bool -> [String] -> [PackageConfig] +package_details installing + [ cTARGETPLATFORM + , cCURRENT_DIR + , cHaveLibGmp + , cLibsReadline + , clibdir + , cGHC_LIB_DIR + , cGHC_RUNTIME_DIR + , cGHC_UTILS_DIR + , cGHC_INCLUDE_DIR + , cFPTOOLS_TOP_ABS ] = -package_details :: Bool -> [Package] -package_details installing = [ Package { name = "gmp", -- GMP is at the bottom of the heap import_dirs = [], + source_dirs = [], library_dirs = if cHaveLibGmp == "YES" then [] else if installing @@ -42,11 +53,16 @@ package_details installing = Package { name = "rts", -- The RTS is just another package! import_dirs = [], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ ghc_src_dir cGHC_RUNTIME_DIR ], hs_libraries = [ "HSrts" ], +#ifndef mingw32_TARGET_OS extra_libraries = [], +#else + extra_libraries = [ "winmm" ], -- for the threadDelay timer +#endif include_dirs = if installing then [ clibdir ++ "/includes" ] else [ ghc_src_dir cGHC_INCLUDE_DIR ], @@ -90,7 +106,6 @@ package_details installing = , "PrelIOBase_stackOverflow_closure" , "PrelIOBase_heapOverflow_closure" , "PrelIOBase_NonTermination_closure" - , "PrelIOBase_PutFullMVar_closure" , "PrelIOBase_BlockedOnDeadMVar_closure" , "PrelWeak_runFinalizzerBatch_closure" , "__init_Prelude" @@ -102,12 +117,19 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/std" ] else [ ghc_src_dir cGHC_LIB_DIR ++ "/std" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ ghc_src_dir cGHC_LIB_DIR ++ "/std" , ghc_src_dir cGHC_LIB_DIR ++ "/std/cbits" ], hs_libraries = [ "HSstd" ], - extra_libraries = [ "HSstd_cbits" ], + extra_libraries = [ "HSstd_cbits" ] ++ +# ifdef mingw32_TARGET_OS + ["wsock32", "msvcrt"] +# else + ["m"] -- libm, that is +# endif + , include_dirs = if installing then [] else [ ghc_src_dir cGHC_LIB_DIR ++ "/std/cbits" ], @@ -115,13 +137,7 @@ package_details installing = package_deps = [ "rts" ], extra_ghc_opts = [], extra_cc_opts = [], - extra_ld_opts = [ -#ifdef mingw32_TARGET_OS - "-lwsock32" -#else - "-lm" -#endif - ] + extra_ld_opts = [] }, Package { @@ -130,6 +146,7 @@ package_details installing = then [ clibdir ++ "/imports/lang" ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang" , cFPTOOLS_TOP_ABS ++ "/hslibs/lang/monads" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang" @@ -143,7 +160,13 @@ package_details installing = package_deps = [], extra_ghc_opts = [], extra_cc_opts = [], - extra_ld_opts = [] + extra_ld_opts = [ +#ifndef LEADING_UNDERSCORE + "-u Addr_Azh_static_info" +#else + "-u _Addr_Azh_static_info" +#endif + ] }, Package { @@ -151,6 +174,7 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/concurrent" ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ], @@ -175,6 +199,7 @@ package_details installing = , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Assoc" , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Coll" , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Seq" ], + source_dirs = [], library_dirs = if installing then [clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data" ], @@ -184,7 +209,7 @@ package_details installing = then [] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data/cbits" ], c_includes = [], - package_deps = [ "lang" ], + package_deps = [ "lang", "util" ], extra_ghc_opts = [], extra_cc_opts = [], extra_ld_opts = [] @@ -195,22 +220,25 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/net" ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net" , cFPTOOLS_TOP_ABS ++ "/hslibs/net/cbits" ], hs_libraries = [ "HSnet" ], - extra_libraries = [ "HSnet_cbits" ], + extra_libraries = [ "HSnet_cbits" ] + ++ if suffixMatch "solaris2" cTARGETPLATFORM + then [ "nsl", "socket" ] + else [] + , include_dirs = if installing then [] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net/cbits" ], c_includes = [ "HsNet.h" ], - package_deps = [ "lang", "text" ], + package_deps = [ "lang", "text", "concurrent" ], extra_ghc_opts = [], extra_cc_opts = [], - extra_ld_opts = if suffixMatch "solaris2" cTARGETPLATFORM - then [ "-lnsl", "-lsocket" ] - else [] + extra_ld_opts = [] }, Package { @@ -218,6 +246,7 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/posix" ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix" @@ -242,6 +271,7 @@ package_details installing = , cFPTOOLS_TOP_ABS ++ "/hslibs/text/html" , cFPTOOLS_TOP_ABS ++ "/hslibs/text/HaXml/lib" , cFPTOOLS_TOP_ABS ++ "/hslibs/text/parsec" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text" @@ -252,7 +282,7 @@ package_details installing = then [] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text/cbits" ], c_includes = [ "HsText.h" ], - package_deps = [ "lang", "data" ], + package_deps = [ "lang" ], extra_ghc_opts = [], extra_cc_opts = [], extra_ld_opts = [] @@ -264,6 +294,7 @@ package_details installing = then [ clibdir ++ "/imports/util" ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util" , cFPTOOLS_TOP_ABS ++ "/hslibs/util/check" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util" @@ -291,6 +322,7 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/hssource" ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ], @@ -309,6 +341,7 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/greencard" ] else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ], @@ -327,17 +360,18 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/win32" ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32" ], hs_libraries = [ "HSwin32" ], - extra_libraries = [], + extra_libraries = [ "user32", "gdi32", "winmm" ], include_dirs = [], c_includes = [], -- ??? package_deps = [ "lang", "greencard" ], extra_ghc_opts = [], extra_cc_opts = [], - extra_ld_opts = [ "-luser32", "-lgdi32", "-lwinmm" ] + extra_ld_opts = [] }, Package { @@ -345,19 +379,20 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/com" ] else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ], hs_libraries = [ "HScom" ], - extra_libraries = [], + extra_libraries = [ "user32", "ole32", "oleaut32", "advapi32" ], include_dirs = [], c_includes = [], -- ??? package_deps = [ "lang" ], extra_ghc_opts = [], extra_cc_opts = [], - extra_ld_opts = [ "-luser32", "-lole32", "-loleaut32", "-ladvapi32" ] + extra_ld_opts = [] } ] - -ghc_src_dir :: String -> String -ghc_src_dir path = cFPTOOLS_TOP_ABS ++ '/':cCURRENT_DIR ++ '/':path + where + ghc_src_dir :: String -> String + ghc_src_dir path = cFPTOOLS_TOP_ABS ++ '/':cCURRENT_DIR ++ '/':path