summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2013-02-27 09:57:09 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2013-02-27 09:57:09 +0000
commit47d226544fc3fb11d024740a162f8ae4e1d044c9 (patch)
tree8a024b97de71216f6b3606d3cda7bf16ae1f98a6 /utils
parent7b5e514d85c086be8dc6d938b526c97b6ced56eb (diff)
parent0ee31659afe7a6819f9eb5e233f98e5592f1b439 (diff)
downloadhaskell-tc-arrows.tar.gz
Merge remote-tracking branch 'origin/master' into tc-arrowstc-arrows
Diffstat (limited to 'utils')
-rw-r--r--utils/Makefile119
-rw-r--r--utils/ghc-cabal/ghc.mk2
-rw-r--r--utils/ghc-pkg/Main.hs3
-rw-r--r--utils/ghc-pkg/ghc-pkg.cabal2
-rw-r--r--utils/ghc-pkg/ghc.mk71
-rw-r--r--utils/ghctags/Main.hs2
-rw-r--r--utils/lndir/Makefile17
-rw-r--r--utils/runghc/runghc.hs2
8 files changed, 18 insertions, 200 deletions
diff --git a/utils/Makefile b/utils/Makefile
deleted file mode 100644
index e522c32ba8..0000000000
--- a/utils/Makefile
+++ /dev/null
@@ -1,119 +0,0 @@
-TOP=..
-include $(TOP)/mk/boilerplate.mk
-
-ifeq "$(DOING_BIN_DIST)" "YES"
-# We're doing a binary-dist, descend into a subset of the dirs.
-SUBDIRS = mkdirhier hp2ps parallel unlit
-else
-ifeq "$(BootingFromHc)" "YES"
-SUBDIRS = mkdependC mkdirhier runstdtest genapply genprimopcode unlit
-else
-SUBDIRS = mkdependC mkdirhier runstdtest hp2ps \
- parallel unlit genprimopcode genapply
-endif
-#ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-## lndir doesn't build on Windows
-#SUBDIRS += lndir
-#endif
-endif
-
-ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-SUBDIRS += touchy
-endif
-
-# XXX pwd and lndir building disabled for now
-
-# Utils that we don't build by default:
-# nofib-analyse
-
-# Utils that are old and/or bitrotted:
-# stat2resid
-# debugNCG
-# genargs
-# heap-view
-# pvm
-# verbatim
-# ltx
-# hstags
-
-# "heap-view" is not in the list because (a) it requires
-# a Haskell compiler (which you may not have yet), and (b) you are
-# unlikely to want it desperately. It is easy to build once you have
-# a Haskell compiler and if you want it.
-
-include $(TOP)/mk/target.mk
-
-# genprimopcode is needed to boot in ghc/compiler...
-ifneq "$(BootingFromHc)" "YES"
-boot ::
- $(MAKE) -C genprimopcode
-endif
-
-############################################
-
-# The utils may be built with the bootstrapping compiler, for use during
-# the build, or with the stage2 compiler, for installing. Some of them
-# are built with both; we can't install the utils built with the
-# bootstrapping compiler as they may use different versions of C
-# libraries. The reason we use stage2 rather than stage1 is that some
-# utils, e.g. haddock, need the GHC API package.
-
-WITH_BOOTSTRAPPING_COMPILER = installPackage ghc-pkg hsc2hs hpc
-
-WITH_STAGE2 = installPackage ghc-pkg runghc hpc pwd haddock
-ifneq "$(NO_INSTALL_HSC2HS)" "YES"
-WITH_STAGE2 += hsc2hs
-endif
-
-# sort removes duplicates - we don't actually care about the order
-WITH_EITHER = $(sort $(WITH_BOOTSTRAPPING_COMPILER) $(WITH_STAGE2))
-
-# We need to build pwd with stage 2, as it goes in bindists, but we
-# don't actually want to install it. Likewise the installPackage
-# program.
-DO_NOT_INSTALL = pwd installPackage
-
-binary-dist: $(foreach P,$(WITH_STAGE2),binary-dist.$P)
-ifeq "$(WHERE_AM_I)" ""
- echo "I don't know where I am" >&2
- exit 1
-endif
- echo $(WHERE_AM_I)/Makefile >> $(BIN_DIST_LIST)
- set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d binary-dist WHERE_AM_I=$(WHERE_AM_I)/$$d; done
-
-clean:: $(foreach P,$(WITH_EITHER),clean.$P)
-
-distclean:: $(foreach P,$(WITH_EITHER),distclean.$P)
-
-with-bootstrapping-compiler: \
- $(foreach P,$(WITH_BOOTSTRAPPING_COMPILER),with-bootstrapping-compiler.$P)
-
-with-stage-2: $(foreach P,$(WITH_STAGE2),with-stage-2.$P)
- $(MAKE) -C haddock install-inplace
-
-install:: $(foreach P,$(filter-out $(DO_NOT_INSTALL),$(WITH_STAGE2)),install.$P)
-
-$(foreach P,$(WITH_EITHER),clean.$P): \
-clean.%:
- $(MAKE) -C $* clean
-
-$(foreach P,$(WITH_EITHER),distclean.$P): \
-distclean.%:
- $(MAKE) -C $* distclean
-
-$(foreach P,$(WITH_BOOTSTRAPPING_COMPILER),with-bootstrapping-compiler.$P): \
-with-bootstrapping-compiler.%:
- $(MAKE) -C $* with-bootstrapping-compiler
-
-$(foreach P,$(WITH_STAGE2),with-stage-2.$P): \
-with-stage-2.%:
- $(MAKE) -C $* with-stage-2
-
-$(foreach P,$(WITH_STAGE2),install.$P): \
-install.%:
- $(MAKE) -C $* install
-
-$(foreach P,$(WITH_STAGE2),binary-dist.$P): \
-binary-dist.%:
- $(MAKE) -C $* binary-dist WHERE_AM_I=$(WHERE_AM_I)/$*
-
diff --git a/utils/ghc-cabal/ghc.mk b/utils/ghc-cabal/ghc.mk
index 2b105f424c..e95fa62f07 100644
--- a/utils/ghc-cabal/ghc.mk
+++ b/utils/ghc-cabal/ghc.mk
@@ -30,7 +30,7 @@ $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(GHC_CABAL_DIR)/Main.hs $(T
-no-user-$(GHC_PACKAGE_DB_FLAG) \
-Wall -fno-warn-unused-imports -fno-warn-warnings-deprecations \
-DCABAL_VERSION=$(CABAL_VERSION) \
- -DBOOTSTRAPPING \
+ -DBOOTSTRAPPING \
-odir bootstrapping \
-hidir bootstrapping \
-ilibraries/Cabal/Cabal \
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index 6e9dba6dab..2e7bab6cc4 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -21,7 +21,7 @@ import Distribution.Text
import Distribution.Version
import System.FilePath as FilePath
import qualified System.FilePath.Posix as FilePath.Posix
-import System.Cmd ( rawSystem )
+import System.Process
import System.Directory ( getAppUserDataDirectory, createDirectoryIfMissing,
getModificationTime )
import Text.Printf
@@ -61,7 +61,6 @@ import System.Posix hiding (fdToHandle)
#endif
#if defined(GLOB)
-import System.Process(runInteractiveCommand)
import qualified System.Info(os)
#endif
diff --git a/utils/ghc-pkg/ghc-pkg.cabal b/utils/ghc-pkg/ghc-pkg.cabal
index e7f1d539ac..2f42e31f15 100644
--- a/utils/ghc-pkg/ghc-pkg.cabal
+++ b/utils/ghc-pkg/ghc-pkg.cabal
@@ -11,7 +11,7 @@ Description:
XXX
Category: Development
build-type: Simple
-cabal-version: >=1.2
+cabal-version: >=1.4
Executable ghc-pkg
Main-Is: Main.hs
diff --git a/utils/ghc-pkg/ghc.mk b/utils/ghc-pkg/ghc.mk
index d904c48d11..a179ae7940 100644
--- a/utils/ghc-pkg/ghc.mk
+++ b/utils/ghc-pkg/ghc.mk
@@ -13,62 +13,6 @@
# -----------------------------------------------------------------------------
# Bootstrapping ghc-pkg
-utils/ghc-pkg_dist_PROG = ghc-pkg$(exeext)
-
-ifeq "$(BootingFromHc)" "YES"
-
-inplace/bin/ghc-pkg : utils/ghc-pkg/dist-install/build/tmp/$(utils/ghc-pkg_dist_PROG)$(exeext)
-ifeq "$(Windows)" "YES"
- cp $< $@
-else
- $(call removeFiles,$@)
- echo "#!/bin/sh" >>$@
- echo "PKGCONF=$(TOP)/$(INPLACE_PACKAGE_CONF)" >>$@
- echo '$(TOP)/$< --global-package-db $$PKGCONF $${1+"$$@"}' >> $@
- chmod +x $@
-endif
-
-else
-
-$(GHC_PKG_INPLACE) : utils/ghc-pkg/dist/build/tmp/$(utils/ghc-pkg_dist_PROG)$(exeext) | $$(dir $$@)/. $(INPLACE_PACKAGE_CONF)/.
- $(call removeFiles,$(wildcard $(INPLACE_PACKAGE_CONF)/*))
-ifeq "$(Windows)" "YES"
- cp $< $@
-else
- $(call removeFiles,$@)
- echo "#!/bin/sh" >>$@
- echo "PKGCONF=$(TOP)/$(INPLACE_PACKAGE_CONF)" >>$@
- echo '$(TOP)/$< --global-package-db $$PKGCONF $${1+"$$@"}' >> $@
- chmod +x $@
-endif
-
-endif
-
-# depend on ghc-cabal, otherwise we build Cabal twice when building in parallel.
-# (ghc-cabal is an order-only dependency, we don't need to rebuild ghc-pkg
-# if ghc-cabal is newer).
-# The binary package is not warning-clean, so we need a few -fno-warns here.
-#
-# ToDo: we might want to do this using ghc-cabal instead.
-#
-utils/ghc-pkg/dist/build/tmp/$(utils/ghc-pkg_dist_PROG)$(exeext): utils/ghc-pkg/Main.hs utils/ghc-pkg/dist/build/Version.hs | bootstrapping/. $$(dir $$@)/. $(GHC_CABAL_INPLACE)
- "$(GHC)" $(SRC_HC_OPTS) --make utils/ghc-pkg/Main.hs -o $@ \
- -no-user-$(GHC_PACKAGE_DB_FLAG) \
- -Wall -fno-warn-unused-imports -fno-warn-warnings-deprecations \
- $(SRC_HC_WARNING_OPTS) \
- -DCABAL_VERSION=$(CABAL_VERSION) \
- -DBOOTSTRAPPING \
- -odir bootstrapping \
- -hidir bootstrapping \
- -iutils/ghc-pkg \
- -iutils/ghc-pkg/dist/build \
- -ilibraries/Cabal/Cabal \
- -ilibraries/filepath \
- -ilibraries/hpc \
- -ilibraries/binary/src \
- -ilibraries/bin-package-db
-
-
utils/ghc-pkg/dist/build/Version.hs \
utils/ghc-pkg/dist-install/build/Version.hs: mk/project.mk | $$(dir $$@)/.
$(call removeFiles,$@)
@@ -78,7 +22,7 @@ utils/ghc-pkg/dist-install/build/Version.hs: mk/project.mk | $$(dir $$@)/.
echo "targetOS = \"$(TargetOS_CPP)\"" >> $@
echo "targetARCH = \"$(TargetArch_CPP)\"" >> $@
-$(eval $(call clean-target,utils/ghc-pkg,dist,utils/ghc-pkg/dist))
+utils/ghc-pkg_PACKAGE = ghc-pkg
# -----------------------------------------------------------------------------
# Cross-compile case: install our dist version
@@ -96,13 +40,24 @@ $(eval $(call shell-wrapper,utils/ghc-pkg,dist))
endif
+utils/ghc-pkg_dist_USES_CABAL = YES
+utils/ghc-pkg_dist_PROG = ghc-pkg$(exeext)
+utils/ghc-pkg_dist_SHELL_WRAPPER = YES
+utils/ghc-pkg_dist_INSTALL_INPLACE = YES
+
+$(eval $(call build-prog,utils/ghc-pkg,dist,0))
+
+$(GHC_PKG_INPLACE) : | $(INPLACE_PACKAGE_CONF)/.
+
+utils/ghc-pkg/dist/package-data.mk: \
+ utils/ghc-pkg/dist/build/Version.hs
+
# -----------------------------------------------------------------------------
# Normal case: Build ghc-pkg with stage 1 and install it
ifneq "$(Stage1Only)" "YES"
utils/ghc-pkg_dist-install_USES_CABAL = YES
-utils/ghc-pkg_PACKAGE = ghc-pkg
utils/ghc-pkg_dist-install_PROG = ghc-pkg
utils/ghc-pkg_dist-install_SHELL_WRAPPER = YES
diff --git a/utils/ghctags/Main.hs b/utils/ghctags/Main.hs
index 07fd5723fc..514f2998c0 100644
--- a/utils/ghctags/Main.hs
+++ b/utils/ghctags/Main.hs
@@ -292,7 +292,7 @@ boundThings modname lbinding =
AsPat id p -> patThings p (thing id : tl)
ParPat p -> patThings p tl
BangPat p -> patThings p tl
- ListPat ps _ -> foldr patThings tl ps
+ ListPat ps _ _ -> foldr patThings tl ps
TuplePat ps _ _ -> foldr patThings tl ps
PArrPat ps _ -> foldr patThings tl ps
ConPatIn _ conargs -> conArgs conargs tl
diff --git a/utils/lndir/Makefile b/utils/lndir/Makefile
deleted file mode 100644
index 43e61c1a3a..0000000000
--- a/utils/lndir/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-TOP=../..
-include $(TOP)/mk/boilerplate.mk
-
-# Exclude for booting
-ifeq "$(stage)" "2"
-SRC_CC_OPTS += $(MACOSX_DEPLOYMENT_CC_OPTS)
-SRC_LD_OPTS += $(MACOSX_DEPLOYMENT_LD_OPTS)
-endif
-
-C_SRCS=lndir.c
-C_PROG=lndir
-
-CLEAN_FILES += $(C_PROG)$(exeext) $(C_OBJS)
-DESTDIR=$(INSTBINDIR)
-
-include $(TOP)/mk/target.mk
-
diff --git a/utils/runghc/runghc.hs b/utils/runghc/runghc.hs
index 7c306475b6..1673e7bdeb 100644
--- a/utils/runghc/runghc.hs
+++ b/utils/runghc/runghc.hs
@@ -20,12 +20,12 @@ module Main (main) where
import Control.Exception
import Data.Monoid
-import System.Cmd
import System.Directory
import System.Environment
import System.Exit
import System.FilePath
import System.IO
+import System.Process
#if defined(mingw32_HOST_OS)
import Foreign