1 # $NetBSD: Makefile,v 1.42 2008/07/07 14:58:00 kristerw Exp $
3 DISTNAME= ghc-${VERSION}
6 MASTER_SITES= http://www.haskell.org/ghc/dist/${VERSION}/
7 MAINTAINER= kristerw@NetBSD.org
8 HOMEPAGE= http://www.haskell.org/ghc/
9 COMMENT= Compiler for the functional language Haskell
11 DISTFILES= ${DISTNAME}-src.tar.bz2 \
12 ghc-6.6.1-src.tar.bz2 \
13 ghc-6.6.1-i386-unknown-freebsd-hc.tar.gz \
14 ghc-6.6.1-powerpc-apple-darwin-hc.tar.gz
16 SITES.ghc-6.6.1-src.tar.bz2 = http://www.haskell.org/ghc/dist/6.6.1/
17 SITES.ghc-6.6.1-powerpc-apple-darwin-hc.tar.gz = http://static.cielonegro.org/archive/
18 SITES.ghc-6.6.1-i386-unknown-freebsd-hc.tar.gz = http://static.cielonegro.org/archive/
20 .include "../../mk/bsd.prefs.mk"
22 # Unregisterised HC packages are architecture dependent. We have to
23 # create more HC packages to support more architectures.
24 ONLY_FOR_PLATFORM= *-*-i386 *-*-powerpc
27 CONFIGURE_ENV+= PerlCmd=${PERL5:Q}
28 USE_TOOLS+= gmake perl:run find:run cp:run
30 # We don't want to extract all of the DISTFILEs.
31 EXTRACT_ONLY= ${DISTNAME}-src.tar.bz2 \
34 .if ${MACHINE_ARCH} == "i386"
35 EXTRACT_ONLY += ghc-6.6.1-i386-unknown-freebsd-hc.tar.gz
36 .elif ${MACHINE_ARCH} == "powerpc"
37 EXTRACT_ONLY += ghc-6.6.1-powerpc-apple-darwin-hc.tar.gz
40 # Build an unregisterised bootstrap compiler and install it directly
41 # into the .buildlink directory. But we can't use "make install"
42 # because we don't build it in a standard way (./configure && make).
44 # To install it, we search for any non-symlink executables in
45 # work/ghc-6.4.2 whose name ends with "-inplace". Then copy those
46 # files into ${BUILDLINK_DIR}/bin with dropping the "-inplace" at
49 cd ${WRKDIR}/ghc-6.6.1 && \
50 ${CHMOD} +x ./distrib/hc-build && \
51 ${ENV} ${CONFIGURE_ENV} ./distrib/hc-build -C --disable-readline --enable-hc-boot-unregisterised && \
52 ${FIND} . -type f -and -perm +o+x -and -name '*-inplace' | \
54 ${CP} $$i ${BUILDLINK_DIR}/bin/`basename $$i | sed -e 's/-inplace//'`; \
57 # The ghc compiler does normally split the generated C files into small
58 # parts before sending them to gcc, to enable the linker to eliminate
59 # unused parts. This does however not play nice with the pkgsrc
60 # framework, and the result is that the build takes more than 5 times
61 # as long than when the files are not split. See
62 # http://mail-index.netbsd.org/tech-pkg/2006/07/30/0005.html
63 # for a description of the problem.
64 # Disable file splitting until pkgsrc has been improved.
66 ${ECHO} "SplitObjs=NO" > ${WRKSRC}/mk/build.mk
68 .include "../../devel/gmp/buildlink3.mk"
69 .include "../../wip/editline/buildlink3.mk"
70 .include "../../mk/pthread.buildlink3.mk"
71 .include "../../mk/bsd.pkg.mk"