The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Alien::Proj4 - Give install info for already-installed proj4

SYNOPSIS

In Makefile.PL:

  use Alien::Proj4 [ 'overridelibdirs' ], [ 'overrideincdirs' ];
  my $proj4_installed = Alien::Proj4->installed;
  my $proj4_lib = Alien::Proj4->libflags;
  my $proj4_inc = Alien::Proj4->incflags;

In a module like PDLA::Transform::Proj4 that wants available proj4 projections:

  my @projections = Alien::Proj4->projections;

DESCRIPTION

If no override is given for the library or include directories, the defaults are used. The projections are listed using Inline::C, so that needs to be installed.

An alternative idiom to the above compile-time example of supplying overrides for directories is:

  use Alien::Proj4;
  Alien::Proj4->import(\@libdirs, undef) if @libdirs; # set to different
  Alien::Proj4->import(undef, [ Alien::Proj4->default_inc, @incdirs ]); # add

since the overrides have no effect if undef is supplied as the array-ref, OR the array is empty.

Note as above that there are default_inc and default_lib methods to get the defaults.

Currently the incflags method includes a separate search for proj_api.h and projects.h. This is so that if (as in PJ_VERSION = 480) there is no projects.h supplied, you can provide one and add the location to the list of directories searched, using import as above.

AUTHOR

Ed J