2 # Copyright (C) 2006,2007 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"
36 default PACKAGE_php5_without_spl
38 config PACKAGE_php5_with_spl
39 bool
"With SPL (and pcre) static"
41 config PACKAGE_php5_without_spl
42 bool
"without SPL (pcre may be enabled)"
47 $(call Package
/php5
/Default
)
48 ifneq ($(CONFIG_PACKAGE_php5_with_spl
),)
49 DEPENDS
:=+libopenssl
+zlib
50 CONFIG_PACKAGE_php5-mod-pcre
:=
52 DEPENDS
:=+libopenssl
+zlib
+libpcre
56 define Package
/php5
/description
57 $(call Package
/php5
/Default
/description
)
58 This package contains only the PHP config file. You must actually choose
59 your PHP flavour
(cli
, cgi or fastcgi
).
62 define Package
/php5-cli
63 $(call Package
/php5
/Default
)
68 define Package
/php5-cli
/description
69 $(call Package
/php5
/Default
/description
)
70 This package contains the CLI version of the PHP5 interpreter.
73 define Package
/php5-cgi
74 $(call Package
/php5
/Default
)
79 define Package
/php5-cgi
/description
80 $(call Package
/php5
/Default
/description
)
81 This package contains the CGI version of the PHP5 interpreter.
84 define Package
/php5-fastcgi
85 $(call Package
/php5
/Default
)
90 define Package
/php5-fastcgi
/description
91 $(call Package
/php5
/Default
/description
)
92 This package contains the FastCGI version of the PHP5 interpreter.
95 define Package
/php5-mod-curl
96 $(call Package
/php5
/Default
)
97 DEPENDS
:=php5
+libcurl
101 define Package
/php5-mod-ftp
102 $(call Package
/php5
/Default
)
107 define Package
/php5-mod-gd
108 $(call Package
/php5
/Default
)
110 TITLE
:=GD graphics module
113 define Package
/php5-mod-gmp
114 $(call Package
/php5
/Default
)
115 DEPENDS
:=php5
+libgmp
119 define Package
/php5-mod-ldap
120 $(call Package
/php5
/Default
)
121 DEPENDS
:=php5
+libopenldap
+libsasl2
125 define Package
/php5-mod-mysql
126 $(call Package
/php5
/Default
)
127 DEPENDS
:=php5
+libmysqlclient
131 define Package
/php5-mod-openssl
132 $(call Package
/php5
/Default
)
133 DEPENDS
:=php5
+libopenssl
134 TITLE
:=OpenSSL module
137 define Package
/php5-mod-pcre
138 $(call Package
/php5
/Default
)
139 DEPENDS
:=php5
+libpcre
143 define Package
/php5-mod-pgsql
144 $(call Package
/php5
/Default
)
146 TITLE
:=PostgreSQL module
149 define Package
/php5-mod-session
150 $(call Package
/php5
/Default
)
152 TITLE
:=Session module
155 define Package
/php5-mod-sockets
156 $(call Package
/php5
/Default
)
158 TITLE
:=Sockets module
161 define Package
/php5-mod-sqlite
162 $(call Package
/php5
/Default
)
163 DEPENDS
:=php5
+libsqlite2
167 define Package
/php5-mod-pdo
168 $(call Package
/php5
/Default
)
170 TITLE
:=PHP Data Objects module
173 define Package
/php5-mod-pdo-sqlite
174 $(call Package
/php5
/Default
)
175 DEPENDS
:=php5-mod-pdo
+libsqlite3
176 TITLE
:=PHP Data Objects module
- SQLite support
179 define Package
/php5-mod-xml
180 $(call Package
/php5
/Default
)
181 DEPENDS
:=php5
+libexpat
185 define Package
/php5-mod-apc
186 $(call Package
/php5
/Default
)
191 define Package
/php5-mod-exif
192 $(call Package
/php5
/Default
)
194 TITLE
:=EXIF Extension
197 PKG_CONFIGURE_LIBS
:= -lcrypto
-lssl
198 PKG_CONFIGURE_OPTS
:= \
205 --with-config-file-path
=/etc \
207 --enable-magic-quotes \
208 --enable-memory-limit \
209 --disable-short-tags \
213 --enable-ftp
=shared \
217 --without-libxml-dir \
218 --disable-xmlreader \
219 --disable-xmlwriter \
222 --with-openssl
=shared
,"$(STAGING_DIR)/usr" \
224 --with-openssl-dir
="$(STAGING_DIR)/usr" \
225 --enable-session
=shared \
226 --disable-simplexml \
228 --enable-sockets
=shared \
229 --disable-tokenizer \
230 --with-zlib
="$(STAGING_DIR)/usr" \
231 --with-zlib-dir
="$(STAGING_DIR)/usr" \
235 PKG_BUILD_DEPENDS
:=libopenssl zlib libcurl libgd libgmp libopenldap libmysqlclient libpq libsqlite2 libexpat
236 # force PKG_CONFIGURE_{LIBS,OPTS} below when built in the SDK
237 CONFIG_PACKAGE_php5-cli
:=m
238 CONFIG_PACKAGE_php5-cgi
:=m
239 CONFIG_PACKAGE_php5-fastcgi
:=m
240 CONFIG_PACKAGE_php5-mod-curl
:=m
241 CONFIG_PACKAGE_php5-mod-gd
:=m
242 CONFIG_PACKAGE_php5-mod-gmp
:=m
243 CONFIG_PACKAGE_php5-mod-ldap
:=m
244 CONFIG_PACKAGE_php5-mod-mysql
:=m
245 ifneq ($(CONFIG_PACKAGE_php5_with_spl
),)
246 CONFIG_PACKAGE_php5-mod-pcre
:=n
248 CONFIG_PACKAGE_php5-mod-pcre
:=m
250 CONFIG_PACKAGE_php5-mod-pgsql
:=m
251 CONFIG_PACKAGE_php5-mod-sqlite
:=m
252 CONFIG_PACKAGE_php5-mod-xml
:=m
255 ifneq ($(CONFIG_PACKAGE_php5-mod-curl
),)
256 PKG_CONFIGURE_OPTS
+= --with-curl
=shared
,"$(STAGING_DIR)/usr"
258 PKG_CONFIGURE_OPTS
+= --without-curl
260 ifneq ($(CONFIG_PACKAGE_php5-mod-gd
),)
261 PKG_CONFIGURE_OPTS
+= --with-gd
=shared
,"$(STAGING_DIR)/usr" \
262 --without-freetype-dir \
263 --with-jpeg-dir
="$(STAGING_DIR)/usr" \
264 --with-png-dir
="$(STAGING_DIR)/usr" \
268 --enable-gd-native-ttf \
269 --disable-gd-jis-conv
271 PKG_CONFIGURE_OPTS
+= --without-gd
273 ifneq ($(CONFIG_PACKAGE_php5-mod-gmp
),)
274 PKG_CONFIGURE_OPTS
+= --with-gmp
=shared
,"$(STAGING_DIR)/usr"
276 PKG_CONFIGURE_OPTS
+= --without-gmp
278 ifneq ($(CONFIG_PACKAGE_php5-mod-ldap
),)
279 PKG_CONFIGURE_OPTS
+= --with-ldap
=shared
,"$(STAGING_DIR)/usr" \
280 --with-ldap-sasl
="$(STAGING_DIR)/usr"
282 PKG_CONFIGURE_OPTS
+= --without-ldap
284 ifneq ($(CONFIG_PACKAGE_php5-mod-mysql
),)
285 PKG_CONFIGURE_OPTS
+= --with-mysql
=shared
,"$(STAGING_DIR)/usr"
287 PKG_CONFIGURE_OPTS
+= --without-mysql
289 ifneq ($(CONFIG_PACKAGE_php5_with_spl
),)
290 PKG_CONFIGURE_OPTS
+= --with-pcre-dir
="$(STAGING_DIR)/usr"
291 PKG_CONFIGURE_OPTS
+= --enable-spl
293 PKG_CONFIGURE_OPTS
+= --disable-spl
294 ifneq ($(CONFIG_PACKAGE_php5-mod-pcre
),)
295 PKG_CONFIGURE_OPTS
+= --with-pcre-regex
=shared
,"$(STAGING_DIR)/usr"
297 PKG_CONFIGURE_OPTS
+= --without-pcre-regex
300 ifneq ($(CONFIG_PACKAGE_php5-mod-pgsql
),)
301 PKG_CONFIGURE_OPTS
+= --with-pgsql
=shared
,"$(STAGING_DIR)/usr"
303 PKG_CONFIGURE_OPTS
+= --without-pgsql
305 ifneq ($(CONFIG_PACKAGE_php5-mod-sqlite
),)
306 PKG_CONFIGURE_OPTS
+= --with-sqlite
=shared
,"$(STAGING_DIR)/usr"
308 PKG_CONFIGURE_OPTS
+= --without-sqlite
310 ifneq ($(CONFIG_PACKAGE_php5-mod-pdo
),)
311 PKG_CONFIGURE_OPTS
+= --enable-pdo
=shared
312 ifneq ($(CONFIG_PACKAGE_php5-mod-pdo-sqlite
),)
313 PKG_CONFIGURE_OPTS
+= --with-pdo-sqlite
=shared
,"$(STAGING_DIR)/usr"
316 PKG_CONFIGURE_OPTS
+= --disable-pdo
318 ifneq ($(CONFIG_PACKAGE_php5-mod-xml
),)
319 PKG_CONFIGURE_OPTS
+= --enable-xml
=shared
,"$(STAGING_DIR)/usr" \
320 --with-libexpat-dir
="$(STAGING_DIR)/usr"
322 PKG_CONFIGURE_OPTS
+= --disable-xml
324 ifneq ($(CONFIG_PACKAGE_php5-mod-apc
),)
325 PKG_CONFIGURE_OPTS
+= --enable-apc
--disable-apc-mmap
--disable-apc-pthreadmutex
326 PKG_CONFIGURE_LIBS
+= -lrt
328 PKG_CONFIGURE_OPTS
+= --disable-apc
330 ifneq ($(CONFIG_PACKAGE_php5-mod-exif
),)
331 PKG_CONFIGURE_OPTS
+= --enable-exif
333 PKG_CONFIGURE_OPTS
+= --disable-exif
336 define Build
/Configure
339 ifneq ($(CONFIG_PACKAGE_php5-cli
),)
340 define Build
/Compile
/php5-cli
341 -$(MAKE
) -C
$(PKG_BUILD_DIR
) clean
342 $(call Build
/Configure
/Default
, \
343 $(PKG_CONFIGURE_OPTS
) \
347 --enable-force-cgi-redirect \
348 --enable-discard-path \
350 LIBS
="$(PKG_CONFIGURE_LIBS)" \
351 php_cv_cc_rpath
="no" \
353 $(MAKE
) -C
$(PKG_BUILD_DIR
)
354 mv
$(PKG_BUILD_DIR
)/sapi
/cli
/php
$(PKG_BUILD_DIR
)/php-cli
358 ifneq ($(CONFIG_PACKAGE_php5-cgi
),)
359 define Build
/Compile
/php5-cgi
360 -$(MAKE
) -C
$(PKG_BUILD_DIR
) clean
361 $(call Build
/Configure
/Default
, \
362 $(PKG_CONFIGURE_OPTS
) \
366 --enable-force-cgi-redirect \
367 --enable-discard-path \
369 LIBS
="$(PKG_CONFIGURE_LIBS)" \
370 php_cv_cc_rpath
="no" \
372 $(MAKE
) -C
$(PKG_BUILD_DIR
)
373 mv
$(PKG_BUILD_DIR
)/sapi
/cgi
/php-cgi
$(PKG_BUILD_DIR
)/php-cgi
377 ifneq ($(CONFIG_PACKAGE_php5-fastcgi
),)
378 define Build
/Compile
/php5-fastcgi
379 -$(MAKE
) -C
$(PKG_BUILD_DIR
) clean
380 rm $(PKG_BUILD_DIR
)/configure
381 cd
$(PKG_BUILD_DIR
) && .
/buildconf
--force
382 $(call Build
/Configure
/Default
, \
383 $(PKG_CONFIGURE_OPTS
) \
387 --enable-force-cgi-redirect \
388 --enable-discard-path \
390 LIBS
="$(PKG_CONFIGURE_LIBS)" \
391 php_cv_cc_rpath
="no" \
393 $(MAKE
) -C
$(PKG_BUILD_DIR
)
394 mv
$(PKG_BUILD_DIR
)/sapi
/cgi
/php-cgi
$(PKG_BUILD_DIR
)/php-fcgi
399 $(call Build
/Compile
/php5-cli
)
400 $(call Build
/Compile
/php5-cgi
)
401 $(call Build
/Compile
/php5-fastcgi
)
404 define Package
/php5
/conffiles
408 define Package
/php5
/install
409 $(INSTALL_DIR
) $(1)/etc
410 $(INSTALL_DATA
) .
/files
/php.ini
$(1)/etc
/
413 define Package
/php5-cli
/install
414 $(INSTALL_DIR
) $(1)/usr
/bin
415 $(CP
) $(PKG_BUILD_DIR
)/php-cli
$(1)/usr
/bin
/php-cli
418 define Package
/php5-cgi
/install
419 $(INSTALL_DIR
) $(1)/usr
/bin
420 $(CP
) $(PKG_BUILD_DIR
)/php-cgi
$(1)/usr
/bin
/php-cgi
423 define Package
/php5-fastcgi
/install
424 $(INSTALL_DIR
) $(1)/usr
/bin
425 $(CP
) $(PKG_BUILD_DIR
)/php-fcgi
$(1)/usr
/bin
/php-fcgi
426 $(INSTALL_DIR
) $(1)/etc
/init.d
427 $(INSTALL_BIN
) .
/files
/php.init
$(1)/etc
/init.d
/php
431 define Package
/$(1)/install
432 [ -z
"$(2)" ] ||
$(INSTALL_DIR
) $$(1)/usr
/lib
/php
434 [ -z
"$(CONFIG_PACKAGE_$(1))" ] \
435 ||
$(INSTALL_BIN
) $(PKG_BUILD_DIR
)/modules
/$$$$$$$${m}.so
$$(1)/usr
/lib
/php
/ ; \
439 $$(eval
$$(call BuildPackage
,$(1)))
442 $(eval
$(call BuildPackage
,php5
))
443 $(eval
$(call BuildPackage
,php5-cli
))
444 $(eval
$(call BuildPackage
,php5-cgi
))
445 $(eval
$(call BuildPackage
,php5-fastcgi
))
446 $(eval
$(call BuildPlugin
,php5-mod-curl
,curl
))
447 $(eval
$(call BuildPlugin
,php5-mod-ftp
,ftp
))
448 $(eval
$(call BuildPlugin
,php5-mod-gd
,gd
))
449 $(eval
$(call BuildPlugin
,php5-mod-gmp
,gmp
))
450 $(eval
$(call BuildPlugin
,php5-mod-ldap
,ldap
))
451 $(eval
$(call BuildPlugin
,php5-mod-mysql
,mysql
))
452 $(eval
$(call BuildPlugin
,php5-mod-openssl
,openssl
))
453 $(eval
$(call BuildPlugin
,php5-mod-pcre
,pcre
))
454 $(eval
$(call BuildPlugin
,php5-mod-pgsql
,pgsql
))
455 $(eval
$(call BuildPlugin
,php5-mod-session
,session
))
456 $(eval
$(call BuildPlugin
,php5-mod-sockets
,sockets
))
457 $(eval
$(call BuildPlugin
,php5-mod-sqlite
,sqlite
))
458 $(eval
$(call BuildPlugin
,php5-mod-pdo
,pdo
))
459 $(eval
$(call BuildPlugin
,php5-mod-pdo-sqlite
,pdo_sqlite
))
460 $(eval
$(call BuildPlugin
,php5-mod-xml
,xml
))
461 $(eval
$(call BuildPlugin
,php5-mod-apc
))
462 $(eval
$(call BuildPlugin
,php5-mod-exif
))