summaryrefslogtreecommitdiff
path: root/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
parentc60c72b60f77f386d0a11cc37da7c5075e270352 (diff)
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')
-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
40 40
41m4_popdef([DOWN]) 41m4_popdef([DOWN])
42]) 42])
43
44dnl EFL_LIB_START(PKG)
45dnl start the setup of an EFL library, defines variables and prints a notice
46AC_DEFUN([EFL_LIB_START],
47[
48m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
49
50requirements_libs_[]m4_defn([DOWN])=""
51requirements_pc_[]m4_defn([DOWN])=""
52requirements_pc_deps_[]m4_defn([DOWN])=""
53
54AC_SUBST([requirements_libs_]m4_defn([DOWN]))
55AC_SUBST([requirements_pc_]m4_defn([DOWN]))
56
57AC_MSG_NOTICE([Start $1 checks])
58
59m4_popdef([DOWN])
60])
61
62dnl EFL_LIB_END(PKG)
63dnl finishes the setup of an EFL library
64AC_DEFUN([EFL_LIB_END],
65[
66AC_MSG_NOTICE([Finished $1 checks])
67])
68
69dnl EFL_LIB_START_OPTIONAL(PKG, TEST)
70dnl test if library should be build and then EFL_LIB_START()
71dnl must call EFL_LIB_END_OPTIONAL() to close it.
72AC_DEFUN([EFL_LIB_START_OPTIONAL],
73[
74m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
75m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
76
77if $2; then
78 efl_lib_optional_[]m4_defn([DOWN])="yes"
79else
80 efl_lib_optional_[]m4_defn([DOWN])="no"
81 AC_MSG_NOTICE([Skipping $1 checks (disabled)])
82fi
83
84if test "$efl_lib_optional_[]m4_defn([DOWN])" = "yes"; then
85 EFL_LIB_START([$1])
86 AC_DEFINE([HAVE_]m4_defn([UP]), [1], [optional EFL $1 is enabled])
87
88dnl closed at EFL_LIB_END_OPTIONAL()
89
90m4_popdef([UP])
91m4_popdef([DOWN])
92])
93
94dnl EFL_LIB_END_OPTIONAL(PKG)
95dnl closes block started by EFL_LIB_START_OPTIONAL() and then
96dnl defines AM_CONDITIONAL([HAVE_PKG]) and AC_DEFINE([HAVE_PKG])
97AC_DEFUN([EFL_LIB_END_OPTIONAL],
98[
99m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
100m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
101
102dnl close if started at EFL_LIB_START_OPTIONAL()
103 EFL_LIB_END([$1])
104fi
105
106AM_CONDITIONAL([HAVE_]m4_defn([UP]), [test "$efl_lib_optional_[]m4_defn([DOWN])" = "yes"])
107
108m4_popdef([UP])
109m4_popdef([DOWN])
110])