Alien-SDL2

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

NAME
    Alien::SDL2 - building, finding and using SDL2 binaries

VERSION
    Version 0.002

SYNOPSIS
    Alien::SDL2 tries (in given order) during its installation:

    *   When given "--with-sdl2-config" option use specified sdl2-config
        script to locate SDL2 libs.

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

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

         perl Build.PL --with-sdl2-config

        IMPORTANT NOTE: Using --with-sdl2-config avoids considering any
        other build methods; no prompt with other available build options.

    *   Locate an already installed SDL2 via 'sdl2-config' script.

    *   Download prebuilt SDL2 binaries (if available for your platform).

    *   Build SDL2 binaries from source codes (if possible on your system).

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

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

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

DESCRIPTION
    Please see Alien for the manifesto of the Alien namespace.

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

    The important facts:

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

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

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

    *   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::SDL2
        offers some special functionality (see below).

METHODS
  config()
    This function is the main public interface to this module. Basic
    functionality works in a very similar maner to 'sdl2-config' script:

        Alien::SDL2->config('prefix');   # gives the same string as 'sdl2-config --prefix'
        Alien::SDL2->config('version');  # gives the same string as 'sdl2-config --version'
        Alien::SDL2->config('libs');     # gives the same string as 'sdl2-config --libs'
        Alien::SDL2->config('cflags');   # gives the same string as 'sdl2-config --cflags'

    On top of that this function supports special parameters:



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