Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/openal-0.0.8/admin/autotools/m4/alut_check_flag.m4 @ 17

Last change on this file since 17 was 17, checked in by landauf, 16 years ago

added openal

File size: 1.3 KB
Line 
1# ALUT_CHECK_FLAG(FLAG, [ACTION-IF-SUPPORTED], [ACTION-IF-NOT-SUPPORTED])
2# -----------------------------------------------------------------------
3# Check to see whether the compiler for the current language supports a
4# particular option.
5#
6# Implementation note: When given an unkown option, some GCC versions issue an
7# warning on stderr only, but return an exit value of 0 nevertheless.
8# Consequently we have to check stderr *and* the exit value.
9AC_DEFUN([ALUT_CHECK_FLAG],
10[AC_LANG_COMPILER_REQUIRE()dnl
11AC_LANG_CASE([C],          [alut_compiler="$CC"  m4_pushdef([alut_Flags], [CFLAGS])],
12             [C++],        [alut_compiler="$CXX" m4_pushdef([alut_Flags], [CXXFLAGS])],
13             [Fortran 77], [alut_compiler="$F77" m4_pushdef([alut_Flags], [FFLAGS])])
14m4_pushdef([alut_Cache], [alut_cv_[]alut_Flags[]AS_TR_SH([$1])])[]dnl
15AC_CACHE_CHECK([whether $alut_compiler accepts $1], [alut_Cache],
16[AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
17alut_save_flags="$alut_Flags"
18alut_Flags="$alut_Flags $1"
19alut_Cache=no
20if ALUT_EVAL_STDERR([$ac_compile conftest.$ac_ext]) >/dev/null; then
21  test -s conftest.err || alut_Cache=yes
22fi
23alut_Flags="$alut_save_flags"
24rm -f conftest.err conftest.$ac_ext])
25AS_IF([test $alut_Cache = yes], [$2], [$3])[]dnl
26m4_popdef([alut_Cache])[]dnl
27m4_popdef([alut_Flags])[]dnl
28])# ALUT_CHECK_FLAG
Note: See TracBrowser for help on using the repository browser.