diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/eina/m4/eina_check.m4 | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/libraries/eina/m4/eina_check.m4 b/libraries/eina/m4/eina_check.m4 new file mode 100644 index 0000000..f8a4f8c --- /dev/null +++ b/libraries/eina/m4/eina_check.m4 | |||
@@ -0,0 +1,48 @@ | |||
1 | dnl use: EINA_CHECK_MODULE(foo-bar, have_dependency, description) | ||
2 | AC_DEFUN([EINA_CHECK_MODULE], | ||
3 | [ | ||
4 | m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl | ||
5 | m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl | ||
6 | |||
7 | AC_ARG_ENABLE([mempool-$1], | ||
8 | [AC_HELP_STRING([--enable-mempool-$1], [enable build of $3 @<:@default=$2@:>@])], | ||
9 | [ | ||
10 | if test "x${enableval}" = "xyes" ; then | ||
11 | enable_module="yes" | ||
12 | else | ||
13 | if test "x${enableval}" = "xstatic" ; then | ||
14 | enable_module="static" | ||
15 | else | ||
16 | enable_module="no" | ||
17 | fi | ||
18 | fi | ||
19 | ], | ||
20 | [enable_module=$2]) | ||
21 | |||
22 | have_module="no" | ||
23 | if test "x${enable_module}" = "xyes" || test "x${enable_module}" = "xstatic" ; then | ||
24 | have_module="yes" | ||
25 | fi | ||
26 | |||
27 | AC_MSG_CHECKING([whether to enable $3 built]) | ||
28 | AC_MSG_RESULT([${have_module}]) | ||
29 | |||
30 | static_module="no" | ||
31 | if test "x${enable_module}" = "xstatic" ; then | ||
32 | static_module="yes" | ||
33 | have_static_module="yes" | ||
34 | AC_DEFINE(EINA_STATIC_BUILD_[]UP, 1, [Set to 1 if $2 is statically built]) | ||
35 | fi | ||
36 | |||
37 | if ! test "x${enable_module}" = "xno" ; then | ||
38 | AC_DEFINE(EINA_BUILD_[]UP, 1, [Set to 1 if $2 is built]) | ||
39 | fi | ||
40 | |||
41 | AM_CONDITIONAL(EINA_BUILD_[]UP, [test "x${have_module}" = "xyes"]) | ||
42 | AM_CONDITIONAL(EINA_STATIC_BUILD_[]UP, [test "x${static_module}" = "xyes"]) | ||
43 | |||
44 | enable_[]DOWN=${enable_module} | ||
45 | |||
46 | m4_popdef([UP]) | ||
47 | m4_popdef([DOWN]) | ||
48 | ]) | ||