2009-06-19 23:42:32 -07:00
|
|
|
dnl use: EINA_CHECK_MODULE(foo-bar, have_dependency, description)
|
|
|
|
AC_DEFUN([EINA_CHECK_MODULE],
|
2008-09-22 22:17:49 -07:00
|
|
|
[
|
2009-06-19 23:42:32 -07:00
|
|
|
m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
|
|
|
|
m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
|
2008-09-22 22:17:49 -07:00
|
|
|
|
2012-09-16 03:57:48 -07:00
|
|
|
default_value=$2
|
|
|
|
|
2010-01-26 03:22:48 -08:00
|
|
|
AC_ARG_ENABLE([mempool-$1],
|
2012-09-16 03:57:48 -07:00
|
|
|
[AC_HELP_STRING([--enable-mempool-$1], [enable build of $3 @<:@default=$@:>@])],
|
2008-09-22 22:17:49 -07:00
|
|
|
[
|
|
|
|
if test "x${enableval}" = "xyes" ; then
|
2009-06-19 23:42:32 -07:00
|
|
|
enable_module="yes"
|
2008-09-22 22:17:49 -07:00
|
|
|
else
|
2009-06-19 23:42:32 -07:00
|
|
|
if test "x${enableval}" = "xstatic" ; then
|
|
|
|
enable_module="static"
|
|
|
|
else
|
|
|
|
enable_module="no"
|
|
|
|
fi
|
2008-09-22 22:17:49 -07:00
|
|
|
fi
|
|
|
|
],
|
2010-01-26 07:30:40 -08:00
|
|
|
[enable_module=$2])
|
2008-09-22 22:17:49 -07:00
|
|
|
|
2009-06-19 23:42:32 -07:00
|
|
|
have_module="no"
|
2010-01-24 15:04:24 -08:00
|
|
|
if test "x${enable_module}" = "xyes" || test "x${enable_module}" = "xstatic" ; then
|
2009-06-19 23:42:32 -07:00
|
|
|
have_module="yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether to enable $3 built])
|
|
|
|
AC_MSG_RESULT([${have_module}])
|
|
|
|
|
|
|
|
static_module="no"
|
2010-01-26 07:30:40 -08:00
|
|
|
if test "x${enable_module}" = "xstatic" ; then
|
2009-06-19 23:42:32 -07:00
|
|
|
static_module="yes"
|
2010-01-26 07:30:40 -08:00
|
|
|
have_static_module="yes"
|
|
|
|
AC_DEFINE(EINA_STATIC_BUILD_[]UP, 1, [Set to 1 if $2 is statically built])
|
2009-06-19 23:42:32 -07:00
|
|
|
fi
|
2010-02-11 23:32:11 -08:00
|
|
|
|
|
|
|
if ! test "x${enable_module}" = "xno" ; then
|
2010-02-11 13:21:22 -08:00
|
|
|
AC_DEFINE(EINA_BUILD_[]UP, 1, [Set to 1 if $2 is built])
|
|
|
|
fi
|
2009-06-19 23:42:32 -07:00
|
|
|
|
2010-01-26 07:30:40 -08:00
|
|
|
AM_CONDITIONAL(EINA_BUILD_[]UP, [test "x${have_module}" = "xyes"])
|
2009-06-19 23:42:32 -07:00
|
|
|
AM_CONDITIONAL(EINA_STATIC_BUILD_[]UP, [test "x${static_module}" = "xyes"])
|
|
|
|
|
2010-01-26 07:30:40 -08:00
|
|
|
enable_[]DOWN=${enable_module}
|
2009-06-19 23:42:32 -07:00
|
|
|
|
|
|
|
m4_popdef([UP])
|
|
|
|
m4_popdef([DOWN])
|
|
|
|
])
|