]> gitweb @ CieloNegro.org - pkgsrc-ghc.git/blob - patches/patch-aclocal.m4
Drop superfluous PKG_DESTDIR_SUPPORT, "user-destdir" is default these days.
[pkgsrc-ghc.git] / patches / patch-aclocal.m4
1 $NetBSD$
2
3 Hunk #1, #2:
4   For systems having as(1) that doesn't recognise .ident
5   directives. (Already merged to the upstream)
6
7 Hunk #3:
8   Don't try to find ghc-pkg when we're bootstrapping from HC.
9
10 Hunk #4:
11   Don't try to build ghc-pwd when we're bootstrapping from HC.
12
13
14 --- aclocal.m4.orig     2012-02-01 18:10:32.000000000 +0000
15 +++ aclocal.m4
16 @@ -245,6 +245,16 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V
17          [HaskellHaveSubsectionsViaSymbols=False
18           AC_MSG_RESULT(no)])
19  
20 +    dnl ** check for .ident assembler directive
21 +
22 +    AC_MSG_CHECKING(whether your assembler supports .ident directive)
23 +    AC_COMPILE_IFELSE(
24 +        [AC_LANG_SOURCE([__asm__ (".ident \"GHC x.y.z\"");])],
25 +        [AC_MSG_RESULT(yes)
26 +         HaskellHaveIdentDirective=True],
27 +        [AC_MSG_RESULT(no)
28 +         HaskellHaveIdentDirective=False])
29 +
30      dnl *** check for GNU non-executable stack note support (ELF only)
31      dnl     (.section .note.GNU-stack,"",@progbits)
32  
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)
39  ])
40  
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,
46  [
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
51 -# other suffix.
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
55 -else
56 -  AC_MSG_ERROR([Cannot find matching ghc-pkg])
57 -fi])
58 -GhcPkgCmd=$fp_cv_matching_ghc_pkg
59 -AC_SUBST([GhcPkgCmd])
60 -])# FP_PROG_GHC_PKG
61 +    if test "$BootingFromHc" = "YES"; then
62 +        GhcPkgCmd=
63 +    else
64 +        AC_CACHE_CHECK([for ghc-pkg matching $WithGhc], fp_cv_matching_ghc_pkg,
65 +        [
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
70 +            # other suffix.
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"
74 +            else
75 +                AC_MSG_ERROR([Cannot find matching ghc-pkg])
76 +            fi
77 +        ])
78 +        GhcPkgCmd="$fp_cv_matching_ghc_pkg"
79 +    fi
80 +    AC_SUBST([GhcPkgCmd])
81 +])
82  
83  
84  # FP_GCC_EXTRA_FLAGS
85 @@ -1729,18 +1746,28 @@ fi
86  # --------------------------------------------------------------
87  
88  AC_DEFUN([FP_INTREE_GHC_PWD],[
89 -AC_MSG_NOTICE(Building in-tree ghc-pwd)
90      dnl This would be
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
96 -    then
97 -        AC_MSG_ERROR([Building ghc-pwd failed])
98 -    fi
99  
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])
103 +        GHC_PWD=pwd
104 +    else
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
113 +        else
114 +            AC_MSG_ERROR([Building ghc-pwd failed])
115 +        fi
116 +    fi
117  ])
118  
119  AC_DEFUN([FP_BINDIST_GHC_PWD],[