From 7a7513fbcc9055c86bd4373d0a1aec2282070201 Mon Sep 17 00:00:00 2001 From: Christian Walde Date: Tue, 5 Apr 2011 00:36:48 +0200 Subject: [PATCH] Liblist::Kid needs to be able to recognize the compiler even if a fully qualified path is given in %Config. --- Changes | 4 ++++ lib/ExtUtils/Liblist/Kid.pm | 4 ++-- t/Liblist_Kid.t | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index 504546119..46a2339a4 100644 --- a/Changes +++ b/Changes @@ -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 diff --git a/lib/ExtUtils/Liblist/Kid.pm b/lib/ExtUtils/Liblist/Kid.pm index d0da4e1ef..da2e5b93e 100644 --- a/lib/ExtUtils/Liblist/Kid.pm +++ b/lib/ExtUtils/Liblist/Kid.pm @@ -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 ); diff --git a/t/Liblist_Kid.t b/t/Liblist_Kid.t index af271f10c..522bdca70 100644 --- a/t/Liblist_Kid.t +++ b/t/Liblist_Kid.t @@ -132,7 +132,7 @@ 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' ); @@ -140,7 +140,7 @@ sub test_kid_win32 { 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:' );