1 dnl use: ECORE_CHECK_MODULE(Foo, default-enabled, description[, dependancy[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]])
2 AC_DEFUN([ECORE_CHECK_MODULE],
4 m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
5 m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
7 have_ecore_[]m4_defn([DOWN])=no
8 ecore_[]m4_defn([DOWN])[]_cflags=
9 ecore_[]m4_defn([DOWN])[]_libs=
12 AC_ARG_ENABLE(ecore-$1,
15 [enable the ecore_]m4_defn([DOWN])[ module])],
17 if test "x${enableval}" = "xyes" ; then
25 AC_MSG_CHECKING([whether Ecore_$3 module is to be built])
27 if 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])"
34 AC_MSG_RESULT([no (dependency failed)])
40 AM_CONDITIONAL([BUILD_ECORE_]UP, [test "x$have_ecore_]DOWN[" = "xyes"])
42 AS_IF([test "x$have_ecore_[]m4_defn([DOWN])" = "xyes"], [$5], [$6])
44 AC_SUBST(ecore_[]m4_defn([DOWN])[]_cflags)
45 AC_SUBST(ecore_[]m4_defn([DOWN])[]_libs)
51 dnl use: ECORE_EVAS_CHECK_MODULE(foo-bar, want, description, backend[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
52 AC_DEFUN([ECORE_EVAS_CHECK_MODULE],
54 m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
55 m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
57 have_ecore_evas_[]m4_defn([DOWN])="no"
60 AC_ARG_ENABLE(ecore-evas-$1,
62 [--enable-ecore-evas-$1],
63 [enable $3 support in the ecore_evas module.])],
65 if test "x${enableval}" = "xyes" ; then
73 AC_MSG_CHECKING([whether ecore_evas $3 support is to be built])
74 AC_MSG_RESULT([${want_module}])
76 if test "x$4" = "xyes" -a \
77 "x$have_ecore_evas" = "xyes" -a \
78 "x$want_module" = "xyes" ; then
79 PKG_CHECK_EXISTS([evas-$1],
81 AC_DEFINE([BUILD_ECORE_EVAS_]m4_defn([UP]), [1], [Support for $3 Engine in Ecore_Evas])
82 have_ecore_evas_[]m4_defn([DOWN])="yes"
86 AC_MSG_CHECKING([whether ecore_evas $3 support is built])
87 AC_MSG_RESULT([$have_ecore_evas_]m4_defn([DOWN]))
89 AS_IF([test "x$have_ecore_evas_[]m4_defn([DOWN])" = "xyes"], [$5], [$6])