# Calculate absolute path to build tree
# --------------------------------------------------------------
-AC_DEFUN([FP_FIND_ROOT],[
-AC_MSG_CHECKING(for path to top of 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
+ if ! "$WithGhc" -v0 -no-user-package-conf -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
-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.
-if test ! -f utils/ghc-pwd/ghc-pwd && test ! -f utils/ghc-pwd/ghc-pwd.exe; then
- cd utils/ghc-pwd
- rm -f *.o
- rm -f *.hi
- rm -f ghc-pwd
- rm -f ghc-pwd.exe
- "$WithGhc" -v0 -no-user-package-conf --make ghc-pwd -o ghc-pwd
- cd ../..
-fi
+ GHC_PWD=utils/ghc-pwd/dist-boot/ghc-pwd
+])
-hardtop=`utils/ghc-pwd/ghc-pwd`
+AC_DEFUN([FP_BINDIST_GHC_PWD],[
+ GHC_PWD=utils/ghc-pwd/dist/build/tmp/ghc-pwd
+])
-if ! test -d "$hardtop"; then
- AC_MSG_ERROR([cannot determine current directory])
-fi
+AC_DEFUN([FP_FIND_ROOT],[
+AC_MSG_CHECKING(for path to top of build tree)
+ hardtop=`$GHC_PWD`
-dnl Remove common automounter nonsense
-dnl
-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/|/|'`
-AC_SUBST(hardtop)
+ if ! test -d "$hardtop"; then
+ AC_MSG_ERROR([cannot determine current directory])
+ fi
-AC_MSG_RESULT(${hardtop})
+ dnl We don't support building in directories with spaces.
+ case "$hardtop" in
+ *' '*)
+ AC_MSG_ERROR([
+ The build system does not support building in a directory
+ containing space characters.
+ Suggestion: move the build tree somewhere else.])
+ ;;
+ esac
-# We don't support building in directories with spaces.
-case "$hardtop" in
- *' '*) AC_MSG_ERROR([
- The build system does not support building in a directory containing
- space characters. Suggestion: move the build tree somewhere else.])
- ;;
-esac
+ AC_SUBST(hardtop)
+
+ AC_MSG_RESULT($hardtop)
])
# GHC_CONVERT_CPU(cpu, target_var)
AC_PATH_PROG(HBC,hbc)
# This uses GHC, so put it after the "GHC is required" check above:
+FP_INTREE_GHC_PWD
FP_FIND_ROOT
if test "$HostOS" = "mingw32"
AC_INIT([The Glorious Glasgow Haskell Compilation System], [@ProjectVersion@], [glasgow-haskell-bugs@haskell.org], [ghc])
+FP_BINDIST_GHC_PWD
FP_FIND_ROOT
BootingFromHc=NO
# package-data.mk is sufficient, as that in turn depends on all the
# libraries
utils/haddock/dist/package-data.mk: compiler/stage2/package-data.mk
+utils/ghc-pwd/dist/package-data.mk: compiler/stage2/package-data.mk
utils/ghc-pkg/dist-install/package-data.mk: compiler/stage2/package-data.mk
utils/hsc2hs/dist-install/package-data.mk: compiler/stage2/package-data.mk
$(GHC_GENAPPLY_DIR)
endif
-BUILD_DIRS += \
- utils/haddock \
- utils/haddock/doc
-
ifneq "$(CLEANING)" "YES"
BUILD_DIRS += \
$(patsubst %, libraries/%, $(PACKAGES))
endif
BUILD_DIRS += \
+ utils/haddock \
+ utils/haddock/doc \
compiler \
$(GHC_HSC2HS_DIR) \
$(GHC_PKG_DIR) \
utils/testremove \
utils/ghctags \
+ utils/ghc-pwd \
utils/hpc \
utils/runghc \
ghc
utils/hpc_dist_DISABLE = YES
utils/hsc2hs_dist-install_DISABLE = YES
utils/ghc-pkg_dist-install_DISABLE = YES
+utils/ghc-pwd_dist_DISABLE = YES
utils/mkUserGuidePart_dist_DISABLE = YES
utils/compare_sizes_dist_DISABLE = YES
compiler_stage2_DISABLE = YES
mk/config.mk.in \
$(INPLACE_BIN)/mkdirhier \
$(INPLACE_BIN)/ghc-cabal \
- utils/ghc-pwd/ghc-pwd \
+ utils/ghc-pwd/dist/build/tmp/ghc-pwd \
$(BINDIST_WRAPPERS) \
$(BINDIST_PERL_SOURCES) \
$(BINDIST_LIBS) \
.PHONY: clean
-CLEAN_FILES += utils/ghc-pwd/ghc-pwd
-CLEAN_FILES += utils/ghc-pwd/ghc-pwd.exe
-CLEAN_FILES += utils/ghc-pwd/ghc-pwd.hi
-CLEAN_FILES += utils/ghc-pwd/ghc-pwd.o
CLEAN_FILES += libraries/bootstrapping.conf
CLEAN_FILES += libraries/integer-gmp/cbits/GmpDerivedConstants.h
CLEAN_FILES += libraries/integer-gmp/cbits/mkGmpDerivedConstants
"$(RM)" $(RM_OPTS) libraries/process/include/HsProcessConfig.h
"$(RM)" $(RM_OPTS) libraries/unix/include/HsUnixConfig.h
"$(RM)" $(RM_OPTS) libraries/old-time/include/HsTimeConfig.h
+ "$(RM)" $(RM_OPTS_REC) utils/ghc-pwd/dist
"$(RM)" $(RM_OPTS) $(patsubst %, libraries/%/config.log, $(PACKAGES) $(PACKAGES_STAGE2))
"$(RM)" $(RM_OPTS) $(patsubst %, libraries/%/config.status, $(PACKAGES) $(PACKAGES_STAGE2))
build-type: Simple
cabal-version: >=1.2
-Flag base3
- Description: Choose the new smaller, split-up base package.
-
Executable ghc-pwd
Main-Is: ghc-pwd.hs
- if flag(base3)
- Build-Depends: base >= 3 && < 5,
- directory >= 1 && < 1.1
- else
- Build-Depends: base < 3
+ Build-Depends: base >= 3 && < 5,
+ directory >= 1 && < 1.2
--- /dev/null
+
+utils/ghc-pwd_USES_CABAL = YES
+utils/ghc-pwd_PACKAGE = ghc-pwd
+utils/ghc-pwd_dist_PROG = ghc-pwd$(exeext)
+
+$(eval $(call build-prog,utils/ghc-pwd,dist,1))
+
./configure --prefix="$INSTDIR" $config_args
fi
-thisdir=`utils/ghc-pwd/ghc-pwd`
+thisdir=`utils/ghc-pwd/dist-boot/ghc-pwd`
echo "Validating=YES" > mk/are-validating.mk