Permalink
Browse files

Redesign towards new Alien::SDL (part 2)

  • Loading branch information...
1 parent 0e54be1 commit b10581afc033ed90d2f981854bbfff160442625d unknown committed Feb 16, 2010
Showing with 204 additions and 107 deletions.
  1. +20 −4 Build.PL
  2. +0 −4 inc/My/Builder/Cygwin.pm
  3. +0 −4 inc/My/Builder/Freebsd.pm
  4. +0 −4 inc/My/Builder/Gnukfreebsd.pm
  5. +0 −4 inc/My/Builder/MSWin32.pm
  6. +0 −4 inc/My/Builder/Netbsd.pm
  7. +0 −4 inc/My/Builder/Openbsd.pm
  8. +0 −4 inc/My/Builder/Solaris.pm
  9. +1 −1 inc/My/Builder/{Linux.pm → Unix.pm}
  10. +4 −0 inc/My/Builder/Windows.pm
  11. +0 −66 inc/My/Utility.pm
  12. +2 −1 lib/SDL.pm
  13. +4 −0 lib/SDL/Audio.pm
  14. +4 −0 lib/SDL/AudioCVT.pm
  15. +4 −0 lib/SDL/AudioSpec.pm
  16. +4 −0 lib/SDL/CD.pm
  17. +4 −0 lib/SDL/CDROM.pm
  18. +4 −0 lib/SDL/CDTrack.pm
  19. +4 −0 lib/SDL/Color.pm
  20. +4 −0 lib/SDL/Cursor.pm
  21. +4 −0 lib/SDL/Event.pm
  22. +4 −0 lib/SDL/Events.pm
  23. +4 −0 lib/SDL/GFX/BlitFunc.pm
  24. +4 −0 lib/SDL/GFX/FPSManager.pm
  25. +4 −0 lib/SDL/GFX/Framerate.pm
  26. +4 −0 lib/SDL/GFX/ImageFilter.pm
  27. +4 −0 lib/SDL/GFX/Primitives.pm
  28. +4 −0 lib/SDL/GFX/Rotozoom.pm
  29. +3 −0 lib/SDL/Image.pm
  30. +4 −0 lib/SDL/Joystick.pm
  31. +4 −0 lib/SDL/Mixer.pm
  32. +5 −0 lib/SDL/Mixer/Channels.pm
  33. +5 −0 lib/SDL/Mixer/Effects.pm
  34. +4 −0 lib/SDL/Mixer/Groups.pm
  35. +4 −0 lib/SDL/Mixer/MixChunk.pm
  36. +4 −0 lib/SDL/Mixer/MixMusic.pm
  37. +5 −0 lib/SDL/Mixer/Music.pm
  38. +4 −0 lib/SDL/Mixer/Samples.pm
  39. +4 −0 lib/SDL/MultiThread.pm
  40. +3 −0 lib/SDL/Net.pm
  41. +5 −0 lib/SDL/Net/IPaddress.pm
  42. +5 −0 lib/SDL/Net/TCP.pm
  43. +5 −0 lib/SDL/Net/UDP.pm
  44. +4 −0 lib/SDL/Overlay.pm
  45. +4 −0 lib/SDL/Palette.pm
  46. +4 −0 lib/SDL/PixelFormat.pm
  47. +4 −0 lib/SDL/RWOps.pm
  48. +4 −0 lib/SDL/Rect.pm
  49. +4 −0 lib/SDL/Surface.pm
  50. +4 −2 lib/SDL/TTF_Font.pm
  51. +4 −0 lib/SDL/Time.pm
  52. +4 −0 lib/SDL/Version.pm
  53. +4 −0 lib/SDL/Video.pm
  54. +4 −0 lib/SDL/VideoInfo.pm
  55. +5 −5 lib/SDL_perl.pm
View
@@ -20,8 +20,21 @@ at sdl-devel\@perl.org, or join us on #sdl in irc.perl.org
BROKENMSG
### we need the platform-specific module
-my $package = 'My::Builder::' . ucfirst( $^O );
-eval "require $package" or croak "No module for '$^O' platform: $@\n";
+my %platforms =(
+ MSWin32 => 'Windows',
+ MacOS => 'MacOS',
+ darwin => 'Darwin',
+ cygwin => 'Unix',
+ freebsd => 'Unix',
+ gnukfreebsd => 'Unix',
+ linux => 'Unix',
+ netbsd => 'Unix',
+ openbsd => 'Unix',
+ solaris => 'Unix',
+);
+my $package = 'My::Builder::' . ($platforms{$^O} || 'Unix');
+print "Gonna use '$package' class ...\n";
+eval "require $package" or croak "Require '$package' failed: $@\n";
### subsystems to build
# <subsystem>
@@ -441,12 +454,12 @@ my %libraries = (
GL => {
define => 'HAVE_GL',
header => 'GL/gl.h',
- lib => 'GL',
+ lib => ($^O eq 'MSWin32') ? 'opengl32' : 'GL', # xxx not nice
},
GLU => {
define => 'HAVE_GLU',
header => 'GL/glu.h',
- lib => 'GLU',
+ lib => ($^O eq 'MSWin32') ? 'glu32' : 'GLU', # xxx not nice
},
);
@@ -492,6 +505,9 @@ my $build_systems = $build->find_subsystems( \%subsystems, \%libraries );
### save info about available subsystems for future SDL::ConfigData
print "Gonna write config_data ...\n";
$build->config_data('SDL_cfg', $build_systems );
+$build->config_data('subsystems', \%subsystems);
+$build->config_data('libraries', \%libraries);
+$build->config_data('sdl_ld_shlib_map', Alien::SDL->config('ld_shlib_map'));
### something that was originally special to MacOS/Darwin
# somebody MacOS/Darwin friendly should review whether it is still necessary
View
@@ -1,4 +0,0 @@
-package My::Builder::Cygwin;
-use base 'My::Builder';
-
-1;
@@ -1,4 +0,0 @@
-package My::Builder::Freebsd;
-use base 'My::Builder';
-
-1;
@@ -1,4 +0,0 @@
-package My::Builder::Gnukfreebsd;
-use base 'My::Builder';
-
-1;
@@ -1,4 +0,0 @@
-package My::Builder::MSWin32;
-use base 'My::Builder';
-
-1;
View
@@ -1,4 +0,0 @@
-package My::Builder::Netbsd;
-use base 'My::Builder';
-
-1;
@@ -1,4 +0,0 @@
-package package My::Builder::Openbsd;
-use base 'My::Builder';
-
-1;
@@ -1,4 +0,0 @@
-package package My::Builder::Solaris;
-use base 'My::Builder';
-
-1;
@@ -1,4 +1,4 @@
-package My::Builder::Linux;
+package My::Builder::Unix;
use base 'My::Builder';
1;
@@ -0,0 +1,4 @@
+package My::Builder::Windows;
+use base 'My::Builder';
+
+1;
View
@@ -1,66 +0,0 @@
-package My::Utility;
-use strict;
-use warnings;
-use Carp;
-
-
-BEGIN{
- require Exporter;
- our @ISA = qw(Exporter);
- our @EXPORT_OK = qw(sdl_con_found sdl_libs sdl_c_flags);
-}
- my $has_alien = (eval { require Alien::SDL }) ? 1 : 0;
-
-use lib '../';
-#use SDL::Build;
-use File::Spec;
-
-#checks to see if sdl-config is availabe
-#
-sub sdl_con_found
-{
- 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
-sub check_sdl_dir
-{
- return 0 unless $ENV{SDL_INST_DIR} and return $ENV{SDL_INST_DIR};
-}
-
-sub not_installed_message
-{
- print STDERR <<MSG;
-********************************* !!!ERROR!!! *********************************
-SDL library not found.
-1) If you do not have SDL, you can download it from see http://www.libsdl.org/
-2) If you have already installed SDL, you can specify the location of your SDL
- installation by setting the enviroment variable SDL_INST_DIR.
-*******************************************************************************
-MSG
-}
-
-
-sub sdl_libs
-{
- return Alien::SDL->config('libs');
-}
-
-sub sdl_c_flags
-{
- return Alien::SDL->config('cflags');
-}
-
-sub sdl_shared_libs
-{
- return Alien::SDL->config('shared_libs');
-}
-
-sub sdl_check_feature
-{
- return Allien::SDL->check_feature(@_);
-}
-
-1;
View
@@ -45,9 +45,10 @@ use SDL::Constants;
BEGIN {
@ISA = qw(Exporter DynaLoader);
@EXPORT = qw( in &NULL );
- local $DynaLoader::dl_library_path = 'd:\strawberry\perl\site\lib\auto\share\dist\Alien-SDL\v0.8.0_16142bf4\c\bin';
};
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
# Give our caller SDL::Constant's stuff as well as ours.
sub import {
View
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::Audio;
1;
View
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::AudioCVT;
1;
View
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::AudioSpec;
1;
View
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::CD;
1;
View
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::CDROM;
1;
View
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::CDTrack;
1;
View
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::Color;
1;
View
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::Cursor;
1;
View
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::Event;
#sub CLONE_SKIP { 1 };
1;
View
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::Events;
our @EXPORT=qw(SDL_EVENTMASK);
View
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::GFX::BlitFunc;
1;
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::GFX::FPSManager;
1;
View
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::GFX::Framerate;
1;
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::GFX::ImageFilter;
1;
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::GFX::Primitives;
1;
View
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::GFX::Rotozoom;
1;
View
@@ -10,6 +10,9 @@ BEGIN {
@EXPORT = qw( IMG_INIT_JPG IMG_INIT_PNG IMG_INIT_TIF);
}
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::Image;
use constant
View
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::Joystick;
1;
View
@@ -4,6 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::Mixer;
1;
@@ -4,5 +4,10 @@ use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
+
+use SDL::Internal::Loader;
+internal_load_dlls(__PACKAGE__);
+
bootstrap SDL::Mixer::Channels;
+
1;
Oops, something went wrong.

0 comments on commit b10581a

Please sign in to comment.