maemo-ui-old/m4/as-compiler-flag.m4
author melunko
Mon Oct 08 19:35:09 2007 +0100 (2007-10-08)
branchtrunk
changeset 860 bb5592a9ac48
parent 23 915ef81992c0
permissions -rw-r--r--
[svn r866] Fixed gst-gmyth Makefile to get source from gstreamer cvs
renatofilho@23
     1
dnl as-compiler-flag.m4 0.1.0
renatofilho@23
     2
renatofilho@23
     3
dnl autostars m4 macro for detection of compiler flags
renatofilho@23
     4
renatofilho@23
     5
dnl David Schleef <ds@schleef.org>
renatofilho@23
     6
renatofilho@23
     7
dnl $Id: as-compiler-flag.m4,v 1.1.1.1 2005/08/26 00:42:44 andrunko Exp $
renatofilho@23
     8
renatofilho@23
     9
dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
renatofilho@23
    10
dnl Tries to compile with the given CFLAGS.
renatofilho@23
    11
dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
renatofilho@23
    12
dnl and ACTION-IF-NOT-ACCEPTED otherwise.
renatofilho@23
    13
renatofilho@23
    14
AC_DEFUN([AS_COMPILER_FLAG],
renatofilho@23
    15
[
renatofilho@23
    16
  AC_MSG_CHECKING([to see if compiler understands $1])
renatofilho@23
    17
renatofilho@23
    18
  save_CFLAGS="$CFLAGS"
renatofilho@23
    19
  CFLAGS="$CFLAGS $1"
renatofilho@23
    20
renatofilho@23
    21
  AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
renatofilho@23
    22
  CFLAGS="$save_CFLAGS"
renatofilho@23
    23
renatofilho@23
    24
  if test "X$flag_ok" = Xyes ; then
renatofilho@23
    25
    $2
renatofilho@23
    26
    true
renatofilho@23
    27
  else
renatofilho@23
    28
    $3
renatofilho@23
    29
    true
renatofilho@23
    30
  fi
renatofilho@23
    31
  AC_MSG_RESULT([$flag_ok])
renatofilho@23
    32
])
renatofilho@23
    33