2 # Copyright (C) 2006-2009 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
:=7380ffecebd95c6edb317ef861229ebd
18 include $(INCLUDE_DIR
)/package.mk
20 define Package
/php5
/Default
24 TITLE
:=PHP5 Hypertext preprocessor
25 URL
:=http
://www.php.net
/
28 define Package
/php5
/Default
/description
29 PHP is a widely-used general-purpose scripting language that is especially
30 suited for Web development and can be embedded into HTML.
33 define Package
/php5
/config
35 prompt
"PHP5 SPL Options"
37 default PACKAGE_php5_without_spl
39 config PACKAGE_php5_with_spl
40 bool
"With SPL (and pcre) static"
42 config PACKAGE_php5_without_spl
43 bool
"without SPL (pcre may be enabled)"
47 bool
"PHP5 APC support"
50 bool
"PHP5 EXIF support"
54 $(call Package
/php5
/Default
)
55 ifneq ($(CONFIG_PACKAGE_php5_with_spl
),)
56 DEPENDS
:=+libopenssl
+zlib
57 CONFIG_PACKAGE_php5-mod-pcre
:=
59 DEPENDS
:=+libopenssl
+zlib
+libpcre
63 define Package
/php5
/description
64 $(call Package
/php5
/Default
/description
)
65 This package contains only the PHP config file. You must actually choose
66 your PHP flavour
(cli
, cgi or fastcgi
).
69 define Package
/php5-cli
70 $(call Package
/php5
/Default
)
75 define Package
/php5-cli
/description
76 $(call Package
/php5
/Default
/description
)
77 This package contains the CLI version of the PHP5 interpreter.
80 define Package
/php5-cgi
81 $(call Package
/php5
/Default
)
86 define Package
/php5-cgi
/description
87 $(call Package
/php5
/Default
/description
)
88 This package contains the CGI version of the PHP5 interpreter.
91 define Package
/php5-fastcgi
92 $(call Package
/php5
/Default
)
97 define Package
/php5-fastcgi
/description
98 $(call Package
/php5
/Default
/description
)
99 This package contains the FastCGI version of the PHP5 interpreter.
102 define Package
/php5-mod-curl
103 $(call Package
/php5
/Default
)
104 DEPENDS
:=php5
+libcurl
108 define Package
/php5-mod-ftp
109 $(call Package
/php5
/Default
)
114 define Package
/php5-mod-gd
115 $(call Package
/php5
/Default
)
117 TITLE
:=GD graphics module
120 define Package
/php5-mod-gmp
121 $(call Package
/php5
/Default
)
122 DEPENDS
:=php5
+libgmp
126 define Package
/php5-mod-ldap
127 $(call Package
/php5
/Default
)
128 DEPENDS
:=php5
+libopenldap
+libsasl2
132 define Package
/php5-mod-mysql
133 $(call Package
/php5
/Default
)
134 DEPENDS
:=php5
+libmysqlclient
138 define Package
/php5-mod-openssl
139 $(call Package
/php5
/Default
)
140 DEPENDS
:=php5
+libopenssl
141 TITLE
:=OpenSSL module
144 define Package
/php5-mod-pcre
145 $(call Package
/php5
/Default
)
146 DEPENDS
:=php5
+libpcre
150 define Package
/php5-mod-pgsql
151 $(call Package
/php5
/Default
)
153 TITLE
:=PostgreSQL module
156 define Package
/php5-mod-session
157 $(call Package
/php5
/Default
)
159 TITLE
:=Session module
162 define Package
/php5-mod-sockets
163 $(call Package
/php5
/Default
)
165 TITLE
:=Sockets module
168 define Package
/php5-mod-sqlite
169 $(call Package
/php5
/Default
)
170 DEPENDS
:=php5
+libsqlite2
174 define Package
/php5-mod-pdo
175 $(call Package
/php5
/Default
)
177 TITLE
:=PHP Data Objects module
180 define Package
/php5-mod-pdo-sqlite
181 $(call Package
/php5
/Default
)
182 DEPENDS
:=php5-mod-pdo
+libsqlite3
183 TITLE
:=PHP Data Objects module
- SQLite support
186 define Package
/php5-mod-xml
187 $(call Package
/php5
/Default
)
188 DEPENDS
:=php5
+libexpat
192 PKG_CONFIGURE_LIBS
:= -lcrypto
-lssl
193 PKG_CONFIGURE_OPTS
:= \
200 --with-config-file-path
=/etc \
201 --enable-magic-quotes \
202 --enable-memory-limit \
203 --disable-short-tags \
207 --enable-ftp
=shared \
211 --without-libxml-dir \
212 --disable-xmlreader \
213 --disable-xmlwriter \
216 --with-openssl
=shared
,"$(STAGING_DIR)/usr" \
218 --with-openssl-dir
="$(STAGING_DIR)/usr" \
219 --enable-session
=shared \
220 --disable-simplexml \
222 --enable-sockets
=shared \
223 --disable-tokenizer \
224 --with-zlib
="$(STAGING_DIR)/usr" \
225 --with-zlib-dir
="$(STAGING_DIR)/usr" \
229 PKG_BUILD_DEPENDS
:=libopenssl zlib libcurl libgd libgmp libopenldap libmysqlclient libpq libsqlite2 libexpat
230 # force PKG_CONFIGURE_{LIBS,OPTS} below when built in the SDK
231 CONFIG_PACKAGE_php5-cli
:=m
232 CONFIG_PACKAGE_php5-cgi
:=m
233 CONFIG_PACKAGE_php5-fastcgi
:=m
234 CONFIG_PACKAGE_php5-mod-curl
:=m
235 CONFIG_PACKAGE_php5-mod-gd
:=m
236 CONFIG_PACKAGE_php5-mod-gmp
:=m
237 CONFIG_PACKAGE_php5-mod-ldap
:=m
238 CONFIG_PACKAGE_php5-mod-mysql
:=m
239 ifneq ($(CONFIG_PACKAGE_php5_with_spl
),)
240 CONFIG_PACKAGE_php5-mod-pcre
:=n
242 CONFIG_PACKAGE_php5-mod-pcre
:=m
244 CONFIG_PACKAGE_php5-mod-pgsql
:=m
245 CONFIG_PACKAGE_php5-mod-sqlite
:=m
246 CONFIG_PACKAGE_php5-mod-xml
:=m
249 ifneq ($(CONFIG_PACKAGE_php5-mod-curl
),)
250 PKG_CONFIGURE_OPTS
+= --with-curl
=shared
,"$(STAGING_DIR)/usr"
252 PKG_CONFIGURE_OPTS
+= --without-curl
254 ifneq ($(CONFIG_PACKAGE_php5-mod-gd
),)
255 PKG_CONFIGURE_OPTS
+= --with-gd
=shared
,"$(STAGING_DIR)/usr" \
256 --without-freetype-dir \
257 --with-jpeg-dir
="$(STAGING_DIR)/usr" \
258 --with-png-dir
="$(STAGING_DIR)/usr" \
262 --enable-gd-native-ttf \
263 --disable-gd-jis-conv
265 PKG_CONFIGURE_OPTS
+= --without-gd
267 ifneq ($(CONFIG_PACKAGE_php5-mod-gmp
),)
268 PKG_CONFIGURE_OPTS
+= --with-gmp
=shared
,"$(STAGING_DIR)/usr"
270 PKG_CONFIGURE_OPTS
+= --without-gmp
272 ifneq ($(CONFIG_PACKAGE_php5-mod-ldap
),)
273 PKG_CONFIGURE_OPTS
+= --with-ldap
=shared
,"$(STAGING_DIR)/usr" \
274 --with-ldap-sasl
="$(STAGING_DIR)/usr"
276 PKG_CONFIGURE_OPTS
+= --without-ldap
278 ifneq ($(CONFIG_PACKAGE_php5-mod-mysql
),)
279 PKG_CONFIGURE_OPTS
+= --with-mysql
=shared
,"$(STAGING_DIR)/usr"
281 PKG_CONFIGURE_OPTS
+= --without-mysql
283 ifneq ($(CONFIG_PACKAGE_php5_with_spl
),)
284 PKG_CONFIGURE_OPTS
+= --with-pcre-dir
="$(STAGING_DIR)/usr"
285 PKG_CONFIGURE_OPTS
+= --enable-spl
287 PKG_CONFIGURE_OPTS
+= --disable-spl
288 ifneq ($(CONFIG_PACKAGE_php5-mod-pcre
),)
289 PKG_CONFIGURE_OPTS
+= --with-pcre-regex
=shared
,"$(STAGING_DIR)/usr"
291 PKG_CONFIGURE_OPTS
+= --without-pcre-regex
294 ifneq ($(CONFIG_PACKAGE_php5-mod-pgsql
),)
295 PKG_CONFIGURE_OPTS
+= --with-pgsql
=shared
,"$(STAGING_DIR)/usr"
297 PKG_CONFIGURE_OPTS
+= --without-pgsql
299 ifneq ($(CONFIG_PACKAGE_php5-mod-sqlite
),)
300 PKG_CONFIGURE_OPTS
+= --with-sqlite
=shared
,"$(STAGING_DIR)/usr"
302 PKG_CONFIGURE_OPTS
+= --without-sqlite
304 ifneq ($(CONFIG_PACKAGE_php5-mod-pdo
),)
305 PKG_CONFIGURE_OPTS
+= --enable-pdo
=shared
306 ifneq ($(CONFIG_PACKAGE_php5-mod-pdo-sqlite
),)
307 PKG_CONFIGURE_OPTS
+= --with-pdo-sqlite
=shared
,"$(STAGING_DIR)/usr"
310 PKG_CONFIGURE_OPTS
+= --disable-pdo
312 ifneq ($(CONFIG_PACKAGE_php5-mod-xml
),)
313 PKG_CONFIGURE_OPTS
+= --enable-xml
=shared
,"$(STAGING_DIR)/usr" \
314 --with-libexpat-dir
="$(STAGING_DIR)/usr"
316 PKG_CONFIGURE_OPTS
+= --disable-xml
318 ifneq ($(CONFIG_PHP5_APC
),)
319 PKG_CONFIGURE_OPTS
+= --enable-apc
--disable-apc-mmap
--disable-apc-pthreadmutex
320 PKG_CONFIGURE_LIBS
+= -lrt
322 PKG_CONFIGURE_OPTS
+= --disable-apc
324 ifneq ($(CONFIG_PHP5_EXIF
),)
325 PKG_CONFIGURE_OPTS
+= --enable-exif
327 PKG_CONFIGURE_OPTS
+= --disable-exif
330 define Build
/Configure
333 ifneq ($(CONFIG_PACKAGE_php5-cli
),)
334 define Build
/Compile
/php5-cli
335 -$(MAKE
) -C
$(PKG_BUILD_DIR
) clean
336 $(call Build
/Configure
/Default
, \
337 $(PKG_CONFIGURE_OPTS
) \
341 --enable-force-cgi-redirect \
342 --enable-discard-path \
344 LIBS
="$(PKG_CONFIGURE_LIBS)" \
345 php_cv_cc_rpath
="no" \
347 $(MAKE
) -C
$(PKG_BUILD_DIR
)
348 mv
$(PKG_BUILD_DIR
)/sapi
/cli
/php
$(PKG_BUILD_DIR
)/php-cli
352 ifneq ($(CONFIG_PACKAGE_php5-cgi
),)
353 define Build
/Compile
/php5-cgi
354 -$(MAKE
) -C
$(PKG_BUILD_DIR
) clean
355 $(call Build
/Configure
/Default
, \
356 $(PKG_CONFIGURE_OPTS
) \
360 --enable-force-cgi-redirect \
361 --enable-discard-path \
363 LIBS
="$(PKG_CONFIGURE_LIBS)" \
364 php_cv_cc_rpath
="no" \
366 $(MAKE
) -C
$(PKG_BUILD_DIR
)
367 mv
$(PKG_BUILD_DIR
)/sapi
/cgi
/php-cgi
$(PKG_BUILD_DIR
)/php-cgi
371 ifneq ($(CONFIG_PACKAGE_php5-fastcgi
),)
372 define Build
/Compile
/php5-fastcgi
373 -$(MAKE
) -C
$(PKG_BUILD_DIR
) clean
374 rm $(PKG_BUILD_DIR
)/configure
375 cd
$(PKG_BUILD_DIR
) && .
/buildconf
--force
376 $(call Build
/Configure
/Default
, \
377 $(PKG_CONFIGURE_OPTS
) \
381 --enable-force-cgi-redirect \
382 --enable-discard-path \
384 LIBS
="$(PKG_CONFIGURE_LIBS)" \
385 php_cv_cc_rpath
="no" \
387 $(MAKE
) -C
$(PKG_BUILD_DIR
)
388 mv
$(PKG_BUILD_DIR
)/sapi
/cgi
/php-cgi
$(PKG_BUILD_DIR
)/php-fcgi
393 $(call Build
/Compile
/php5-cli
)
394 $(call Build
/Compile
/php5-cgi
)
395 $(call Build
/Compile
/php5-fastcgi
)
398 define Package
/php5
/conffiles
402 define Package
/php5
/install
403 $(INSTALL_DIR
) $(1)/etc
404 $(INSTALL_DATA
) .
/files
/php.ini
$(1)/etc
/
407 define Package
/php5-cli
/install
408 $(INSTALL_DIR
) $(1)/usr
/bin
409 $(CP
) $(PKG_BUILD_DIR
)/php-cli
$(1)/usr
/bin
/php-cli
412 define Package
/php5-cgi
/install
413 $(INSTALL_DIR
) $(1)/usr
/bin
414 $(CP
) $(PKG_BUILD_DIR
)/php-cgi
$(1)/usr
/bin
/php-cgi
417 define Package
/php5-fastcgi
/install
418 $(INSTALL_DIR
) $(1)/usr
/bin
419 $(CP
) $(PKG_BUILD_DIR
)/php-fcgi
$(1)/usr
/bin
/php-fcgi
420 $(INSTALL_DIR
) $(1)/etc
/init.d
421 $(INSTALL_BIN
) .
/files
/php.init
$(1)/etc
/init.d
/php
425 define Package
/$(1)/install
426 [ -z
"$(2)" ] ||
$(INSTALL_DIR
) $$(1)/usr
/lib
/php
428 [ -z
"$(CONFIG_PACKAGE_$(1))" ] \
429 ||
$(INSTALL_BIN
) $(PKG_BUILD_DIR
)/modules
/$$$$$$$${m}.so
$$(1)/usr
/lib
/php
/ ; \
433 $$(eval
$$(call BuildPackage
,$(1)))
436 $(eval
$(call BuildPackage
,php5
))
437 $(eval
$(call BuildPackage
,php5-cli
))
438 $(eval
$(call BuildPackage
,php5-cgi
))
439 $(eval
$(call BuildPackage
,php5-fastcgi
))
440 $(eval
$(call BuildPlugin
,php5-mod-curl
,curl
))
441 $(eval
$(call BuildPlugin
,php5-mod-ftp
,ftp
))
442 $(eval
$(call BuildPlugin
,php5-mod-gd
,gd
))
443 $(eval
$(call BuildPlugin
,php5-mod-gmp
,gmp
))
444 $(eval
$(call BuildPlugin
,php5-mod-ldap
,ldap
))
445 $(eval
$(call BuildPlugin
,php5-mod-mysql
,mysql
))
446 $(eval
$(call BuildPlugin
,php5-mod-openssl
,openssl
))
447 $(eval
$(call BuildPlugin
,php5-mod-pcre
,pcre
))
448 $(eval
$(call BuildPlugin
,php5-mod-pgsql
,pgsql
))
449 $(eval
$(call BuildPlugin
,php5-mod-session
,session
))
450 $(eval
$(call BuildPlugin
,php5-mod-sockets
,sockets
))
451 $(eval
$(call BuildPlugin
,php5-mod-sqlite
,sqlite
))
452 $(eval
$(call BuildPlugin
,php5-mod-pdo
,pdo
))
453 $(eval
$(call BuildPlugin
,php5-mod-pdo-sqlite
,pdo_sqlite
))
454 $(eval
$(call BuildPlugin
,php5-mod-xml
,xml
))