X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=make%2Flib%2FSDL%2FUtility.pm;fp=make%2Flib%2FSDL%2FUtility.pm;h=94f5a82b7537979469acf53b32fcb7de67dfc64f;hb=2a6680669f5a19e0ce53b58722a7a5aaa53ad9c1;hp=a3e3272ca0517a9a0927ea269417b9abdef0cc43;hpb=d485953b55cb2bd56bbffb96a4f685f22c545861;p=sdlgit%2FSDL_perl.git diff --git a/make/lib/SDL/Utility.pm b/make/lib/SDL/Utility.pm index a3e3272..94f5a82 100644 --- a/make/lib/SDL/Utility.pm +++ b/make/lib/SDL/Utility.pm @@ -13,16 +13,15 @@ BEGIN{ use lib '../'; use SDL::Build; +use File::Spec; #checks to see if sdl-config is availabe # sub sdl_con_found { - return 0 if($^O eq 'MSWin32'); - - `sdl-config --libs`; - return 1 unless ($? >> 8) and return 0; - + my $devnull = File::Spec->devnull(); + `sdl-config --libs 2>$devnull`; + return 1 unless ($? >> 8) and return 0; } #This should check if the folder actually has the SDL files @@ -31,11 +30,25 @@ sub check_sdl_dir return 0 unless $ENV{SDL_INST_DIR} and return $ENV{SDL_INST_DIR}; } +sub not_installed_message +{ + print STDERR <devnull(); + local $_ = `sdl-config --libs 2>$devnull`; chomp($_); return $_; } @@ -46,6 +59,7 @@ sub sdl_libs else { #ask to download + not_installed_message; croak 'SDL not installed'; return 0; } @@ -55,8 +69,9 @@ sub sdl_c_flags { if(sdl_con_found) { - local $_ = `sdl-config --cflags`; - chomp($_); + my $devnull = File::Spec->devnull(); + local $_ = `sdl-config --cflags 2>$devnull`; + chomp($_); return $_; } elsif ( check_sdl_dir() ) @@ -66,6 +81,7 @@ sub sdl_c_flags else { #ask to download + not_installed_message ; croak 'SDL not installed'; } }