1 #include "../includes/config.h"
3 module Main (main) where
16 [ "install" ] -> do { putStrLn (dumpPackages (package_details True)) }
17 [ "in-place" ] -> do { putStrLn (dumpPackages (package_details False)) }
18 _ -> do hPutStr stderr "usage: pkgconf (install | in-place)\n"
19 exitWith (ExitFailure 1)
21 package_details :: Bool -> [Package]
22 package_details installing =
25 name = "gmp", -- GMP is at the bottom of the heap
27 library_dirs = if cHaveLibGmp == "YES"
31 else [ ghc_src_dir cGHC_RUNTIME_DIR ++ "/gmp" ],
33 extra_libraries = [ "gmp" ],
43 name = "rts", -- The RTS is just another package!
45 library_dirs = if installing
47 else [ ghc_src_dir cGHC_RUNTIME_DIR ],
48 hs_libraries = [ "HSrts" ],
50 include_dirs = if installing
51 then [ clibdir ++ "/includes" ]
52 else [ ghc_src_dir cGHC_INCLUDE_DIR ],
53 c_includes = [ "Stg.h" ], -- ha!
54 package_deps = [ "gmp" ],
57 -- the RTS forward-references to a bunch of stuff in the prelude,
58 -- so we force it to be included with special options to ld.
60 #ifndef LEADING_UNDERSCORE
66 "PrelBase_Izh_static_info"
67 , "PrelBase_Czh_static_info"
68 , "PrelFloat_Fzh_static_info"
69 , "PrelFloat_Dzh_static_info"
70 , "PrelPtr_Ptr_static_info"
71 , "PrelWord_Wzh_static_info"
72 , "PrelInt_I8zh_static_info"
73 , "PrelInt_I16zh_static_info"
74 , "PrelInt_I32zh_static_info"
75 , "PrelInt_I64zh_static_info"
76 , "PrelWord_W8zh_static_info"
77 , "PrelWord_W16zh_static_info"
78 , "PrelWord_W32zh_static_info"
79 , "PrelWord_W64zh_static_info"
80 , "PrelStable_StablePtr_static_info"
81 , "PrelBase_Izh_con_info"
82 , "PrelBase_Czh_con_info"
83 , "PrelFloat_Fzh_con_info"
84 , "PrelFloat_Dzh_con_info"
85 , "PrelPtr_Ptr_con_info"
86 , "PrelStable_StablePtr_con_info"
87 , "PrelBase_False_closure"
88 , "PrelBase_True_closure"
89 , "PrelPack_unpackCString_closure"
90 , "PrelIOBase_stackOverflow_closure"
91 , "PrelIOBase_heapOverflow_closure"
92 , "PrelIOBase_NonTermination_closure"
93 , "PrelIOBase_PutFullMVar_closure"
94 , "PrelIOBase_BlockedOnDeadMVar_closure"
95 , "PrelWeak_runFinalizzerBatch_closure"
101 name = "std", -- The Prelude & Standard Hs_libraries
102 import_dirs = if installing
103 then [ clibdir ++ "/imports/std" ]
104 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std" ],
105 library_dirs = if installing
107 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std"
108 , ghc_src_dir cGHC_LIB_DIR ++ "/std/cbits" ],
109 hs_libraries = [ "HSstd" ],
110 extra_libraries = [ "HSstd_cbits" ],
111 include_dirs = if installing
113 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std/cbits" ],
114 c_includes = [ "HsStd.h" ],
115 package_deps = [ "rts" ],
119 #ifdef mingw32_TARGET_OS
129 import_dirs = if installing
130 then [ clibdir ++ "/imports/lang" ]
131 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang"
132 , cFPTOOLS_TOP_ABS ++ "/hslibs/lang/monads" ],
133 library_dirs = if installing
135 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang"
136 , cFPTOOLS_TOP_ABS ++ "/hslibs/lang/cbits" ],
137 hs_libraries = [ "HSlang" ],
138 extra_libraries = [ "HSlang_cbits" ],
139 include_dirs = if installing
141 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang/cbits" ],
142 c_includes = [ "HsLang.h" ],
151 import_dirs = if installing
152 then [ clibdir ++ "/imports/concurrent" ]
153 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ],
154 library_dirs = if installing
156 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ],
157 hs_libraries = [ "HSconcurrent" ],
158 extra_libraries = [],
159 include_dirs = if installing
161 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent/cbits" ],
163 package_deps = [ "lang" ],
171 import_dirs = if installing
172 then [ clibdir ++ "/imports/data" ]
173 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data"
174 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison"
175 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Assoc"
176 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Coll"
177 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Seq" ],
178 library_dirs = if installing
180 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data" ],
181 hs_libraries = [ "HSdata" ],
182 extra_libraries = [],
183 include_dirs = if installing
185 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data/cbits" ],
187 package_deps = [ "lang" ],
195 import_dirs = if installing
196 then [ clibdir ++ "/imports/net" ]
197 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net" ],
198 library_dirs = if installing
200 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net"
201 , cFPTOOLS_TOP_ABS ++ "/hslibs/net/cbits" ],
202 hs_libraries = [ "HSnet" ],
203 extra_libraries = [ "HSnet_cbits" ],
204 include_dirs = if installing
206 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net/cbits" ],
207 c_includes = [ "HsNet.h" ],
208 package_deps = [ "lang", "text" ],
211 extra_ld_opts = if suffixMatch "solaris2" cTARGETPLATFORM
212 then [ "-lnsl", "-lsocket" ]
218 import_dirs = if installing
219 then [ clibdir ++ "/imports/posix" ]
220 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix" ],
221 library_dirs = if installing
223 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix"
224 , cFPTOOLS_TOP_ABS ++ "/hslibs/posix/cbits" ],
225 hs_libraries = [ "HSposix" ],
226 extra_libraries = [ "HSposix_cbits" ],
227 include_dirs = if installing
229 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix/cbits" ],
230 c_includes = [ "HsPosix.h" ],
231 package_deps = [ "lang" ],
239 import_dirs = if installing
240 then [ clibdir ++ "/imports/text" ]
241 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text"
242 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/html"
243 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/HaXml/lib"
244 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/parsec" ],
245 library_dirs = if installing
247 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text"
248 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/cbits" ],
249 hs_libraries = [ "HStext" ],
250 extra_libraries = [ "HStext_cbits" ],
251 include_dirs = if installing
253 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text/cbits" ],
254 c_includes = [ "HsText.h" ],
255 package_deps = [ "lang", "data" ],
263 import_dirs = if installing
264 then [ clibdir ++ "/imports/util" ]
265 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util"
266 , cFPTOOLS_TOP_ABS ++ "/hslibs/util/check" ],
267 library_dirs = if installing
269 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util"
270 , cFPTOOLS_TOP_ABS ++ "/hslibs/util/cbits" ],
271 hs_libraries = [ "HSutil" ],
272 extra_libraries = [ "HSutil_cbits" ],
273 include_dirs = if installing
275 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util/cbits" ],
276 c_includes = [ "HsUtil.h" ],
277 package_deps = [ "lang", "concurrent"
278 #ifndef mingw32_TARGET_OS
284 extra_ld_opts = words cLibsReadline
287 -- no cbits at the moment, we'll need to add one if this library
288 -- ever calls out to any C libs.
291 import_dirs = if installing
292 then [ clibdir ++ "/imports/hssource" ]
293 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ],
294 library_dirs = if installing
296 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ],
297 hs_libraries = [ "HShssource" ],
298 extra_libraries = [],
301 package_deps = [ "text" ],
309 import_dirs = if installing
310 then [ clibdir ++ "/imports/greencard" ]
311 else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ],
312 library_dirs = if installing
314 else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ],
315 hs_libraries = [ "HSgreencard" ],
316 extra_libraries = [],
319 package_deps = [ "lang" ],
327 import_dirs = if installing
328 then [ clibdir ++ "/imports/win32" ]
329 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32" ],
330 library_dirs = if installing
332 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32" ],
333 hs_libraries = [ "HSwin32" ],
334 extra_libraries = [],
336 c_includes = [], -- ???
337 package_deps = [ "lang", "greencard" ],
340 extra_ld_opts = [ "-luser32", "-lgdi32", "-lwinmm" ]
345 import_dirs = if installing
346 then [ clibdir ++ "/imports/com" ]
347 else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ],
348 library_dirs = if installing
350 else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ],
351 hs_libraries = [ "HScom" ],
352 extra_libraries = [],
354 c_includes = [], -- ???
355 package_deps = [ "lang" ],
358 extra_ld_opts = [ "-luser32", "-lole32", "-loleaut32", "-ladvapi32" ]
362 ghc_src_dir :: String -> String
363 ghc_src_dir path = cFPTOOLS_TOP_ABS ++ '/':cCURRENT_DIR ++ '/':path