From e9b02c060c4d02b4096ba312ca58b498556dbabc Mon Sep 17 00:00:00 2001 From: ken Date: Sat, 4 Aug 2001 06:09:24 +0000 Subject: [PATCH] [project @ 2001-08-04 06:09:24 by ken] Change the generation of package.conf and package.conf.inplace, so that -lbfd and -liberty are included when necessary. --- ghc/driver/Makefile | 3 ++- ghc/driver/PackageSrc.hs | 14 ++++++++++---- ghc/includes/Derived.h | 9 ++++++++- ghc/rts/Printer.c | 4 ++-- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/ghc/driver/Makefile b/ghc/driver/Makefile index c732167..b0c4b63 100644 --- a/ghc/driver/Makefile +++ b/ghc/driver/Makefile @@ -1,5 +1,5 @@ #----------------------------------------------------------------------------- -# $Id: Makefile,v 1.67 2001/07/24 10:28:51 simonmar Exp $ +# $Id: Makefile,v 1.68 2001/08/04 06:09:24 ken Exp $ # TOP=.. @@ -37,6 +37,7 @@ SRC_HC_OPTS += -fglasgow-exts -cpp -syslib concurrent -syslib posix -syslib misc endif SRC_HC_OPTS += -DWANT_PRETTY +SRC_HC_OPTS += $(filter -D% -U%,$(GhcRtsCcOpts)) all :: package.conf package.conf.inplace diff --git a/ghc/driver/PackageSrc.hs b/ghc/driver/PackageSrc.hs index 3c3151f..1745809 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 @@ -64,11 +65,16 @@ package_details installing then [ "$libdir" ] else [ ghc_src_dir cGHC_RUNTIME_DIR ], hs_libraries = [ "HSrts" ], -#ifndef mingw32_TARGET_OS - extra_libraries = [ "m" ], -- libm, that is, for ldexp() -#else - extra_libraries = [ "winmm", "wsock32" ], -- winmm for the threadDelay timer, wsock32 for the linker + 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/include" #ifdef mingw32_TARGET_OS diff --git a/ghc/includes/Derived.h b/ghc/includes/Derived.h index bda5ce4..f65cfc8 100644 --- a/ghc/includes/Derived.h +++ b/ghc/includes/Derived.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Derived.h,v 1.1 2001/07/26 03:08:39 ken Exp $ + * $Id: Derived.h,v 1.2 2001/08/04 06:09:24 ken Exp $ * * (c) The GHC Team, 1998-2001 * @@ -22,4 +22,11 @@ #define SUPPORT_LONG_LONGS 1 #endif +/* + * Whether the runtime system will use libbfd for debugging purposes. + */ +#if defined(DEBUG) && defined(HAVE_BFD_H) && !defined(_WIN32) && !defined(PAR) && !defined(GRAN) +#define USING_LIBBFD 1 +#endif + #endif /* DERIVED_H */ diff --git a/ghc/rts/Printer.c b/ghc/rts/Printer.c index 47f39d1..d71c436 100644 --- a/ghc/rts/Printer.c +++ b/ghc/rts/Printer.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Printer.c,v 1.42 2001/07/24 06:31:36 ken Exp $ + * $Id: Printer.c,v 1.43 2001/08/04 06:09:24 ken Exp $ * * (c) The GHC Team, 1994-2000. * @@ -818,7 +818,7 @@ static void printZcoded( const char *raw ) /* Causing linking trouble on Win32 plats, so I'm disabling this for now. */ -#if defined(HAVE_BFD_H) && !defined(_WIN32) && !defined(PAR) && !defined(GRAN) +#ifdef USING_LIBBFD #include -- 1.7.10.4