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
12 DISTFILES= ${DISTNAME}-src.tar.bz2 \
13 ghc-6.6.1-src.tar.bz2 \
14 ghc-6.6.1-i386-unknown-freebsd-hc.tar.gz \
15 ghc-6.6.1-powerpc-apple-darwin-hc.tar.gz
17 SITES.ghc-6.6.1-src.tar.bz2 = http://www.haskell.org/ghc/dist/6.6.1/
18 SITES.ghc-6.6.1-powerpc-apple-darwin-hc.tar.gz = http://static.cielonegro.org/archive/
19 SITES.ghc-6.6.1-i386-unknown-freebsd-hc.tar.gz = http://static.cielonegro.org/archive/
21 PKG_DESTDIR_SUPPORT= user-destdir
23 .include "../../mk/bsd.prefs.mk"
25 # Unregisterised HC packages are architecture dependent. We have to
26 # create more HC packages to support more architectures.
27 ONLY_FOR_PLATFORM= *-*-i386 *-*-powerpc
30 CONFIGURE_ENV+= PerlCmd=${PERL5:Q}
31 USE_TOOLS+= gmake perl:run find:run cp:run
33 # We don't want to extract all of the DISTFILEs.
34 EXTRACT_ONLY= ${DISTNAME}-src.tar.bz2 \
37 .if ${MACHINE_ARCH} == "i386"
38 EXTRACT_ONLY += ghc-6.6.1-i386-unknown-freebsd-hc.tar.gz
39 .elif ${MACHINE_ARCH} == "powerpc"
40 EXTRACT_ONLY += ghc-6.6.1-powerpc-apple-darwin-hc.tar.gz
43 # We need to tell the ./configure that libgmp is in a non-standard path. Without
44 # that, the resulting GHC tries to link programs by executing ld(1) without
45 # passing it -L${PREFIX}/lib.
46 CONFIGURE_ARGS += --with-gmp-includes=${PREFIX}/include
47 CONFIGURE_ARGS += --with-gmp-libraries=${PREFIX}/lib
49 # Build an unregisterised bootstrap compiler and install it directly
50 # into the .buildlink directory. But we can't use "make install"
51 # because we don't build it in a standard way (./configure && make).
53 # To install it, we search for any non-symlink executables in
54 # work/ghc-6.4.2 whose name ends with "-inplace". Then copy those
55 # files into ${BUILDLINK_DIR}/bin with dropping the "-inplace" at
58 cd ${WRKDIR}/ghc-6.6.1 && \
59 ${CHMOD} +x ./distrib/hc-build && \
60 ${ENV} ${CONFIGURE_ENV} ./distrib/hc-build -C --disable-readline --enable-hc-boot-unregisterised && \
61 ${FIND} . -type f -and -perm -o+x -and -name '*-inplace' | \
63 ${CP} $$i ${BUILDLINK_DIR}/bin/`basename $$i | sed -e 's/-inplace//'`; \
66 # The ghc compiler does normally split the generated C files into small
67 # parts before sending them to gcc, to enable the linker to eliminate
68 # unused parts. This does however not play nice with the pkgsrc
69 # framework, and the result is that the build takes more than 5 times
70 # as long than when the files are not split. See
71 # http://mail-index.netbsd.org/tech-pkg/2006/07/30/0005.html
72 # for a description of the problem.
73 # Disable file splitting until pkgsrc gets improved.
75 ${ECHO} "SplitObjs=NO" > ${WRKSRC}/mk/build.mk
77 # Some unused scripts don't pass the portability test.
78 CHECK_PORTABILITY_SKIP+= distrib/prep-bin-dist-mingw
80 .include "../../devel/gmp/buildlink3.mk"
81 .include "../../mk/pthread.buildlink3.mk"
82 .include "../../mk/bsd.pkg.mk"