From 8bcf51ba402f64e848bb9175f88f81a2fd753c49 Mon Sep 17 00:00:00 2001 From: caro Date: Wed, 21 Apr 2010 19:51:16 +0000 Subject: [PATCH] use a macro for edje external support git-svn-id: http://svn.enlightenment.org/svn/e/trunk/emotion@48211 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- configure.ac | 25 ++----------------------- m4/efl_edje_external.m4 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 23 deletions(-) create mode 100644 m4/efl_edje_external.m4 diff --git a/configure.ac b/configure.ac index 934a20e..66c1f8e 100644 --- a/configure.ac +++ b/configure.ac @@ -108,28 +108,7 @@ PKG_CHECK_EXISTS([evas-opengl-x11], [AC_DEFINE(HAVE_EVAS_OPENGL_X11, 1, [Evas Op PKG_CHECK_EXISTS([evas-fb], [AC_DEFINE(HAVE_EVAS_FB, 1, [Evas Framebuffer Engine Support])]) -enable_edje_external="yes" -want_edje_external="auto" -AC_MSG_CHECKING([if should provide Edje EXTERNAL support...]) -AC_ARG_ENABLE([edje-external], - [AC_HELP_STRING([--disable-edje-external], [disable providing Edje EXTERNAL support. @<:@default=detect@:>@])], - [want_edje_external=$enableval], []) -AC_MSG_RESULT([${enable_edje_external}]) -if test "x$want_edje_external" != "xno"; then - PKG_CHECK_MODULES([EDJE_EXTERNAL], - [edje], - [enable_edje_external="yes"], - [enable_edje_external="no"] - ) -else - enable_edje_external="no" -fi -if test "x$want_edje_external" = "xyes" -a "x$enable_edje_external" = "xno"; then - AC_MSG_ERROR([Edje EXTERNAL support requested, but Edje not found by pkg-config.]) -fi -AM_CONDITIONAL(ENABLE_EDJE_EXTERNAL, test "x$enable_edje_external" = "xyes") -AC_SUBST(EDJE_EXTERNAL_CFLAGS) -AC_SUBST(EDJE_EXTERNAL_LIBS) +EFL_EDJE_EXTERNAL([have_edje_external="yes"], [have_edje_external="no"]) ### Checks for header files @@ -225,7 +204,7 @@ echo echo " Build emotion_test...: $have_emotion_test" echo " edje_cc..............: ${edje_cc}" echo -echo " Edje EXTERNAL support: ${enable_edje_external}" +echo " Edje EXTERNAL support: ${have_edje_external}" echo echo "Compilation............: make (or gmake)" echo " CPPFLAGS.............: $CPPFLAGS" diff --git a/m4/efl_edje_external.m4 b/m4/efl_edje_external.m4 new file mode 100644 index 0000000..fb48996 --- /dev/null +++ b/m4/efl_edje_external.m4 @@ -0,0 +1,48 @@ +dnl Copyright (C) 2010 Vincent Torri +dnl That code is public domain and can be freely used or copied. + +dnl Macro that check if edje external should be enabled or not + +dnl Usage: EFL_EDJE_EXTERNAL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Call AC_SUBST(EDJE_EXTERNAL_CFLAGS) +dnl Call AC_SUBST(EDJE_EXTERNAL_LIBS) +dnl Define conditional ENABLE_EDJE_EXTERNAL + +AC_DEFUN([EFL_EDJE_EXTERNAL], +[ + +AC_ARG_ENABLE([edje-external], + [AC_HELP_STRING([--disable-edje-external], + [disable providing Edje EXTERNAL support. @<:@default=enabled@:>@])], + [ + if test "x${enableval}" = "xyes" ; then + _efl_want_edje_external="yes" + else + _efl_want_edje_external="no" + fi + ], + [_efl_want_edje_external="auto"]) + +AC_MSG_CHECKING([if should provide Edje EXTERNAL support...]) +AC_MSG_RESULT([${_efl_want_edje_external}]) + +_efl_enable_edje_external="no" +if ! test "x${_efl_want_edje_external}" = "xno" ; then + PKG_CHECK_MODULES([EDJE_EXTERNAL], + [edje], + [_efl_enable_edje_external="yes"], + [_efl_enable_edje_external="no"]) +else + AC_SUBST(EDJE_EXTERNAL_CFLAGS) + AC_SUBST(EDJE_EXTERNAL_LIBS) +fi + +if test "x${_efl_want_edje_external}" = "xyes" && test "x${_efl_enable_edje_external}" = "xno" ; then + AC_MSG_ERROR([Edje EXTERNAL support requested, but Edje not found by pkg-config.]) +fi + +AM_CONDITIONAL([ENABLE_EDJE_EXTERNAL], [test "x${_efl_enable_edje_external}" = "xyes"]) + +AS_IF([test "x${_efl_enable_edje_external}" = "xyes"], [$1], [$2]) + +]) -- 2.7.4