Fix Control.Arrow (***) diagram (fixes #25698)
[ghc.git] / m4 / fp_find_nm.m4
blobbc044cc9b6a72fe0e356606783f432e3fd5160ee
1 # FP_FIND_NM
2 # ---------------------
3 # Find nm and verify that it works.
4 AC_DEFUN([FP_FIND_NM],
6     if test "$HostOS" != "mingw32"; then
7         AC_CHECK_TARGET_TOOL([NM], [nm])
8         if test "$NM" = ":"; then
9             AC_MSG_ERROR([cannot find nm in your PATH])
10         fi
11     fi
12     if test "$HostOS" = "mingw32"
13     then
14       NmCmd=$(cygpath -m "$NM")
15     else
16       NmCmd="$NM"
17     fi
18     AC_SUBST([NmCmd])
20     if test "$TargetOS_CPP" = "darwin"
21     then
22         AC_MSG_CHECKING(whether nm program is broken)
23         # Some versions of Xcode ship a broken version of `nm`. Detect and work
24         # around this issue. See : https://gitlab.haskell.org/ghc/ghc/issues/11744
25         nmver=$(${NM} --version | grep version | sed 's/ //g')
26         case "$nmver" in
27             LLVMversion7.3.0|LLVMversion7.3.1)
28                 AC_MSG_RESULT(yes)
29                 echo "The detected nm program is broken."
30                 echo
31                 echo "See: https://gitlab.haskell.org/ghc/ghc/issues/11744"
32                 echo
33                 echo "Try re-running configure with:"
34                 echo
35                 echo '   NM=$(xcrun --find nm-classic) ./configure'
36                 echo
37                 exit 1
38                 ;;
39             *)
40                 AC_MSG_RESULT(no)
41                 ;;
42             esac
43     fi