8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 21:23:04 +01:00

Allow to configure Firebird in posix using relative directories with options --with-fb* (#7918)

* Allow to configure Firebird in posix using relative directories with options --with-fb*.

Relative directories will be interpreted based in the runtime root prefix.
This commit is contained in:
Adriano dos Santos Fernandes 2023-12-14 07:23:07 -03:00 committed by GitHub
parent e3465b14ba
commit 6f33e54648
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 7 deletions

View File

@ -26,9 +26,19 @@ dnl XE_CONF_DIR(param, help, variable, default)
define([XE_CONF_DIR],[
AC_ARG_WITH([$1],
[AS_HELP_STRING([--with-$1],[$2])],
[[$3]="$withval"
CHANGE_PATH_SUPPORT=no
AC_DEFINE_UNQUOTED([$3], "$[$3]", [$2])],
[
case "$withval" in
/*)
CHANGE_PATH_SUPPORT=no
[$3]="$withval"
;;
*)
[$3]='${fb_install_prefix}'/"${withval}"
;;
esac
AC_DEFINE_UNQUOTED([$3], "${withval}", [$2])
],
[[$3]='${fb_install_prefix}[$4]'
AC_DEFINE_UNQUOTED([$3], [""], [$2])]
)

View File

@ -121,7 +121,9 @@ namespace
PathName temp;
// Could not call fb_utils::getPrefix here.
if (FB_TZDATADIR[0])
if (FB_TZDATADIR[0] && PathUtils::isRelative(FB_TZDATADIR))
PathUtils::concatPath(temp, Config::getRootDirectory(), FB_TZDATADIR);
else if (FB_TZDATADIR[0])
temp = FB_TZDATADIR;
else
{

View File

@ -1232,10 +1232,18 @@ Firebird::PathName getPrefix(unsigned int prefType, const char* name)
{
if (prefType != Firebird::IConfigManager::DIR_CONF &&
prefType != Firebird::IConfigManager::DIR_MSG &&
prefType != Firebird::IConfigManager::DIR_TZDATA &&
configDir[prefType][0])
{
// Value is set explicitly and is not environment overridable
PathUtils::concatPath(s, configDir[prefType], name);
if (PathUtils::isRelative(s))
{
gds__prefix(tmp, s.c_str());
return tmp;
}
return s;
}
}
@ -1316,11 +1324,11 @@ Firebird::PathName getPrefix(unsigned int prefType, const char* name)
}
if (s.hasData() && name[0])
{
s += PathUtils::dir_sep;
}
s += name;
gds__prefix(tmp, s.c_str());
return tmp;
#endif
}

View File

@ -4146,7 +4146,10 @@ public:
Firebird::PathName msgPrefix;
if (!fb_utils::readenv(FB_MSG_ENV, msgPrefix))
{
msgPrefix = FB_MSGDIR[0] ? FB_MSGDIR : prefix;
if (FB_MSGDIR[0] && PathUtils::isRelative(FB_MSGDIR))
PathUtils::concatPath(msgPrefix, prefix, FB_MSGDIR);
else
msgPrefix = FB_MSGDIR[0] ? FB_MSGDIR : prefix;
}
msgPrefix.copyTo(fb_prefix_msg_val, sizeof(fb_prefix_msg_val));
fb_prefix_msg = fb_prefix_msg_val;