~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/pandora_have_libmemcached.m4

  • Committer: Brian Aker
  • Date: 2009-10-07 16:55:53 UTC
  • mfrom: (1161.2.1 bug444827)
  • Revision ID: brian@gaz-20091007165553-9tnp7liw1k9g6gvc
Merge Padraig

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl  Copyright (C) 2009 Sun Microsystems, Inc.
2
 
dnl This file is free software; Sun Microsystems, Inc.
 
1
dnl  Copyright (C) 2009 Sun Microsystems
 
2
dnl This file is free software; Sun Microsystems
3
3
dnl gives unlimited permission to copy and/or distribute it,
4
4
dnl with or without modifications, as long as this notice is preserved.
5
5
 
27
27
  ],[
28
28
    ac_cv_libmemcached="no"
29
29
  ])
30
 
 
31
 
  AS_IF([test "x$ac_enable_libmemcached" = "xyes"],[
32
 
    AC_LIB_HAVE_LINKFLAGS(memcachedprotocol,,[
33
 
      #include <libmemcached/protocol_handler.h>
34
 
    ],[
35
 
      struct memcached_protocol_st *protocol_handle;
36
 
      protocol_handle= memcached_protocol_create_instance();
37
 
    ])
38
 
  ],[
39
 
    ac_cv_libmemcachedprotocol="no"
40
 
  ])
41
 
  
42
 
  AC_CACHE_CHECK([if libmemcached has memcached_server_fn],
43
 
    [pandora_cv_libmemcached_server_fn],
44
 
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
45
 
#include <libmemcached/memcached.h>
46
 
memcached_server_fn callbacks[1];
47
 
    ]])],
48
 
    [pandora_cv_libmemcached_server_fn=yes],
49
 
    [pandora_cv_libmemcached_server_fn=no])])
50
 
 
51
 
  AS_IF([test "x$pandora_cv_libmemcached_server_fn" = "xyes"],[
52
 
    AC_DEFINE([HAVE_MEMCACHED_SERVER_FN],[1],[If we have the new memcached_server_fn typedef])
53
 
  ])
54
 
])
55
 
 
56
 
AC_DEFUN([_PANDORA_RECENT_LIBMEMCACHED],[
57
 
 
58
 
  AC_CACHE_CHECK([if libmemcached is recent enough],
59
 
    [pandora_cv_recent_libmemcached],[
60
 
    AS_IF([test "x${ac_cv_libmemcached}" = "xno"],[
61
 
      pandora_cv_recent_libmemcached=no
62
 
    ],[
63
 
      AS_IF([test "x$1" != "x"],[
64
 
        pandora_need_libmemcached_version=`echo "$1" | perl -nle '/(\d+)\.(\d+)/; printf "%d%0.3d000", $[]1, $[]2 ;'`
65
 
        AS_IF([test "x${pandora_need_libmemcached_version}" = "x0000000"],[
66
 
          pandora_cv_recent_libmemcached=yes
67
 
        ],[
68
 
          AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
69
 
#include <libmemcached/configure.h>
70
 
 
71
 
#if !defined(LIBMEMCACHED_VERSION_HEX) || LIBMEMCACHED_VERSION_HEX < 0x]]${pandora_need_libmemcached_version}[[
72
 
# error libmemcached too old!
73
 
#endif
74
 
            ]],[[]])
75
 
          ],[
76
 
            pandora_cv_recent_libmemcached=yes
77
 
          ],[
78
 
            pandora_cv_recent_libmemcached=no
79
 
          ])
80
 
        ])
81
 
      ],[
82
 
        pandora_cv_recent_libmemcached=yes
83
 
      ])
84
 
    ])
85
 
  ])
86
 
 
87
 
  AM_CONDITIONAL(HAVE_LIBMEMCACHED,[test "x${ac_cv_libmemcached}" = "xyes" -a "x${pandora_cv_recent_libmemcached}" = "xyes"])
88
 
  
 
30
  
 
31
  AM_CONDITIONAL(HAVE_LIBMEMCACHED, [test "x${ac_cv_libmemcached}" = "xyes"])
 
32
  
 
33
  AS_IF([test "x${ac_cv_libmemcached}" = "xyes"], [ PANDORA_WITH_MEMCACHED ])
89
34
])
90
35
 
91
36
AC_DEFUN([PANDORA_HAVE_LIBMEMCACHED],[
92
37
  AC_REQUIRE([_PANDORA_SEARCH_LIBMEMCACHED])
93
 
  _PANDORA_RECENT_LIBMEMCACHED($1)
94
38
])
95
39
 
96
40
AC_DEFUN([PANDORA_REQUIRE_LIBMEMCACHED],[
97
 
  PANDORA_HAVE_LIBMEMCACHED($1)
98
 
  AS_IF([test "x{$pandora_cv_recent_libmemcached}" = "xno"],
 
41
  AC_REQUIRE([PANDORA_HAVE_LIBMEMCACHED])
 
42
  AS_IF([test x$ac_cv_libmemcached = xno],
99
43
      AC_MSG_ERROR([libmemcached is required for ${PACKAGE}]))
100
44
])
101
 
 
102
 
AC_DEFUN([PANDORA_REQUIRE_LIBMEMCACHEDPROTOCOL],[
103
 
  PANDORA_HAVE_LIBMEMCACHED($1)
104
 
  AS_IF([test x$ac_cv_libmemcachedprotocol = xno],
105
 
      AC_MSG_ERROR([libmemcachedprotocol is required for ${PACKAGE}]))
106
 
])