Revert "Make sure extensions are built before docs; get rid of strange inter-director...
[dbus-python-phuang.git] / m4 / jh-add-cflag.m4
blob75fa78c23a16884e23cf0a5a99414721982195b0
1 dnl JH_ADD_CFLAG(FLAG)
2 dnl checks whether the C compiler supports the given flag, and if so, adds
3 dnl it to $CFLAGS.  If the flag is already present in the list, then the
4 dnl check is not performed.
5 AC_DEFUN([JH_ADD_CFLAG],
7 case " $CFLAGS " in
8 *@<:@\  \ @:>@$1@<:@\   \ @:>@*)
9   ;;
11   save_CFLAGS="$CFLAGS"
12   CFLAGS="$CFLAGS $1"
13   AC_MSG_CHECKING([whether [$]CC understands $1])
14   AC_TRY_COMPILE([], [], [jh_has_option=yes], [jh_has_option=no])
15   AC_MSG_RESULT($jh_has_option)
16   if test $jh_has_option = no; then
17     CFLAGS="$save_CFLAGS"
18   fi
19   ;;
20 esac])