Skip to content

Commit 66a97ae

Browse files
palichoroba
authored andcommitted
Add new Makefile.PL option --requireembsup
This new Makefile.PL option --requireembsup or the new ENV variable DBD_MARIADB_REQUIREEMBSUP=1 cause that Makefile.PL will fail if the Embedded server is not supported by client library. This allows build scripts to verify that the correct client library is used for compiling the DBD-MariaDB.
1 parent 24f99ef commit 66a97ae

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

Makefile.PL

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Getopt::Long::GetOptions(
5555
"testembdatadir:s",
5656
"testemboptions:s",
5757
"testauthplugin:s",
58+
"requireembsup!",
5859
"cflags:s",
5960
"libs:s",
6061
"mysql_config:s",
@@ -110,6 +111,21 @@ MSG
110111
}
111112
}
112113

114+
if (exists $opt->{requireembsup})
115+
{
116+
$source->{'requireembsup'} = "User's choice";
117+
}
118+
elsif (defined $ENV{'DBD_MARIADB_REQUIREEMBSUP'})
119+
{
120+
$source->{'requireembsup'} = 'environment';
121+
$opt->{'requireembsup'} = !!$ENV{DBD_MARIADB_REQUIREEMBSUP};
122+
}
123+
else
124+
{
125+
$source->{'requireembsup'} = 'default';
126+
$opt->{'requireembsup'} = 0;
127+
}
128+
113129
for my $key (qw(testdb testhost testuser testpassword testsocket testport testembdatadir testemboptions testauthplugin cflags libs))
114130
{
115131
Configure($opt, $source, $key);
@@ -301,11 +317,11 @@ my $have_embedded = check_lib(
301317

302318
print "Embedded server: " . ($have_embedded ? "supported" : "not supported by client library") . "\n\n";
303319

304-
if (!$have_embedded && $opt->{testhost} eq 'embedded') {
320+
if (!$have_embedded && ($opt->{testhost} eq 'embedded' || $opt->{requireembsup})) {
305321
die << "MSG";
306322
Cannot run test suite against Embedded server (specified via
307-
option --testhost=embedded) because Embedded server is not
308-
supported by client library.
323+
option --testhost=embedded or option --requireembsup) because
324+
Embedded server is not supported by client library.
309325
MSG
310326
}
311327

@@ -726,6 +742,7 @@ Possible options are:
726742
--testauthplugin=<ap> Use <ap> auth plugin when doing user authentication
727743
handshake with server; for older server versions it is
728744
needed to pass "mysql_native_password"
745+
--requireembsup Require client library with embedded server support
729746
--mariadb_config Synonym for --mysql_config, override it
730747
--mysql_config=<path> Specify <path> for mariadb_config or mysql_config script
731748
--help Print this message and exit

0 commit comments

Comments
 (0)