Skip to content

Commit 7e1ce07

Browse files
committed
Makefile: Clearly report that MySQL 8.x is needed and do some cleanup
1 parent b77582d commit 7e1ce07

File tree

1 file changed

+6
-40
lines changed

1 file changed

+6
-40
lines changed

Makefile.PL

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ MSG
9595

9696
for my $key (qw/testdb testhost testuser testpassword testsocket testport
9797
cflags libs nocatchstderr nofoundrows
98-
ps-protocol bind-type-guessing /)
98+
ps-protocol bind-type-guessing version/)
9999
{
100100
Configure($opt, $source, $key);
101101
}
@@ -374,7 +374,6 @@ it can be found):
374374
375375
mysql_config --cflags
376376
mysql_config --libs
377-
mysql_config --testdb
378377
379378
and so on. See DBD::mysql::INSTALL for details.
380379
USAGE
@@ -446,13 +445,12 @@ sub Configure {
446445
$source->{ldflags} = "mysql_config";
447446
}
448447

449-
if ($command =~ /10.[34]/) {
450-
# MariaDB's mysql_config/mariadb_config reports the compile time
451-
# locations, not the install location. This results in issues for
452-
# dbdeployer etc. where these are not the same.
453-
my $installdir = substr(dirname($opt->{'mysql_config'}), 1, -4);
454-
$str =~ s#usr/local/mysql#$installdir#g;
448+
if ($param eq 'version') {
449+
if ($str !~ /^8\./) {
450+
die "DBD::mysql requires MySQL 8.x for building. Version reported by $command: $str";
451+
}
455452
}
453+
456454
$opt->{$param} = $str;
457455
$source->{$param} = "mysql_config";
458456
return;
@@ -572,38 +570,6 @@ sub SearchFor2 {
572570
}
573571
}
574572

575-
576-
sub check_include_version {
577-
578-
my ($dir, $ver) = @_;
579-
580-
my $headerfile;
581-
582-
$dir =~ s/-I//;
583-
$dir =~ s/'//g;
584-
$dir =~ s/\s.*//g;
585-
586-
open(HEADERFILE ,"<${dir}/mysql_version.h") or
587-
(print "Unable to open header file ${dir}/mysql_version.h" && exit(0));
588-
{
589-
local undef $/;
590-
$headerfile = <HEADERFILE>;
591-
}
592-
close(HEADERFILE);
593-
594-
my ($version_id) = ($headerfile =~ /MYSQL_VERSION_ID[\t\s]+(\d+)[\n\r]/);
595-
596-
if ($version_id < $ver)
597-
{
598-
print <<"MSG";
599-
600-
Version of MySQL include files in $dir - $1
601-
MSG
602-
return 0;
603-
}
604-
return 1;
605-
}
606-
607573
sub replace
608574
{
609575
my ($str, $ref)=@_;

0 commit comments

Comments
 (0)