Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: Clearly report that MySQL 8.x is needed and do some cleanup #366

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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