summaryrefslogtreecommitdiff
path: root/lang/ghc/patches
diff options
context:
space:
mode:
authoraugustss <augustss@pkgsrc.org>2003-04-29 11:27:39 +0000
committeraugustss <augustss@pkgsrc.org>2003-04-29 11:27:39 +0000
commit5012e7fbb45cee82ad2df4df8774cabe5bcf0f6b (patch)
tree349af3e9ce06d4580d91087878b824c5ad757c67 /lang/ghc/patches
parent1eafba1c126c98572c78c2c81a366969b0443f2e (diff)
downloadpkgsrc-5012e7fbb45cee82ad2df4df8774cabe5bcf0f6b.tar.gz
Update to a new GHC. There are too numerous changes to mention; see the
GHC documentation for details. The most import change is that this package (which has been broken since the conversion from a.out to ELF) has been re-ported to NetBSD by Urban Boquist, boquist@crt.se.
Diffstat (limited to 'lang/ghc/patches')
-rw-r--r--lang/ghc/patches/patch-aa63
-rw-r--r--lang/ghc/patches/patch-ab15
-rw-r--r--lang/ghc/patches/patch-ac49
-rw-r--r--lang/ghc/patches/patch-ad62
-rw-r--r--lang/ghc/patches/patch-ae42
-rw-r--r--lang/ghc/patches/patch-af24
-rw-r--r--lang/ghc/patches/patch-ag12
-rw-r--r--lang/ghc/patches/patch-ah13
-rw-r--r--lang/ghc/patches/patch-ai23
-rw-r--r--lang/ghc/patches/patch-aj13
-rw-r--r--lang/ghc/patches/patch-ak12
-rw-r--r--lang/ghc/patches/patch-al13
-rw-r--r--lang/ghc/patches/patch-am17
-rw-r--r--lang/ghc/patches/patch-an30
-rw-r--r--lang/ghc/patches/patch-ao14
-rw-r--r--lang/ghc/patches/patch-ap18
-rw-r--r--lang/ghc/patches/patch-aq64
17 files changed, 269 insertions, 215 deletions
diff --git a/lang/ghc/patches/patch-aa b/lang/ghc/patches/patch-aa
deleted file mode 100644
index e80c406a07d..00000000000
--- a/lang/ghc/patches/patch-aa
+++ /dev/null
@@ -1,63 +0,0 @@
-$NetBSD: patch-aa,v 1.2 1999/12/15 18:15:21 proff Exp $
-
---- ghc/lib/misc/SocketPrim.lhs Wed Sep 15 09:06:26 1999
-+++ ghc/lib/misc/SocketPrim.lhs Tue Dec 14 13:00:08 1999
-@@ -941,10 +941,56 @@
-
- #endif
-
-+#if netbsd_TARGET_OS || netbsd_elf_TARGET_OS
-+
-+data Family =
-+ AF_UNSPEC -- unspecified
-+ | AF_UNIX -- local to host (pipes, portals)
-+ | AF_INET -- internetwork: UDP, TCP, etc.
-+ | AF_IMPLINK -- arpanet imp addresses
-+ | AF_PUP -- pup protocols: e.g. BSP
-+ | AF_CHAOS -- mit CHAOS protocols
-+ | AF_NS -- XEROX NS protocols
-+ | AF_ISO -- ISO protocols
-+-- | AF_OSI is the same as AF_ISO
-+ | AF_ECMA -- european computer manufacturers
-+ | AF_DATAKIT -- datakit protocols
-+ | AF_CCITT -- CCITT protocols, X.25 etc
-+ | AF_SNA -- IBM SNA
-+ | AF_DECnet -- DECnet
-+ | AF_DLI -- DEC Direct data link interface
-+ | AF_LAT -- LAT
-+ | AF_HYLINK -- NSC Hyperchannel
-+ | AF_APPLETALK -- Apple Talk
-+ | AF_ROUTE -- Internal Routing Protocol
-+ | AF_LINK -- Link layer interface
-+ | Pseudo_AF_XTP -- eXpress Transfer Protocol (no AF)
-+ | AF_COIP -- connection-oriented IP, aka ST II
-+ | AF_CNT -- Computer Network Technology
-+ | Pseudo_AF_RTIP -- Help Identify RTIP packets
-+ | AF_IPX -- Novell Internet Protocol
-+ | AF_INET6 -- IPv6
-+ | Pseudo_AF_PIP -- Help Identify PIP packets
-+ | AF_ISDN -- Integrated Services Digital Network
-+-- | AF_E164 is the same as AF_ISDN
-+ | AF_NATM -- native ATM access
-+ | AF_ARP -- (rev.) addr. res. prot. (RFC 826)
-+ | Pseudo_AF_KEY -- Internal key-management function
-+ | Pseudo_AF_HDRCMPLT -- Used by BPF to not rewrite hdrs in iface output
-+ | AF_MAX
-+ deriving (Eq, Ord, Ix, Show)
-+
-+packFamily = index (AF_UNSPEC, AF_MAX)
-+unpackFamily family = (range (AF_UNSPEC, AF_MAX))!!family
-+
-+#endif
-+
-+
- -- Alpha running OSF or a SPARC with SunOS, rather than Solaris.
-
- #if osf1_TARGET_OS || osf3_TARGET_OS || sunos4_TARGET_OS || hpux_TARGET_OS || \
-- aix_TARGET_OS || freebsd2_TARGET_OS || freebsd3_TARGET_OS
-+ aix_TARGET_OS || freebsd2_TARGET_OS || freebsd3_TARGET_OS || \
-+ netbsd_TARGET_OS || netbsd_elf_TARGET_OS
- data SocketType =
- Stream
- | Datagram
-diff -u -r old/fptools/ghc/rts/MBlock.c work.i386/fptools/ghc/rts/MBlock.c
diff --git a/lang/ghc/patches/patch-ab b/lang/ghc/patches/patch-ab
deleted file mode 100644
index 17e4ae8a725..00000000000
--- a/lang/ghc/patches/patch-ab
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-ab,v 1.2 1999/12/27 18:20:12 tron Exp $
-
---- ghc/rts/MBlock.c Wed Sep 15 09:06:54 1999
-+++ ghc/rts/MBlock.c Tue Dec 14 10:27:15 1999
-@@ -47,6 +47,10 @@
- */
- #define ASK_FOR_MEM_AT 0x50000000
-
-+#elif netbsd_TARGET_OS || netbsd_elf_TARGET_OS
-+/* NetBSD i386 shared libs are at 0x40000000
-+ */
-+#define ASK_FOR_MEM_AT 0x50000000
- #elif linux_TARGET_OS
- /* Any ideas?
- */
diff --git a/lang/ghc/patches/patch-ac b/lang/ghc/patches/patch-ac
index e860375bced..e6c60249078 100644
--- a/lang/ghc/patches/patch-ac
+++ b/lang/ghc/patches/patch-ac
@@ -1,37 +1,24 @@
-$NetBSD: patch-ac,v 1.1.1.1 1999/12/15 06:05:15 proff Exp $
+$NetBSD: patch-ac,v 1.2 2003/04/29 11:27:42 augustss Exp $
---- ghc/driver/ghc-asm.lprl Wed Sep 15 09:05:45 1999
-+++ ghc/driver/ghc-asm.lprl Tue Dec 14 22:09:04 1999
-@@ -104,7 +104,7 @@
- $T_HDR_direct = "\t.SPACE \$TEXT\$\n\t.SUBSPA \$CODE\$\n\t\.align 4\n";
+--- ./mk/package.mk.orig Tue Jul 23 12:19:50 2002
++++ ./mk/package.mk Fri Mar 28 23:48:02 2003
+@@ -17,8 +17,10 @@
+ | sed 's/^#.*$$//g' >$@
- #--------------------------------------------------------#
-- } elsif ( $TargetPlatform =~ /^i386-.*-(linuxaout|freebsd2|nextstep3|cygwin32|mingw32)$/ ) {
-+ } elsif ( $TargetPlatform =~ /^i386-.*-(linuxaout|freebsd2|netbsd|nextstep3|cygwin32|mingw32)$/ ) {
- # NeXT added but not tested. CaS
+ boot all :: $(PACKAGE).conf.inplace $(PACKAGE).conf.installed
++ifneq "$(BootingFromHc)" "YES"
+ $(GHC_PKG_INPLACE) --update-package <$(PACKAGE).conf.inplace
+ $(GHC_PKG_INPLACE) -f $(GHC_DRIVER_DIR)/package.conf --update-package <$(PACKAGE).conf.installed
++endif
- $T_STABBY = 1; # 1 iff .stab things (usually if a.out format)
-@@ -135,12 +135,12 @@
- $T_HDR_direct = "\.text\n\t\.align 2,0x90\n";
+ CLEAN_FILES += $(PACKAGE).conf.installed $(PACKAGE).conf.inplace
- #--------------------------------------------------------#
-- } elsif ( $TargetPlatform =~ /^i386-.*-(solaris2|linux|freebsd3)$/ ) {
-+ } elsif ( $TargetPlatform =~ /^i386-.*-(solaris2|linux|freebsd3|netbsd_elf)$/ ) {
+@@ -31,7 +33,7 @@
- $T_STABBY = 0; # 1 iff .stab things (usually if a.out format)
- $T_US = ''; # _ if symbols have an underscore on the front
- $T_PRE_APP = # regexp that says what comes before APP/NO_APP
-- ($TargetPlatform =~ /-(linux|freebsd3)$/) ? '#' : '/' ;
-+ ($TargetPlatform =~ /-(linux|freebsd3|netbsd_elf)$/) ? '#' : '/' ;
- $T_CONST_LBL = '^\.LC(\d+):$'; # regexp for what such a lbl looks like
- $T_POST_LBL = ':';
- $T_X86_PRE_LLBL_PAT = '\.L';
-@@ -150,7 +150,7 @@
- $T_MOVE_DIRVS = '^(\s*(\.(p2)?align\s+\d+(,0x90)?|\.globl\s+\S+|\.text|\.data|\.section\s+.*|\.type\s+.*|\.Lfe.*\n\t\.size\s+.*|\.size\s+.*|\.ident.*)\n)';
- $T_COPY_DIRVS = '\.(globl)';
+ SRC_HSC2HS_OPTS += -I.
-- if ( $TargetPlatform =~ /freebsd3/ ) {
-+ if ( $TargetPlatform =~ /freebsd3|netbsd_elf/ ) {
- $T_hsc_cc_PAT = '\.ascii.*\)(hsc|cc) (.*)\\\\11"\n\t\.ascii\s+"(.*)\\\\0"';
- } else {
- $T_hsc_cc_PAT = '\.string.*\)(hsc|cc) (.*)\\\\t(.*)"';
+-ifeq "$(NON_HS_PACKAGE)" ""
++ifeq "$(NON_HS_PKG)" ""
+ SRC_HC_OPTS += -package-name $(PACKAGE)
+ SRC_HC_OPTS += $(GhcLibHcOpts)
+ SRC_HC_OPTS += $(patsubst %, -package %, $(PACKAGE_DEPS))
diff --git a/lang/ghc/patches/patch-ad b/lang/ghc/patches/patch-ad
deleted file mode 100644
index 04f872eacba..00000000000
--- a/lang/ghc/patches/patch-ad
+++ /dev/null
@@ -1,62 +0,0 @@
-$NetBSD: patch-ad,v 1.2 2000/06/30 16:29:17 danw Exp $
-
---- configure.orig Tue Sep 14 19:13:41 1999
-+++ configure Fri Jun 30 08:05:39 2000
-@@ -786,7 +786,16 @@
- HostPlatform_CPP='i386_unknown_netbsd'
- HostArch_CPP='i386'
- HostVendor_CPP='unknown'
-- HostOS_CPP='netbsd'
-+ if test "$HASKELL_OBJ_FMT" = "a.out"; then
-+ HostOS_CPP='netbsd'
-+ else
-+ if test "$HASKELL_OBJ_FMT" = "ELF"; then
-+ HostOS_CPP='netbsd_elf'
-+ else
-+ echo bad \$HASKELL_OBJ_FMT = "$HASKELL_OBJ_FMT"
-+ exit 1
-+ fi
-+ fi
- ;;
- i[3456]86-*-solaris2*)
- HostPlatform=i386-unknown-solaris2 # hack again
-@@ -3926,24 +3935,24 @@
- HaveLibGmp=YES; LibGmp=gmp
- else
- echo "$ac_t""no" 1>&6
--echo $ac_n "checking for mpz_fdiv_qr in -lgmp2""... $ac_c" 1>&6
--echo "configure:3931: checking for mpz_fdiv_qr in -lgmp2" >&5
--ac_lib_var=`echo gmp2'_'mpz_fdiv_qr | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for __gmpz_fdiv_qr in -lgmp""... $ac_c" 1>&6
-+echo "configure:3931: checking for __gmpz_fdiv_qr in -lgmp" >&5
-+ac_lib_var=`echo gmp'_'__gmpz_fdiv_qr | sed 'y%./+-%__p_%'`
- if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
- else
- ac_save_LIBS="$LIBS"
--LIBS="-lgmp2 $LIBS"
-+LIBS="-lgmp $LIBS"
- cat > conftest.$ac_ext <<EOF
- #line 3939 "configure"
- #include "confdefs.h"
- /* Override any gcc2 internal prototype to avoid an error. */
- /* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
--char mpz_fdiv_qr();
-+char __gmpz_fdiv_qr();
-
- int main() {
--mpz_fdiv_qr()
-+__gmpz_fdiv_qr()
- ; return 0; }
- EOF
- if { (eval echo configure:3950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-@@ -3961,7 +3970,7 @@
- fi
- if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
-- HaveLibGmp=YES; LibGmp=gmp2
-+ HaveLibGmp=YES; LibGmp=gmp
- else
- echo "$ac_t""no" 1>&6
- HaveLibGmp=No; LibGmp=not-installed
diff --git a/lang/ghc/patches/patch-ae b/lang/ghc/patches/patch-ae
index cde42cae38e..e7d396d07a9 100644
--- a/lang/ghc/patches/patch-ae
+++ b/lang/ghc/patches/patch-ae
@@ -1,34 +1,12 @@
-$NetBSD: patch-ae,v 1.2 2000/06/30 16:29:17 danw Exp $
+$NetBSD: patch-ae,v 1.3 2003/04/29 11:27:44 augustss Exp $
---- configure.in.orig Tue Sep 14 19:03:35 1999
-+++ configure.in Fri Jun 30 08:04:25 2000
-@@ -138,7 +138,16 @@
- HostPlatform_CPP='i386_unknown_netbsd'
- HostArch_CPP='i386'
- HostVendor_CPP='unknown'
-- HostOS_CPP='netbsd'
-+ if test "$HASKELL_OBJ_FMT" = "a.out"; then
-+ HostOS_CPP='netbsd'
-+ else
-+ if test "$HASKELL_OBJ_FMT" = "ELF"; then
-+ HostOS_CPP='netbsd_elf'
-+ else
-+ echo bad \$HASKELL_OBJ_FMT = "$HASKELL_OBJ_FMT"
-+ exit 1
-+ fi
-+ fi
- ;;
- i[[3456]]86-*-solaris2*)
- HostPlatform=i386-unknown-solaris2 # hack again
-@@ -602,9 +611,9 @@
- dnl ** check for specific library functions that we are interested in
- AC_CHECK_FUNCS(access ftime getclock getpagesize getrusage gettimeofday mktime mprotect readlink setitimer stat symlink sysconf timelocal times vadvise vfork)
+--- ./ghc/compiler/Makefile.orig Fri Jun 14 10:23:57 2002
++++ ./ghc/compiler/Makefile Fri Mar 28 23:48:01 2003
+@@ -4,6 +4,7 @@
+ TOP = ..
--dnl ** check whether this machine has gmp2 installed
-+dnl ** check whether this machine has gmp installed
- AC_CHECK_LIB(gmp, mpz_fdiv_qr, HaveLibGmp=YES; LibGmp=gmp,
-- AC_CHECK_LIB(gmp2, mpz_fdiv_qr, HaveLibGmp=YES; LibGmp=gmp2,
-+ AC_CHECK_LIB(gmp, __gmpz_fdiv_qr, HaveLibGmp=YES; LibGmp=gmp,
- HaveLibGmp=No; LibGmp=not-installed))
- AC_SUBST(HaveLibGmp)
- AC_SUBST(LibGmp)
+ # Use GHC for compiling C bits (NB. must be before boilerplate include)
++# NB. this requires BootingFromHc to be set on the make command line!
+ #
+ ifneq "$(BootingFromHc)" "YES"
+ UseGhcForCc = YES
diff --git a/lang/ghc/patches/patch-af b/lang/ghc/patches/patch-af
index a8b02bd3323..6fef94d29f1 100644
--- a/lang/ghc/patches/patch-af
+++ b/lang/ghc/patches/patch-af
@@ -1,13 +1,13 @@
-$NetBSD: patch-af,v 1.1.1.1 1999/12/15 06:05:15 proff Exp $
+$NetBSD: patch-af,v 1.2 2003/04/29 11:27:44 augustss Exp $
---- /p/lang/ghc/old/fptools/Makefile Wed Sep 15 09:03:33 1999
-+++ Makefile Wed Dec 15 16:04:58 1999
-@@ -15,7 +15,7 @@
- # on whether we do `make install' or not. Having a $(ifeq ... ) would
- # be preferable..
- CURRENT_TARGET = $(MAKECMDGOALS)
--SUBDIRS = $(shell if (test x$(CURRENT_TARGET) = xinstall) ; then echo $(ProjectsToInstall); else echo $(ProjectsToBuild); fi)
-+SUBDIRS = $(shell if test x$(CURRENT_TARGET) = xinstall ; then echo $(ProjectsToInstall); else echo $(ProjectsToBuild); fi)
-
- ifneq "$(Project)" ""
- include $(shell echo $(Project) | tr A-Z a-z)/mk/config.mk
+--- ./ghc/driver/mangler/ghc-asm.lprl.orig Sun Dec 8 15:29:50 2002
++++ ./ghc/driver/mangler/ghc-asm.lprl Fri Mar 28 23:48:01 2003
+@@ -197,7 +197,7 @@
+ $T_hsc_cc_PAT = '\.string.*\)(hsc|cc) (.*)\\\\t(.*)"';
+ }
+
+- $T_DOT_WORD = '\.(long|value|byte|zero)';
++ $T_DOT_WORD = '\.(long|value|word|byte|zero)';
+ $T_DOT_GLOBAL = '\.globl';
+ $T_HDR_literal = "\.section\t\.rodata\n"; # or just use .text??? (WDP 95/11)
+ $T_HDR_misc = "\.text\n\t\.align 4\n";
diff --git a/lang/ghc/patches/patch-ag b/lang/ghc/patches/patch-ag
new file mode 100644
index 00000000000..d9099f4981c
--- /dev/null
+++ b/lang/ghc/patches/patch-ag
@@ -0,0 +1,12 @@
+$NetBSD: patch-ag,v 1.1 2003/04/29 11:27:44 augustss Exp $
+
+--- ./ghc/mk/paths.mk.orig Mon Apr 1 15:57:10 2002
++++ ./ghc/mk/paths.mk Fri Mar 28 23:48:01 2003
+@@ -34,6 +34,7 @@
+ GHC_DRIVER_DIR = $(GHC_TOP)/$(GHC_DRIVER_DIR_REL)
+ GHC_PKG_DIR = $(GHC_TOP)/$(GHC_PKG_DIR_REL)
+ GHC_GENPRIMOP_DIR = $(GHC_TOP)/$(GHC_GENPRIMOP_DIR_REL)
++GHC_MANGLER_DIR = $(GHC_TOP)/$(GHC_MANGLER_DIR_REL)
+
+ GHC_LIB_DIR = $(FPTOOLS_TOP)/libraries
+
diff --git a/lang/ghc/patches/patch-ah b/lang/ghc/patches/patch-ah
new file mode 100644
index 00000000000..d3fd77ca965
--- /dev/null
+++ b/lang/ghc/patches/patch-ah
@@ -0,0 +1,13 @@
+$NetBSD: patch-ah,v 1.1 2003/04/29 11:27:45 augustss Exp $
+
+--- ./ghc/rts/Linker.c.orig Sun Oct 13 19:50:54 2002
++++ ./ghc/rts/Linker.c Fri Mar 28 23:48:02 2003
+@@ -56,7 +56,7 @@
+ #include <sys/mman.h>
+ #endif
+
+-#if defined(linux_TARGET_OS) || defined(solaris2_TARGET_OS) || defined(freebsd_TARGET_OS)
++#if defined(linux_TARGET_OS) || defined(solaris2_TARGET_OS) || defined(freebsd_TARGET_OS) || defined(netbsd_TARGET_OS)
+ # define OBJFORMAT_ELF
+ #elif defined(cygwin32_TARGET_OS) || defined (mingw32_TARGET_OS)
+ # define OBJFORMAT_PEi386
diff --git a/lang/ghc/patches/patch-ai b/lang/ghc/patches/patch-ai
new file mode 100644
index 00000000000..db3baeff582
--- /dev/null
+++ b/lang/ghc/patches/patch-ai
@@ -0,0 +1,23 @@
+$NetBSD: patch-ai,v 1.1 2003/04/29 11:27:45 augustss Exp $
+
+--- ./ghc/rts/Makefile.orig Sun Oct 13 19:50:55 2002
++++ ./ghc/rts/Makefile Fri Mar 28 23:48:02 2003
+@@ -21,6 +21,7 @@
+ # set of suffix rules for compiling C code, using $(HC) rather than $(CC)
+ # and prepending "-optc" to $(CC_OPTS). NB. must be done before including
+ # boilerplate.mk below.
++# NB. this requires BootingFromHc to be set on the make command line!
+ ifneq "$(BootingFromHc)" "YES"
+ UseGhcForCc = YES
+ endif
+@@ -126,6 +127,10 @@
+ ifeq "$(HaveLibMingwEx)" "YES"
+ PACKAGE_CPP_OPTS += -DHAVE_LIBMINGWEX
+ endif
++
++# have to get ExtraLdOptsGmp in through CPP to rts.conf.in (see hslibs/util/Makefile)
++comma = ,
++PACKAGE_CPP_OPTS += -DExtraLdOptsGmp='$(patsubst %,"%"$(comma),$(ExtraLdOptsGmp))'
+
+ #-----------------------------------------------------------------------------
+ # Include the Front panel code?
diff --git a/lang/ghc/patches/patch-aj b/lang/ghc/patches/patch-aj
new file mode 100644
index 00000000000..52bbcf96e6c
--- /dev/null
+++ b/lang/ghc/patches/patch-aj
@@ -0,0 +1,13 @@
+$NetBSD: patch-aj,v 1.1 2003/04/29 11:27:46 augustss Exp $
+
+--- ./ghc/rts/Stats.c.orig Wed Feb 6 02:21:40 2002
++++ ./ghc/rts/Stats.c Fri Mar 28 23:48:02 2003
+@@ -749,7 +749,7 @@
+ fprintf(sf, "<<ghc: %llu bytes, ", GC_tot_alloc*sizeof(W_));
+ fprintf(sf, "%d GCs, %ld/%ld avg/max bytes residency (%ld samples), %luM in use, %.2f INIT (%.2f elapsed), %.2f MUT (%.2f elapsed), %.2f GC (%.2f elapsed) :ghc>>\n",
+ total_collections,
+- AvgResidency*sizeof(W_)/ResidencySamples,
++ (ResidencySamples==0) ? 0 : AvgResidency*sizeof(W_)/ResidencySamples,
+ MaxResidency*sizeof(W_),
+ ResidencySamples,
+ (unsigned long)(mblocks_allocated * MBLOCK_SIZE / (1024L * 1024L)),
diff --git a/lang/ghc/patches/patch-ak b/lang/ghc/patches/patch-ak
new file mode 100644
index 00000000000..f9d61ac0073
--- /dev/null
+++ b/lang/ghc/patches/patch-ak
@@ -0,0 +1,12 @@
+$NetBSD: patch-ak,v 1.1 2003/04/29 11:27:46 augustss Exp $
+
+--- ./ghc/rts/rts.conf.in.orig Mon Feb 10 11:18:31 2003
++++ ./ghc/rts/rts.conf.in Fri Mar 28 23:48:02 2003
+@@ -67,6 +67,7 @@
+ so we force it to be included with special options to ld. */
+ extra_ld_opts =
+ [
++ ExtraLdOptsGmp
+ #ifdef LEADING_UNDERSCORE
+ "-u", "_GHCziBase_Izh_static_info"
+ , "-u", "_GHCziBase_Czh_static_info"
diff --git a/lang/ghc/patches/patch-al b/lang/ghc/patches/patch-al
new file mode 100644
index 00000000000..7e6711c5e34
--- /dev/null
+++ b/lang/ghc/patches/patch-al
@@ -0,0 +1,13 @@
+$NetBSD: patch-al,v 1.1 2003/04/29 11:27:47 augustss Exp $
+
+--- ./ghc/utils/Makefile.orig Tue Sep 11 13:13:22 2001
++++ ./ghc/utils/Makefile Fri Mar 28 23:48:02 2003
+@@ -6,7 +6,7 @@
+ SUBDIRS = hp2ps stat2resid unlit
+ else
+ ifeq "$(BootingFromHc)" "YES"
+-SUBDIRS = hp2ps parallel stat2resid prof unlit
++SUBDIRS = ghc-pkg unlit
+ else
+ SUBDIRS = hasktags ghc-pkg hp2ps hsc2hs parallel stat2resid prof unlit genprimopcode
+ endif
diff --git a/lang/ghc/patches/patch-am b/lang/ghc/patches/patch-am
new file mode 100644
index 00000000000..43a3f5b26ec
--- /dev/null
+++ b/lang/ghc/patches/patch-am
@@ -0,0 +1,17 @@
+$NetBSD: patch-am,v 1.1 2003/04/29 11:27:47 augustss Exp $
+
+--- ./ghc/Makefile.orig Tue Jul 2 16:15:22 2002
++++ ./ghc/Makefile Fri Mar 28 23:48:01 2003
+@@ -18,10 +18,10 @@
+ # before the rest to have a config.h, etc.
+ #
+ # If we're booting from .hc files, swap the order
+-# we descend into compiler/ and lib/.
++# we descend into subdirs - to boot utils must be before driver.
+ #
+ ifeq "$(BootingFromHc)" "YES"
+-SUBDIRS = includes utils rts docs compiler driver
++SUBDIRS = includes rts docs compiler utils driver
+ else
+ ifneq "$(ILXized)" "YES"
+ SUBDIRS = includes utils driver docs compiler rts
diff --git a/lang/ghc/patches/patch-an b/lang/ghc/patches/patch-an
new file mode 100644
index 00000000000..c00237179e6
--- /dev/null
+++ b/lang/ghc/patches/patch-an
@@ -0,0 +1,30 @@
+$NetBSD: patch-an,v 1.1 2003/04/29 11:27:47 augustss Exp $
+
+--- ./hslibs/util/Makefile.orig Tue Apr 23 11:31:39 2002
++++ ./hslibs/util/Makefile Fri Mar 28 23:48:02 2003
+@@ -23,16 +23,25 @@
+ PACKAGE_DEPS := $(filter-out posix, $(PACKAGE_DEPS))
+ endif
+
++# hsc2hs needs to find the correct readline includes:
++EXTRA_HSC2HS_OPTS += -I$(ReadlineIncludePath)
++
+ # yeuch, have to get LibsReadline in through CPP to util.conf.in
+ comma = ,
+ PACKAGE_CPP_OPTS += -DLibsReadline='$(patsubst %,$(comma)"%",$(LibsReadline))'
+
++# ... same with ExtraLdOptsReadline:
++PACKAGE_CPP_OPTS += -DExtraLdOptsReadline='$(patsubst %,"%"$(comma),$(ExtraLdOptsReadline))'
++
+ # Remove Readline.hs if it is not wanted or headers are not available.
+ ifeq "$(GhcLibsWithReadline)" "YES"
+ ifneq "$(ReadlineIncludePath)" ""
+ SRC_HC_OPTS += -I$(ReadlineIncludePath)
+ endif
+ STUBOBJS += Readline_stub.$(way_)o
++ ifeq "$(BootingFromHc)" "YES"
++ all :: $(STUBOBJS)
++ endif
+ CLEAN_FILES += Readline_stub.[ch] $(STUBOBJS)
+ else
+ EXCLUDED_SRCS += Readline.hsc Readline_stub.c
diff --git a/lang/ghc/patches/patch-ao b/lang/ghc/patches/patch-ao
new file mode 100644
index 00000000000..a7a7fbb0c65
--- /dev/null
+++ b/lang/ghc/patches/patch-ao
@@ -0,0 +1,14 @@
+$NetBSD: patch-ao,v 1.1 2003/04/29 11:27:48 augustss Exp $
+
+--- ./hslibs/util/util.conf.in.orig Sun Feb 17 16:22:11 2002
++++ ./hslibs/util/util.conf.in Fri Mar 28 23:48:02 2003
+@@ -35,5 +35,8 @@
+ ],
+ extra_ghc_opts = [],
+ extra_cc_opts = [],
+- extra_ld_opts = []
++ extra_ld_opts = [
++ ExtraLdOptsReadline
++ "" /* handle final comma... */
++ ]
+ }
diff --git a/lang/ghc/patches/patch-ap b/lang/ghc/patches/patch-ap
new file mode 100644
index 00000000000..41eddd2f800
--- /dev/null
+++ b/lang/ghc/patches/patch-ap
@@ -0,0 +1,18 @@
+$NetBSD: patch-ap,v 1.1 2003/04/29 11:27:48 augustss Exp $
+
+--- ./Makefile.orig Wed Mar 5 11:11:34 2003
++++ ./Makefile Fri Mar 28 23:48:01 2003
+@@ -295,11 +295,11 @@
+ $(RM) -r $(ProjectNameShort)-$(ProjectVersion)
+ $(LN_S) . $(ProjectNameShort)-$(ProjectVersion)
+ $(FIND) $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler \
+- $(ProjectNameShort)-$(ProjectVersion)/ghc/driver \
++ $(ProjectNameShort)-$(ProjectVersion)/ghc/utils \
+ $(ProjectNameShort)-$(ProjectVersion)/libraries \
+ $(ProjectNameShort)-$(ProjectVersion)/hslibs \
+ \( -name "*.hc" -o -name "*_hsc.[ch]" -o -name "*_stub.[ch]" \) -print > hc-files-to-go
+- for f in `$(FIND) $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler $(ProjectNameShort)-$(ProjectVersion)/ghc/driver $(ProjectNameShort)-$(ProjectVersion)/libraries $(ProjectNameShort)-$(ProjectVersion)/hslibs -name "*.hsc" -print` ""; do \
++ for f in `$(FIND) $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler $(ProjectNameShort)-$(ProjectVersion)/ghc/utils $(ProjectNameShort)-$(ProjectVersion)/libraries $(ProjectNameShort)-$(ProjectVersion)/hslibs -name "*.hsc" -print` ""; do \
+ if test "x$$f" != "x" && test -e `echo "$$f" | sed 's/hsc$$/hs/g'`; then \
+ echo `echo "$$f" | sed 's/hsc$$/hs/g' ` >> hc-files-to-go ; \
+ fi; \
diff --git a/lang/ghc/patches/patch-aq b/lang/ghc/patches/patch-aq
new file mode 100644
index 00000000000..2a3d291801e
--- /dev/null
+++ b/lang/ghc/patches/patch-aq
@@ -0,0 +1,64 @@
+$NetBSD: patch-aq,v 1.1 2003/04/29 11:27:49 augustss Exp $
+
+--- configure.in.orig Mon Feb 17 12:27:20 2003
++++ configure.in Sun Mar 30 11:46:08 2003
+@@ -718,6 +718,13 @@
+ fi
+ AC_SUBST(HaveReadlineHeaders)
+
++dnl ** XXX_UB: fix this in a better way!
++ReadlineIncludePath=
++if test x"$TargetOS_CPP" = x"netbsd"; then
++ ReadlineIncludePath=@PREFIX@/include
++fi
++AC_SUBST(ReadlineIncludePath)
++
+ dnl ** check for DOS include files
+ AC_CHECK_HEADERS(dos.h conio.h io.h std.h)
+
+@@ -734,14 +741,14 @@
+ AC_CHECK_HEADERS(dlfcn.h dl.h)
+
+ dnl ** check for farcalloc (in bcc)
+-AC_CHECK_HEADER(alloc.h,AC_CHECK_FUNCS(farcalloc))
++AC_CHECK_HEADER(alloc.h,[AC_CHECK_FUNCS(farcalloc)])
+
+ dnl ** check for valloc (in sunos, solaris, mips, amiga, next, minix, ultrix)
+-AC_CHECK_HEADER(malloc.h,AC_CHECK_FUNCS(valloc))
++AC_CHECK_HEADER(malloc.h,[AC_CHECK_FUNCS(valloc)])
+
+ dnl ** check for POSIX regex
+ HavePosixRegex=NO
+-AC_CHECK_HEADER(regex.h,AC_CHECK_FUNC(regcomp, HavePosixRegex=YES))
++AC_CHECK_HEADER(regex.h,[AC_CHECK_FUNC(regcomp, HavePosixRegex=YES)])
+ AC_SUBST(HavePosixRegex)
+
+ dnl ** how do we get a timezone name, and UTC offset ?
+@@ -942,6 +949,13 @@
+ AC_SUBST(HaveLibGmp)
+ AC_SUBST(LibGmp)
+
++dnl ** XXX_UB: fix this in a better way!
++ExtraLdOptsGmp=
++if test x"$TargetOS_CPP" = x"netbsd"; then
++ ExtraLdOptsGmp="-L@PREFIX@/lib -Wl,-R@PREFIX@/lib"
++fi
++AC_SUBST(ExtraLdOptsGmp)
++
+ dnl ** (Mac OS X only: check for HaskellSupport.framework)
+ HaveFrameworkHaskellSupport=NO
+ if test $HostPlatform = "powerpc-apple-darwin"; then
+@@ -1012,6 +1026,13 @@
+ AC_DEFINE(HAVE_READLINE_4, 0)
+ AC_DEFINE(HAVE_READLINE_4_2, 0)
+ fi
++
++dnl ** XXX_UB: fix this in a better way!
++ExtraLdOptsReadline=
++if test x"$TargetOS_CPP" = x"netbsd"; then
++ ExtraLdOptsReadline="-L@PREFIX@/lib -Wl,-R@PREFIX@/lib"
++fi
++AC_SUBST(ExtraLdOptsReadline)
+
+ dnl ** check for math library
+ FPTOOLS_CHECK_LIBM()