~ubuntu-branches/ubuntu/quantal/pitivi/quantal

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2008-12-12 10:22:29 UTC
  • mfrom: (1.1.6 upstream)
  • mto: (3.2.2 jaunty) (1.2.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20081212102229-7c3etvaoy9ys0x28
Tags: upstream-0.11.3
Import upstream version 0.11.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
dnl autostars m4 macro for detection of compiler flags
4
4
 
5
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 $
 
6
dnl Tim-Philipp Müller <tim centricular net>
8
7
 
9
8
dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
10
9
dnl Tries to compile with the given CFLAGS.
31
30
  AC_MSG_RESULT([$flag_ok])
32
31
])
33
32
 
 
33
dnl AS_CXX_COMPILER_FLAG(CPPFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
 
34
dnl Tries to compile with the given CPPFLAGS.
 
35
dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
 
36
dnl and ACTION-IF-NOT-ACCEPTED otherwise.
 
37
 
 
38
AC_DEFUN([AS_CXX_COMPILER_FLAG],
 
39
[
 
40
  AC_REQUIRE([AC_PROG_CXX])
 
41
 
 
42
  AC_MSG_CHECKING([to see if c++ compiler understands $1])
 
43
 
 
44
  save_CPPFLAGS="$CPPFLAGS"
 
45
  CPPFLAGS="$CPPFLAGS $1"
 
46
 
 
47
  AC_LANG_PUSH(C++)
 
48
 
 
49
  AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
 
50
  CPPFLAGS="$save_CPPFLAGS"
 
51
 
 
52
  if test "X$flag_ok" = Xyes ; then
 
53
    $2
 
54
    true
 
55
  else
 
56
    $3
 
57
    true
 
58
  fi
 
59
 
 
60
  AC_LANG_POP(C++)
 
61
 
 
62
  AC_MSG_RESULT([$flag_ok])
 
63
])
 
64