summaryrefslogtreecommitdiffstats
path: root/rules/php4.make
blob: 937a14518b78e4889c4c2d6228eb021eb1fc3c29 (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
# -*-makefile-*-
# $Id: php4.make,v 1.3 2006/09/26 18:29:22 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_PHP4) += php4

#
# Paths and names
#
PHP4_VERSION	= 4.4.4
PHP4		= php-$(PHP4_VERSION)
PHP4_SUFFIX	= tar.bz2
PHP4_URL	= http://de.php.net/get/$(PHP4).$(PHP4_SUFFIX)/from/this/mirror
PHP4_SOURCE	= $(SRCDIR)/$(PHP4).$(PHP4_SUFFIX)
PHP4_DIR	= $(BUILDDIR)/$(PHP4)


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

php4_get: $(STATEDIR)/php4.get

$(STATEDIR)/php4.get: $(php4_get_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(PHP4_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, PHP4)

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

php4_extract: $(STATEDIR)/php4.extract

$(STATEDIR)/php4.extract: $(php4_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(PHP4_DIR))
	@$(call extract, PHP4)
	@$(call patchin, PHP4)
	@$(call touch, $@)

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

php4_prepare: $(STATEDIR)/php4.prepare

PHP4_PATH = PATH=$(CROSS_PATH)
PHP4_ENV = \
	$(CROSS_ENV) \
	ac_cv_func_fopencookie=no \
	ac_cv_func_getaddrinfo=yes \
	LIBS=-ldl

#
# autoconf
#
PHP4_AUTOCONF = \
	$(CROSS_AUTOCONF_USR) \
	--with-config-file-path=/etc \
	--with-expat-dir=$(SYSROOT) \
	--disable-all

ifndef PTXCONF_PHP4_CLI
PHP4_AUTOCONF += --disable-cli
endif
ifdef PTXCONF_APACHE2_MOD_PHP4
PHP4_AUTOCONF += --with-apxs2=$(SYSROOT)/usr/bin/apxs
endif

$(STATEDIR)/php4.prepare: $(php4_prepare_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(PHP4_DIR)/config.cache)
	cd $(PHP4_DIR) && \
 		$(PHP4_PATH) $(PHP4_ENV) \
		./configure $(PHP4_AUTOCONF)
	@$(call touch, $@)

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

php4_compile: $(STATEDIR)/php4.compile

$(STATEDIR)/php4.compile: $(php4_compile_deps_default)
	@$(call targetinfo, $@)
	cd $(PHP4_DIR) && $(PHP4_ENV) $(PHP4_PATH) make
	@$(call touch, $@)

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

php4_install: $(STATEDIR)/php4.install

$(STATEDIR)/php4.install: $(php4_install_deps_default)
	@$(call targetinfo, $@)
	# FIXME
	cd $(PHP4_DIR) && \
		$(PHP4_ENV) $(PHP4_PATH) \
		make install-build install-headers install-programs \
		INSTALL_ROOT=$(SYSROOT)
	install -m 755 -D $(PHP4_DIR)/scripts/php-config $(PTXCONF_PREFIX)/bin/php-config
	install -m 755 -D $(PHP4_DIR)/scripts/phpize $(PTXCONF_PREFIX)/bin/phpize
	@$(call touch, $@)

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

php4_targetinstall: $(STATEDIR)/php4.targetinstall

$(STATEDIR)/php4.targetinstall: $(php4_targetinstall_deps_default)
	@$(call targetinfo, $@)

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

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

ifdef PTXCONF_APACHE2_MOD_PHP4
	@$(call install_copy, php4, 0, 0, 0644, $(PHP4_DIR)/libs/libphp4.so, /usr/lib/apache2/libphp4.so)
endif
ifdef PTXCONF_PHP4_CLI
	@$(call install_copy, php4, 0, 0, 0755, $(PHP4_DIR)/sapi/cli/php, /usr/bin/php)
endif

	@$(call install_finish, php4)

	@$(call touch, $@)

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

php4_clean:
	rm -rf $(STATEDIR)/php4.*
	rm -rf $(IMAGEDIR)/php4_*
	rm -rf $(PHP4_DIR)

# vim: syntax=make