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 = if suffixMatch "solaris2" cTARGETPLATFORM
230 then [ "nsl", "socket" ]
233 include_dirs = if installing
235 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net/cbits" ],
236 c_includes = [ "HsNet.h" ],
237 package_deps = [ "lang", "text", "concurrent" ],
245 import_dirs = if installing
246 then [ clibdir ++ "/imports/posix" ]
247 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix" ],
249 library_dirs = if installing
251 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix"
252 , cFPTOOLS_TOP_ABS ++ "/hslibs/posix/cbits" ],
253 hs_libraries = [ "HSposix" ],
254 extra_libraries = [ "HSposix_cbits" ],
255 include_dirs = if installing
257 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix/cbits" ],
258 c_includes = [ "HsPosix.h" ],
259 package_deps = [ "lang" ],
267 import_dirs = if installing
268 then [ clibdir ++ "/imports/text" ]
269 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text"
270 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/html"
271 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/HaXml/lib"
272 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/parsec" ],
274 library_dirs = if installing
276 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text"
277 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/cbits" ],
278 hs_libraries = [ "HStext" ],
279 extra_libraries = [ "HStext_cbits" ],
280 include_dirs = if installing
282 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text/cbits" ],
283 c_includes = [ "HsText.h" ],
284 package_deps = [ "lang" ],
292 import_dirs = if installing
293 then [ clibdir ++ "/imports/util" ]
294 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util"
295 , cFPTOOLS_TOP_ABS ++ "/hslibs/util/check" ],
297 library_dirs = if installing
299 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util"
300 , cFPTOOLS_TOP_ABS ++ "/hslibs/util/cbits" ],
301 hs_libraries = [ "HSutil" ],
302 extra_libraries = [ "HSutil_cbits" ] ++ words cLibsReadline,
303 include_dirs = if installing
305 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util/cbits" ],
306 c_includes = [ "HsUtil.h" ],
307 package_deps = [ "lang", "concurrent"
308 #ifndef mingw32_TARGET_OS
317 -- no cbits at the moment, we'll need to add one if this library
318 -- ever calls out to any C libs.
321 import_dirs = if installing
322 then [ clibdir ++ "/imports/hssource" ]
323 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ],
325 library_dirs = if installing
327 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ],
328 hs_libraries = [ "HShssource" ],
329 extra_libraries = [],
332 package_deps = [ "text" ],
340 import_dirs = if installing
341 then [ clibdir ++ "/imports/greencard" ]
342 else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ],
344 library_dirs = if installing
346 else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ],
347 hs_libraries = [ "HSgreencard" ],
348 extra_libraries = [],
351 package_deps = [ "lang" ],
357 #if defined(mingw32_TARGET_OS) || defined(cygwin32_TARGET_OS)
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" ],
398 ghc_src_dir :: String -> String
399 ghc_src_dir path = cFPTOOLS_TOP_ABS ++ '/':cCURRENT_DIR ++ '/':path