hwcaps.m4 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. dnl
  2. dnl Check if the assembler used supports disabling generation of hardware
  3. dnl capabilities. This is only supported by Solaris as at the moment.
  4. dnl
  5. dnl Defines:
  6. dnl HWCAP_CFLAGS='-Wa,-nH' if possible.
  7. dnl
  8. AC_DEFUN([GCC_CHECK_ASSEMBLER_HWCAP], [
  9. test -z "$HWCAP_CFLAGS" && HWCAP_CFLAGS=''
  10. # Restrict the test to Solaris, other assemblers (e.g. AIX as) have -nH
  11. # with a different meaning.
  12. case ${target_os} in
  13. solaris2*)
  14. ac_save_CFLAGS="$CFLAGS"
  15. CFLAGS="$CFLAGS -Wa,-nH"
  16. AC_MSG_CHECKING([for as that supports -Wa,-nH])
  17. AC_TRY_COMPILE([], [return 0;], [ac_hwcap_flags=yes],[ac_hwcap_flags=no])
  18. if test "$ac_hwcap_flags" = "yes"; then
  19. HWCAP_CFLAGS="-Wa,-nH $HWCAP_CFLAGS"
  20. fi
  21. AC_MSG_RESULT($ac_hwcap_flags)
  22. CFLAGS="$ac_save_CFLAGS"
  23. ;;
  24. esac
  25. AC_SUBST(HWCAP_CFLAGS)
  26. ])
  27. dnl
  28. dnl Check if the linker used supports linker maps to clear hardware
  29. dnl capabilities. This is only supported on Solaris at the moment.
  30. dnl
  31. dnl Defines:
  32. dnl HWCAP_LDFLAGS=-mclear-hwcap if possible
  33. dnl LD (as a side effect of testing)
  34. dnl
  35. AC_DEFUN([GCC_CHECK_LINKER_HWCAP], [
  36. test -z "$HWCAP_LDFLAGS" && HWCAP_LDFLAGS=''
  37. AC_REQUIRE([AC_PROG_LD])
  38. ac_save_LDFLAGS="$LDFLAGS"
  39. LDFLAGS="$LFLAGS -mclear-hwcap"
  40. AC_MSG_CHECKING([for -mclear-hwcap])
  41. AC_TRY_LINK([], [return 0;], [ac_hwcap_ldflags=yes],[ac_hwcap_ldflags=no])
  42. if test "$ac_hwcap_ldflags" = "yes"; then
  43. HWCAP_LDFLAGS="-mclear-hwcap $HWCAP_LDFLAGS"
  44. fi
  45. AC_MSG_RESULT($ac_hwcap_ldflags)
  46. LDFLAGS="$ac_save_LDFLAGS"
  47. AC_SUBST(HWCAP_LDFLAGS)
  48. AM_CONDITIONAL(HAVE_HWCAP, test $ac_hwcap_ldflags != no)
  49. ])