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 , "PrelAddr_Azh_static_info"
71 , "PrelAddr_Wzh_static_info"
72 , "PrelAddr_I64zh_static_info"
73 , "PrelAddr_W64zh_static_info"
74 , "PrelStable_StablePtr_static_info"
75 , "PrelBase_Izh_con_info"
76 , "PrelBase_Czh_con_info"
77 , "PrelFloat_Fzh_con_info"
78 , "PrelFloat_Dzh_con_info"
79 , "PrelAddr_Azh_con_info"
80 , "PrelAddr_Wzh_con_info"
81 , "PrelAddr_I64zh_con_info"
82 , "PrelAddr_W64zh_con_info"
83 , "PrelStable_StablePtr_con_info"
84 , "PrelBase_False_closure"
85 , "PrelBase_True_closure"
86 , "PrelPack_unpackCString_closure"
87 , "PrelIOBase_stackOverflow_closure"
88 , "PrelIOBase_heapOverflow_closure"
89 , "PrelIOBase_NonTermination_closure"
90 , "PrelIOBase_PutFullMVar_closure"
91 , "PrelIOBase_BlockedOnDeadMVar_closure"
92 , "PrelWeak_runFinalizzerBatch_closure"
98 name = "std", -- The Prelude & Standard Hs_libraries
99 import_dirs = if installing
100 then [ clibdir ++ "/imports/std" ]
101 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std" ],
102 library_dirs = if installing
104 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std"
105 , ghc_src_dir cGHC_LIB_DIR ++ "/std/cbits" ],
106 hs_libraries = [ "HSstd" ],
107 extra_libraries = [ "HSstd_cbits" ],
108 include_dirs = if installing
110 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std/cbits" ],
111 c_includes = [ "HsStd.h" ],
112 package_deps = [ "rts" ],
116 #ifdef mingw32_TARGET_OS
126 import_dirs = if installing
127 then [ clibdir ++ "/imports/lang" ]
128 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang"
129 , cFPTOOLS_TOP_ABS ++ "/hslibs/lang/monads" ],
130 library_dirs = if installing
132 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang"
133 , cFPTOOLS_TOP_ABS ++ "/hslibs/lang/cbits" ],
134 hs_libraries = [ "HSlang" ],
135 extra_libraries = [ "HSlang_cbits" ],
136 include_dirs = if installing
138 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang/cbits" ],
139 c_includes = [ "HsLang.h" ],
148 import_dirs = if installing
149 then [ clibdir ++ "/imports/concurrent" ]
150 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ],
151 library_dirs = if installing
153 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ],
154 hs_libraries = [ "HSconcurrent" ],
155 extra_libraries = [],
156 include_dirs = if installing
158 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent/cbits" ],
160 package_deps = [ "lang" ],
168 import_dirs = if installing
169 then [ clibdir ++ "/imports/data" ]
170 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data"
171 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison"
172 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Assoc"
173 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Coll"
174 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Seq" ],
175 library_dirs = if installing
177 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data" ],
178 hs_libraries = [ "HSdata" ],
179 extra_libraries = [],
180 include_dirs = if installing
182 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data/cbits" ],
184 package_deps = [ "lang" ],
192 import_dirs = if installing
193 then [ clibdir ++ "/imports/net" ]
194 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net" ],
195 library_dirs = if installing
197 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net"
198 , cFPTOOLS_TOP_ABS ++ "/hslibs/net/cbits" ],
199 hs_libraries = [ "HSnet" ],
200 extra_libraries = [ "HSnet_cbits" ],
201 include_dirs = if installing
203 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net/cbits" ],
204 c_includes = [ "HsNet.h" ],
205 package_deps = [ "lang", "text" ],
208 extra_ld_opts = if suffixMatch "solaris2" cTARGETPLATFORM
209 then [ "-lnsl", "-lsocket" ]
215 import_dirs = if installing
216 then [ clibdir ++ "/imports/posix" ]
217 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix" ],
218 library_dirs = if installing
220 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix"
221 , cFPTOOLS_TOP_ABS ++ "/hslibs/posix/cbits" ],
222 hs_libraries = [ "HSposix" ],
223 extra_libraries = [ "HSposix_cbits" ],
224 include_dirs = if installing
226 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix/cbits" ],
227 c_includes = [ "HsPosix.h" ],
228 package_deps = [ "lang" ],
236 import_dirs = if installing
237 then [ clibdir ++ "/imports/text" ]
238 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text"
239 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/html"
240 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/HaXml/lib"
241 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/parsec" ],
242 library_dirs = if installing
244 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text"
245 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/cbits" ],
246 hs_libraries = [ "HStext" ],
247 extra_libraries = [ "HStext_cbits" ],
248 include_dirs = if installing
250 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text/cbits" ],
251 c_includes = [ "HsText.h" ],
252 package_deps = [ "lang", "data" ],
260 import_dirs = if installing
261 then [ clibdir ++ "/imports/util" ]
262 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util"
263 , cFPTOOLS_TOP_ABS ++ "/hslibs/util/check" ],
264 library_dirs = if installing
266 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util"
267 , cFPTOOLS_TOP_ABS ++ "/hslibs/util/cbits" ],
268 hs_libraries = [ "HSutil" ],
269 extra_libraries = [ "HSutil_cbits" ],
270 include_dirs = if installing
272 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util/cbits" ],
273 c_includes = [ "HsUtil.h" ],
274 package_deps = [ "lang", "concurrent"
275 #ifndef mingw32_TARGET_OS
281 extra_ld_opts = words cLibsReadline
284 -- no cbits at the moment, we'll need to add one if this library
285 -- ever calls out to any C libs.
288 import_dirs = if installing
289 then [ clibdir ++ "/imports/hssource" ]
290 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ],
291 library_dirs = if installing
293 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ],
294 hs_libraries = [ "HShssource" ],
295 extra_libraries = [],
298 package_deps = [ "text" ],
306 import_dirs = if installing
307 then [ clibdir ++ "/imports/greencard" ]
308 else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ],
309 library_dirs = if installing
311 else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ],
312 hs_libraries = [ "HSgreencard" ],
313 extra_libraries = [],
316 package_deps = [ "lang" ],
324 import_dirs = if installing
325 then [ clibdir ++ "/imports/win32" ]
326 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32" ],
327 library_dirs = if installing
329 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32" ],
330 hs_libraries = [ "HSwin32" ],
331 extra_libraries = [],
333 c_includes = [], -- ???
334 package_deps = [ "lang", "greencard" ],
337 extra_ld_opts = [ "-luser32", "-lgdi32", "-lwinmm" ]
342 import_dirs = if installing
343 then [ clibdir ++ "/imports/com" ]
344 else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ],
345 library_dirs = if installing
347 else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ],
348 hs_libraries = [ "HScom" ],
349 extra_libraries = [],
351 c_includes = [], -- ???
352 package_deps = [ "lang" ],
355 extra_ld_opts = [ "-luser32", "-lole32", "-loleaut32", "-ladvapi32" ]
359 ghc_src_dir :: String -> String
360 ghc_src_dir path = cFPTOOLS_TOP_ABS ++ '/':cCURRENT_DIR ++ '/':path