129 lines
4.3 KiB
Diff
129 lines
4.3 KiB
Diff
diff --git a/src/common/utils.cpp b/src/common/utils.cpp
|
|
index d16cc62..e6d8dca 100644
|
|
--- a/src/common/utils.cpp
|
|
+++ b/src/common/utils.cpp
|
|
@@ -47,6 +47,7 @@
|
|
#include "../common/classes/locks.h"
|
|
#include "../common/classes/init.h"
|
|
#include "../common/isc_proto.h"
|
|
+#include "../common/pathtools.h"
|
|
#include "../jrd/constants.h"
|
|
#include "firebird/impl/inf_pub.h"
|
|
#include "../jrd/align.h"
|
|
@@ -1220,9 +1221,30 @@ Firebird::PathName getPrefix(unsigned int prefType, const char* name)
|
|
char tmp[MAXPATHLEN];
|
|
|
|
const char* configDir[] = {
|
|
+#ifdef MINGW
|
|
+ single_path_relocation(FB_BINDIR,FB_BINDIR),
|
|
+ single_path_relocation(FB_BINDIR,FB_SBINDIR),
|
|
+ single_path_relocation(FB_BINDIR,FB_CONFDIR),
|
|
+ single_path_relocation(FB_BINDIR,FB_LIBDIR),
|
|
+ single_path_relocation(FB_BINDIR,FB_INCDIR),
|
|
+ single_path_relocation(FB_BINDIR,FB_DOCDIR),
|
|
+ single_path_relocation(FB_BINDIR,""),
|
|
+ single_path_relocation(FB_BINDIR,FB_SAMPLEDIR),
|
|
+ single_path_relocation(FB_BINDIR,FB_SAMPLEDBDIR),
|
|
+ single_path_relocation(FB_BINDIR,""),
|
|
+ single_path_relocation(FB_BINDIR,FB_INTLDIR),
|
|
+ single_path_relocation(FB_BINDIR,FB_MISCDIR),
|
|
+ single_path_relocation(FB_BINDIR,FB_SECDBDIR),
|
|
+ single_path_relocation(FB_BINDIR,FB_MSGDIR),
|
|
+ single_path_relocation(FB_BINDIR,FB_LOGDIR),
|
|
+ single_path_relocation(FB_BINDIR,FB_GUARDDIR),
|
|
+ single_path_relocation(FB_BINDIR,FB_PLUGDIR),
|
|
+ single_path_relocation(FB_BINDIR,FB_TZDATADIR)
|
|
+#else
|
|
FB_BINDIR, FB_SBINDIR, FB_CONFDIR, FB_LIBDIR, FB_INCDIR, FB_DOCDIR, "", FB_SAMPLEDIR,
|
|
FB_SAMPLEDBDIR, "", FB_INTLDIR, FB_MISCDIR, FB_SECDBDIR, FB_MSGDIR, FB_LOGDIR,
|
|
FB_GUARDDIR, FB_PLUGDIR, FB_TZDATADIR
|
|
+#endif
|
|
};
|
|
|
|
fb_assert(FB_NELEM(configDir) == Firebird::IConfigManager::DIR_COUNT);
|
|
diff --git a/src/yvalve/config/os/win32/config_root.cpp b/src/yvalve/config/os/win32/config_root.cpp
|
|
index 3658ee3..c3d9fde 100644
|
|
--- a/src/yvalve/config/os/win32/config_root.cpp
|
|
+++ b/src/yvalve/config/os/win32/config_root.cpp
|
|
@@ -28,6 +28,7 @@
|
|
#include "fb_types.h"
|
|
#include "../../../../common/classes/fb_string.h"
|
|
#include "../../../../common/dllinst.h"
|
|
+#include "../../../../common/pathtools.h"
|
|
#include "../../../../yvalve/config/os/config_root.h"
|
|
|
|
using Firebird::PathName;
|
|
@@ -60,7 +61,11 @@ bool getPathFromHInstance(PathName& root)
|
|
|
|
void ConfigRoot::osConfigRoot()
|
|
{
|
|
+#ifdef MINGW
|
|
+ root_dir = single_path_relocation(FB_BINDIR,FB_PREFIX);
|
|
+#else
|
|
root_dir = install_dir;
|
|
+#endif
|
|
}
|
|
|
|
void ConfigRoot::osConfigInstallDir()
|
|
@@ -107,7 +112,11 @@ void ConfigRoot::osConfigInstallDir()
|
|
if (install_dir.isEmpty())
|
|
{
|
|
// As a last resort get it from the default install directory
|
|
+#ifdef MINGW
|
|
+ install_dir = single_path_relocation(FB_BINDIR,FB_PREFIX);
|
|
+#else
|
|
install_dir = FB_PREFIX;
|
|
+#endif
|
|
}
|
|
|
|
PathUtils::ensureSeparator(install_dir);
|
|
diff --git a/src/yvalve/gds.cpp b/src/yvalve/gds.cpp
|
|
index 6d5149e..b66c627 100644
|
|
--- a/src/yvalve/gds.cpp
|
|
+++ b/src/yvalve/gds.cpp
|
|
@@ -64,6 +64,10 @@
|
|
#include "../common/ThreadStart.h"
|
|
#include "../common/Int128.h"
|
|
|
|
+#ifdef MINGW
|
|
+#include "../common/pathtools.h"
|
|
+#endif
|
|
+
|
|
#ifdef HAVE_UNISTD_H
|
|
#include <unistd.h>
|
|
#endif
|
|
@@ -4080,13 +4084,21 @@ public:
|
|
{
|
|
prefix = Firebird::Config::getRootDirectory();
|
|
if (prefix.isEmpty() && !GetProgramFilesDir(prefix))
|
|
+#ifdef MINGW
|
|
+ prefix = FB_CONFDIR[0] ? single_path_relocation(FB_BINDIR,FB_CONFDIR) : single_path_relocation(FB_BINDIR,FB_PREFIX);
|
|
+#else
|
|
prefix = FB_CONFDIR[0] ? FB_CONFDIR : FB_PREFIX;
|
|
+#endif
|
|
}
|
|
catch (const Firebird::Exception&)
|
|
{
|
|
// CVC: Presumably here we failed because the config file can't be located.
|
|
if (!GetProgramFilesDir(prefix))
|
|
+#ifdef MINGW
|
|
+ prefix = FB_CONFDIR[0] ? single_path_relocation(FB_BINDIR,FB_CONFDIR) : single_path_relocation(FB_BINDIR,FB_PREFIX);
|
|
+#else
|
|
prefix = FB_CONFDIR[0] ? FB_CONFDIR : FB_PREFIX;
|
|
+#endif
|
|
}
|
|
prefix.copyTo(fb_prefix_val, sizeof(fb_prefix_val));
|
|
fb_prefix = fb_prefix_val;
|
|
@@ -4149,7 +4161,11 @@ public:
|
|
if (FB_MSGDIR[0] && PathUtils::isRelative(FB_MSGDIR))
|
|
PathUtils::concatPath(msgPrefix, prefix, FB_MSGDIR);
|
|
else
|
|
+#ifdef MINGW
|
|
+ msgPrefix = FB_MSGDIR[0] ? single_path_relocation(FB_BINDIR,FB_MSGDIR) : prefix;
|
|
+#else
|
|
msgPrefix = FB_MSGDIR[0] ? FB_MSGDIR : prefix;
|
|
+#endif
|
|
}
|
|
msgPrefix.copyTo(fb_prefix_msg_val, sizeof(fb_prefix_msg_val));
|
|
fb_prefix_msg = fb_prefix_msg_val;
|