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" ],
49 #ifndef mingw32_TARGET_OS
52 extra_libraries = [ "winmm" ], -- for the threadDelay timer
54 include_dirs = if installing
55 then [ clibdir ++ "/includes" ]
56 else [ ghc_src_dir cGHC_INCLUDE_DIR ],
57 c_includes = [ "Stg.h" ], -- ha!
58 package_deps = [ "gmp" ],
61 -- the RTS forward-references to a bunch of stuff in the prelude,
62 -- so we force it to be included with special options to ld.
64 #ifndef LEADING_UNDERSCORE
70 "PrelBase_Izh_static_info"
71 , "PrelBase_Czh_static_info"
72 , "PrelFloat_Fzh_static_info"
73 , "PrelFloat_Dzh_static_info"
74 , "PrelPtr_Ptr_static_info"
75 , "PrelWord_Wzh_static_info"
76 , "PrelInt_I8zh_static_info"
77 , "PrelInt_I16zh_static_info"
78 , "PrelInt_I32zh_static_info"
79 , "PrelInt_I64zh_static_info"
80 , "PrelWord_W8zh_static_info"
81 , "PrelWord_W16zh_static_info"
82 , "PrelWord_W32zh_static_info"
83 , "PrelWord_W64zh_static_info"
84 , "PrelStable_StablePtr_static_info"
85 , "PrelBase_Izh_con_info"
86 , "PrelBase_Czh_con_info"
87 , "PrelFloat_Fzh_con_info"
88 , "PrelFloat_Dzh_con_info"
89 , "PrelPtr_Ptr_con_info"
90 , "PrelStable_StablePtr_con_info"
91 , "PrelBase_False_closure"
92 , "PrelBase_True_closure"
93 , "PrelPack_unpackCString_closure"
94 , "PrelIOBase_stackOverflow_closure"
95 , "PrelIOBase_heapOverflow_closure"
96 , "PrelIOBase_NonTermination_closure"
97 , "PrelIOBase_PutFullMVar_closure"
98 , "PrelIOBase_BlockedOnDeadMVar_closure"
99 , "PrelWeak_runFinalizzerBatch_closure"
105 name = "std", -- The Prelude & Standard Hs_libraries
106 import_dirs = if installing
107 then [ clibdir ++ "/imports/std" ]
108 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std" ],
109 library_dirs = if installing
111 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std"
112 , ghc_src_dir cGHC_LIB_DIR ++ "/std/cbits" ],
113 hs_libraries = [ "HSstd" ],
114 extra_libraries = [ "HSstd_cbits" ] ++
115 # ifdef mingw32_TARGET_OS
116 ["wsock32", "msvcrt"]
118 ["m"] -- libm, that is
121 include_dirs = if installing
123 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std/cbits" ],
124 c_includes = [ "HsStd.h" ],
125 package_deps = [ "rts" ],
133 import_dirs = if installing
134 then [ clibdir ++ "/imports/lang" ]
135 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang"
136 , cFPTOOLS_TOP_ABS ++ "/hslibs/lang/monads" ],
137 library_dirs = if installing
139 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang"
140 , cFPTOOLS_TOP_ABS ++ "/hslibs/lang/cbits" ],
141 hs_libraries = [ "HSlang" ],
142 extra_libraries = [ "HSlang_cbits" ],
143 include_dirs = if installing
145 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang/cbits" ],
146 c_includes = [ "HsLang.h" ],
151 #ifndef LEADING_UNDERSCORE
152 "-u Addr_Azh_static_info"
154 "-u _Addr_Azh_static_info"
161 import_dirs = if installing
162 then [ clibdir ++ "/imports/concurrent" ]
163 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ],
164 library_dirs = if installing
166 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ],
167 hs_libraries = [ "HSconcurrent" ],
168 extra_libraries = [],
169 include_dirs = if installing
171 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent/cbits" ],
173 package_deps = [ "lang" ],
181 import_dirs = if installing
182 then [ clibdir ++ "/imports/data" ]
183 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data"
184 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison"
185 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Assoc"
186 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Coll"
187 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Seq" ],
188 library_dirs = if installing
190 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data" ],
191 hs_libraries = [ "HSdata" ],
192 extra_libraries = [],
193 include_dirs = if installing
195 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data/cbits" ],
197 package_deps = [ "lang", "util" ],
205 import_dirs = if installing
206 then [ clibdir ++ "/imports/net" ]
207 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net" ],
208 library_dirs = if installing
210 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net"
211 , cFPTOOLS_TOP_ABS ++ "/hslibs/net/cbits" ],
212 hs_libraries = [ "HSnet" ],
213 extra_libraries = [ "HSnet_cbits" ]
214 ++ if suffixMatch "solaris2" cTARGETPLATFORM
215 then [ "nsl", "socket" ]
218 include_dirs = if installing
220 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net/cbits" ],
221 c_includes = [ "HsNet.h" ],
222 package_deps = [ "lang", "text", "concurrent" ],
230 import_dirs = if installing
231 then [ clibdir ++ "/imports/posix" ]
232 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix" ],
233 library_dirs = if installing
235 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix"
236 , cFPTOOLS_TOP_ABS ++ "/hslibs/posix/cbits" ],
237 hs_libraries = [ "HSposix" ],
238 extra_libraries = [ "HSposix_cbits" ],
239 include_dirs = if installing
241 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix/cbits" ],
242 c_includes = [ "HsPosix.h" ],
243 package_deps = [ "lang" ],
251 import_dirs = if installing
252 then [ clibdir ++ "/imports/text" ]
253 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text"
254 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/html"
255 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/HaXml/lib"
256 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/parsec" ],
257 library_dirs = if installing
259 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text"
260 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/cbits" ],
261 hs_libraries = [ "HStext" ],
262 extra_libraries = [ "HStext_cbits" ],
263 include_dirs = if installing
265 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text/cbits" ],
266 c_includes = [ "HsText.h" ],
267 package_deps = [ "lang" ],
275 import_dirs = if installing
276 then [ clibdir ++ "/imports/util" ]
277 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util"
278 , cFPTOOLS_TOP_ABS ++ "/hslibs/util/check" ],
279 library_dirs = if installing
281 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util"
282 , cFPTOOLS_TOP_ABS ++ "/hslibs/util/cbits" ],
283 hs_libraries = [ "HSutil" ],
284 extra_libraries = [ "HSutil_cbits" ],
285 include_dirs = if installing
287 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util/cbits" ],
288 c_includes = [ "HsUtil.h" ],
289 package_deps = [ "lang", "concurrent"
290 #ifndef mingw32_TARGET_OS
296 extra_ld_opts = words cLibsReadline
299 -- no cbits at the moment, we'll need to add one if this library
300 -- ever calls out to any C libs.
303 import_dirs = if installing
304 then [ clibdir ++ "/imports/hssource" ]
305 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ],
306 library_dirs = if installing
308 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ],
309 hs_libraries = [ "HShssource" ],
310 extra_libraries = [],
313 package_deps = [ "text" ],
321 import_dirs = if installing
322 then [ clibdir ++ "/imports/greencard" ]
323 else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ],
324 library_dirs = if installing
326 else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ],
327 hs_libraries = [ "HSgreencard" ],
328 extra_libraries = [],
331 package_deps = [ "lang" ],
339 import_dirs = if installing
340 then [ clibdir ++ "/imports/win32" ]
341 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32" ],
342 library_dirs = if installing
344 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32" ],
345 hs_libraries = [ "HSwin32" ],
346 extra_libraries = [ "user32", "gdi32", "winmm" ],
348 c_includes = [], -- ???
349 package_deps = [ "lang", "greencard" ],
357 import_dirs = if installing
358 then [ clibdir ++ "/imports/com" ]
359 else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ],
360 library_dirs = if installing
362 else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ],
363 hs_libraries = [ "HScom" ],
364 extra_libraries = [ "user32", "ole32", "oleaut32", "advapi32" ],
366 c_includes = [], -- ???
367 package_deps = [ "lang" ],
374 ghc_src_dir :: String -> String
375 ghc_src_dir path = cFPTOOLS_TOP_ABS ++ '/':cCURRENT_DIR ++ '/':path