summaryrefslogtreecommitdiffstats
path: root/rules/php.make
blob: 95a71281f0f106e9a322b31e865d2773d9051d54 (plain)
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
# -*-makefile-*-
# $Id: php.make,v 1.6 2005/04/29 08:40:27 michl Exp $
#
# Copyright (C) 2005 by Jiri Nesladek
#          
# 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_PHP) += php

#
# Paths and names
#
PHP_VERSION	= 4.3.11
PHP		= php-$(PHP_VERSION)
PHP_SUFFIX	= tar.bz2
PHP_URL		= http://de.php.net/get/$(PHP).$(PHP_SUFFIX)/from/this/mirror
PHP_SOURCE	= $(SRCDIR)/$(PHP).$(PHP_SUFFIX)
PHP_DIR		= $(BUILDDIR)/$(PHP)

-include $(call package_depfile)

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

php_get: $(STATEDIR)/php.get

php_get_deps = $(PHP_SOURCE)

$(STATEDIR)/php.get: $(php_get_deps)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(PHP_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(PHP_URL))

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

php_extract: $(STATEDIR)/php.extract

php_extract_deps = $(STATEDIR)/php.get

$(STATEDIR)/php.extract: $(php_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(PHP_DIR))
	@$(call extract, $(PHP_SOURCE))
	@$(call patchin, $(PHP))
	@$(call touch, $@)

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

php_prepare: $(STATEDIR)/php.prepare

#
# dependencies
#
php_prepare_deps = \
	$(STATEDIR)/php.extract \
	$(STATEDIR)/virtual-xchain.install

ifdef PTXCONF_PHP_APACHE
php_prepare_deps += $(STATEDIR)/apache.install
endif

PHP_PATH = PATH=$(CROSS_PATH)
PHP_ENV = \
	$(CROSS_ENV) \
	ac_cv_func_fopencookie=no \
	ac_cv_func_getaddrinfo=yes \
	LIBS=-ldl

#
# autoconf
#
PHP_AUTOCONF = \
	$(CROSS_AUTOCONF_USR) \
	--with-config-file-path=/etc \
	--disable-all

ifndef PTXCONF_PHP_CLI
PHP_AUTOCONF += --disable-cli
endif
ifdef PTXCONF_PHP_APACHE
PHP_AUTOCONF += --with-apxs=$(CROSS_LIB_DIR)/bin/apxs
endif

ifdef PTXCONF_VOICEBLUE_PHP_MODULE
PHP_AUTOCONF += VOICEBLUE_DIR=$(VOICEBLUE_DIR) --with-vblue_cnf=shared
endif
ifdef PTXCONF_NS_PHP_MODULE
PHP_AUTOCONF += NS_DIR=$(NS_DIR) --with-netstar_cfg=shared
endif

$(STATEDIR)/php.prepare: $(php_prepare_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(PHP_DIR)/config.cache)
	cd $(PHP_DIR) && \
 		$(PHP_PATH) $(PHP_ENV) \
		./configure $(PHP_AUTOCONF)
	@$(call touch, $@)

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

php_compile: $(STATEDIR)/php.compile

php_compile_deps = $(STATEDIR)/php.prepare

$(STATEDIR)/php.compile: $(php_compile_deps)
	@$(call targetinfo, $@)
	cd $(PHP_DIR) && $(PHP_ENV) $(PHP_PATH) make
	@$(call touch, $@)

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

php_install: $(STATEDIR)/php.install

$(STATEDIR)/php.install: $(STATEDIR)/php.compile
	@$(call targetinfo, $@)
	# FIXME
	cd $(PHP_DIR) && \
		$(PHP_ENV) $(PHP_PATH) \
		make install-build install-headers install-programs \
		INSTALL_ROOT=$(SYSROOT)
	install -m 755 -D $(PHP_DIR)/scripts/php-config $(PTXCONF_PREFIX)/bin/php-config
	install -m 755 -D $(PHP_DIR)/scripts/phpize $(PTXCONF_PREFIX)/bin/phpize
	@$(call touch, $@)

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

php_targetinstall: $(STATEDIR)/php.targetinstall

php_targetinstall_deps = $(STATEDIR)/php.compile
ifdef PTXCONF_APACHE
php_targetinstall_deps += $(STATEDIR)/apache.targetinstall
endif

$(STATEDIR)/php.targetinstall: $(php_targetinstall_deps)
	@$(call targetinfo, $@)

	@$(call install_init,default)
	@$(call install_fixup,PACKAGE,php)
	@$(call install_fixup,PRIORITY,optional)
	@$(call install_fixup,VERSION,$(PHP_VERSION))
	@$(call install_fixup,SECTION,base)
	@$(call install_fixup,AUTHOR,"Jiri Nesladek <nesladek\@2n.cz>")
	@$(call install_fixup,DEPENDS,)
	@$(call install_fixup,DESCRIPTION,missing)

	@$(call install_copy, 0, 0, 0755, /usr/lib/php)

ifdef PTXCONF_PHP_APACHE
	@$(call install_copy, 0, 0, 0644, $(PHP_DIR)/libs/libphp4.so, /usr/lib/apache/libphp4.so)
endif
ifdef PTXCONF_PHP_CLI
	@$(call install_copy, 0, 0, 0755, $(PHP_DIR)/sapi/cli/php, /usr/bin/php)
endif

	@$(call install_finish)

	@$(call touch, $@)

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

php_clean:
	rm -rf $(STATEDIR)/php.*
	rm -rf $(IMAGEDIR)/php_*
	rm -rf $(PHP_DIR)

# vim: syntax=make