]> gitweb @ CieloNegro.org - pkgsrc-ghc.git/blob - Makefile
-perm -o+x
[pkgsrc-ghc.git] / Makefile
1 # $NetBSD: Makefile,v 1.42 2008/07/07 14:58:00 kristerw Exp $
2
3 DISTNAME=               ghc-${VERSION}
4 VERSION=                6.10.1
5 CATEGORIES=             lang
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
10
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
15
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/
19
20 .include "../../mk/bsd.prefs.mk"
21
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
25
26 GNU_CONFIGURE=          yes
27 CONFIGURE_ENV+=         PerlCmd=${PERL5:Q}
28 USE_TOOLS+=                     gmake perl:run find:run cp:run
29
30 # We don't want to extract all of the DISTFILEs.
31 EXTRACT_ONLY=   ${DISTNAME}-src.tar.bz2 \
32                                 ghc-6.6.1-src.tar.bz2
33
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
38 .endif
39
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).
43 #
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
47 # their tails.
48 pre-configure:
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' | \
53                         while read i; do \
54                                 ${CP} $$i ${BUILDLINK_DIR}/bin/`basename $$i | sed -e 's/-inplace//'`; \
55                         done
56
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.
65 pre-build:
66         ${ECHO} "SplitObjs=NO" > ${WRKSRC}/mk/build.mk
67
68 .include "../../devel/gmp/buildlink3.mk"
69 .include "../../wip/editline/buildlink3.mk"
70 .include "../../mk/pthread.buildlink3.mk"
71 .include "../../mk/bsd.pkg.mk"