2 # Copyright (C) 2006-2011 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
15 PKG_SOURCE_URL
:=http
://www.php.net
/distributions
/
16 PKG_MD5SUM
:=2286f5a82a6e8397955a0025c1c2ad98
18 PKG_FIXUP
:=libtool no-autoreconf
33 mbstring mcrypt mysql \
35 pcntl pdo pdo-mysql pdo-pgsql pdo-sqlite pgsql \
36 session simplexml soap sockets sqlite sqlite3 sysvmsg sysvsem sysvshm \
38 xml xmlreader xmlwriter \
40 PKG_CONFIG_DEPENDS
:= \
41 CONFIG_PACKAGE_php5-cgi CONFIG_PACKAGE_php5-cli \
42 $(patsubst %,CONFIG_PACKAGE_php5-mod-
%,$(PHP5_MODULES
)) \
43 CONFIG_PHP5_FILTER CONFIG_PHP5_LIBXML
45 include $(INCLUDE_DIR
)/package.mk
46 include $(INCLUDE_DIR
)/nls.mk
48 define Package
/php5
/Default
52 TITLE
:=PHP5 Hypertext preprocessor
53 URL
:=http
://www.php.net
/
54 MAINTAINER
:=Michael Heimpold
<mhei@heimpold.de
>
58 define Package
/php5
/Default
/description
59 PHP is a widely-used general-purpose scripting language that is especially
60 suited for Web development and can be embedded into HTML.
63 define Package
/php5
/config
65 bool
"PHP5 Filter support"
66 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
69 bool
"PHP5 LIBXML support"
70 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
74 $(call Package
/php5
/Default
)
76 DEPENDS
:=+libpcre
+zlib \
77 +PHP5_LIBXML
:libxml2 \
78 +PACKAGE_php5-mod-apc
:librt \
79 +(PACKAGE_php5-mod-sqlite3||PACKAGE_php5-mod-pdo-sqlite
):libsqlite3 \
80 +(PACKAGE_php5-mod-sqlite3||PACKAGE_php5-mod-pdo-sqlite
):libpthread
83 define Package
/php5
/description
84 $(call Package
/php5
/Default
/description
)
85 This package contains only the PHP config file. You must actually choose
86 your PHP flavour
(cli
, cgi or fastcgi
).
89 define Package
/php5-cli
90 $(call Package
/php5
/Default
)
94 define Package
/php5-cli
/description
95 $(call Package
/php5
/Default
/description
)
96 This package contains the CLI version of the PHP5 interpreter.
99 define Package
/php5-cgi
100 $(call Package
/php5
/Default
)
101 TITLE
+= (CGI
& FastCGI
)
104 define Package
/php5-cgi
/description
105 $(call Package
/php5
/Default
/description
)
106 This package contains the CGI version of the PHP5 interpreter.
109 define Package
/php5-fastcgi
110 $(call Package
/php5
/Default
)
112 TITLE
:=FastCGI startup script
115 define Package
/php5-fastcgi
/description
116 As FastCGI support is now a core feature the php5-fastcgi package now depends
117 on the php5-cgi package
, containing just the startup script.
127 --with-config-file-path
=/etc \
128 --with-config-file-scan-dir
=/etc
/php5 \
129 --enable-magic-quotes \
130 --disable-short-tags \
132 --with-zlib
="$(STAGING_DIR)/usr" \
133 --with-zlib-dir
="$(STAGING_DIR)/usr" \
134 --with-pcre-regex
="$(STAGING_DIR)/usr" \
138 PKG_BUILD_DEPENDS
+=libopenssl zlib libcurl libgd libgmp libopenldap libmysqlclient libpq libsqlite2 libpthread libsqlite3 libpcre libxml2
139 # force PKG_CONFIGURE_{LIBS,OPTS} below when built in the SDK
140 CONFIG_PACKAGE_php5-cli
:=m
141 CONFIG_PACKAGE_php5-cgi
:=m
142 CONFIG_PACKAGE_php5-fastcgi
:=m
143 CONFIG_PACKAGE_php5-mod-curl
:=m
144 CONFIG_PACKAGE_php5-mod-gd
:=m
145 CONFIG_PACKAGE_php5-mod-gmp
:=m
146 CONFIG_PACKAGE_php5-mod-ldap
:=m
147 CONFIG_PACKAGE_php5-mod-mysql
:=m
148 CONFIG_PACKAGE_php5-mod-pgsql
:=m
149 CONFIG_PACKAGE_php5-mod-sqlite
:=m
150 CONFIG_PACKAGE_php5-mod-sqlite3
:=m
151 CONFIG_PACKAGE_php5-mod-xml
:=m
154 ifneq ($(CONFIG_PACKAGE_php5-cli
),)
155 CONFIGURE_ARGS
+= --enable-cli
157 CONFIGURE_ARGS
+= --disable-cli
160 ifneq ($(CONFIG_PACKAGE_php5-cgi
),)
161 CONFIGURE_ARGS
+= --enable-cgi
163 CONFIGURE_ARGS
+= --disable-cgi
166 ifneq ($(CONFIG_PACKAGE_php5-mod-apc
),)
167 CONFIGURE_ARGS
+= --enable-apc
=shared
--disable-apc-mmap
--disable-apc-pthreadmutex
168 CONFIGURE_LIBS
+= -lrt
170 CONFIGURE_ARGS
+= --disable-apc
173 ifneq ($(CONFIG_PACKAGE_php5-mod-ctype
),)
174 CONFIGURE_ARGS
+= --enable-ctype
=shared
176 CONFIGURE_ARGS
+= --disable-ctype
179 ifneq ($(CONFIG_PACKAGE_php5-mod-curl
),)
180 CONFIGURE_ARGS
+= --with-curl
=shared
,"$(STAGING_DIR)/usr"
182 CONFIGURE_ARGS
+= --without-curl
185 ifneq ($(CONFIG_PACKAGE_php5-mod-fileinfo
),)
186 CONFIGURE_ARGS
+= --enable-fileinfo
=shared
188 CONFIGURE_ARGS
+= --disable-fileinfo
191 ifneq ($(CONFIG_PACKAGE_php5-mod-gettext
),)
192 CONFIGURE_ARGS
+= --with-gettext
=shared
,"$(STAGING_DIR)/usr/lib/libintl-full"
194 CONFIGURE_ARGS
+= --without-gettext
197 ifneq ($(CONFIG_PACKAGE_php5-mod-dio
),)
198 CONFIGURE_ARGS
+= --enable-dio
=shared
200 CONFIGURE_ARGS
+= --disable-dio
203 ifneq ($(CONFIG_PACKAGE_php5-mod-dom
),)
204 CONFIGURE_ARGS
+= --enable-dom
=shared
206 CONFIGURE_ARGS
+= --disable-dom
209 ifneq ($(CONFIG_PACKAGE_php5-mod-exif
),)
210 CONFIGURE_ARGS
+= --enable-exif
=shared
212 CONFIGURE_ARGS
+= --disable-exif
215 ifneq ($(CONFIG_PACKAGE_php5-mod-ftp
),)
216 CONFIGURE_ARGS
+= --enable-ftp
=shared
218 CONFIGURE_ARGS
+= --disable-ftp
221 ifneq ($(CONFIG_PACKAGE_php5-mod-gd
),)
223 --with-gd
=shared
,"$(STAGING_DIR)/usr" \
224 --without-freetype-dir \
225 --with-jpeg-dir
="$(STAGING_DIR)/usr" \
226 --with-png-dir
="$(STAGING_DIR)/usr" \
229 --enable-gd-native-ttf \
230 --disable-gd-jis-conv
232 CONFIGURE_ARGS
+= --without-gd
235 ifneq ($(CONFIG_PACKAGE_php5-mod-gmp
),)
236 CONFIGURE_ARGS
+= --with-gmp
=shared
,"$(STAGING_DIR)/usr"
238 CONFIGURE_ARGS
+= --without-gmp
241 ifneq ($(CONFIG_PACKAGE_php5-mod-hash
),)
242 CONFIGURE_ARGS
+= --enable-hash
=shared
244 CONFIGURE_ARGS
+= --disable-hash
247 ifneq ($(CONFIG_PACKAGE_php5-mod-iconv
),)
248 CONFIGURE_ARGS
+= --with-iconv
=shared
,"$(ICONV_PREFIX)"
250 CONFIGURE_ARGS
+= --without-iconv
253 ifneq ($(CONFIG_PACKAGE_php5-mod-json
),)
254 CONFIGURE_ARGS
+= --enable-json
=shared
256 CONFIGURE_ARGS
+= --disable-json
259 ifneq ($(CONFIG_PACKAGE_php5-mod-ldap
),)
261 --with-ldap
=shared
,"$(STAGING_DIR)/usr" \
262 --with-ldap-sasl
="$(STAGING_DIR)/usr"
264 CONFIGURE_ARGS
+= --without-ldap
267 ifneq ($(CONFIG_PACKAGE_php5-mod-libevent
),)
268 CONFIGURE_ARGS
+= --with-libevent
=shared
,"$(STAGING_DIR)/usr"
270 CONFIGURE_ARGS
+= --without-libevent
273 ifneq ($(CONFIG_PACKAGE_php5-mod-mbstring
),)
274 CONFIGURE_ARGS
+= --enable-mbstring
=shared
--enable-mbregex
276 CONFIGURE_ARGS
+= --disable-mbstring
279 ifneq ($(CONFIG_PACKAGE_php5-mod-mcrypt
),)
280 CONFIGURE_ARGS
+= --with-mcrypt
=shared
,"$(STAGING_DIR)/usr"
282 CONFIGURE_ARGS
+= --without-mcrypt
285 ifneq ($(CONFIG_PACKAGE_php5-mod-mysql
),)
286 CONFIGURE_ARGS
+= --with-mysql
=shared
,"$(STAGING_DIR)/usr"
288 CONFIGURE_ARGS
+= --without-mysql
291 ifneq ($(CONFIG_PACKAGE_php5-mod-openssl
),)
293 --with-openssl
=shared
,"$(STAGING_DIR)/usr" \
295 --with-openssl-dir
="$(STAGING_DIR)/usr"
297 CONFIGURE_ARGS
+= --without-openssl
300 ifneq ($(CONFIG_PACKAGE_php5-mod-pcntl
),)
301 CONFIGURE_ARGS
+= --enable-pcntl
=shared
303 CONFIGURE_ARGS
+= --disable-pcntl
306 ifneq ($(CONFIG_PACKAGE_php5-mod-pdo
),)
307 CONFIGURE_ARGS
+= --enable-pdo
=shared
308 ifneq ($(CONFIG_PACKAGE_php5-mod-pdo-mysql
),)
309 CONFIGURE_ARGS
+= --with-pdo-mysql
=shared
,"$(STAGING_DIR)/usr"
311 CONFIGURE_ARGS
+= --without-pdo-mysql
313 ifneq ($(CONFIG_PACKAGE_php5-mod-pdo-pgsql
),)
314 CONFIGURE_ARGS
+= --with-pdo-pgsql
=shared
,"$(STAGING_DIR)/usr"
316 CONFIGURE_ARGS
+= --without-pdo-pgsql
318 ifneq ($(CONFIG_PACKAGE_php5-mod-pdo-sqlite
),)
319 CONFIGURE_ARGS
+= --with-pdo-sqlite
=shared
,"$(STAGING_DIR)/usr"
320 CONFIGURE_LIBS
+= -lsqlite3
-lpthread
322 CONFIGURE_ARGS
+= --without-pdo-sqlite
325 CONFIGURE_ARGS
+= --disable-pdo
328 ifneq ($(CONFIG_PACKAGE_php5-mod-pgsql
),)
329 CONFIGURE_ARGS
+= --with-pgsql
=shared
,"$(STAGING_DIR)/usr"
331 CONFIGURE_ARGS
+= --without-pgsql
334 ifneq ($(CONFIG_PACKAGE_php5-mod-session
),)
335 CONFIGURE_ARGS
+= --enable-session
=shared
337 CONFIGURE_ARGS
+= --disable-session
340 ifneq ($(CONFIG_PACKAGE_php5-mod-simplexml
),)
341 CONFIGURE_ARGS
+= --enable-simplexml
=shared
343 CONFIGURE_ARGS
+= --disable-simplexml
346 ifneq ($(CONFIG_PACKAGE_php5-mod-soap
),)
347 CONFIGURE_ARGS
+= --enable-soap
=shared
349 CONFIGURE_ARGS
+= --disable-soap
352 ifneq ($(CONFIG_PACKAGE_php5-mod-sockets
),)
353 CONFIGURE_ARGS
+= --enable-sockets
=shared
355 CONFIGURE_ARGS
+= --disable-sockets
358 ifneq ($(CONFIG_PACKAGE_php5-mod-sqlite
),)
359 CONFIGURE_ARGS
+= --with-sqlite
=shared
,"$(STAGING_DIR)/usr"
361 CONFIGURE_ARGS
+= --without-sqlite
364 ifneq ($(CONFIG_PACKAGE_php5-mod-sqlite3
),)
365 CONFIGURE_ARGS
+= --with-sqlite3
=shared
,"$(STAGING_DIR)/usr"
366 CONFIGURE_LIBS
+= -lsqlite3
-lpthread
368 CONFIGURE_ARGS
+= --without-sqlite3
371 ifneq ($(CONFIG_PACKAGE_php5-mod-sysvmsg
),)
372 CONFIGURE_ARGS
+= --enable-sysvmsg
=shared
374 CONFIGURE_ARGS
+= --disable-sysvmsg
377 ifneq ($(CONFIG_PACKAGE_php5-mod-sysvsem
),)
378 CONFIGURE_ARGS
+= --enable-sysvsem
=shared
380 CONFIGURE_ARGS
+= --disable-sysvsem
383 ifneq ($(CONFIG_PACKAGE_php5-mod-sysvshm
),)
384 CONFIGURE_ARGS
+= --enable-sysvshm
=shared
386 CONFIGURE_ARGS
+= --disable-sysvshm
389 ifneq ($(CONFIG_PACKAGE_php5-mod-tokenizer
),)
390 CONFIGURE_ARGS
+= --enable-tokenizer
=shared
392 CONFIGURE_ARGS
+= --disable-tokenizer
395 ifneq ($(CONFIG_PACKAGE_php5-mod-xml
),)
396 CONFIGURE_ARGS
+= --enable-xml
=shared
,"$(STAGING_DIR)/usr"
397 ifneq ($(CONFIG_PHP5_LIBXML
),)
398 CONFIGURE_ARGS
+= --with-libxml-dir
="$(STAGING_DIR)/usr/include/libxml2"
400 CONFIGURE_ARGS
+= --with-libexpat-dir
="$(STAGING_DIR)/usr"
403 CONFIGURE_ARGS
+= --disable-xml
406 ifneq ($(CONFIG_PACKAGE_php5-mod-xmlreader
),)
407 CONFIGURE_ARGS
+= --enable-xmlreader
=shared
,"$(STAGING_DIR)/usr"
409 CONFIGURE_ARGS
+= --disable-xmlreader
412 ifneq ($(CONFIG_PACKAGE_php5-mod-xmlwriter
),)
413 CONFIGURE_ARGS
+= --enable-xmlwriter
=shared
,"$(STAGING_DIR)/usr"
415 CONFIGURE_ARGS
+= --disable-xmlwriter
418 ifneq ($(CONFIG_PHP5_FILTER
),)
419 CONFIGURE_ARGS
+= --enable-filter
421 CONFIGURE_ARGS
+= --disable-filter
424 ifneq ($(CONFIG_PHP5_LIBXML
),)
425 CONFIGURE_ARGS
+= --enable-libxml
426 CONFIGURE_ARGS
+= --with-libxml-dir
="$(STAGING_DIR)/usr/include/libxml2"
428 CONFIGURE_ARGS
+= --disable-libxml
432 LIBS
="$(CONFIGURE_LIBS)" \
433 ac_cv_c_bigendian_php
=$(if
$(CONFIG_BIG_ENDIAN
),yes
,no
) \
434 php_cv_cc_rpath
="no" \
435 iconv_impl_name
="gnu_libiconv" \
436 ac_cv_php_xml2_config_path
="$(STAGING_DIR)/host/bin/xml2-config" \
438 define Package
/php5
/conffiles
442 define Package
/php5
/install
443 $(INSTALL_DIR
) $(1)/etc
444 $(INSTALL_DATA
) .
/files
/php.ini
$(1)/etc
/
447 define Package
/php5-cli
/install
448 $(INSTALL_DIR
) $(1)/usr
/bin
449 $(CP
) $(PKG_BUILD_DIR
)/sapi
/cli
/php
$(1)/usr
/bin
/php-cli
452 define Package
/php5-cgi
/install
453 $(INSTALL_DIR
) $(1)/usr
/bin
454 $(CP
) $(PKG_BUILD_DIR
)/sapi
/cgi
/php-cgi
$(1)/usr
/bin
/php-cgi
455 ln
-sf php-cgi
$(1)/usr
/bin
/php-fcgi
458 define Package
/php5-fastcgi
/install
459 $(INSTALL_DIR
) $(1)/etc
/init.d
460 $(INSTALL_BIN
) .
/files
/php.init
$(1)/etc
/init.d
/php
465 define Package
/php5-mod-
$(1)
466 $(call Package
/php5
/Default
)
472 TITLE
:=$(2) shared module
475 define Package
/php5-mod-
$(1)/install
476 $(INSTALL_DIR
) $$(1)/usr
/lib
/php
477 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/modules
/$(subst -,_
,$(1)).so
$$(1)/usr
/lib
/php
/
478 $(INSTALL_DIR
) $$(1)/etc
/php5
479 echo
"extension=$(subst -,_,$(1)).so" > $$(1)/etc
/php5
/$(subst -,_
,$(1)).ini
482 $$(eval
$$(call BuildPackage
,php5-mod-
$(1)))
486 $(eval
$(call BuildPackage
,php5
))
487 $(eval
$(call BuildPackage
,php5-cli
))
488 $(eval
$(call BuildPackage
,php5-cgi
))
489 $(eval
$(call BuildPackage
,php5-fastcgi
))
491 #$(eval $(call BuildModule,NAME,TITLE[,PKG DEPENDS]))
492 $(eval
$(call BuildModule
,apc
,APC
,+librt
))
493 $(eval
$(call BuildModule
,ctype
,Ctype
))
494 $(eval
$(call BuildModule
,curl
,cURL
,+libcurl
))
495 $(eval
$(call BuildModule
,fileinfo
,Fileinfo
,+libmagic
))
496 $(eval
$(call BuildModule
,dio
,Direct IO
))
497 $(eval
$(call BuildModule
,dom
,DOM
,@PHP5_LIBXML
+libxml2
))
498 $(eval
$(call BuildModule
,exif
,EXIF
))
499 $(eval
$(call BuildModule
,ftp
,FTP
))
500 $(eval
$(call BuildModule
,gettext
,Gettext
,+libintl-full
))
501 $(eval
$(call BuildModule
,gd
,GD graphics
,+libgd
))
502 $(eval
$(call BuildModule
,gmp
,GMP
,+libgmp
))
503 $(eval
$(call BuildModule
,hash
,Hash
))
504 $(eval
$(call BuildModule
,iconv
,iConv
,+libiconv
))
505 $(eval
$(call BuildModule
,json
,JSON
))
506 $(eval
$(call BuildModule
,ldap
,LDAP
,+libopenldap
+libsasl2
))
507 $(eval
$(call BuildModule
,libevent
,libevent
,+libevent
))
508 $(eval
$(call BuildModule
,mbstring
,MBString
))
509 $(eval
$(call BuildModule
,mcrypt
,Mcrypt
,+libmcrypt
+libltdl
))
510 $(eval
$(call BuildModule
,mysql
,MySQL
,+libmysqlclient
))
511 $(eval
$(call BuildModule
,openssl
,OpenSSL
,+libopenssl
))
512 $(eval
$(call BuildModule
,pcntl
,PCNTL
))
513 $(eval
$(call BuildModule
,pdo
,PHP Data Objects
))
514 $(eval
$(call BuildModule
,pdo-mysql
,PDO driver for MySQL
,php5-mod-pdo
+libmysqlclient
))
515 $(eval
$(call BuildModule
,pdo-pgsql
,PDO driver for PostgreSQL
,php5-mod-pdo
+libpq
))
516 $(eval
$(call BuildModule
,pdo-sqlite
,PDO driver for SQLite
3.x
,php5-mod-pdo
+libsqlite3
+libpthread
))
517 $(eval
$(call BuildModule
,pgsql
,PostgreSQL
,+libpq
))
518 $(eval
$(call BuildModule
,session
,Session
))
519 $(eval
$(call BuildModule
,simplexml
,SimpleXML
,@PHP5_LIBXML
+libxml2
))
520 $(eval
$(call BuildModule
,soap
,SOAP
,@PHP5_LIBXML
+libxml2
))
521 $(eval
$(call BuildModule
,sockets
,Sockets
))
522 $(eval
$(call BuildModule
,sqlite
,SQLite
2.x
,+libsqlite2
))
523 $(eval
$(call BuildModule
,sqlite3
,SQLite3
,+libsqlite3
+libpthread
))
524 $(eval
$(call BuildModule
,sysvmsg
,System V messages
))
525 $(eval
$(call BuildModule
,sysvsem
,System V shared memory
))
526 $(eval
$(call BuildModule
,sysvshm
,System V semaphore
))
527 $(eval
$(call BuildModule
,tokenizer
,Tokenizer
))
528 $(eval
$(call BuildModule
,xml
,XML
,+PHP5_LIBXML
:libxml2
+!PHP5_LIBXML
:libexpat
))
529 $(eval
$(call BuildModule
,xmlreader
,XMLReader
,@PHP5_LIBXML
+libxml2
+libiconv
))
530 $(eval
$(call BuildModule
,xmlwriter
,XMLWriter
,@PHP5_LIBXML
+libxml2
+libiconv
))