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 -> [PackageConfig]
22 package_details installing =
25 name = "gmp", -- GMP is at the bottom of the heap
28 library_dirs = if cHaveLibGmp == "YES"
32 else [ ghc_src_dir cGHC_RUNTIME_DIR ++ "/gmp" ],
34 extra_libraries = [ "gmp" ],
44 name = "rts", -- The RTS is just another package!
47 library_dirs = if installing
49 else [ ghc_src_dir cGHC_RUNTIME_DIR ],
50 hs_libraries = [ "HSrts" ],
51 #ifndef mingw32_TARGET_OS
54 extra_libraries = [ "winmm" ], -- for the threadDelay timer
56 include_dirs = if installing
57 then [ clibdir ++ "/includes" ]
58 else [ ghc_src_dir cGHC_INCLUDE_DIR ],
59 c_includes = [ "Stg.h" ], -- ha!
60 package_deps = [ "gmp" ],
63 -- the RTS forward-references to a bunch of stuff in the prelude,
64 -- so we force it to be included with special options to ld.
66 #ifndef LEADING_UNDERSCORE
72 "PrelBase_Izh_static_info"
73 , "PrelBase_Czh_static_info"
74 , "PrelFloat_Fzh_static_info"
75 , "PrelFloat_Dzh_static_info"
76 , "PrelPtr_Ptr_static_info"
77 , "PrelWord_Wzh_static_info"
78 , "PrelInt_I8zh_static_info"
79 , "PrelInt_I16zh_static_info"
80 , "PrelInt_I32zh_static_info"
81 , "PrelInt_I64zh_static_info"
82 , "PrelWord_W8zh_static_info"
83 , "PrelWord_W16zh_static_info"
84 , "PrelWord_W32zh_static_info"
85 , "PrelWord_W64zh_static_info"
86 , "PrelStable_StablePtr_static_info"
87 , "PrelBase_Izh_con_info"
88 , "PrelBase_Czh_con_info"
89 , "PrelFloat_Fzh_con_info"
90 , "PrelFloat_Dzh_con_info"
91 , "PrelPtr_Ptr_con_info"
92 , "PrelStable_StablePtr_con_info"
93 , "PrelBase_False_closure"
94 , "PrelBase_True_closure"
95 , "PrelPack_unpackCString_closure"
96 , "PrelIOBase_stackOverflow_closure"
97 , "PrelIOBase_heapOverflow_closure"
98 , "PrelIOBase_NonTermination_closure"
99 , "PrelIOBase_BlockedOnDeadMVar_closure"
100 , "PrelWeak_runFinalizzerBatch_closure"
106 name = "std", -- The Prelude & Standard Hs_libraries
107 import_dirs = if installing
108 then [ clibdir ++ "/imports/std" ]
109 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std" ],
111 library_dirs = if installing
113 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std"
114 , ghc_src_dir cGHC_LIB_DIR ++ "/std/cbits" ],
115 hs_libraries = [ "HSstd" ],
116 extra_libraries = [ "HSstd_cbits" ] ++
117 # ifdef mingw32_TARGET_OS
118 ["wsock32", "msvcrt"]
120 ["m"] -- libm, that is
123 include_dirs = if installing
125 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std/cbits" ],
126 c_includes = [ "HsStd.h" ],
127 package_deps = [ "rts" ],
135 import_dirs = if installing
136 then [ clibdir ++ "/imports/lang" ]
137 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang"
138 , cFPTOOLS_TOP_ABS ++ "/hslibs/lang/monads" ],
140 library_dirs = if installing
142 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang"
143 , cFPTOOLS_TOP_ABS ++ "/hslibs/lang/cbits" ],
144 hs_libraries = [ "HSlang" ],
145 extra_libraries = [ "HSlang_cbits" ],
146 include_dirs = if installing
148 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang/cbits" ],
149 c_includes = [ "HsLang.h" ],
154 #ifndef LEADING_UNDERSCORE
155 "-u Addr_Azh_static_info"
157 "-u _Addr_Azh_static_info"
164 import_dirs = if installing
165 then [ clibdir ++ "/imports/concurrent" ]
166 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ],
168 library_dirs = if installing
170 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ],
171 hs_libraries = [ "HSconcurrent" ],
172 extra_libraries = [],
173 include_dirs = if installing
175 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent/cbits" ],
177 package_deps = [ "lang" ],
185 import_dirs = if installing
186 then [ clibdir ++ "/imports/data" ]
187 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data"
188 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison"
189 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Assoc"
190 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Coll"
191 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Seq" ],
193 library_dirs = if installing
195 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data" ],
196 hs_libraries = [ "HSdata" ],
197 extra_libraries = [],
198 include_dirs = if installing
200 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data/cbits" ],
202 package_deps = [ "lang", "util" ],
210 import_dirs = if installing
211 then [ clibdir ++ "/imports/net" ]
212 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net" ],
214 library_dirs = if installing
216 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net"
217 , cFPTOOLS_TOP_ABS ++ "/hslibs/net/cbits" ],
218 hs_libraries = [ "HSnet" ],
219 extra_libraries = [ "HSnet_cbits" ]
220 ++ if suffixMatch "solaris2" cTARGETPLATFORM
221 then [ "nsl", "socket" ]
224 include_dirs = if installing
226 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net/cbits" ],
227 c_includes = [ "HsNet.h" ],
228 package_deps = [ "lang", "text", "concurrent" ],
236 import_dirs = if installing
237 then [ clibdir ++ "/imports/posix" ]
238 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix" ],
240 library_dirs = if installing
242 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix"
243 , cFPTOOLS_TOP_ABS ++ "/hslibs/posix/cbits" ],
244 hs_libraries = [ "HSposix" ],
245 extra_libraries = [ "HSposix_cbits" ],
246 include_dirs = if installing
248 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix/cbits" ],
249 c_includes = [ "HsPosix.h" ],
250 package_deps = [ "lang" ],
258 import_dirs = if installing
259 then [ clibdir ++ "/imports/text" ]
260 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text"
261 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/html"
262 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/HaXml/lib"
263 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/parsec" ],
265 library_dirs = if installing
267 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text"
268 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/cbits" ],
269 hs_libraries = [ "HStext" ],
270 extra_libraries = [ "HStext_cbits" ],
271 include_dirs = if installing
273 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text/cbits" ],
274 c_includes = [ "HsText.h" ],
275 package_deps = [ "lang" ],
283 import_dirs = if installing
284 then [ clibdir ++ "/imports/util" ]
285 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util"
286 , cFPTOOLS_TOP_ABS ++ "/hslibs/util/check" ],
288 library_dirs = if installing
290 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util"
291 , cFPTOOLS_TOP_ABS ++ "/hslibs/util/cbits" ],
292 hs_libraries = [ "HSutil" ],
293 extra_libraries = [ "HSutil_cbits" ],
294 include_dirs = if installing
296 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util/cbits" ],
297 c_includes = [ "HsUtil.h" ],
298 package_deps = [ "lang", "concurrent"
299 #ifndef mingw32_TARGET_OS
305 extra_ld_opts = words cLibsReadline
308 -- no cbits at the moment, we'll need to add one if this library
309 -- ever calls out to any C libs.
312 import_dirs = if installing
313 then [ clibdir ++ "/imports/hssource" ]
314 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ],
316 library_dirs = if installing
318 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ],
319 hs_libraries = [ "HShssource" ],
320 extra_libraries = [],
323 package_deps = [ "text" ],
331 import_dirs = if installing
332 then [ clibdir ++ "/imports/greencard" ]
333 else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ],
335 library_dirs = if installing
337 else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ],
338 hs_libraries = [ "HSgreencard" ],
339 extra_libraries = [],
342 package_deps = [ "lang" ],
350 import_dirs = if installing
351 then [ clibdir ++ "/imports/win32" ]
352 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32" ],
354 library_dirs = if installing
356 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32" ],
357 hs_libraries = [ "HSwin32" ],
358 extra_libraries = [ "user32", "gdi32", "winmm" ],
360 c_includes = [], -- ???
361 package_deps = [ "lang", "greencard" ],
369 import_dirs = if installing
370 then [ clibdir ++ "/imports/com" ]
371 else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ],
373 library_dirs = if installing
375 else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ],
376 hs_libraries = [ "HScom" ],
377 extra_libraries = [ "user32", "ole32", "oleaut32", "advapi32" ],
379 c_includes = [], -- ???
380 package_deps = [ "lang" ],
387 ghc_src_dir :: String -> String
388 ghc_src_dir path = cFPTOOLS_TOP_ABS ++ '/':cCURRENT_DIR ++ '/':path