Skip to content

Commit

Permalink
pdlpp_eumm_update_deep to add INC, TYPEMAPS, XSMULTI, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Nov 23, 2024
1 parent d639005 commit dca7f8b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
2 changes: 0 additions & 2 deletions Basic/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ WriteMakefile(
},
},
DEFINE => $pthread_define,
INC => PDL::Core::Dev::PDL_INCLUDE(),
TYPEMAPS => [PDL::Core::Dev::PDL_TYPEMAP()],
LIBS => [$libs_string],
depend => {
$core_obj => $hdeps,
Expand Down
33 changes: 24 additions & 9 deletions Basic/lib/PDL/Core/Dev.pm
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,24 @@ As a side effect, the setting of the C<EXTRAS> value can be seen
by the build process.
To have the only F<Makefile.PL> work in this new scheme, converting
it from the previous one(s), you need to add these keys to the
C<WriteMakefile> call, some of which may previously have been
supplied by C<pdlpp_stdargs>:
it from the previous one(s), you need to add this key to the
C<WriteMakefile> call:
VERSION_FROM => 'lib/PDL/GSL/CDF.pd',
MIN_PERL_VERSION => '5.014', # PDL as of 2.094
LIBS => [$GSL_libs],
XSMULTI => 1,
TYPEMAPS => [PDL::Core::Dev::PDL_TYPEMAP()],
INC => join(' ', PDL::Core::Dev::PDL_INCLUDE(), "-I".curdir(), $GSL_includes),
dist => {PREOP => '$(PERLRUNINST) -MPDL::Core::Dev -e pdlpp_mkgen $(DISTVNAME)' },
Note that the ones supplied by C<pdlpp_stdargs> are added for you. You I<do>
need to provide overrides for C<postamble> as before, and also C<init_PM>:
{
my @pd_srcs;
package MY; # so that "SUPER" works right
sub init_PM {
my ($self) = @_;
$self->SUPER::init_PM;
@pd_srcs = ::pdlpp_eumm_update_deep($self);
}
sub postamble { ::pdlpp_postamble(@pd_srcs) }
}
=head1 FUNCTIONS
Expand Down Expand Up @@ -273,6 +280,14 @@ sub pdlpp_eumm_update_deep {
my $xsb = $eumm->{XSBUILD}{xs} ||= {};
$eumm->{clean}{FILES} ||= '';
$eumm->{OBJECT} ||= '';
$eumm->{INC} ||= '';
my $pdl_inc = PDL_INCLUDE();
$eumm->{INC} .= ' '.$pdl_inc if index($eumm->{INC}, $pdl_inc) == -1;
my $tms = $eumm->{TYPEMAPS} ||= [];
my $pdl_tm = PDL_TYPEMAP();
push @$tms, $pdl_tm if !grep $_ eq $pdl_tm, @$tms;
$eumm->{XSMULTI} ||= 1;
$eumm->{dist}{PREOP} ||= '$(PERLRUNINST) -MPDL::Core::Dev -e pdlpp_mkgen $(DISTVNAME)';
my $xs = $eumm->{XS} ||= {};
my $global_version = $eumm->parse_version($eumm->{VERSION_FROM});
my @pd_srcs;
Expand Down
4 changes: 1 addition & 3 deletions Libtmp/GSL/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ WriteMakefile(
NAME => 'PDL::GSL',
VERSION_FROM => 'lib/PDL/GSL/CDF.pd',
MIN_PERL_VERSION => '5.014',
XSMULTI => 1,
TYPEMAPS => [PDL::Core::Dev::PDL_TYPEMAP()],
INC => join(' ', PDL::Core::Dev::PDL_INCLUDE(), "-I".curdir(), $GSL_includes),
INC => join(' ', "-I".curdir(), $GSL_includes),
LIBS => [$GSL_libs],
clean => { FILES => join ' ', qw(MANIFEST.bak) },
NO_MYMETA => 1,
Expand Down
4 changes: 1 addition & 3 deletions Libtmp/Transform-Proj4/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ WriteMakefile(
NAME => 'PDL::Transform::Proj4',
VERSION_FROM => 'lib/PDL/Transform/Proj4.pd',
MIN_PERL_VERSION => '5.014',
XSMULTI => 1,
INC => PDL::Core::Dev::PDL_INCLUDE() . ' ' . Alien::proj->cflags,
TYPEMAPS => [PDL::Core::Dev::PDL_TYPEMAP()],
INC => Alien::proj->cflags,
LIBS => [Alien::proj->libs],
clean => { FILES => join ' ', qw(MANIFEST.bak) },
NO_MYMETA => 1,
Expand Down

0 comments on commit dca7f8b

Please sign in to comment.