Commit d8084116 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-7066 No Source RPMs ... (and so no "yum-builddep MariaDB-server" either)

special cases:

* change systemd detection to use CHECK_LIBRARY_EXISTS at least once,
  to have it detected by build_depends.cmake
* similarly, use find_library for pam
* unixODBC is weird, libodbc.so is in the unixODBC package, not
  in the unixODBC-devel, where normally all .so files belong.
  Packaging bug? As a workaround, use find_file(sql.h) instead of
  find_path(sql.h) to make sure that /usr/include/sql.h (not /usr/include)
  is cached by cmake, and later build_depends.cmake will select
  unixODBC-devel, as a package owning /usr/include/sql.h file.
parent b12f1496
...@@ -39,22 +39,14 @@ MACRO(CHECK_SYSTEMD) ...@@ -39,22 +39,14 @@ MACRO(CHECK_SYSTEMD)
SET(LIBSYSTEMD systemd) SET(LIBSYSTEMD systemd)
ENDIF() ENDIF()
SET(CMAKE_REQUIRED_LIBRARIES ${LIBSYSTEMD}) SET(CMAKE_REQUIRED_LIBRARIES ${LIBSYSTEMD})
CHECK_C_SOURCE_COMPILES( CHECK_LIBRARY_EXISTS(systemd sd_listen_fds "" HAVE_SYSTEMD_SD_LISTEN_FDS)
"
#include <systemd/sd-daemon.h>
int main()
{
sd_listen_fds(0);
}"
HAVE_SYSTEMD)
CHECK_INCLUDE_FILES(systemd/sd-daemon.h HAVE_SYSTEMD_SD_DAEMON_H) CHECK_INCLUDE_FILES(systemd/sd-daemon.h HAVE_SYSTEMD_SD_DAEMON_H)
CHECK_FUNCTION_EXISTS(sd_listen_fds HAVE_SYSTEMD_SD_LISTEN_FDS)
CHECK_FUNCTION_EXISTS(sd_notify HAVE_SYSTEMD_SD_NOTIFY) CHECK_FUNCTION_EXISTS(sd_notify HAVE_SYSTEMD_SD_NOTIFY)
CHECK_FUNCTION_EXISTS(sd_notifyf HAVE_SYSTEMD_SD_NOTIFYF) CHECK_FUNCTION_EXISTS(sd_notifyf HAVE_SYSTEMD_SD_NOTIFYF)
SET(CMAKE_REQUIRED_LIBRARIES) SET(CMAKE_REQUIRED_LIBRARIES)
IF(HAVE_SYSTEMD AND HAVE_SYSTEMD_SD_DAEMON_H AND HAVE_SYSTEMD_SD_LISTEN_FDS IF(HAVE_SYSTEMD_SD_DAEMON_H AND HAVE_SYSTEMD_SD_LISTEN_FDS
AND HAVE_SYSTEMD_SD_NOTIFY AND HAVE_SYSTEMD_SD_NOTIFYF) AND HAVE_SYSTEMD_SD_NOTIFY AND HAVE_SYSTEMD_SD_NOTIFYF)
ADD_DEFINITIONS(-DHAVE_SYSTEMD) SET(HAVE_SYSTEMD TRUE)
SET(SYSTEMD_SCRIPTS mariadb-service-convert galera_new_cluster galera_recovery) SET(SYSTEMD_SCRIPTS mariadb-service-convert galera_new_cluster galera_recovery)
SET(SYSTEMD_DEB_FILES "usr/bin/mariadb-service-convert SET(SYSTEMD_DEB_FILES "usr/bin/mariadb-service-convert
usr/bin/galera_new_cluster usr/bin/galera_new_cluster
......
...@@ -8,6 +8,7 @@ IF(HAVE_PAM_APPL_H) ...@@ -8,6 +8,7 @@ IF(HAVE_PAM_APPL_H)
IF(HAVE_STRNDUP) IF(HAVE_STRNDUP)
ADD_DEFINITIONS(-DHAVE_STRNDUP) ADD_DEFINITIONS(-DHAVE_STRNDUP)
ENDIF(HAVE_STRNDUP) ENDIF(HAVE_STRNDUP)
FIND_LIBRARY(PAM_LIBRARY pam)
MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam MODULE_ONLY) MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam MODULE_ONLY)
ENDIF(HAVE_PAM_APPL_H) ENDIF(HAVE_PAM_APPL_H)
...@@ -170,7 +170,8 @@ IF(CONNECT_WITH_ODBC) ...@@ -170,7 +170,8 @@ IF(CONNECT_WITH_ODBC)
# the library 'libiodbc' gets compiled with 'sql'h. # the library 'libiodbc' gets compiled with 'sql'h.
# This will also need changes in the sources (e.g. #include <isql.h>). # This will also need changes in the sources (e.g. #include <isql.h>).
find_path(ODBC_INCLUDE_DIR sql.h find_file(ODBC_INCLUDES sql.h
PATHS
/usr/include /usr/include
/usr/include/odbc /usr/include/odbc
/usr/local/include /usr/local/include
...@@ -180,7 +181,7 @@ IF(CONNECT_WITH_ODBC) ...@@ -180,7 +181,7 @@ IF(CONNECT_WITH_ODBC)
#"C:/Program Files/Microsoft SDKs/Windows/v7.0A/include" #"C:/Program Files/Microsoft SDKs/Windows/v7.0A/include"
#"C:/Program Files/Microsoft SDKs/Windows/v6.0a/include" #"C:/Program Files/Microsoft SDKs/Windows/v6.0a/include"
#"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/include" #"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/include"
DOC "Specify the directory containing sql.h." DOC "Specify the path to sql.h."
) )
find_library(ODBC_LIBRARY find_library(ODBC_LIBRARY
...@@ -199,9 +200,10 @@ IF(CONNECT_WITH_ODBC) ...@@ -199,9 +200,10 @@ IF(CONNECT_WITH_ODBC)
DOC "Specify the ODBC driver manager library here." DOC "Specify the ODBC driver manager library here."
) )
mark_as_advanced(ODBC_LIBRARY ODBC_INCLUDE_DIR) mark_as_advanced(ODBC_LIBRARY ODBC_INCLUDES)
IF(ODBC_INCLUDE_DIR AND ODBC_LIBRARY) IF(ODBC_INCLUDES AND ODBC_LIBRARY)
get_filename_component(ODBC_INCLUDE_DIR "${ODBC_INCLUDES}" PATH)
set(CMAKE_REQUIRED_LIBRARIES ${ODBC_LIBRARY}) set(CMAKE_REQUIRED_LIBRARIES ${ODBC_LIBRARY})
set(CMAKE_REQUIRED_INCLUDES ${ODBC_INCLUDE_DIR}) set(CMAKE_REQUIRED_INCLUDES ${ODBC_INCLUDE_DIR})
CHECK_CXX_SOURCE_COMPILES( CHECK_CXX_SOURCE_COMPILES(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment