Source
9
9
# found, and sets @LIBEVENT_LDFLAGS@ and @LIBEVENT_CFLAGS@ to the necessary
10
10
# values.
11
11
#
12
12
# This macro is distributed in the hope that it will be useful,
13
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
15
16
16
AC_DEFUN([LIBEVENT_TRY_LINK],
17
17
[
18
18
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
19
-
#include <stdlib.h>
20
-
#include <event.h>
19
+
#include <event2/event.h>
21
20
#include <event2/thread.h>
22
21
]], [[
22
+
struct event_base *evb;
23
+
24
+
evb = event_base_new();
25
+
23
26
evthread_use_pthreads();
24
-
event_init();
27
+
event_base_free(evb);
25
28
]])],[found_libevent="yes"],[])
26
29
])dnl
27
30
28
31
AC_DEFUN([LIBEVENT_CHECK_CONFIG],
29
32
[
30
33
AC_ARG_WITH([libevent],[
31
34
If you want to specify libevent installation directories:
32
35
AS_HELP_STRING([--with-libevent@<:@=DIR@:>@], [use libevent from given base install directory (DIR), default is to search through a number of common places for the libevent files.])],
33
36
[
34
37
if test "x$withval" = "xyes"; then
35
-
if test -f /usr/local/include/event.h; then withval=/usr/local; else withval=/usr; fi
38
+
if test -f /usr/local/include/event2/event.h; then withval=/usr/local; else withval=/usr; fi
36
39
fi
37
40
38
41
LIBEVENT_CFLAGS="-I$withval/include"
39
42
LIBEVENT_LDFLAGS="-L$withval/lib"
40
43
_libevent_dir_set="yes"
41
44
]
42
45
)
43
46
44
47
AC_ARG_WITH([libevent-include],
45
48
AS_HELP_STRING([--with-libevent-include@<:@=DIR@:>@],
56
59
[use libevent libraries from given path.]
57
60
),
58
61
[
59
62
LIBEVENT_LDFLAGS="-L$withval"
60
63
_libevent_dir_set="yes"
61
64
]
62
65
)
63
66
64
67
AC_MSG_CHECKING(for libevent support)
65
68
66
-
if test "x$ARCH" = "xopenbsd"; then
67
-
LIBEVENT_LIBS="-levent_core -levent_pthreads"
68
-
else
69
-
LIBEVENT_LIBS="-levent -levent_pthreads"
70
-
fi
69
+
LIBEVENT_LIBS="-levent_core -levent_extra -levent_pthreads"
71
70
72
-
if test -n "$_libevent_dir_set" -o -f /usr/include/event.h; then
71
+
if test -n "$_libevent_dir_set" -o -f /usr/include/event2/event.h; then
73
72
found_libevent="yes"
74
-
elif test -f /usr/local/include/event.h; then
73
+
elif test -f /usr/local/include/event2/event.h; then
75
74
LIBEVENT_CFLAGS="-I/usr/local/include"
76
75
LIBEVENT_LDFLAGS="-L/usr/local/lib"
77
76
found_libevent="yes"
78
77
else
79
78
found_libevent="no"
80
79
AC_MSG_RESULT(no)
81
80
fi
82
81
83
82
if test "x$found_libevent" = "xyes"; then
84
83
am_save_CFLAGS="$CFLAGS"