[project @ 2001-08-04 06:09:24 by ken]
authorken <unknown>
Sat, 4 Aug 2001 06:09:24 +0000 (06:09 +0000)
committerken <unknown>
Sat, 4 Aug 2001 06:09:24 +0000 (06:09 +0000)
Change the generation of package.conf and package.conf.inplace, so that
-lbfd and -liberty are included when necessary.

ghc/driver/Makefile
ghc/driver/PackageSrc.hs
ghc/includes/Derived.h
ghc/rts/Printer.c

index c732167..b0c4b63 100644 (file)
@@ -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
 
index 3c3151f..1745809 100644 (file)
@@ -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
index bda5ce4..f65cfc8 100644 (file)
@@ -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
  *
 #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 */
index 47f39d1..d71c436 100644 (file)
@@ -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 <bfd.h>