Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 183 lines (167 sloc) 4.508 kb
85fcc9e @kthakore Fixed v2.2.0
kthakore authored
1 #! perl -w
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
2 #
85fcc9e @kthakore Fixed v2.2.0
kthakore authored
3 # Copyright (C) 2003 chromatic
4 # Copyright (C) 2004 David J. Goehrig
5 # Copyright (C) 2009 Kartik Thakore
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
6
7 use strict;
084b921 @kthakore Brought all packages under eye of strict, warnings and love of Carp, For
kthakore authored
8 use warnings;
9 use Carp;
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
10 use lib 'make/lib';
11
0cdd4aa @cthulhuology Tweaked a few setting on the Mac OS X build system to locate Mac Ports l...
cthulhuology authored
12 use Data::Dumper;
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
13 use SDL::Build;
9632eaf @kthakore Add hack for windows building on mingw
kthakore authored
14 use SDL::Utility;
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
15 use YAML;
85fcc9e @kthakore Fixed v2.2.0
kthakore authored
16 use YAML::Node;
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
17
2a66806 @kthakore Patched kmx's patch from here http://rt.cpan.org/Ticket/Display.html?id=...
kthakore authored
18 print STDERR <<BROKENWIN if ($^O =~ /MSWin.*|cygwin/ );
19 ******************************** !!!WARNING!!! ********************************
f3e4e3e @kthakore Can't do that :(
kthakore authored
20 Windows support is currently experimental - you can continue, but you've been warned!
2a66806 @kthakore Patched kmx's patch from here http://rt.cpan.org/Ticket/Display.html?id=...
kthakore authored
21 If you are interested in helping please contact us at sdl-devel\@perl.org.
22 *******************************************************************************
23 BROKENWIN
49ee715 @kthakore Added windows message for help
kthakore authored
24
9632eaf @kthakore Add hack for windows building on mingw
kthakore authored
25 my $sdl_compile_flags = SDL::Utility->sdl_c_flags();
26 my $sdl_link_flags = SDL::Utility->sdl_libs();
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
27 # subsystem to build
28 # file
29 # location of source file => location of build file to get name right
30 # libraries
31 # name of shared library (soname)
32 # preprocessor definition
33 # name of header file
34 my %subsystems =
35 (
36 SDL => {
37 file => {
38 from => 'src/SDL.xs',
2a66806 @kthakore Patched kmx's patch from here http://rt.cpan.org/Ticket/Display.html?id=...
kthakore authored
39 to => 'lib/SDL_perl.xs',
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
40 },
85fcc9e @kthakore Fixed v2.2.0
kthakore authored
41 libraries => [qw( SDL SDL_image SDL_mixer SDL_net SDL_ttf SDL_gfx
42 png jpeg smpeg )],
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
43 },
e4ab5b2 @kthakore Using new Rect with v2.2.2.11. Had to change getClipRect paramters.
kthakore authored
44 Rect => {
45 file => {
46 from => 'src/Rect.xs',
47 to => 'lib/SDL/Rect.xs',
48 },
49 libraries => [qw( SDL )],
50 },
51
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
52 OpenGL => {
53 file => {
54 from => 'src/OpenGL.xs',
2a66806 @kthakore Patched kmx's patch from here http://rt.cpan.org/Ticket/Display.html?id=...
kthakore authored
55 to => 'lib/SDL/OpenGL.xs',
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
56 },
57 libraries => [qw( SDL GL GLU )],
58 },
59 SFont => {
60 file => {
61 from => 'src/SFont.xs',
2a66806 @kthakore Patched kmx's patch from here http://rt.cpan.org/Ticket/Display.html?id=...
kthakore authored
62 to => 'lib/SDL/SFont.xs',
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
63 },
64 libraries => [qw( SDL SDL_image )],
65 },
66 );
67
68 my %libraries = (
69 SDL => {
70 define => 'HAVE_SDL',
71 header => 'SDL.h',
72 },
73 SDL_image => {
74 define => 'HAVE_SDL_IMAGE',
75 header => 'SDL_image.h'
76 },
77 SDL_mixer => {
78 define => 'HAVE_SDL_MIXER',
79 header => 'SDL_mixer.h'
80 },
81 SDL_net => {
82 define => 'HAVE_SDL_NET',
83 header => 'SDL_net.h'
84 },
85 SDL_ttf => {
86 define => 'HAVE_SDL_TTF',
87 header => 'SDL_ttf.h'
88 },
89 SDL_gfx => {
90 define => 'HAVE_SDL_GFX',
91 header => 'SDL_gfxPrimitives.h'
92 },
93 png => {
94 define => 'HAVE_PNG',
95 header => 'png.h',
96 },
97 jpeg => {
98 define => 'HAVE_JPEG',
99 header => 'jpeglib.h',
100 },
101 smpeg => {
102 define => 'HAVE_SMPEG',
103 header => 'smpeg.h',
104 },
105 GL => {
106 define => 'HAVE_GL',
107 header => 'gl.h'
108 },
109 GLU => {
110 define => 'HAVE_GLU',
111 header => 'glu.h'
112 },
113 );
114
115 # need the platform-specific module to find include paths correctly
116 # see build/lib/SDL/Build/*pm
117 my $arch = SDL::Build->get_arch( $^O );
118
119 # see which subsystems can be built -- do we have headers for them?
120 my $build_systems = $arch->find_subsystems( \%subsystems, \%libraries );
121
122 # now write SDL::Config
123 $arch->write_sdl_config( $build_systems );
124
125 # and fetch all of the information needed to compile
85fcc9e @kthakore Fixed v2.2.0
kthakore authored
126 my $defines = $arch->build_defines( \%libraries, $build_systems );
127 my $includes = $arch->build_includes( \%libraries, $build_systems );
128 my $links = $arch->build_links( \%libraries, $build_systems );
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
129
130 # mangle the compilable files into a format Module::Build can understand
131 my %xs = map { $subsystems{$_}{file}{from} => $subsystems{$_}{file}{to} }
85fcc9e @kthakore Fixed v2.2.0
kthakore authored
132 keys %subsystems;
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
133 my $build = SDL::Build->new(
85fcc9e @kthakore Fixed v2.2.0
kthakore authored
134 module_name => 'SDL',
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
135 dist_name => 'SDL_Perl',
136 license => 'lgpl',
137 dist_version_from => 'lib/SDL.pm',
138 build_requires =>
139 {
140 'Test::Simple' => '0.47',
141 'Module::Build' => '0.22',
bf87e76 @kthakore Updated SDL::App docs
kthakore authored
142 'YAML' => '0.68'
143 },
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
144 build_recommends =>
145 {
eb33e5f @kthakore Added more info
kthakore authored
146 'Pod::ToDemo' => '0.20'
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
147 },
85fcc9e @kthakore Fixed v2.2.0
kthakore authored
148 c_source => 'src',
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
149 xs_files => \%xs,
fc3f64f @kthakore Added no_index for files in make here is the bug https://rt.cpan.org/Tic...
kthakore authored
150 meta_add =>
151 {
f466624 @kthakore Added darwin build to Build.PL, fixed configure requires
kthakore authored
152 configure_requires =>
153 {
154 'Alien::SDL' => '0.06',
155 'ExtUtils::CBuilder' => '0.260301'
156 },
157
57450fa @kthakore A new test for surface leaks. I made is as simple as possible but it doe...
kthakore authored
158 no_index => { file => [ <make/lib/SDL/*.pm>, <make/lib/SDL/Build/*.pm>, <make/lib/ExtUtils/CBuilder/*>, <make/lib/ExtUtils/*>, <make/lib/ExtUtils/CBuilder/Platform/Windows.pm> ] },
fc3f64f @kthakore Added no_index for files in make here is the bug https://rt.cpan.org/Tic...
kthakore authored
159 },
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
160 dist_author => 'David J. Goehrig <DGOEHRIG@cpan.org>',
161 );
162
f466624 @kthakore Added darwin build to Build.PL, fixed configure requires
kthakore authored
163 if($arch eq 'Darwin')
164 {
165 $build->{c_source} = $arch->build_c_source( \%libraries, $build_systems );
166 $build->{c_sources} = $arch->build_c_sources( \%libraries, $build_systems );
167 $build->{install_base} = $arch->build_install_base( \%libraries, $build_systems );
168
169 }
eb33e5f @kthakore Added more info
kthakore authored
170
85fcc9e @kthakore Fixed v2.2.0
kthakore authored
171 # and here's where the real (and ugly) magic works... see SDL::Build
8fde61e @kthakore First commit of SDL_Perl-2.1.3
kthakore authored
172 $build->set_flags(
173 \%subsystems,
174 $build_systems,
175 $defines,
176 $includes,
177 $links,
178 $sdl_compile_flags,
179 $sdl_link_flags,
180 );
181 # now we're ready to go!
182 $build->create_build_script();
Something went wrong with that request. Please try again.