1 dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
2 dnl and Albin Tonnerre <albin dot tonnerre at gmail dot com>
3 dnl That code is public domain and can be freely used or copied.
5 dnl Macro that checks if a compiler flag is supported by the compiler.
7 dnl Usage: EFL_COMPILER_FLAG(flag)
8 dnl flag is added to CFLAGS if supported.
10 AC_DEFUN([EFL_COMPILER_FLAG],
13 CFLAGS_save="${CFLAGS}"
17 AC_MSG_CHECKING([whether the compiler supports $1])
20 [AC_LANG_PROGRAM([[]])],
23 AC_MSG_RESULT([${have_flag}])
25 if test "x${have_flag}" = "xno" ; then
26 CFLAGS="${CFLAGS_save}"
32 dnl Macro that checks if a linker flag is supported by the compiler.
34 dnl Usage: EFL_LINKER_FLAG(flag)
35 dnl flag is added to LDFLAGS if supported (will be passed to ld anyway).
37 AC_DEFUN([EFL_LINKER_FLAG],
40 LDFLAGS_save="${LDFLAGS}"
41 LDFLAGS="${LDFLAGS} $1"
44 AC_MSG_CHECKING([whether the compiler supports $1])
47 [AC_LANG_PROGRAM([[]])],
50 AC_MSG_RESULT([${have_flag}])
52 if test "x${have_flag}" = "xno" ; then
53 LDFLAGS="${LDFLAGS_save}"