summaryrefslogtreecommitdiff
path: root/m4/ecore_check_module.m4
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-12-02 22:35:45 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-12-02 22:35:45 +0000
commit7d6010b12c47a20e492da808e3192c3f87dab619 (patch)
tree26c6fd189e046a76560c0bc740b85f4d767ae399 /m4/ecore_check_module.m4
parent53fc441d5475155965d92da89502fe4634a561b2 (diff)
merge: add escape ecore, fix several bugs
SVN revision: 79995
Diffstat (limited to 'm4/ecore_check_module.m4')
-rw-r--r--m4/ecore_check_module.m495
1 files changed, 95 insertions, 0 deletions
diff --git a/m4/ecore_check_module.m4 b/m4/ecore_check_module.m4
new file mode 100644
index 0000000000..8d0d76bf3c
--- /dev/null
+++ b/m4/ecore_check_module.m4
@@ -0,0 +1,95 @@
1dnl use: ECORE_CHECK_MODULE(Foo, default-enabled, description[, dependency[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]])
2AC_DEFUN([ECORE_CHECK_MODULE],
3[
4m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
5m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
6
7have_ecore_[]m4_defn([DOWN])=no
8ecore_[]m4_defn([DOWN])[]_cflags=
9ecore_[]m4_defn([DOWN])[]_libs=
10want_module=$2
11
12AC_ARG_ENABLE(ecore-$1,
13 [AC_HELP_STRING(
14 [--enable-ecore-$1],
15 [enable the ecore_]m4_defn([DOWN])[ module])],
16 [
17 if test "x${enableval}" = "xyes" ; then
18 want_module="yes"
19 else
20 want_module="no"
21 fi
22 ],
23 [])
24
25AC_MSG_CHECKING([whether Ecore_$3 module is to be built])
26
27if test "x${want_module}" = "xyes" ; then
28 if test "x$4" = "x" || test "x$4" = "xyes" ; then
29 AC_DEFINE([BUILD_ECORE_]m4_defn([UP]), [1], [Build Ecore_$3 Module])
30 have_ecore_[]m4_defn([DOWN])="yes"
31 ecore_[]m4_defn([DOWN])[]_libs="-lecore_[]m4_defn([DOWN])"
32 AC_MSG_RESULT([yes])
33 else
34 AC_MSG_RESULT([no (dependency failed)])
35 fi
36else
37 AC_MSG_RESULT([no])
38fi
39
40AM_CONDITIONAL([BUILD_ECORE_]UP, [test "x$have_ecore_]DOWN[" = "xyes"])
41
42AS_IF([test "x$have_ecore_[]m4_defn([DOWN])" = "xyes"], [$5], [$6])
43
44AC_SUBST(ecore_[]m4_defn([DOWN])[]_cflags)
45AC_SUBST(ecore_[]m4_defn([DOWN])[]_libs)
46
47m4_popdef([UP])
48m4_popdef([DOWN])
49])
50
51dnl use: ECORE_EVAS_CHECK_MODULE_FULL(foo-bar, evas-module, want, description, backend[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
52AC_DEFUN([ECORE_EVAS_CHECK_MODULE_FULL],
53[
54m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
55m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
56
57have_ecore_evas_[]m4_defn([DOWN])="no"
58want_module="$3"
59
60AC_ARG_ENABLE(ecore-evas-$1,
61 [AC_HELP_STRING(
62 [--enable-ecore-evas-$1],
63 [enable $4 support in the ecore_evas module.])],
64 [
65 if test "x${enableval}" = "xyes" ; then
66 want_module="yes"
67 else
68 want_module="no"
69 fi
70 ],
71 [])
72
73AC_MSG_CHECKING([whether ecore_evas $4 support is to be built])
74AC_MSG_RESULT([${want_module}])
75
76if test "x$2" = "xyes" && \
77 test "x$5" = "xyes" && \
78 test "x$have_ecore_evas" = "xyes" && \
79 test "x$want_module" = "xyes" ; then
80 AC_DEFINE([BUILD_ECORE_EVAS_]m4_defn([UP]), [1], [Support for $4 Engine in Ecore_Evas])
81 have_ecore_evas_[]m4_defn([DOWN])="yes"
82fi
83
84AC_MSG_CHECKING([whether ecore_evas $4 support is built])
85AC_MSG_RESULT([$have_ecore_evas_]m4_defn([DOWN]))
86
87AS_IF([test "x$have_ecore_evas_[]m4_defn([DOWN])" = "xyes"], [$6], [$7])
88
89m4_popdef([UP])
90m4_popdef([DOWN])
91])
92
93dnl use: ECORE_EVAS_CHECK_MODULE(foo-bar, want, description, backend[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
94AC_DEFUN([ECORE_EVAS_CHECK_MODULE],
95[ECORE_EVAS_CHECK_MODULE_FULL([$1], [$1], [$2], [$3], [$4], [$5], [$6])])