Skip to content
Permalink
Browse files

ODBC-264 Windows and OSX build fix.

C/C is updated to 3.1.4
For OSX added workaround for typo(aka bug) in c/c preventing linking of
one of auth plugins. Plus solved some rather old issues in pkg cmake for
the case, when src and build directories are different
  • Loading branch information...
lawrinn committed Sep 17, 2019
1 parent 18ea7d4 commit c921b500650eca535010f12e0d83417d2ef915ec
Showing with 34 additions and 31 deletions.
  1. +30 −27 CMakeLists.txt
  2. +1 −1 libmariadb
  3. +2 −2 osxinstall/CMakeLists.txt
  4. +1 −1 osxinstall/build_package.sh.in
@@ -90,6 +90,7 @@ IF(WIN32)
ENDFOREACH()
ENDIF()
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
SET(INSTALL_PLUGINDIR "${MARIADB_DEFAULT_PLUGINS_SUBDIR}")
ELSE()
# This has been done before C/C cmake scripts are included
IF(NOT DEFINED INSTALL_LIB_SUFFIX)
@@ -103,6 +104,35 @@ ELSE()
MESSAGE(STATUS "Autentication Plugins installation dir: ${INSTALL_PLUGINDIR}")
ENDIF()

IF(WIN32 OR WITH_OPENSSL OR "${WITH_SSL}" STREQUAL "OPENSSL")
IF(WITH_OPENSSL OR "${WITH_SSL}" STREQUAL "OPENSSL")
FIND_PACKAGE(OpenSSL)

IF(OPENSSL_FOUND)
MESSAGE(STATUS "Configuring to build with OpenSSL ${OPENSSL_LIBRARIES}")

ADD_DEFINITIONS(-DHAVE_OPENSSL)
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES})

#IF(OPENSSL_CRYPTO_LIBRARIES)
# SET(SSL_LIBRARIES ${SSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES})
#ENDIF()

SET(PLATFORM_DEPENDENCIES ${PLATFORM_DEPENDENCIES} ${SSL_LIBRARIES})
# Temporary workarond for the (typo) issue in the c/c 3.1.4
SET(CRYT_LIBS ${SSL_LIBRARIES})
ELSE()
MESSAGE(FATAL_ERROR "OpenSSL not found. Please install OpenSSL or disable SSL support via option -DWITH_OPENSSL=Off")
ENDIF()
ELSE()
MESSAGE(STATUS "Configuring SSL support using SChannel")
SET(PLATFORM_DEPENDENCIES ${PLATFORM_DEPENDENCIES} version.lib)
ENDIF()
ELSE()
MESSAGE(STATUS "Configuring to build without SSL support")
ENDIF()

IF(EXISTS ${CMAKE_SOURCE_DIR}/libmariadb)
IF(GIT_BUILD_SRCPKG)
# We don't want conn/c (wrong) src pkg to be built.
@@ -254,33 +284,6 @@ ELSE()

ENDIF()

IF(WIN32 OR WITH_OPENSSL)
IF(WITH_OPENSSL)
FIND_PACKAGE(OpenSSL)

IF(OPENSSL_FOUND)
MESSAGE(STATUS "Configuring to build with OpenSSL")

ADD_DEFINITIONS(-DHAVE_OPENSSL)
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES})

IF(OPENSSL_CRYPTO_LIBRARIES)
SET(SSL_LIBRARIES ${SSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES})
ENDIF()

SET(PLATFORM_DEPENDENCIES ${PLATFORM_DEPENDENCIES} ${SSL_LIBRARIES})
ELSE()
MESSAGE(FATAL_ERROR "OpenSSL not found. Please install OpenSSL or disable SSL support via option -DWITH_OPENSSL=Off")
ENDIF()
ELSE()
MESSAGE(STATUS "Configuring SSL support using SChannel")
SET(PLATFORM_DEPENDENCIES ${PLATFORM_DEPENDENCIES} version.lib)
ENDIF()
ELSE()
MESSAGE(STATUS "Configuring to build without SSL support")
ENDIF()

SET(LIBRARY_NAME "maodbc")
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/mariadb-odbc-driver.def.in
${CMAKE_SOURCE_DIR}/mariadb-odbc-driver-uni.def)
@@ -61,8 +61,8 @@ ELSE()
ENDIF()

ADD_CUSTOM_TARGET(maodbcpkg
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build_package.sh ${PRODUCT_IDENTIFIER} ${PRODUCT_VERSION} ${PKG_PACKAGE}
DEPENDS copypkgfiles ${CMAKE_CURRENT_BINARY_DIR}/scripts/postinstall distribution.plist README.html WELCOME.html LICENSE.html
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/build_package.sh ${PRODUCT_IDENTIFIER} ${PRODUCT_VERSION} ${PKG_PACKAGE}
DEPENDS copypkgfiles ${CMAKE_CURRENT_BINARY_DIR}/scripts/postinstall ${CMAKE_CURRENT_BINARY_DIR}/distribution.plist README.html ${CMAKE_CURRENT_BINARY_DIR}/WELCOME.html LICENSE.html
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

SET_TARGET_PROPERTIES(maodbcpkg PROPERTIES EXCLUDE_FROM_ALL OFF)
@@ -19,4 +19,4 @@
# *************************************************************************************/

pkgbuild --root ROOT --scripts scripts --identifier $1 --version $2 libmaodbc.pkg
productbuild --distribution distribution.plist --resources . --package-path libmaodbc.pkg @SIGN_WITH_DEVID@ $3
productbuild --distribution @CMAKE_CURRENT_BINARY_DIR@/distribution.plist --resources . --package-path libmaodbc.pkg @SIGN_WITH_DEVID@ $3

0 comments on commit c921b50

Please sign in to comment.
You can’t perform that action at this time.