author | Jon Tibble <meths@btinternet.com> |
Fri, 10 Feb 2012 16:19:42 +0000 | |
branch | oi_151a |
changeset 114 | b6d40d0a7b17 |
parent 100 | 0a3c3c0e0ff2 |
permissions | -rw-r--r-- |
0 | 1 |
# |
2 |
# |
|
3 |
# CDDL HEADER START |
|
4 |
# |
|
5 |
# The contents of this file are subject to the terms of the |
|
6 |
# Common Development and Distribution License (the "License"). |
|
7 |
# You may not use this file except in compliance with the License. |
|
8 |
# |
|
9 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
10 |
# or http://www.opensolaris.org/os/licensing. |
|
11 |
# See the License for the specific language governing permissions |
|
12 |
# and limitations under the License. |
|
13 |
# |
|
14 |
# When distributing Covered Code, include this CDDL HEADER in each |
|
15 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
16 |
# If applicable, add the following below this CDDL HEADER, with the |
|
17 |
# fields enclosed by brackets "[]" replaced with your own identifying |
|
18 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
|
19 |
# |
|
20 |
# CDDL HEADER END |
|
21 |
# |
|
46 | 22 |
# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. |
0 | 23 |
# |
46 | 24 |
#ident "@(#)Makefile.sfw 1.37 10/09/03 SMI" |
0 | 25 |
|
26 |
# Note to maintainers. I'm sorry...please forgive me for all |
|
27 |
# that follows. |
|
28 |
||
29 |
# Currently, here's a brief overview of how apache is built: |
|
30 |
# |
|
31 |
# First the main server code is extracted, and the EAPI patch |
|
32 |
# is applied. Next, we build all the various add-on modules |
|
33 |
# we intend to ship - mod_perl, mod_jserv, and mod_webapp. |
|
34 |
# The perl side of mod_perl gets installed by building the |
|
35 |
# mod_perl module. |
|
36 |
# |
|
37 |
# Then, we massage various configuration files and scripts |
|
38 |
# and add in some Sun goodness (:-)) before a massive shell |
|
39 |
# script installs the whole wad in the proto area. |
|
40 |
||
41 |
BUILD_TOP=$(SRC)/cmd/apache |
|
42 |
TMPWORK=$(BUILD_TOP)/tmp # work dir |
|
43 |
||
44 |
.NO_PARALLEL: $(MODULES) |
|
45 |
||
46 |
# so the mod_perl build knows where to install the perl side. |
|
47 |
||
48 |
PERL=/usr/perl5/bin/perl |
|
49 |
PERL_ARCH:sh = arch |
|
100
0a3c3c0e0ff2
imported patch sfw-perl510.patch
Alasdair Lumsden <al@everycity.co.uk>
parents:
46
diff
changeset
|
50 |
AP_PERL5LIB=/usr/apache/perl5/5.10.0/$(PERL_ARCH)-solaris |
0 | 51 |
ROOTAP_PERL5LIB=$(AP_PERL5LIB:%=$(ROOT)/%) |
52 |
ROOT_PERLMAN=$(ROOT)/usr/apache/man |
|
53 |
APXS=/usr/apache/bin/apxs |
|
54 |
||
55 |
SERVER=apache_1.3.41 |
|
56 |
PERL_MODULE=mod_perl-1.31 |
|
57 |
SSL_MODULE=mod_ssl-2.8.31-1.3.41 |
|
58 |
AUTH_GSS_MODULE=mod_auth_gss |
|
59 |
||
60 |
LDOPTS=-M $(SRC)/cmd/mapfile_noexstk -zcombreloc |
|
61 |
||
62 |
# hack - webapp always uses gcc if it finds it, so we null out |
|
63 |
# the path and point at our cc path before running configure. |
|
64 |
# The following kludge allows us to get the path cleanly without having |
|
65 |
# to hardwire anything in the makefile |
|
66 |
# |
|
67 |
# Note that it's very tough to get the WEBAPP_MODULE piece to use anything |
|
68 |
# other than gcc - that's one reason why $(CCPATH) is explicitly in the path. |
|
69 |
||
70 |
CCPATH=$(NATIVECC:%/cc=%) |
|
71 |
SFW_PATH="$(CCPATH):/usr/ccs/bin:/usr/bin:/usr/sfw/bin" |
|
72 |
||
73 |
TOMCATCON_SOURCE=tomcat-connectors-1.2.27-src |
|
74 |
TOMCATCON_MODULE=$(TOMCATCON_SOURCE)/native/apache-1.3/.libs/mod_jk.so |
|
75 |
||
76 |
MODULES= \ |
|
77 |
$(SSL_MODULE) \ |
|
78 |
$(PERL_MODULE) \ |
|
79 |
$(TOMCATCON_MODULE) |
|
80 |
||
81 |
# stuff to whack when we do 'make clean' |
|
82 |
||
83 |
CLEANDIRS=$(SERVER) $(MODULES) $(TOMCATCON_SOURCE) |
|
84 |
||
85 |
# hack alert - the 'echo' command in the all target is the only |
|
86 |
# architecture-independent way of getting the mod_perl path compiled |
|
87 |
# in via redefinition of APACHE_PERL5LIB (src/modules/perl/mod_perl.c). |
|
88 |
# All other methods result in the backquoted quotes getting stripped |
|
89 |
# by shell expansion in the apache configuration script. Sorry... |
|
90 |
||
91 |
all: $(SERVER) .WAIT $(SERVER)/Makefile |
|
92 |
echo "echo '-DAPACHE_PERL5LIB=\"$(AP_PERL5LIB)\"'" \ |
|
93 |
>> $(SERVER)/src/apaci |
|
94 |
(cd $(SERVER); env - \ |
|
95 |
PATH=$(SFW_PATH) \ |
|
96 |
"LD_OPTIONS=-L/usr/sfw/lib -R/usr/sfw/lib" \ |
|
97 |
CC=$(CC) \ |
|
98 |
'CFLAGS=$(CFLAGS)' \ |
|
99 |
MAKE=$(CCSMAKE) \ |
|
100 |
$(CCSMAKE) root=$(ROOT)) |
|
101 |
(cd $(SERVER); env - \ |
|
102 |
PATH=$(SFW_PATH) \ |
|
103 |
CC=$(CC) \ |
|
104 |
'CFLAGS=$(CFLAGS)' \ |
|
105 |
MAKE=$(CCSMAKE) \ |
|
106 |
$(CCSMAKE) certificate TYPE=dummy) |
|
107 |
||
108 |
include ../Makefile.cmd |
|
109 |
||
110 |
# currently, apache is a bit lacking in large-file awareness, but |
|
111 |
# much of it works, and we need to turn it on for compatibility with |
|
112 |
# perl now. |
|
113 |
||
114 |
CFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 |
|
115 |
||
116 |
install: all |
|
100
0a3c3c0e0ff2
imported patch sfw-perl510.patch
Alasdair Lumsden <al@everycity.co.uk>
parents:
46
diff
changeset
|
117 |
if [ -d $(ROOT)/usr/apache/perl5/5.10.0 ]; then \ |
0 | 118 |
rm -f $(ROOT)/usr/apache/libexec/httpd.exp; \ |
100
0a3c3c0e0ff2
imported patch sfw-perl510.patch
Alasdair Lumsden <al@everycity.co.uk>
parents:
46
diff
changeset
|
119 |
chmod -R u+w $(ROOT)/usr/apache/perl5/5.10.0; \ |
0 | 120 |
fi |
121 |
(cd $(SERVER); env - \ |
|
122 |
PATH=$(SFW_PATH) \ |
|
123 |
CC=$(CC) \ |
|
124 |
'CFLAGS=$(CFLAGS)' \ |
|
125 |
'CFLAGS_SHLIB=$(CFLAGS) -DPIC -KPIC' \ |
|
126 |
LDFLAGS="$(LDOPTS)" \ |
|
127 |
LDFLAGS_SHLIB="$(LDOPTS) -G" \ |
|
128 |
MAKE=$(CCSMAKE) \ |
|
129 |
$(CCSMAKE) install root=$(ROOT)) |
|
130 |
sh ./install-apache |
|
131 |
# clean up perllocal.pod |
|
100
0a3c3c0e0ff2
imported patch sfw-perl510.patch
Alasdair Lumsden <al@everycity.co.uk>
parents:
46
diff
changeset
|
132 |
$(RM) -f $(ROOT)/usr/apache/perl5/5.10.0/`/bin/arch`-solaris/perllocal.pod |
0 | 133 |
|
134 |
$(SERVER)/Makefile: $(SERVER)/configure |
|
135 |
(cd $(SERVER); env - \ |
|
136 |
PATH=$(SFW_PATH) \ |
|
137 |
CC=$(CC) \ |
|
138 |
'CFLAGS=$(CFLAGS) -DUSE_SO_LINGER -DHARD_SERVER_LIMIT=2048 -DSSL_EXPERIMENTAL_PERDIRCA_IGNORE -DSSL_EXPERIMENTAL_PROXY_IGNORE' \ |
|
139 |
'CFLAGS_SHLIB=$(CFLAGS) -DPIC -KPIC -DUSE_SO_LINGER -DHARD_SERVER_LIMIT=2048 -DSSL_EXPERIMENTAL_PERDIRCA_IGNORE -DSSL_EXPERIMENTAL_PROXY_IGNORE' \ |
|
140 |
LDFLAGS="$(LDOPTS)" \ |
|
141 |
LDFLAGS_SHLIB="$(LDOPTS) -G" \ |
|
142 |
PERL=$(PERL) \ |
|
143 |
MAKE=$(CCSMAKE) \ |
|
144 |
./configure --with-layout=Solaris \ |
|
145 |
--prefix=/usr/apache \ |
|
146 |
--with-perl=$(PERL) \ |
|
147 |
--verbose \ |
|
148 |
--enable-module=all \ |
|
149 |
--enable-module=ssl \ |
|
150 |
--enable-shared=ssl \ |
|
151 |
--disable-module=auth_db \ |
|
152 |
--enable-rule=EAPI \ |
|
153 |
--enable-rule=SSL_SDBM \ |
|
154 |
--enable-rule=SSL_EXPERIMENTAL \ |
|
155 |
--bindir=/usr/apache/bin \ |
|
156 |
--sbindir=/usr/apache/bin \ |
|
157 |
--libexecdir=/usr/apache/libexec \ |
|
158 |
--mandir=/usr/apache/man \ |
|
159 |
--sysconfdir=/etc/apache \ |
|
160 |
--datadir=/var/apache \ |
|
161 |
--includedir=/usr/apache/include \ |
|
162 |
--cgidir=/var/apache/cgi-bin \ |
|
163 |
--localstatedir=/usr/apache \ |
|
164 |
--runtimedir=/var/run/apache \ |
|
165 |
--logfiledir=/var/apache/logs \ |
|
166 |
--proxycachedir=/var/apache/proxy \ |
|
167 |
--enable-suexec \ |
|
168 |
--suexec-caller=nobody \ |
|
169 |
--suexec-safepath=/usr/bin \ |
|
170 |
--enable-shared=max \ |
|
171 |
--activate-module=src/modules/perl/libperl.a \ |
|
172 |
--enable-shared=perl) |
|
173 |
||
174 |
$(SERVER): |
|
175 |
gzip -dc $(SERVER).tar.gz | tar xopf - |
|
176 |
(cd $(SERVER); gpatch -p1 < ../Solaris/manpage.patches) |
|
177 |
(cd $(SERVER); gpatch -p1 < ../Solaris/apachectl.patch) # PSARC/2001/244 |
|
46 | 178 |
(cd $(SERVER); gpatch -p1 < ../Solaris/getline.patches) |
0 | 179 |
# remove nasty chown |
180 |
rm -f $(SERVER)/Makefile.tmpl.orig |
|
181 |
mv $(SERVER)/Makefile.tmpl \ |
|
182 |
$(SERVER)/Makefile.tmpl.orig |
|
183 |
sed -e 's,chown,/bin/true,' -e 's,chmod,/bin/true,' \ |
|
184 |
< $(SERVER)/Makefile.tmpl.orig \ |
|
185 |
> $(SERVER)/Makefile.tmpl |
|
186 |
||
187 |
||
188 |
# The server configure file needs to depend on all the modules |
|
189 |
# that add source to the server tree. The next rule guarantees |
|
190 |
# that we will build all the modules before configuring apache. |
|
191 |
||
192 |
$(SERVER)/configure: $(MODULES) auth_gss_dir |
|
193 |
||
194 |
# The rest is a bunch of individual rules that build the |
|
195 |
# various modules and pieces. |
|
196 |
||
197 |
$(SSL_MODULE): |
|
198 |
gzip -dc $(SSL_MODULE).tar.gz | tar xopf - |
|
199 |
(cd $(SSL_MODULE); env - \ |
|
200 |
PATH=$(SFW_PATH) \ |
|
201 |
CC=$(CC) "CFLAGS=$(CFLAGS) -DPIC -KPIC" \ |
|
202 |
"LD_OPTIONS=-L/usr/sfw/lib -R/usr/sfw/lib" \ |
|
203 |
LDFLAGS="$(LDOPTS)" \ |
|
204 |
LDDLFLAGS="$(LDOPTS) -G" \ |
|
205 |
MAKE=$(CCSMAKE) \ |
|
206 |
PERL=$(PERL) \ |
|
207 |
./configure \ |
|
208 |
--with-apache=../$(SERVER) ) |
|
209 |
||
210 |
# The perl side of mod_perl |
|
211 |
# gets installed in the proto area here (though with wrong |
|
212 |
# permissions, etc) by the make install. The apache side |
|
213 |
# gets installed by the main install-apache script. It's |
|
214 |
# disgusting, but perl is pretty picky about how it wants |
|
215 |
# to build stuff. Note also that $(PERL_MODULE) is a |
|
216 |
# dependency of the main apache build, since it needs |
|
217 |
# to copy stuff into the server tree before the server |
|
218 |
# gets built. Also pay attention to the fact that we |
|
219 |
# need to edit the generated Makefiles to get the right |
|
220 |
# CC and LD in them - because by default they use whatever |
|
221 |
# perl was compiled with (in this case just "cc"). |
|
222 |
||
223 |
$(PERL_MODULE): |
|
100
0a3c3c0e0ff2
imported patch sfw-perl510.patch
Alasdair Lumsden <al@everycity.co.uk>
parents:
46
diff
changeset
|
224 |
if [ -d $(ROOT)/usr/apache/perl5/5.10.0 ]; then \ |
0a3c3c0e0ff2
imported patch sfw-perl510.patch
Alasdair Lumsden <al@everycity.co.uk>
parents:
46
diff
changeset
|
225 |
chmod -R u+w $(ROOT)/usr/apache/perl5/5.10.0; \ |
0 | 226 |
fi |
227 |
gzip -dc $(PERL_MODULE).tar.gz | tar xopf - |
|
4 | 228 |
gpatch -p0 < perlbug38084.patch |
0 | 229 |
(cd $(PERL_MODULE); env - \ |
230 |
PATH=$(SFW_PATH) \ |
|
231 |
CC=$(CC) "CFLAGS=$(CFLAGS) -DPIC -KPIC" \ |
|
232 |
LDFLAGS="$(LDOPTS)" \ |
|
233 |
LDDLFLAGS="$(LDOPTS) -G" \ |
|
234 |
MAKE=$(CCSMAKE) \ |
|
235 |
PERL=$(PERL) \ |
|
236 |
$(PERL) Makefile.PL \ |
|
237 |
INSTALLDIRS=perl \ |
|
238 |
USE_APACI=1 \ |
|
239 |
APACHE_SRC=../$(SERVER)/src \ |
|
240 |
DO_HTTPD=1 \ |
|
241 |
PREP_HTTPD=1 \ |
|
242 |
EVERYTHING=1 \ |
|
243 |
INSTALLSITELIB=$(ROOTAP_PERL5LIB) \ |
|
244 |
INSTALLARCHLIB=$(ROOTAP_PERL5LIB) \ |
|
245 |
INSTALLSITEARCH=$(ROOTAP_PERL5LIB) \ |
|
246 |
INSTALLPRIVLIB=$(ROOTAP_PERL5LIB) \ |
|
247 |
SITEARCHEXP=$(ROOTAP_PERL5LIB) \ |
|
248 |
SITELIBEXP=$(ROOTAP_PERL5LIB) \ |
|
249 |
INSTALLMAN1DIR=$(ROOT_PERLMAN)/man1 \ |
|
250 |
INSTALLMAN3DIR=$(ROOT_PERLMAN)/man3; \ |
|
251 |
for i in `find . -name Makefile` ; \ |
|
252 |
do \ |
|
253 |
sed -e '/^CC/s;CC = cc;CC = $(CC);' \ |
|
254 |
-e '/^LD =/s;LD = cc;LD = $(CC);' \ |
|
255 |
$$i > $$i.1; \ |
|
256 |
mv $$i.1 $$i; \ |
|
257 |
done) |
|
258 |
(cd $(PERL_MODULE); env - \ |
|
259 |
PATH=$(SFW_PATH) \ |
|
260 |
CC=$(CC) "CFLAGS=$(CFLAGS)" \ |
|
261 |
MAKE=$(CCSMAKE) \ |
|
262 |
MAKEFLAGS=e \ |
|
263 |
PERL=$(PERL) \ |
|
264 |
$(CCSMAKE) install) |
|
265 |
||
266 |
$(TOMCATCON_MODULE): $(TOMCATCON_SOURCE)/native/config.status |
|
267 |
(cd $(TOMCATCON_SOURCE)/native; env - \ |
|
268 |
PATH=$(SFW_PATH) \ |
|
269 |
CC=$(CC) "CFLAGS=$(CFLAGS)" \ |
|
270 |
MAKE=$(GMAKE) $(GMAKE)) |
|
271 |
||
272 |
$(TOMCATCON_SOURCE)/native/config.status: $(TOMCATCON_SOURCE)/native/configure |
|
273 |
(cd $(TOMCATCON_SOURCE)/native; env - \ |
|
274 |
PATH=$(SFW_PATH) \ |
|
275 |
CC=$(CC) "CFLAGS=$(CFLAGS)" \ |
|
276 |
MAKE=$(GMAKE) \ |
|
277 |
./configure --with-apxs=/usr/apache/bin/apxs) |
|
278 |
||
279 |
# Note that we need to avoid any error message from nightly log. |
|
280 |
$(TOMCATCON_SOURCE)/native/configure: |
|
281 |
/usr/sfw/bin/gtar xpfz $(TOMCATCON_SOURCE).tar.gz |
|
282 |
(cd $(TOMCATCON_SOURCE)/native; \ |
|
283 |
sed 's/throws an error of the form/throws a message of the form/' \ |
|
284 |
configure > configure.new; \ |
|
285 |
cat configure.new > configure; rm configure.new) |
|
286 |
||
287 |
auth_gss_dir: |
|
288 |
(cd $(AUTH_GSS_MODULE); SERVER=$(SERVER) make all) |
|
289 |
||
290 |
$(ROOTJSDKDIR)/%: % |
|
291 |
$(INS.file) |
|
292 |
||
293 |
clean: |
|
294 |
-rm -rf $(CLEANDIRS) |
|
295 |
(cd $(AUTH_GSS_MODULE); make clean;) |
|
296 |
||
297 |
include ../Makefile.targ |