Skip to content

Commit 037ed08

Browse files
author
Tor Didriksen
committed
Bug#29041505 BACKPORT TO 5.7: BUNDLED LIBEVENT IS OUTDATED
This is a backport from 8.0, updated libevent to 2.1.8 Change-Id: Id42e713576e92696a9f226bb20df302d13d9ea47
1 parent d18ea48 commit 037ed08

File tree

204 files changed

+60392
-25987
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+60392
-25987
lines changed

client/base/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -15,6 +15,8 @@
1515

1616
ADD_DEFINITIONS(${SSL_DEFINES})
1717

18+
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake)
19+
1820
ADD_CONVENIENCE_LIBRARY(client_base
1921
i_option.cc
2022
bool_option.cc

client/dump/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# along with this program; if not, write to the Free Software
1414
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1515

16+
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake)
17+
1618
INCLUDE_DIRECTORIES(
1719
${CMAKE_SOURCE_DIR}/dump
1820
)

cmake/libevent.cmake

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -14,16 +14,14 @@
1414
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1515

1616
MACRO (MYSQL_USE_BUNDLED_LIBEVENT)
17-
SET(LIBEVENT_LIBRARY event)
18-
SET(LIBEVENT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/libevent)
17+
SET(WITH_LIBEVENT "bundled" CACHE STRING "Use bundled libevent library")
18+
SET(LIBEVENT_LIBRARIES event)
19+
SET(LIBEVENT_INCLUDE_DIRS
20+
"${CMAKE_SOURCE_DIR}/extra/libevent/include"
21+
"${CMAKE_BINARY_DIR}/extra/libevent/include")
1922
SET(LIBEVENT_FOUND TRUE)
20-
ADD_DEFINITIONS("-DHAVE_LIBEVENT1")
21-
SET(WITH_LIBEVENT "bundled" CACHE STRING "Use bundled libevent")
22-
ADD_SUBDIRECTORY(libevent)
23-
GET_TARGET_PROPERTY(src libevent SOURCES)
24-
FOREACH(file ${src})
25-
SET(LIBEVENT_SOURCES ${LIBEVENT_SOURCES} ${CMAKE_SOURCE_DIR}/libevent/${file})
26-
ENDFOREACH()
23+
ADD_DEFINITIONS("-DHAVE_LIBEVENT2")
24+
ADD_SUBDIRECTORY(extra/libevent)
2725
ENDMACRO()
2826

2927
# MYSQL_CHECK_LIBEVENT
@@ -33,7 +31,7 @@ ENDMACRO()
3331
# If this is set,we use bindled libevent
3432
# If this is not set,search for system libevent.
3533
# if system libevent is not found, use bundled copy
36-
# LIBEVENT_LIBRARIES, LIBEVENT_INCLUDE_DIR and LIBEVENT_SOURCES
34+
# LIBEVENT_LIBRARIES, LIBEVENT_INCLUDE_DIRS
3735
# are set after this macro has run
3836

3937
MACRO (MYSQL_CHECK_LIBEVENT)
@@ -48,43 +46,43 @@ MACRO (MYSQL_CHECK_LIBEVENT)
4846
SET(LIBEVENT_FIND_QUIETLY TRUE)
4947

5048
IF (NOT LIBEVENT_INCLUDE_PATH)
51-
set(LIBEVENT_INCLUDE_PATH /usr/local/include /opt/local/include)
49+
SET(LIBEVENT_INCLUDE_PATH /usr/local/include /opt/local/include)
5250
ENDIF()
5351

54-
find_path(LIBEVENT_INCLUDE_DIR event.h PATHS ${LIBEVENT_INCLUDE_PATH})
52+
FIND_PATH(LIBEVENT_INCLUDE_DIR event.h PATHS ${LIBEVENT_INCLUDE_PATH})
5553

56-
if (NOT LIBEVENT_INCLUDE_DIR)
54+
IF (NOT LIBEVENT_INCLUDE_DIR)
5755
MESSAGE(SEND_ERROR "Cannot find appropriate event.h in /usr/local/include or /opt/local/include. Use bundled libevent")
58-
endif()
56+
ENDIF()
5957

6058
IF (NOT LIBEVENT_LIB_PATHS)
61-
set(LIBEVENT_LIB_PATHS /usr/local/lib /opt/local/lib)
59+
SET(LIBEVENT_LIB_PATHS /usr/local/lib /opt/local/lib)
6260
ENDIF()
6361

6462
## libevent.so is historical, use libevent_core.so if found.
65-
find_library(LIBEVENT_CORE event_core PATHS ${LIBEVENT_LIB_PATHS})
66-
find_library(LIBEVENT_LIB event PATHS ${LIBEVENT_LIB_PATHS})
63+
FIND_LIBRARY(LIBEVENT_CORE event_core PATHS ${LIBEVENT_LIB_PATHS})
64+
FIND_LIBRARY(LIBEVENT_EXTRA event_extra PATHS ${LIBEVENT_LIB_PATHS})
65+
FIND_LIBRARY(LIBEVENT_LIB event PATHS ${LIBEVENT_LIB_PATHS})
6766

68-
if (NOT LIBEVENT_LIB AND NOT LIBEVENT_CORE)
67+
IF (NOT LIBEVENT_LIB AND NOT LIBEVENT_CORE)
6968
MESSAGE(SEND_ERROR "Cannot find appropriate event lib in /usr/local/lib or /opt/local/lib. Use bundled libevent")
70-
endif()
69+
ENDIF()
7170

7271
IF ((LIBEVENT_LIB OR LIBEVENT_CORE) AND LIBEVENT_INCLUDE_DIR)
73-
set(LIBEVENT_FOUND TRUE)
72+
SET(LIBEVENT_FOUND TRUE)
7473
IF (LIBEVENT_CORE)
75-
set(LIBEVENT_LIBS ${LIBEVENT_CORE})
74+
SET(LIBEVENT_LIBS ${LIBEVENT_CORE} ${LIBEVENT_EXTRA})
7675
ELSE()
77-
set(LIBEVENT_LIBS ${LIBEVENT_LIB})
76+
SET(LIBEVENT_LIBS ${LIBEVENT_LIB})
7877
ENDIF()
7978
ELSE()
80-
set(LIBEVENT_FOUND FALSE)
79+
SET(LIBEVENT_FOUND FALSE)
8180
ENDIF()
8281

8382
IF(LIBEVENT_FOUND)
84-
SET(LIBEVENT_SOURCES "")
8583
SET(LIBEVENT_LIBRARIES ${LIBEVENT_LIBS})
8684
SET(LIBEVENT_INCLUDE_DIRS ${LIBEVENT_INCLUDE_DIR})
87-
find_path(LIBEVENT2_INCLUDE_DIR event2 HINTS ${LIBEVENT_INCLUDE_PATH}/event)
85+
FIND_PATH(LIBEVENT2_INCLUDE_DIR event2 HINTS ${LIBEVENT_INCLUDE_PATH}/event)
8886
IF (LIBEVENT2_INCLUDE_DIR)
8987
ADD_DEFINITIONS("-DHAVE_LIBEVENT2")
9088
ELSE()
@@ -98,4 +96,6 @@ MACRO (MYSQL_CHECK_LIBEVENT)
9896
ENDIF()
9997

10098
ENDIF()
99+
MESSAGE(STATUS "LIBEVENT_INCLUDE_DIRS ${LIBEVENT_INCLUDE_DIRS}")
100+
MESSAGE(STATUS "LIBEVENT_LIBRARIES ${LIBEVENT_LIBRARIES}")
101101
ENDMACRO()

extra/libevent/.clang-format

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: LLVM
4+
5+
AccessModifierOffset: -4
6+
7+
AlignAfterOpenBracket: DontAlign
8+
AlignEscapedNewlinesLeft: true
9+
# AlignOperands: true
10+
AlignTrailingComments: true
11+
12+
AllowAllParametersOfDeclarationOnNextLine: true
13+
AllowShortBlocksOnASingleLine: false
14+
AllowShortCaseLabelsOnASingleLine: false
15+
AllowShortFunctionsOnASingleLine: All
16+
AllowShortIfStatementsOnASingleLine: false
17+
AllowShortLoopsOnASingleLine: false
18+
19+
AlwaysBreakAfterDefinitionReturnType: All
20+
AlwaysBreakBeforeMultilineStrings: false
21+
AlwaysBreakTemplateDeclarations: false
22+
23+
# BinPackArguments: false
24+
# BinPackParameters: true
25+
26+
BreakBeforeBinaryOperators: false
27+
BreakBeforeBraces: Custom
28+
BraceWrapping: { AfterFunction: true }
29+
BreakBeforeTernaryOperators: true
30+
BreakConstructorInitializersBeforeComma: true
31+
32+
ColumnLimit: 80
33+
34+
ContinuationIndentWidth: 4
35+
36+
DerivePointerAlignment: false #XXX
37+
DisableFormat: false
38+
ExperimentalAutoDetectBinPacking: false #XXX
39+
ForEachMacros: [ LIST_FOREACH, SIMPLEQ_FOREACH, CIRCLEQ_FOREACH, TAILQ_FOREACH, TAILQ_FOREACH_REVERSE, HT_FOREACH ]
40+
41+
IndentCaseLabels: false
42+
IndentFunctionDeclarationAfterType: false
43+
IndentWidth: 4
44+
IndentWrappedFunctionNames: false
45+
46+
KeepEmptyLinesAtTheStartOfBlocks: true
47+
MaxEmptyLinesToKeep: 2
48+
49+
PointerAlignment: Right #XXX
50+
51+
# SpaceAfterCStyleCast: false
52+
SpaceBeforeAssignmentOperators: true
53+
SpaceBeforeParens: ControlStatements
54+
SpaceInEmptyParentheses: false
55+
SpacesBeforeTrailingComments: 1
56+
SpacesInAngles: false
57+
SpacesInCStyleCastParentheses: false
58+
SpacesInParentheses: false
59+
Standard: Cpp03
60+
TabWidth: 4
61+
UseTab: Always
62+
SortIncludes: false
63+
...

0 commit comments

Comments
 (0)