This is an automated email from the ASF dual-hosted git repository.

tillt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 3dcdb32cf90702047b96abff38545c6f29ae2049
Author: Till Toenshoff <[email protected]>
AuthorDate: Thu Oct 4 15:41:12 2018 +0200

    Updated libevent linkage to adhere to best practices.
    
    libevent is a combination of libevent_core and libevent_extra. Mesos
    and libprocess do not make use of any libevent_extra functionality.
    
    Additionally, linking against libevent is against best practices.
    
    Replaces use of libevent with libevent_core in libevent.m4,
    FindLIBEVENT.cmake as well as the native Python egg linkage.
    
    Review: https://reviews.apache.org/r/68913/
---
 3rdparty/cmake/FindLIBEVENT.cmake          |  2 +-
 m4/libevent.m4                             |  4 ++--
 src/python/native_common/ext_modules.py.in | 10 ++++------
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/3rdparty/cmake/FindLIBEVENT.cmake 
b/3rdparty/cmake/FindLIBEVENT.cmake
index d6a1e65..5741ef0 100644
--- a/3rdparty/cmake/FindLIBEVENT.cmake
+++ b/3rdparty/cmake/FindLIBEVENT.cmake
@@ -42,7 +42,7 @@ else()
   set(POSSIBLE_LIBEVENT_LIB_DIRS ${LIBEVENT_ROOT_DIR}/lib)
 endif()
 
-set(LIBEVENT_LIBRARY_NAMES event event_pthreads)
+set(LIBEVENT_LIBRARY_NAMES event_core event_pthreads)
 
 if (ENABLE_SSL)
   list(APPEND LIBEVENT_LIBRARY_NAMES event_openssl)
diff --git a/m4/libevent.m4 b/m4/libevent.m4
index cd52b3f..35242a1 100644
--- a/m4/libevent.m4
+++ b/m4/libevent.m4
@@ -33,10 +33,10 @@ libevent version 2+ headers are required for libprocess to 
build.
 -------------------------------------------------------------------
   ])])
 
-  AC_CHECK_LIB([event], [event_base_new], [], [
+  AC_CHECK_LIB([event_core], [event_base_new], [], [
     AC_MSG_ERROR([cannot find libevent
 -------------------------------------------------------------------
-libevent version 2+ is required for libprocess to build.
+libevent_core version 2+ is required for libprocess to build.
 -------------------------------------------------------------------
   ])])
 
diff --git a/src/python/native_common/ext_modules.py.in 
b/src/python/native_common/ext_modules.py.in
index df10b5c..1f2e6c1 100644
--- a/src/python/native_common/ext_modules.py.in
+++ b/src/python/native_common/ext_modules.py.in
@@ -118,18 +118,16 @@ def _create_module(module_name):
         libevent_dir = os.path.join('3rdparty', 'libevent-2.0.22-stable')
         libevent_dir = os.path.join(abs_top_builddir, libevent_dir, '.libs')
 
-        libevent = os.path.join(libevent_dir, 'libevent.a')
+        libevent_core = os.path.join(libevent_dir, 'libevent_core.a')
 
         # Check if a bundled version of libevent was built.
-        if os.path.exists(libevent):
-            EXTRA_OBJECTS.append(libevent)
-            EXTRA_OBJECTS.append(os.path.join(libevent_dir, 
'libevent_extra.a'))
+        if os.path.exists(libevent_core):
+            EXTRA_OBJECTS.append(libevent_core)
             EXTRA_OBJECTS.append(os.path.join(libevent_dir, 
'libevent_pthreads.a'))
             if '@ENABLE_SSL_TRUE@' == '':
                 EXTRA_OBJECTS.append(os.path.join(libevent_dir, 
'libevent_openssl.a'))
         else:
-            EXTRA_OBJECTS.append('-levent')
-            EXTRA_OBJECTS.append('-levent_extra')
+            EXTRA_OBJECTS.append('-levent_core')
             EXTRA_OBJECTS.append('-levent_pthreads')
             if '@ENABLE_SSL_TRUE@' == '':
                 EXTRA_OBJECTS.append(-levent_openssl)

Reply via email to