Fix in-source builds

The internal header directory conflicted with in-source builds causing a
build failure. This is fixed by renaming the internal header directory to
something other than maxscale.

The renaming pointed out a few problems in a couple of source files that
appeared to include internal headers when the headers were in fact public
headers.

Fixed maxctrl in-source builds by making the copying of the sources
optional.
This commit is contained in:
Markus Mäkelä 2017-11-22 08:12:09 +02:00
parent 6054fa0957
commit 396b81f336
74 changed files with 135 additions and 129 deletions

View File

@ -6,9 +6,15 @@ then
exit 1
fi
# Copy sources to working directory
src=$1
cp -r -t $PWD/maxctrl $src/maxctrl/* && cd $PWD/maxctrl
if [ "$PWD" != "$src" ]
then
# Copy sources to working directory
cp -r -t $PWD/maxctrl $src/maxctrl/*
fi
cd $PWD/maxctrl
npm install
npm install pkg@4.2.3

View File

@ -14,7 +14,7 @@
/**
* @file The embedded HTTP protocol administrative interface
*/
#include "maxscale/admin.hh"
#include "internal/admin.hh"
#include <climits>
#include <new>
@ -35,7 +35,7 @@
#include <maxscale/http.hh>
#include <maxscale/adminusers.h>
#include "maxscale/resource.hh"
#include "internal/resource.hh"
using std::string;
using std::ifstream;

View File

@ -15,7 +15,7 @@
#include <maxscale/modutil.h>
#include <maxscale/alloc.h>
#include "maxscale/modules.h"
#include "internal/modules.h"
/**
* @file authenticator.c - Authenticator module functions
*/

View File

@ -39,18 +39,18 @@
#include <maxscale/spinlock.h>
#include <maxscale/utils.h>
#include <maxscale/paths.h>
#include <maxscale/router.h>
#include <maxscale/json_api.h>
#include <maxscale/http.hh>
#include <maxscale/version.h>
#include <maxscale/maxscale.h>
#include <maxscale/hk_heartbeat.h>
#include "maxscale/config.h"
#include "maxscale/filter.h"
#include "maxscale/service.h"
#include "maxscale/monitor.h"
#include "maxscale/modules.h"
#include "maxscale/router.h"
#include "internal/config.h"
#include "internal/filter.h"
#include "internal/service.h"
#include "internal/monitor.h"
#include "internal/modules.h"
using std::set;
using std::string;

View File

@ -13,7 +13,7 @@
#include <maxscale/cppdefs.hh>
#include "maxscale/config_runtime.h"
#include "internal/config_runtime.h"
#include <strings.h>
#include <string>
@ -31,10 +31,10 @@
#include <maxscale/spinlock.h>
#include <maxscale/users.h>
#include "maxscale/config.h"
#include "maxscale/monitor.h"
#include "maxscale/modules.h"
#include "maxscale/service.h"
#include "internal/config.h"
#include "internal/monitor.h"
#include "internal/modules.h"
#include "internal/service.h"
typedef std::set<std::string> StringSet;

View File

@ -20,7 +20,7 @@
* the state data and pointers to other components that relate to the
* use of a file descriptor.
*/
#include "maxscale/dcb.h"
#include "internal/dcb.h"
#include <arpa/inet.h>
#include <errno.h>
@ -54,12 +54,12 @@
#include <maxscale/service.h>
#include <maxscale/spinlock.h>
#include <maxscale/utils.h>
#include <maxscale/semaphore.hh>
#include "maxscale/modules.h"
#include "maxscale/semaphore.hh"
#include "maxscale/session.h"
#include "maxscale/worker.hh"
#include "maxscale/workertask.hh"
#include "internal/modules.h"
#include "internal/session.h"
#include "internal/worker.hh"
#include "internal/workertask.hh"
using maxscale::Worker;
using maxscale::WorkerTask;

View File

@ -11,7 +11,7 @@
* Public License.
*/
#include "maxscale/externcmd.h"
#include "internal/externcmd.h"
#include <ctype.h>
#include <errno.h>

View File

@ -15,7 +15,7 @@
* @file filter.c - A representation of a filter within MaxScale.
*/
#include "maxscale/filter.h"
#include "internal/filter.h"
#include <stdio.h>
#include <stdlib.h>
@ -32,8 +32,8 @@
#include <maxscale/filter.hh>
#include <maxscale/json_api.h>
#include "maxscale/config.h"
#include "maxscale/modules.h"
#include "internal/config.h"
#include "internal/modules.h"
using std::string;
using std::set;

View File

@ -51,16 +51,16 @@
#include <maxscale/version.h>
#include <maxscale/random_jkiss.h>
#include "maxscale/config.h"
#include "maxscale/maxscale.h"
#include "maxscale/messagequeue.hh"
#include "maxscale/modules.h"
#include "maxscale/monitor.h"
#include "maxscale/poll.h"
#include "maxscale/service.h"
#include "maxscale/statistics.h"
#include "maxscale/admin.hh"
#include "maxscale/worker.hh"
#include "internal/config.h"
#include "internal/maxscale.h"
#include "internal/messagequeue.hh"
#include "internal/modules.h"
#include "internal/monitor.h"
#include "internal/poll.h"
#include "internal/service.h"
#include "internal/statistics.h"
#include "internal/admin.hh"
#include "internal/worker.hh"
using namespace maxscale;

View File

@ -11,8 +11,8 @@
* Public License.
*/
#include "maxscale/httprequest.hh"
#include "maxscale/admin.hh"
#include "internal/httprequest.hh"
#include "internal/admin.hh"
#include <ctype.h>
#include <string.h>

View File

@ -11,7 +11,7 @@
* Public License.
*/
#include "maxscale/httpresponse.hh"
#include "internal/httpresponse.hh"
#include <string>
#include <sstream>
@ -19,7 +19,7 @@
#include <maxscale/alloc.h>
#include <sys/time.h>
#include "maxscale/admin.hh"
#include "internal/admin.hh"
using std::string;
using std::stringstream;

View File

@ -15,7 +15,7 @@
* @file load_utils.c Utility functions for loading of modules
*/
#include "maxscale/modules.h"
#include "internal/modules.h"
#include <sys/param.h>
#include <stdio.h>
@ -32,8 +32,8 @@
#include <maxscale/json_api.h>
#include <maxscale/modulecmd.h>
#include "maxscale/modules.h"
#include "maxscale/config.h"
#include "internal/modules.h"
#include "internal/config.h"
typedef struct loaded_module
{

View File

@ -36,7 +36,7 @@
#include <maxscale/session.h>
#include <maxscale/spinlock.h>
#include <maxscale/utils.h>
#include "maxscale/mlist.h"
#include "internal/mlist.h"
#define MAX_PREFIXLEN 250
#define MAX_SUFFIXLEN 250

View File

@ -22,7 +22,7 @@
*
* @endverbatim
*/
#include "maxscale/secrets.h"
#include "internal/secrets.h"
#include <getopt.h>
#include <stdio.h>

View File

@ -34,7 +34,7 @@
#include <maxscale/log_manager.h>
#include <maxscale/random_jkiss.h>
#include "maxscale/secrets.h"
#include "internal/secrets.h"
#ifdef HAVE_GLIBC
struct option options[] =

View File

@ -11,7 +11,7 @@
* Public License.
*/
#include "maxscale/messagequeue.hh"
#include "internal/messagequeue.hh"
#include <errno.h>
#include <fcntl.h>
#include <string.h>
@ -19,7 +19,7 @@
#include <sys/utsname.h>
#include <maxscale/debug.h>
#include <maxscale/log_manager.h>
#include "maxscale/worker.hh"
#include "internal/worker.hh"
namespace
{

View File

@ -14,7 +14,7 @@
#include <maxscale/maxscale.h>
#include <time.h>
#include "maxscale/maxscale.h"
#include "internal/maxscale.h"
static time_t started;

View File

@ -11,7 +11,7 @@
* Public License.
*/
#include "maxscale/mlist.h"
#include "internal/mlist.h"
#include <maxscale/alloc.h>
static void mlist_free_memory(mlist_t* ml, char* name);

View File

@ -21,8 +21,8 @@
#include <maxscale/platform.h>
#include <maxscale/spinlock.h>
#include "maxscale/filter.h"
#include "maxscale/monitor.h"
#include "internal/filter.h"
#include "internal/monitor.h"
/** Size of the error buffer */
#define MODULECMD_ERRBUF_SIZE 512

View File

@ -37,13 +37,13 @@
#include <maxscale/secrets.h>
#include <maxscale/spinlock.h>
#include <maxscale/utils.h>
#include <maxscale/json_api.h>
#include <mysqld_error.h>
#include "maxscale/config.h"
#include "maxscale/externcmd.h"
#include "maxscale/monitor.h"
#include "maxscale/modules.h"
#include "maxscale/json_api.h"
#include "internal/config.h"
#include "internal/externcmd.h"
#include "internal/monitor.h"
#include "internal/modules.h"
/** Schema version, journals must have a matching version */
#define MMB_SCHEMA_VERSION 1

View File

@ -35,8 +35,8 @@
#include <maxscale/platform.h>
#include <maxscale/server.h>
#include <maxscale/statistics.h>
#include "maxscale/poll.h"
#include "maxscale/worker.hh"
#include "internal/poll.h"
#include "internal/worker.hh"
using maxscale::Worker;

View File

@ -11,16 +11,16 @@
* Public License.
*/
#include "maxscale/query_classifier.h"
#include "internal/query_classifier.h"
#include <maxscale/log_manager.h>
#include <maxscale/modutil.h>
#include <maxscale/alloc.h>
#include <maxscale/platform.h>
#include <maxscale/pcre2.h>
#include <maxscale/utils.h>
#include "maxscale/trxboundaryparser.hh"
#include "../core/maxscale/modules.h"
#include "internal/modules.h"
#include "internal/trxboundaryparser.hh"
//#define QC_TRACE_ENABLED
#undef QC_TRACE_ENABLED

View File

@ -10,7 +10,7 @@
* of this software will be governed by version 2 or later of the General
* Public License.
*/
#include "maxscale/resource.hh"
#include "internal/resource.hh"
#include <list>
#include <sstream>
@ -25,15 +25,15 @@
#include <maxscale/adminusers.h>
#include <maxscale/modulecmd.h>
#include "maxscale/httprequest.hh"
#include "maxscale/httpresponse.hh"
#include "maxscale/session.h"
#include "maxscale/filter.h"
#include "maxscale/monitor.h"
#include "maxscale/service.h"
#include "maxscale/config_runtime.h"
#include "maxscale/modules.h"
#include "maxscale/worker.h"
#include "internal/httprequest.hh"
#include "internal/httpresponse.hh"
#include "internal/session.h"
#include "internal/filter.h"
#include "internal/monitor.h"
#include "internal/service.h"
#include "internal/config_runtime.h"
#include "internal/modules.h"
#include "internal/worker.h"
using std::list;
using std::map;

View File

@ -25,7 +25,7 @@
#include <maxscale/random_jkiss.h>
#include <maxscale/utils.h>
#include "maxscale/secrets.h"
#include "internal/secrets.h"
/**
* Generate a random printable character

View File

@ -41,10 +41,10 @@
#include <maxscale/http.hh>
#include <maxscale/maxscale.h>
#include "maxscale/monitor.h"
#include "maxscale/poll.h"
#include "maxscale/workertask.hh"
#include "maxscale/worker.hh"
#include "internal/monitor.h"
#include "internal/poll.h"
#include "internal/workertask.hh"
#include "internal/worker.hh"
using maxscale::Semaphore;
using maxscale::Worker;

View File

@ -50,10 +50,10 @@
#include <maxscale/jansson.h>
#include <maxscale/json_api.h>
#include "maxscale/config.h"
#include "maxscale/filter.h"
#include "maxscale/modules.h"
#include "maxscale/service.h"
#include "internal/config.h"
#include "internal/filter.h"
#include "internal/modules.h"
#include "internal/service.h"
/** This define is needed in CentOS 6 systems */
#if !defined(UINT64_MAX)

View File

@ -37,11 +37,11 @@
#include <maxscale/utils.h>
#include <maxscale/json_api.h>
#include "maxscale/dcb.h"
#include "maxscale/session.h"
#include "maxscale/filter.h"
#include "maxscale/worker.hh"
#include "maxscale/workertask.hh"
#include "internal/dcb.h"
#include "internal/session.h"
#include "internal/filter.h"
#include "internal/worker.hh"
#include "internal/workertask.hh"
using std::string;
using std::stringstream;

View File

@ -27,7 +27,7 @@
#include <regex.h>
#include <maxscale/debug.h>
#include <sys/time.h>
#include "maxscale/skygw_utils.h"
#include "internal/skygw_utils.h"
#include <maxscale/atomic.h>
#include <maxscale/random_jkiss.h>
#include <pcre2.h>

View File

@ -23,7 +23,7 @@
* @endverbatim
*/
#include "maxscale/statistics.h"
#include "internal/statistics.h"
#include <string.h>
#include <maxscale/alloc.h>
#include <maxscale/config.h>

View File

@ -15,7 +15,7 @@
#include <iomanip>
#include <iostream>
#include <maxscale/paths.h>
#include "../maxscale/trxboundaryparser.hh"
#include "../internal/trxboundaryparser.hh"
using namespace std;

View File

@ -37,8 +37,8 @@
#include <maxscale/config.h>
#include <maxscale/listener.h>
#include "../maxscale/messagequeue.hh"
#include "../maxscale/worker.hh"
#include "../internal/messagequeue.hh"
#include "../internal/worker.hh"
#include "../dcb.cc"
/**

View File

@ -33,7 +33,7 @@
#include <stdlib.h>
#include <string.h>
#include "../maxscale/filter.h"
#include "../internal/filter.h"
/**

View File

@ -19,7 +19,7 @@
#include <stdlib.h>
#include <string.h>
#include <maxscale/alloc.h>
#include "../maxscale/skygw_utils.h"
#include "../internal/skygw_utils.h"
#include <maxscale/log_manager.h>
static void skygw_log_enable(int priority)

View File

@ -22,7 +22,7 @@
#include <maxscale/session.h>
#include <maxscale/json_api.h>
#include "../maxscale/monitor.h"
#include "../internal/monitor.h"
#define TEST(a, b) do{if (!(a)){printf("%s:%d " b "\n", __FILE__, __LINE__);return 1;}}while(false)

View File

@ -36,7 +36,7 @@
#include <maxscale/paths.h>
#include <maxscale/alloc.h>
#include "../maxscale/service.h"
#include "../internal/service.h"
#include "test_utils.h"
/**

View File

@ -16,7 +16,7 @@
#include <fstream>
#include <iostream>
#include <string>
#include "../maxscale/query_classifier.h"
#include "../internal/query_classifier.h"
#include <maxscale/alloc.h>
#include <maxscale/paths.h>
#include <maxscale/protocol/mysql.h>

View File

@ -17,7 +17,7 @@
#include <maxscale/modutil.h>
#include <maxscale/paths.h>
#include <maxscale/protocol/mysql.h>
#include "../core/maxscale/query_classifier.h"
#include "../core/internal/query_classifier.h"
using namespace std;

View File

@ -21,9 +21,9 @@
#include <maxscale/log_manager.h>
#include <maxscale/config.h>
#include "../maxscale/poll.h"
#include "../maxscale/statistics.h"
#include "../maxscale/worker.hh"
#include "../internal/poll.h"
#include "../internal/statistics.h"
#include "../internal/worker.hh"
void init_test_env(char *path)

View File

@ -11,7 +11,7 @@
* Public License.
*/
#include "maxscale/worker.hh"
#include "internal/worker.hh"
#include <errno.h>
#include <fcntl.h>
@ -31,11 +31,11 @@
#include <maxscale/json_api.h>
#include <maxscale/utils.hh>
#include "maxscale/dcb.h"
#include "maxscale/modules.h"
#include "maxscale/poll.h"
#include "maxscale/statistics.h"
#include "maxscale/workertask.hh"
#include "internal/dcb.h"
#include "internal/modules.h"
#include "internal/poll.h"
#include "internal/statistics.h"
#include "internal/workertask.hh"
#define WORKER_ABSENT_ID -1

View File

@ -11,7 +11,7 @@
* Public License.
*/
#include "maxscale/workertask.hh"
#include "internal/workertask.hh"
#include <maxscale/atomic.h>
#include <maxscale/debug.h>

View File

@ -12,8 +12,8 @@
*/
#include <maxscale/cppdefs.hh>
#include <maxscale/filtermodule.hh>
#include "../../../core/maxscale/modules.h"
#include "maxscale/filtermodule.hh"
#include "../../../core/internal/modules.h"
using std::auto_ptr;

View File

@ -11,8 +11,8 @@
* Public License.
*/
#include <maxscale/module.hh>
#include "../../../core/maxscale/modules.h"
#include "maxscale/module.hh"
#include "../../../core/internal/modules.h"
namespace maxscale
{

View File

@ -32,7 +32,7 @@
#include <maxscale/mysql_utils.h>
#include <maxscale/utils.h>
// TODO: For monitorAddParameters
#include "../../../core/maxscale/monitor.h"
#include "../../../core/internal/monitor.h"
/** Column positions for SHOW SLAVE STATUS */
#define MYSQL55_STATUS_MASTER_LOG_POS 5

View File

@ -15,7 +15,7 @@
#include <maxscale/utils.h>
// TODO: Find a way to cleanly expose this
#include "../../../core/maxscale/worker.hh"
#include "../../../core/internal/worker.hh"
#ifdef EPOLLRDHUP
#define ERROR_EVENTS (EPOLLRDHUP | EPOLLHUP | EPOLLERR)

View File

@ -49,7 +49,7 @@
#include <maxscale/version.h>
// This isn't really a clean way of testing
#include "../../../../core/maxscale/service.h"
#include "../../../../core/internal/service.h"
static void printVersion(const char *progname);
static void printUsage(const char *progname);

View File

@ -56,12 +56,12 @@
#include <debugcli.h>
#include "../../../core/maxscale/config_runtime.h"
#include "../../../core/maxscale/maxscale.h"
#include "../../../core/maxscale/modules.h"
#include "../../../core/maxscale/monitor.h"
#include "../../../core/maxscale/poll.h"
#include "../../../core/maxscale/session.h"
#include "../../../core/internal/config_runtime.h"
#include "../../../core/internal/maxscale.h"
#include "../../../core/internal/modules.h"
#include "../../../core/internal/monitor.h"
#include "../../../core/internal/poll.h"
#include "../../../core/internal/session.h"
#define MAXARGS 12

View File

@ -52,10 +52,10 @@
#include <maxscale/users.h>
#include <maxscale/protocol/mysql.h>
#include "../../../core/maxscale/modules.h"
#include "../../../core/maxscale/monitor.h"
#include "../../../core/maxscale/session.h"
#include "../../../core/maxscale/poll.h"
#include "../../../core/internal/modules.h"
#include "../../../core/internal/monitor.h"
#include "../../../core/internal/session.h"
#include "../../../core/internal/poll.h"
extern char *create_hex_sha1_sha1_passwd(char *passwd);

View File

@ -45,11 +45,11 @@
#include <maxscale/spinlock.h>
#include <maxscale/version.h>
#include "../../../core/maxscale/maxscale.h"
#include "../../../core/maxscale/modules.h"
#include "../../../core/maxscale/monitor.h"
#include "../../../core/maxscale/poll.h"
#include "../../../core/maxscale/session.h"
#include "../../../core/internal/maxscale.h"
#include "../../../core/internal/modules.h"
#include "../../../core/internal/monitor.h"
#include "../../../core/internal/poll.h"
#include "../../../core/internal/session.h"
static void exec_show(DCB *dcb, MAXINFO_TREE *tree);
static void exec_select(DCB *dcb, MAXINFO_TREE *tree);