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