File: Makefile.PL

package info (click to toggle)
pdl 1%3A2.007-4
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,848 kB
  • ctags: 6,321
  • sloc: perl: 32,760; fortran: 13,113; ansic: 9,273; makefile: 81; sh: 32
file content (58 lines) | stat: -rw-r--r-- 1,815 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

# Makefile.PL for PDL::Primitive module.

# Use this as a template for the Makefile.PL for
# any external PDL module.

use ExtUtils::MakeMaker;
use Config;

PDL::Core::Dev->import();

@pack = (["primitive.pd",Primitive,PDL::Primitive]);

if ($^O eq 'dec_osf') {
       require Config;
       if ($Config::Config{cc} =~ /^cc/) {
               my $no_optimize = $::PDL_OPTIONS{OPTIMIZE}
                                || $Config::Config{optimize}
                                || '-g2';
               $no_optimize =~ s/(\s|^)(-O)\d/$1${2}0/;
               $no_optimize =~ s/(\s|^)(-g)\d/$1${2}2/;
               print <<EOT;
       Digital Unix cc optimizer has a bug that is
       triggered by primitive.c. Therefore
EOT
               # Becaue OPTIMIZE in PASTHRU it can't be overridden so
               # it gets hard coded in Makefile
               eval q|
                       sub MY::const_cccmd {
                               package MY;
                               my $defval = shift->SUPER::const_cccmd(@_);
                               $defval =~ s/\$\(OPTIMIZE\)/|
                                       . $no_optimize . q|/gs;
                               print "$defval\n";
                               return $defval;
                       };
               |;
       }
}


#WriteMakefile(
# pdlpp_stdargs_int(@::pack)
#);
%hash = pdlpp_stdargs_int(@::pack);
$hash{LIBS}->[0] .= ' -lm';

# If we don't do this, and Perl core is using the wrapped API, then it will
# call (say) srand48_r(), and get its random numbers from drand48_r(), but we
# will get ours from drand48(), and srand48() never gets called.
$hash{CCFLAGS} ||= $Config{ccflags};
$hash{CCFLAGS} .= ' -DPERL_REENTR_API';

WriteMakefile(%hash);

sub MY::postamble {
	pdlpp_postamble_int(@::pack);
}  # Add genpp rule