This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix up dtrace compile/link for Solaris
[perl5.git] / ext / XS-APItest / Makefile.PL
CommitLineData
3e61d65a
JH
1use 5.008;
2use ExtUtils::MakeMaker;
55289a74 3use ExtUtils::Constant 0.11 'WriteConstants';
95ddc675 4use Config;
42ef68d0 5
efc4bddf
DM
6my $dtrace_o = $Config{dtraceobject} ? ' dtrace$(OBJ_EXT)' : '';
7
3e61d65a
JH
8WriteMakefile(
9 'NAME' => 'XS::APItest',
10 'VERSION_FROM' => 'APItest.pm', # finds $VERSION
11 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1
8c5ae9a3 12 ABSTRACT_FROM => 'APItest.pm', # retrieve abstract from module
83f8bb56 13 AUTHOR => 'Tim Jenness <t.jenness@jach.hawaii.edu>, Christian Soeller <csoelle@mph.auckland.ac.nz>, Hugo van der Sanden <hv@crypt.compulink.co.uk>, Andrew Main (Zefram) <zefram@fysh.org>',
34482cd6 14 'C' => ['exception.c', 'core.c', 'notcore.c'],
efc4bddf 15 'OBJECT' => '$(BASEEXT)$(OBJ_EXT) XSUB-undef-XS_VERSION$(OBJ_EXT) XSUB-redefined-macros$(OBJ_EXT) $(O_FILES)'. $dtrace_o,
55289a74 16 realclean => {FILES => 'const-c.inc const-xs.inc'},
95ddc675 17 ($Config{gccversion} && $Config{d_attribute_deprecated} ?
42ef68d0 18 (CCFLAGS => $Config{ccflags} . ' -Wno-deprecated-declarations') : ()),
048a2f47
FC
19 depend => { 'core.o' => 'core_or_not.inc',
20 'notcore.o' => 'core_or_not.inc' },
55289a74
NC
21);
22
7d255dc8
NC
23my @names = (qw(HV_DELETE HV_DISABLE_UVAR_XKEY HV_FETCH_ISSTORE
24 HV_FETCH_ISEXISTS HV_FETCH_LVALUE HV_FETCH_JUST_SV
25 G_SCALAR G_ARRAY G_VOID G_DISCARD G_EVAL G_NOARGS
26 G_KEEPERR G_NODEBUG G_METHOD G_FAKINGEVAL
27 IS_NUMBER_IN_UV IS_NUMBER_GREATER_THAN_UV_MAX
28 IS_NUMBER_NOT_INT IS_NUMBER_NEG IS_NUMBER_INFINITY
e222d7e2 29 IS_NUMBER_NAN IS_NUMBER_TRAILING PERL_SCAN_TRAILING
7d255dc8
NC
30 ),
31 {name=>"G_WANT", default=>["IV", "G_ARRAY|G_VOID"]});
32
33open my $fh, '../../overload.h' or die "Can't open ../../overload.h: $!";
34while (<$fh>) {
35 push @names, {name => $1, macro => 1} if /^\s+([A-Za-z_0-9]+_amg),/;
36}
37
55289a74
NC
38WriteConstants(
39 PROXYSUBS => 1,
40 NAME => 'XS::APItest',
7d255dc8 41 NAMES => \@names,
b8d2d791 42 );
3e61d65a
JH
43
44sub MY::install { "install ::\n" };
efc4bddf
DM
45
46
47sub MY::postamble
48{
49 package MY;
50 my $post = shift->SUPER::postamble(@_);
51 use Config;
52 return $post unless $Config{dtraceobject};
53
54 # core.o is build using PERL_CORE, so picks up any dtrace probes
55
56 $post .= <<POSTAMBLE;
57
58DTRACE_D = ../../perldtrace.d
59
60dtrace\$(OBJ_EXT): \$(DTRACE_D) core\$(OBJ_EXT)
61 $Config{dtrace} -G -s \$(DTRACE_D) -o dtrace\$(OBJ_EXT) core\$(OBJ_EXT)
62POSTAMBLE
63
64 return $post;
65}