]> gitweb @ CieloNegro.org - pkgsrc-ghc.git/blob - Makefile
Fixed a problem with libgmp in a non-standard path.
[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.3
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 LICENSE=                modified-bsd
11
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
16
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/
20
21 PKG_DESTDIR_SUPPORT=    user-destdir
22
23 .include "../../mk/bsd.prefs.mk"
24
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
28
29 GNU_CONFIGURE=          yes
30 CONFIGURE_ENV+=         PerlCmd=${PERL5:Q}
31 USE_TOOLS+=                     gmake perl:run find:run cp:run
32
33 # We don't want to extract all of the DISTFILEs.
34 EXTRACT_ONLY=   ${DISTNAME}-src.tar.bz2 \
35                                 ghc-6.6.1-src.tar.bz2
36
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
41 .endif
42
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
48
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).
52 #
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
56 # their tails.
57 pre-configure:
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' | \
62                         while read i; do \
63                                 ${CP} $$i ${BUILDLINK_DIR}/bin/`basename $$i | sed -e 's/-inplace//'`; \
64                         done
65
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.
74 pre-build:
75         ${ECHO} "SplitObjs=NO" > ${WRKSRC}/mk/build.mk
76
77 # Some unused scripts don't pass the portability test.
78 CHECK_PORTABILITY_SKIP+=        distrib/prep-bin-dist-mingw
79
80 .include "../../devel/gmp/buildlink3.mk"
81 .include "../../mk/pthread.buildlink3.mk"
82 .include "../../mk/bsd.pkg.mk"