branches/gmyth-0.1b/m4/as-compiler-flag.m4
author morphbr
Wed Feb 07 00:03:05 2007 +0000 (2007-02-07)
branchtrunk
changeset 329 818deb9ae65d
permissions -rw-r--r--
[svn r331] - Updated gmyth_http (comments, etc..)
- Modified gmyth_http test file (test/http.c to test/gmyth_test_http.c)
- Created gmyth_vlc (interface for vlc - will be used for live tv and cool stuff)
- Created gmyth_vlc test file (test/gmyth_test_vlc.c)
renatofilho@320
     1
dnl as-compiler-flag.m4 0.1.0
renatofilho@320
     2
renatofilho@320
     3
dnl autostars m4 macro for detection of compiler flags
renatofilho@320
     4
renatofilho@320
     5
dnl David Schleef <ds@schleef.org>
renatofilho@320
     6
renatofilho@320
     7
dnl $Id: as-compiler-flag.m4,v 1.1.1.1 2005/08/26 00:42:44 andrunko Exp $
renatofilho@320
     8
renatofilho@320
     9
dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
renatofilho@320
    10
dnl Tries to compile with the given CFLAGS.
renatofilho@320
    11
dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
renatofilho@320
    12
dnl and ACTION-IF-NOT-ACCEPTED otherwise.
renatofilho@320
    13
renatofilho@320
    14
AC_DEFUN([AS_COMPILER_FLAG],
renatofilho@320
    15
[
renatofilho@320
    16
  AC_MSG_CHECKING([to see if compiler understands $1])
renatofilho@320
    17
renatofilho@320
    18
  save_CFLAGS="$CFLAGS"
renatofilho@320
    19
  CFLAGS="$CFLAGS $1"
renatofilho@320
    20
renatofilho@320
    21
  AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
renatofilho@320
    22
  CFLAGS="$save_CFLAGS"
renatofilho@320
    23
renatofilho@320
    24
  if test "X$flag_ok" = Xyes ; then
renatofilho@320
    25
    $2
renatofilho@320
    26
    true
renatofilho@320
    27
  else
renatofilho@320
    28
    $3
renatofilho@320
    29
    true
renatofilho@320
    30
  fi
renatofilho@320
    31
  AC_MSG_RESULT([$flag_ok])
renatofilho@320
    32
])
renatofilho@320
    33