diff --git a/Common/DStarDefines.h b/Common/DStarDefines.h index 9a0b1f0..e624cd1 100644 --- a/Common/DStarDefines.h +++ b/Common/DStarDefines.h @@ -15,7 +15,7 @@ #define DStarDefines_H #include -#include "GlobalDefines.h" +#include "../GlobalDefines.h" const unsigned int DSTAR_GMSK_SYMBOL_RATE = 4800U; const float DSTAR_GMSK_BT = 0.5F; diff --git a/GlobalDefines.h b/GlobalDefines.h index c83a798..d9a8a8c 100644 --- a/GlobalDefines.h +++ b/GlobalDefines.h @@ -1,11 +1,25 @@ #ifndef __GLOBAL_DEFS__ #define __GLOBAL_DEFS__ -#ifndef DATA_DIR -#define DATA_DIR "/etc/mmdvm/ircddbgateway" +#if defined(__APPLE__) +#define DATA_DIR "/etc/mmdvm/dstar" #define LOG_DIR "/var/log/mmdvm" #define CONF_DIR "/etc" -#define BIN_DIR "/usr/bin" -#endif +#define CONF_FILE "ircDDBGateway.ini" +#define LOG_BASE "ircDDBGateway" + +#elif defined(OPENWRT) && OPENWRT == 1 +#define DATA_DIR "/etc/mmdvm/dstar" +#define LOG_DIR "/var/log/mmdvm" +#define CONF_DIR "/etc" +#define CONF_FILE "ircDDBGateway.ini" +#define LOG_BASE "ircDDBGateway" + +#else +#define DATA_DIR "/usr/share/ircddbgateway" +#define LOG_DIR "/tmp" +#define CONF_DIR "/etc" +#define CONF_FILE "ircddbgateway" +#define LOG_BASE "ircddbgateway" #endif diff --git a/Makefile b/Makefile index e14b3d3..670c12d 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ - -# CXX := $(shell wx-config --cxx) -# CFLAGS := -O2 -Wall $(shell wx-config --cxxflags) -DLOG_DIR='$(LOGDIR)' -DCONF_DIR='$(CONFDIR)' -DDATA_DIR='$(DATADIR)' -# GUILIBS := $(shell wx-config --libs adv,core,base) -# LIBS := $(shell wx-config --libs base) -# LDFLAGS := +# export CXX ?= $(shell wx-config --cxx) +# export CFLAGS ?= -O2 -Wall $(shell wx-config --cxxflags) +# export GUILIBS ?= $(shell wx-config --libs adv,core,base) +# export LIBS ?= $(shell wx-config --libs base) +# export LDFLAGS ?= all: ircDDBGateway/ircddbgatewayd diff --git a/ircDDBGateway/IRCDDBGatewayAppD.cpp b/ircDDBGateway/IRCDDBGatewayAppD.cpp index 0132c92..556280b 100644 --- a/ircDDBGateway/IRCDDBGatewayAppD.cpp +++ b/ircDDBGateway/IRCDDBGatewayAppD.cpp @@ -42,13 +42,15 @@ #include #include +#include "../GlobalDefines.h" + const wxChar* NAME_PARAM = wxT("Gateway Name"); const wxChar* NOLOGGING_SWITCH = wxT("nolog"); const wxChar* LOGDIR_OPTION = wxT("logdir"); const wxChar* CONFDIR_OPTION = wxT("confdir"); const wxChar* DAEMON_SWITCH = wxT("daemon"); -const wxString LOG_BASE_NAME = wxT("ircddbgatewayd"); +const wxString LOG_BASE_NAME = wxT("LOG_BASE"); static CIRCDDBGatewayAppD* m_gateway = NULL; diff --git a/ircDDBGateway/IRCDDBGatewayDefs.h b/ircDDBGateway/IRCDDBGatewayDefs.h index db5a10c..7806c3b 100644 --- a/ircDDBGateway/IRCDDBGatewayDefs.h +++ b/ircDDBGateway/IRCDDBGatewayDefs.h @@ -20,10 +20,11 @@ #define IRCDDBGatewayDefs_H #include +#include "../GlobalDefines.h" const wxString APPLICATION_NAME = wxT("ircDDB Gateway"); -const wxString CONFIG_FILE_NAME = wxT("ircDDBGateway.ini"); +const wxString CONFIG_FILE_NAME = wxT(CONF_FILE); const wxString STATUS1_FILE_NAME = wxT("status1.txt"); const wxString STATUS2_FILE_NAME = wxT("status2.txt");