source: mod_gnutls/m4/apr_memcache.m4 @ a63301f

debian/masterdebian/stretch-backportsjessie-backportsupstream
Last change on this file since a63301f was 70509f8, checked in by Thomas Klute <thomas2.klute@…>, 5 years ago

configure: Try apr-util if apr_memcache library was not found

Fedora doesn't provide libapr_memcache, but apr-util contains the
necessary functions as well. With this commit ./configure checks for
apr_memcache first, and then for apr-util if it was not found.

This commit is inspired by a patch added to the Fedora package of
mod_gnutls by Jiri Kastner <jkastner@…> in version 0.5.10-1.
The original patch just replaces apr_memcache with apr-util.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1dnl Check for memcache client libraries
2dnl CHECK_APR_MEMCACHE(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
3dnl Sets:
4dnl  APR_MEMCACHE_LIBS
5AC_DEFUN([CHECK_APR_MEMCACHE],
6[dnl
7
8AC_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    :)
13AC_ARG_WITH(
14    apr-memcache-libs,
15    [AC_HELP_STRING([--with-apr-memcache-libs=PATH],[Path to apr_memcache libs])],
16    apr_memcache_libs="$withval",
17    :)
18AC_ARG_WITH(
19    apr-memcache-includes,
20    [AC_HELP_STRING([--with-apr-memcache-includes=PATH],[Path to apr_memcache includes])],
21    apr_memcache_includes="$withval",
22    :)
23
24
25AC_LIBTOOL_SYS_DYNAMIC_LINKER
26
27dnl # Determine memcache lib directory
28save_CFLAGS=$CFLAGS
29save_LDFLAGS=$LDFLAGS
30
31if test -n "$apr_memcache_libs"; then
32    apr_memcache_libdir=$apr_memcache_libs
33elif test -n "$apr_memcache_prefix"; then
34    apr_memcache_libdir=$apr_memcache_prefix/lib
35fi
36if test -n "$apr_memcache_libdir"; then
37    LDFLAGS="-L$apr_memcache_libdir $LDFLAGS"
38fi
39
40if test -n "$apr_memcache_includes"; then
41    apr_memcache_includedir=$apr_memcache_includes
42elif test -n "$apr_memcache_prefix"; then
43    apr_memcache_includedir=$apr_memcache_prefix/include/apr_memcache-0
44else
45    apr_memcache_includedir=$includedir/apr_memcache-0
46fi
47
48CFLAGS="-I$apr_memcache_includedir $CFLAGS"
49
50
51AC_CHECK_LIB(
52    apr_memcache,
53    apr_memcache_create,
54    [
55        APR_MEMCACHE_LIBS="-lapr_memcache"
56        if test -n "$apr_memcache_libdir"; then
57            APR_MEMCACHE_LIBS="-R$apr_memcache_libdir -L$apr_memcache_libdir $APR_MEMCACHE_LIBS"
58        fi
59        APR_MEMCACHE_CFLAGS="-I$apr_memcache_includedir"
60    ]
61)
62
63
64dnl # if the apr_memcache was not found, try apr-util
65if test -z "${APR_MEMCACHE_LIBS}"; then
66    if test -n "$apr_memcache_includes"; then
67        apr_memcache_includedir=$apr_memcache_includes
68    elif test -n "$apr_memcache_prefix"; then
69        apr_memcache_includedir=$apr_memcache_prefix/include/aprutil-1
70    else
71        apr_memcache_includedir=$includedir/aprutil-1
72    fi
73    AC_CHECK_LIB(
74        aprutil-1,
75        apr_memcache_create,
76        [
77            APR_MEMCACHE_LIBS="`apu-1-config --link-ld`"
78            APR_MEMCACHE_CFLAGS="`apu-1-config --includes`"
79        ]
80    )
81fi
82
83
84CFLAGS=$save_CFLAGS
85LDFLAGS=$save_LDFLAGS
86
87AC_SUBST(APR_MEMCACHE_LIBS)
88AC_SUBST(APR_MEMCACHE_CFLAGS)
89
90if test -z "${APR_MEMCACHE_LIBS}"; then
91  AC_MSG_NOTICE([*** memcache library not found.])
92  ifelse([$2], , AC_MSG_ERROR([memcache library is required]), $2)
93else
94  AC_MSG_NOTICE([using '${APR_MEMCACHE_LIBS}' for memcache])
95  ifelse([$1], , , $1)
96fi
97])
Note: See TracBrowser for help on using the repository browser.