~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/pandora_have_libmemcached.m4

  • Committer: Siddharth Prakash Singh
  • Date: 2010-03-26 19:25:23 UTC
  • mfrom: (1410 drizzle)
  • mto: This revision was merged to the branch mainline in revision 1425.
  • Revision ID: spsneo@spsneo-laptop-20100326192523-ibjlbt1p692vobtj
merging with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
      memcached_dump_func *df;
25
25
      memcached_lib_version();
26
26
    ])
 
27
  ],[
 
28
    ac_cv_libmemcached="no"
 
29
  ])
 
30
 
 
31
  AS_IF([test "x$ac_enable_libmemcached" = "xyes"],[
27
32
    AC_LIB_HAVE_LINKFLAGS(memcachedprotocol,,[
28
33
      #include <libmemcached/protocol_handler.h>
29
34
    ],[
31
36
      protocol_handle= memcached_protocol_create_instance();
32
37
    ])
33
38
  ],[
34
 
    ac_cv_libmemcached="no"
35
39
    ac_cv_libmemcachedprotocol="no"
36
40
  ])
37
41
  
43
47
    ]])],
44
48
    [pandora_cv_libmemcached_server_fn=yes],
45
49
    [pandora_cv_libmemcached_server_fn=no])])
 
50
 
46
51
  AS_IF([test "x$pandora_cv_libmemcached_server_fn" = "xyes"],[
47
52
    AC_DEFINE([HAVE_MEMCACHED_SERVER_FN],[1],[If we have the new memcached_server_fn typedef])
48
53
  ])
49
 
 
50
 
  AS_IF([test "x$1" != "x"],[
51
 
    AC_CACHE_CHECK([if libmemcached is recent enough],
52
 
      [pandora_cv_recent_libmemcached],[
53
 
      pandora_need_libmemcached_version=`echo "$1" | perl -nle '/(\d+)\.(\d+)/; printf "%d%0.3d000", $[]1, $[]2 ;'`
54
 
      AS_IF([test "x${pandora_need_libmemcached_version}" = "x0000000"],[
55
 
        pandora_cv_recent_libmemcached=yes
56
 
      ],[
57
 
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
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([[
58
69
#include <libmemcached/configure.h>
59
70
 
60
71
#if !defined(LIBMEMCACHED_VERSION_HEX) || LIBMEMCACHED_VERSION_HEX < 0x]]${pandora_need_libmemcached_version}[[
61
72
# error libmemcached too old!
62
73
#endif
63
 
          ]],[[]])
64
 
        ],[
65
 
          pandora_cv_recent_libmemcached=yes
66
 
        ],[
67
 
          pandora_cv_recent_libmemcached=no
 
74
            ]],[[]])
 
75
          ],[
 
76
            pandora_cv_recent_libmemcached=yes
 
77
          ],[
 
78
            pandora_cv_recent_libmemcached=no
 
79
          ])
68
80
        ])
 
81
      ],[
 
82
        pandora_cv_recent_libmemcached=yes
69
83
      ])
70
84
    ])
71
 
    AS_IF([test "x${pandora_cv_recent_libmemcached}" = "xno"],[
72
 
      ac_cv_libmemcached=no
73
 
      ac_cv_libmemcachedprotocol=no
74
 
    ])
75
85
  ])
76
 
      
77
86
 
78
 
  AM_CONDITIONAL(HAVE_LIBMEMCACHED, [test "x${ac_cv_libmemcached}" = "xyes"])
 
87
  AM_CONDITIONAL(HAVE_LIBMEMCACHED,[test "x${ac_cv_libmemcached}" = "xyes" -a "x${pandora_cv_recent_libmemcached}" = "xyes"])
79
88
  
80
89
])
81
90
 
82
91
AC_DEFUN([PANDORA_HAVE_LIBMEMCACHED],[
83
 
  _PANDORA_SEARCH_LIBMEMCACHED($1)
 
92
  AC_REQUIRE([_PANDORA_SEARCH_LIBMEMCACHED])
 
93
  _PANDORA_RECENT_LIBMEMCACHED($1)
84
94
])
85
95
 
86
96
AC_DEFUN([PANDORA_REQUIRE_LIBMEMCACHED],[
87
97
  PANDORA_HAVE_LIBMEMCACHED($1)
88
 
  AS_IF([test x$ac_cv_libmemcached = xno],
 
98
  AS_IF([test "x{$pandora_cv_recent_libmemcached}" = "xno"],
89
99
      AC_MSG_ERROR([libmemcached is required for ${PACKAGE}]))
90
100
])
91
101