clean up board-dependent files, add pppoatm support, add proper config examples
[openwrt.git] / openwrt / package / php5 / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=php
6 PKG_VERSION:=5.0.4
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=fb1aac107870f897d26563a9cc5053c0
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 --disable-spl \
35 \
36 --with-config-file-path=/etc \
37 --disable-ipv6 \
38 --enable-magic-quotes \
39 --enable-memory-limit \
40 --disable-short-tags \
41 \
42 --disable-ctype \
43 --disable-dom \
44 --enable-ftp=shared \
45 --without-gettext \
46 --without-iconv \
47 --disable-libxml \
48 --without-libxml-dir \
49 --disable-mbstring \
50 --disable-mbregex \
51 --with-openssl=shared,"$(STAGING_DIR)/usr" \
52 --with-kerberos=no \
53 --with-openssl-dir="$(STAGING_DIR)/usr" \
54 --enable-session=shared \
55 --disable-simplexml \
56 --disable-soap \
57 --enable-sockets=shared \
58 --disable-tokenizer \
59 --with-zlib="$(STAGING_DIR)/usr" \
60 --with-zlib-dir="$(STAGING_DIR)/usr" \
61
62 ifneq ($(BR2_PACKAGE_PHP5_MOD_GD),)
63 PKG_CONFIGURE_OPTS+= --with-gd=shared,"$(STAGING_DIR)/usr" \
64 --enable-gd-native-ttf \
65 --with-png-dir="$(STAGING_DIR)/usr"
66 else
67 PKG_CONFIGURE_OPTS+= --without-gd
68 endif
69 ifneq ($(BR2_PACKAGE_PHP5_MOD_LDAP),)
70 PKG_CONFIGURE_OPTS+= --with-ldap=shared,"$(STAGING_DIR)/usr" \
71 --with-ldap-sasl="$(STAGING_DIR)/usr"
72 else
73 PKG_CONFIGURE_OPTS+= --without-ldap
74 endif
75 ifneq ($(BR2_PACKAGE_PHP5_MOD_MYSQL),)
76 PKG_CONFIGURE_OPTS+= --with-mysql=shared,"$(STAGING_DIR)/usr"
77 else
78 PKG_CONFIGURE_OPTS+= --without-mysql
79 endif
80 ifneq ($(BR2_PACKAGE_PHP5_MOD_PCRE),)
81 PKG_CONFIGURE_OPTS+= --with-pcre-regex=shared,"$(STAGING_DIR)/usr"
82 else
83 PKG_CONFIGURE_OPTS+= --without-pcre-regex
84 endif
85 ifneq ($(BR2_PACKAGE_PHP5_MOD_PGSQL),)
86 PKG_CONFIGURE_OPTS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
87 else
88 PKG_CONFIGURE_OPTS+= --without-pgsql
89 endif
90 ifneq ($(BR2_PACKAGE_PHP5_MOD_SQLITE),)
91 PKG_CONFIGURE_OPTS+= --with-sqlite=shared,"$(STAGING_DIR)/usr"
92 else
93 PKG_CONFIGURE_OPTS+= --without-sqlite
94 endif
95 ifneq ($(BR2_PACKAGE_PHP5_MOD_XML),)
96 PKG_CONFIGURE_OPTS+= --enable-xml=shared,"$(STAGING_DIR)/usr" \
97 --with-libexpat-dir="$(STAGING_DIR)/usr"
98 else
99 PKG_CONFIGURE_OPTS+= --disable-xml
100 endif
101
102 $(eval $(call PKG_template,PHP5_CLI,php5-cli,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
103 $(eval $(call PKG_template,PHP5_CGI,php5-cgi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
104 $(eval $(call PKG_template,PHP5_FASTCGI,php5-fastcgi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
105
106 $(eval $(call PKG_template,PHP5_MOD_FTP,php5-mod-ftp,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
107 $(eval $(call PKG_template,PHP5_MOD_GD,php5-mod-gd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
108 $(eval $(call PKG_template,PHP5_MOD_LDAP,php5-mod-ldap,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
109 $(eval $(call PKG_template,PHP5_MOD_MYSQL,php5-mod-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
110 $(eval $(call PKG_template,PHP5_MOD_OPENSSL,php5-mod-openssl,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
111 $(eval $(call PKG_template,PHP5_MOD_PCRE,php5-mod-pcre,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
112 $(eval $(call PKG_template,PHP5_MOD_PGSQL,php5-mod-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
113 $(eval $(call PKG_template,PHP5_MOD_SESSION,php5-mod-session,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
114 $(eval $(call PKG_template,PHP5_MOD_SOCKETS,php5-mod-sockets,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
115 $(eval $(call PKG_template,PHP5_MOD_SQLITE,php5-mod-sqlite,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
116 $(eval $(call PKG_template,PHP5_MOD_XML,php5-mod-xml,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
117
118 $(eval $(call PKG_mod_template,PHP5_MOD_FTP,ftp))
119 $(eval $(call PKG_mod_template,PHP5_MOD_GD,gd))
120 $(eval $(call PKG_mod_template,PHP5_MOD_LDAP,ldap))
121 $(eval $(call PKG_mod_template,PHP5_MOD_MYSQL,mysql))
122 $(eval $(call PKG_mod_template,PHP5_MOD_OPENSSL,openssl))
123 $(eval $(call PKG_mod_template,PHP5_MOD_PCRE,pcre))
124 $(eval $(call PKG_mod_template,PHP5_MOD_PGSQL,pgsql))
125 $(eval $(call PKG_mod_template,PHP5_MOD_SESSION,session))
126 $(eval $(call PKG_mod_template,PHP5_MOD_SOCKETS,sockets))
127 $(eval $(call PKG_mod_template,PHP5_MOD_SQLITE,sqlite))
128 $(eval $(call PKG_mod_template,PHP5_MOD_XML,xml))
129
130
131 $(PKG_BUILD_DIR)/.configured:
132 touch $@
133
134 $(PKG_BUILD_DIR)/.built:
135 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
136 $(TARGET_CONFIGURE_OPTS) \
137 CFLAGS="$(TARGET_CFLAGS)" \
138 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
139 LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
140 LIBS="-lcrypto -lssl" \
141 php_cv_cc_rpath="no" \
142 ./configure \
143 --target=$(GNU_TARGET_NAME) \
144 --host=$(GNU_TARGET_NAME) \
145 --build=$(GNU_HOST_NAME) \
146 --program-prefix="" \
147 --program-suffix="" \
148 --prefix=/usr \
149 --exec-prefix=/usr \
150 --bindir=/usr/bin \
151 --datadir=/usr/share \
152 --includedir=/usr/include \
153 --infodir=/usr/share/info \
154 --libdir=/usr/lib \
155 --libexecdir=/usr/lib \
156 --localstatedir=/var \
157 --mandir=/usr/share/man \
158 --sbindir=/usr/sbin \
159 --sysconfdir=/etc \
160 $(DISABLE_LARGEFILE) \
161 $(DISABLE_NLS) \
162 $(PKG_CONFIGURE_OPTS) \
163 --enable-cli \
164 --disable-cgi \
165 --disable-fastcgi \
166 --enable-force-cgi-redirect \
167 --enable-discard-path \
168 );
169 $(MAKE) -C $(PKG_BUILD_DIR)
170 mv $(PKG_BUILD_DIR)/sapi/cli/php $(PKG_BUILD_DIR)/php-cli
171 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
172 $(TARGET_CONFIGURE_OPTS) \
173 CFLAGS="$(TARGET_CFLAGS)" \
174 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
175 LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
176 LIBS="-lcrypto -lssl" \
177 php_cv_cc_rpath="no" \
178 ./configure \
179 --target=$(GNU_TARGET_NAME) \
180 --host=$(GNU_TARGET_NAME) \
181 --build=$(GNU_HOST_NAME) \
182 --program-prefix="" \
183 --program-suffix="" \
184 --prefix=/usr \
185 --exec-prefix=/usr \
186 --bindir=/usr/bin \
187 --datadir=/usr/share \
188 --includedir=/usr/include \
189 --infodir=/usr/share/info \
190 --libdir=/usr/lib \
191 --libexecdir=/usr/lib \
192 --localstatedir=/var \
193 --mandir=/usr/share/man \
194 --sbindir=/usr/sbin \
195 --sysconfdir=/etc \
196 $(DISABLE_LARGEFILE) \
197 $(DISABLE_NLS) \
198 $(PKG_CONFIGURE_OPTS) \
199 --disable-cli \
200 --enable-cgi \
201 --disable-fastcgi \
202 --enable-force-cgi-redirect \
203 --enable-discard-path \
204 );
205 $(MAKE) -C $(PKG_BUILD_DIR)
206 mv $(PKG_BUILD_DIR)/sapi/cgi/php $(PKG_BUILD_DIR)/php-cgi
207 $(MAKE) -C $(PKG_BUILD_DIR) clean
208 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
209 $(TARGET_CONFIGURE_OPTS) \
210 CFLAGS="$(TARGET_CFLAGS)" \
211 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
212 LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
213 LIBS="-lcrypto -lssl" \
214 php_cv_cc_rpath="no" \
215 ./configure \
216 --target=$(GNU_TARGET_NAME) \
217 --host=$(GNU_TARGET_NAME) \
218 --build=$(GNU_HOST_NAME) \
219 --program-prefix="" \
220 --program-suffix="" \
221 --prefix=/usr \
222 --exec-prefix=/usr \
223 --bindir=/usr/sbin \
224 --datadir=/usr/share \
225 --includedir=/usr/include \
226 --infodir=/usr/share/info \
227 --libdir=/usr/lib \
228 --libexecdir=/usr/lib \
229 --localstatedir=/var \
230 --mandir=/usr/share/man \
231 --sbindir=/usr/sbin \
232 --sysconfdir=/etc \
233 $(DISABLE_LARGEFILE) \
234 $(DISABLE_NLS) \
235 $(PKG_CONFIGURE_OPTS) \
236 --disable-cli \
237 --enable-cgi \
238 --enable-fastcgi \
239 --enable-force-cgi-redirect \
240 --enable-discard-path \
241 );
242 $(MAKE) -C $(PKG_BUILD_DIR)
243 mv $(PKG_BUILD_DIR)/sapi/cgi/php $(PKG_BUILD_DIR)/php-fastcgi
244 touch $@
245
246 $(IPKG_PHP5_CLI):
247 install -m0755 -d $(IDIR_PHP5_CLI)/etc
248 install -m0644 ./files/php.ini $(IDIR_PHP5_CLI)/etc/
249 install -m0755 -d $(IDIR_PHP5_CLI)/usr/bin
250 cp -fpR $(PKG_BUILD_DIR)/php-cli $(IDIR_PHP5_CLI)/usr/bin/php
251 $(RSTRIP) $(IDIR_PHP5_CLI)
252 $(IPKG_BUILD) $(IDIR_PHP5_CLI) $(PACKAGE_DIR)
253
254 $(IPKG_PHP5_CGI):
255 install -m0755 -d $(IDIR_PHP5_CGI)/etc
256 install -m0644 ./files/php.ini $(IDIR_PHP5_CGI)/etc/
257 install -m0755 -d $(IDIR_PHP5_CGI)/usr/bin
258 cp -fpR $(PKG_BUILD_DIR)/php-cgi $(IDIR_PHP5_CGI)/usr/bin/php
259 $(RSTRIP) $(IDIR_PHP5_CGI)
260 $(IPKG_BUILD) $(IDIR_PHP5_CGI) $(PACKAGE_DIR)
261
262 $(IPKG_PHP5_FASTCGI):
263 install -m0755 -d $(IDIR_PHP5_FASTCGI)/etc
264 install -m0644 ./files/php.ini $(IDIR_PHP5_FASTCGI)/etc/
265 install -m0755 -d $(IDIR_PHP5_FASTCGI)/etc/init.d
266 install -m0755 ./files/php.init $(IDIR_PHP5_FASTCGI)/etc/init.d/php
267 install -m0755 -d $(IDIR_PHP5_FASTCGI)/usr/sbin
268 cp -fpR $(PKG_BUILD_DIR)/php-fastcgi $(IDIR_PHP5_FASTCGI)/usr/sbin/php
269 $(RSTRIP) $(IDIR_PHP5_FASTCGI)
270 $(IPKG_BUILD) $(IDIR_PHP5_FASTCGI) $(PACKAGE_DIR)
271
This page took 0.055368 seconds and 5 git commands to generate.