summaryrefslogtreecommitdiffstats
path: root/rules/php5.make
blob: f9f6aca109c707453b111d17c2360ce8ca4451c7 (plain) (blame)
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
# -*-makefile-*-
# $Id: php5.make,v 1.1 2007/01/08 08:28:01 michl Exp $
#
# Copyright (C) 2006 by Robert Schwebel
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_PHP5) += php5

#
# Paths and names
#
PHP5_VERSION	:= 5.1.6
PHP5		:= php-$(PHP5_VERSION)
PHP5_SUFFIX	:= tar.bz2
PHP5_URL	:= http://de2.php.net/get/$(PHP5).$(PHP5_SUFFIX)
PHP5_SOURCE	:= $(SRCDIR)/$(PHP5).$(PHP5_SUFFIX)
PHP5_DIR	:= $(BUILDDIR)/$(PHP5)

# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

php5_get: $(STATEDIR)/php5.get

$(STATEDIR)/php5.get: $(php5_get_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(PHP5_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, PHP5)

# ----------------------------------------------------------------------------
# Extract
# ----------------------------------------------------------------------------

php5_extract: $(STATEDIR)/php5.extract

$(STATEDIR)/php5.extract: $(php5_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(PHP5_DIR))
	@$(call extract, PHP5)
	@$(call patchin, PHP5)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

php5_prepare: $(STATEDIR)/php5.prepare

PHP5_PATH	:= PATH=$(CROSS_PATH)
PHP5_ENV 	:= $(CROSS_ENV)

#
# autoconf
#
PHP5_AUTOCONF := $(CROSS_AUTOCONF_USR)

# FIXME: php5 doesn't interprete "with_foo=no" correctly, so we cannot
# give --without-foo options. Should be fixed in php5's configure.in.

# ------------
# SAPI Modules
# ------------

ifdef PTXCONF_PHP5_SAPI_AOLSERVER
PHP5_AUTOCONF += --with-aolserver=FIXME
else
PHP5_AUTOCONF += --without-aolserver
endif

# default off, we don't support apache1 any more
# PHP5_AUTOCONF += --without-apxs
# PHP5_AUTOCONF += --without-apache

ifdef PTXCONF_PHP5_SAPI_MOD_CHARSET
PHP5_AUTOCONF += --with-mod_charset
else
PHP5_AUTOCONF += --without-mod_charset
endif

ifdef PTXCONF_PHP5_SAPI_APXS2FILTER
PHP5_AUTOCONF += --with-apxs2filter
else
# FIXME: php5 interprets --without-... as --with ...
# PHP5_AUTOCONF += --without-apxs2filter
endif

ifdef PTXCONF_PHP5_SAPI_APXS2
PHP5_AUTOCONF += --with-apxs2=$(SYSROOT)/usr/bin/apxs
else
# FIXME: php5 interprets --without-... as --with ...
# PHP5_AUTOCONF += --without-apxs2
endif

# default off, we don't support apache1 any more
# PHP5_AUTOCONF += --without-apache-hooks
# PHP5_AUTOCONF += --without-apache-hooks-static

ifdef PTXCONF_PHP5_SAPI_CAUDIUM
PHP5_AUTOCONF += --with-caudium
else
# FIXME: php5 interprets --without-... as --with ...
# PHP5_AUTOCONF += --without-caudium
endif

ifdef PTXCONF_PHP5_SAPI_CLI
PHP5_AUTOCONF += --enable-cli
else
PHP5_AUTOCONF += --disable-cli
endif

ifdef PTXCONF_PHP5_SAPI_CONTINUITY
PHP5_AUTOCONF += --with-continuity
else
#PHP5_AUTOCONF += --without-continuity
endif

ifdef PTXCONF_PHP5_SAPI_EMBEDDED
PHP5_AUTOCONF += --enable-embedded
else
#PHP5_AUTOCONF += --disable-embedded
endif

ifdef PTXCONF_PHP5_SAPI_ISAPI
PHP5_AUTOCONF += --with-isapi
else
#PHP5_AUTOCONF += --without-isapi
endif

ifdef PTXCONF_PHP5_SAPI_MILTER
PHP5_AUTOCONF += --with-milter
else
#PHP5_AUTOCONF += --without-milter
endif

ifdef PTXCONF_PHP5_SAPI_NSAPI
PHP5_AUTOCONF += --with-nsapi
else
#PHP5_AUTOCONF += --without-nsapi
endif

ifdef PTXCONF_PHP5_SAPI_PHTTPD
PHP5_AUTOCONF += --with-phttpd
else
#PHP5_AUTOCONF += --without-phttpd
endif

ifdef PTXCONF_PHP5_SAPI_PI3WEB
PHP5_AUTOCONF += --with-pi3web
else
#PHP5_AUTOCONF += --without-pi3web
endif

ifdef PTXCONF_PHP5_SAPI_ROXEN
PHP5_AUTOCONF += --with-roxen
else
#PHP5_AUTOCONF += --without-roxen
endif

ifdef PTXCONF_PHP5_SAPI_ROXEN_ZTS
PHP5_AUTOCONF += --with-roxen-zts
else
#PHP5_AUTOCONF += --without-roxen-zts
endif

ifdef PTXCONF_PHP5_SAPI_THTTPD
PHP5_AUTOCONF += --with-thttpd
else
#PHP5_AUTOCONF += --without-thttpd
endif

ifdef PTXCONF_PHP5_SAPI_TUX
PHP5_AUTOCONF += --with-tux
else
#PHP5_AUTOCONF += --without-tux
endif

ifdef PTXCONF_PHP5_SAPI_CGI
PHP5_AUTOCONF += --enable-cgi
else
PHP5_AUTOCONF += --disable-cgi
endif

ifdef PTXCONF_PHP5_SAPI_FORCE_CGI_REDIRECT
PHP5_AUTOCONF += --enable-force-cgi-redirect
else
PHP5_AUTOCONF += --disable-force-cgi-redirect
endif

ifdef PTXCONF_PHP5_SAPI_DISCARD_PATH
PHP5_AUTOCONF += --enable-discard-path
else
PHP5_AUTOCONF += --disable-discard-path
endif

ifdef PTXCONF_PHP5_SAPI_FASTCGI
PHP5_AUTOCONF += --enable-fastcgi
else
#PHP5_AUTOCONF += --disable-fastcgi
endif

ifdef PTXCONF_PHP5_SAPI_PATH_INFO_CHECK
PHP5_AUTOCONF += --enable-path-info-check
else
PHP5_AUTOCONF += --disable-path-info-check
endif

# ---------------
# General Options
# ---------------

ifdef PTXCONF_PHP5_XML
PHP5_AUTOCONF += --enable-xml
else
PHP5_AUTOCONF += --disable-xml
endif

ifdef PTXCONF_PHP5_XML_LIBXML2
PHP5_AUTOCONF += --enable-libxml
PHP5_AUTOCONF += --with-libxml-dir=$(SYSROOT)/usr/lib
else
PHP5_AUTOCONF += --disable-libxml
endif

ifdef PTXCONF_PHP5_XML_LIBXML2_READER
PHP5_AUTOCONF += --enable-xmlreader
else
PHP5_AUTOCONF += --disable-xmlreader
endif

ifdef PTXCONF_PHP5_XML_LIBXML2_WRITER
PHP5_AUTOCONF += --enable-xmlwriter
else
PHP5_AUTOCONF += --disable-xmlwriter
endif

ifdef PTXCONF_PHP5_XML_LIBXML2_DOM
PHP5_AUTOCONF += --enable-dom
else
PHP5_AUTOCONF += --disable-dom
endif

ifdef PTXCONF_PHP5_XML_LIBXML2_XSLT
PHP5_AUTOCONF += --with-xsl=$(SYSROOT)/usr/lib
else
PHP5_AUTOCONF += --without-xsl
endif

ifdef PTXCONF_PHP5_XML_LIBXML2_SIMPLEXML
PHP5_AUTOCONF += --enable-simplexml
else
PHP5_AUTOCONF += --disable-simplexml
endif

ifdef PTXCONF_PHP5_EXT_ICONV
PHP5_AUTOCONF += --with-iconv=$(SYSROOT)/usr
else
PHP5_AUTOCONF += --without-iconv
endif

ifdef PTXCONF_PHP5_EXT_MYSQL
PHP5_AUTOCONF += --with-mysql=$(SYSROOT)/usr
else
PHP5_AUTOCONF += --without-mysql
endif

ifdef PTXCONF_PHP5_EXT_PEAR
PHP5_AUTOCONF += --with-pear=FIXME
else
PHP5_AUTOCONF += --without-pear
endif

$(STATEDIR)/php5.prepare: $(php5_prepare_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(PHP5_DIR)/config.cache)
	cd $(PHP5_DIR) && \
		$(PHP5_PATH) $(PHP5_ENV) \
		./configure $(PHP5_AUTOCONF)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------

php5_compile: $(STATEDIR)/php5.compile

$(STATEDIR)/php5.compile: $(php5_compile_deps_default)
	@$(call targetinfo, $@)
	cd $(PHP5_DIR) && $(PHP5_PATH) $(MAKE) CC=$(CROSS_CC)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

php5_install: $(STATEDIR)/php5.install

$(STATEDIR)/php5.install: $(php5_install_deps_default)
	@$(call targetinfo, $@)
	# FIXME
	cd $(PHP5_DIR) && \
		$(PHP5_ENV) $(PHP5_PATH) \
		make install-build install-headers install-programs \
		INSTALL_ROOT=$(SYSROOT)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

php5_targetinstall: $(STATEDIR)/php5.targetinstall

$(STATEDIR)/php5.targetinstall: $(php5_targetinstall_deps_default)
	@$(call targetinfo, $@)

	@$(call install_init, php5)
	@$(call install_fixup,php5,PACKAGE,php5)
	@$(call install_fixup,php5,PRIORITY,optional)
	@$(call install_fixup,php5,VERSION,$(PHP5_VERSION))
	@$(call install_fixup,php5,SECTION,base)
	@$(call install_fixup,php5,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
	@$(call install_fixup,php5,DEPENDS,)
	@$(call install_fixup,php5,DESCRIPTION,missing)

ifdef PTXCONF_PHP5_SAPI_APXS2
	@$(call install_copy, php5, 0, 0, 0644, $(PHP5_DIR)/libs/libphp5.so, /usr/lib/apache2/libphp5.so)
endif
ifdef PTXCONF_PHP5_CLI
	@$(call install_copy, php5, 0, 0, 0755, $(PHP5_DIR)/sapi/cli/php, /usr/bin/php5)
endif

	@$(call install_finish,php5)

	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

php5_clean:
	rm -rf $(STATEDIR)/php5.*
	rm -rf $(IMAGEDIR)/php5_*
	rm -rf $(PHP5_DIR)

# vim: syntax=make