1 #include "../includes/config.h"
3 module Main (main) where
15 ("install":rest) -> do { putStrLn (dumpPackages (package_details True rest)) }
16 ("in-place":rest) -> do { putStrLn (dumpPackages (package_details False rest)) }
17 _ -> do hPutStr stderr "usage: pkgconf (install | in-place) ...\n"
18 exitWith (ExitFailure 1)
20 -- The compiler automatically replaces the string "$libdir" at the
21 -- beginning of a path with the appropriate directory: either the
22 -- wired-in libdir or the one passed to the compiler via the -B<dir>
23 -- flag. This is how we make package.conf independent of GHC's
24 -- installation location.
26 package_details :: Bool -> [String] -> [PackageConfig]
27 package_details installing
40 name = "gmp", -- GMP is at the bottom of the heap
43 library_dirs = if cHaveLibGmp == "YES"
47 else [ ghc_src_dir cGHC_RUNTIME_DIR ++ "/gmp" ],
49 extra_libraries = [ "gmp" ],
59 name = "rts", -- The RTS is just another package!
62 library_dirs = if installing
64 else [ ghc_src_dir cGHC_RUNTIME_DIR ],
65 hs_libraries = [ "HSrts" ],
66 #ifndef mingw32_TARGET_OS
69 extra_libraries = [ "winmm" ], -- for the threadDelay timer
71 include_dirs = if installing
72 then [ "$libdir/includes" ]
73 else [ ghc_src_dir cGHC_INCLUDE_DIR ],
74 c_includes = [ "Stg.h" ], -- ha!
75 package_deps = [ "gmp" ],
78 -- the RTS forward-references to a bunch of stuff in the prelude,
79 -- so we force it to be included with special options to ld.
81 #ifndef LEADING_UNDERSCORE
87 "PrelBase_Izh_static_info"
88 , "PrelBase_Czh_static_info"
89 , "PrelFloat_Fzh_static_info"
90 , "PrelFloat_Dzh_static_info"
91 , "PrelPtr_Ptr_static_info"
92 , "PrelWord_Wzh_static_info"
93 , "PrelInt_I8zh_static_info"
94 , "PrelInt_I16zh_static_info"
95 , "PrelInt_I32zh_static_info"
96 , "PrelInt_I64zh_static_info"
97 , "PrelWord_W8zh_static_info"
98 , "PrelWord_W16zh_static_info"
99 , "PrelWord_W32zh_static_info"
100 , "PrelWord_W64zh_static_info"
101 , "PrelStable_StablePtr_static_info"
102 , "PrelBase_Izh_con_info"
103 , "PrelBase_Czh_con_info"
104 , "PrelFloat_Fzh_con_info"
105 , "PrelFloat_Dzh_con_info"
106 , "PrelPtr_Ptr_con_info"
107 , "PrelStable_StablePtr_con_info"
108 , "PrelBase_False_closure"
109 , "PrelBase_True_closure"
110 , "PrelPack_unpackCString_closure"
111 , "PrelIOBase_stackOverflow_closure"
112 , "PrelIOBase_heapOverflow_closure"
113 , "PrelIOBase_NonTermination_closure"
114 , "PrelIOBase_BlockedOnDeadMVar_closure"
115 , "PrelWeak_runFinalizzerBatch_closure"
121 name = "std", -- The Prelude & Standard Hs_libraries
122 import_dirs = if installing
123 then [ "$libdir/imports/std" ]
124 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std" ],
126 library_dirs = if installing
128 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std"
129 , ghc_src_dir cGHC_LIB_DIR ++ "/std/cbits" ],
130 hs_libraries = [ "HSstd" ],
131 extra_libraries = [ "HSstd_cbits" ] ++
132 # ifdef mingw32_TARGET_OS
133 ["wsock32", "msvcrt"]
135 ["m"] -- libm, that is
138 include_dirs = if installing
140 else [ ghc_src_dir cGHC_LIB_DIR ++ "/std/cbits" ],
141 c_includes = [ "HsStd.h" ],
142 package_deps = [ "rts" ],
150 import_dirs = if installing
151 then [ "$libdir/imports/lang" ]
152 else [ "$libdir/hslibs/lang"
153 , "$libdir/hslibs/lang/monads" ],
155 library_dirs = if installing
157 else [ "$libdir/hslibs/lang"
158 , "$libdir/hslibs/lang/cbits" ],
159 hs_libraries = [ "HSlang" ],
160 extra_libraries = [ "HSlang_cbits" ],
161 include_dirs = if installing
163 else [ "$libdir/hslibs/lang/cbits" ],
164 c_includes = [ "HsLang.h" ],
169 #ifndef LEADING_UNDERSCORE
170 "-u Addr_Azh_static_info"
172 "-u _Addr_Azh_static_info"
179 import_dirs = if installing
180 then [ "$libdir/imports/concurrent" ]
181 else [ "$libdir/hslibs/concurrent" ],
183 library_dirs = if installing
185 else [ "$libdir/hslibs/concurrent" ],
186 hs_libraries = [ "HSconcurrent" ],
187 extra_libraries = [],
188 include_dirs = if installing
190 else [ "$libdir/hslibs/concurrent/cbits" ],
192 package_deps = [ "lang" ],
200 import_dirs = if installing
201 then [ "$libdir/imports/data" ]
202 else [ "$libdir/hslibs/data"
203 , "$libdir/hslibs/data/edison"
204 , "$libdir/hslibs/data/edison/Assoc"
205 , "$libdir/hslibs/data/edison/Coll"
206 , "$libdir/hslibs/data/edison/Seq" ],
208 library_dirs = if installing
210 else [ "$libdir/hslibs/data" ],
211 hs_libraries = [ "HSdata" ],
212 extra_libraries = [],
213 include_dirs = if installing
215 else [ "$libdir/hslibs/data/cbits" ],
217 package_deps = [ "lang", "util" ],
225 import_dirs = if installing
226 then [ "$libdir/imports/net" ]
227 else [ "$libdir/hslibs/net" ],
229 library_dirs = if installing
231 else [ "$libdir/hslibs/net"
232 , "$libdir/hslibs/net/cbits" ],
233 hs_libraries = [ "HSnet" ],
234 extra_libraries = if suffixMatch "solaris2" cTARGETPLATFORM
235 then [ "nsl", "socket" ]
238 include_dirs = if installing
240 else [ "$libdir/hslibs/net/cbits" ],
241 c_includes = [ "HsNet.h" ],
242 package_deps = [ "lang", "text", "concurrent" ],
250 import_dirs = if installing
251 then [ "$libdir/imports/posix" ]
252 else [ "$libdir/hslibs/posix" ],
254 library_dirs = if installing
256 else [ "$libdir/hslibs/posix"
257 , "$libdir/hslibs/posix/cbits" ],
258 hs_libraries = [ "HSposix" ],
259 extra_libraries = [ "HSposix_cbits" ],
260 include_dirs = if installing
262 else [ "$libdir/hslibs/posix/cbits" ],
263 c_includes = [ "HsPosix.h" ],
264 package_deps = [ "lang" ],
272 import_dirs = if installing
273 then [ "$libdir/imports/text" ]
274 else [ "$libdir/hslibs/text"
275 , "$libdir/hslibs/text/html"
276 , "$libdir/hslibs/text/HaXml/lib"
277 , "$libdir/hslibs/text/parsec" ],
279 library_dirs = if installing
281 else [ "$libdir/hslibs/text"
282 , "$libdir/hslibs/text/cbits" ],
283 hs_libraries = [ "HStext" ],
284 extra_libraries = [ "HStext_cbits" ],
285 include_dirs = if installing
287 else [ "$libdir/hslibs/text/cbits" ],
288 c_includes = [ "HsText.h" ],
289 package_deps = [ "lang" ],
297 import_dirs = if installing
298 then [ "$libdir/imports/util" ]
299 else [ "$libdir/hslibs/util"
300 , "$libdir/hslibs/util/check" ],
302 library_dirs = if installing
304 else [ "$libdir/hslibs/util"
305 , "$libdir/hslibs/util/cbits" ],
306 hs_libraries = [ "HSutil" ],
307 extra_libraries = [ "HSutil_cbits" ] ++ words cLibsReadline,
308 include_dirs = if installing
310 else [ "$libdir/hslibs/util/cbits" ],
311 c_includes = [ "HsUtil.h" ],
312 package_deps = [ "lang", "concurrent"
313 #ifndef mingw32_TARGET_OS
322 -- no cbits at the moment, we'll need to add one if this library
323 -- ever calls out to any C libs.
326 import_dirs = if installing
327 then [ "$libdir/imports/hssource" ]
328 else [ "$libdir/hslibs/hssource" ],
330 library_dirs = if installing
332 else [ "$libdir/hslibs/hssource" ],
333 hs_libraries = [ "HShssource" ],
334 extra_libraries = [],
337 package_deps = [ "text" ],
345 import_dirs = if installing
346 then [ "$libdir/imports/greencard" ]
347 else [ "$libdir/green-card/lib/ghc" ],
349 library_dirs = if installing
351 else [ "$libdir/green-card/lib/ghc" ],
352 hs_libraries = [ "HSgreencard" ],
353 extra_libraries = [],
356 package_deps = [ "lang" ],
362 #if defined(mingw32_TARGET_OS) || defined(cygwin32_TARGET_OS)
365 import_dirs = if installing
366 then [ "$libdir/imports/win32" ]
367 else [ "$libdir/hslibs/win32" ],
369 library_dirs = if installing
371 else [ "$libdir/hslibs/win32" ],
372 hs_libraries = [ "HSwin32" ],
373 extra_libraries = [ "user32", "gdi32", "winmm" ],
375 c_includes = [], -- ???
376 package_deps = [ "lang", "greencard" ],
384 import_dirs = if installing
385 then [ "$libdir/imports/com" ]
386 else [ "$libdir/hdirect/lib" ],
388 library_dirs = if installing
390 else [ "$libdir/hdirect/lib" ],
391 hs_libraries = [ "HScom" ],
392 extra_libraries = [ "user32", "ole32", "oleaut32", "advapi32" ],
394 c_includes = [], -- ???
395 package_deps = [ "lang" ],
403 ghc_src_dir :: String -> String
404 ghc_src_dir path = "$libdir/" ++ cCURRENT_DIR ++ '/':path