Initialize Tizen 2.3
[framework/multimedia/gst-openmax.git] / wearable / m4 / as-compiler-flag.m4
1 dnl as-compiler-flag.m4 0.1.0
2
3 dnl autostars m4 macro for detection of compiler flags
4
5 dnl David Schleef <ds@schleef.org>
6 dnl Tim-Philipp Müller <tim centricular net>
7
8 dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
9 dnl Tries to compile with the given CFLAGS.
10 dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
11 dnl and ACTION-IF-NOT-ACCEPTED otherwise.
12
13 AC_DEFUN([AS_COMPILER_FLAG],
14 [
15   AC_MSG_CHECKING([to see if compiler understands $1])
16
17   save_CFLAGS="$CFLAGS"
18   CFLAGS="$CFLAGS $1"
19
20   AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
21   CFLAGS="$save_CFLAGS"
22
23   if test "X$flag_ok" = Xyes ; then
24     $2
25     true
26   else
27     $3
28     true
29   fi
30   AC_MSG_RESULT([$flag_ok])
31 ])