Merge branch 'install_dir_change' into develop
Conflicts: CMakeLists.txt Documentation/Tutorials/Administration-Tutorial.md log_manager/CMakeLists.txt server/core/CMakeLists.txt server/core/gateway.c server/core/maxkeys.c server/core/maxpasswd.c server/modules/filter/test/CMakeLists.txt server/modules/routing/CMakeLists.txt
This commit is contained in:
@ -3,48 +3,48 @@ if(BUILD_RABBITMQ)
|
||||
include_directories(${RABBITMQ_HEADERS})
|
||||
add_library(mqfilter SHARED mqfilter.c)
|
||||
target_link_libraries(mqfilter query_classifier log_manager utils ${RABBITMQ_LIBRARIES})
|
||||
install(TARGETS mqfilter DESTINATION modules)
|
||||
install(TARGETS mqfilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||
endif()
|
||||
|
||||
add_library(regexfilter SHARED regexfilter.c)
|
||||
target_link_libraries(regexfilter log_manager utils)
|
||||
install(TARGETS regexfilter DESTINATION modules)
|
||||
install(TARGETS regexfilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
add_library(testfilter SHARED testfilter.c)
|
||||
target_link_libraries(testfilter log_manager utils)
|
||||
install(TARGETS testfilter DESTINATION modules)
|
||||
install(TARGETS testfilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
add_library(qlafilter SHARED qlafilter.c)
|
||||
target_link_libraries(qlafilter log_manager utils)
|
||||
install(TARGETS qlafilter DESTINATION modules)
|
||||
install(TARGETS qlafilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
add_library(tee SHARED tee.c)
|
||||
target_link_libraries(tee log_manager utils)
|
||||
install(TARGETS tee DESTINATION modules)
|
||||
install(TARGETS tee DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
add_library(topfilter SHARED topfilter.c)
|
||||
target_link_libraries(topfilter log_manager utils)
|
||||
install(TARGETS topfilter DESTINATION modules)
|
||||
install(TARGETS topfilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
add_library(dbfwfilter SHARED dbfwfilter.c)
|
||||
target_link_libraries(dbfwfilter log_manager utils query_classifier)
|
||||
install(TARGETS dbfwfilter DESTINATION modules)
|
||||
install(TARGETS dbfwfilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
add_library(namedserverfilter SHARED namedserverfilter.c)
|
||||
target_link_libraries(namedserverfilter log_manager utils)
|
||||
install(TARGETS namedserverfilter DESTINATION modules)
|
||||
install(TARGETS namedserverfilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
if(BUILD_SLAVELAG)
|
||||
add_library(slavelag SHARED slavelag.c)
|
||||
target_link_libraries(slavelag log_manager utils query_classifier)
|
||||
install(TARGETS slavelag DESTINATION modules)
|
||||
install(TARGETS slavelag DESTINATION ${MAXSCALE_LIBDIR})
|
||||
endif()
|
||||
|
||||
if(BUILD_TOOLS)
|
||||
add_executable(ruleparser dbfwfilter.c)
|
||||
target_compile_definitions(ruleparser PUBLIC "BUILD_RULE_PARSER")
|
||||
target_link_libraries(ruleparser ${EMBEDDED_LIB} log_manager utils query_classifier fullcore)
|
||||
install(TARGETS ruleparser DESTINATION tools)
|
||||
install(TARGETS ruleparser DESTINATION ${MAXSCALE_BINDIR})
|
||||
endif()
|
||||
|
||||
add_subdirectory(hint)
|
||||
|
@ -2214,15 +2214,13 @@ int main(int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if((home = getenv("MAXSCALE_HOME")) == NULL)
|
||||
home = malloc(sizeof(char)*(PATH_MAX+1));
|
||||
if(getcwd(home,PATH_MAX) == NULL)
|
||||
{
|
||||
home = malloc(sizeof(char)*(PATH_MAX+1));
|
||||
if(getcwd(home,PATH_MAX) == NULL)
|
||||
{
|
||||
free(home);
|
||||
home = NULL;
|
||||
}
|
||||
free(home);
|
||||
home = NULL;
|
||||
}
|
||||
|
||||
printf("Log files written to: %s\n",home?home:"/tpm");
|
||||
|
||||
int argc_ = 2;
|
||||
|
@ -1,4 +1,4 @@
|
||||
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)
|
||||
install(TARGETS hintfilter DESTINATION modules)
|
||||
install(TARGETS hintfilter DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
add_executable(harness_ui harness_ui.c harness_common.c)
|
||||
add_executable(harness harness_util.c harness_common.c)
|
||||
@ -25,7 +24,3 @@ add_test(TestTeeRecursion ${CMAKE_CURRENT_SOURCE_DIR}/tee_recursion.sh
|
||||
${TEST_PASSWORD}
|
||||
${TEST_HOST}
|
||||
${TEST_PORT})
|
||||
|
||||
set_tests_properties(TestHintfilter TestRegexfilter TestFwfilter1 TestFwfilter2 TestTeeRecursion
|
||||
PROPERTIES
|
||||
ENVIRONMENT MAXSCALE_HOME=${CMAKE_BINARY_DIR}/)
|
||||
|
@ -49,8 +49,8 @@ USER=$3
|
||||
PWD=$4
|
||||
HOST=$5
|
||||
PORT=$6
|
||||
CONF=$BINDIR/etc/MaxScale.cnf
|
||||
OLDCONF=$BINDIR/etc/MaxScale.cnf.old
|
||||
CONF=$BINDIR/etc/maxscale.cnf
|
||||
OLDCONF=$BINDIR/etc/maxscale.cnf.old
|
||||
MAXPID=$BINDIR/log/$(ls -1 $BINDIR/log|grep maxscale)
|
||||
TEST1=$SRCDIR/server/modules/filter/test/tee_recursion1.cnf
|
||||
TEST2=$SRCDIR/server/modules/filter/test/tee_recursion2.cnf
|
||||
|
@ -1,16 +1,16 @@
|
||||
add_library(mysqlmon SHARED mysql_mon.c monitor_common.c)
|
||||
target_link_libraries(mysqlmon log_manager utils)
|
||||
install(TARGETS mysqlmon DESTINATION modules)
|
||||
install(TARGETS mysqlmon DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
add_library(galeramon SHARED galeramon.c monitor_common.c)
|
||||
target_link_libraries(galeramon log_manager utils)
|
||||
install(TARGETS galeramon DESTINATION modules)
|
||||
install(TARGETS galeramon DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
add_library(ndbclustermon SHARED ndbclustermon.c monitor_common.c)
|
||||
target_link_libraries(ndbclustermon log_manager utils)
|
||||
install(TARGETS ndbclustermon DESTINATION modules)
|
||||
install(TARGETS ndbclustermon DESTINATION ${MAXSCALE_LIBDIR})
|
||||
if(BUILD_MMMON)
|
||||
add_library(mmmon SHARED mmmon.c monitor_common.c)
|
||||
target_link_libraries(mmmon log_manager utils)
|
||||
install(TARGETS mmmon DESTINATION modules)
|
||||
install(TARGETS mmmon DESTINATION ${MAXSCALE_LIBDIR})
|
||||
endif()
|
||||
|
@ -1,27 +1,27 @@
|
||||
add_library(MySQLClient SHARED mysql_client.c mysql_common.c)
|
||||
target_link_libraries(MySQLClient log_manager utils)
|
||||
install(TARGETS MySQLClient DESTINATION modules)
|
||||
install(TARGETS MySQLClient DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
add_library(MySQLBackend SHARED mysql_backend.c mysql_common.c)
|
||||
target_link_libraries(MySQLBackend log_manager utils)
|
||||
install(TARGETS MySQLBackend DESTINATION modules)
|
||||
install(TARGETS MySQLBackend DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
add_library(telnetd SHARED telnetd.c)
|
||||
target_link_libraries(telnetd log_manager utils)
|
||||
install(TARGETS telnetd DESTINATION modules)
|
||||
install(TARGETS telnetd DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
add_library(HTTPD SHARED httpd.c)
|
||||
target_link_libraries(HTTPD log_manager utils)
|
||||
install(TARGETS HTTPD DESTINATION modules)
|
||||
install(TARGETS HTTPD DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
if(BUILD_TESTS)
|
||||
add_library(testprotocol SHARED testprotocol.c)
|
||||
install(TARGETS testprotocol DESTINATION modules)
|
||||
install(TARGETS testprotocol DESTINATION ${MAXSCALE_LIBDIR})
|
||||
endif()
|
||||
|
||||
add_library(maxscaled SHARED maxscaled.c)
|
||||
target_link_libraries(maxscaled log_manager utils)
|
||||
install(TARGETS maxscaled DESTINATION modules)
|
||||
install(TARGETS maxscaled DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
|
||||
|
||||
|
@ -2,20 +2,20 @@ if(BUILD_TESTS)
|
||||
add_subdirectory(test)
|
||||
add_library(testroute SHARED testroute.c)
|
||||
target_link_libraries(testroute log_manager utils)
|
||||
install(TARGETS testroute DESTINATION modules)
|
||||
install(TARGETS testroute DESTINATION ${MAXSCALE_LIBDIR})
|
||||
endif()
|
||||
|
||||
add_library(readconnroute SHARED readconnroute.c)
|
||||
target_link_libraries(readconnroute log_manager utils)
|
||||
install(TARGETS readconnroute DESTINATION modules)
|
||||
install(TARGETS readconnroute DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
add_library(debugcli SHARED debugcli.c debugcmd.c)
|
||||
target_link_libraries(debugcli log_manager utils)
|
||||
install(TARGETS debugcli DESTINATION modules)
|
||||
install(TARGETS debugcli DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
add_library(cli SHARED cli.c debugcmd.c)
|
||||
target_link_libraries(cli log_manager utils)
|
||||
install(TARGETS cli DESTINATION modules)
|
||||
install(TARGETS cli DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
add_subdirectory(readwritesplit)
|
||||
add_subdirectory(schemarouter)
|
||||
|
@ -1,4 +1,4 @@
|
||||
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}:${CMAKE_INSTALL_PREFIX}/lib)
|
||||
set_target_properties(binlogrouter PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_LIBDIR})
|
||||
target_link_libraries(binlogrouter ssl pthread log_manager)
|
||||
install(TARGETS binlogrouter DESTINATION modules)
|
||||
install(TARGETS binlogrouter DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
@ -71,7 +71,7 @@ static void blr_log_header(logfile_id_t file, char *msg, uint8_t *ptr);
|
||||
int
|
||||
blr_file_init(ROUTER_INSTANCE *router)
|
||||
{
|
||||
char *ptr, path[PATH_MAX], filename[PATH_MAX];
|
||||
char *ptr, path[PATH_MAX+1], filename[PATH_MAX+1];
|
||||
int file_found, n = 1;
|
||||
int root_len, i;
|
||||
DIR *dirp;
|
||||
@ -79,12 +79,8 @@ struct dirent *dp;
|
||||
|
||||
if (router->binlogdir == NULL)
|
||||
{
|
||||
strcpy(path, "/usr/local/mariadb-maxscale");
|
||||
if ((ptr = getenv("MAXSCALE_HOME")) != NULL)
|
||||
{
|
||||
strncpy(path, ptr,PATH_MAX);
|
||||
}
|
||||
strncat(path, "/",PATH_MAX);
|
||||
strcpy(path, get_datadir());
|
||||
strncat(path,"/",PATH_MAX);
|
||||
strncat(path, router->service->name,PATH_MAX);
|
||||
|
||||
if (access(path, R_OK) == -1)
|
||||
@ -660,24 +656,20 @@ struct stat statb;
|
||||
void
|
||||
blr_cache_response(ROUTER_INSTANCE *router, char *response, GWBUF *buf)
|
||||
{
|
||||
char path[4097], *ptr;
|
||||
char path[PATH_MAX+1], *ptr;
|
||||
int fd;
|
||||
|
||||
strcpy(path, "/usr/local/mariadb-maxscale");
|
||||
if ((ptr = getenv("MAXSCALE_HOME")) != NULL)
|
||||
{
|
||||
strncpy(path, ptr, 4096);
|
||||
}
|
||||
strncat(path, "/", 4096);
|
||||
strncat(path, router->service->name, 4096);
|
||||
strcpy(path,get_datadir());
|
||||
strncat(path,"/",PATH_MAX);
|
||||
strncat(path, router->service->name, PATH_MAX);
|
||||
|
||||
if (access(path, R_OK) == -1)
|
||||
mkdir(path, 0777);
|
||||
strncat(path, "/.cache", 4096);
|
||||
strncat(path, "/.cache", PATH_MAX);
|
||||
if (access(path, R_OK) == -1)
|
||||
mkdir(path, 0777);
|
||||
strncat(path, "/", 4096);
|
||||
strncat(path, response, 4096);
|
||||
strncat(path, response, PATH_MAX);
|
||||
|
||||
if ((fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, 0666)) == -1)
|
||||
return;
|
||||
@ -698,19 +690,15 @@ GWBUF *
|
||||
blr_cache_read_response(ROUTER_INSTANCE *router, char *response)
|
||||
{
|
||||
struct stat statb;
|
||||
char path[4097], *ptr;
|
||||
char path[PATH_MAX+1], *ptr;
|
||||
int fd;
|
||||
GWBUF *buf;
|
||||
|
||||
strcpy(path, "/usr/local/mariadb-maxscale");
|
||||
if ((ptr = getenv("MAXSCALE_HOME")) != NULL)
|
||||
{
|
||||
strncpy(path, ptr, 4096);
|
||||
}
|
||||
strncat(path, "/", 4096);
|
||||
strncat(path, router->service->name, 4096);
|
||||
strncat(path, "/.cache/", 4096);
|
||||
strncat(path, response, 4096);
|
||||
strcpy(path, get_datadir());
|
||||
strncat(path, "/", PATH_MAX);
|
||||
strncat(path, router->service->name, PATH_MAX);
|
||||
strncat(path, "/.cache/", PATH_MAX);
|
||||
strncat(path, response, PATH_MAX);
|
||||
|
||||
if ((fd = open(path, O_RDONLY)) == -1)
|
||||
return NULL;
|
||||
|
@ -1,4 +1,4 @@
|
||||
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}:${CMAKE_INSTALL_PREFIX}/lib)
|
||||
set_target_properties(maxinfo PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_LIBDIR})
|
||||
target_link_libraries(maxinfo pthread log_manager)
|
||||
install(TARGETS maxinfo DESTINATION modules)
|
||||
install(TARGETS maxinfo DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
@ -1,6 +1,6 @@
|
||||
add_library(readwritesplit SHARED readwritesplit.c)
|
||||
target_link_libraries(readwritesplit ssl pthread log_manager utils query_classifier)
|
||||
install(TARGETS readwritesplit DESTINATION modules)
|
||||
install(TARGETS readwritesplit DESTINATION ${MAXSCALE_LIBDIR})
|
||||
if(BUILD_TESTS)
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
@ -1,10 +1,10 @@
|
||||
add_library(schemarouter SHARED schemarouter.c sharding_common.c)
|
||||
target_link_libraries(schemarouter log_manager utils query_classifier)
|
||||
install(TARGETS schemarouter DESTINATION modules)
|
||||
install(TARGETS schemarouter DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
add_library(shardrouter SHARED shardrouter.c svcconn.c sharding_common.c)
|
||||
target_link_libraries(shardrouter log_manager utils query_classifier)
|
||||
install(TARGETS shardrouter DESTINATION modules)
|
||||
install(TARGETS shardrouter DESTINATION ${MAXSCALE_LIBDIR})
|
||||
|
||||
if(BUILD_TESTS)
|
||||
add_subdirectory(test)
|
||||
|
Reference in New Issue
Block a user