summaryrefslogtreecommitdiff
path: root/m4/efl.m4
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-12-30 15:21:33 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-12-30 15:21:33 +0000
commitfb27484376f64ab229020c70cf21ca4fc56be092 (patch)
tree8daf9206dcede184e8da53c681103cca3d07fef4 /m4/efl.m4
parentc60c72b60f77f386d0a11cc37da7c5075e270352 (diff)
downloadefl-fb27484376f64ab229020c70cf21ca4fc56be092.tar.gz
efl/configure: simplify lib declaration.
added couple of macros: - EFL_LIB_START(PKG): setup variables and replacements (AC_SUBST), prints started checks - EFL_LIB_END(PKG): prints ended checks - EFL_LIB_START_OPTIONAL(PKG, TEST): wraps EFL_LIB_START() with a conditional test. defines AC_DEFINE(HAVE_PKG). - EFL_LIB_END_OPTIONAL(PKG): wraps EFL_LIB_END() with a conditional test, defines AM_CONDITIONAL(HAVE_PKG). SVN revision: 81903
Diffstat (limited to 'm4/efl.m4')
-rw-r--r--m4/efl.m468
1 files changed, 68 insertions, 0 deletions
diff --git a/m4/efl.m4 b/m4/efl.m4
index d4a4d1ad62..2397e22ce3 100644
--- a/m4/efl.m4
+++ b/m4/efl.m4
@@ -40,3 +40,71 @@ m4_pushdef([DOWN], m4_translit([$3], [-A-Z], [_a-z]))dnl
m4_popdef([DOWN])
])
+
+dnl EFL_LIB_START(PKG)
+dnl start the setup of an EFL library, defines variables and prints a notice
+AC_DEFUN([EFL_LIB_START],
+[
+m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
+
+requirements_libs_[]m4_defn([DOWN])=""
+requirements_pc_[]m4_defn([DOWN])=""
+requirements_pc_deps_[]m4_defn([DOWN])=""
+
+AC_SUBST([requirements_libs_]m4_defn([DOWN]))
+AC_SUBST([requirements_pc_]m4_defn([DOWN]))
+
+AC_MSG_NOTICE([Start $1 checks])
+
+m4_popdef([DOWN])
+])
+
+dnl EFL_LIB_END(PKG)
+dnl finishes the setup of an EFL library
+AC_DEFUN([EFL_LIB_END],
+[
+AC_MSG_NOTICE([Finished $1 checks])
+])
+
+dnl EFL_LIB_START_OPTIONAL(PKG, TEST)
+dnl test if library should be build and then EFL_LIB_START()
+dnl must call EFL_LIB_END_OPTIONAL() to close it.
+AC_DEFUN([EFL_LIB_START_OPTIONAL],
+[
+m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
+m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
+
+if $2; then
+ efl_lib_optional_[]m4_defn([DOWN])="yes"
+else
+ efl_lib_optional_[]m4_defn([DOWN])="no"
+ AC_MSG_NOTICE([Skipping $1 checks (disabled)])
+fi
+
+if test "$efl_lib_optional_[]m4_defn([DOWN])" = "yes"; then
+ EFL_LIB_START([$1])
+ AC_DEFINE([HAVE_]m4_defn([UP]), [1], [optional EFL $1 is enabled])
+
+dnl closed at EFL_LIB_END_OPTIONAL()
+
+m4_popdef([UP])
+m4_popdef([DOWN])
+])
+
+dnl EFL_LIB_END_OPTIONAL(PKG)
+dnl closes block started by EFL_LIB_START_OPTIONAL() and then
+dnl defines AM_CONDITIONAL([HAVE_PKG]) and AC_DEFINE([HAVE_PKG])
+AC_DEFUN([EFL_LIB_END_OPTIONAL],
+[
+m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
+m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
+
+dnl close if started at EFL_LIB_START_OPTIONAL()
+ EFL_LIB_END([$1])
+fi
+
+AM_CONDITIONAL([HAVE_]m4_defn([UP]), [test "$efl_lib_optional_[]m4_defn([DOWN])" = "yes"])
+
+m4_popdef([UP])
+m4_popdef([DOWN])
+])