Craig Mohrman
2011-08-06 d248e608916d6a0b5dad6d3c2ac2d86e2e46c10e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
#
include ../../make-rules/shared-macros.mk
include ../../make-rules/ips.mk
 
##
## DO:
##   patch
##        12_php_7050600.patch
##   can go away once i get hold of 7052015 in b171
##
 
##
## This Makefile for local usage only.
## The full build will NOT execute this Makefile.
##
 
# PHP 5.2
#
# Build ordering:
#    1) imap        -> install
#    2) php-sapi    -> install
#    3) php-nsapi    -> install
#    3) php-cgi    -> install
#    4) php-sapi    -> publish (packages sapi, nsapi, cgi in 1 package)
#    5) APC-zts    -> install
#    6) APC        -> publish (packages APC-zts, APC in 1 package)
#    5) idn-zts    -> install
#    6) idn        -> publish (packages idn-zts, idn in 1 package)
#    5) memcache-zts -> install
#    6) memcache     -> publish (packages memcache-zts, memcache in 1 pack)
#    5) suhosin-zts  -> install
#    6) suhosin      -> publish (packages suhosin-zts, suhosin in 1 package)
#    5) tcpwrap-zts  -> install
#    6) tcpwrap    -> publish (packages tcpwrap-zts, tcpwrap in 1 package)
#    5) xdebug-zts    -> install
#    6) xdebug    -> publish (packages xdebug-zts, xdebug in 1 package)
#
# The numbers indicate parallelism possible in the build.
# The other way to build this would be:
#    1) imap        -> build
#    2) php-sapi    -> install
#    3) php-nsapi    -> install
#    4) all others    -> install (in parallel)
#    5) all        -> publish (in parallel)
# So after imap, php-sapi, php-nsapi build serially in that order
# then it doesn't matter.
 
# PHP is built 3 ways:
#    php-sapi  - Server API
#    php-cgi   - CGI
#    php-nsapi - Netscape Server API
#            This is the Netscape group (aka webstack group)
#            that Sun purchased from AOL long ago.
#            I believe this Netscape server is still alive
#            and offered by Oracle.
# These PHP's are built from the same source, patched the same way,
# but configured differently.
 
# More relevant to the full USERLAND build is the dependency tree
# for say starting the build down in an extension module:
# To publish the APC extension:
#     1) build imap
#    2) install php-sapi
#    3) install APC
#    4) install php-nsapi
#    5) install APC-zts
#    6) publish APC
 
# SFW build of php
# 1) build_imap - Because php needs headers and libc-client.a
#                 Must be built first.
# 2) build_modphp5 - php SAPI
#        $(PHP_DIR)/libs/libphp5.so
#              $(PHP_DIR)/config.status
#                    $(PHP_DIR)/configure
#                          unroll php archive
#                          patch
#                          ./buildconf
#                          edit configure
#                          copy php source tree for php_fast/cgi build
#                          unroll webserver7-spi
#                              [Sun Java System Web Server 7 (formerly known
#                               as Sun ONE/iPlanet Enterprise Server)]
#                              [now Oracle iPlanet Web Server 7]
#                          copy php source tree for php_nsapi build
#                    $(PHP_NSAPI)/configure
#                        [stuff...]
#                    ./configure
# 3) build_cgi     - php cgi/fastcgi
# 4) build_nsapi   - php nsapi (netscape SAPI - old sun webserver product)
#                         (still applicable)
#    I think so - http://blogs.oracle.com/natarajan/entry/php_plug_in_for_oracle
#                         (now known as Oracle iPlanet Web Server 7)
#
# 5) install_php - this is called AFTER php builds and installs
#          cd $(PHP_DIR); make install
#          cd $(PHP_NSAPI); make libphp5.la install-modules
#       ./install-php5
#        don't need fix_bin_scripts()
#            [paths already correct and some things don't exist.]
#               looks like i DO NEED the pear patches
 
PKG_PROTO_DIRS += APC/build/prototype/$(MACH)
PKG_PROTO_DIRS += APC-zts/build/prototype/$(MACH)
PKG_PROTO_DIRS += idn/build/prototype/$(MACH)
PKG_PROTO_DIRS += idn-zts/build/prototype/$(MACH)
PKG_PROTO_DIRS += memcache/build/prototype/$(MACH)
PKG_PROTO_DIRS += memcache-zts/build/prototype/$(MACH)
PKG_PROTO_DIRS += php-cgi/build/prototype/$(MACH)
PKG_PROTO_DIRS += php-nsapi/build/prototype/$(MACH)
PKG_PROTO_DIRS += php-sapi/build/prototype/$(MACH)
PKG_PROTO_DIRS += suhosin/build/prototype/$(MACH)
PKG_PROTO_DIRS += suhosin-zts/build/prototype/$(MACH)
PKG_PROTO_DIRS += tcpwrap/build/prototype/$(MACH)
PKG_PROTO_DIRS += tcpwrap-zts/build/prototype/$(MACH)
PKG_PROTO_DIRS += xdebug/build/prototype/$(MACH)
PKG_PROTO_DIRS += xdebug-zts/build/prototype/$(MACH)
 
# for now, everything with a Makefile should be built
SUBDIRS =    $(shell echo */Makefile | sed -e 's;/Makefile;;g')
 
.PHONY:    $(SUBDIRS)
 
download:        TARGET = download
prep:            TARGET = prep
install:        TARGET = install
clean:            TARGET = clean
clobber:        TARGET = clobber
test:            TARGET = test
publish:        TARGET = publish
 
build:        install
 
.DEFAULT:    publish
 
download prep install test publish: $(SUBDIRS)
 
clean:        $(SUBDIRS)
 
clobber:    $(SUBDIRS) clean
 
$(SUBDIRS):    FORCE
    @cd $@ && echo "$(TARGET) $@" && $(MAKE) $(TARGET)
 
# declare module dependencies
APC:        php-sapi
APC-zts:    php-sapi php-nsapi
idn:        php-sapi
idn-zts:    php-sapi php-nsapi
memcache:    php-sapi
memcache-zts:    php-sapi php-nsapi
php-cgi:    php-sapi
php-nsapi:    php-sapi
php-sapi:    imap
suhosin:    php-sapi
suhosin-zts:    php-sapi php-nsapi
tcpwrap:    php-sapi
tcpwrap-zts:    php-sapi php-nsapi
xdebug:        php-sapi
xdebug-zts:    php-sapi php-nsapi
 
FORCE: