Subject: | Makefile.PL - fix error message and Windows detection |
Between 1.11 and 1.15, the Makefile.PL has changed to look for the SYBASE libraries under %SYBASE%\dll on Windows. Unfortunately, when the dll directory doesn't exist, the error message still prints "cannot find $SYBASE/lib or $SYBASE/lib64" which is misleading.
The patch fixes the error message. It also fixes the Darwin-related problem reported by Anthony (#89816).
--- c:\temp\p4v\PRGDWM355382_qaperforce_1666\depot\QA\Toolbox\main.br\CPAN\DBD-Sybase\1.15\src\Makefile#1.PL 2014-01-15 11:44:56.000000000 +-0100
+++ c:\p4_ws\0toolbox\main.br\CPAN\DBD-Sybase\1.15\src\Makefile.PL 2014-01-15 11:39:44.000000000 +-0100
@@ -136,27 +136,28 @@
$SYBASE .= "/$ENV{SYBASE_OCS}";
}
}
my $libfound = 0;
my $libsub = '';
- my @libdir = ( 'lib', 'lib64' );
- if ($^O =~ /win/i) {
- @libdir = ( 'dll' );
- }
+ my @libdir = ( 'lib', 'lib64' );
+ if ($^O eq 'MSWin32') {
+ @libdir = ( 'dll' );
+ }
foreach $libdir ( @libdir ) {
if ( -d "$SYBASE/$libdir" ) {
if ( checkLib($SYBASE) ) {
$libfound = 1;
$libsub = $libdir;
}
}
}
- die "Can't find any Sybase libraries in $SYBASE/lib or $SYBASE/lib64"
- unless $libfound;
+ die "Can't find any Sybase libraries in " .
+ join(' or ', map "$SYBASE/$_", @libdir)
+ unless $libfound;
my $inc_found = 0;
if ( -d "$SYBASE/include" && -f "$SYBASE/include/cspublic.h" ) {
++$inc_found;
$inc_string = "-I$SYBASE/include";
}