Lines 14-26
Link Here
|
14 |
|
14 |
|
15 |
libevent_libs="\$(top_builddir)/extra/libevent/libevent.a" |
15 |
libevent_libs="\$(top_builddir)/extra/libevent/libevent.a" |
16 |
libevent_includes="-I\$(top_srcdir)/extra/libevent" |
16 |
libevent_includes="-I\$(top_srcdir)/extra/libevent" |
17 |
libevent_test_option="--mysqld=--thread-handling=pool-of-threads" |
|
|
18 |
AC_SUBST(libevent_libs) |
19 |
AC_SUBST(libevent_includes) |
20 |
AC_SUBST(libevent_test_option) |
21 |
|
22 |
AC_DEFINE([HAVE_LIBEVENT], [1], [If we want to use libevent and have connection pooling]) |
23 |
AC_MSG_RESULT([using bundled libevent]) |
24 |
|
17 |
|
25 |
dnl Get the upstream file with the original libevent configure macros. |
18 |
dnl Get the upstream file with the original libevent configure macros. |
26 |
dnl Use builtin include for this, to work around path problems in old versions of aclocal. |
19 |
dnl Use builtin include for this, to work around path problems in old versions of aclocal. |
Lines 39-55
Link Here
|
39 |
|
32 |
|
40 |
AC_CONFIG_FILES(extra/libevent/Makefile) |
33 |
AC_CONFIG_FILES(extra/libevent/Makefile) |
41 |
|
34 |
|
42 |
AC_MSG_CHECKING(for libevent) |
35 |
AC_MSG_NOTICE([checking what libevent library to use]) |
|
|
36 |
|
43 |
AC_ARG_WITH([libevent], |
37 |
AC_ARG_WITH([libevent], |
44 |
[ --with-libevent use libevent and have connection pooling], |
38 |
AC_HELP_STRING([--with-libevent=yes|no|bundled|DIR], |
45 |
[with_libevent=$withval], |
39 |
[Use libevent and have connection pooling. |
46 |
[with_libevent=no] |
40 |
A location of libevent library can be specified. |
47 |
) |
41 |
Given DIR, libevent library is |
48 |
|
42 |
assumed to be in $DIR/lib and header files |
49 |
if test "$with_libevent" != "no"; then |
43 |
in $DIR/include.]), |
50 |
MYSQL_USE_BUNDLED_LIBEVENT |
44 |
[with_libevent=${withval}], |
51 |
else |
45 |
[with_libevent=no]) |
52 |
AC_MSG_RESULT([disabled]) |
46 |
|
|
|
47 |
case "$with_libevent" in |
48 |
"no") |
49 |
with_libevent=disabled |
50 |
;; |
51 |
"bundled") |
52 |
MYSQL_USE_BUNDLED_LIBEVENT |
53 |
;; |
54 |
"" | "yes") |
55 |
libevent_includes="" |
56 |
libevent_libs="-levent" |
57 |
AC_CHECK_LIB(event, evutil_socketpair,[with_libevent=system], |
58 |
[with_libevent=bundled]) |
59 |
AC_CHECK_HEADER(evutil.h,,[with_libevent=bundled]) |
60 |
if test "$with_libevent" = "bundled"; then |
61 |
MYSQL_USE_BUNDLED_LIBEVENT |
62 |
fi |
63 |
;; |
64 |
*) |
65 |
# Test for libevent using all known library file endings |
66 |
if test \( -f "$with_libevent/lib/libevent.a" -o \ |
67 |
-f "$with_libevent/lib/libevent.so" -o \ |
68 |
-f "$with_libevent/lib/libevent.sl" -o \ |
69 |
-f "$with_libevent/lib/libevent.dylib" \) \ |
70 |
-a -f "$with_libevent/include/evutil.h"; then |
71 |
libevent_includes="-I$with_libevent/include" |
72 |
libevent_libs="-L$with_libevent/lib -levent" |
73 |
AC_CHECK_LIB(event, evutil_socketpair,[with_libevent=$with_libevent], |
74 |
[with_libevent=no], [$libevent_libs]) |
75 |
else |
76 |
with_libevent=no |
77 |
fi |
78 |
if test "$with_libevent" = "no"; then |
79 |
AC_MSG_ERROR([libevent headers or binaries were not found]) |
80 |
fi |
81 |
;; |
82 |
esac |
83 |
AC_MSG_CHECKING(for libevent) |
84 |
AC_MSG_RESULT([$with_libevent]) |
85 |
|
86 |
if test "$with_libevent" != "disabled"; then |
87 |
libevent_test_option="--mysqld=--thread-handling=pool-of-threads" |
88 |
AC_SUBST(libevent_libs) |
89 |
AC_SUBST(libevent_includes) |
90 |
AC_SUBST(libevent_test_option) |
91 |
AC_DEFINE([HAVE_LIBEVENT], [1], [If we want to use libevent and have connection pooling]) |
53 |
fi |
92 |
fi |
54 |
AM_CONDITIONAL([HAVE_LIBEVENT], [ test "$with_libevent" != "no" ]) |
93 |
AM_CONDITIONAL([HAVE_LIBEVENT], [ test "$with_libevent" != "disabled" ]) |
55 |
]) |
94 |
]) |
|
|
95 |
|