diff options
Diffstat (limited to 'libraries/eina/m4/eina_bench.m4')
-rw-r--r-- | libraries/eina/m4/eina_bench.m4 | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libraries/eina/m4/eina_bench.m4 b/libraries/eina/m4/eina_bench.m4 new file mode 100644 index 0000000..e586eff --- /dev/null +++ b/libraries/eina/m4/eina_bench.m4 | |||
@@ -0,0 +1,31 @@ | |||
1 | dnl use: EINA_BENCH_MODULE(foo-bar, have_bench, pkg_file [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) | ||
2 | AC_DEFUN([EINA_BENCH_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 | want_module="$2" | ||
8 | have_module="no" | ||
9 | |||
10 | AC_ARG_ENABLE([$1], | ||
11 | [AC_HELP_STRING([--disable-benchmark-$1], [disable benchmarking against ]DOWN[ @<:@default=yes@:>@])], | ||
12 | [ | ||
13 | if test "x${enableval}" = "xyes" ; then | ||
14 | enable_module="yes" | ||
15 | else | ||
16 | enable_module="no" | ||
17 | fi | ||
18 | ], | ||
19 | [enable_module="yes"]) | ||
20 | |||
21 | if test "x${enable_module}" = "xyes" && test "x${want_module}" = "xyes"; then | ||
22 | PKG_CHECK_MODULES([]UP[], [$3], [have_module="yes"], [have_module="no"]) | ||
23 | fi | ||
24 | |||
25 | AM_CONDITIONAL([EINA_HAVE_]UP[], [test "x${have_module}" = "xyes"]) | ||
26 | |||
27 | AS_IF([test "x$have_module" = "xyes"], [$4], [$5]) | ||
28 | |||
29 | m4_popdef([UP]) | ||
30 | m4_popdef([DOWN]) | ||
31 | ]) | ||