diff options
author | Nikos Mavrogiannopoulos | 2008-02-20 19:53:44 +0000 |
---|---|---|
committer | Nokis Mavrogiannopoulos | 2008-02-20 19:53:44 +0000 |
commit | abce2980c929dbb6ccb9d45c7cd88df3106c6ee4 (patch) | |
tree | b71cda083d1ed8ceb2db2fb815eadf042295c348 /m4/libmemcache.m4 | |
parent | 572096be0da2690e3e32ad8fd19ae5758c870874 (diff) |
added new m4 directory
Diffstat (limited to 'm4/libmemcache.m4')
-rw-r--r-- | m4/libmemcache.m4 | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/m4/libmemcache.m4 b/m4/libmemcache.m4 new file mode 100644 index 0000000..95e630b --- /dev/null +++ b/m4/libmemcache.m4 | |||
@@ -0,0 +1,46 @@ | |||
1 | dnl Check for memcache client libraries | ||
2 | dnl CHECK_MEMCACHE(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) | ||
3 | AC_DEFUN([CHECK_MEMCACHE], | ||
4 | [dnl | ||
5 | |||
6 | AC_ARG_WITH( | ||
7 | memcache, | ||
8 | [AC_HELP_STRING([--with-memcache=PATH],[Path memcache libraries])], | ||
9 | mc_path="$withval", | ||
10 | :) | ||
11 | |||
12 | dnl # Determine memcache lib directory | ||
13 | if test -z $mc_path; then | ||
14 | test_paths="/usr/lib /usr/local/lib" | ||
15 | else | ||
16 | test_paths="${mc_path}/lib" | ||
17 | fi | ||
18 | |||
19 | for x in $test_paths ; do | ||
20 | AC_MSG_CHECKING([for memcache library in ${x}]) | ||
21 | if test -f ${x}/libmemcache.so.1.0; then | ||
22 | AC_MSG_RESULT([yes]) | ||
23 | save_CFLAGS=$CFLAGS | ||
24 | save_LDFLAGS=$LDFLAGS | ||
25 | CFLAGS="$CFLAGS" | ||
26 | LDFLAGS="-L$x $LDFLAGS" | ||
27 | AC_CHECK_LIB(memcache, mc_server_add, | ||
28 | LIBMEMCACHE_LIBS="-L$x -lmemcache") | ||
29 | CFLAGS=$save_CFLAGS | ||
30 | LDFLAGS=$save_LDFLAGS | ||
31 | break | ||
32 | else | ||
33 | AC_MSG_RESULT([no]) | ||
34 | fi | ||
35 | done | ||
36 | |||
37 | AC_SUBST(LIBMEMCACHE_LIBS) | ||
38 | |||
39 | if test -z "${LIBMEMCACHE_LIBS}"; then | ||
40 | AC_MSG_NOTICE([*** memcache library not found.]) | ||
41 | ifelse([$2], , AC_MSG_ERROR([memcache library is required]), $2) | ||
42 | else | ||
43 | AC_MSG_NOTICE([using '${LIBMEMCACHE_LIBS}' for memcache]) | ||
44 | ifelse([$1], , , $1) | ||
45 | fi | ||
46 | ]) | ||