1 dnl use: EINA_CHECK_MODULE(foo-bar, have_dependency, description)
2 AC_DEFUN([EINA_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 AC_ARG_ENABLE([mempool-$1],
8 [AC_HELP_STRING([--enable-mempool-$1], [enable build of $3 @<:@default=$2@:>@])],
10 if test "x${enableval}" = "xyes" ; then
13 if test "x${enableval}" = "xstatic" ; then
14 enable_module="static"
23 if test "x${enable_module}" = "xyes" || test "x${enable_module}" = "xstatic" ; then
27 AC_MSG_CHECKING([whether to enable $3 built])
28 AC_MSG_RESULT([${have_module}])
31 if test "x${enable_module}" = "xstatic" ; then
33 have_static_module="yes"
34 AC_DEFINE(EINA_STATIC_BUILD_[]UP, 1, [Set to 1 if $2 is statically built])
37 if ! test "x${enable_module}" = "xno" ; then
38 AC_DEFINE(EINA_BUILD_[]UP, 1, [Set to 1 if $2 is built])
41 AM_CONDITIONAL(EINA_BUILD_[]UP, [test "x${have_module}" = "xyes"])
42 AM_CONDITIONAL(EINA_STATIC_BUILD_[]UP, [test "x${static_module}" = "xyes"])
44 enable_[]DOWN=${enable_module}