package SDL::ConfigData;
use strict;
my $arrayref = eval do {local $/; <DATA>}
  or die "Couldn't load ConfigData data: $@";
close DATA;
my ($config, $features, $auto_features) = @$arrayref;

sub config { $config->{$_[1]} }

sub set_config { $config->{$_[1]} = $_[2] }
sub set_feature { $features->{$_[1]} = 0+!!$_[2] }  # Constrain to 1 or 0

sub auto_feature_names { grep !exists $features->{$_}, keys %$auto_features }

sub feature_names {
  my @features = (keys %$features, auto_feature_names());
  @features;
}

sub config_names  { keys %$config }

sub write {
  my $me = __FILE__;

  # Can't use Module::Build::Dumper here because M::B is only a
  # build-time prereq of this module
  require Data::Dumper;

  my $mode_orig = (stat $me)[2] & 07777;
  chmod($mode_orig | 0222, $me); # Make it writeable
  open(my $fh, '+<', $me) or die "Can't rewrite $me: $!";
  seek($fh, 0, 0);
  while (<$fh>) {
    last if /^__DATA__$/;
  }
  die "Couldn't find __DATA__ token in $me" if eof($fh);

  seek($fh, tell($fh), 0);
  my $data = [$config, $features, $auto_features];
  print($fh 'do{ my '
	      . Data::Dumper->new([$data],['x'])->Purity(1)->Dump()
	      . '$x; }' );
  truncate($fh, tell($fh));
  close $fh;

  chmod($mode_orig, $me)
    or warn "Couldn't restore permissions on $me: $!";
}

sub feature {
  my ($package, $key) = @_;
  return $features->{$key} if exists $features->{$key};

  my $info = $auto_features->{$key} or return 0;

  # Under perl 5.005, each(%$foo) isn't working correctly when $foo
  # was reanimated with Data::Dumper and eval().  Not sure why, but
  # copying to a new hash seems to solve it.
  my %info = %$info;

  require Module::Build;  # XXX should get rid of this
  while (my ($type, $prereqs) = each %info) {
    next if $type eq 'description' || $type eq 'recommends';

    my %p = %$prereqs;  # Ditto here.
    while (my ($modname, $spec) = each %p) {
      my $status = Module::Build->check_installed_status($modname, $spec);
      if ((!$status->{ok}) xor ($type =~ /conflicts$/)) { return 0; }
      if ( ! eval "require $modname; 1" ) { return 0; }
    }
  }
  return 1;
}


=head1 NAME

SDL::ConfigData - Configuration for SDL

=head1 SYNOPSIS

  use SDL::ConfigData;
  $value = SDL::ConfigData->config('foo');
  $value = SDL::ConfigData->feature('bar');

  @names = SDL::ConfigData->config_names;
  @names = SDL::ConfigData->feature_names;

  SDL::ConfigData->set_config(foo => $new_value);
  SDL::ConfigData->set_feature(bar => $new_value);
  SDL::ConfigData->write;  # Save changes


=head1 DESCRIPTION

This module holds the configuration data for the C<SDL>
module.  It also provides a programmatic interface for getting or
setting that configuration data.  Note that in order to actually make
changes, you'll have to have write access to the C<SDL::ConfigData>
module, and you should attempt to understand the repercussions of your
actions.


=head1 METHODS

=over 4

=item config($name)

Given a string argument, returns the value of the configuration item
by that name, or C<undef> if no such item exists.

=item feature($name)

Given a string argument, returns the value of the feature by that
name, or C<undef> if no such feature exists.

=item set_config($name, $value)

Sets the configuration item with the given name to the given value.
The value may be any Perl scalar that will serialize correctly using
C<Data::Dumper>.  This includes references, objects (usually), and
complex data structures.  It probably does not include transient
things like filehandles or sockets.

=item set_feature($name, $value)

Sets the feature with the given name to the given boolean value.  The
value will be converted to 0 or 1 automatically.

=item config_names()

Returns a list of all the names of config items currently defined in
C<SDL::ConfigData>, or in scalar context the number of items.

=item feature_names()

Returns a list of all the names of features currently defined in
C<SDL::ConfigData>, or in scalar context the number of features.

=item auto_feature_names()

Returns a list of all the names of features whose availability is
dynamically determined, or in scalar context the number of such
features.  Does not include such features that have later been set to
a fixed value.

=item write()

Commits any changes from C<set_config()> and C<set_feature()> to disk.
Requires write access to the C<SDL::ConfigData> module.

=back


=head1 AUTHOR

C<SDL::ConfigData> was automatically created using C<Module::Build>.
C<Module::Build> was written by Ken Williams, but he holds no
authorship claim or copyright claim to the contents of C<SDL::ConfigData>.

=cut


__DATA__
do{ my $x = [
       {
         'SDL_lib_translate' => {
                                  'SDL::CDTrack' => [
                                                      'SDL'
                                                    ],
                                  'SDL::Color' => [
                                                    'SDL'
                                                  ],
                                  'SDL::MultiThread' => [
                                                          'SDL'
                                                        ],
                                  'SDL_perl' => [
                                                  'SDL'
                                                ],
                                  'SDL::GFX::Framerate' => [
                                                             'SDL',
                                                             'SDL_gfx'
                                                           ],
                                  'SDL::CDROM' => [
                                                    'SDL'
                                                  ],
                                  'SDL::Pango' => [
                                                    'SDL',
                                                    'SDL_Pango'
                                                  ],
                                  'SDLx::Layer' => [
                                                     'SDL',
                                                     'SDL_image'
                                                   ],
                                  'SDL::Mixer::MixChunk' => [
                                                              'SDL',
                                                              'SDL_mixer'
                                                            ],
                                  'SDL::VideoInfo' => [
                                                        'SDL'
                                                      ],
                                  'SDL::GFX::FPSManager' => [
                                                              'SDL',
                                                              'SDL_gfx'
                                                            ],
                                  'SDL::Audio' => [
                                                    'SDL'
                                                  ],
                                  'SDL::Overlay' => [
                                                      'SDL'
                                                    ],
                                  'SDL::TTF::Font' => [
                                                        'SDL',
                                                        'SDL_ttf'
                                                      ],
                                  'SDLx::Controller::Interface' => [
                                                                     'SDL'
                                                                   ],
                                  'SDL::Image' => [
                                                    'SDL',
                                                    'SDL_image'
                                                  ],
                                  'SDLx::Controller::Timer' => [
                                                                 'SDL'
                                                               ],
                                  'SDL::Time' => [
                                                   'SDL'
                                                 ],
                                  'SDLx::Validate' => [
                                                        'SDL'
                                                      ],
                                  'SDLx::Surface' => [
                                                       'SDL',
                                                       'SDL_gfx'
                                                     ],
                                  'SDLx::SFont' => [
                                                     'SDL',
                                                     'SDL_image'
                                                   ],
                                  'SDL::GFX::Rotozoom' => [
                                                            'SDL',
                                                            'SDL_gfx'
                                                          ],
                                  'SDL::RWOps' => [
                                                    'SDL'
                                                  ],
                                  'SDL::TTF' => [
                                                  'SDL',
                                                  'SDL_ttf'
                                                ],
                                  'SDL::Event' => [
                                                    'SDL'
                                                  ],
                                  'SDL::AudioSpec' => [
                                                        'SDL'
                                                      ],
                                  'SDL::Pango::Context' => [
                                                             'SDL',
                                                             'SDL_Pango'
                                                           ],
                                  'SDL::GFX::Primitives' => [
                                                              'SDL',
                                                              'SDL_gfx'
                                                            ],
                                  'SDL::Surface' => [
                                                      'SDL'
                                                    ],
                                  'SDL::Joystick' => [
                                                       'SDL'
                                                     ],
                                  'SDL::Video' => [
                                                    'SDL'
                                                  ],
                                  'SDL::AudioCVT' => [
                                                       'SDL'
                                                     ],
                                  'SDL::Palette' => [
                                                      'SDL'
                                                    ],
                                  'SDL::Version' => [
                                                      'SDL'
                                                    ],
                                  'SDL::GFX::ImageFilter' => [
                                                               'SDL',
                                                               'SDL_gfx'
                                                             ],
                                  'SDL::Mixer' => [
                                                    'SDL',
                                                    'SDL_mixer'
                                                  ],
                                  'SDL::Mouse' => [
                                                    'SDL'
                                                  ],
                                  'SDL::Mixer::Samples' => [
                                                             'SDL',
                                                             'SDL_mixer'
                                                           ],
                                  'SDL::Mixer::Groups' => [
                                                            'SDL',
                                                            'SDL_mixer'
                                                          ],
                                  'SDL::Events' => [
                                                     'SDL'
                                                   ],
                                  'SDL::Mixer::Effects' => [
                                                             'SDL',
                                                             'SDL_mixer'
                                                           ],
                                  'SDL::Mixer::MixMusic' => [
                                                              'SDL',
                                                              'SDL_mixer'
                                                            ],
                                  'SDL::Mixer::Music' => [
                                                           'SDL',
                                                           'SDL_mixer'
                                                         ],
                                  'SDL::GFX::BlitFunc' => [
                                                            'SDL',
                                                            'SDL_gfx'
                                                          ],
                                  'SDL::CD' => [
                                                 'SDL'
                                               ],
                                  'SDLx::Controller::State' => [
                                                                 'SDL'
                                                               ],
                                  'SDL::PixelFormat' => [
                                                          'SDL'
                                                        ],
                                  'SDL::GFX' => [
                                                  'SDL',
                                                  'SDL_gfx'
                                                ],
                                  'SDL::Rect' => [
                                                   'SDL'
                                                 ],
                                  'SDL::Cursor' => [
                                                     'SDL'
                                                   ],
                                  'SDL::Mixer::Channels' => [
                                                              'SDL',
                                                              'SDL_mixer'
                                                            ],
                                  'SDLx::LayerManager' => [
                                                            'SDL'
                                                          ]
                                },
         'libraries' => {
                          'SDL_gfx_framerate' => {
                                                   'header' => 'SDL_framerate.h',
                                                   'define' => 'HAVE_SDL_GFX_FRAMERATE',
                                                   'lib' => 'SDL_gfx'
                                                 },
                          'SDL_gfx_rotozoom' => {
                                                  'header' => 'SDL_rotozoom.h',
                                                  'define' => 'HAVE_SDL_GFX_ROTOZOOM',
                                                  'lib' => 'SDL_gfx'
                                                },
                          'png' => {
                                     'header' => 'png.h',
                                     'lib' => 'png',
                                     'define' => 'HAVE_PNG'
                                   },
                          'SDL_gfx_imagefilter' => {
                                                     'define' => 'HAVE_SDL_GFX_IMAGEFILTER',
                                                     'lib' => 'SDL_gfx',
                                                     'header' => 'SDL_imageFilter.h'
                                                   },
                          'SDL_Pango' => {
                                           'define' => 'HAVE_SDL_PANGO',
                                           'lib' => 'SDL_Pango',
                                           'header' => 'SDL_Pango.h'
                                         },
                          'SDL_mixer' => {
                                           'header' => 'SDL_mixer.h',
                                           'lib' => 'SDL_mixer',
                                           'define' => 'HAVE_SDL_MIXER'
                                         },
                          'SDL_gfx_primitives' => {
                                                    'header' => 'SDL_gfxPrimitives.h',
                                                    'define' => 'HAVE_SDL_GFX_PRIMITIVES',
                                                    'lib' => 'SDL_gfx'
                                                  },
                          'SDL_ttf' => {
                                         'lib' => 'SDL_ttf',
                                         'define' => 'HAVE_SDL_TTF',
                                         'header' => 'SDL_ttf.h'
                                       },
                          'GL' => {
                                    'define' => 'HAVE_GL',
                                    'lib' => 'GL',
                                    'header' => [
                                                  'GL/gl.h',
                                                  'GL/glext.h'
                                                ]
                                  },
                          'tiff' => {
                                      'define' => 'HAVE_TIFF',
                                      'lib' => 'tiff',
                                      'header' => 'tiff.h'
                                    },
                          'GLU' => {
                                     'lib' => 'GLU',
                                     'define' => 'HAVE_GLU',
                                     'header' => 'GL/glu.h'
                                   },
                          'SDL_gfx' => {
                                         'header' => 'SDL_gfxPrimitives.h',
                                         'define' => 'HAVE_SDL_GFX',
                                         'lib' => 'SDL_gfx'
                                       },
                          'smpeg' => {
                                       'header' => 'smpeg/smpeg.h',
                                       'lib' => 'smpeg',
                                       'define' => 'HAVE_SMPEG'
                                     },
                          'SDL_image' => {
                                           'header' => 'SDL_image.h',
                                           'lib' => 'SDL_image',
                                           'define' => 'HAVE_SDL_IMAGE'
                                         },
                          'jpeg' => {
                                      'lib' => 'jpeg',
                                      'define' => 'HAVE_JPEG',
                                      'header' => 'jpeglib.h'
                                    },
                          'SDL' => {
                                     'header' => 'SDL.h',
                                     'lib' => 'SDL',
                                     'define' => 'HAVE_SDL'
                                   },
                          'SDL_gfx_blitfunc' => {
                                                  'lib' => 'SDL_gfx',
                                                  'define' => 'HAVE_SDL_GFX_BLITFUNC',
                                                  'header' => 'SDL_gfxBlitFunc.h'
                                                }
                        },
         'subsystems' => {
                           'Version' => {
                                          'file' => {
                                                      'from' => 'src/Core/objects/Version.xs',
                                                      'to' => 'lib/SDL/Version.xs'
                                                    },
                                          'libraries' => [
                                                           'SDL'
                                                         ]
                                        },
                           'MixChunk' => {
                                           'file' => {
                                                       'to' => 'lib/SDL/Mixer/MixChunk.xs',
                                                       'from' => 'src/Mixer/objects/MixChunk.xs'
                                                     },
                                           'libraries' => [
                                                            'SDL',
                                                            'SDL_mixer'
                                                          ]
                                         },
                           'MixerChannels' => {
                                                'file' => {
                                                            'from' => 'src/Mixer/Channels.xs',
                                                            'to' => 'lib/SDL/Mixer/Channels.xs'
                                                          },
                                                'libraries' => [
                                                                 'SDL',
                                                                 'SDL_mixer'
                                                               ]
                                              },
                           'SDL' => {
                                      'file' => {
                                                  'from' => 'src/SDL.xs',
                                                  'to' => 'lib/SDL_perl.xs'
                                                },
                                      'libraries' => [
                                                       'SDL'
                                                     ]
                                    },
                           'Image' => {
                                        'libraries' => [
                                                         'SDL',
                                                         'SDL_image'
                                                       ],
                                        'file' => {
                                                    'to' => 'lib/SDL/Image.xs',
                                                    'from' => 'src/Image.xs'
                                                  }
                                      },
                           'AudioCVT' => {
                                           'file' => {
                                                       'from' => 'src/Core/objects/AudioCVT.xs',
                                                       'to' => 'lib/SDL/AudioCVT.xs'
                                                     },
                                           'libraries' => [
                                                            'SDL'
                                                          ]
                                         },
                           'Framerate' => {
                                            'libraries' => [
                                                             'SDL',
                                                             'SDL_gfx_framerate'
                                                           ],
                                            'file' => {
                                                        'from' => 'src/GFX/Framerate.xs',
                                                        'to' => 'lib/SDL/GFX/Framerate.xs'
                                                      }
                                          },
                           'Surface' => {
                                          'libraries' => [
                                                           'SDL'
                                                         ],
                                          'file' => {
                                                      'from' => 'src/Core/objects/Surface.xs',
                                                      'to' => 'lib/SDL/Surface.xs'
                                                    }
                                        },
                           'MixerMusic' => {
                                             'file' => {
                                                         'from' => 'src/Mixer/Music.xs',
                                                         'to' => 'lib/SDL/Mixer/Music.xs'
                                                       },
                                             'libraries' => [
                                                              'SDL',
                                                              'SDL_mixer'
                                                            ]
                                           },
                           'ValidateX' => {
                                            'libraries' => [
                                                             'SDL'
                                                           ],
                                            'file' => {
                                                        'to' => 'lib/SDLx/Validate.xs',
                                                        'from' => 'src/SDLx/Validate.xs'
                                                      }
                                          },
                           'TTF' => {
                                      'libraries' => [
                                                       'SDL',
                                                       'SDL_ttf'
                                                     ],
                                      'file' => {
                                                  'to' => 'lib/SDL/TTF.xs',
                                                  'from' => 'src/TTF/TTF.xs'
                                                }
                                    },
                           'Events' => {
                                         'file' => {
                                                     'to' => 'lib/SDL/Events.xs',
                                                     'from' => 'src/Core/Events.xs'
                                                   },
                                         'libraries' => [
                                                          'SDL'
                                                        ]
                                       },
                           'BlitFunc' => {
                                           'libraries' => [
                                                            'SDL',
                                                            'SDL_gfx_blitfunc'
                                                          ],
                                           'file' => {
                                                       'to' => 'lib/SDL/GFX/BlitFunc.xs',
                                                       'from' => 'src/GFX/BlitFunc.xs'
                                                     }
                                         },
                           'Color' => {
                                        'file' => {
                                                    'to' => 'lib/SDL/Color.xs',
                                                    'from' => 'src/Core/objects/Color.xs'
                                                  },
                                        'libraries' => [
                                                         'SDL'
                                                       ]
                                      },
                           'Pango' => {
                                        'file' => {
                                                    'to' => 'lib/SDL/Pango.xs',
                                                    'from' => 'src/Pango/Pango.xs'
                                                  },
                                        'libraries' => [
                                                         'SDL',
                                                         'SDL_Pango'
                                                       ]
                                      },
                           'Event' => {
                                        'libraries' => [
                                                         'SDL'
                                                       ],
                                        'file' => {
                                                    'to' => 'lib/SDL/Event.xs',
                                                    'from' => 'src/Core/objects/Event.xs'
                                                  }
                                      },
                           'Cursor' => {
                                         'libraries' => [
                                                          'SDL'
                                                        ],
                                         'file' => {
                                                     'from' => 'src/Core/objects/Cursor.xs',
                                                     'to' => 'lib/SDL/Cursor.xs'
                                                   }
                                       },
                           'RWOps' => {
                                        'libraries' => [
                                                         'SDL'
                                                       ],
                                        'file' => {
                                                    'from' => 'src/Core/objects/RWOps.xs',
                                                    'to' => 'lib/SDL/RWOps.xs'
                                                  }
                                      },
                           'SurfaceX' => {
                                           'file' => {
                                                       'from' => 'src/SDLx/Surface.xs',
                                                       'to' => 'lib/SDLx/Surface.xs'
                                                     },
                                           'libraries' => [
                                                            'SDL',
                                                            'SDL_gfx_primitives'
                                                          ]
                                         },
                           'MixerSamples' => {
                                               'libraries' => [
                                                                'SDL',
                                                                'SDL_mixer'
                                                              ],
                                               'file' => {
                                                           'to' => 'lib/SDL/Mixer/Samples.xs',
                                                           'from' => 'src/Mixer/Samples.xs'
                                                         }
                                             },
                           'FPSManager' => {
                                             'file' => {
                                                         'from' => 'src/GFX/FPSManager.xs',
                                                         'to' => 'lib/SDL/GFX/FPSManager.xs'
                                                       },
                                             'libraries' => [
                                                              'SDL',
                                                              'SDL_gfx_framerate'
                                                            ]
                                           },
                           'MultiThread' => {
                                              'libraries' => [
                                                               'SDL'
                                                             ],
                                              'file' => {
                                                          'from' => 'src/Core/MultiThread.xs',
                                                          'to' => 'lib/SDL/MultiThread.xs'
                                                        }
                                            },
                           'Primitives' => {
                                             'file' => {
                                                         'from' => 'src/GFX/Primitives.xs',
                                                         'to' => 'lib/SDL/GFX/Primitives.xs'
                                                       },
                                             'libraries' => [
                                                              'SDL',
                                                              'SDL_gfx_primitives'
                                                            ]
                                           },
                           'StateX' => {
                                         'file' => {
                                                     'from' => 'src/SDLx/Controller/State.xs',
                                                     'to' => 'lib/SDLx/Controller/State.xs'
                                                   },
                                         'libraries' => [
                                                          'SDL'
                                                        ]
                                       },
                           'TTF_Font' => {
                                           'file' => {
                                                       'from' => 'src/TTF/objects/Font.xs',
                                                       'to' => 'lib/SDL/TTF/Font.xs'
                                                     },
                                           'libraries' => [
                                                            'SDL',
                                                            'SDL_ttf'
                                                          ]
                                         },
                           'LayerX' => {
                                         'file' => {
                                                     'to' => 'lib/SDLx/Layer.xs',
                                                     'from' => 'src/SDLx/Layer.xs'
                                                   },
                                         'libraries' => [
                                                          'SDL',
                                                          'SDL_image'
                                                        ]
                                       },
                           'CDTrack' => {
                                          'libraries' => [
                                                           'SDL'
                                                         ],
                                          'file' => {
                                                      'from' => 'src/Core/objects/CDTrack.xs',
                                                      'to' => 'lib/SDL/CDTrack.xs'
                                                    }
                                        },
                           'CD' => {
                                     'file' => {
                                                 'to' => 'lib/SDL/CD.xs',
                                                 'from' => 'src/Core/objects/CD.xs'
                                               },
                                     'libraries' => [
                                                      'SDL'
                                                    ]
                                   },
                           'MixerEffects' => {
                                               'file' => {
                                                           'from' => 'src/Mixer/Effects.xs',
                                                           'to' => 'lib/SDL/Mixer/Effects.xs'
                                                         },
                                               'libraries' => [
                                                                'SDL',
                                                                'SDL_mixer'
                                                              ]
                                             },
                           'CDROM' => {
                                        'libraries' => [
                                                         'SDL'
                                                       ],
                                        'file' => {
                                                    'from' => 'src/Core/CDROM.xs',
                                                    'to' => 'lib/SDL/CDROM.xs'
                                                  }
                                      },
                           'Mixer' => {
                                        'file' => {
                                                    'from' => 'src/Mixer/Mixer.xs',
                                                    'to' => 'lib/SDL/Mixer.xs'
                                                  },
                                        'libraries' => [
                                                         'SDL',
                                                         'SDL_mixer'
                                                       ]
                                      },
                           'Rect' => {
                                       'libraries' => [
                                                        'SDL'
                                                      ],
                                       'file' => {
                                                   'to' => 'lib/SDL/Rect.xs',
                                                   'from' => 'src/Core/objects/Rect.xs'
                                                 }
                                     },
                           'MixMusic' => {
                                           'file' => {
                                                       'to' => 'lib/SDL/Mixer/MixMusic.xs',
                                                       'from' => 'src/Mixer/objects/MixMusic.xs'
                                                     },
                                           'libraries' => [
                                                            'SDL',
                                                            'SDL_mixer'
                                                          ]
                                         },
                           'Context' => {
                                          'libraries' => [
                                                           'SDL',
                                                           'SDL_Pango'
                                                         ],
                                          'file' => {
                                                      'to' => 'lib/SDL/Pango/Context.xs',
                                                      'from' => 'src/Pango/objects/Context.xs'
                                                    }
                                        },
                           'PixelFormat' => {
                                              'libraries' => [
                                                               'SDL'
                                                             ],
                                              'file' => {
                                                          'to' => 'lib/SDL/PixelFormat.xs',
                                                          'from' => 'src/Core/objects/PixelFormat.xs'
                                                        }
                                            },
                           'ImageFilter' => {
                                              'libraries' => [
                                                               'SDL',
                                                               'SDL_gfx_imagefilter'
                                                             ],
                                              'file' => {
                                                          'to' => 'lib/SDL/GFX/ImageFilter.xs',
                                                          'from' => 'src/GFX/ImageFilter.xs'
                                                        }
                                            },
                           'Audio' => {
                                        'libraries' => [
                                                         'SDL'
                                                       ],
                                        'file' => {
                                                    'from' => 'src/Core/Audio.xs',
                                                    'to' => 'lib/SDL/Audio.xs'
                                                  }
                                      },
                           'AudioSpec' => {
                                            'file' => {
                                                        'from' => 'src/Core/objects/AudioSpec.xs',
                                                        'to' => 'lib/SDL/AudioSpec.xs'
                                                      },
                                            'libraries' => [
                                                             'SDL'
                                                           ]
                                          },
                           'GFX' => {
                                      'libraries' => [
                                                       'SDL',
                                                       'SDL_gfx_primitives'
                                                     ],
                                      'file' => {
                                                  'from' => 'src/GFX/GFX.xs',
                                                  'to' => 'lib/SDL/GFX.xs'
                                                }
                                    },
                           'MixerGroups' => {
                                              'file' => {
                                                          'from' => 'src/Mixer/Groups.xs',
                                                          'to' => 'lib/SDL/Mixer/Groups.xs'
                                                        },
                                              'libraries' => [
                                                               'SDL',
                                                               'SDL_mixer'
                                                             ]
                                            },
                           'Overlay' => {
                                          'libraries' => [
                                                           'SDL'
                                                         ],
                                          'file' => {
                                                      'from' => 'src/Core/objects/Overlay.xs',
                                                      'to' => 'lib/SDL/Overlay.xs'
                                                    }
                                        },
                           'Rotozoom' => {
                                           'file' => {
                                                       'from' => 'src/GFX/Rotozoom.xs',
                                                       'to' => 'lib/SDL/GFX/Rotozoom.xs'
                                                     },
                                           'libraries' => [
                                                            'SDL',
                                                            'SDL_gfx_rotozoom'
                                                          ]
                                         },
                           'Mouse' => {
                                        'libraries' => [
                                                         'SDL'
                                                       ],
                                        'file' => {
                                                    'from' => 'src/Core/Mouse.xs',
                                                    'to' => 'lib/SDL/Mouse.xs'
                                                  }
                                      },
                           'TimerX' => {
                                         'libraries' => [
                                                          'SDL'
                                                        ],
                                         'file' => {
                                                     'to' => 'lib/SDLx/Controller/Timer.xs',
                                                     'from' => 'src/SDLx/Timer.xs'
                                                   }
                                       },
                           'SFont' => {
                                        'file' => {
                                                    'from' => 'src/SDLx/SFont.xs',
                                                    'to' => 'lib/SDLx/SFont.xs'
                                                  },
                                        'libraries' => [
                                                         'SDL',
                                                         'SDL_image'
                                                       ]
                                      },
                           'VideoInfo' => {
                                            'file' => {
                                                        'to' => 'lib/SDL/VideoInfo.xs',
                                                        'from' => 'src/Core/objects/VideoInfo.xs'
                                                      },
                                            'libraries' => [
                                                             'SDL'
                                                           ]
                                          },
                           'Palette' => {
                                          'file' => {
                                                      'from' => 'src/Core/objects/Palette.xs',
                                                      'to' => 'lib/SDL/Palette.xs'
                                                    },
                                          'libraries' => [
                                                           'SDL'
                                                         ]
                                        },
                           'Video' => {
                                        'file' => {
                                                    'from' => 'src/Core/Video.xs',
                                                    'to' => 'lib/SDL/Video.xs'
                                                  },
                                        'libraries' => [
                                                         'SDL'
                                                       ]
                                      },
                           'Joystick' => {
                                           'libraries' => [
                                                            'SDL'
                                                          ],
                                           'file' => {
                                                       'to' => 'lib/SDL/Joystick.xs',
                                                       'from' => 'src/Core/Joystick.xs'
                                                     }
                                         },
                           'Time' => {
                                       'file' => {
                                                   'to' => 'lib/SDL/Time.xs',
                                                   'from' => 'src/Core/Time.xs'
                                                 },
                                       'libraries' => [
                                                        'SDL'
                                                      ]
                                     },
                           'InterfaceX' => {
                                             'libraries' => [
                                                              'SDL'
                                                            ],
                                             'file' => {
                                                         'from' => 'src/SDLx/Controller/Interface.xs',
                                                         'to' => 'lib/SDLx/Controller/Interface.xs'
                                                       }
                                           },
                           'LayerManagerX' => {
                                                'libraries' => [
                                                                 'SDL'
                                                               ],
                                                'file' => {
                                                            'to' => 'lib/SDLx/LayerManager.xs',
                                                            'from' => 'src/SDLx/LayerManager.xs'
                                                          }
                                              }
                         },
         'SDL_cfg' => {
                        'AudioSpec' => {
                                         'defines' => [
                                                        '-DHAVE_SDL'
                                                      ],
                                         'libs' => {
                                                     'SDL' => 1
                                                   },
                                         'links' => [
                                                      '-lSDL'
                                                    ]
                                       },
                        'Audio' => {
                                     'defines' => [
                                                    '-DHAVE_SDL'
                                                  ],
                                     'libs' => {
                                                 'SDL' => 1
                                               },
                                     'links' => [
                                                  '-lSDL'
                                                ]
                                   },
                        'PixelFormat' => {
                                           'links' => [
                                                        '-lSDL'
                                                      ],
                                           'libs' => {
                                                       'SDL' => 1
                                                     },
                                           'defines' => [
                                                          '-DHAVE_SDL'
                                                        ]
                                         },
                        'Context' => {
                                       'links' => [
                                                    '-lSDL',
                                                    '-lSDL_Pango'
                                                  ],
                                       'libs' => {
                                                   'SDL_Pango' => 1,
                                                   'SDL' => 1
                                                 },
                                       'defines' => [
                                                      '-DHAVE_SDL',
                                                      '-DHAVE_SDL_PANGO'
                                                    ]
                                     },
                        'ImageFilter' => {
                                           'links' => [
                                                        '-lSDL',
                                                        '-lSDL_gfx'
                                                      ],
                                           'libs' => {
                                                       'SDL' => 1,
                                                       'SDL_gfx_imagefilter' => 1
                                                     },
                                           'defines' => [
                                                          '-DHAVE_SDL',
                                                          '-DHAVE_SDL_GFX_IMAGEFILTER'
                                                        ]
                                         },
                        'Mixer' => {
                                     'defines' => [
                                                    '-DHAVE_SDL',
                                                    '-DHAVE_SDL_MIXER'
                                                  ],
                                     'libs' => {
                                                 'SDL_mixer' => 1,
                                                 'SDL' => 1
                                               },
                                     'links' => [
                                                  '-lSDL',
                                                  '-lSDL_mixer'
                                                ]
                                   },
                        'Rect' => {
                                    'defines' => [
                                                   '-DHAVE_SDL'
                                                 ],
                                    'libs' => {
                                                'SDL' => 1
                                              },
                                    'links' => [
                                                 '-lSDL'
                                               ]
                                  },
                        'MixMusic' => {
                                        'libs' => {
                                                    'SDL_mixer' => 1,
                                                    'SDL' => 1
                                                  },
                                        'links' => [
                                                     '-lSDL',
                                                     '-lSDL_mixer'
                                                   ],
                                        'defines' => [
                                                       '-DHAVE_SDL',
                                                       '-DHAVE_SDL_MIXER'
                                                     ]
                                      },
                        'CDROM' => {
                                     'links' => [
                                                  '-lSDL'
                                                ],
                                     'libs' => {
                                                 'SDL' => 1
                                               },
                                     'defines' => [
                                                    '-DHAVE_SDL'
                                                  ]
                                   },
                        'MixerEffects' => {
                                            'defines' => [
                                                           '-DHAVE_SDL',
                                                           '-DHAVE_SDL_MIXER'
                                                         ],
                                            'libs' => {
                                                        'SDL' => 1,
                                                        'SDL_mixer' => 1
                                                      },
                                            'links' => [
                                                         '-lSDL',
                                                         '-lSDL_mixer'
                                                       ]
                                          },
                        'CDTrack' => {
                                       'links' => [
                                                    '-lSDL'
                                                  ],
                                       'libs' => {
                                                   'SDL' => 1
                                                 },
                                       'defines' => [
                                                      '-DHAVE_SDL'
                                                    ]
                                     },
                        'CD' => {
                                  'libs' => {
                                              'SDL' => 1
                                            },
                                  'links' => [
                                               '-lSDL'
                                             ],
                                  'defines' => [
                                                 '-DHAVE_SDL'
                                               ]
                                },
                        'LayerX' => {
                                      'defines' => [
                                                     '-DHAVE_SDL',
                                                     '-DHAVE_SDL_IMAGE'
                                                   ],
                                      'libs' => {
                                                  'SDL_image' => 1,
                                                  'SDL' => 1
                                                },
                                      'links' => [
                                                   '-lSDL',
                                                   '-lSDL_image'
                                                 ]
                                    },
                        'Primitives' => {
                                          'defines' => [
                                                         '-DHAVE_SDL',
                                                         '-DHAVE_SDL_GFX_PRIMITIVES'
                                                       ],
                                          'links' => [
                                                       '-lSDL',
                                                       '-lSDL_gfx'
                                                     ],
                                          'libs' => {
                                                      'SDL' => 1,
                                                      'SDL_gfx_primitives' => 1
                                                    }
                                        },
                        'StateX' => {
                                      'libs' => {
                                                  'SDL' => 1
                                                },
                                      'links' => [
                                                   '-lSDL'
                                                 ],
                                      'defines' => [
                                                     '-DHAVE_SDL'
                                                   ]
                                    },
                        'TTF_Font' => {
                                        'libs' => {
                                                    'SDL_ttf' => 1,
                                                    'SDL' => 1
                                                  },
                                        'links' => [
                                                     '-lSDL',
                                                     '-lSDL_ttf'
                                                   ],
                                        'defines' => [
                                                       '-DHAVE_SDL',
                                                       '-DHAVE_SDL_TTF'
                                                     ]
                                      },
                        'LayerManagerX' => {
                                             'defines' => [
                                                            '-DHAVE_SDL'
                                                          ],
                                             'links' => [
                                                          '-lSDL'
                                                        ],
                                             'libs' => {
                                                         'SDL' => 1
                                                       }
                                           },
                        'InterfaceX' => {
                                          'defines' => [
                                                         '-DHAVE_SDL'
                                                       ],
                                          'libs' => {
                                                      'SDL' => 1
                                                    },
                                          'links' => [
                                                       '-lSDL'
                                                     ]
                                        },
                        'Joystick' => {
                                        'links' => [
                                                     '-lSDL'
                                                   ],
                                        'libs' => {
                                                    'SDL' => 1
                                                  },
                                        'defines' => [
                                                       '-DHAVE_SDL'
                                                     ]
                                      },
                        'Time' => {
                                    'links' => [
                                                 '-lSDL'
                                               ],
                                    'libs' => {
                                                'SDL' => 1
                                              },
                                    'defines' => [
                                                   '-DHAVE_SDL'
                                                 ]
                                  },
                        'Palette' => {
                                       'libs' => {
                                                   'SDL' => 1
                                                 },
                                       'links' => [
                                                    '-lSDL'
                                                  ],
                                       'defines' => [
                                                      '-DHAVE_SDL'
                                                    ]
                                     },
                        'Video' => {
                                     'defines' => [
                                                    '-DHAVE_SDL'
                                                  ],
                                     'libs' => {
                                                 'SDL' => 1
                                               },
                                     'links' => [
                                                  '-lSDL'
                                                ]
                                   },
                        'VideoInfo' => {
                                         'libs' => {
                                                     'SDL' => 1
                                                   },
                                         'links' => [
                                                      '-lSDL'
                                                    ],
                                         'defines' => [
                                                        '-DHAVE_SDL'
                                                      ]
                                       },
                        'SFont' => {
                                     'links' => [
                                                  '-lSDL',
                                                  '-lSDL_image'
                                                ],
                                     'libs' => {
                                                 'SDL' => 1,
                                                 'SDL_image' => 1
                                               },
                                     'defines' => [
                                                    '-DHAVE_SDL',
                                                    '-DHAVE_SDL_IMAGE'
                                                  ]
                                   },
                        'Rotozoom' => {
                                        'defines' => [
                                                       '-DHAVE_SDL',
                                                       '-DHAVE_SDL_GFX_ROTOZOOM'
                                                     ],
                                        'libs' => {
                                                    'SDL_gfx_rotozoom' => 1,
                                                    'SDL' => 1
                                                  },
                                        'links' => [
                                                     '-lSDL',
                                                     '-lSDL_gfx'
                                                   ]
                                      },
                        'Mouse' => {
                                     'libs' => {
                                                 'SDL' => 1
                                               },
                                     'links' => [
                                                  '-lSDL'
                                                ],
                                     'defines' => [
                                                    '-DHAVE_SDL'
                                                  ]
                                   },
                        'TimerX' => {
                                      'links' => [
                                                   '-lSDL'
                                                 ],
                                      'libs' => {
                                                  'SDL' => 1
                                                },
                                      'defines' => [
                                                     '-DHAVE_SDL'
                                                   ]
                                    },
                        'GFX' => {
                                   'libs' => {
                                               'SDL' => 1,
                                               'SDL_gfx_primitives' => 1
                                             },
                                   'links' => [
                                                '-lSDL',
                                                '-lSDL_gfx'
                                              ],
                                   'defines' => [
                                                  '-DHAVE_SDL',
                                                  '-DHAVE_SDL_GFX_PRIMITIVES'
                                                ]
                                 },
                        'MixerGroups' => {
                                           'defines' => [
                                                          '-DHAVE_SDL',
                                                          '-DHAVE_SDL_MIXER'
                                                        ],
                                           'links' => [
                                                        '-lSDL',
                                                        '-lSDL_mixer'
                                                      ],
                                           'libs' => {
                                                       'SDL' => 1,
                                                       'SDL_mixer' => 1
                                                     }
                                         },
                        'Overlay' => {
                                       'links' => [
                                                    '-lSDL'
                                                  ],
                                       'libs' => {
                                                   'SDL' => 1
                                                 },
                                       'defines' => [
                                                      '-DHAVE_SDL'
                                                    ]
                                     },
                        'ValidateX' => {
                                         'libs' => {
                                                     'SDL' => 1
                                                   },
                                         'links' => [
                                                      '-lSDL'
                                                    ],
                                         'defines' => [
                                                        '-DHAVE_SDL'
                                                      ]
                                       },
                        'MixerMusic' => {
                                          'libs' => {
                                                      'SDL_mixer' => 1,
                                                      'SDL' => 1
                                                    },
                                          'links' => [
                                                       '-lSDL',
                                                       '-lSDL_mixer'
                                                     ],
                                          'defines' => [
                                                         '-DHAVE_SDL',
                                                         '-DHAVE_SDL_MIXER'
                                                       ]
                                        },
                        'Surface' => {
                                       'links' => [
                                                    '-lSDL'
                                                  ],
                                       'libs' => {
                                                   'SDL' => 1
                                                 },
                                       'defines' => [
                                                      '-DHAVE_SDL'
                                                    ]
                                     },
                        'Framerate' => {
                                         'libs' => {
                                                     'SDL_gfx_framerate' => 1,
                                                     'SDL' => 1
                                                   },
                                         'links' => [
                                                      '-lSDL',
                                                      '-lSDL_gfx'
                                                    ],
                                         'defines' => [
                                                        '-DHAVE_SDL',
                                                        '-DHAVE_SDL_GFX_FRAMERATE'
                                                      ]
                                       },
                        'AudioCVT' => {
                                        'libs' => {
                                                    'SDL' => 1
                                                  },
                                        'links' => [
                                                     '-lSDL'
                                                   ],
                                        'defines' => [
                                                       '-DHAVE_SDL'
                                                     ]
                                      },
                        'Image' => {
                                     'libs' => {
                                                 'SDL' => 1,
                                                 'SDL_image' => 1
                                               },
                                     'links' => [
                                                  '-lSDL',
                                                  '-lSDL_image'
                                                ],
                                     'defines' => [
                                                    '-DHAVE_SDL',
                                                    '-DHAVE_SDL_IMAGE'
                                                  ]
                                   },
                        'SDL' => {
                                   'libs' => {
                                               'SDL' => 1
                                             },
                                   'links' => [
                                                '-lSDL'
                                              ],
                                   'defines' => [
                                                  '-DHAVE_SDL'
                                                ]
                                 },
                        'MixerChannels' => {
                                             'links' => [
                                                          '-lSDL',
                                                          '-lSDL_mixer'
                                                        ],
                                             'libs' => {
                                                         'SDL_mixer' => 1,
                                                         'SDL' => 1
                                                       },
                                             'defines' => [
                                                            '-DHAVE_SDL',
                                                            '-DHAVE_SDL_MIXER'
                                                          ]
                                           },
                        'MixChunk' => {
                                        'defines' => [
                                                       '-DHAVE_SDL',
                                                       '-DHAVE_SDL_MIXER'
                                                     ],
                                        'links' => [
                                                     '-lSDL',
                                                     '-lSDL_mixer'
                                                   ],
                                        'libs' => {
                                                    'SDL' => 1,
                                                    'SDL_mixer' => 1
                                                  }
                                      },
                        'Version' => {
                                       'libs' => {
                                                   'SDL' => 1
                                                 },
                                       'links' => [
                                                    '-lSDL'
                                                  ],
                                       'defines' => [
                                                      '-DHAVE_SDL'
                                                    ]
                                     },
                        'MultiThread' => {
                                           'libs' => {
                                                       'SDL' => 1
                                                     },
                                           'links' => [
                                                        '-lSDL'
                                                      ],
                                           'defines' => [
                                                          '-DHAVE_SDL'
                                                        ]
                                         },
                        'FPSManager' => {
                                          'defines' => [
                                                         '-DHAVE_SDL',
                                                         '-DHAVE_SDL_GFX_FRAMERATE'
                                                       ],
                                          'libs' => {
                                                      'SDL_gfx_framerate' => 1,
                                                      'SDL' => 1
                                                    },
                                          'links' => [
                                                       '-lSDL',
                                                       '-lSDL_gfx'
                                                     ]
                                        },
                        'Cursor' => {
                                      'defines' => [
                                                     '-DHAVE_SDL'
                                                   ],
                                      'links' => [
                                                   '-lSDL'
                                                 ],
                                      'libs' => {
                                                  'SDL' => 1
                                                }
                                    },
                        'SurfaceX' => {
                                        'defines' => [
                                                       '-DHAVE_SDL',
                                                       '-DHAVE_SDL_GFX_PRIMITIVES'
                                                     ],
                                        'libs' => {
                                                    'SDL' => 1,
                                                    'SDL_gfx_primitives' => 1
                                                  },
                                        'links' => [
                                                     '-lSDL',
                                                     '-lSDL_gfx'
                                                   ]
                                      },
                        'MixerSamples' => {
                                            'defines' => [
                                                           '-DHAVE_SDL',
                                                           '-DHAVE_SDL_MIXER'
                                                         ],
                                            'libs' => {
                                                        'SDL_mixer' => 1,
                                                        'SDL' => 1
                                                      },
                                            'links' => [
                                                         '-lSDL',
                                                         '-lSDL_mixer'
                                                       ]
                                          },
                        'RWOps' => {
                                     'defines' => [
                                                    '-DHAVE_SDL'
                                                  ],
                                     'links' => [
                                                  '-lSDL'
                                                ],
                                     'libs' => {
                                                 'SDL' => 1
                                               }
                                   },
                        'Event' => {
                                     'defines' => [
                                                    '-DHAVE_SDL'
                                                  ],
                                     'links' => [
                                                  '-lSDL'
                                                ],
                                     'libs' => {
                                                 'SDL' => 1
                                               }
                                   },
                        'Pango' => {
                                     'links' => [
                                                  '-lSDL',
                                                  '-lSDL_Pango'
                                                ],
                                     'libs' => {
                                                 'SDL' => 1,
                                                 'SDL_Pango' => 1
                                               },
                                     'defines' => [
                                                    '-DHAVE_SDL',
                                                    '-DHAVE_SDL_PANGO'
                                                  ]
                                   },
                        'BlitFunc' => {
                                        'libs' => {
                                                    'SDL_gfx_blitfunc' => 1,
                                                    'SDL' => 1
                                                  },
                                        'links' => [
                                                     '-lSDL',
                                                     '-lSDL_gfx'
                                                   ],
                                        'defines' => [
                                                       '-DHAVE_SDL',
                                                       '-DHAVE_SDL_GFX_BLITFUNC'
                                                     ]
                                      },
                        'Color' => {
                                     'defines' => [
                                                    '-DHAVE_SDL'
                                                  ],
                                     'libs' => {
                                                 'SDL' => 1
                                               },
                                     'links' => [
                                                  '-lSDL'
                                                ]
                                   },
                        'TTF' => {
                                   'libs' => {
                                               'SDL' => 1,
                                               'SDL_ttf' => 1
                                             },
                                   'links' => [
                                                '-lSDL',
                                                '-lSDL_ttf'
                                              ],
                                   'defines' => [
                                                  '-DHAVE_SDL',
                                                  '-DHAVE_SDL_TTF'
                                                ]
                                 },
                        'Events' => {
                                      'libs' => {
                                                  'SDL' => 1
                                                },
                                      'links' => [
                                                   '-lSDL'
                                                 ],
                                      'defines' => [
                                                     '-DHAVE_SDL'
                                                   ]
                                    }
                      }
       },
       {},
       {}
     ];
$x; }