diff options
Diffstat (limited to 'm4/apr_memcache.m4')
-rw-r--r-- | m4/apr_memcache.m4 | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/m4/apr_memcache.m4 b/m4/apr_memcache.m4 new file mode 100644 index 0000000..71ab2b6 --- /dev/null +++ b/m4/apr_memcache.m4 | |||
@@ -0,0 +1,56 @@ | |||
1 | dnl Check for memcache client libraries | ||
2 | dnl CHECK_APR_MEMCACHE(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) | ||
3 | dnl Sets: | ||
4 | dnl APR_MEMCACHE_LIBS | ||
5 | AC_DEFUN([CHECK_APR_MEMCACHE], | ||
6 | [dnl | ||
7 | |||
8 | AC_ARG_WITH( | ||
9 | apr-memcache-prefix, | ||
10 | [AC_HELP_STRING([--with-apr-memcache-prefix=PATH],[Install prefix for apr_memcache])], | ||
11 | apr_memcache_prefix="$withval", | ||
12 | apr_memcache_prefix="/usr", | ||
13 | :) | ||
14 | AC_ARG_WITH( | ||
15 | apr-memcache-libs, | ||
16 | [AC_HELP_STRING([--with-apr-memcache-libs=PATH],[Path to apr_memcache libs])], | ||
17 | apr_memcache_libs="$withval", | ||
18 | apr_memcache_libs="$apr_memcache_prefix/lib" | ||
19 | :) | ||
20 | AC_ARG_WITH( | ||
21 | apr-memcache-includes, | ||
22 | [AC_HELP_STRING([--with-apr-memcache-includes=PATH],[Path to apr_memcache includes])], | ||
23 | apr_memcache_includes="$withval", | ||
24 | apr_memcache_includes="$apr_memcache_prefix/include/apr_memcache-0" | ||
25 | :) | ||
26 | |||
27 | |||
28 | AC_LIBTOOL_SYS_DYNAMIC_LINKER | ||
29 | |||
30 | dnl # Determine memcache lib directory | ||
31 | save_CFLAGS=$CFLAGS | ||
32 | save_LDFLAGS=$LDFLAGS | ||
33 | CFLAGS="-I$apr_memcache_includes $APR_INCLUDES $CFLAGS" | ||
34 | LDFLAGS="-L$apr_memcache_libs $LDFLAGS" | ||
35 | AC_CHECK_LIB( | ||
36 | apr_memcache, | ||
37 | apr_memcache_create, | ||
38 | [ | ||
39 | APR_MEMCACHE_LIBS="-R$apr_memcache_libs -L$apr_memcache_libs -lapr_memcache" | ||
40 | APR_MEMCACHE_CFLAGS="-I$apr_memcache_includes" | ||
41 | ] | ||
42 | ) | ||
43 | CFLAGS=$save_CFLAGS | ||
44 | LDFLAGS=$save_LDFLAGS | ||
45 | |||
46 | AC_SUBST(APR_MEMCACHE_LIBS) | ||
47 | AC_SUBST(APR_MEMCACHE_CFLAGS) | ||
48 | |||
49 | if test -z "${APR_MEMCACHE_LIBS}"; then | ||
50 | AC_MSG_NOTICE([*** memcache library not found.]) | ||
51 | ifelse([$2], , AC_MSG_ERROR([memcache library is required]), $2) | ||
52 | else | ||
53 | AC_MSG_NOTICE([using '${APR_MEMCACHE_LIBS}' for memcache]) | ||
54 | ifelse([$1], , , $1) | ||
55 | fi | ||
56 | ]) | ||