9 our @ISA = qw(Exporter);
10 our @EXPORT_OK = qw(sdl_con_found sdl_libs sdl_c_flags);
12 my $arch = SDL::Build->get_arch( $^O );
18 #checks to see if sdl-config is availabe
22 my $devnull = File::Spec->devnull();
23 `sdl-config --libs 2>$devnull`;
24 return 1 unless ($? >> 8) and return 0;
27 #This should check if the folder actually has the SDL files
30 return 0 unless $ENV{SDL_INST_DIR} and return $ENV{SDL_INST_DIR};
33 sub not_installed_message
36 ********************************* !!!ERROR!!! *********************************
37 SDL library not found.
38 1) If you do not have SDL, you can download it from see http://www.libsdl.org/
39 2) If you have already installed SDL, you can specify the location of your SDL
40 installation by setting the enviroment variable SDL_INST_DIR.
41 *******************************************************************************
50 my $devnull = File::Spec->devnull();
51 local $_ = `sdl-config --libs 2>$devnull`;
55 elsif( check_sdl_dir() )
57 return $arch->alt_link_flags( check_sdl_dir() ) ;
62 not_installed_message;
63 croak 'SDL not installed';
72 my $devnull = File::Spec->devnull();
73 local $_ = `sdl-config --cflags 2>$devnull`;
77 elsif ( check_sdl_dir() )
79 return $arch->alt_compile_flags( check_sdl_dir() );
84 not_installed_message ;
85 croak 'SDL not installed';