Print this page
3900 illumos will not build against gcc compiled perl
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Exacct/Object/Makefile.PL
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Exacct/Object/Makefile.PL
1 1 #
2 2 # Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
3 3 #
4 4
5 5 #
6 6 # Makefile.PL for ::Exacct::Object
7 7 #
8 8
9 9 # See ../Makefile.PL for an explanation of the linker flag manipulations.
10 10
11 -require 5.8.4;
11 +require 5.0010;
12 12 use strict;
13 13 use warnings;
14 14 use ExtUtils::MakeMaker;
15 15
16 16 #
17 17 # Some later versions of ExtUtils::MakeMaker are broken,
18 18 # and complain about function redefinitions in the child Makefile.PLs.
19 19 # Stop the warnings.
20 20 #
21 21 no warnings qw(redefine);
22 22
23 23 our (@defines, @man3pods);
24 24
25 25 #
26 26 # MakeMaker overrides.
27 27 #
28 28 package MY;
29 29 no warnings qw(once);
30 30
31 31 #
32 32 # Overrides that are common to both the ON and non-ON build environments.
33 33 #
34 34
35 35 #
36 36 # Suppress the setting of LD_RUN_PATH, as it isn't necessary.
37 37 #
38 38
39 39 sub const_loadlibs
40 40 {
41 41 my $self = shift(@_);
42 42 delete($self->{LD_RUN_PATH});
43 43 return($self->SUPER::const_loadlibs(@_));
44 44 }
45 45
46 46 sub dynamic_lib
47 47 {
48 48 my $self = shift(@_);
49 49 my $txt = $self->SUPER::dynamic_lib(@_);
50 50 $txt =~ s/LD_RUN_PATH=\S*\s*//;
51 51 return($txt);
52 52 }
53 53
54 54 #
55 55 # ON-specific overrides.
56 56 #
57 57 if (exists($ENV{CODEMGR_WS}) && exists($ENV{ENVCPPFLAGS1})) {
58 58 #
59 59 # Override postamble and replace it with one that explicitly records
60 60 # the dependency between Object.c (generated from Object.xs by xsubpp)
61 61 # and the ObjectDefs.xi file (generated from sys/exacct.h by
62 62 # extract_defines). Note we have to mimic the -I processing done by cc
63 63 # to find the correct version of the file, as we want the copy from the
64 64 # proto area rather than /usr/include. This ensures that the constant
65 65 # values exported by the perl module stay up-to date with the
66 66 # corresponding #defines.
67 67 #
68 68 *postamble = sub {
69 69 return <<'EOF';
70 70 EXACCT_H:sh= \
71 71 for dir in $ENVCPPFLAGS1 $ENVCPPFLAGS2 $ENVCPPFLAGS3 $ENVCPPFLAGS4 \
72 72 /usr/include; do \
73 73 dir=`expr $dir : '^-I\(.*\)$' \| $dir`; \
74 74 file="$dir/sys/exacct.h"; \
75 75 test -f $file && echo $file && break; \
76 76 done;
77 77
78 78 Object.c: ObjectDefs.xi
79 79
80 80 ObjectDefs.xi: ../extract_defines $(EXACCT_H)
81 81 $(PERL) ../extract_defines Object $@ $(EXACCT_H)
82 82 EOF
83 83 };
84 84
85 85 # Enable/disable debugging as required.
86 86 @main::defines = ( DEFINE => '-DEXACCT_DEBUG' )
87 87 if (! exists($ENV{RELEASE_BUILD}));
88 88
89 89 # Don't install POD pages for ON.
90 90 @main::man3pods = ( MAN3PODS => {} );
91 91
92 92 #
93 93 # Non-ON overrides.
94 94 #
95 95 } else {
96 96 #
97 97 # Override postamble and replace it with one that explicitly records
98 98 # the dependency between Object.c (generated from Object.xs by xsubpp)
99 99 # and the ObjectDefs.xi file (generated from /usr/include/sys/exacct.h
100 100 # by # extract_defines). This ensures # that the constant values
101 101 # exported by the perl module stay up-to date with the corresponding
102 102 # #defines.
103 103 #
104 104 *postamble = sub {
105 105 return <<'EOF';
106 106 EXACCT_H = /usr/include/sys/exacct.h
107 107
108 108 Object.c: ObjectDefs.xi
109 109
110 110 ObjectDefs.xi: ../extract_defines $(EXACCT_H)
111 111 $(PERL) ../extract_defines Object $@ $(EXACCT_H)
112 112 EOF
113 113 };
114 114
115 115 # Install the POD documentation for non-ON builds.
116 116 my $man3pfx = '$(INST_MAN3DIR)/Sun::Solaris::Exacct';
117 117 @main::man3pods = ( MAN3PODS => {
118 118 '../pod/Object.pod' => $man3pfx . '::Object.$(MAN3EXT)',
119 119 '../pod/Item.pod' => $man3pfx . '::Object::Item.$(MAN3EXT)',
120 120 '../pod/Group.pod' => $man3pfx . '::Object::Group.$(MAN3EXT)'
121 121 });
122 122 }
123 123
124 124 #
125 125 # Having set everything up, write the Makefile.
126 126 #
127 127 package main;
128 128
129 129 WriteMakefile(
130 130 NAME => 'Sun::Solaris::Exacct::Object',
131 131 VERSION_FROM => 'Object.pm',
132 132 H => [ '../exacct_common.xh' ],
133 133 TYPEMAPS => [ '../typemap' ],
134 134 @defines,
135 135 @man3pods,
136 136 dynamic_lib => { OTHERLDFLAGS =>
137 137 '-h $(DLBASE).$(DLEXT) ' .
138 138 '-R\$$ORIGIN/.. $(INST_ARCHAUTODIR)/../Exacct.so'
139 139 },
140 140 realclean => { FILES => 'ObjectDefs.xi' },
141 141 );
↓ open down ↓ |
120 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX