-# Build an unregisterised bootstrap compiler and install it directly
-# into the .buildlink directory. But we can't use "make install"
-# because we don't build it in a standard way (./configure && make).
-#
-# To install it, we search for any non-symlink executables in
-# work/ghc-6.6.1 whose name ends with "-inplace". Then copy those
-# files into ${BUILDLINK_DIR}/bin with dropping the "-inplace" at
-# their tails.
-pre-configure:
- cd ${WRKDIR}/ghc-6.6.1 && \
- ${CHMOD} +x ./distrib/hc-build && \
- ${ENV} ${CONFIGURE_ENV} ./distrib/hc-build -C --disable-readline --enable-hc-boot-unregisterised && \
- ${FIND} . -type f -and -perm -o+x -and -name '*-inplace' | \
- while read i; do \
- ${CP} $$i ${BUILDLINK_DIR}/bin/`basename $$i | sed -e 's/-inplace//'`; \
- done
-
-# The ghc compiler does normally split the generated C files into small
+do-configure:
+ ${RUN} cd ${WRKSRC} && \
+ ${SETENV} ${CONFIGURE_ENV} ./configure ${CONFIGURE_ARGS}
+# We need to tell the libraries/terminfo/configure that our ncurses is
+# in a non-standard path. Without that, the resulting GHC tries to
+# link programs by executing ld(1) without passing it -L${PREFIX}/lib.
+ ${RUN} ${ECHO} "libraries/terminfo_CONFIGURE_OPTS += \
+ --configure-option=--with-curses-includes=${PREFIX}/include \
+ --configure-option=--with-curses-libraries=${PREFIX}/lib" >> ${WRKSRC}/mk/build.mk
+# The ghc compiler does normally split the generated asm files into small