summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-06-20 22:22:34 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-06-20 22:22:34 +0000
commit9ae512f073c0ee2d3d5d22c6a0bfd9540c4797cf (patch)
treeece1d407b90b66f065447ab9634131a196b6dd47
parent86977b67a2e8ed1e414f964e7ca472155c67e969 (diff)
Econcentration: Add some more cflags by default.
-Wall -Wshadow -Wextra SVN revision: 72557
-rw-r--r--configure.ac8
-rw-r--r--m4/efl_compiler_flag.m457
2 files changed, 65 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 77157e1..1ebc1de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,14 @@ AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
46AC_SUBST(VMAJ) 46AC_SUBST(VMAJ)
47AC_SUBST(version_info) 47AC_SUBST(version_info)
48 48
49m4_ifdef([v_mic],
50 [
51 EFL_COMPILER_FLAG([-Wshadow])
52 EFL_COMPILER_FLAG([-Wall])
53 EFL_COMPILER_FLAG([-Wextra])
54 EFL_COMPILER_FLAG([-W])
55 ])
56
49AC_C_BIGENDIAN 57AC_C_BIGENDIAN
50AC_PROG_CC_C99 58AC_PROG_CC_C99
51AM_PROG_CC_C_O 59AM_PROG_CC_C_O
diff --git a/m4/efl_compiler_flag.m4 b/m4/efl_compiler_flag.m4
new file mode 100644
index 0000000..25c285d
--- /dev/null
+++ b/m4/efl_compiler_flag.m4
@@ -0,0 +1,57 @@
1dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
2dnl and Albin Tonnerre <albin dot tonnerre at gmail dot com>
3dnl That code is public domain and can be freely used or copied.
4
5dnl Macro that checks if a compiler flag is supported by the compiler.
6
7dnl Usage: EFL_COMPILER_FLAG(flag)
8dnl flag is added to CFLAGS if supported.
9
10AC_DEFUN([EFL_COMPILER_FLAG],
11[
12
13CFLAGS_save="${CFLAGS}"
14CFLAGS="${CFLAGS} $1"
15
16AC_LANG_PUSH([C])
17AC_MSG_CHECKING([whether the compiler supports $1])
18
19AC_COMPILE_IFELSE(
20 [AC_LANG_PROGRAM([[]])],
21 [have_flag="yes"],
22 [have_flag="no"])
23AC_MSG_RESULT([${have_flag}])
24
25if test "x${have_flag}" = "xno" ; then
26 CFLAGS="${CFLAGS_save}"
27fi
28AC_LANG_POP([C])
29
30])
31
32dnl Macro that checks if a linker flag is supported by the compiler.
33
34dnl Usage: EFL_LINKER_FLAG(flag)
35dnl flag is added to LDFLAGS if supported (will be passed to ld anyway).
36
37AC_DEFUN([EFL_LINKER_FLAG],
38[
39
40LDFLAGS_save="${LDFLAGS}"
41LDFLAGS="${LDFLAGS} $1"
42
43AC_LANG_PUSH([C])
44AC_MSG_CHECKING([whether the compiler supports $1])
45
46AC_LINK_IFELSE(
47 [AC_LANG_PROGRAM([[]])],
48 [have_flag="yes"],
49 [have_flag="no"])
50AC_MSG_RESULT([${have_flag}])
51
52if test "x${have_flag}" = "xno" ; then
53 LDFLAGS="${LDFLAGS_save}"
54fi
55AC_LANG_POP([C])
56
57])