Update to 2.28 for TINF-96
[profile/ivi/pygobject2.git] / m4 / jhflags.m4
1 dnl
2 dnl JH_ADD_CFLAG(FLAG)
3 dnl checks whether the C compiler supports the given flag, and if so, adds
4 dnl it to $CFLAGS.  If the flag is already present in the list, then the
5 dnl check is not performed.
6 AC_DEFUN([JH_ADD_CFLAG],
7 [
8 case " $CFLAGS " in
9 *@<:@\  \ @:>@$1@<:@\   \ @:>@*)
10   ;;
11 *)
12   save_CFLAGS="$CFLAGS"
13   CFLAGS="$CFLAGS $1"
14   AC_MSG_CHECKING([whether [$]CC understands $1])
15   AC_TRY_COMPILE([], [], [jh_has_option=yes], [jh_has_option=no])
16   AC_MSG_RESULT($jh_has_option)
17   if test $jh_has_option = no; then
18     CFLAGS="$save_CFLAGS"
19   fi
20   ;;
21 esac])