Skip to content

Commit

Permalink
Completely remove ability to build with yassl
Browse files Browse the repository at this point in the history
Summary:
Current cmake default is to build with the bundled yaSSL. Because
we always build with OpenSSL, we introduce code changes that break
when running cmake -DWITH_SSL=bundled. Explicitly stop supporting
bundled and switch the default to system.

Test Plan:
mysqlbuild.sh --clean

cmake .. -DCMAKE_BUILD_TYPE=Debug
make -j12

cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_SLL=system
make -j12

Reviewers: pengt, tianx, santoshb, chip

Reviewed By: chip
  • Loading branch information
jtolmer committed Jan 5, 2016
1 parent 8d1f3c8 commit 95257cb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 69 deletions.
2 changes: 1 addition & 1 deletion cmake/build_configurations/feature_set.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ IF(FEATURE_SET)
ENDFOREACH()
ENDIF()

SET(WITH_SSL bundled CACHE STRING "")
SET(WITH_SSL system CACHE STRING "")
SET(WITH_ZLIB bundled CACHE STRING "")
68 changes: 4 additions & 64 deletions cmake/ssl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

# We support different versions of SSL:
# - "bundled" uses source code in <source dir>/extra/yassl
# - "system" (typically) uses headers/libraries in /usr/lib and /usr/lib64
# - a custom installation of openssl can be used like this
# - cmake -DCMAKE_PREFIX_PATH=</path/to/custom/openssl> -DWITH_SSL="system"
# or
# - cmake -DWITH_SSL=</path/to/custom/openssl>
#
# The default value for WITH_SSL is "bundled"
# The default value for WITH_SSL is "system"
# set in cmake/build_configurations/feature_set.cmake
#
# For custom build/install of openssl, see the accompanying README and
Expand All @@ -34,9 +33,6 @@
# 'set path=</path/to/custom/openssl>\bin;%PATH%
# in order to find the .dll files at runtime.

SET(WITH_SSL_DOC "bundled (use yassl)")
SET(WITH_SSL_DOC
"${WITH_SSL_DOC}, yes (prefer os library if present, otherwise use bundled)")
SET(WITH_SSL_DOC
"${WITH_SSL_DOC}, system (use os library)")
SET(WITH_SSL_DOC
Expand All @@ -46,42 +42,16 @@ MACRO (CHANGE_SSL_SETTINGS string)
SET(WITH_SSL ${string} CACHE STRING ${WITH_SSL_DOC} FORCE)
ENDMACRO()

MACRO (MYSQL_USE_BUNDLED_SSL)
SET(INC_DIRS
${CMAKE_SOURCE_DIR}/extra/yassl/include
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include
)
SET(SSL_LIBRARIES yassl taocrypt)
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
SET(SSL_LIBRARIES ${SSL_LIBRARIES} ${LIBSOCKET})
ENDIF()
SET(SSL_INCLUDE_DIRS ${INC_DIRS})
SET(SSL_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
SET(SSL_DEFINES "-DHAVE_YASSL -DYASSL_PREFIX -DHAVE_OPENSSL -DMULTI_THREADED")
CHANGE_SSL_SETTINGS("bundled")
ADD_SUBDIRECTORY(extra/yassl)
ADD_SUBDIRECTORY(extra/yassl/taocrypt)
GET_TARGET_PROPERTY(src yassl SOURCES)
FOREACH(file ${src})
SET(SSL_SOURCES ${SSL_SOURCES} ${CMAKE_SOURCE_DIR}/extra/yassl/${file})
ENDFOREACH()
GET_TARGET_PROPERTY(src taocrypt SOURCES)
FOREACH(file ${src})
SET(SSL_SOURCES ${SSL_SOURCES}
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/${file})
ENDFOREACH()
ENDMACRO()

# MYSQL_CHECK_SSL
#
# Provides the following configure options:
# WITH_SSL=[yes|bundled|system|<path/to/custom/installation>]
# WITH_SSL=[system|<path/to/custom/installation>]
MACRO (MYSQL_CHECK_SSL)
# Add custom krb.
MYSQL_CHECK_KRB()
IF(NOT WITH_SSL)
IF(WIN32)
CHANGE_SSL_SETTINGS("bundled")
CHANGE_SSL_SETTINGS("system")
ENDIF()
ENDIF()

Expand All @@ -91,37 +61,7 @@ MACRO (MYSQL_CHECK_SSL)
SET(WITH_SSL_PATH ${WITH_SSL} CACHE PATH "path to custom SSL installation")
ENDIF()

IF(WITH_SSL STREQUAL "bundled")
MYSQL_USE_BUNDLED_SSL()
# Reset some variables, in case we switch from /path/to/ssl to "bundled".
IF (WITH_SSL_PATH)
UNSET(WITH_SSL_PATH)
UNSET(WITH_SSL_PATH CACHE)
ENDIF()
IF (OPENSSL_ROOT_DIR)
UNSET(OPENSSL_ROOT_DIR)
UNSET(OPENSSL_ROOT_DIR CACHE)
ENDIF()
IF (OPENSSL_INCLUDE_DIR)
UNSET(OPENSSL_INCLUDE_DIR)
UNSET(OPENSSL_INCLUDE_DIR CACHE)
ENDIF()
IF (WIN32 AND OPENSSL_APPLINK_C)
UNSET(OPENSSL_APPLINK_C)
UNSET(OPENSSL_APPLINK_C CACHE)
ENDIF()
IF (OPENSSL_LIBRARY)
UNSET(OPENSSL_LIBRARY)
UNSET(OPENSSL_LIBRARY CACHE)
ENDIF()
IF (CRYPTO_LIBRARY)
UNSET(CRYPTO_LIBRARY)
UNSET(CRYPTO_LIBRARY CACHE)
ENDIF()
ELSEIF(WITH_SSL STREQUAL "system" OR
WITH_SSL STREQUAL "yes" OR
WITH_SSL_PATH
)
IF(WITH_SSL STREQUAL "system" OR WITH_SSL_PATH)
# First search in WITH_SSL_PATH.
FIND_PATH(OPENSSL_ROOT_DIR
NAMES include/openssl/ssl.h
Expand Down
4 changes: 0 additions & 4 deletions unittest/gunit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,6 @@ ADD_LIBRARY(gmock STATIC ${GMOCK_SOURCE_DIR}/src/gmock-all.cc)
ADD_LIBRARY(gtest STATIC ${GTEST_SOURCE_DIR}/src/gtest-all.cc)
SET(GTEST_LIBRARIES gmock gtest)

IF (WITH_SSL STREQUAL "bundled")
ADD_SUBDIRECTORY(yassl)
ENDIF()

INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/regex
Expand Down

0 comments on commit 95257cb

Please sign in to comment.