X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdriver%2FPackageSrc.hs;h=474ae4fa4367043d9ef10a570ae06b752a943eb3;hb=8de7cb84a9de88b8d2db923d25b9adbdd6df09fc;hp=ad10cf09255550f6518ef00ac53b0fd0de917883;hpb=a30fbb323ef7eadd74c8fae51f1e402cd5f965b7;p=ghc-hetmet.git diff --git a/ghc/driver/PackageSrc.hs b/ghc/driver/PackageSrc.hs index ad10cf0..474ae4f 100644 --- a/ghc/driver/PackageSrc.hs +++ b/ghc/driver/PackageSrc.hs @@ -1,4 +1,5 @@ #include "../includes/config.h" +#include "../includes/Derived.h" module Main (main) where @@ -34,6 +35,8 @@ package_details installing , cGHC_RUNTIME_DIR , cGHC_UTILS_DIR , cGHC_INCLUDE_DIR + , cX_CFLAGS + , cX_LIBS ] = [ @@ -61,16 +64,31 @@ package_details installing import_dirs = [], source_dirs = [], library_dirs = if installing - then [ "$libdir" ] + then +#ifdef mingw32_TARGET_OS + -- force the dist-provided gcc-lib/ into scope. + [ "$libdir", "$libdir/gcc-lib" ] +#else + [ "$libdir" ] +#endif else [ ghc_src_dir cGHC_RUNTIME_DIR ], hs_libraries = [ "HSrts" ], -#ifndef mingw32_TARGET_OS - extra_libraries = [], -#else - extra_libraries = [ "winmm" ], -- for the threadDelay timer + extra_libraries = + "m": -- for ldexp() +#ifdef mingw32_TARGET_OS + "winmm": -- for the threadDelay timer + "wsock32": -- for the linker #endif +#ifdef USING_LIBBFD + "bfd": "iberty": -- for debugging +#endif + [], include_dirs = if installing - then [ "$libdir/includes" ] + then [ "$libdir/include" +#ifdef mingw32_TARGET_OS + , "$libdir/include/mingw" +#endif + ] else [ ghc_src_dir cGHC_INCLUDE_DIR ], c_includes = [ "Stg.h" ], -- ha! package_deps = [ "gmp" ], @@ -78,11 +96,13 @@ package_details installing extra_cc_opts = [], -- the RTS forward-references to a bunch of stuff in the prelude, -- so we force it to be included with special options to ld. - extra_ld_opts = map ( + extra_ld_opts = + foldr (\ x xs -> "-u" : x : xs) [] + (map ( #ifndef LEADING_UNDERSCORE - "-u " + "" #else - "-u _" + "_" #endif ++ ) [ "PrelBase_Izh_static_info" @@ -113,9 +133,10 @@ package_details installing , "PrelIOBase_heapOverflow_closure" , "PrelIOBase_NonTermination_closure" , "PrelIOBase_BlockedOnDeadMVar_closure" + , "PrelIOBase_Deadlock_closure" , "PrelWeak_runFinalizzerBatch_closure" - , "__init_Prelude" - ] + , "__stginit_Prelude" + ]) }, Package { @@ -128,12 +149,23 @@ package_details installing then [ "$libdir" ] else [ ghc_src_dir cGHC_LIB_DIR ++ "/std" , ghc_src_dir cGHC_LIB_DIR ++ "/std/cbits" ], - hs_libraries = [ "HSstd" ], + + hs_libraries = +# ifndef mingw32_TARGET_OS + [ "HSstd" ] +# else + -- This splitting is the subject of a totally + -- horrible hack, which glues HSstd1 and HSstd2 + -- back into HSstd for the purposes of static linking. + -- See DriverState.getPackageLibraries for details. + [ "HSstd1", "HSstd2" ] +# endif + , extra_libraries = [ "HSstd_cbits" ] ++ # ifdef mingw32_TARGET_OS - ["wsock32", "msvcrt"] + [ "wsock32", "msvcrt", "kernel32", "user32" ] # else - ["m"] -- libm, that is + [ ] # endif , include_dirs = if installing @@ -168,9 +200,9 @@ package_details installing extra_cc_opts = [], extra_ld_opts = [ #ifndef LEADING_UNDERSCORE - "-u Addr_Azh_static_info" + "-u", "Addr_Azh_static_info" #else - "-u _Addr_Azh_static_info" + "-u", "_Addr_Azh_static_info" #endif ] }, @@ -305,7 +337,11 @@ package_details installing else [ "$libdir/hslibs/util" , "$libdir/hslibs/util/cbits" ], hs_libraries = [ "HSutil" ], - extra_libraries = [ "HSutil_cbits" ] ++ words cLibsReadline, + extra_libraries = [ "HSutil_cbits" ] +#ifndef mingw32_TARGET_OS + ++ words cLibsReadline +#endif + , include_dirs = if installing then [] else [ "$libdir/hslibs/util/cbits" ], @@ -370,35 +406,59 @@ package_details installing library_dirs = if installing then [ "$libdir" ] else [ "$libdir/hslibs/win32" ], - hs_libraries = [ "HSwin32" ], - extra_libraries = [ "user32", "gdi32", "winmm" ], + hs_libraries = [ "HSwin321", "HSwin322" ], + extra_libraries = [ "user32", "gdi32", "winmm", + "kernel32", "advapi32" ], include_dirs = [], c_includes = [], -- ??? - package_deps = [ "lang", "greencard" ], + package_deps = [ "lang" ], -- greencard now built in extra_ghc_opts = [], extra_cc_opts = [], extra_ld_opts = [] - }, + } +#endif - Package { - name = "com", + ,Package { + name = "xlib", import_dirs = if installing - then [ "$libdir/imports/com" ] - else [ "$libdir/hdirect/lib" ], + then [ "$libdir/imports/xlib" ] + else [ "$libdir/hslibs/xlib" ], source_dirs = [], library_dirs = if installing then [ "$libdir" ] - else [ "$libdir/hdirect/lib" ], - hs_libraries = [ "HScom" ], - extra_libraries = [ "user32", "ole32", "oleaut32", "advapi32" ], + else [ "$libdir/hslibs/xlib" + , "$libdir/hslibs/xlib/cbits" ], + hs_libraries = [ "HSxlib" ], + extra_libraries = [ "HSxlib_cbits", "X11" ], + include_dirs = if installing + then [] + else [ "$libdir/hslibs/xlib/cbits" ], + c_includes = [ "HsXlib.h" ], + package_deps = [ "greencard" ], + extra_ghc_opts = [], + extra_cc_opts = [ cX_CFLAGS ], + extra_ld_opts = [ cX_LIBS ] + } + + ,Package { + name = "HGL", + import_dirs = if installing + then [ "$libdir/imports/HGL" ] + else [ "$libdir/hslibs/graphics/lib/x11" ], + source_dirs = [], + library_dirs = if installing + then [ "$libdir" ] + else [ "$libdir/hslibs/graphics/lib/x11"], + hs_libraries = [ "HSHGL" ], + extra_libraries= [], include_dirs = [], - c_includes = [], -- ??? - package_deps = [ "lang" ], + c_includes = [], + package_deps = [ "xlib", "concurrent" ], extra_ghc_opts = [], extra_cc_opts = [], extra_ld_opts = [] } -#endif + ] where ghc_src_dir :: String -> String