Skip to content
Snippets Groups Projects
Commit f6e429f8 authored by Simon Marlow's avatar Simon Marlow
Browse files

default to installing runhaskell and hsc2hs again, but provide knobs to turn them off

parent 7895455f
No related merge requests found
......@@ -84,6 +84,12 @@ needed.
%build
test -f configure || sh boot
./configure --prefix=%{_prefix} --mandir=%{_mandir}
# Don't install these tools, we'll use update-alternatives below.
touch mk/build.mk
echo "NO_INSTALL_RUNHASKELL=YES" >>mk/build.mk
echo "NO_INSTALL_HSC2HS=YES" >>mk/build.mk
make %{?jobs:-j%jobs}
make html
# Alas, we don't pass make options/arguments down to "libraries", so let's redo make here...
......
......@@ -641,6 +641,19 @@ INSTALL_HEADER = $(INSTALL) -m 644
INSTALL_MAN = $(INSTALL) -m 644
INSTALL_DIR = $(MKDIRHIER)
#
# runhaskell and hsc2hs are special, in that other compilers besides
# GHC might provide them. Systems with a package manager often come
# with tools to manage this kind of clash, e.g. RPM's
# update-alternatives. When building a distribution for such a system,
# we recommend setting both of the following to 'YES'.
#
# NO_INSTALL_RUNHASKELL = YES
# NO_INSTALL_HSC2HS = YES
#
# NB. we use negative tests here because for binary-distributions we cannot
# test build-time variables at install-time, so they must default to on.
# -----------------------------------------------------------------------------
# Utilities programs: flags
......
......@@ -54,7 +54,7 @@ ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
INSTALL_PROGS += $(HS_PROG)
else
INSTALL_LIBEXECS += $(HS_PROG)
LINK = hsc2hs
LINK = hsc2hs-ghc
LINK_TARGET = $(LINK)-$(ProjectVersion)
INSTALLED_SCRIPT=$(DESTDIR)$(bindir)/$(LINK_TARGET)
install::
......@@ -66,6 +66,11 @@ install::
echo "HSC2HS_EXTRA=" >> $(INSTALLED_SCRIPT)
cat hsc2hs.sh >> $(INSTALLED_SCRIPT)
$(EXECUTABLE_FILE) $(INSTALLED_SCRIPT)
ifneq "$(NO_INSTALL_HSC2HS)" "YES"
install::
$(CP) $(INSTALLED_SCRIPT) $(DESTDIR)/$(bindir)/hsc2hs
endif
endif
# -----------------------------------------------------------------------------
......
......@@ -16,9 +16,22 @@ include $(GHC_COMPAT_DIR)/compat.mk
SRC_HC_OPTS += $(GhcHcOpts) $(GhcStage1HcOpts)
SRC_HC_OPTS += -Wall
binary-dist:
RUNHASKELL_PROG = runhaskell$(exeext)
all :: $(RUNHASKELL_PROG)
$(RUNHASKELL_PROG) : $(HS_PROG)
$(CP) $< $(RUNHASKELL_PROG)
CLEAN_FILES += $(RUNHASKELL_PROG)
ifneq "$(NO_INSTALL_RUNHASKELL)" "YES"
INSTALL_PROGS += $(RUNHASKELL_PROG)
endif
binary-dist::
$(INSTALL_DIR) $(BIN_DIST_DIR)/utils/runghc
$(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/utils/runghc/
$(INSTALL_PROGRAM) $(HS_PROG) $(BIN_DIST_DIR)/utils/runghc/
$(INSTALL_PROGRAM) $(RUNHASKELL_PROG) $(BIN_DIST_DIR)/utils/runghc/
include $(TOP)/mk/target.mk
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment