summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-04-02 16:41:26 +0100
committerSadie Powell <sadie@witchery.services>2024-04-02 16:45:49 +0100
commit87a8af0ad71a11c248ba94c9ba20668dcb0fe831 (patch)
tree32359dfc4094c20e24b79c116d659c0167e0ccc8
parent4691dfa3f0b91e8cca1ebc8905c5f0bc08688b6b (diff)
Use the paths from the build system instead of hardcoding them.
-rw-r--r--include/sysconf.h.cmake15
-rw-r--r--src/init.cpp6
2 files changed, 20 insertions, 1 deletions
diff --git a/include/sysconf.h.cmake b/include/sysconf.h.cmake
index 927c75910..5605976f9 100644
--- a/include/sysconf.h.cmake
+++ b/include/sysconf.h.cmake
@@ -20,6 +20,21 @@
// Whether Anope was built in debug mode.
#cmakedefine01 DEBUG_BUILD
+// The default config directory.
+#define DEFAULT_CONF_DIR "@CONF_DIR@"
+
+// The default data directory.
+#define DEFAULT_DATA_DIR "@DB_DIR@"
+
+// The default locale directory.
+#define DEFAULT_LOCALE_DIR "@LOCALE_DIR@"
+
+// The default log directory.
+#define DEFAULT_LOG_DIR "@LOGS_DIR@"
+
+// The default module directory.
+#define DEFAULT_MODULE_DIR "@LIB_DIR@"
+
// Whether the clock_gettime() function is available.
#cmakedefine01 HAVE_CLOCK_GETTIME
diff --git a/src/init.cpp b/src/init.cpp
index df53ee908..7c760d1af 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -30,7 +30,11 @@
#endif
#include <thread>
-Anope::string Anope::ConfigDir = "conf", Anope::DataDir = "data", Anope::ModuleDir = "lib", Anope::LocaleDir = "locale", Anope::LogDir = "logs";
+Anope::string Anope::ConfigDir = DEFAULT_CONF_DIR;
+Anope::string Anope::DataDir = DEFAULT_DATA_DIR;
+Anope::string Anope::LocaleDir = DEFAULT_LOCALE_DIR;
+Anope::string Anope::LogDir = DEFAULT_LOG_DIR;
+Anope::string Anope::ModuleDir = DEFAULT_MODULE_DIR;
/* Vector of pairs of command line arguments and their params */
static std::vector<std::pair<Anope::string, Anope::string> > CommandLineArguments;