1 #include "../includes/config.h"
3 module Main (main) where
15 ("install":rest) -> do { putStrLn (dumpPackages (package_details True rest)) }
16 ("in-place":rest) -> do { putStrLn (dumpPackages (package_details False rest)) }
17 _ -> do hPutStr stderr "usage: pkgconf (install | in-place) ...\n"
18 exitWith (ExitFailure 1)
20 package_details :: Bool -> [String] -> [PackageConfig]
21 package_details installing
31 , cFPTOOLS_TOP_ABS ] =
35 name = "gmp", -- GMP is at the bottom of the heap
38 library_dirs = if cHaveLibGmp == "YES"
42 else [ ghc_src_dir cGHC_RUNTIME_DIR ++ "/gmp" ],
44 extra_libraries = [ "gmp" ],
54 name = "rts", -- The RTS is just another package!
57 library_dirs = if installing
59 else [ ghc_src_dir cGHC_RUNTIME_DIR ],
60 hs_libraries = [ "HSrts" ],
61 #ifndef mingw32_TARGET_OS
64 extra_libraries = [ "winmm" ], -- for the threadDelay timer
66 include_dirs = if installing
67 then [ clibdir ++ "/includes" ]
68 else [ ghc_src_dir cGHC_INCLUDE_DIR ],
69 c_includes = [ "Stg.h" ], -- ha!
70 package_deps = [ "gmp" ],
73 -- the RTS forward-references to a bunch of stuff in the prelude,
74 -- so we force it to be included with special options to ld.
76 #ifndef LEADING_UNDERSCORE
82 "PrelBase_Izh_static_info"
83 , "PrelBase_Czh_static_info"
84 , "PrelFloat_Fzh_static_info"
85 , "PrelFloat_Dzh_static_info"
86 , "PrelPtr_Ptr_static_info"
87 , "PrelWord_Wzh_static_info"
88 , "PrelInt_I8zh_static_info"
89 , "PrelInt_I16zh_static_info"
90 , "PrelInt_I32zh_static_info"
91 , "PrelInt_I64zh_static_info"
92 , "PrelWord_W8zh_static_info"
93 , "PrelWord_W16zh_static_info"
94 , "PrelWord_W32zh_static_info"
95 , "PrelWord_W64zh_static_info"
96 , "PrelStable_StablePtr_static_info"
97 , "PrelBase_Izh_con_info"
98 , "PrelBase_Czh_con_info"
99 , "PrelFloat_Fzh_con_info"
100 , "PrelFloat_Dzh_con_info"
101 , "PrelPtr_Ptr_con_info"
102 , "PrelStable_StablePtr_con_info"
103 , "PrelBase_False_closure"
104 , "PrelBase_True_closure"
105 , "PrelPack_unpackCString_closure"
106 , "PrelIOBase_stackOverflow_closure"
107 , "PrelIOBase_heapOverflow_closure"
108 , "PrelIOBase_NonTermination_closure"
109 , "PrelIOBase_BlockedOnDeadMVar_closure"
110 , "PrelWeak_runFinalizzerBatch_closure"
116 name = "std", -- The Prelude & Standard Hs_libraries
117 import_dirs = if installing
118 then [ clibdir ++ "/imports/std" ]
119 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std" ],
121 library_dirs = if installing
123 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std"
124 , ghc_src_dir cGHC_LIB_DIR ++ "/std/cbits" ],
125 hs_libraries = [ "HSstd" ],
126 extra_libraries = [ "HSstd_cbits" ] ++
127 # ifdef mingw32_TARGET_OS
128 ["wsock32", "msvcrt"]
130 ["m"] -- libm, that is
133 include_dirs = if installing
135 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std/cbits" ],
136 c_includes = [ "HsStd.h" ],
137 package_deps = [ "rts" ],
145 import_dirs = if installing
146 then [ clibdir ++ "/imports/lang" ]
147 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang"
148 , cFPTOOLS_TOP_ABS ++ "/hslibs/lang/monads" ],
150 library_dirs = if installing
152 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang"
153 , cFPTOOLS_TOP_ABS ++ "/hslibs/lang/cbits" ],
154 hs_libraries = [ "HSlang" ],
155 extra_libraries = [ "HSlang_cbits" ],
156 include_dirs = if installing
158 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang/cbits" ],
159 c_includes = [ "HsLang.h" ],
164 #ifndef LEADING_UNDERSCORE
165 "-u Addr_Azh_static_info"
167 "-u _Addr_Azh_static_info"
174 import_dirs = if installing
175 then [ clibdir ++ "/imports/concurrent" ]
176 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ],
178 library_dirs = if installing
180 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ],
181 hs_libraries = [ "HSconcurrent" ],
182 extra_libraries = [],
183 include_dirs = if installing
185 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent/cbits" ],
187 package_deps = [ "lang" ],
195 import_dirs = if installing
196 then [ clibdir ++ "/imports/data" ]
197 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data"
198 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison"
199 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Assoc"
200 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Coll"
201 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Seq" ],
203 library_dirs = if installing
205 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data" ],
206 hs_libraries = [ "HSdata" ],
207 extra_libraries = [],
208 include_dirs = if installing
210 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data/cbits" ],
212 package_deps = [ "lang", "util" ],
220 import_dirs = if installing
221 then [ clibdir ++ "/imports/net" ]
222 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net" ],
224 library_dirs = if installing
226 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net"
227 , cFPTOOLS_TOP_ABS ++ "/hslibs/net/cbits" ],
228 hs_libraries = [ "HSnet" ],
229 extra_libraries = [ "HSnet_cbits" ]
230 ++ if suffixMatch "solaris2" cTARGETPLATFORM
231 then [ "nsl", "socket" ]
234 include_dirs = if installing
236 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net/cbits" ],
237 c_includes = [ "HsNet.h" ],
238 package_deps = [ "lang", "text", "concurrent" ],
246 import_dirs = if installing
247 then [ clibdir ++ "/imports/posix" ]
248 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix" ],
250 library_dirs = if installing
252 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix"
253 , cFPTOOLS_TOP_ABS ++ "/hslibs/posix/cbits" ],
254 hs_libraries = [ "HSposix" ],
255 extra_libraries = [ "HSposix_cbits" ],
256 include_dirs = if installing
258 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix/cbits" ],
259 c_includes = [ "HsPosix.h" ],
260 package_deps = [ "lang" ],
268 import_dirs = if installing
269 then [ clibdir ++ "/imports/text" ]
270 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text"
271 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/html"
272 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/HaXml/lib"
273 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/parsec" ],
275 library_dirs = if installing
277 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text"
278 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/cbits" ],
279 hs_libraries = [ "HStext" ],
280 extra_libraries = [ "HStext_cbits" ],
281 include_dirs = if installing
283 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text/cbits" ],
284 c_includes = [ "HsText.h" ],
285 package_deps = [ "lang" ],
293 import_dirs = if installing
294 then [ clibdir ++ "/imports/util" ]
295 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util"
296 , cFPTOOLS_TOP_ABS ++ "/hslibs/util/check" ],
298 library_dirs = if installing
300 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util"
301 , cFPTOOLS_TOP_ABS ++ "/hslibs/util/cbits" ],
302 hs_libraries = [ "HSutil" ],
303 extra_libraries = [ "HSutil_cbits" ],
304 include_dirs = if installing
306 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util/cbits" ],
307 c_includes = [ "HsUtil.h" ],
308 package_deps = [ "lang", "concurrent"
309 #ifndef mingw32_TARGET_OS
315 extra_ld_opts = words cLibsReadline
318 -- no cbits at the moment, we'll need to add one if this library
319 -- ever calls out to any C libs.
322 import_dirs = if installing
323 then [ clibdir ++ "/imports/hssource" ]
324 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ],
326 library_dirs = if installing
328 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ],
329 hs_libraries = [ "HShssource" ],
330 extra_libraries = [],
333 package_deps = [ "text" ],
341 import_dirs = if installing
342 then [ clibdir ++ "/imports/greencard" ]
343 else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ],
345 library_dirs = if installing
347 else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ],
348 hs_libraries = [ "HSgreencard" ],
349 extra_libraries = [],
352 package_deps = [ "lang" ],
360 import_dirs = if installing
361 then [ clibdir ++ "/imports/win32" ]
362 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32" ],
364 library_dirs = if installing
366 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32" ],
367 hs_libraries = [ "HSwin32" ],
368 extra_libraries = [ "user32", "gdi32", "winmm" ],
370 c_includes = [], -- ???
371 package_deps = [ "lang", "greencard" ],
379 import_dirs = if installing
380 then [ clibdir ++ "/imports/com" ]
381 else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ],
383 library_dirs = if installing
385 else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ],
386 hs_libraries = [ "HScom" ],
387 extra_libraries = [ "user32", "ole32", "oleaut32", "advapi32" ],
389 c_includes = [], -- ???
390 package_deps = [ "lang" ],
397 ghc_src_dir :: String -> String
398 ghc_src_dir path = cFPTOOLS_TOP_ABS ++ '/':cCURRENT_DIR ++ '/':path