mpeppler/DBD-Sybase

use -libpath: on Windows, not -L [rt.cpan.org #91298]

Closed this issue · 0 comments

Migrated from rt.cpan.org#91298 (status was 'open')

Requestors:

From https://www.google.com/accounts/o8/id?id=AItOawlVEP5IYeRHpH3ZT4ELVsJ3INWz0Lpegpo on 2013-12-10 17:06:07
:

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

From https://www.google.com/accounts/o8/id?id=AItOawlVEP5IYeRHpH3ZT4ELVsJ3INWz0Lpegpo on 2014-01-16 11:39:00
:

See also #92196, which is closely releated.

I think there are two options to fix these two bugs:

1) use -L only
- apply the 2nd patch above
- apply the patch from 92196

2) use -libpath only
- apply the 1st patch above
- in 92196, remove the -L option altogether