gst-gpac/m4/as-compiler-flag.m4
author melunko
Thu Mar 13 16:29:38 2008 +0000 (2008-03-13)
branchtrunk
changeset 942 c93bfa74c71f
permissions -rwxr-xr-x
[svn r951] gmyth now is 0.8.1. Added methods epg_is_connected() and scheduler_is_connected()
melunko@917
     1
dnl as-compiler-flag.m4 0.1.0
melunko@917
     2
melunko@917
     3
dnl autostars m4 macro for detection of compiler flags
melunko@917
     4
melunko@917
     5
dnl David Schleef <ds@schleef.org>
melunko@917
     6
melunko@917
     7
dnl $Id: as-compiler-flag.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $
melunko@917
     8
melunko@917
     9
dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
melunko@917
    10
dnl Tries to compile with the given CFLAGS.
melunko@917
    11
dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
melunko@917
    12
dnl and ACTION-IF-NOT-ACCEPTED otherwise.
melunko@917
    13
melunko@917
    14
AC_DEFUN([AS_COMPILER_FLAG],
melunko@917
    15
[
melunko@917
    16
  AC_MSG_CHECKING([to see if compiler understands $1])
melunko@917
    17
melunko@917
    18
  save_CFLAGS="$CFLAGS"
melunko@917
    19
  CFLAGS="$CFLAGS $1"
melunko@917
    20
melunko@917
    21
  AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
melunko@917
    22
  CFLAGS="$save_CFLAGS"
melunko@917
    23
melunko@917
    24
  if test "X$flag_ok" = Xyes ; then
melunko@917
    25
    $2
melunko@917
    26
    true
melunko@917
    27
  else
melunko@917
    28
    $3
melunko@917
    29
    true
melunko@917
    30
  fi
melunko@917
    31
  AC_MSG_RESULT([$flag_ok])
melunko@917
    32
])