diff options
author | Ian Lynagh <igloo@earth.li> | 2010-11-21 18:35:20 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2010-11-21 18:35:20 +0000 |
commit | 6bb8d64a971afce310df3349e8767b790c2845ee (patch) | |
tree | 2c84c646d1dbafc482c4232e1be9ebfa3c2bd9b0 /aclocal.m4 | |
parent | 0d348bceca43eaac089d3e5e77dcaa0110a94fe2 (diff) | |
download | haskell-6bb8d64a971afce310df3349e8767b790c2845ee.tar.gz |
For bindists, build ghc-pwd with stage 1
rather then the bootstrapping compiler. This fixes problems where the
bootstrapping compiler dynamically links against libraries not on the
target machine.
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 66 |
1 files changed, 36 insertions, 30 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 9ebfe7d224..c50d3481da 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1280,43 +1280,49 @@ fi # 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) |