Subject: | use -libpath: on Windows, not -L |
On Windows, the link utility uses -libpath:, not -L, for specifying library paths. Please see patch below.
--- c:\temp\p4v\PRGDWM355382_qaperforce_1666\depot\QA\Toolbox\_priv\DBD-Sybase\CPAN\DBD-Sybase\1.11\src\Makefile#1.PL 2013-11-14 15:37:21.000000000 +-0100
+++ c:\p4_ws\0toolbox\_priv\DBD-Sybase\CPAN\DBD-Sybase\1.11\src\Makefile.PL 2013-12-10 17:46:37.000000000 +-0100
@@ -35,16 +35,17 @@
$| = 1;
configure();
configPwd();
+my $libpathOpt = $^O eq 'MSWin32' ? 'libpath:' : 'L';
my $lddlflags = $Config{lddlflags};
-$lddlflags = "-L$SYBASE/$libdir $lddlflags" unless $^O eq 'VMS';
+$lddlflags = "-$libpathOpt$SYBASE/$libdir $lddlflags" unless $^O eq 'VMS';
my $ldflags = $Config{ldflags};
-$ldflags = "-L$SYBASE/$libdir $ldflags" unless $^O eq 'VMS';
+$ldflags = "-$libpathOpt$SYBASE/$libdir $ldflags" unless $^O eq 'VMS';
WriteMakefile(
'NAME' => 'DBD::Sybase',
LIBS => [$lib_string],
INC => $inc_string,
clean => { FILES => "Sybase.xsi $written_pwd_file" },
Without this change, link produces a warning about "unknown option /L."
That raises another issue: this is only a warning but the linking still succeeds because the link command-line contains the full path to libct.lib. Maybe we needn't extend LDDLFLAGS at all on Windows? Here's a patch for that:
--- c:\temp\p4v\PRGDWM355382_qaperforce_1666\depot\QA\Toolbox\main.br\CPAN\DBD-Sybase\1.15\src\Makefile#1.PL 2013-12-10 18:05:42.000000000 +-0100
+++ c:\p4_ws\0toolbox\main.br\CPAN\DBD-Sybase\1.15\src\Makefile.PL 2013-12-10 18:05:15.000000000 +-0100
@@ -36,15 +36,17 @@
configure();
configPwd();
my $lddlflags = $Config{lddlflags};
-$lddlflags = "-L$SYBASE/$libdir $lddlflags" unless $^O eq 'VMS';
+$lddlflags = "-L$SYBASE/$libdir $lddlflags"
+ unless $^O eq 'VMS' || $^O eq 'MSWin32';
my $ldflags = $Config{ldflags};
-$ldflags = "-L$SYBASE/$libdir $ldflags" unless $^O eq 'VMS';
+$ldflags = "-L$SYBASE/$libdir $ldflags"
+ unless $^O eq 'VMS' || $^O eq 'MSWin32';
WriteMakefile(
'NAME' => 'DBD::Sybase',
LIBS => [$lib_string],
INC => $inc_string,
clean => { FILES => "Sybase.xsi $written_pwd_file" },
Sam