Skip to content

Commit

Permalink
Liblist::Kid needs to be able to recognize the compiler even if a ful…
Browse files Browse the repository at this point in the history
…ly qualified path is given in %Config.
  • Loading branch information
wchristian committed Apr 4, 2011
1 parent 8f85e8f commit 7a7513f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Changes
Expand Up @@ -2,6 +2,10 @@
VMS
* Fix prereq.t to work around "local %ENV = %ENV" bug

Win32
* Liblist::Kid can now recognize long compiler paths
(Christian Walde) [github #11]


6.57_10 Sun, 03 Apr 2011 19:36:38 +1000
Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions lib/ExtUtils/Liblist/Kid.pm
Expand Up @@ -259,8 +259,8 @@ sub _win32_ext {
my %libs_seen;
my @extralibs;
my $cc = $Config{cc} || '';
my $VC = $cc =~ /^cl/i;
my $GC = $cc =~ /^gcc/i;
my $VC = $cc =~ /\bcl\b/i;
my $GC = $cc =~ /\bgcc\b/i;
my $libext = _win32_lib_extensions();
my @searchpath = ( '' ); # from "-L/path" entries in $potential_libs
my @libpath = _win32_default_search_paths( $VC );
Expand Down
4 changes: 2 additions & 2 deletions t/Liblist_Kid.t
Expand Up @@ -132,15 +132,15 @@ sub test_kid_win32 {
is_deeply( [ _ext( 'test' ) ], [ 'test.meep', '', 'test.meep', '' ], '$Config{lib_ext} changes the lib extension to be searched for' );
delete $Config{lib_ext};

$Config{cc} = 'gcc';
$Config{cc} = 'C:/MinGW/bin/gcc.exe';

is_deeply( [ _ext( 'test' ) ], [ 'test.lib', '', 'test.lib', '' ], '[gcc] searching for straight lib names remains unchanged' );
is_deeply( [ _ext( '-l__test' ) ], [ 'lib__test.lib', '', 'lib__test.lib', '' ], '[gcc] lib-prefixed library files are found first when -l is in use' );
is_deeply( [ _ext( '-ltest' ) ], [ 'test.lib', '', 'test.lib', '' ], '[gcc] non-lib-prefixed library files are found on the second search when -l is in use' );
is_deeply( [ _ext( '-llibtest' ) ], [ 'test.lib', '', 'test.lib', '' ], '[gcc] if -l is used and the lib name is already prefixed a second search without the lib is done' );
is_deeply( [ _ext( ':nosearch -lunreal_test' ) ], [ '-lunreal_test', '', '-lunreal_test', '' ], '[gcc] lib names with -l after a :nosearch remain as they are' );

$Config{cc} = 'cl';
$Config{cc} = 'c:/Programme/Microsoft Visual Studio 9.0/VC/bin/cl.exe';

is_deeply( [ _ext( 'test' ) ], [ 'test.lib', '', 'test.lib', '' ], '[vc] searching for straight lib names remains unchanged' );
is_deeply( [ _ext( ':nosearch -Lunreal_test' ) ], [ '-libpath:unreal_test', '', '-libpath:unreal_test', '' ], '[vc] lib dirs with -L after a :nosearch are prefixed with -libpath:' );
Expand Down

0 comments on commit 7a7513f

Please sign in to comment.