[build] Add macro for testing droid header contents.

This commit is contained in:
Juho Hämäläinen 2017-01-19 16:27:27 +02:00
parent 6bc52dac61
commit 1b3da56e22

17
m4/check_droid_enum.m4 Normal file
View file

@ -0,0 +1,17 @@
AC_DEFUN([CC_CHECK_DROID_ENUM],
[AC_MSG_CHECKING([if droid headers have enum $2])
AC_LANG_SAVE
AC_LANG_C
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $1"
AC_TRY_COMPILE(
[ #include <system/audio.h> ],
[ unsigned int e = $2; ],
cc_check_droid_enum=yes, cc_check_droid_enum=no)
CFLAGS="$SAVE_CFLAGS"
AC_LANG_RESTORE
AC_MSG_RESULT([$cc_check_droid_enum])
if test x"$cc_check_droid_enum" = x"yes"; then
AC_DEFINE(HAVE_ENUM_$2,,[define if enum $2 is found in headers])
fi
])