opus-intrinsics.m4 870 B

1234567891011121314151617181920212223242526272829
  1. dnl opus-intrinsics.m4
  2. dnl macro for testing for support for compiler intrinsics, either by default or with a compiler flag
  3. dnl OPUS_CHECK_INTRINSICS(NAME-OF-INTRINSICS, COMPILER-FLAG-FOR-INTRINSICS, VAR-IF-PRESENT, VAR-IF-DEFAULT, TEST-PROGRAM-HEADER, TEST-PROGRAM-BODY)
  4. AC_DEFUN([OPUS_CHECK_INTRINSICS],
  5. [
  6. AC_MSG_CHECKING([if compiler supports $1 intrinsics])
  7. AC_LINK_IFELSE(
  8. [AC_LANG_PROGRAM($5, $6)],
  9. [
  10. $3=1
  11. $4=1
  12. AC_MSG_RESULT([yes])
  13. ],[
  14. $4=0
  15. AC_MSG_RESULT([no])
  16. AC_MSG_CHECKING([if compiler supports $1 intrinsics with $2])
  17. save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS $2"
  18. AC_LINK_IFELSE([AC_LANG_PROGRAM($5, $6)],
  19. [
  20. AC_MSG_RESULT([yes])
  21. $3=1
  22. ],[
  23. AC_MSG_RESULT([no])
  24. $3=0
  25. ])
  26. CFLAGS="$save_CFLAGS"
  27. ])
  28. ])