Updated more variables.
This commit is contained in:
@ -6,23 +6,24 @@ endif()
|
|||||||
|
|
||||||
message(STATUS "CMake version: ${CMAKE_VERSION}")
|
message(STATUS "CMake version: ${CMAKE_VERSION}")
|
||||||
|
|
||||||
|
|
||||||
include(${CMAKE_SOURCE_DIR}/cmake/macros.cmake)
|
include(${CMAKE_SOURCE_DIR}/cmake/macros.cmake)
|
||||||
|
|
||||||
|
# Set the installation layout
|
||||||
|
set(INSTALL_LAYOUT "STANDALONE" CACHE STRING "Install layout, options are: STANDALONE, RPM, DEB")
|
||||||
include(${CMAKE_SOURCE_DIR}/cmake/install_layout.cmake)
|
include(${CMAKE_SOURCE_DIR}/cmake/install_layout.cmake)
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
set_variables()
|
set_variables()
|
||||||
set_maxscale_version()
|
set_maxscale_version()
|
||||||
|
|
||||||
|
|
||||||
set(INSTALL_LAYOUT "STANDALONE" CACHE STRING "Install layout, options are: STANDALONE, RPM, DEB")
|
|
||||||
set_install_layout(${INSTALL_LAYOUT})
|
|
||||||
|
|
||||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
|
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
project(MaxScale)
|
project(MaxScale)
|
||||||
|
|
||||||
#Disabled for now pending evaluation
|
#Do the platform check
|
||||||
include(cmake/CheckPlatform.cmake)
|
include(cmake/CheckPlatform.cmake)
|
||||||
|
|
||||||
check_deps()
|
check_deps()
|
||||||
@ -40,7 +41,7 @@ if(NOT CURL_FOUND)
|
|||||||
message(FATAL_ERROR "Failed to locate dependency: libcurl")
|
message(FATAL_ERROR "Failed to locate dependency: libcurl")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_MODULE_DIR}:${MAXSCALE_LIBRARY_DIR})
|
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_PREFIX}/${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
# Make sure the release notes for this release are present if it is a stable one
|
# Make sure the release notes for this release are present if it is a stable one
|
||||||
if(${MAXSCALE_VERSION} MATCHES "-stable")
|
if(${MAXSCALE_VERSION} MATCHES "-stable")
|
||||||
@ -143,15 +144,15 @@ ${CMAKE_SOURCE_DIR}/Documentation/Upgrading-To-MaxScale-1.1.0.md
|
|||||||
${CMAKE_BINARY_DIR}/UpgradingToMaxScale110.txt)
|
${CMAKE_BINARY_DIR}/UpgradingToMaxScale110.txt)
|
||||||
|
|
||||||
|
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/Changelog.txt DESTINATION ${MAXSCALE_SHARE_DIR})
|
install(FILES ${CMAKE_BINARY_DIR}/Changelog.txt DESTINATION ${MAXSCALE_SHAREDIR})
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/ReleaseNotes.txt DESTINATION ${MAXSCALE_SHARE_DIR})
|
install(FILES ${CMAKE_BINARY_DIR}/ReleaseNotes.txt DESTINATION ${MAXSCALE_SHAREDIR})
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/UpgradingToMaxScale110.txt DESTINATION ${MAXSCALE_SHARE_DIR})
|
install(FILES ${CMAKE_BINARY_DIR}/UpgradingToMaxScale110.txt DESTINATION ${MAXSCALE_SHAREDIR})
|
||||||
install(FILES server/MaxScale_template.cnf DESTINATION ${MAXSCALE_CONFIG_DIR})
|
install(FILES server/MaxScale_template.cnf DESTINATION ${MAXSCALE_SHAREDIR})
|
||||||
install(FILES server/MaxScale_BinlogServer_template.cnf DESTINATION ${MAXSCALE_CONFIG_DIR})
|
install(FILES server/MaxScale_BinlogServer_template.cnf DESTINATION ${MAXSCALE_SHAREDIR})
|
||||||
install(FILES ${ERRMSG} DESTINATION ${MAXSCALE_SHARE_DIR})
|
install(FILES ${ERRMSG} DESTINATION ${MAXSCALE_SHAREDIR})
|
||||||
install(FILES ${CMAKE_SOURCE_DIR}/COPYRIGHT DESTINATION ${MAXSCALE_SHARE_DIR})
|
install(FILES ${CMAKE_SOURCE_DIR}/COPYRIGHT DESTINATION ${MAXSCALE_SHAREDIR})
|
||||||
install(FILES ${CMAKE_SOURCE_DIR}/README DESTINATION ${MAXSCALE_SHARE_DIR})
|
install(FILES ${CMAKE_SOURCE_DIR}/README DESTINATION ${MAXSCALE_SHAREDIR})
|
||||||
install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION ${MAXSCALE_SHARE_DIR})
|
install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION ${MAXSCALE_SHAREDIR})
|
||||||
|
|
||||||
# Install startup scripts and ldconfig files
|
# Install startup scripts and ldconfig files
|
||||||
if(WITH_SCRIPTS)
|
if(WITH_SCRIPTS)
|
||||||
@ -176,13 +177,13 @@ endif()
|
|||||||
|
|
||||||
if(PACKAGE)
|
if(PACKAGE)
|
||||||
# Install the files copied by the postinst script into the share folder
|
# Install the files copied by the postinst script into the share folder
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/maxscale DESTINATION ${MAXSCALE_SHARE_DIR}
|
install(FILES ${CMAKE_BINARY_DIR}/maxscale DESTINATION ${MAXSCALE_SHAREDIR}
|
||||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/maxscale.conf DESTINATION ${MAXSCALE_SHARE_DIR}
|
install(FILES ${CMAKE_BINARY_DIR}/maxscale.conf DESTINATION ${MAXSCALE_SHAREDIR}
|
||||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/postinst DESTINATION ${MAXSCALE_SHARE_DIR}
|
install(FILES ${CMAKE_BINARY_DIR}/postinst DESTINATION ${MAXSCALE_SHAREDIR}
|
||||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/postrm DESTINATION ${MAXSCALE_SHARE_DIR}
|
install(FILES ${CMAKE_BINARY_DIR}/postrm DESTINATION ${MAXSCALE_SHAREDIR}
|
||||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
if(${CMAKE_VERSION} VERSION_LESS 2.8.12)
|
if(${CMAKE_VERSION} VERSION_LESS 2.8.12)
|
||||||
message(WARNING "CMake version is ${CMAKE_VERSION}. Building of packages requires version 2.8.12 or greater.")
|
message(WARNING "CMake version is ${CMAKE_VERSION}. Building of packages requires version 2.8.12 or greater.")
|
||||||
|
@ -7,4 +7,4 @@ if(HIST)
|
|||||||
else()
|
else()
|
||||||
message(STATUS "Could not find editline library. MaxAdmin will be built without it.")
|
message(STATUS "Could not find editline library. MaxAdmin will be built without it.")
|
||||||
endif()
|
endif()
|
||||||
install(TARGETS maxadmin DESTINATION ${MAXSCALE_EXECUTABLE_INSTALL})
|
install(TARGETS maxadmin DESTINATION ${MAXSCALE_BINDIR})
|
||||||
|
@ -3,27 +3,18 @@
|
|||||||
# STANDALONE - Installs to /usr/local/mariadb-maxscale
|
# STANDALONE - Installs to /usr/local/mariadb-maxscale
|
||||||
# RPM - Installs to /usr
|
# RPM - Installs to /usr
|
||||||
# DEB - Installs to /usr
|
# DEB - Installs to /usr
|
||||||
function(set_install_layout TYPE)
|
if(${TYPE} MATCHES "STANDALONE")
|
||||||
|
|
||||||
if(${TYPE} MATCHES "STANDALONE")
|
set(CMAKE_INSTALL_PREFIX "/usr/local/mariadb-maxscale" CACHE PATH "Prefix prepended to install directories.")
|
||||||
|
|
||||||
set(CMAKE_INSTALL_PREFIX "/usr/local/mariadb-maxscale" CACHE PATH "Prefix prepended to install directories.")
|
# RPM and DEB are the same until differences are found
|
||||||
|
else()
|
||||||
|
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Prefix prepended to install directories.")
|
||||||
|
endif()
|
||||||
|
|
||||||
# RPM and DEB are the same until differences are found
|
set(MAXSCALE_LIBDIR lib64/maxscale CACHE PATH "Library installation path")
|
||||||
elseif(${TYPE} MATCHES "RPM")
|
set(MAXSCALE_BINDIR bin CACHE PATH "Executable installation path")
|
||||||
|
set(MAXSCALE_SHAREDIR share/maxscale CACHE PATH "Share file installation path, includes licence and readme files")
|
||||||
|
set(MAXSCALE_DOCDIR share/doc/maxscale CACHE PATH "Documentation installation path, text versions only")
|
||||||
|
set(MAXSCALE_CONFDIR etc CACHE PATH "Configuration file installation path, this is not usually needed")
|
||||||
|
|
||||||
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Prefix prepended to install directories.")
|
|
||||||
|
|
||||||
elseif(${TYPE} MATCHES "DEB")
|
|
||||||
|
|
||||||
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Prefix prepended to install directories.")
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(MAXSCALE_MODULE_INSTALL lib64/maxscale CACHE PATH "Module installation path")
|
|
||||||
set(MAXSCALE_LIBRARY_INSTALL lib64/maxscale CACHE PATH "Library installation path")
|
|
||||||
set(MAXSCALE_EXECUTABLE_INSTALL bin CACHE PATH "Executable installation path")
|
|
||||||
set(MAXSCALE_SHARE_DIR share/maxscale CACHE PATH "Share file installation path, includes licence and readme files")
|
|
||||||
set(MAXSCALE_DOC_DIR ${MAXSCALE_SHARE_DIR}/doc CACHE PATH "Documentation installation path, text versions only")
|
|
||||||
set(MAXSCALE_CONFIG_DIR ${MAXSCALE_SHARE_DIR}/etc CACHE PATH "Configuration file installation path, example configurations will be placed here")
|
|
||||||
endfunction()
|
|
||||||
|
@ -3,7 +3,7 @@ if(LOG_DEBUG)
|
|||||||
endif()
|
endif()
|
||||||
add_library(log_manager SHARED log_manager.cc)
|
add_library(log_manager SHARED log_manager.cc)
|
||||||
target_link_libraries(log_manager pthread aio stdc++)
|
target_link_libraries(log_manager pthread aio stdc++)
|
||||||
install(TARGETS log_manager DESTINATION ${MAXSCALE_LIBRARY_INSTALL})
|
install(TARGETS log_manager DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
if(BUILD_TESTS)
|
if(BUILD_TESTS)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
install(FILES nagios/check_maxscale_monitors.pl DESTINATION ${MAXSCALE_SHARE_DIR}/plugins/nagios)
|
install(FILES nagios/check_maxscale_monitors.pl DESTINATION ${MAXSCALE_SHAREDIR}/plugins/nagios)
|
||||||
install(FILES nagios/check_maxscale_resources.pl DESTINATION ${MAXSCALE_SHARE_DIR}/plugins/nagios)
|
install(FILES nagios/check_maxscale_resources.pl DESTINATION ${MAXSCALE_SHAREDIR}/plugins/nagios)
|
||||||
install(FILES nagios/check_maxscale_threads.pl DESTINATION ${MAXSCALE_SHARE_DIR}/plugins/nagios)
|
install(FILES nagios/check_maxscale_threads.pl DESTINATION ${MAXSCALE_SHAREDIR}/plugins/nagios)
|
||||||
install(FILES nagios/maxscale_commands.cfg DESTINATION ${MAXSCALE_SHARE_DIR}/plugins/nagios)
|
install(FILES nagios/maxscale_commands.cfg DESTINATION ${MAXSCALE_SHAREDIR}/plugins/nagios)
|
||||||
install(FILES nagios/server1.cfg DESTINATION ${MAXSCALE_SHARE_DIR}/plugins/nagios)
|
install(FILES nagios/server1.cfg DESTINATION ${MAXSCALE_SHAREDIR}/plugins/nagios)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
add_library(query_classifier SHARED query_classifier.cc)
|
add_library(query_classifier SHARED query_classifier.cc)
|
||||||
install(TARGETS query_classifier COMPONENT lib DESTINATION ${MAXSCALE_LIBRARY_INSTALL})
|
install(TARGETS query_classifier COMPONENT lib DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
if(BUILD_TESTS)
|
if(BUILD_TESTS)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
@ -18,15 +18,15 @@ if(WITH_TCMALLOC)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(maxscale ${EMBEDDED_LIB} ${PCRE_LINK_FLAGS} ${CURL_LIBRARIES} log_manager utils ssl aio pthread crypt dl crypto inih z rt m stdc++)
|
target_link_libraries(maxscale ${EMBEDDED_LIB} ${PCRE_LINK_FLAGS} ${CURL_LIBRARIES} log_manager utils ssl aio pthread crypt dl crypto inih z rt m stdc++)
|
||||||
install(TARGETS maxscale DESTINATION ${MAXSCALE_EXECUTABLE_INSTALL})
|
install(TARGETS maxscale DESTINATION ${MAXSCALE_BINDIR})
|
||||||
|
|
||||||
add_executable(maxkeys maxkeys.c secrets.c utils.c)
|
add_executable(maxkeys maxkeys.c secrets.c utils.c)
|
||||||
target_link_libraries(maxkeys log_manager utils pthread crypt crypto)
|
target_link_libraries(maxkeys log_manager utils pthread crypt crypto)
|
||||||
install(TARGETS maxkeys DESTINATION ${MAXSCALE_EXECUTABLE_INSTALL})
|
install(TARGETS maxkeys DESTINATION ${MAXSCALE_BINDIR})
|
||||||
|
|
||||||
add_executable(maxpasswd maxpasswd.c secrets.c utils.c)
|
add_executable(maxpasswd maxpasswd.c secrets.c utils.c)
|
||||||
target_link_libraries(maxpasswd log_manager utils pthread crypt crypto)
|
target_link_libraries(maxpasswd log_manager utils pthread crypt crypto)
|
||||||
install(TARGETS maxpasswd DESTINATION ${MAXSCALE_EXECUTABLE_INSTALL})
|
install(TARGETS maxpasswd DESTINATION ${MAXSCALE_BINDIR})
|
||||||
|
|
||||||
if(BUILD_TESTS)
|
if(BUILD_TESTS)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
|
@ -131,7 +131,7 @@ static char pidfile[PATH_MAX+1] = "";
|
|||||||
|
|
||||||
static char* configdir = NULL;
|
static char* configdir = NULL;
|
||||||
static char* logdir = NULL;
|
static char* logdir = NULL;
|
||||||
static char* moduledir = NULL;
|
static char* libdir = NULL;
|
||||||
static char* cachedir = NULL;
|
static char* cachedir = NULL;
|
||||||
static char* langdir = NULL;
|
static char* langdir = NULL;
|
||||||
/**
|
/**
|
||||||
@ -158,7 +158,7 @@ static struct option long_options[] = {
|
|||||||
{"logdir", required_argument, 0, 'L'},
|
{"logdir", required_argument, 0, 'L'},
|
||||||
{"datadir", required_argument, 0, 'D'},
|
{"datadir", required_argument, 0, 'D'},
|
||||||
{"configdir",required_argument, 0, 'C'},
|
{"configdir",required_argument, 0, 'C'},
|
||||||
{"moduledir",required_argument, 0, 'B'},
|
{"libdir",required_argument, 0, 'B'},
|
||||||
{"cachedir",required_argument, 0, 'A'},
|
{"cachedir",required_argument, 0, 'A'},
|
||||||
{"language",required_argument, 0, 'N'},
|
{"language",required_argument, 0, 'N'},
|
||||||
{"syslog", required_argument, 0, 's'},
|
{"syslog", required_argument, 0, 's'},
|
||||||
@ -204,9 +204,9 @@ static char* check_dir_access(char* dirname,bool,bool);
|
|||||||
* Get the directory with all the modules.
|
* Get the directory with all the modules.
|
||||||
* @return The module directory
|
* @return The module directory
|
||||||
*/
|
*/
|
||||||
char* get_moduledir()
|
char* get_libdir()
|
||||||
{
|
{
|
||||||
return moduledir;
|
return libdir;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Handler for SIGHUP signal. Reload the configuration for the
|
* Handler for SIGHUP signal. Reload the configuration for the
|
||||||
@ -1029,7 +1029,7 @@ static void usage(void)
|
|||||||
" (default: /var/lib/maxscale)\n"
|
" (default: /var/lib/maxscale)\n"
|
||||||
" -C|--configdir=... path to configuration file directory\n"
|
" -C|--configdir=... path to configuration file directory\n"
|
||||||
" (default: /etc/)\n"
|
" (default: /etc/)\n"
|
||||||
" -B|--moduledir=... path to module directory\n"
|
" -B|--libdir=... path to module directory\n"
|
||||||
" (default: /var/lib/maxscale)\n"
|
" (default: /var/lib/maxscale)\n"
|
||||||
" -A|--cachedir=... path to cache directory\n"
|
" -A|--cachedir=... path to cache directory\n"
|
||||||
" (default: /var/cache/maxscale)\n"
|
" (default: /var/cache/maxscale)\n"
|
||||||
@ -1274,7 +1274,7 @@ int main(int argc, char **argv)
|
|||||||
case 'B':
|
case 'B':
|
||||||
if(handle_path_arg(&tmp_path,optarg,NULL,true,false))
|
if(handle_path_arg(&tmp_path,optarg,NULL,true,false))
|
||||||
{
|
{
|
||||||
moduledir = tmp_path;
|
libdir = tmp_path;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'A':
|
case 'A':
|
||||||
@ -1742,8 +1742,8 @@ int main(int argc, char **argv)
|
|||||||
cachedir = strdup(default_cachedir);
|
cachedir = strdup(default_cachedir);
|
||||||
if(langdir == NULL)
|
if(langdir == NULL)
|
||||||
langdir = strdup(default_langdir);
|
langdir = strdup(default_langdir);
|
||||||
if(moduledir == NULL)
|
if(libdir == NULL)
|
||||||
moduledir = strdup(default_moduledir);
|
libdir = strdup(default_libdir);
|
||||||
/**
|
/**
|
||||||
* Set a data directory for the mysqld library, we use
|
* Set a data directory for the mysqld library, we use
|
||||||
* a unique directory name to avoid clauses if multiple
|
* a unique directory name to avoid clauses if multiple
|
||||||
@ -1785,7 +1785,7 @@ int main(int argc, char **argv)
|
|||||||
cnf_file_path,
|
cnf_file_path,
|
||||||
logdir,
|
logdir,
|
||||||
datadir,
|
datadir,
|
||||||
moduledir,
|
libdir,
|
||||||
cachedir);
|
cachedir);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1807,7 +1807,7 @@ int main(int argc, char **argv)
|
|||||||
LOGIF(LM,
|
LOGIF(LM,
|
||||||
(skygw_log_write_flush(LOGFILE_MESSAGE,
|
(skygw_log_write_flush(LOGFILE_MESSAGE,
|
||||||
"Module directory: %s",
|
"Module directory: %s",
|
||||||
moduledir)));
|
libdir)));
|
||||||
LOGIF(LM,
|
LOGIF(LM,
|
||||||
(skygw_log_write_flush(LOGFILE_MESSAGE,
|
(skygw_log_write_flush(LOGFILE_MESSAGE,
|
||||||
"Service cache: %s",
|
"Service cache: %s",
|
||||||
@ -1882,8 +1882,8 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
libmysqld_started = TRUE;
|
libmysqld_started = TRUE;
|
||||||
|
|
||||||
if(moduledir == NULL)
|
if(libdir == NULL)
|
||||||
moduledir = strdup(default_moduledir);
|
libdir = strdup(default_libdir);
|
||||||
|
|
||||||
if (!config_load(cnf_file_path))
|
if (!config_load(cnf_file_path))
|
||||||
{
|
{
|
||||||
@ -2179,10 +2179,10 @@ static int cnf_preparser(void* data, const char* section, const char* name, cons
|
|||||||
if(logdir == NULL)
|
if(logdir == NULL)
|
||||||
handle_path_arg(&logdir,(char*)value,NULL,true,true);
|
handle_path_arg(&logdir,(char*)value,NULL,true,true);
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "moduledir") == 0)
|
else if(strcmp(name, "libdir") == 0)
|
||||||
{
|
{
|
||||||
if(moduledir == NULL)
|
if(libdir == NULL)
|
||||||
handle_path_arg(&moduledir,(char*)value,NULL,true,false);
|
handle_path_arg(&libdir,(char*)value,NULL,true,false);
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "datadir") == 0)
|
else if(strcmp(name, "datadir") == 0)
|
||||||
{
|
{
|
||||||
|
@ -147,7 +147,7 @@ MODULE_INFO *mod_info = NULL;
|
|||||||
|
|
||||||
if (access(fname, F_OK) == -1)
|
if (access(fname, F_OK) == -1)
|
||||||
{
|
{
|
||||||
snprintf(fname, MAXPATHLEN+1,"%s/lib%s.so", get_moduledir(), module);
|
snprintf(fname, MAXPATHLEN+1,"%s/lib%s.so", get_libdir(), module);
|
||||||
|
|
||||||
if (access(fname, F_OK) == -1)
|
if (access(fname, F_OK) == -1)
|
||||||
{
|
{
|
||||||
@ -155,7 +155,7 @@ MODULE_INFO *mod_info = NULL;
|
|||||||
LOGFILE_ERROR,
|
LOGFILE_ERROR,
|
||||||
"Error : Unable to find library for "
|
"Error : Unable to find library for "
|
||||||
"module: %s. Module dir: %s",
|
"module: %s. Module dir: %s",
|
||||||
module, get_moduledir())));
|
module, get_libdir())));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ SERVICE *service;
|
|||||||
return NULL;
|
return NULL;
|
||||||
if ((service->router = load_module(router, MODULE_ROUTER)) == NULL)
|
if ((service->router = load_module(router, MODULE_ROUTER)) == NULL)
|
||||||
{
|
{
|
||||||
char* home = get_moduledir();
|
char* home = get_libdir();
|
||||||
char* ldpath = getenv("LD_LIBRARY_PATH");
|
char* ldpath = getenv("LD_LIBRARY_PATH");
|
||||||
|
|
||||||
LOGIF(LE, (skygw_log_write_flush(
|
LOGIF(LE, (skygw_log_write_flush(
|
||||||
|
@ -25,7 +25,7 @@ static const char* default_cnf_fname = "MaxScale.cnf";
|
|||||||
static const char* default_configdir = "/etc/";
|
static const char* default_configdir = "/etc/";
|
||||||
static const char* default_logdir = "/var/log/maxscale/";
|
static const char* default_logdir = "/var/log/maxscale/";
|
||||||
static const char* default_datadir = "/var/cache/maxscale/";
|
static const char* default_datadir = "/var/cache/maxscale/";
|
||||||
static const char* default_moduledir = "/lib64/maxscale/";
|
static const char* default_libdir = "/lib64/maxscale/";
|
||||||
static const char* default_cachedir = "/var/cache/maxscale/";
|
static const char* default_cachedir = "/var/cache/maxscale/";
|
||||||
static const char* default_langdir = "/usr/share/mysql/english/"; /*< This is where the MariaDB
|
static const char* default_langdir = "/usr/share/mysql/english/"; /*< This is where the MariaDB
|
||||||
* server installs errmsg.sys */
|
* server installs errmsg.sys */
|
||||||
@ -77,5 +77,5 @@ int gw_write(DCB *dcb, const void *buf, size_t nbytes);
|
|||||||
int gw_getsockerrno(int fd);
|
int gw_getsockerrno(int fd);
|
||||||
int parse_bindconfig(char *, unsigned short, struct sockaddr_in *);
|
int parse_bindconfig(char *, unsigned short, struct sockaddr_in *);
|
||||||
int setipaddress(struct in_addr *, char *);
|
int setipaddress(struct in_addr *, char *);
|
||||||
char* get_moduledir();
|
char* get_libdir();
|
||||||
#endif
|
#endif
|
||||||
|
@ -3,48 +3,48 @@ if(BUILD_RABBITMQ)
|
|||||||
include_directories(${RABBITMQ_HEADERS})
|
include_directories(${RABBITMQ_HEADERS})
|
||||||
add_library(mqfilter SHARED mqfilter.c)
|
add_library(mqfilter SHARED mqfilter.c)
|
||||||
target_link_libraries(mqfilter query_classifier log_manager utils ${RABBITMQ_LIBRARIES})
|
target_link_libraries(mqfilter query_classifier log_manager utils ${RABBITMQ_LIBRARIES})
|
||||||
install(TARGETS mqfilter DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS mqfilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(regexfilter SHARED regexfilter.c)
|
add_library(regexfilter SHARED regexfilter.c)
|
||||||
target_link_libraries(regexfilter log_manager utils)
|
target_link_libraries(regexfilter log_manager utils)
|
||||||
install(TARGETS regexfilter DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS regexfilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_library(testfilter SHARED testfilter.c)
|
add_library(testfilter SHARED testfilter.c)
|
||||||
target_link_libraries(testfilter log_manager utils)
|
target_link_libraries(testfilter log_manager utils)
|
||||||
install(TARGETS testfilter DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS testfilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_library(qlafilter SHARED qlafilter.c)
|
add_library(qlafilter SHARED qlafilter.c)
|
||||||
target_link_libraries(qlafilter log_manager utils)
|
target_link_libraries(qlafilter log_manager utils)
|
||||||
install(TARGETS qlafilter DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS qlafilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_library(tee SHARED tee.c)
|
add_library(tee SHARED tee.c)
|
||||||
target_link_libraries(tee log_manager utils)
|
target_link_libraries(tee log_manager utils)
|
||||||
install(TARGETS tee DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS tee DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_library(topfilter SHARED topfilter.c)
|
add_library(topfilter SHARED topfilter.c)
|
||||||
target_link_libraries(topfilter log_manager utils)
|
target_link_libraries(topfilter log_manager utils)
|
||||||
install(TARGETS topfilter DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS topfilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_library(dbfwfilter SHARED dbfwfilter.c)
|
add_library(dbfwfilter SHARED dbfwfilter.c)
|
||||||
target_link_libraries(dbfwfilter log_manager utils query_classifier)
|
target_link_libraries(dbfwfilter log_manager utils query_classifier)
|
||||||
install(TARGETS dbfwfilter DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS dbfwfilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_library(namedserverfilter SHARED namedserverfilter.c)
|
add_library(namedserverfilter SHARED namedserverfilter.c)
|
||||||
target_link_libraries(namedserverfilter log_manager utils)
|
target_link_libraries(namedserverfilter log_manager utils)
|
||||||
install(TARGETS namedserverfilter DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS namedserverfilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
if(BUILD_SLAVELAG)
|
if(BUILD_SLAVELAG)
|
||||||
add_library(slavelag SHARED slavelag.c)
|
add_library(slavelag SHARED slavelag.c)
|
||||||
target_link_libraries(slavelag log_manager utils query_classifier)
|
target_link_libraries(slavelag log_manager utils query_classifier)
|
||||||
install(TARGETS slavelag DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS slavelag DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TOOLS)
|
if(BUILD_TOOLS)
|
||||||
add_executable(ruleparser dbfwfilter.c)
|
add_executable(ruleparser dbfwfilter.c)
|
||||||
target_compile_definitions(ruleparser PUBLIC "BUILD_RULE_PARSER")
|
target_compile_definitions(ruleparser PUBLIC "BUILD_RULE_PARSER")
|
||||||
target_link_libraries(ruleparser ${EMBEDDED_LIB} log_manager utils query_classifier fullcore)
|
target_link_libraries(ruleparser ${EMBEDDED_LIB} log_manager utils query_classifier fullcore)
|
||||||
install(TARGETS ruleparser DESTINATION tools)
|
install(TARGETS ruleparser DESTINATION ${MAXSCALE_BINDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(hint)
|
add_subdirectory(hint)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
add_library(hintfilter SHARED hintfilter.c hintparser.c)
|
add_library(hintfilter SHARED hintfilter.c hintparser.c)
|
||||||
set_target_properties(hintfilter PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_PREFIX}/lib)
|
set_target_properties(hintfilter PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_LIBDIR})
|
||||||
target_link_libraries(hintfilter ssl log_manager utils)
|
target_link_libraries(hintfilter ssl log_manager utils)
|
||||||
install(TARGETS hintfilter DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS hintfilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
add_library(mysqlmon SHARED mysql_mon.c)
|
add_library(mysqlmon SHARED mysql_mon.c)
|
||||||
target_link_libraries(mysqlmon log_manager utils)
|
target_link_libraries(mysqlmon log_manager utils)
|
||||||
install(TARGETS mysqlmon DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS mysqlmon DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_library(galeramon SHARED galera_mon.c)
|
add_library(galeramon SHARED galera_mon.c)
|
||||||
target_link_libraries(galeramon log_manager utils)
|
target_link_libraries(galeramon log_manager utils)
|
||||||
install(TARGETS galeramon DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS galeramon DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_library(ndbclustermon SHARED ndbcluster_mon.c)
|
add_library(ndbclustermon SHARED ndbcluster_mon.c)
|
||||||
target_link_libraries(ndbclustermon log_manager utils)
|
target_link_libraries(ndbclustermon log_manager utils)
|
||||||
install(TARGETS ndbclustermon DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS ndbclustermon DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
if(BUILD_MMMON)
|
if(BUILD_MMMON)
|
||||||
add_library(mmmon SHARED mm_mon.c)
|
add_library(mmmon SHARED mm_mon.c)
|
||||||
target_link_libraries(mmmon log_manager utils)
|
target_link_libraries(mmmon log_manager utils)
|
||||||
install(TARGETS mmmon DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS mmmon DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
add_library(MySQLClient SHARED mysql_client.c mysql_common.c)
|
add_library(MySQLClient SHARED mysql_client.c mysql_common.c)
|
||||||
target_link_libraries(MySQLClient log_manager utils)
|
target_link_libraries(MySQLClient log_manager utils)
|
||||||
install(TARGETS MySQLClient DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS MySQLClient DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_library(MySQLBackend SHARED mysql_backend.c mysql_common.c)
|
add_library(MySQLBackend SHARED mysql_backend.c mysql_common.c)
|
||||||
target_link_libraries(MySQLBackend log_manager utils)
|
target_link_libraries(MySQLBackend log_manager utils)
|
||||||
install(TARGETS MySQLBackend DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS MySQLBackend DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_library(telnetd SHARED telnetd.c)
|
add_library(telnetd SHARED telnetd.c)
|
||||||
target_link_libraries(telnetd log_manager utils)
|
target_link_libraries(telnetd log_manager utils)
|
||||||
install(TARGETS telnetd DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS telnetd DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_library(HTTPD SHARED httpd.c)
|
add_library(HTTPD SHARED httpd.c)
|
||||||
target_link_libraries(HTTPD log_manager utils)
|
target_link_libraries(HTTPD log_manager utils)
|
||||||
install(TARGETS HTTPD DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS HTTPD DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
if(BUILD_TESTS)
|
if(BUILD_TESTS)
|
||||||
add_library(testprotocol SHARED testprotocol.c)
|
add_library(testprotocol SHARED testprotocol.c)
|
||||||
install(TARGETS testprotocol DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS testprotocol DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(maxscaled SHARED maxscaled.c)
|
add_library(maxscaled SHARED maxscaled.c)
|
||||||
target_link_libraries(maxscaled log_manager utils)
|
target_link_libraries(maxscaled log_manager utils)
|
||||||
install(TARGETS maxscaled DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS maxscaled DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,28 +2,28 @@ if(BUILD_TESTS)
|
|||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
add_library(testroute SHARED testroute.c)
|
add_library(testroute SHARED testroute.c)
|
||||||
target_link_libraries(testroute log_manager utils)
|
target_link_libraries(testroute log_manager utils)
|
||||||
install(TARGETS testroute DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS testroute DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(schemarouter SHARED schemarouter/schemarouter.c)
|
add_library(schemarouter SHARED schemarouter/schemarouter.c)
|
||||||
target_link_libraries(schemarouter log_manager utils query_classifier)
|
target_link_libraries(schemarouter log_manager utils query_classifier)
|
||||||
install(TARGETS schemarouter DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS schemarouter DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_library(shardrouter SHARED schemarouter/shardrouter.c)
|
add_library(shardrouter SHARED schemarouter/shardrouter.c)
|
||||||
target_link_libraries(shardrouter log_manager utils query_classifier)
|
target_link_libraries(shardrouter log_manager utils query_classifier)
|
||||||
install(TARGETS shardrouter DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS shardrouter DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_library(readconnroute SHARED readconnroute.c)
|
add_library(readconnroute SHARED readconnroute.c)
|
||||||
target_link_libraries(readconnroute log_manager utils)
|
target_link_libraries(readconnroute log_manager utils)
|
||||||
install(TARGETS readconnroute DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS readconnroute DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_library(debugcli SHARED debugcli.c debugcmd.c)
|
add_library(debugcli SHARED debugcli.c debugcmd.c)
|
||||||
target_link_libraries(debugcli log_manager utils)
|
target_link_libraries(debugcli log_manager utils)
|
||||||
install(TARGETS debugcli DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS debugcli DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_library(cli SHARED cli.c debugcmd.c)
|
add_library(cli SHARED cli.c debugcmd.c)
|
||||||
target_link_libraries(cli log_manager utils)
|
target_link_libraries(cli log_manager utils)
|
||||||
install(TARGETS cli DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS cli DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
|
||||||
add_subdirectory(readwritesplit)
|
add_subdirectory(readwritesplit)
|
||||||
add_subdirectory(schemarouter/test)
|
add_subdirectory(schemarouter/test)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
add_library(binlogrouter SHARED blr.c blr_master.c blr_cache.c blr_slave.c blr_file.c)
|
add_library(binlogrouter SHARED blr.c blr_master.c blr_cache.c blr_slave.c blr_file.c)
|
||||||
set_target_properties(binlogrouter PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_MODULE_INSTALL}:${MAXSCALE_LIBRARY_INSTALL})
|
set_target_properties(binlogrouter PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_LIBDIR})
|
||||||
target_link_libraries(binlogrouter ssl pthread log_manager)
|
target_link_libraries(binlogrouter ssl pthread log_manager)
|
||||||
install(TARGETS binlogrouter DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS binlogrouter DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
add_library(maxinfo SHARED maxinfo.c maxinfo_parse.c maxinfo_error.c maxinfo_exec.c)
|
add_library(maxinfo SHARED maxinfo.c maxinfo_parse.c maxinfo_error.c maxinfo_exec.c)
|
||||||
set_target_properties(maxinfo PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_MODULE_INSTALL}:MAXSCALE_LIBRARY_INSTALL)
|
set_target_properties(maxinfo PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_LIBDIR})
|
||||||
target_link_libraries(maxinfo pthread log_manager)
|
target_link_libraries(maxinfo pthread log_manager)
|
||||||
install(TARGETS maxinfo DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS maxinfo DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
add_library(readwritesplit SHARED readwritesplit.c)
|
add_library(readwritesplit SHARED readwritesplit.c)
|
||||||
target_link_libraries(readwritesplit ssl pthread log_manager utils query_classifier)
|
target_link_libraries(readwritesplit ssl pthread log_manager utils query_classifier)
|
||||||
install(TARGETS readwritesplit DESTINATION ${MAXSCALE_MODULE_INSTALL})
|
install(TARGETS readwritesplit DESTINATION ${MAXSCALE_LIBDIR})
|
||||||
if(BUILD_TESTS)
|
if(BUILD_TESTS)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
Reference in New Issue
Block a user