PGPLOT
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
'PNDRIV' => 'png',
'AQDRIV' => 'aquaterm',
);
while (<$fh>) {
next if /^\s*$/ or /^!/; # /; (comment is to un-confuse emacs highlighting)
chomp;
my @words = split;
if ( exists $libs{$words[0]} ) {
$retval .= " -l" . $libs{$words[0]};
delete $libs{$words[0]}; # since the driver can appear multiple times in drivers.list
}
}
$fh->close;
return $retval;
} # sub: find_required_driver_libs()
# What os are we using?
#
my $is_vms = $^O eq "VMS";
my $is_osx = $^O eq "darwin";
my $is_win32 = $^O =~ /mswin32/i;
# Move the logic out of the WriteMakefile statement to make it a
# bit easier to follow. We use the %items hash to store key,value
# pairs that will be used in the WriteMakefile call. Note that
# some key settings are platform specific.
#
my %items;
$items{DEFINE} = "-DNO_TRAILING_USCORE"
unless ExtUtils::F77->trail_;
$items{DLEXT} = "xs.dll" if $is_win32;
if ( $is_vms ) {
$items{INC} = 'pgplot_dir:';
$items{LIBS} = 'pgplot_dir:cpgplot.olb';
} else {
$items{INC} = $IDIRS;
$items{OBJECT} = '$(BASEEXT)$(OBJ_EXT) pgplot_tmp/libcpgplot.a ' .
'pgplot_tmp/libpgplot.a'
if -d 'pgplot_tmp';
$items{LIBS} = [ join( ' ', $LIBDIRS, $LIBS, ExtUtils::F77->runtime ) ];
# This is not ideal since it assumes that:
# objc is required
# the logic in find_required_driver_libs() is correct
# the libraries are located either in a location pointed to by LDFLAGS
# or in /sw/lib
#
if ($is_osx) {
my $pgplot_dir = defined $ENV{PGPLOT_DIR} ? $ENV{PGPLOT_DIR} : "/usr/lib";
my $dir = -d 'pgplot_tmp' ? 'pgplot_tmp' : $pgplot_dir;
$items{LIBS}[0] .= " -lobjc " .
(defined $ENV{LDFLAGS} ? $ENV{LDFLAGS} : "-L/sw/lib") .
find_required_driver_libs($pgplot_dir);
}
# The following is needed for PGPLOT compiled on OS-X, at least
# for both the version used from FINK and a hand-compiled version.
#
$items{LDDLFLAGS} = "$Config{lddlflags} -Wl,-framework -Wl,Foundation"
if $is_osx;
# Nasty hack to build only i386/x86_64 only instead of a Universal binary on OS X
# I put this in to avoid an error if linking with the pgplot libs in
# SciKarl (2.4.6 and above). Hope one day to remove this.
# - Karl Glazebrook
if ($is_osx) {
$items{CCFLAGS} = $Config{ccflags};
$items{LDFLAGS} = $Config{ldflags};
$items{LDDLFLAGS} = $Config{lddlflags};
# Added this 11/1/2021 to avoid warnings about 'compact unwinds' on MacOS11
my @darwin_vers = split("\\.",$Config{osvers}); # Darwin version XX.YY.ZZ
if ($darwin_vers[0]>=20) { # Big Sur
$items{LDDLFLAGS} .= " -Wl,-no_compact_unwind"; # Avoid mess of warnings about this
}
# Karl - now figure out automagically WHICH binary arch
# to build for and change the various flags
mac_universal( \$items{CCFLAGS}, \$items{LDFLAGS}, \$items{LDDLFLAGS});
print "TEST $items{CCFLAGS}\n";
print "TEST $items{LDFLAGS}\n";
print "TEST $items{LDDLFLAGS}\n";
}
}
my @prereq;
my %min_version = (
'PDL' => '2.089', # broadcast_define, no PGPLOT
);
for my $opt_dep (sort keys %min_version) {
(my $file = $opt_dep) =~ s#::#/#g;
next if !eval { require "$file.pm"; 1 }; # not installed, fine
next if eval { $opt_dep->VERSION($min_version{$opt_dep}); 1 };
push @prereq, $opt_dep => $min_version{$opt_dep};
}
WriteMakefile(
'NAME' => 'PGPLOT',
MIN_PERL_VERSION => '5.010001',
'CONFIGURE_REQUIRES' => { 'ExtUtils::F77' => 1.13, 'Devel::CheckLib' => '1.14' },
'TEST_REQUIRES' => { 'Test::More' => '0.88' },
PREREQ_PM => { @prereq },
'VERSION_FROM' => 'lib/PGPLOT.pm',
'dist' => { COMPRESS=>"gzip", SUFFIX=>"gz" },
'depend' => { '$(OBJECT)' => q[pgfun.c arrays.c PGPLOT.c]},
'META_MERGE' => {
"meta-spec" => { version => 2 },
( run in 1.343 second using v1.01-cache-2.11-cpan-6736b670a1e )