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