summaryrefslogtreecommitdiff
path: root/m4/efl_enable.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/efl_enable.m4')
-rw-r--r--m4/efl_enable.m434
1 files changed, 34 insertions, 0 deletions
diff --git a/m4/efl_enable.m4 b/m4/efl_enable.m4
new file mode 100644
index 0000000000..78f6e0ab93
--- /dev/null
+++ b/m4/efl_enable.m4
@@ -0,0 +1,34 @@
1dnl Copyright (C) 2012 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that allows an EFL to not be built
5
6dnl Usage: EFL_ENABLE_LIB(lib, want)
7dnl Call AC_SUBST(BINARY_PRG) (BINARY is the uppercase of binary, - being transformed into _)
8dnl Define have_lib (- is transformed into _)
9dnl Define conditional EFL_BUILD_LIB (LIB is the uppercase of lib, - being transformed into _)
10
11AC_DEFUN([EFL_ENABLE_LIB],
12[
13
14m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
15m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
16
17dnl configure option
18
19AC_ARG_ENABLE([build-$1],
20 [AC_HELP_STRING([--disable-build-$1], [disable building of ]DOWN)],
21 [
22 if test "x${enableval}" = "xyes" ; then
23 efl_want_build_[]m4_defn([DOWN])="yes"
24 else
25 efl_want_build_[]m4_defn([DOWN])="no"
26 fi
27 ],
28 [efl_want_build_[]m4_defn([DOWN])=$2])
29
30AC_MSG_CHECKING([whether to build ]DOWN[ binary])
31AC_MSG_RESULT([${efl_want_build_[]m4_defn([DOWN])}])
32
33AM_CONDITIONAL(EFL_BUILD_[]UP, test "x${efl_want_build_[]m4_defn([DOWN])}" = "xyes")
34])