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" ],
115 extra_ld_opts = [ "-lm"
116 #ifdef mingw32_TARGET_OS
124 import_dirs = if installing
125 then [ clibdir ++ "/imports/lang" ]
126 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang"
127 , cFPTOOLS_TOP_ABS ++ "/hslibs/lang/monads" ],
128 library_dirs = if installing
130 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang"
131 , cFPTOOLS_TOP_ABS ++ "/hslibs/lang/cbits" ],
132 hs_libraries = [ "HSlang" ],
133 extra_libraries = [ "HSlang_cbits" ],
134 include_dirs = if installing
136 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang/cbits" ],
137 c_includes = [ "HsLang.h" ],
146 import_dirs = if installing
147 then [ clibdir ++ "/imports/concurrent" ]
148 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ],
149 library_dirs = if installing
151 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ],
152 hs_libraries = [ "HSconcurrent" ],
153 extra_libraries = [],
154 include_dirs = if installing
156 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent/cbits" ],
157 c_includes = [ "HsConcurrent.h" ],
158 package_deps = [ "lang" ],
166 import_dirs = if installing
167 then [ clibdir ++ "/imports/data" ]
168 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data"
169 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison"
170 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Assoc"
171 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Coll"
172 , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Seq" ],
173 library_dirs = if installing
175 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data" ],
176 hs_libraries = [ "HSdata" ],
177 extra_libraries = [],
178 include_dirs = if installing
180 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data/cbits" ],
181 c_includes = [ "HsData.h" ],
182 package_deps = [ "lang" ],
190 import_dirs = if installing
191 then [ clibdir ++ "/imports/net" ]
192 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net" ],
193 library_dirs = if installing
195 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net"
196 , cFPTOOLS_TOP_ABS ++ "/hslibs/net/cbits" ],
197 hs_libraries = [ "HSnet" ],
198 extra_libraries = [ "HSnet_cbits" ],
199 include_dirs = if installing
201 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net/cbits" ],
202 c_includes = [ "HsNet.h" ],
203 package_deps = [ "lang", "text" ],
206 extra_ld_opts = if suffixMatch "solaris2" cTARGETPLATFORM
207 then [ "-lnsl", "-lsocket" ]
213 import_dirs = if installing
214 then [ clibdir ++ "/imports/posix" ]
215 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix" ],
216 library_dirs = if installing
218 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix"
219 , cFPTOOLS_TOP_ABS ++ "/hslibs/posix/cbits" ],
220 hs_libraries = [ "HSposix" ],
221 extra_libraries = [ "HSposix_cbits" ],
222 include_dirs = if installing
224 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix/cbits" ],
225 c_includes = [ "HsPosix.h" ],
226 package_deps = [ "lang" ],
234 import_dirs = if installing
235 then [ clibdir ++ "/imports/text" ]
236 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text"
237 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/html"
238 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/HaXml/lib"
239 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/parsec" ],
240 library_dirs = if installing
242 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text"
243 , cFPTOOLS_TOP_ABS ++ "/hslibs/text/cbits" ],
244 hs_libraries = [ "HStext" ],
245 extra_libraries = [ "HStext_cbits" ],
246 include_dirs = if installing
248 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text/cbits" ],
249 c_includes = [ "HsText.h" ],
250 package_deps = [ "lang", "data" ],
258 import_dirs = if installing
259 then [ clibdir ++ "/imports/util" ]
260 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util"
261 , cFPTOOLS_TOP_ABS ++ "/hslibs/util/check" ],
262 library_dirs = if installing
264 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util"
265 , cFPTOOLS_TOP_ABS ++ "/hslibs/util/cbits" ],
266 hs_libraries = [ "HSutil" ],
267 extra_libraries = [ "HSutil_cbits" ],
268 include_dirs = if installing
270 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util/cbits" ],
271 c_includes = [ "HsUtil.h" ],
272 package_deps = [ "lang", "concurrent"
273 #ifndef mingw32_TARGET_OS
279 extra_ld_opts = words cLibsReadline
282 -- no cbits at the moment, we'll need to add one if this library
283 -- ever calls out to any C libs.
286 import_dirs = if installing
287 then [ clibdir ++ "/imports/hssource" ]
288 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ],
289 library_dirs = if installing
291 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ],
292 hs_libraries = [ "HShssource" ],
293 extra_libraries = [],
296 package_deps = [ "text" ],
304 import_dirs = if installing
305 then [ clibdir ++ "/imports/win32" ]
306 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32/src" ],
307 library_dirs = if installing
309 else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32/src" ],
310 hs_libraries = [ "HSwin32" ],
311 extra_libraries = [],
313 c_includes = [], -- ???
314 package_deps = [ "lang" ],
317 extra_ld_opts = [ "-luser32", "-lgdi32" ]
322 import_dirs = if installing
323 then [ clibdir ++ "/imports/com" ]
324 else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ],
325 library_dirs = if installing
327 else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ],
328 hs_libraries = [ "HScom" ],
329 extra_libraries = [],
331 c_includes = [], -- ???
332 package_deps = [ "lang" ],
335 extra_ld_opts = [ "-luser32", "-lole32", "-loleaut32", "-ladvapi32" ]
339 ghc_src_dir :: String -> String
340 ghc_src_dir path = cFPTOOLS_TOP_ABS ++ '/':cCURRENT_DIR ++ '/':path