4555 macro side-effects with /usr/include/libelf.h
[illumos-gate.git] / usr / src / cmd / perl / contrib / Sun / Solaris / Project / Makefile.PL
blob54a5a5df8c7cddd00262217323327dd51fe7fb92
2 # Copyright (c) 1999, 2008 Oracle and/or its affiliates. All rights reserved.
6 # Makefile.PL for ::Project
9 require 5.8.4;
10 use strict;
11 use warnings;
12 use ExtUtils::MakeMaker;
14 # #defines.
15 my @defines = ( DEFINE => exists($ENV{RELEASE_BUILD}) ? '-DNDEBUG' : '' );
17 # List of POD pages to install.
18 my @man3pods = ( MAN3PODS => {} );
21 # If not building as part of ON.
23 if (! exists($ENV{CODEMGR_WS})) {
25         #
26         # Suppress the setting of LD_RUN_PATH.  The ON build environment
27         # contains a modified MakeMaker that does this automatically, so we
28         # only need to do this if we are building outside of ON.
29         #
30         package MY;
31         no warnings qw(once);
33         # Override const_loadlibs to remove LD_RUN_PATH cruft.
34         *const_loadlibs = sub
35         {
36                 my $self = shift(@_);
37                 delete($self->{LD_RUN_PATH});
38                 return($self->SUPER::const_loadlibs(@_));
39         };
41         # Override dynamic_lib to get rid of LD_RUN_PATH cruft.
42         *dynamic_lib = sub
43         {
44                 my $self = shift(@_);
45                 my $txt = $self->SUPER::dynamic_lib(@_);
46                 $txt =~ s/LD_RUN_PATH=\S*\s*//;
47                 return($txt);
48         };
50         # Turn off debugging.
51         @defines = ();
53         #
54         # Install the POD documentation for non-ON builds.
55         #
56         my $man3pfx = '$(INST_MAN3DIR)/Sun::Solaris::Project';
57         @man3pods = (
58             MAN3PODS => { 'pod/Project.pod' => $man3pfx . '.$(MAN3EXT)' }
59         );
62 WriteMakefile(
63     NAME         => 'Sun::Solaris::Project',
64     VERSION_FROM => 'Project.pm',
65      LIBS         => '-lproject -lgen',
66     @defines,
67     @man3pods,