fi
}
+function detect_gnu_sed () {
+ if which gsed >/dev/null 2>&1; then
+ echo "gsed"
+ elif sed --version | grep -qF GNU; then
+ echo "sed"
+ else
+ echo "We need GNU sed to be installed." >&2
+ exit 1
+ fi
+}
+
function say_hello () {
local -r self=$(basename "$0")
local -r platform=$(detect_platform_type)
SRCPATH="$srcpath" \
PLATFORM="$(detect_platform_type)" \
GNUTAR="$(detect_gnu_tar)" \
+ GNUSED="$(detect_gnu_sed)" \
SHELL="$SHELL"
echo "If you are done, run \"$0 clean\" to cleanup the working directory."
+# -*- makefile-gmake -*-
PORTING_HOST = YES
GhcUnregisterised = YES
GhcLibHcOpts = -O -fvia-C -keep-hc-files
libraries/terminfo_CONFIGURE_OPTS += \
--configure-option=--with-curses-includes=/usr/pkg/include \
--configure-option=--with-curses-libraries=/usr/pkg/lib
+
+ifeq ($(shell uname),Linux)
+# To find out why evacuate() segfaults on Linux...
+rts_CC_OPTS += -O0 -g
+# ...but this stops ghc-stage2 from segfaulting. Sigh.
+endif
DIRNAME := $(patsubst %-src.tar.bz2,%,$(notdir $(SRCPATH)))
GNUTAR ?= gtar
+GNUSED ?= gsed
HC_TARNAME ?= $(DIRNAME)-boot-$(PLATFORM).tar.bz2
all: work/pack-hc-pkg.stamp
work/replace-paths.stamp: work/extract-boot-tarball.stamp
cd "work/$(DIRNAME)" && \
- gsed -i \
+ $(GNUSED) -i \
-e 's#/usr/pkg#[[PREFIX]]#g' \
-e 's#'`pwd`'-host#[[GHC_SOURCE_PATH]]#g' \
inplace/lib/package.conf.d/*.conf \