Made sure that Build knows if sdl-config exists
[sdlgit/SDL_perl.git] / inc / Utility.pm
CommitLineData
33710f4e 1package inc::Utility;
2use strict;
3use warnings;
4use Carp;
5
6BEGIN{
7 require Exporter;
8 our @ISA = qw(Exporter);
9 our @EXPORT_OK = qw(sdl_con_found sdl_libs sdl_c_flags);
10}
11
12#checks to see if sdl-config is availabe
13#
14sub sdl_con_found
15{
16 `sdl-config --libs`;
17 return 0 if ($? >> 8);
18 return 1;
19}
20
21sub sdl_libs
22{
23 if(sdl_con_found)
24 {
25 local $_ = `sdl-config --libs`;
26 return chomp($_);
27 }
28 else
29 {
30 return undef;
31 }
32}
33
34sub sdl_c_flags
35{
36 if(sdl_con_found)
37 {
38 local $_ = `sdl-config --cflags`;
39 return chomp($_);
40 }
41 else
42 {
43 return undef;
44 }
45}
46
471;