4 open XS, "< sdl_words.txt" or die "could not open sdl_words.txt\n";
5 open CPP, "| cpp `sdl-config --cflags` - > SDL.cx" or die "Could not pipe to cpp, $!\n";
11 #define TEXT_BLENDED 4
13 #define UTF8_SHADED 16
14 #define UTF8_BLENDED 32
15 #define UNICODE_SOLID 64
16 #define UNICODE_SHADED 128
17 #define UNICODE_BLENDED 256
32 # ENUMS AREN'T CPPed we got to do this the hard way
35 open FP, "> sdl_const.c" or die "Could not write to sdl__const.c\n";
39 #include <SDL_image.h>
40 #include <SDL_mixer.h>
43 #include <smpeg/smpeg.h>
46 #define TEXT_BLENDED 4
48 #define UTF8_SHADED 16
49 #define UTF8_BLENDED 32
50 #define UNICODE_SOLID 64
51 #define UNICODE_SHADED 128
52 #define UNICODE_BLENDED 256
55 main ( int argc, char **argv ) {
59 for ( grep { $words{$_} == 0 } keys %words ) {
61 fprintf(stdout,"sub main::$_ { \%i }\n", $_);
70 system("gcc `sdl-config --cflags --libs` -o sdl_const sdl_const.c");
73 open ENUMS, "./sdl_const |";
80 $goodstuff .= "\n$enums";
82 for ( split "\n", $goodstuff ) {
83 if (/sub\s+main::([A-Za-z0-9_]+)/) {
89 print STDERR "Failed to find $_\n" unless $words{$_};
92 (@words) = grep { $words{$_} == 1 } keys %words;
94 $words = join(" ",@words);
96 open CONST, "> ../lib/SDL/Constants.pm";
101 # This is an automatically generated file, don't bother editing.
102 # Names are read from a list in sdl_words.txt and written by sdl_const.pl.
104 # Copyright (C) 2003 David J. Goehrig <dave\@sdlperl.org>
107 package SDL::Constants;
115 system("rm -f SDL.cx sdl_const sdl_const.c");