Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add optional 4th array-ref build-deps param to pdlpp_postamble_int
  • Loading branch information
mohawk2 committed Mar 18, 2015
1 parent ee66fd0 commit aa7c613
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
33 changes: 24 additions & 9 deletions Basic/Core/Dev.pm
Expand Up @@ -364,25 +364,40 @@ EOF
}

# Expects list in format:
# [gtest.pd, GTest, PDL::GTest], [...]
# source, prefix,module/package
# The idea is to support in future several packages in same dir.
# [gtest.pd, GTest, PDL::GTest, ['../GIS/Proj', ...] ], [...]
# source, prefix,module/package, optional deps
# The idea is to support in future several packages in same dir - EUMM
# 7.06 supports
# each optional dep is a relative dir that a "make" will chdir to and
# "make" first - so the *.pd file can then "use" what it makes

# This is the function internal for PDL.
# Later on, we shall provide another for use outside PDL.
#

sub pdlpp_postamble_int {
join '',map { my($src,$pref,$mod) = @$_;
join '',map { my($src,$pref,$mod, $deps) = @$_;
die "If give dependencies, must be array-ref" if $deps and !ref $deps;
my $w = whereami_any();
$w =~ s%/((PDL)|(Basic))$%%; # remove the trailing subdir
my $basic = File::Spec->abs2rel(File::Spec->catdir($w, 'Basic'));
my $top = File::Spec->abs2rel($w);
my $basic = File::Spec->catdir($top, 'Basic');
my $core = File::Spec->catdir($basic, 'Core');
my $gen = File::Spec->catdir($basic, 'Gen');

my $depbuild = '';
for my $dep (@{$deps || []}) {
my $target = '';
if ($dep eq 'core') {
$dep = $top;
$target = ' core';
}
require ExtUtils::MM;
$dep =~ s#([\(\)])#\\$1#g; # in case of unbalanced (
$depbuild .= MM->oneliner("exit(!(chdir q($dep) && !system(q(\$(MAKE)$target))))");
$depbuild .= "\n\t";
}
qq|
$pref.pm: $src $core/Types.pm
\$(PERLRUNINST) \"-MPDL::PP qw/$mod $mod $pref/\" $src
$depbuild\$(PERLRUNINST) \"-MPDL::PP qw/$mod $mod $pref/\" $src
$pref.xs: $pref.pm
\$(TOUCH) \$@
Expand Down
2 changes: 1 addition & 1 deletion Lib/Transform/Proj4/Makefile.PL
Expand Up @@ -142,7 +142,7 @@ if ($msg && $forcebuild==0) {
return if $donot; # yes, this must be return (exit will kill Makefile.PL process)

my $ppfile = "Proj4.pd";
my $package = [$ppfile, 'Proj4', $package_name];
my $package = [$ppfile, 'Proj4', $package_name, [ qw(core ../../GIS/Proj) ]];
my %hash = pdlpp_stdargs($package);
$hash{VERSION_FROM} = $ppfile;
#$hash{TYPEMAPS} = [&PDL_TYPEMAP()];
Expand Down
13 changes: 0 additions & 13 deletions Lib/Transform/Proj4/Proj4.pd
@@ -1,21 +1,9 @@
#
# Proj4.pd
#
# PDL::PP Definition file for the PDL::Transform::Proj4 module
#
# Judd Taylor, USF IMaRS
# 4 Apr 2006
#

use strict;

# It won't build without this:
# 8 Aug 2006 - JT - Well, I guess it can!
#use lib '../../../blib/lib';
#use lib '../../../blib/arch';

use PDL;
#use PDL::Transform; # This is not needed, and just causes trouble!
use PDL::GIS::Proj;

use vars qw( $VERSION );
Expand All @@ -24,7 +12,6 @@ $VERSION = "1.32";
pp_add_isa( 'PDL::Transform' );

# This array holds the list of functions we want to export (everything here is explicit!)
#
my @export_funcs = ();

pp_addbegin( <<'ENDBEGIN' );
Expand Down

0 comments on commit aa7c613

Please sign in to comment.