Alien-SDL

 view release on metacpan or  search on metacpan

lib/Alien/SDL.pm  view on Meta::CPAN

package Alien::SDL;
use strict;
use warnings;
use Alien::SDL::ConfigData;
use File::ShareDir qw(dist_dir);
use File::Spec;
use File::Find;
use File::Spec::Functions qw(catdir catfile rel2abs);
use File::Temp;
use Capture::Tiny;
use Config;

=head1 NAME

Alien::SDL - building, finding and using SDL binaries

=head1 VERSION

Version 1.446

=cut

our $VERSION = '1.446';
$VERSION = eval $VERSION;

=head1 SYNOPSIS

Alien::SDL tries (in given order) during its installation:

=over

=item * When given C<--with-sdl-config> option use specified sdl-config
script to locate SDL libs.

 perl Build.PL --with-sdl-config=/opt/sdl/bin/sdl-config

or using default script name 'sdl-config' by running:

 perl Build.PL --with-sdl-config

B<IMPORTANT NOTE:> Using --with-sdl-config avoids considering any other
build methods; no prompt with other available build options.

=item * Locate an already installed SDL via 'sdl-config' script.

=item * Check for SDL libs in directory specified by SDL_INST_DIR variable.
In this case the module performs SDL library detection via
'$SDL_INST_DIR/bin/sdl-config' script.

 SDL_INST_DIR=/opt/sdl perl ./Build.PL

=item * Download prebuilt SDL binaries (if available for your platform).

=item * Build SDL binaries from source codes (if possible on your system).

=back

Later you can use Alien::SDL in your module that needs to link agains SDL
and/or related libraries like this:

    # Sample Makefile.pl
    use ExtUtils::MakeMaker;
    use Alien::SDL;

    WriteMakefile(
      NAME         => 'Any::SDL::Module',
      VERSION_FROM => 'lib/Any/SDL/Module.pm',
      LIBS         => Alien::SDL->config('libs', [-lAdd_Lib]),
      INC          => Alien::SDL->config('cflags'),
      # + additional params
    );

=head1 DESCRIPTION

Please see L<Alien> for the manifesto of the Alien namespace.

In short C<Alien::SDL> can be used to detect and get
configuration settings from an installed SDL and related libraries.
Based on your platform it offers the possibility to download and
install prebuilt binaries or to build SDL & co. from source codes.

The important facts:

=over

=item * The module does not modify in any way the already existing SDL
installation on your system.

=item * If you reinstall SDL libs on your system you do not need to
reinstall Alien::SDL (providing that you use the same directory for
the new installation).

=item * The prebuild binaries and/or binaries built from sources are always
installed into perl module's 'share' directory.

=item * If you use prebuild binaries and/or binaries built from sources
it happens that some of the dynamic libraries (*.so, *.dll) will not
automaticly loadable as they will be stored somewhere under perl module's
'share' directory. To handle this scenario Alien::SDL offers some special
functionality (see below).

=back



( run in 0.528 second using v1.01-cache-2.11-cpan-0b5f733616e )