~ubuntu-branches/ubuntu/natty/gst-entrans/natty

« back to all changes in this revision

Viewing changes to common/m4/as-compiler-flag.m4

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2010-09-13 19:49:29 UTC
  • Revision ID: james.westby@ubuntu.com-20100913194929-qz90a14xyxln9yfz
Tags: upstream-0.10.2
ImportĀ upstreamĀ versionĀ 0.10.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl as-compiler-flag.m4 0.1.0
 
2
 
 
3
dnl autostars m4 macro for detection of compiler flags
 
4
 
 
5
dnl David Schleef <ds@schleef.org>
 
6
 
 
7
dnl $Id: as-compiler-flag.m4,v 1.1 2004/06/01 09:33:45 thomasvs Exp $
 
8
 
 
9
dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
 
10
dnl Tries to compile with the given CFLAGS.
 
11
dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
 
12
dnl and ACTION-IF-NOT-ACCEPTED otherwise.
 
13
 
 
14
AC_DEFUN([AS_COMPILER_FLAG],
 
15
[
 
16
  AC_MSG_CHECKING([to see if compiler understands $1])
 
17
 
 
18
  save_CFLAGS="$CFLAGS"
 
19
  CFLAGS="$CFLAGS $1"
 
20
 
 
21
  AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
 
22
  CFLAGS="$save_CFLAGS"
 
23
 
 
24
  if test "X$flag_ok" = Xyes ; then
 
25
    $2
 
26
    true
 
27
  else
 
28
    $3
 
29
    true
 
30
  fi
 
31
  AC_MSG_RESULT([$flag_ok])
 
32
])
 
33