add kernel 2.6 patch, from tuxap with changes for new kernel 2.6
[openwrt.git] / openwrt / package / php4 / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=php
6 PKG_VERSION:=4.3.11
7 PKG_RELEASE:=2
8 PKG_MD5SUM:=fbc67d240812136a9842bc1f2a217b7a
9
10 PKG_SOURCE_URL:=http://fr.php.net/distributions/
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
12 PKG_CAT:=bzcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15
16 include $(TOPDIR)/package/rules.mk
17
18 define PKG_mod_template
19
20 $$(IPKG_$(1)):
21 install -d -m0755 $$(IDIR_$(1))/usr/lib/php
22 install -m0755 $(PKG_BUILD_DIR)/modules/$(2).so $$(IDIR_$(1))/usr/lib/php
23 $(RSTRIP) $$(IDIR_$(1))
24 $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
25
26 endef
27
28 PKG_CONFIGURE_OPTS:= \
29 --enable-shared \
30 --disable-static \
31 --disable-rpath \
32 --disable-debug \
33 --without-pear \
34 \
35 --with-config-file-path=/etc \
36 --disable-ipv6 \
37 --enable-magic-quotes \
38 --enable-memory-limit \
39 --disable-overload \
40 --disable-short-tags \
41 \
42 --disable-ctype \
43 --disable-dom \
44 --enable-ftp=shared \
45 --without-gettext \
46 --without-iconv \
47 --disable-mbstring \
48 --disable-mbregex \
49 --with-openssl=shared,"$(STAGING_DIR)/usr" \
50 --with-kerberos=no \
51 --with-openssl-dir="$(STAGING_DIR)/usr" \
52 --enable-session=shared \
53 --enable-sockets=shared \
54 --disable-tokenizer \
55 --with-zlib="$(STAGING_DIR)/usr" \
56 --with-zlib-dir="$(STAGING_DIR)/usr" \
57
58 ifneq ($(BR2_PACKAGE_PHP4_MOD_GD),)
59 PKG_CONFIGURE_OPTS+= --with-gd=shared,"$(STAGING_DIR)/usr" \
60 --enable-gd-native-ttf \
61 --with-png-dir="$(STAGING_DIR)/usr"
62 else
63 PKG_CONFIGURE_OPTS+= --without-gd
64 endif
65 ifneq ($(BR2_PACKAGE_PHP4_MOD_LDAP),)
66 PKG_CONFIGURE_OPTS+= --with-ldap=shared,"$(STAGING_DIR)/usr"
67 --with-ldap-sasl="$(STAGING_DIR)/usr"
68 else
69 PKG_CONFIGURE_OPTS+= --without-ldap
70 endif
71 ifneq ($(BR2_PACKAGE_PHP4_MOD_MYSQL),)
72 PKG_CONFIGURE_OPTS+= --with-mysql=shared,"$(STAGING_DIR)/usr"
73 else
74 PKG_CONFIGURE_OPTS+= --without-mysql
75 endif
76 ifneq ($(BR2_PACKAGE_PHP4_MOD_PCRE),)
77 PKG_CONFIGURE_OPTS+= --with-pcre-regex=shared,"$(STAGING_DIR)/usr"
78 else
79 PKG_CONFIGURE_OPTS+= --without-pcre-regex
80 endif
81 ifneq ($(BR2_PACKAGE_PHP4_MOD_PGSQL),)
82 PKG_CONFIGURE_OPTS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
83 else
84 PKG_CONFIGURE_OPTS+= --without-pgsql
85 endif
86 ifneq ($(BR2_PACKAGE_PHP4_MOD_SQLITE),)
87 PKG_CONFIGURE_OPTS+= --with-sqlite=shared,"$(STAGING_DIR)/usr"
88 else
89 PKG_CONFIGURE_OPTS+= --without-sqlite
90 endif
91 ifneq ($(BR2_PACKAGE_PHP4_MOD_XML),)
92 PKG_CONFIGURE_OPTS+= --enable-xml=shared \
93 --with-expat-dir="$(STAGING_DIR)/usr"
94 else
95 PKG_CONFIGURE_OPTS+= --disable-xml
96 endif
97
98 $(eval $(call PKG_template,PHP4_CLI,php4-cli,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
99 $(eval $(call PKG_template,PHP4_CGI,php4-cgi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
100 $(eval $(call PKG_template,PHP4_FASTCGI,php4-fastcgi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
101
102 $(eval $(call PKG_template,PHP4_MOD_FTP,php4-mod-ftp,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
103 $(eval $(call PKG_template,PHP4_MOD_GD,php4-mod-gd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
104 $(eval $(call PKG_template,PHP4_MOD_LDAP,php4-mod-ldap,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
105 $(eval $(call PKG_template,PHP4_MOD_MYSQL,php4-mod-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
106 $(eval $(call PKG_template,PHP4_MOD_OPENSSL,php4-mod-openssl,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
107 $(eval $(call PKG_template,PHP4_MOD_PCRE,php4-mod-pcre,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
108 $(eval $(call PKG_template,PHP4_MOD_PGSQL,php4-mod-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
109 $(eval $(call PKG_template,PHP4_MOD_SESSION,php4-mod-session,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
110 $(eval $(call PKG_template,PHP4_MOD_SOCKETS,php4-mod-sockets,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
111 $(eval $(call PKG_template,PHP4_MOD_SQLITE,php4-mod-sqlite,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
112 $(eval $(call PKG_template,PHP4_MOD_XML,php4-mod-xml,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
113
114 $(eval $(call PKG_mod_template,PHP4_MOD_FTP,ftp))
115 $(eval $(call PKG_mod_template,PHP4_MOD_GD,gd))
116 $(eval $(call PKG_mod_template,PHP4_MOD_LDAP,ldap))
117 $(eval $(call PKG_mod_template,PHP4_MOD_MYSQL,mysql))
118 $(eval $(call PKG_mod_template,PHP4_MOD_OPENSSL,openssl))
119 $(eval $(call PKG_mod_template,PHP4_MOD_PCRE,pcre))
120 $(eval $(call PKG_mod_template,PHP4_MOD_PGSQL,pgsql))
121 $(eval $(call PKG_mod_template,PHP4_MOD_SESSION,session))
122 $(eval $(call PKG_mod_template,PHP4_MOD_SOCKETS,sockets))
123 $(eval $(call PKG_mod_template,PHP4_MOD_SQLITE,sqlite))
124 $(eval $(call PKG_mod_template,PHP4_MOD_XML,xml))
125
126
127 $(PKG_BUILD_DIR)/.configured:
128 touch $@
129
130 $(PKG_BUILD_DIR)/.built:
131 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
132 $(TARGET_CONFIGURE_OPTS) \
133 CFLAGS="$(TARGET_CFLAGS)" \
134 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
135 LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
136 LIBS="-lcrypto -lssl" \
137 php_cv_cc_rpath="no" \
138 ./configure \
139 --target=$(GNU_TARGET_NAME) \
140 --host=$(GNU_TARGET_NAME) \
141 --build=$(GNU_HOST_NAME) \
142 --program-prefix="" \
143 --program-suffix="" \
144 --prefix=/usr \
145 --exec-prefix=/usr \
146 --bindir=/usr/bin \
147 --datadir=/usr/share \
148 --includedir=/usr/include \
149 --infodir=/usr/share/info \
150 --libdir=/usr/lib \
151 --libexecdir=/usr/lib \
152 --localstatedir=/var \
153 --mandir=/usr/share/man \
154 --sbindir=/usr/sbin \
155 --sysconfdir=/etc \
156 $(DISABLE_LARGEFILE) \
157 $(DISABLE_NLS) \
158 $(PKG_CONFIGURE_OPTS) \
159 --enable-cli \
160 --disable-cgi \
161 --disable-fastcgi \
162 --enable-force-cgi-redirect \
163 --enable-discard-path \
164 );
165 $(MAKE) -C $(PKG_BUILD_DIR)
166 mv $(PKG_BUILD_DIR)/sapi/cli/php $(PKG_BUILD_DIR)/php-cli
167 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
168 $(TARGET_CONFIGURE_OPTS) \
169 CFLAGS="$(TARGET_CFLAGS)" \
170 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
171 LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
172 LIBS="-lcrypto -lssl" \
173 php_cv_cc_rpath="no" \
174 ./configure \
175 --target=$(GNU_TARGET_NAME) \
176 --host=$(GNU_TARGET_NAME) \
177 --build=$(GNU_HOST_NAME) \
178 --program-prefix="" \
179 --program-suffix="" \
180 --prefix=/usr \
181 --exec-prefix=/usr \
182 --bindir=/usr/bin \
183 --datadir=/usr/share \
184 --includedir=/usr/include \
185 --infodir=/usr/share/info \
186 --libdir=/usr/lib \
187 --libexecdir=/usr/lib \
188 --localstatedir=/var \
189 --mandir=/usr/share/man \
190 --sbindir=/usr/sbin \
191 --sysconfdir=/etc \
192 $(DISABLE_LARGEFILE) \
193 $(DISABLE_NLS) \
194 $(PKG_CONFIGURE_OPTS) \
195 --disable-cli \
196 --enable-cgi \
197 --disable-fastcgi \
198 --enable-force-cgi-redirect \
199 --enable-discard-path \
200 );
201 $(MAKE) -C $(PKG_BUILD_DIR)
202 mv $(PKG_BUILD_DIR)/sapi/cgi/php $(PKG_BUILD_DIR)/php-cgi
203 $(MAKE) -C $(PKG_BUILD_DIR) clean
204 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
205 $(TARGET_CONFIGURE_OPTS) \
206 CFLAGS="$(TARGET_CFLAGS)" \
207 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
208 LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
209 LIBS="-lcrypto -lssl" \
210 php_cv_cc_rpath="no" \
211 ./configure \
212 --target=$(GNU_TARGET_NAME) \
213 --host=$(GNU_TARGET_NAME) \
214 --build=$(GNU_HOST_NAME) \
215 --program-prefix="" \
216 --program-suffix="" \
217 --prefix=/usr \
218 --exec-prefix=/usr \
219 --bindir=/usr/sbin \
220 --datadir=/usr/share \
221 --includedir=/usr/include \
222 --infodir=/usr/share/info \
223 --libdir=/usr/lib \
224 --libexecdir=/usr/lib \
225 --localstatedir=/var \
226 --mandir=/usr/share/man \
227 --sbindir=/usr/sbin \
228 --sysconfdir=/etc \
229 $(DISABLE_LARGEFILE) \
230 $(DISABLE_NLS) \
231 $(PKG_CONFIGURE_OPTS) \
232 --disable-cli \
233 --enable-cgi \
234 --enable-fastcgi \
235 --enable-force-cgi-redirect \
236 --enable-discard-path \
237 );
238 $(MAKE) -C $(PKG_BUILD_DIR)
239 mv $(PKG_BUILD_DIR)/sapi/cgi/php $(PKG_BUILD_DIR)/php-fastcgi
240 touch $@
241
242 $(IPKG_PHP4_CLI):
243 install -m0755 -d $(IDIR_PHP4_CLI)/etc
244 install -m0644 ./files/php.ini $(IDIR_PHP4_CLI)/etc/
245 install -m0755 -d $(IDIR_PHP4_CLI)/usr/bin
246 cp -fpR $(PKG_BUILD_DIR)/php-cli $(IDIR_PHP4_CLI)/usr/bin/php
247 $(RSTRIP) $(IDIR_PHP4_CLI)
248 $(IPKG_BUILD) $(IDIR_PHP4_CLI) $(PACKAGE_DIR)
249
250 $(IPKG_PHP4_CGI):
251 install -m0755 -d $(IDIR_PHP4_CGI)/etc
252 install -m0644 ./files/php.ini $(IDIR_PHP4_CGI)/etc/
253 install -m0755 -d $(IDIR_PHP4_CGI)/usr/bin
254 cp -fpR $(PKG_BUILD_DIR)/php-cgi $(IDIR_PHP4_CGI)/usr/bin/php
255 $(RSTRIP) $(IDIR_PHP4_CGI)
256 $(IPKG_BUILD) $(IDIR_PHP4_CGI) $(PACKAGE_DIR)
257
258 $(IPKG_PHP4_FASTCGI):
259 install -m0755 -d $(IDIR_PHP4_FASTCGI)/etc
260 install -m0644 ./files/php.ini $(IDIR_PHP4_FASTCGI)/etc/
261 install -m0755 -d $(IDIR_PHP4_FASTCGI)/etc/init.d
262 install -m0755 ./files/php.init $(IDIR_PHP4_FASTCGI)/etc/init.d/php
263 install -m0755 -d $(IDIR_PHP4_FASTCGI)/usr/sbin
264 cp -fpR $(PKG_BUILD_DIR)/php-fastcgi $(IDIR_PHP4_FASTCGI)/usr/sbin/php
265 $(RSTRIP) $(IDIR_PHP4_FASTCGI)
266 $(IPKG_BUILD) $(IDIR_PHP4_FASTCGI) $(PACKAGE_DIR)
267
This page took 0.048453 seconds and 5 git commands to generate.