aboutsummaryrefslogtreecommitdiffstats
path: root/m4/libmemcache.m4
diff options
context:
space:
mode:
authorGravatar Nikos Mavrogiannopoulos 2008-02-20 19:53:44 +0000
committerGravatar Nokis Mavrogiannopoulos 2008-02-20 19:53:44 +0000
commitabce2980c929dbb6ccb9d45c7cd88df3106c6ee4 (patch)
treeb71cda083d1ed8ceb2db2fb815eadf042295c348 /m4/libmemcache.m4
parent572096be0da2690e3e32ad8fd19ae5758c870874 (diff)
added new m4 directory
Diffstat (limited to 'm4/libmemcache.m4')
-rw-r--r--m4/libmemcache.m446
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 @@
1dnl Check for memcache client libraries
2dnl CHECK_MEMCACHE(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
3AC_DEFUN([CHECK_MEMCACHE],
4[dnl
5
6AC_ARG_WITH(
7 memcache,
8 [AC_HELP_STRING([--with-memcache=PATH],[Path memcache libraries])],
9 mc_path="$withval",
10 :)
11
12dnl # Determine memcache lib directory
13if test -z $mc_path; then
14 test_paths="/usr/lib /usr/local/lib"
15else
16 test_paths="${mc_path}/lib"
17fi
18
19for 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
35done
36
37AC_SUBST(LIBMEMCACHE_LIBS)
38
39if test -z "${LIBMEMCACHE_LIBS}"; then
40 AC_MSG_NOTICE([*** memcache library not found.])
41 ifelse([$2], , AC_MSG_ERROR([memcache library is required]), $2)
42else
43 AC_MSG_NOTICE([using '${LIBMEMCACHE_LIBS}' for memcache])
44 ifelse([$1], , , $1)
45fi
46])