Merge lp:~mohyt/drizzle/trunk-bug-1116980 into lp:drizzle

Proposed by Mohit Srivastava
Status: Merged
Approved by: Brian Aker
Approved revision: 2620
Merged at revision: 2622
Proposed branch: lp:~mohyt/drizzle/trunk-bug-1116980
Merge into: lp:drizzle
Diff against target: 112 lines (+89/-4)
3 files modified
m4/pandora_have_libevent.m4 (+79/-0)
plugin/json_server/plugin.ac (+8/-2)
plugin/json_server/plugin.ini (+2/-2)
To merge this branch: bzr merge lp:~mohyt/drizzle/trunk-bug-1116980
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
Drizzle Trunk Pending
Review via email: mp+146797@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stewart Smith (stewart) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'm4/pandora_have_libevent.m4'
2--- m4/pandora_have_libevent.m4 1970-01-01 00:00:00 +0000
3+++ m4/pandora_have_libevent.m4 2013-02-06 08:17:22 +0000
4@@ -0,0 +1,79 @@
5+dnl Copyright (C) 2009 Sun Microsystems, Inc.
6+dnl This file is free software; Sun Microsystems, Inc.
7+dnl gives unlimited permission to copy and/or distribute it,
8+dnl with or without modifications, as long as this notice is preserved.
9+
10+#--------------------------------------------------------------------
11+# Check for libevent
12+#--------------------------------------------------------------------
13+
14+
15+AC_DEFUN([_PANDORA_SEARCH_LIBEVENT],[
16+ AC_REQUIRE([AC_LIB_PREFIX])
17+
18+ AC_LIB_HAVE_LINKFLAGS(event,,
19+ [
20+ #include <sys/types.h>
21+ #include <sys/time.h>
22+ #include <stdlib.h>
23+ #include <event.h>
24+ ],[
25+ struct bufferevent bev;
26+ bufferevent_settimeout(&bev, 1, 1);
27+ event_init();
28+ event_loop(EVLOOP_ONCE);
29+ ])
30+
31+ AM_CONDITIONAL(HAVE_LIBEVENT, [test "x${ac_cv_libevent}" = "xyes"])
32+
33+ AS_IF([test "x${ac_cv_libevent}" = "xyes"],[
34+ save_LIBS="${LIBS}"
35+ LIBS="${LIBS} ${LTLIBEVENT}"
36+ AC_CHECK_FUNCS(event_base_new)
37+ AC_CHECK_FUNCS(event_base_free)
38+ AC_CHECK_FUNCS(event_base_get_method)
39+ LIBS="$save_LIBS"
40+ ])
41+])
42+
43+AC_DEFUN([_PANDORA_HAVE_LIBEVENT],[
44+
45+ AC_ARG_ENABLE([libevent],
46+ [AS_HELP_STRING([--disable-libevent],
47+ [Build with libevent support @<:@default=on@:>@])],
48+ [ac_enable_libevent="$enableval"],
49+ [ac_enable_libevent="yes"])
50+
51+ _PANDORA_SEARCH_LIBEVENT
52+])
53+
54+
55+AC_DEFUN([PANDORA_HAVE_LIBEVENT],[
56+ AC_REQUIRE([_PANDORA_HAVE_LIBEVENT])
57+])
58+
59+AC_DEFUN([_PANDORA_REQUIRE_LIBEVENT],[
60+ ac_enable_libevent="yes"
61+ _PANDORA_SEARCH_LIBEVENT
62+
63+ AS_IF([test x$ac_cv_libevent = xno],[
64+ PANDORA_MSG_ERROR([libevent is required for ${PACKAGE}. On Debian this can be found in libevent-dev. On RedHat this can be found in libevent-devel.])
65+ ])
66+])
67+
68+AC_DEFUN([PANDORA_REQUIRE_LIBEVENT],[
69+ AC_REQUIRE([_PANDORA_REQUIRE_LIBEVENT])
70+])
71+
72+AC_DEFUN([PANDORA_LIBEVENT_RECENT],[
73+ dnl FIXME I really wanted to check for existence of EVHTTP_REQ_DELETE,
74+ dnl but autoconf gods were not favorable to me, so the below is all I got
75+ AC_CACHE_CHECK([if libevent is recent enough],
76+ [pandora_cv_libevent_recent],
77+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
78+#include <event2/event.h>
79+#include <event2/http.h>
80+ ]])],
81+ [pandora_cv_libevent_recent=yes],
82+ [pandora_cv_libevent_recent=no])])
83+])
84\ No newline at end of file
85
86=== modified file 'plugin/json_server/plugin.ac'
87--- plugin/json_server/plugin.ac 2012-10-19 03:12:41 +0000
88+++ plugin/json_server/plugin.ac 2013-02-06 08:17:22 +0000
89@@ -1,3 +1,9 @@
90-AX_LIBEVENT2
91-AS_IF([test "$ax_cv_libevent2" = "no"],
92+PANDORA_HAVE_LIBEVENT
93+
94+AS_IF([test "x$ac_cv_libevent" = "xno"],
95+ AC_MSG_WARN([libevent not found: not building json_server.]))
96+
97+PANDORA_LIBEVENT_RECENT
98+
99+AS_IF([test "$pandora_cv_libevent_recent" = "no"],
100 AC_MSG_WARN([Your version of libevent is too old. json_server requires v 2.0 or newer: not building json_server.]))
101
102=== modified file 'plugin/json_server/plugin.ini'
103--- plugin/json_server/plugin.ini 2012-10-19 03:12:41 +0000
104+++ plugin/json_server/plugin.ini 2013-02-06 08:17:22 +0000
105@@ -29,5 +29,5 @@
106 json/json_reader.cpp
107 json/json_value.cpp
108 json/json_writer.cpp
109-build_conditional="x${ax_cv_libevent2}" = "xyes" -a "x${ac_cv_libcurl}" = "xyes"
110-ldflags=${LIBEVENT2_LDFLAGS}
111+build_conditional="x${ac_cv_libevent}" = "xyes" -a "x$pandora_cv_libevent_recent" = "xyes" -a "x${ac_cv_libcurl}" = "xyes"
112+ldflags=${LTLIBEVENT}

Subscribers

People subscribed via source and target branches