aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/eina/m4/eina_bench.m4
blob: e586eff6bf47465143a52355fcc21d6eea69220d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
dnl use: EINA_BENCH_MODULE(foo-bar, have_bench, pkg_file [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
AC_DEFUN([EINA_BENCH_MODULE],
[
m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl

want_module="$2"
have_module="no"

AC_ARG_ENABLE([$1],
   [AC_HELP_STRING([--disable-benchmark-$1], [disable benchmarking against ]DOWN[ @<:@default=yes@:>@])],
   [
    if test "x${enableval}" = "xyes" ; then
       enable_module="yes"
    else
       enable_module="no"
    fi
   ],
   [enable_module="yes"])

if test "x${enable_module}" = "xyes" && test "x${want_module}" = "xyes"; then
   PKG_CHECK_MODULES([]UP[], [$3], [have_module="yes"], [have_module="no"])
fi

AM_CONDITIONAL([EINA_HAVE_]UP[], [test "x${have_module}" = "xyes"])

AS_IF([test "x$have_module" = "xyes"], [$4], [$5])

m4_popdef([UP])
m4_popdef([DOWN])
])