add ECORE_EVAS_CHECK_MODULE m4 macro to check availability of an ecore evas module

SVN revision: 35136
This commit is contained in:
doursse 2008-07-17 05:40:08 +00:00 committed by doursse
parent 913d17fcff
commit 0b77c43fb8
1 changed files with 41 additions and 1 deletions

View File

@ -43,7 +43,7 @@ else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(BUILD_ECORE_[]UP, test $have_ecore_[]DOWN = yes)
AM_CONDITIONAL(BUILD_ECORE_[]UP, test "x$have_ecore_[]DOWN" = "xyes")
if test "x$have_ecore_[]DOWN" = "xyes" ; then
ifelse([$4], , :, [$4])
@ -57,3 +57,43 @@ AC_SUBST(ecore_[]DOWN[]_libs)
popdef([UP])
popdef([DOWN])
])
dnl use: ECORE_EVAS_CHECK_MODULE(foo-bar, want, description, backend[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
AC_DEFUN([ECORE_EVAS_CHECK_MODULE],
[
pushdef([UP], translit([$1], [-a-z], [_A-Z]))dnl
pushdef([DOWN], translit([$1], [-A-Z], [_a-z]))dnl
have_ecore_evas_[]DOWN="no"
want_module="$2"
AC_ARG_ENABLE(ecore-$1,
AC_HELP_STRING(
[--enable-ecore-evas-$1],
[enable $3 support in the ecore_evas module.]
),
[ want_module=$enableval ]
)
AC_MSG_CHECKING(whether ecore_evas $3 support is to be built)
AC_MSG_RESULT($want_module)
if test "x$4" = "xyes" -a \
"x$have_ecore_evas" = "xyes" -a \
"x$want_module" = "xyes" ; then
PKG_CHECK_MODULES(EVAS_[]UP, evas-$1,
[
AC_DEFINE(BUILD_ECORE_EVAS_[]UP, 1, [Support for $3 Engine in Ecore_Evas])
have_ecore_evas_[]DOWN="yes";
]
)
fi
if test "x$have_ecore_evas_[]DOWN" = "xyes" ; then
ifelse([$5], , :, [$5])
else
ifelse([$6], , :, [$6])
fi
popdef([UP])
popdef([DOWN])
])