Chris@69: dnl opus-intrinsics.m4 Chris@69: dnl macro for testing for support for compiler intrinsics, either by default or with a compiler flag Chris@69: Chris@69: dnl OPUS_CHECK_INTRINSICS(NAME-OF-INTRINSICS, COMPILER-FLAG-FOR-INTRINSICS, VAR-IF-PRESENT, VAR-IF-DEFAULT, TEST-PROGRAM-HEADER, TEST-PROGRAM-BODY) Chris@69: AC_DEFUN([OPUS_CHECK_INTRINSICS], Chris@69: [ Chris@69: AC_MSG_CHECKING([if compiler supports $1 intrinsics]) Chris@69: AC_LINK_IFELSE( Chris@69: [AC_LANG_PROGRAM($5, $6)], Chris@69: [ Chris@69: $3=1 Chris@69: $4=1 Chris@69: AC_MSG_RESULT([yes]) Chris@69: ],[ Chris@69: $4=0 Chris@69: AC_MSG_RESULT([no]) Chris@69: AC_MSG_CHECKING([if compiler supports $1 intrinsics with $2]) Chris@69: save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS $2" Chris@69: AC_LINK_IFELSE([AC_LANG_PROGRAM($5, $6)], Chris@69: [ Chris@69: AC_MSG_RESULT([yes]) Chris@69: $3=1 Chris@69: ],[ Chris@69: AC_MSG_RESULT([no]) Chris@69: $3=0 Chris@69: ]) Chris@69: CFLAGS="$save_CFLAGS" Chris@69: ]) Chris@69: ])