[Maria-developers] [Branch ~maria-captains/maria/5.1] Rev 2809: Support building with system libevent
------------------------------------------------------------
revno: 2809
committer: Sergei Golubchik
noreply@launchpad.net writes:
------------------------------------------------------------ revno: 2809 committer: Sergei Golubchik
branch nick: maria-5.1 timestamp: Fri 2010-01-29 21:35:56 +0100 message: Support building with system libevent modified: config/ac-macros/libevent.m4
Thanks! Unfortunately, I was a bit too optimistic about using system libevent. It turns out that the thread scheduler code needs libevent 1.4, but lots of our build systems have only libevent 1.3 in their distros. So we get build failures like this when libevent-dev 1.3 is installed: scheduler.cc: In function ‘bool init_socketpair(int*)’: scheduler.cc:146: error: ‘evutil_socketpair’ was not declared in this scope scheduler.cc:147: error: ‘evutil_make_socket_nonblocking’ was not declared in this scope scheduler.cc: In function ‘void close_socketpair(int*)’: scheduler.cc:154: error: ‘EVUTIL_CLOSESOCKET’ was not declared in this scope scheduler.cc:156: error: ‘EVUTIL_CLOSESOCKET’ was not declared in this scope I guess the solution is to check for system libevent version also, and if too old treat it the same way as not present. Seems we can check for the presense of the evutil_socketpair() function, which was added in libevent 1.4. Then I also need to decide what to do for packages when system libevent is too old. I checked, and Debian 4+5 and Ubuntu up to 9.04 have only libevent 1.3. Ubuntu >= 9.10 has libevent 1.4. I think the best is to use bundled libevent on those older distros. We will then still suffer from https://bugs.launchpad.net/maria/+bug/509521 on those, but hopefully most people using plugins which require libevent will build mariadb themselves and/or use a newer distro. Alternatively, we can disable pool-of-threads on those older distros. (A different alternative would be to see if we can modify the pool-of-threads code to work with libevent 1.3. Not too keen to spend time on this though.) Opinions? - Kristian.
Kristian Nielsen
I guess the solution is to check for system libevent version also, and if too old treat it the same way as not present. Seems we can check for the presense of the evutil_socketpair() function, which was added in libevent 1.4.
Looks like something like this works: === modified file 'config/ac-macros/libevent.m4' --- config/ac-macros/libevent.m4 2010-01-29 20:35:56 +0000 +++ config/ac-macros/libevent.m4 2010-01-30 11:53:39 +0000 @@ -54,7 +54,7 @@ AC_DEFUN([MYSQL_CHECK_LIBEVENT], [ "" | "yes") libevent_includes="" libevent_libs="-levent" - AC_CHECK_LIB(event, event_get_version,[with_libevent=system], + AC_CHECK_LIB(event, evutil_socketpair,[with_libevent=system], [with_libevent=bundled]) AC_CHECK_HEADER(event.h,,[with_libevent=bundled]) if test "$with_libevent" = "bundled"; then Any objections? - Kristian.
participants (2)
-
Kristian Nielsen
-
noreply@launchpad.net