removed manual UBUNTU flag and renamed it to DEB_LIKE and made it automated
This commit is contained in:
@ -80,12 +80,11 @@ add_subdirectory(query_classifier)
|
|||||||
add_subdirectory(server)
|
add_subdirectory(server)
|
||||||
add_subdirectory(client)
|
add_subdirectory(client)
|
||||||
|
|
||||||
|
|
||||||
file(GLOB DOCS Documentation/*.pdf)
|
file(GLOB DOCS Documentation/*.pdf)
|
||||||
|
|
||||||
if( NOT ( (DEFINED INSTALL_SYSTEM_FILES) AND ( NOT ( INSTALL_SYSTEM_FILES ) ) ) )
|
if( NOT ( (DEFINED INSTALL_SYSTEM_FILES) AND ( NOT ( INSTALL_SYSTEM_FILES ) ) ) )
|
||||||
install(FILES maxscale.conf DESTINATION /etc/ld.so.conf.d/ PERMISSIONS WORLD_EXECUTE WORLD_READ)
|
install(FILES maxscale.conf DESTINATION /etc/ld.so.conf.d/ PERMISSIONS WORLD_EXECUTE WORLD_READ)
|
||||||
if(UBUNTU)
|
if(DEB_BASED)
|
||||||
message(STATUS "Ubuntu: Y")
|
message(STATUS "Ubuntu: Y")
|
||||||
install(FILES etc/ubuntu/init.d/maxscale DESTINATION /etc/init.d/ PERMISSIONS WORLD_EXECUTE)
|
install(FILES etc/ubuntu/init.d/maxscale DESTINATION /etc/init.d/ PERMISSIONS WORLD_EXECUTE)
|
||||||
else()
|
else()
|
||||||
|
|||||||
1
README
1
README
@ -196,7 +196,6 @@ MYSQL_DIR=<path> Path to MySQL headers
|
|||||||
STATIC_EMBEDDED=[Y|N] Link the static or the dynamic verson of the library
|
STATIC_EMBEDDED=[Y|N] Link the static or the dynamic verson of the library
|
||||||
GCOV=[Y|N] Generate gcov output
|
GCOV=[Y|N] Generate gcov output
|
||||||
BUILD_TESTS=[Y|N] Build tests
|
BUILD_TESTS=[Y|N] Build tests
|
||||||
UBUNTU=[Y|N] Install Ubuntu specific startup scripts
|
|
||||||
DEBUG_OUTPUT=[Y|N] Produce debugging output when configuring CMake
|
DEBUG_OUTPUT=[Y|N] Produce debugging output when configuring CMake
|
||||||
|
|
||||||
\section Running Running MaxScale
|
\section Running Running MaxScale
|
||||||
|
|||||||
45
macros.cmake
45
macros.cmake
@ -76,49 +76,64 @@ macro(check_deps)
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(check_dirs)
|
macro(check_dirs)
|
||||||
# Find the MySQL headers if they were not defined
|
# Find the MySQL headers if they were not defined
|
||||||
if(NOT ( DEFINED MYSQL_DIR ) )
|
if(NOT ( DEFINED MYSQL_DIR ) )
|
||||||
find_path(MYSQL_DIR mysql.h PATH_SUFFIXES mysql mariadb)
|
find_path(MYSQL_DIR mysql.h PATH_SUFFIXES mysql mariadb)
|
||||||
if(${MYSQL_DIR} STREQUAL "MYSQL_DIR-NOTFOUND")
|
if(${MYSQL_DIR} STREQUAL "MYSQL_DIR-NOTFOUND")
|
||||||
message(FATAL_ERROR "Fatal Error: MySQL headers were not found.")
|
message(FATAL_ERROR "Fatal Error: MySQL headers were not found.")
|
||||||
elseif(DEBUG_OUTPUT)
|
elseif(DEBUG_OUTPUT)
|
||||||
message(STATUS "Using MySQL headers found at: ${MYSQL_DIR}")
|
message(STATUS "Using MySQL headers found at: ${MYSQL_DIR}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Find the errmsg.sys file if it was not defied
|
# Find the errmsg.sys file if it was not defied
|
||||||
if( NOT ( DEFINED ERRMSG ) )
|
if( NOT ( DEFINED ERRMSG ) )
|
||||||
find_file(ERRMSG errmsg.sys PATHS /usr/share/mysql /usr/local/share/mysql ${CUSTOM_ERRMSG} PATH_SUFFIXES english)
|
find_file(ERRMSG errmsg.sys PATHS /usr/share/mysql /usr/local/share/mysql ${CUSTOM_ERRMSG} PATH_SUFFIXES english)
|
||||||
if(${ERRMSG} STREQUAL "ERRMSG-NOTFOUND")
|
if(${ERRMSG} STREQUAL "ERRMSG-NOTFOUND")
|
||||||
message(FATAL_ERROR "Fatal Error: The errmsg.sys file was not found.")
|
message(FATAL_ERROR "Fatal Error: The errmsg.sys file was not found.")
|
||||||
elseif(DEBUG_OUTPUT)
|
elseif(DEBUG_OUTPUT)
|
||||||
message(STATUS "Using errmsg.sys found at: ${ERRMSG}")
|
message(STATUS "Using errmsg.sys found at: ${ERRMSG}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Find the embedded mysql library
|
# Find the embedded mysql library
|
||||||
if(STATIC_EMBEDDED)
|
if(STATIC_EMBEDDED)
|
||||||
set(OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
set(OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||||
find_library(EMBEDDED_LIB_STATIC libmysqld.a PATH_SUFFIXES mysql mariadb)
|
find_library(EMBEDDED_LIB_STATIC libmysqld.a PATH_SUFFIXES mysql mariadb)
|
||||||
set(EMBEDDED_LIB ${EMBEDDED_LIB_STATIC})
|
set(EMBEDDED_LIB ${EMBEDDED_LIB_STATIC})
|
||||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_SUFFIXES})
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_SUFFIXES})
|
||||||
else()
|
else()
|
||||||
|
|
||||||
find_library(EMBEDDED_LIB_DYNAMIC mysqld PATH_SUFFIXES mysql mariadb)
|
find_library(EMBEDDED_LIB_DYNAMIC mysqld PATH_SUFFIXES mysql mariadb)
|
||||||
set(EMBEDDED_LIB ${EMBEDDED_LIB_DYNAMIC})
|
set(EMBEDDED_LIB ${EMBEDDED_LIB_DYNAMIC})
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Inform the user about the embedded library
|
# Inform the user about the embedded library
|
||||||
if( (${EMBEDDED_LIB} STREQUAL "EMBEDDED_LIB_STATIC-NOTFOUND") OR (${EMBEDDED_LIB} STREQUAL "EMBEDDED_LIB_DYNAMIC-NOTFOUND"))
|
if( (${EMBEDDED_LIB} STREQUAL "EMBEDDED_LIB_STATIC-NOTFOUND") OR (${EMBEDDED_LIB} STREQUAL "EMBEDDED_LIB_DYNAMIC-NOTFOUND"))
|
||||||
message(FATAL_ERROR "Library not found: libmysqld. If your install of MySQL is in a non-default location, please provide the location with -DEMBEDDED_LIB=<path to library>")
|
message(FATAL_ERROR "Library not found: libmysqld. If your install of MySQL is in a non-default location, please provide the location with -DEMBEDDED_LIB=<path to library>")
|
||||||
else()
|
else()
|
||||||
get_filename_component(EMBEDDED_LIB ${EMBEDDED_LIB} REALPATH)
|
get_filename_component(EMBEDDED_LIB ${EMBEDDED_LIB} REALPATH)
|
||||||
message(STATUS "Using embedded library: ${EMBEDDED_LIB}")
|
message(STATUS "Using embedded library: ${EMBEDDED_LIB}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(DEPS_OK TRUE CACHE BOOL "If all the dependencies were found.")
|
|
||||||
|
# Check which init.d script to install
|
||||||
|
find_file(RPM_FNC functions PATHS /etc/rc.d/init.d)
|
||||||
|
if(${RPM_FNC} MATCHES "RPM_FNC-NOTFOUND")
|
||||||
|
find_file(DEB_FNC init-functions PATHS /lib/lsb)
|
||||||
|
if(${DEB_FNC MATCHES} "DEB_FNC-NOTFOUND")
|
||||||
|
message(FATAL_ERROR "Cannot find required init-functions in /lib/lsb/ or /etc/rc.d/init.d/, please confirm that your system files are OK.")
|
||||||
|
else()
|
||||||
|
set(DEB_BASED TRUE CACHE BOOL "If init.d script uses /lib/lsb/init-functions instead of /etc/rc.d/init.d/functions.")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(DEB_BASED FALSE CACHE BOOL "If init.d script uses /lib/lsb/init-functions instead of /etc/rc.d/init.d/functions.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
set(DEPS_OK TRUE CACHE BOOL "If all the dependencies were found.")
|
||||||
|
|
||||||
endmacro()
|
endmacro()
|
||||||
Reference in New Issue
Block a user