summaryrefslogtreecommitdiff
path: root/m4/efl_compiler.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/efl_compiler.m4')
-rw-r--r--m4/efl_compiler.m490
1 files changed, 0 insertions, 90 deletions
diff --git a/m4/efl_compiler.m4 b/m4/efl_compiler.m4
deleted file mode 100644
index 1d34992..0000000
--- a/m4/efl_compiler.m4
+++ /dev/null
@@ -1,90 +0,0 @@
1dnl Copyright (C) 2012 Vincent Torri <vincent dot torri at gmail dot com>
2dnl This code is public domain and can be freely used or copied.
3
4dnl Macro that check if compiler of linker flags are available
5
6
7dnl Macro that checks for a compiler flag availability
8dnl
9dnl _EFL_CHECK_COMPILER_FLAGS(EFL, FLAGS)
10dnl AC_SUBST : EFL_CFLAGS (EFL being replaced by its value)
11dnl have_flag: yes or no.
12AC_DEFUN([_EFL_CHECK_COMPILER_FLAGS],
13[dnl
14m4_pushdef([UPEFL], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
15
16dnl store in options -Wfoo if -Wno-foo is passed
17option="m4_bpatsubst([[$2]], [-Wno-], [-W])"
18CFLAGS_save="${CFLAGS}"
19CFLAGS="${CFLAGS} ${option}"
20AC_LANG_PUSH([C])
21
22AC_MSG_CHECKING([whether the compiler supports $2])
23AC_COMPILE_IFELSE(
24 [AC_LANG_PROGRAM([[]])],
25 [have_flag="yes"],
26 [have_flag="no"])
27AC_MSG_RESULT([${have_flag}])
28
29AC_LANG_POP([C])
30CFLAGS="${CFLAGS_save}"
31if test "x${have_flag}" = "xyes" ; then
32 UPEFL[_CFLAGS]="${UPEFL[_CFLAGS]} [$2]"
33fi
34AC_SUBST(UPEFL[_CFLAGS])dnl
35m4_popdef([UPEFL])dnl
36])
37
38dnl EFL_CHECK_COMPILER_FLAGS(EFL, FLAGS)
39dnl Checks if FLAGS are supported and add to EFL_CLFAGS.
40dnl
41dnl It will first try every flag at once, if one fails will try them one by one.
42AC_DEFUN([EFL_CHECK_COMPILER_FLAGS],
43[dnl
44_EFL_CHECK_COMPILER_FLAGS([$1], [$2])
45if test "${have_flag}" != "yes"; then
46m4_foreach_w([flag], [$2], [_EFL_CHECK_COMPILER_FLAGS([$1], m4_defn([flag]))])
47fi
48])
49
50
51dnl Macro that checks for a linker flag availability
52dnl
53dnl _EFL_CHECK_LINKER_FLAGS(EFL, FLAGS)
54dnl AC_SUBST : EFL_LDFLAGS (EFL being replaced by its value)
55dnl have_flag: yes or no
56AC_DEFUN([_EFL_CHECK_LINKER_FLAGS],
57[dnl
58m4_pushdef([UPEFL], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
59
60LDFLAGS_save="${LDFLAGS}"
61LDFLAGS="${LDFLAGS} $2"
62AC_LANG_PUSH([C])
63
64AC_MSG_CHECKING([whether the linker supports $2])
65AC_LINK_IFELSE(
66 [AC_LANG_PROGRAM([[]])],
67 [have_flag="yes"],
68 [have_flag="no"])
69AC_MSG_RESULT([${have_flag}])
70
71AC_LANG_POP([C])
72LDFLAGS="${LDFLAGS_save}"
73if test "x${have_flag}" = "xyes" ; then
74 UPEFL[_LDFLAGS]="${UPEFL[_LDFLAGS]} [$2]"
75fi
76AC_SUBST(UPEFL[_LDFLAGS])dnl
77m4_popdef([UPEFL])dnl
78])
79
80dnl EFL_CHECK_LINKER_FLAGS(EFL, FLAGS)
81dnl Checks if FLAGS are supported and add to EFL_LDLFAGS.
82dnl
83dnl It will first try every flag at once, if one fails will try them one by one.
84AC_DEFUN([EFL_CHECK_LINKER_FLAGS],
85[dnl
86_EFL_CHECK_LINKER_FLAGS([$1], [$2])
87if test "${have_flag}" != "yes"; then
88m4_foreach_w([flag], [$2], [_EFL_CHECK_LINKER_FLAGS([$1], m4_defn([flag]))])
89fi
90])dnl