- ( "rts", -- The RTS is just another package!
- Package {
- import_dirs = [],
- library_dirs = [ if installing
- then _libdir
- else ghc_src_dir _GHC_RUNTIME_DIR ],
- libraries = [ "HSrts" ],
- include_dir = if installing
- then _libdir ++ "/includes"
- else ghc_src_dir _GHC_INCLUDE_DIR,
- c_include = "Stg.h", -- ha!
- package_deps = [ "gmp" ],
- extra_ghc_opts = "",
- extra_cc_opts = "",
- -- the RTS forward-references to a bunch of stuff in the prelude,
- -- so we force it to be included with special options to ld.
- extra_ld_opts = unwords [
- "-u PrelMain_mainIO_closure",
- "-u PrelBase_Izh_static_info",
- "-u PrelBase_Czh_static_info",
- "-u PrelFloat_Fzh_static_info",
- "-u PrelFloat_Dzh_static_info",
- "-u PrelAddr_Azh_static_info",
- "-u PrelAddr_Wzh_static_info",
- "-u PrelAddr_I64zh_static_info",
- "-u PrelAddr_W64zh_static_info",
- "-u PrelStable_StablePtr_static_info",
- "-u PrelBase_Izh_con_info",
- "-u PrelBase_Czh_con_info",
- "-u PrelFloat_Fzh_con_info",
- "-u PrelFloat_Dzh_con_info",
- "-u PrelAddr_Azh_con_info",
- "-u PrelAddr_Wzh_con_info",
- "-u PrelAddr_I64zh_con_info",
- "-u PrelAddr_W64zh_con_info",
- "-u PrelStable_StablePtr_con_info",
- "-u PrelBase_False_closure",
- "-u PrelBase_True_closure",
- "-u PrelPack_unpackCString_closure",
- "-u PrelException_stackOverflow_closure",
- "-u PrelException_heapOverflow_closure",
- "-u PrelException_NonTermination_closure",
- "-u PrelException_PutFullMVar_closure",
- "-u PrelException_BlockedOnDeadMVar_closure",
- "-u PrelWeak_runFinalizzerBatch_closure",
- "-u __init_Prelude",
- "-u __init_PrelMain"
- ]
- }
- ),
+ Package {
+ name = "rts", -- The RTS is just another package!
+ import_dirs = [],
+ source_dirs = [],
+ library_dirs = if installing
+ then [ "$libdir" ]
+ else [ ghc_src_dir cGHC_RUNTIME_DIR ],
+ hs_libraries = [ "HSrts" ],
+ extra_libraries =
+ "m": -- for ldexp()
+#ifdef mingw32_TARGET_OS
+ "winmm": -- for the threadDelay timer
+ "wsock32": -- for the linker
+#endif
+#ifdef USING_LIBBFD
+ "bfd": "iberty": -- for debugging
+#endif
+ [],
+ include_dirs = if installing
+ then [ "$libdir/include"
+#ifdef mingw32_TARGET_OS
+ , "$libdir/include/mingw"
+#endif
+ ]
+ else [ ghc_src_dir cGHC_INCLUDE_DIR ],
+ c_includes = [ "Stg.h" ], -- ha!
+ package_deps = [ "gmp" ],
+ extra_ghc_opts = [],
+ extra_cc_opts = [],
+ -- the RTS forward-references to a bunch of stuff in the prelude,
+ -- so we force it to be included with special options to ld.
+ extra_ld_opts =
+ foldr (\ x xs -> "-u" : x : xs) []
+ (map (
+#ifndef LEADING_UNDERSCORE
+ ""
+#else
+ "_"
+#endif
+ ++ ) [
+ "PrelBase_Izh_static_info"
+ , "PrelBase_Czh_static_info"
+ , "PrelFloat_Fzh_static_info"
+ , "PrelFloat_Dzh_static_info"
+ , "PrelPtr_Ptr_static_info"
+ , "PrelWord_Wzh_static_info"
+ , "PrelInt_I8zh_static_info"
+ , "PrelInt_I16zh_static_info"
+ , "PrelInt_I32zh_static_info"
+ , "PrelInt_I64zh_static_info"
+ , "PrelWord_W8zh_static_info"
+ , "PrelWord_W16zh_static_info"
+ , "PrelWord_W32zh_static_info"
+ , "PrelWord_W64zh_static_info"
+ , "PrelStable_StablePtr_static_info"
+ , "PrelBase_Izh_con_info"
+ , "PrelBase_Czh_con_info"
+ , "PrelFloat_Fzh_con_info"
+ , "PrelFloat_Dzh_con_info"
+ , "PrelPtr_Ptr_con_info"
+ , "PrelStable_StablePtr_con_info"
+ , "PrelBase_False_closure"
+ , "PrelBase_True_closure"
+ , "PrelPack_unpackCString_closure"
+ , "PrelIOBase_stackOverflow_closure"
+ , "PrelIOBase_heapOverflow_closure"
+ , "PrelIOBase_NonTermination_closure"
+ , "PrelIOBase_BlockedOnDeadMVar_closure"
+ , "PrelWeak_runFinalizzerBatch_closure"
+ , "__stginit_Prelude"
+ ])
+ },