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