Skip to content

Commit

Permalink
Makefile: Clearly report that MySQL 8.x is needed and do some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dveeden committed Oct 13, 2023
1 parent b77582d commit 7e1ce07
Showing 1 changed file with 6 additions and 40 deletions.
46 changes: 6 additions & 40 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ MSG

for my $key (qw/testdb testhost testuser testpassword testsocket testport
cflags libs nocatchstderr nofoundrows
ps-protocol bind-type-guessing /)
ps-protocol bind-type-guessing version/)
{
Configure($opt, $source, $key);
}
Expand Down Expand Up @@ -374,7 +374,6 @@ it can be found):
mysql_config --cflags
mysql_config --libs
mysql_config --testdb
and so on. See DBD::mysql::INSTALL for details.
USAGE
Expand Down Expand Up @@ -446,13 +445,12 @@ sub Configure {
$source->{ldflags} = "mysql_config";
}

if ($command =~ /10.[34]/) {
# MariaDB's mysql_config/mariadb_config reports the compile time
# locations, not the install location. This results in issues for
# dbdeployer etc. where these are not the same.
my $installdir = substr(dirname($opt->{'mysql_config'}), 1, -4);
$str =~ s#usr/local/mysql#$installdir#g;
if ($param eq 'version') {
if ($str !~ /^8\./) {
die "DBD::mysql requires MySQL 8.x for building. Version reported by $command: $str";
}
}

$opt->{$param} = $str;
$source->{$param} = "mysql_config";
return;
Expand Down Expand Up @@ -572,38 +570,6 @@ sub SearchFor2 {
}
}


sub check_include_version {

my ($dir, $ver) = @_;

my $headerfile;

$dir =~ s/-I//;
$dir =~ s/'//g;
$dir =~ s/\s.*//g;

open(HEADERFILE ,"<${dir}/mysql_version.h") or
(print "Unable to open header file ${dir}/mysql_version.h" && exit(0));
{
local undef $/;
$headerfile = <HEADERFILE>;
}
close(HEADERFILE);

my ($version_id) = ($headerfile =~ /MYSQL_VERSION_ID[\t\s]+(\d+)[\n\r]/);

if ($version_id < $ver)
{
print <<"MSG";
Version of MySQL include files in $dir - $1
MSG
return 0;
}
return 1;
}

sub replace
{
my ($str, $ref)=@_;
Expand Down

0 comments on commit 7e1ce07

Please sign in to comment.