]> gitweb @ CieloNegro.org - pkgsrc-ghc.git/blob - Makefile
It turned out that gcc -Os was sufficient to reduce the stage0's .text size under...
[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=        7.4.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 LICENSE=        modified-bsd
11
12 DISTFILES=      ${DISTNAME}-src.tar.bz2
13 DISTFILES+=     ${DISTNAME}-boot-i386-unknown-freebsd8.0.tar.bz2
14 DISTFILES+=     ${DISTNAME}-boot-i386-unknown-netbsdelf6.99.1.tar.bz2
15 DISTFILES+=     ${DISTNAME}-boot-powerpc-apple-darwin9.8.0.tar.bz2
16
17 .for i in ${DISTFILES:M*-boot-*}
18 SITES.${i}=     http://static.cielonegro.org/archive/
19 .endfor
20
21 PKG_DESTDIR_SUPPORT=    user-destdir
22
23 # Unregisterised HC packages are platform-dependent C sources. Yes,
24 # they are C sources but are totally non-portable. We have to create
25 # more HC packages to support more platforms. Note that those packages
26 # are built with integer-simple, not integer-gmp, to reduce some
27 # complexity by not depending on the GMP. The resulting registerised
28 # GHC uses integer-gmp so this won't be a problem.
29 #
30 # If you want to build HC packages yourself, follow instructions in
31 # the ./TODO file.
32 ONLY_FOR_PLATFORM= NetBSD-*-i386 FreeBSD-*-i386 Darwin-*-powerpc
33
34 # We must provide the real path to gcc to the ./configure script,
35 # because GHC has a runtime dependency on it. Aren't there any ways
36 # better than this?
37 .include "../../mk/bsd.prefs.mk"
38 .include "../../mk/compiler.mk"
39 .if empty(CCPATH)
40 WARNINGS+= "This package depends on pkgsrc's undocumented variable \
41 CCPATH but it disappeared somehow."
42 WARNINGS+= "Using hard-coded /usr/bin/gcc as the C compiler..."
43 CONFIGURE_ARGS+= --with-gcc=/usr/bin/gcc
44 .else
45 CONFIGURE_ARGS+= --with-gcc=${CCPATH}
46 .endif
47
48 USE_TOOLS+=     autoconf date gmake gtar perl perl:run
49 CONFIGURE_ENV+= PerlCmd=${PERL5:Q}
50
51 # We don't want to extract all of the DISTFILEs.
52 EXTRACT_ONLY=   ${DISTNAME}-src.tar.bz2
53
54 CONFIGURE_ARGS += \
55         --build=${PLATFORM} \
56         --host=${PLATFORM} \
57         --target=${PLATFORM} \
58         --prefix=${PREFIX} \
59         --mandir=${PREFIX}/${PKGMANDIR} \
60         --with-gmp-includes=${PREFIX}/include \
61         --with-gmp-libraries=${PREFIX}/lib \
62         --with-iconv-includes=${PREFIX}/include \
63         --with-iconv-libraries=${PREFIX}/lib
64
65 # Define ${PLATFORM} and the target "pre-configure".
66 .include "../../wip/ghc/stage0.mk"
67
68 do-configure:
69         ${RUN} cd ${WRKSRC} && \
70                 ${SETENV} ${CONFIGURE_ENV} ./configure ${CONFIGURE_ARGS}
71 # We need to tell the libraries/terminfo/configure that our ncurses is
72 # in a non-standard path. Without that, the resulting GHC tries to
73 # link programs by executing ld(1) without passing it -L${PREFIX}/lib.
74         ${RUN} ${ECHO} "libraries/terminfo_CONFIGURE_OPTS += \
75                 --configure-option=--with-curses-includes=${PREFIX}/include \
76                 --configure-option=--with-curses-libraries=${PREFIX}/lib" >> ${WRKSRC}/mk/build.mk
77 # The ghc compiler does normally split the generated asm files into small
78 # parts before sending them to gcc, to enable the linker to eliminate
79 # unused parts.  This does however not play nice with the pkgsrc
80 # framework, and the result is that the build takes more than 5 times
81 # as long than when the files are not split.  See
82 #    http://mail-index.netbsd.org/tech-pkg/2006/07/30/0005.html
83 # for a description of the problem.
84 # Disable file splitting until pkgsrc gets improved.
85         ${RUN} ${ECHO} "SplitObjs = NO" >> ${WRKSRC}/mk/build.mk
86 # If we don't explicitly disable HsColour, PLIST gets changed
87 # depending on whether we have installed it or not.
88         ${RUN} ${ECHO} "HSCOLOUR_SRCS = NO" >> ${WRKSRC}/mk/build.mk
89
90 # Substitutions for INSTALL and DEINSTALL.
91 FILES_SUBST+=   DISTNAME=${DISTNAME}
92
93 # There is an unused script which don't pass the portability test.
94 CHECK_PORTABILITY_SKIP+=        distrib/prep-bin-dist-mingw
95
96 # GHC currently *requires* ${PREFIX}/lib to be in
97 # "/etc/ld-elf.so.conf". See
98 # http://hackage.haskell.org/trac/ghc/ticket/2933
99 CHECK_SHLIBS_SUPPORTED=         no
100
101 # I guess pdcurses works well but not tested.
102 USE_NCURSES=    yes
103 .include "../../devel/ncurses/buildlink3.mk"
104
105 BUILD_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl
106 BUILDLINK_DEPMETHOD.libxslt = build
107 .include "../../converters/libiconv/buildlink3.mk"
108 .include "../../devel/gmp/buildlink3.mk"
109 .include "../../textproc/libxslt/buildlink3.mk"
110 .include "../../mk/pthread.buildlink3.mk"
111 .include "../../mk/bsd.pkg.mk"