4 For systems having as(1) that doesn't recognise .ident
5 directives. (Already merged to the upstream)
8 Don't try to find ghc-pkg when we're bootstrapping from HC.
11 Don't try to build ghc-pwd when we're bootstrapping from HC.
14 --- aclocal.m4.orig 2012-02-01 18:10:32.000000000 +0000
16 @@ -245,6 +245,16 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V
17 [HaskellHaveSubsectionsViaSymbols=False
20 + dnl ** check for .ident assembler directive
22 + AC_MSG_CHECKING(whether your assembler supports .ident directive)
24 + [AC_LANG_SOURCE([__asm__ (".ident \"GHC x.y.z\"");])],
26 + HaskellHaveIdentDirective=True],
28 + HaskellHaveIdentDirective=False])
30 dnl *** check for GNU non-executable stack note support (ELF only)
31 dnl (.section .note.GNU-stack,"",@progbits)
33 @@ -277,6 +287,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V
34 AC_SUBST(HaskellTargetArch)
35 AC_SUBST(HaskellTargetOs)
36 AC_SUBST(HaskellHaveSubsectionsViaSymbols)
37 + AC_SUBST(HaskellHaveIdentDirective)
38 AC_SUBST(HaskellHaveGnuNonexecStack)
41 @@ -1415,22 +1426,28 @@ AC_SUBST([FopCmd])
42 # Try to find a ghc-pkg matching the ghc mentioned in the environment variable
43 # WithGhc. Sets the output variable GhcPkgCmd.
44 AC_DEFUN([FP_PROG_GHC_PKG],
45 -[AC_CACHE_CHECK([for ghc-pkg matching $WithGhc], fp_cv_matching_ghc_pkg,
47 -# If we are told to use ghc-stage2, then we're using an in-tree
48 -# compiler. In this case, we just want ghc-pkg, not ghc-pkg-stage2,
49 -# so we sed off -stage[0-9]$. However, if we are told to use
50 -# ghc-6.12.1 then we want to use ghc-pkg-6.12.1, so we keep any
52 -fp_ghc_pkg_guess=`echo $WithGhc | sed -e 's/-stage@<:@0-9@:>@$//' -e 's,ghc\(@<:@^/\\@:>@*\)$,ghc-pkg\1,'`
53 -if "$fp_ghc_pkg_guess" list > /dev/null 2>&1; then
54 - fp_cv_matching_ghc_pkg=$fp_ghc_pkg_guess
56 - AC_MSG_ERROR([Cannot find matching ghc-pkg])
58 -GhcPkgCmd=$fp_cv_matching_ghc_pkg
59 -AC_SUBST([GhcPkgCmd])
61 + if test "$BootingFromHc" = "YES"; then
64 + AC_CACHE_CHECK([for ghc-pkg matching $WithGhc], fp_cv_matching_ghc_pkg,
66 + # If we are told to use ghc-stage2, then we're using an in-tree
67 + # compiler. In this case, we just want ghc-pkg, not ghc-pkg-stage2,
68 + # so we sed off -stage[0-9]$. However, if we are told to use
69 + # ghc-6.12.1 then we want to use ghc-pkg-6.12.1, so we keep any
71 + fp_ghc_pkg_guess=`echo "$WithGhc" | sed -e 's/-stage@<:@0-9@:>@$//' -e 's,ghc\(@<:@^/\\@:>@*\)$,ghc-pkg\1,'`
72 + if "$fp_ghc_pkg_guess" list > /dev/null 2>&1; then
73 + fp_cv_matching_ghc_pkg="$fp_ghc_pkg_guess"
75 + AC_MSG_ERROR([Cannot find matching ghc-pkg])
78 + GhcPkgCmd="$fp_cv_matching_ghc_pkg"
80 + AC_SUBST([GhcPkgCmd])
85 @@ -1729,18 +1746,28 @@ fi
86 # --------------------------------------------------------------
88 AC_DEFUN([FP_INTREE_GHC_PWD],[
89 -AC_MSG_NOTICE(Building in-tree ghc-pwd)
91 dnl make -C utils/ghc-pwd clean && make -C utils/ghc-pwd
92 dnl except we don't want to have to know what make is called. Sigh.
93 rm -rf utils/ghc-pwd/dist-boot
94 mkdir utils/ghc-pwd/dist-boot
95 - 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
97 - AC_MSG_ERROR([Building ghc-pwd failed])
100 - GHC_PWD=utils/ghc-pwd/dist-boot/ghc-pwd
101 + if test "$BootingFromHc" = "YES"; then
102 + AC_MSG_NOTICE([Using pwd instead of in-tree ghc-pwd])
105 + AC_MSG_NOTICE(Building in-tree ghc-pwd)
106 + if "$WithGhc" -v0 -no-user-package-conf \
107 + -hidir utils/ghc-pwd/dist-boot \
108 + -odir utils/ghc-pwd/dist-boot \
109 + -stubdir utils/ghc-pwd/dist-boot \
110 + --make utils/ghc-pwd/Main.hs \
111 + -o utils/ghc-pwd/dist-boot/ghc-pwd; then
112 + GHC_PWD=utils/ghc-pwd/dist-boot/ghc-pwd
114 + AC_MSG_ERROR([Building ghc-pwd failed])
119 AC_DEFUN([FP_BINDIST_GHC_PWD],[