summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorsven.panne@aedion.de <unknown>2007-03-15 15:28:23 +0000
committersven.panne@aedion.de <unknown>2007-03-15 15:28:23 +0000
commit1ee08bbe86b03ba74a9be309a84602b34e41cbb4 (patch)
tree67135c3c69c653111efdabb3b3a6bc9bc753671b /utils
parentd4b95ea994e850f2c85e418b5625874fd25b0ebf (diff)
downloadhaskell-1ee08bbe86b03ba74a9be309a84602b34e41cbb4.tar.gz
Use update-alternatives for handling generic tool names
ATTENTION: Packagers should read the following stuff carefully! GHC, Hugs and nhc come with various tools like runhaskell or hsc2hs. On the one hand this is quite handy, avoiding lots of tiny native packages, but OTOH this leads to a few problems: * The tools are not always identical in functionality. * The tools fight for a global generic name like "/usr/bin/runhaskell". These problems are not new and not unique to Haskell implementations, so for *nix-based system there is a tool called update-alternatives which handles those cases. The idea is as follows: * Each program/man page/etc. installs itself with a very specific name like /usr/bin/hsc2hs-ghc or /usr/share/man/man1/lua5.1.1.gz, so nothing clashes. * The (un-)installation scripts call update-alternatives to notify the system about new alternatives for a generic tool/manpage/etc. * Alternatives can be grouped together ("link groups"), so e.g. switching from Sun's Java to Kaffe switches compiler, JRE, manpages etc. together. Alas, this doesn't work well with the Haskell implementations yet, because they come with different sets of tools (in addition to runFOO): GHC: hsc2hs Hugs: hsc2hs, cpphs nhc: cpphs Either these tools should be disentangled fromt the Haskell implementations or all implementations should offer the same set. Opinions and recommendations on this topic are highly welcome. * This mechanism can be used to easily switch between several versions of the same implementation, too, but we are not yet fully prepared for that. As a first step, GHC now installs hsc2hs as 'hsc2hs-ghc' and does *not* install runhaskell directly anymore, only runghc. hsc2hs and runhaskell are created via update-alternatives now. What is currently missing is a mechanism for platforms like Windows and probably Mac OS X.
Diffstat (limited to 'utils')
-rw-r--r--utils/hsc2hs/Makefile2
-rw-r--r--utils/runghc/Makefile14
2 files changed, 1 insertions, 15 deletions
diff --git a/utils/hsc2hs/Makefile b/utils/hsc2hs/Makefile
index 7c34bbaf14..88f3edbe85 100644
--- a/utils/hsc2hs/Makefile
+++ b/utils/hsc2hs/Makefile
@@ -33,7 +33,7 @@ endif
SRC_HC_OPTS += -Wall
ifneq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
-INSTALLED_SCRIPT_PROG = hsc2hs
+INSTALLED_SCRIPT_PROG = hsc2hs-ghc
endif
INPLACE_SCRIPT_PROG = hsc2hs-inplace
diff --git a/utils/runghc/Makefile b/utils/runghc/Makefile
index c1a94c799a..f210b004f3 100644
--- a/utils/runghc/Makefile
+++ b/utils/runghc/Makefile
@@ -15,18 +15,4 @@ include $(GHC_COMPAT_DIR)/compat.mk
# we must also build with $(GhcHcOpts) here:
SRC_HC_OPTS += $(GhcHcOpts) $(GhcStage1HcOpts)
-all :: runhaskell
-
-runhaskell : $(HS_PROG)
- $(CP) $< runhaskell$(exeext)
-
-CLEAN_FILES += runhaskell
-
-# Only install runhaskell if there isn't already one installed
-ifneq "$(findstring install, $(MAKECMDGOALS))" ""
-ifeq "$(wildcard $(bindir)/runhaskell)" ""
-INSTALL_PROGS += runhaskell$(exeext)
-endif
-endif
-
include $(TOP)/mk/target.mk