Build system: delete ghc-pwd
authorThomas Miedema <thomasmiedema@gmail.com>
Mon, 4 Jan 2016 17:29:49 +0000 (18:29 +0100)
committerBen Gamari <ben@smart-cactus.org>
Mon, 4 Jan 2016 17:29:50 +0000 (18:29 +0100)
On Windows, with msys2, `pwd` works (as can be seen by the use of `pwd`
that slipped into the validate script), so there is really no need for
`ghc-pwd` anymore.

Test Plan: try it

Reviewers: austin, bgamari, Phyx

Reviewed By: Phyx

Subscribers: Phyx, erikd

Differential Revision: https://phabricator.haskell.org/D1731

aclocal.m4
configure.ac
distrib/configure.ac.in
ghc.mk
utils/ghc-pwd/Main.hs [deleted file]
utils/ghc-pwd/Setup.hs [deleted file]
utils/ghc-pwd/ghc-pwd.cabal [deleted file]
utils/ghc-pwd/ghc.mk [deleted file]
validate

index 8e97726..0c93de4 100644 (file)
@@ -1737,33 +1737,9 @@ AC_DEFUN([FP_CURSES],
 # Calculate absolute path to build tree
 # --------------------------------------------------------------
 
 # Calculate absolute path to build tree
 # --------------------------------------------------------------
 
-AC_DEFUN([FP_INTREE_GHC_PWD],[
-AC_MSG_NOTICE(Building in-tree ghc-pwd)
-    dnl This would be
-    dnl     make -C utils/ghc-pwd clean && make -C utils/ghc-pwd
-    dnl except we don't want to have to know what make is called. Sigh.
-    rm -rf utils/ghc-pwd/dist-boot
-    mkdir  utils/ghc-pwd/dist-boot
-    dnl If special linker flags are needed to build things, then allow
-    dnl the user to pass them in via LDFLAGS.
-    changequote(, )dnl
-    GHC_LDFLAGS=`perl -e 'foreach (@ARGV) { print "-optl$_ " }' -- $LDFLAGS`
-    changequote([, ])dnl
-    if ! "$WithGhc" $GHC_LDFLAGS -v0 -no-user-$GHC_PACKAGE_DB_FLAG -hidir utils/ghc-pwd/dist-boot -odir utils/ghc-pwd/dist-boot -stubdir utils/ghc-pwd/dist-boot --make utils/ghc-pwd/Main.hs -o utils/ghc-pwd/dist-boot/ghc-pwd
-    then
-        AC_MSG_ERROR([Building ghc-pwd failed])
-    fi
-
-    GHC_PWD=utils/ghc-pwd/dist-boot/ghc-pwd
-])
-
-AC_DEFUN([FP_BINDIST_GHC_PWD],[
-    GHC_PWD=utils/ghc-pwd/dist-install/build/tmp/ghc-pwd-bindist
-])
-
 AC_DEFUN([FP_FIND_ROOT],[
 AC_MSG_CHECKING(for path to top of build tree)
 AC_DEFUN([FP_FIND_ROOT],[
 AC_MSG_CHECKING(for path to top of build tree)
-    hardtop=`$GHC_PWD`
+    hardtop=`pwd`
 
     dnl Remove common automounter nonsense
     hardtop=`echo $hardtop | sed 's|^/tmp_mnt.*\(/local/.*\)$|\1|' | sed 's|^/tmp_mnt/|/|'`
 
     dnl Remove common automounter nonsense
     hardtop=`echo $hardtop | sed 's|^/tmp_mnt.*\(/local/.*\)$|\1|' | sed 's|^/tmp_mnt/|/|'`
index 042b417..ab82bb0 100644 (file)
@@ -26,6 +26,8 @@ AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.1], [glasgow-haske
 # checkout), then we ship a file 'VERSION' containing the full version
 # when the source distribution was created.
 
 # checkout), then we ship a file 'VERSION' containing the full version
 # when the source distribution was created.
 
+FP_FIND_ROOT
+
 if test ! -f mk/config.h.in; then
    echo "mk/config.h.in doesn't exist: perhaps you haven't run 'perl boot'?"
    exit 1
 if test ! -f mk/config.h.in; then
    echo "mk/config.h.in doesn't exist: perhaps you haven't run 'perl boot'?"
    exit 1
@@ -258,10 +260,6 @@ AC_ARG_WITH(hc,
 )
 AC_SUBST(WithHc)
 
 )
 AC_SUBST(WithHc)
 
-# This uses GHC, so put it after the "GHC is required" check above:
-FP_INTREE_GHC_PWD
-FP_FIND_ROOT
-
 fail() {
     echo >&2
     echo "$1" >&2
 fail() {
     echo >&2
     echo "$1" >&2
index 0f68a52..4d57cd8 100644 (file)
@@ -6,7 +6,6 @@ dnl
 
 AC_INIT([The Glorious Glasgow Haskell Compilation System], [@ProjectVersion@], [glasgow-haskell-bugs@haskell.org], [ghc])
 
 
 AC_INIT([The Glorious Glasgow Haskell Compilation System], [@ProjectVersion@], [glasgow-haskell-bugs@haskell.org], [ghc])
 
-FP_BINDIST_GHC_PWD
 FP_FIND_ROOT
 
 dnl--------------------------------------------------------------------
 FP_FIND_ROOT
 
 dnl--------------------------------------------------------------------
diff --git a/ghc.mk b/ghc.mk
index ba708a1..3ccc496 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -516,7 +516,6 @@ $(foreach pkg,$(PACKAGES_STAGE1),$(eval $(call fixed_pkg_dep,$(pkg),dist-install
 # the stage1 packages, so we have to make sure those packages get configured
 # and registered before we can start with these. Note that they don't depend on
 # eachother, so we can configure them in parallel.
 # the stage1 packages, so we have to make sure those packages get configured
 # and registered before we can start with these. Note that they don't depend on
 # eachother, so we can configure them in parallel.
-utils/ghc-pwd/dist-install/package-data.mk: $(fixed_pkg_prev)
 utils/ghc-cabal/dist-install/package-data.mk: $(fixed_pkg_prev)
 utils/hpc/dist-install/package-data.mk: $(fixed_pkg_prev)
 utils/ghc-pkg/dist-install/package-data.mk: $(fixed_pkg_prev)
 utils/ghc-cabal/dist-install/package-data.mk: $(fixed_pkg_prev)
 utils/hpc/dist-install/package-data.mk: $(fixed_pkg_prev)
 utils/ghc-pkg/dist-install/package-data.mk: $(fixed_pkg_prev)
@@ -660,7 +659,6 @@ BUILD_DIRS += utils/testremove
 BUILD_DIRS += utils/ghctags
 BUILD_DIRS += utils/check-api-annotations
 BUILD_DIRS += utils/dll-split
 BUILD_DIRS += utils/ghctags
 BUILD_DIRS += utils/check-api-annotations
 BUILD_DIRS += utils/dll-split
-BUILD_DIRS += utils/ghc-pwd
 BUILD_DIRS += utils/ghc-cabal
 BUILD_DIRS += utils/hpc
 BUILD_DIRS += utils/runghc
 BUILD_DIRS += utils/ghc-cabal
 BUILD_DIRS += utils/hpc
 BUILD_DIRS += utils/runghc
@@ -1020,7 +1018,6 @@ $(eval $(call bindist-list,.,\
     mk/config.mk.in \
     $(INPLACE_BIN)/mkdirhier \
     utils/ghc-cabal/dist-install/build/tmp/ghc-cabal \
     mk/config.mk.in \
     $(INPLACE_BIN)/mkdirhier \
     utils/ghc-cabal/dist-install/build/tmp/ghc-cabal \
-    utils/ghc-pwd/dist-install/build/tmp/ghc-pwd \
     $(BINDIST_WRAPPERS) \
     $(BINDIST_PERL_SOURCES) \
     $(BINDIST_LIBS) \
     $(BINDIST_WRAPPERS) \
     $(BINDIST_PERL_SOURCES) \
     $(BINDIST_LIBS) \
@@ -1366,9 +1363,6 @@ distclean : clean
 # Internal files generated by ./configure for itself.
        $(call removeFiles,config.cache config.status config.log)
 
 # Internal files generated by ./configure for itself.
        $(call removeFiles,config.cache config.status config.log)
 
-# ./configure build ghc-pwd in utils/ghc-pwd/dist-boot, so clean it up.
-       $(call removeTrees,utils/ghc-pwd/dist-boot)
-
 # The root Makefile makes .old versions of some files that configure
 # generates, so we clean those too.
        $(call removeFiles,mk/config.mk.old)
 # The root Makefile makes .old versions of some files that configure
 # generates, so we clean those too.
        $(call removeFiles,mk/config.mk.old)
diff --git a/utils/ghc-pwd/Main.hs b/utils/ghc-pwd/Main.hs
deleted file mode 100644 (file)
index 91a5606..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-
-module Main where
-
-import System.Directory
-import System.Environment
-import System.Exit
-import System.IO
-
-main :: IO ()
-main = do
-    args <- getArgs
-    case args of
-        [] -> do d <- getCurrentDirectory
-                 putStr $ map forwardifySlashes d
-        _ -> do hPutStrLn stderr ("Bad args: " ++ show args)
-                hPutStrLn stderr "Usage: ghc-pwd"
-                exitFailure
-
-forwardifySlashes :: Char -> Char
-forwardifySlashes '\\' = '/'
-forwardifySlashes c = c
-
diff --git a/utils/ghc-pwd/Setup.hs b/utils/ghc-pwd/Setup.hs
deleted file mode 100644 (file)
index 9a994af..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-import Distribution.Simple
-main = defaultMain
diff --git a/utils/ghc-pwd/ghc-pwd.cabal b/utils/ghc-pwd/ghc-pwd.cabal
deleted file mode 100644 (file)
index dcd9529..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-Name: ghc-pwd
-Version: 0.1
-Copyright: XXX
-License: BSD3
--- XXX License-File: LICENSE
--- XXX Author:
--- XXX Maintainer:
-Synopsis: XXX
-Description:
-       XXX
-build-type: Simple
-cabal-version: >=1.10
-
-Executable ghc-pwd
-    Default-Language: Haskell2010
-    Main-Is: Main.hs
-    Build-Depends: base       >= 3   && < 5,
-                   directory  >= 1   && < 1.3
-
diff --git a/utils/ghc-pwd/ghc.mk b/utils/ghc-pwd/ghc.mk
deleted file mode 100644 (file)
index ac6bc76..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-
-utils/ghc-pwd_USES_CABAL = YES
-utils/ghc-pwd_PACKAGE    = ghc-pwd
-utils/ghc-pwd_dist-install_INSTALL_INPLACE = YES
-utils/ghc-pwd_dist-install_WANT_BINDIST_WRAPPER = YES
-utils/ghc-pwd_dist-install_PROGNAME = ghc-pwd
-
-$(eval $(call build-prog,utils/ghc-pwd,dist-install,1))
-
index 3b21002..d6bc1bf 100755 (executable)
--- a/validate
+++ b/validate
@@ -161,10 +161,12 @@ $make -C utils/checkUniques
 
 if [ $testsuite_only -eq 0 ]; then
 
 
 if [ $testsuite_only -eq 0 ]; then
 
+thisdir=`pwd`
+
 if [ $no_clean -eq 0 ]; then
     $make maintainer-clean NO_CLEAN_GMP=YES
 
 if [ $no_clean -eq 0 ]; then
     $make maintainer-clean NO_CLEAN_GMP=YES
 
-    INSTDIR=`pwd`/inst
+    INSTDIR="$thisdir/inst"
 
     if [ $use_dph -eq 1 ]; then
         perl -w boot --validate --required-tag=dph
 
     if [ $use_dph -eq 1 ]; then
         perl -w boot --validate --required-tag=dph
@@ -174,8 +176,6 @@ if [ $no_clean -eq 0 ]; then
     ./configure --prefix="$INSTDIR" $config_args
 fi
 
     ./configure --prefix="$INSTDIR" $config_args
 fi
 
-thisdir=`utils/ghc-pwd/dist-boot/ghc-pwd`
-
 echo "Validating=YES"       >  mk/are-validating.mk
 echo "ValidateSpeed=$speed" >> mk/are-validating.mk
 echo "ValidateHpc=$hpc"     >> mk/are-validating.mk
 echo "Validating=YES"       >  mk/are-validating.mk
 echo "ValidateSpeed=$speed" >> mk/are-validating.mk
 echo "ValidateHpc=$hpc"     >> mk/are-validating.mk