fix typos in m4 macros preventing build to happen.
[framework/uifw/ecore.git] / m4 / efl_compiler.m4
1 dnl Copyright (C) 2012 Vincent Torri <vincent dot torri at gmail dot com>
2 dnl This code is public domain and can be freely used or copied.
3
4 dnl Macro that check if compiler of linker flags are available
5
6
7 dnl Macro that checks for a compiler flag availability
8 dnl
9 dnl EFL_CHECK_COMPILER_FLAG(EFL, FLAG[, ACTION-IF-FOUND[ ,ACTION-IF-NOT-FOUND]])
10 dnl AC_SUBST : EFL_CFLAGS (EFL being replaced by its value)
11 dnl AM_CONDITIONAL : EFL_HAVE_FLAG (FLAG being replaced by its value)
12
13 AC_DEFUN([EFL_CHECK_COMPILER_FLAG],
14 [
15 m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
16 m4_pushdef([UP], m4_translit([$2], [-a-z], [_A-Z]))dnl
17
18 CFLAGS_save="${CFLAGS}"
19 CFLAGS="${CFLAGS} $2"
20
21 AC_LANG_PUSH([C])
22 AC_MSG_CHECKING([whether the compiler supports $2])
23
24 AC_COMPILE_IFELSE(
25    [AC_LANG_PROGRAM([[]])],
26    [have_flag="yes"],
27    [have_flag="no"])
28 AC_MSG_RESULT([${have_flag}])
29
30 CFLAGS="${CFLAGS_save}"
31 AC_LANG_POP([C])
32
33 UPEFL[_CFLAGS]="${UPEFL[_CFLAGS]} [$2]"
34 AC_ARG_VAR(UPEFL[_CFLAGS], [preprocessor flags for $2])
35 AC_SUBST(UPEFL[_CFLAGS])
36
37 AM_CONDITIONAL([EFL_HAVE]UPEFL, [test "x${have_flag}" = "xyes"])
38
39 m4_popdef([UP])
40 m4_popdef([UPEFL])
41 ])
42
43 dnl Macro that iterates over a sequence of white separated flags
44 dnl and that call EFL_CHECK_COMPILER_FLAG() for each of these flags
45 dnl
46 dnl EFL_CHECK_COMPILER_FLAGS(EFL, FLAGS)
47
48 AC_DEFUN([EFL_CHECK_COMPILER_FLAGS],
49 [
50 m4_foreach_w([flag], [$2], [EFL_CHECK_COMPILER_FLAG($1, m4_defn([flag]))])
51 ])