Skip to content

Commit 5dda0a5

Browse files
author
Tor Didriksen
committed
WL#10524 Dynamic Linking of OpenSSL in MySQL Server
Adapt to WL#10441
1 parent b88808f commit 5dda0a5

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

sql/mysqld.cc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7958,6 +7958,23 @@ static int mysql_init_variables()
79587958
// sandbox build.
79597959
strcat(prg_dev,"/../"); // Remove containing directory to get base dir
79607960
cleanup_dirname(mysql_home, prg_dev);
7961+
7962+
// New layout: <cmake_binary_dir>/runtime_output_directory/<buildconfig>/
7963+
char cmake_binary_dir[FN_REFLEN];
7964+
size_t dlen= 0;
7965+
dirname_part(cmake_binary_dir, mysql_home, &dlen);
7966+
if (dlen > 26U &&
7967+
(!strcmp(cmake_binary_dir + (dlen - 26), "/runtime_output_directory/") ||
7968+
!strcmp(cmake_binary_dir + (dlen - 26), "\\runtime_output_directory\\")))
7969+
{
7970+
mysql_home[strlen(mysql_home) - 1]= '\0'; // remove trailing
7971+
dirname_part(cmake_binary_dir, mysql_home, &dlen);
7972+
strcat(cmake_binary_dir, "sql\\");
7973+
strmake(mysql_home, cmake_binary_dir, sizeof(mysql_home) - 1);
7974+
}
7975+
// The sql_print_information below outputs nothing ??
7976+
// fprintf(stderr, "mysql_home %s\n", mysql_home);
7977+
// fflush(stderr);
79617978
#else
79627979
const char *tmpenv= getenv("MY_BASEDIR_VERSION");
79637980
if (tmpenv != nullptr)
@@ -7979,6 +7996,15 @@ static int mysql_init_variables()
79797996
}
79807997
strmake(mysql_home, progdir, sizeof(mysql_home) - 1);
79817998
}
7999+
else if (dlen > 26U &&
8000+
!strcmp(progdir + (dlen - 26), "/runtime_output_directory/"))
8001+
{
8002+
char cmake_binary_dir[FN_REFLEN];
8003+
progdir[strlen(progdir) - 1]= '\0'; // remove trailing "/"
8004+
dirname_part(cmake_binary_dir, progdir, &dlen);
8005+
strcat(cmake_binary_dir, "sql/");
8006+
strmake(mysql_home, cmake_binary_dir, sizeof(mysql_home) - 1);
8007+
}
79828008
else
79838009
{
79848010
strcat(progdir, "/../");

0 commit comments

Comments
 (0)