summaryrefslogtreecommitdiff
path: root/m4/ecore_check_module.m4
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-18 13:48:14 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-18 13:48:14 +0000
commitdb38bdd6de782b880ab03c1c4217823d30d5eae0 (patch)
tree1df90ff44139e1f1528f8d9af4ad8dc48cfddec1 /m4/ecore_check_module.m4
parentac4df627f71e4dfc331ef48027fc48b52227a6f1 (diff)
cosmetic: simplify and colorize features.
EFL_ADD_FEATURE(PKG, NAME, [VALUE]) will do an amazing work to produce colored output in a standard way. if value == yes, it's green and shows "+name" if value == no, it's red and shows "-name" else it shows cyan and shows "name=value" if not provided, will use ${have_name:-${want_name}} SVN revision: 82976
Diffstat (limited to 'm4/ecore_check_module.m4')
-rw-r--r--m4/ecore_check_module.m460
1 files changed, 5 insertions, 55 deletions
diff --git a/m4/ecore_check_module.m4 b/m4/ecore_check_module.m4
index 2aa38c3589..784b523e89 100644
--- a/m4/ecore_check_module.m4
+++ b/m4/ecore_check_module.m4
@@ -1,56 +1,6 @@
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_MODULE(name, want, [DEPENDENCY-CHECK-CODE]) 1dnl use: ECORE_EVAS_MODULE(name, want, [DEPENDENCY-CHECK-CODE])
52AC_DEFUN([ECORE_EVAS_MODULE], 2AC_DEFUN([ECORE_EVAS_MODULE],
53[ 3[dnl
54m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl 4m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
55m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl 5m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
56 6
@@ -66,8 +16,8 @@ if test "x$have_ecore_evas" = "xyes"; then
66 fi 16 fi
67fi 17fi
68 18
69AM_CONDITIONAL([BUILD_ECORE_EVAS_]UP, [test "x$have_ecore_evas_]m4_defn([DOWN])[" = "xyes"]) 19EFL_ADD_FEATURE([ECORE_EVAS], [$1], [${want_module}])dnl
70 20AM_CONDITIONAL([BUILD_ECORE_EVAS_]UP, [test "x$have_ecore_evas_]m4_defn([DOWN])[" = "xyes"])dnl
71m4_popdef([UP]) 21m4_popdef([UP])dnl
72m4_popdef([DOWN]) 22m4_popdef([DOWN])dnl
73]) 23])