Blame telepathy-account-widgets/m4/as-compiler-flag.m4

Packit 79f644
dnl as-compiler-flag.m4 0.1.0
Packit 79f644
Packit 79f644
dnl autostars m4 macro for detection of compiler flags
Packit 79f644
Packit 79f644
dnl David Schleef <ds@schleef.org>
Packit 79f644
Packit 79f644
dnl $Id: as-compiler-flag.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $
Packit 79f644
Packit 79f644
dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
Packit 79f644
dnl Tries to compile with the given CFLAGS.
Packit 79f644
dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
Packit 79f644
dnl and ACTION-IF-NOT-ACCEPTED otherwise.
Packit 79f644
Packit 79f644
AC_DEFUN([AS_COMPILER_FLAG],
Packit 79f644
[
Packit 79f644
  AC_MSG_CHECKING([to see if compiler understands $1])
Packit 79f644
Packit 79f644
  save_CFLAGS="$CFLAGS"
Packit 79f644
  CFLAGS="$CFLAGS $1"
Packit 79f644
Packit 79f644
  AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
Packit 79f644
  CFLAGS="$save_CFLAGS"
Packit 79f644
Packit 79f644
  if test "X$flag_ok" = Xyes ; then
Packit 79f644
    $2
Packit 79f644
    true
Packit 79f644
  else
Packit 79f644
    $3
Packit 79f644
    true
Packit 79f644
  fi
Packit 79f644
  AC_MSG_RESULT([$flag_ok])
Packit 79f644
])
Packit 79f644