~drizzle-trunk/drizzle/jenkins-Drizzle-Builder-112

« back to all changes in this revision

Viewing changes to m4/ax_libevent.m4

  • Committer: Continuous Integration
  • Date: 2012-12-12 09:57:37 UTC
  • mfrom: (2604.1.6 drizzle-7.2)
  • Revision ID: ci@drizzle.org-20121212095737-t4ckonxdslly0fd6
Merge lp:~brianaker/drizzle/boost-update Build: jenkins-Drizzle-Builder-112

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#
4
4
# SYNOPSIS
5
5
#
6
 
#   AX_LIBEVENT(), AX_LIBEVENT2()
 
6
#   AX_LIBEVENT(), AX_LIBEVENT2(), AX_LIBEVENT2_EVHTTP()
7
7
#
8
8
# DESCRIPTION
9
9
#
20
20
 
21
21
#serial 2
22
22
 
23
 
  AC_DEFUN([AX_LIBEVENT],[
24
 
      AC_CACHE_CHECK([test for a working libevent], [ax_cv_libevent], [
25
 
        AX_SAVE_FLAGS
26
 
        LIBS="-levent $LIBS"
27
 
        AC_LANG_PUSH([C])
28
 
        AC_RUN_IFELSE([
29
 
          AC_LANG_PROGRAM([
 
23
AC_DEFUN([AX_LIBEVENT],
 
24
    [AC_PREREQ([2.63])dnl
 
25
    AC_CACHE_CHECK([test for a working libevent], [ax_cv_libevent], [
 
26
      AX_SAVE_FLAGS
 
27
      LIBS="-levent $LIBS"
 
28
      AC_LANG_PUSH([C])
 
29
      AC_RUN_IFELSE([
 
30
        AC_LANG_PROGRAM([
30
31
#include <sys/types.h>
31
32
#include <sys/time.h>
32
33
#include <stdlib.h>
33
34
#include <event.h>
34
 
            ], [
35
 
            struct event_base *tmp_event= event_init();
36
 
            event_base_free(tmp_event);
37
 
            ])],
38
 
          [ax_cv_libevent=yes],
39
 
          [ax_cv_libevent=no],
40
 
          [AC_MSG_WARN([test program execution failed])])
41
 
        AC_LANG_POP
42
 
        AX_RESTORE_FLAGS
43
 
        ])
 
35
          ], [
 
36
          struct event_base *tmp_event= event_init();
 
37
          event_base_free(tmp_event);
 
38
          ])],
 
39
        [ax_cv_libevent=yes],
 
40
        [ax_cv_libevent=no],
 
41
        [AC_MSG_WARN([test program execution failed])])
 
42
      AC_LANG_POP
 
43
      AX_RESTORE_FLAGS
 
44
      ])
44
45
 
45
 
      AS_IF([test "x$ax_cv_libevent" = "xyes"],[
 
46
    AS_IF([test "x$ax_cv_libevent" = "xyes"],[
46
47
        LIBEVENT_LDFLAGS="-levent"
47
48
        AC_SUBST(LIBEVENT_LDFLAGS)
48
49
        AC_DEFINE([HAVE_LIBEVENT],[1],[Define if event_init is present in event.h.])],[
49
50
        AC_DEFINE([HAVE_LIBEVENT],[0],[Define if event_init is present in event.h.])
50
51
        ])
51
52
 
52
 
      AM_CONDITIONAL(HAVE_LIBEVENT, test "x$ax_cv_libevent" = "xyes")
53
 
      ])
 
53
    AM_CONDITIONAL(HAVE_LIBEVENT, test "x$ax_cv_libevent" = "xyes")
 
54
    ])
54
55
 
55
56
  AC_DEFUN([AX_LIBEVENT2],[
56
57
      AC_REQUIRE([AX_LIBEVENT])
64
65
#include <sys/time.h>
65
66
#include <stdlib.h>
66
67
#include <event2/event.h>
67
 
#include <event2/http.h>
68
 
            ], [
 
68
            ],[
69
69
            struct event_base *tmp_event= event_init();
70
70
            event_base_free(tmp_event);
71
71
            ])],
86
86
      AM_CONDITIONAL(HAVE_LIBEVENT2, test "x$ax_cv_libevent2" = "xyes")
87
87
      ])
88
88
 
 
89
  AC_DEFUN([AX_LIBEVENT2_EVHTTP],[
 
90
      AC_REQUIRE([AX_LIBEVENT2])
 
91
      AC_CACHE_CHECK([test for a working libevent2 evhttp interface], [ax_cv_libevent2_evhttp], [
 
92
        AX_SAVE_FLAGS
 
93
        LIBS="-levent $LIBS"
 
94
        AC_LANG_PUSH([C])
 
95
        AC_RUN_IFELSE([
 
96
          AC_LANG_PROGRAM([
 
97
#include <sys/types.h>
 
98
#include <sys/time.h>
 
99
#include <stdlib.h>
 
100
#include <event2/event.h>
 
101
#include <event2/http.h>
 
102
            ],[
 
103
            struct event_base *libbase= event_base_new();  
 
104
            struct evhttp *libsrvr= evhttp_new(libbase);
 
105
            ])],
 
106
          [ax_cv_libevent2_evhttp=yes],
 
107
          [ax_cv_libevent2_evhttp=no],
 
108
          [AC_MSG_WARN([test program execution failed])])
 
109
        AC_LANG_POP
 
110
        AX_RESTORE_FLAGS
 
111
        ])
 
112
 
 
113
      AS_IF([test "x$ax_cv_libevent2_evhttp" = "xyes"],[
 
114
        LIBEVENT2_LDFLAGS="-levent"
 
115
        AC_SUBST(LIBEVENT2_LDFLAGS)
 
116
        AC_DEFINE([HAVE_LIBEVENT2],[1],[Define if event_init is present in event2/event.h.])],[
 
117
        AC_DEFINE([HAVE_LIBEVENT2],[0],[Define if event_init is present in event2/event.h.])
 
118
        ])
 
119
 
 
120
      AM_CONDITIONAL(HAVE_LIBEVENT2_EVHTTP, test "x$ax_cv_libevent2_evhttp" = "xyes")
 
121
      ])