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/Makefile.PL
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Exacct/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
7 7 #
8 8
9 9 #
10 10 # Linker flags note:
11 11 # The various .so files that comprise the ::Exacct module need to be able to
12 12 # cross-call each other, and therefore to prevent runtime linker errors it is
13 13 # necessary to establish linker dependencies between the various .so files.
14 14 #
15 15 # This causes several problems. The first of these is that perl .so files are
16 16 # built in one directory (under ../blib in this case) and installed into
17 17 # another, so it is necessary to record the dependency using a path relative to
18 18 # the dependent. This can be done with the $ORIGIN linker mechanism.
19 19
20 20 # The second problem is that it is necessary to specify the name of the
21 21 # dependee at link edit time in a manner that doesn't result in the build-time
22 22 # path of the dependee being hard coded in to the dependent, as this would
↓ open down ↓ |
22 lines elided |
↑ open up ↑ |
23 23 # stop ld.so.1 performing its normal search process for the files. This can't
24 24 # be done with the normal '--L/my/lib/path -lmylib' mechanism, because the XSUB
25 25 # .so files aren't prefixed with 'lib'. To do this the -h linker flag is used
26 26 # to explicitly set the SONAME in the dependee. This is then used as the name
27 27 # of the dependent in the dependee rather than the full path by which it was
28 28 # found at link edit time.
29 29 #
30 30 # For more details, refer to the Linker and Libraries Guide.
31 31 #
32 32
33 -require 5.8.4;
33 +require 5.0010;
34 34 use strict;
35 35 use warnings;
36 36 use ExtUtils::MakeMaker;
37 37
38 38 our (@defines, @man3pods);
39 39
40 40 #
41 41 # MakeMaker overrides.
42 42 #
43 43 package MY;
44 44 no warnings qw(once);
45 45
46 46 #
47 47 # Overrides that are common to both the ON and non-ON build environments.
48 48 #
49 49
50 50 #
51 51 # Force the parent directory to be built first, because the sub-modules all
52 52 # have a linker dependency against Exacct.so.
53 53 #
54 54 sub top_targets
55 55 {
56 56 my $self = shift(@_);
57 57 my $txt = $self->SUPER::top_targets(@_);
58 58 $txt =~ s/pm_to_blib subdirs/pm_to_blib \$(LINKTYPE) .WAIT subdirs/;
59 59 return($txt);
60 60 }
61 61
62 62 #
63 63 # Make 'install' wait for 'all' to complete.
64 64 #
65 65 sub install
66 66 {
67 67 my $self = shift(@_);
68 68 my $txt = $self->SUPER::install(@_);
69 69 $txt =~ s/ all / all .WAIT /g;
70 70 return($txt);
71 71 }
72 72
73 73 #
74 74 # Suppress the setting of LD_RUN_PATH, as it isn't necessary.
75 75 #
76 76 sub const_loadlibs
77 77 {
78 78 my $self = shift(@_);
79 79 delete($self->{LD_RUN_PATH});
80 80 return($self->SUPER::const_loadlibs(@_));
81 81 }
82 82
83 83 sub dynamic_lib
84 84 {
85 85 my $self = shift(@_);
86 86 my $txt = $self->SUPER::dynamic_lib(@_);
87 87 $txt =~ s/LD_RUN_PATH=\S*\s*//;
88 88 return($txt);
89 89 }
90 90
91 91 #
92 92 # ON-specific overrides.
93 93 #
94 94 if (exists($ENV{CODEMGR_WS}) && exists($ENV{ENVCPPFLAGS1})) {
95 95 #
96 96 # Override postamble and replace it with one that explicitly records
97 97 # the dependency between Exacct.c (generated from Exacct.xs by xsubpp)
98 98 # and the ExacctDefs.xi file (generated from sys/exacct.h by
99 99 # extract_defines). Note we have to mimic the -I processing done by cc
100 100 # to find the correct version of the file, as we want the copy from the
101 101 # proto area rather than /usr/include. This ensures that the constant
102 102 # values exported by the perl module stay up-to date with the
103 103 # corresponding #defines.
104 104 #
105 105 *postamble = sub {
106 106 return <<'EOF';
107 107 EXACCT_H:sh= \
108 108 for dir in $ENVCPPFLAGS1 $ENVCPPFLAGS2 $ENVCPPFLAGS3 $ENVCPPFLAGS4 \
109 109 /usr/include; do \
110 110 dir=`expr $dir : '^-I\(.*\)$' \| $dir`; \
111 111 file="$dir/sys/exacct.h"; \
112 112 test -f $file && echo $file && break; \
113 113 done;
114 114
115 115 Exacct.c: ExacctDefs.xi
116 116
117 117 ExacctDefs.xi: extract_defines $(EXACCT_H)
118 118 $(PERL) extract_defines Exacct $@ $(EXACCT_H)
119 119 EOF
120 120 };
121 121
122 122 # Enable/disable debugging as required.
123 123 @main::defines = ( DEFINE => '-DEXACCT_DEBUG' )
124 124 if (! exists($ENV{RELEASE_BUILD}));
125 125
126 126 # Don't install POD pages for ON.
127 127 @main::man3pods = ( MAN3PODS => {} );
128 128
129 129 #
130 130 # Non-ON overrides.
131 131 #
132 132 } else {
133 133 #
134 134 # Override postamble and replace it with one that explicitly records
135 135 # the dependency between Exacct.c (generated from Exacct.xs by xsubpp)
136 136 # and the ExacctDefs.xi file (generated from /usr/include/sys/exacct.h
137 137 # by extract_defines). This ensures that the constant values exported
138 138 # by the perl module stay up-to date with the corresponding #defines.
139 139 #
140 140 *postamble = sub {
141 141 return <<'EOF';
142 142 EXACCT_H = /usr/include/sys/exacct.h
143 143
144 144 Exacct.c: ExacctDefs.xi
145 145
146 146 ExacctDefs.xi: extract_defines $(EXACCT_H)
147 147 $(PERL) extract_defines Exacct $@ $(EXACCT_H)
148 148 EOF
149 149 };
150 150
151 151 # Install the POD documentation for non-ON builds.
152 152 my $man3pfx = '$(INST_MAN3DIR)/Sun::Solaris::Exacct';
153 153 @main::man3pods = (
154 154 MAN3PODS => { 'pod/Exacct.pod' => $man3pfx . '.$(MAN3EXT)' }
155 155 );
156 156 }
157 157
158 158 #
159 159 # Having set everything up, write the Makefile.
160 160 #
161 161 package main;
162 162
163 163 WriteMakefile(
164 164 NAME => 'Sun::Solaris::Exacct',
165 165 VERSION_FROM => 'Exacct.pm',
166 166 DIR => [ qw(Catalog File Object) ],
167 167 H => [ 'exacct_common.xh' ],
168 168 LIBS => [ '-lexacct' ],
169 169 @defines,
170 170 @man3pods,
171 171 dynamic_lib => { OTHERLDFLAGS => '-h $(DLBASE).$(DLEXT)' },
172 172 realclean => { FILES => 'ExacctDefs.xi' },
173 173 );
↓ open down ↓ |
130 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX