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.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
16 PKG_SOURCE_URL
:=http
://www.php.net
/distributions
/
17 PKG_MD5SUM
:=7380ffecebd95c6edb317ef861229ebd
19 include $(INCLUDE_DIR
)/package.mk
21 define Package
/php5
/Default
25 TITLE
:=PHP5 Hypertext preprocessor
26 URL
:=http
://www.php.net
/
29 define Package
/php5
/Default
/description
30 PHP is a widely-used general-purpose scripting language that is especially
31 suited for Web development and can be embedded into HTML.
35 $(call Package
/php5
/Default
)
36 DEPENDS
:=+libopenssl
+zlib
39 define Package
/php5
/description
40 $(call Package
/php5
/Default
/description
)
41 This package contains only the PHP config file. You must actually choose
42 your PHP flavour
(cli
, cgi or fastcgi
).
45 define Package
/php5-cli
46 $(call Package
/php5
/Default
)
51 define Package
/php5-cli
/description
52 $(call Package
/php5
/Default
/description
)
53 This package contains the CLI version of the PHP5 interpreter.
56 define Package
/php5-cgi
57 $(call Package
/php5
/Default
)
62 define Package
/php5-cgi
/description
63 $(call Package
/php5
/Default
/description
)
64 This package contains the CGI version of the PHP5 interpreter.
67 define Package
/php5-fastcgi
68 $(call Package
/php5
/Default
)
73 define Package
/php5-fastcgi
/description
74 $(call Package
/php5
/Default
/description
)
75 This package contains the FastCGI version of the PHP5 interpreter.
78 define Package
/php5-mod-curl
79 $(call Package
/php5
/Default
)
80 DEPENDS
:=php5
+libcurl
84 define Package
/php5-mod-ftp
85 $(call Package
/php5
/Default
)
90 define Package
/php5-mod-gd
91 $(call Package
/php5
/Default
)
93 TITLE
:=GD graphics module
96 define Package
/php5-mod-gmp
97 $(call Package
/php5
/Default
)
102 define Package
/php5-mod-ldap
103 $(call Package
/php5
/Default
)
104 DEPENDS
:=php5
+libopenldap
+libsasl2
108 define Package
/php5-mod-mysql
109 $(call Package
/php5
/Default
)
110 DEPENDS
:=php5
+libmysqlclient
114 define Package
/php5-mod-openssl
115 $(call Package
/php5
/Default
)
116 DEPENDS
:=php5
+libopenssl
117 TITLE
:=OpenSSL module
120 define Package
/php5-mod-pcre
121 $(call Package
/php5
/Default
)
122 DEPENDS
:=php5
+libpcre
126 define Package
/php5-mod-pgsql
127 $(call Package
/php5
/Default
)
129 TITLE
:=PostgreSQL module
132 define Package
/php5-mod-session
133 $(call Package
/php5
/Default
)
135 TITLE
:=Session module
138 define Package
/php5-mod-sockets
139 $(call Package
/php5
/Default
)
141 TITLE
:=Sockets module
144 define Package
/php5-mod-sqlite
145 $(call Package
/php5
/Default
)
146 DEPENDS
:=php5
+libsqlite2
150 define Package
/php5-mod-pdo
151 $(call Package
/php5
/Default
)
153 TITLE
:=PHP Data Objects module
156 define Package
/php5-mod-pdo-sqlite
157 $(call Package
/php5
/Default
)
158 DEPENDS
:=php5-mod-pdo
+libsqlite3
159 TITLE
:=PHP Data Objects module
- SQLite support
162 define Package
/php5-mod-xml
163 $(call Package
/php5
/Default
)
164 DEPENDS
:=php5
+libexpat
168 define Package
/php5-mod-apc
169 $(call Package
/php5
/Default
)
174 PKG_CONFIGURE_LIBS
:= -lcrypto
-lssl
175 PKG_CONFIGURE_OPTS
:= \
183 --with-config-file-path
=/etc \
185 --enable-magic-quotes \
186 --enable-memory-limit \
187 --disable-short-tags \
191 --enable-ftp
=shared \
195 --without-libxml-dir \
196 --disable-xmlreader \
197 --disable-xmlwriter \
200 --with-openssl
=shared
,"$(STAGING_DIR)/usr" \
202 --with-openssl-dir
="$(STAGING_DIR)/usr" \
203 --enable-session
=shared \
204 --disable-simplexml \
206 --enable-sockets
=shared \
207 --disable-tokenizer \
208 --with-zlib
="$(STAGING_DIR)/usr" \
209 --with-zlib-dir
="$(STAGING_DIR)/usr" \
213 PKG_BUILD_DEPENDS
:=libopenssl zlib libcurl libgd libgmp libopenldap libmysqlclient libpq libsqlite2 libexpat
214 # force PKG_CONFIGURE_{LIBS,OPTS} below when built in the SDK
215 CONFIG_PACKAGE_php5-cli
:=m
216 CONFIG_PACKAGE_php5-cgi
:=m
217 CONFIG_PACKAGE_php5-fastcgi
:=m
218 CONFIG_PACKAGE_php5-mod-curl
:=m
219 CONFIG_PACKAGE_php5-mod-gd
:=m
220 CONFIG_PACKAGE_php5-mod-gmp
:=m
221 CONFIG_PACKAGE_php5-mod-ldap
:=m
222 CONFIG_PACKAGE_php5-mod-mysql
:=m
223 CONFIG_PACKAGE_php5-mod-pcre
:=m
224 CONFIG_PACKAGE_php5-mod-pgsql
:=m
225 CONFIG_PACKAGE_php5-mod-sqlite
:=m
226 CONFIG_PACKAGE_php5-mod-xml
:=m
229 ifneq ($(CONFIG_PACKAGE_php5-mod-curl
),)
230 PKG_CONFIGURE_OPTS
+= --with-curl
=shared
,"$(STAGING_DIR)/usr"
232 PKG_CONFIGURE_OPTS
+= --without-curl
234 ifneq ($(CONFIG_PACKAGE_php5-mod-gd
),)
235 PKG_CONFIGURE_OPTS
+= --with-gd
=shared
,"$(STAGING_DIR)/usr" \
236 --without-freetype-dir \
237 --with-jpeg-dir
="$(STAGING_DIR)/usr" \
238 --with-png-dir
="$(STAGING_DIR)/usr" \
242 --enable-gd-native-ttf \
243 --disable-gd-jis-conv
245 PKG_CONFIGURE_OPTS
+= --without-gd
247 ifneq ($(CONFIG_PACKAGE_php5-mod-gmp
),)
248 PKG_CONFIGURE_OPTS
+= --with-gmp
=shared
,"$(STAGING_DIR)/usr"
250 PKG_CONFIGURE_OPTS
+= --without-gmp
252 ifneq ($(CONFIG_PACKAGE_php5-mod-ldap
),)
253 PKG_CONFIGURE_OPTS
+= --with-ldap
=shared
,"$(STAGING_DIR)/usr" \
254 --with-ldap-sasl
="$(STAGING_DIR)/usr"
256 PKG_CONFIGURE_OPTS
+= --without-ldap
258 ifneq ($(CONFIG_PACKAGE_php5-mod-mysql
),)
259 PKG_CONFIGURE_OPTS
+= --with-mysql
=shared
,"$(STAGING_DIR)/usr"
261 PKG_CONFIGURE_OPTS
+= --without-mysql
263 ifneq ($(CONFIG_PACKAGE_php5-mod-pcre
),)
264 PKG_CONFIGURE_OPTS
+= --with-pcre-regex
=shared
,"$(STAGING_DIR)/usr"
266 PKG_CONFIGURE_OPTS
+= --without-pcre-regex
268 ifneq ($(CONFIG_PACKAGE_php5-mod-pgsql
),)
269 PKG_CONFIGURE_OPTS
+= --with-pgsql
=shared
,"$(STAGING_DIR)/usr"
271 PKG_CONFIGURE_OPTS
+= --without-pgsql
273 ifneq ($(CONFIG_PACKAGE_php5-mod-sqlite
),)
274 PKG_CONFIGURE_OPTS
+= --with-sqlite
=shared
,"$(STAGING_DIR)/usr"
276 PKG_CONFIGURE_OPTS
+= --without-sqlite
278 ifneq ($(CONFIG_PACKAGE_php5-mod-pdo
),)
279 PKG_CONFIGURE_OPTS
+= --enable-pdo
=shared
280 ifneq ($(CONFIG_PACKAGE_php5-mod-pdo-sqlite
),)
281 PKG_CONFIGURE_OPTS
+= --with-pdo-sqlite
=shared
,"$(STAGING_DIR)/usr"
284 PKG_CONFIGURE_OPTS
+= --disable-pdo
286 ifneq ($(CONFIG_PACKAGE_php5-mod-xml
),)
287 PKG_CONFIGURE_OPTS
+= --enable-xml
=shared
,"$(STAGING_DIR)/usr" \
288 --with-libexpat-dir
="$(STAGING_DIR)/usr"
290 PKG_CONFIGURE_OPTS
+= --disable-xml
292 ifneq ($(CONFIG_PACKAGE_php5-mod-apc
),)
293 PKG_CONFIGURE_OPTS
+= --enable-apc
--disable-apc-mmap
--disable-apc-pthreadmutex
294 PKG_CONFIGURE_LIBS
+= -lrt
296 PKG_CONFIGURE_OPTS
+= --disable-apc
299 define Build
/Configure
302 ifneq ($(CONFIG_PACKAGE_php5-cli
),)
303 define Build
/Compile
/php5-cli
304 -$(MAKE
) -C
$(PKG_BUILD_DIR
) clean
305 $(call Build
/Configure
/Default
, \
306 $(PKG_CONFIGURE_OPTS
) \
310 --enable-force-cgi-redirect \
311 --enable-discard-path \
313 LIBS
="$(PKG_CONFIGURE_LIBS)" \
314 php_cv_cc_rpath
="no" \
316 $(MAKE
) -C
$(PKG_BUILD_DIR
)
317 mv
$(PKG_BUILD_DIR
)/sapi
/cli
/php
$(PKG_BUILD_DIR
)/php-cli
321 ifneq ($(CONFIG_PACKAGE_php5-cgi
),)
322 define Build
/Compile
/php5-cgi
323 -$(MAKE
) -C
$(PKG_BUILD_DIR
) clean
324 $(call Build
/Configure
/Default
, \
325 $(PKG_CONFIGURE_OPTS
) \
329 --enable-force-cgi-redirect \
330 --enable-discard-path \
332 LIBS
="$(PKG_CONFIGURE_LIBS)" \
333 php_cv_cc_rpath
="no" \
335 $(MAKE
) -C
$(PKG_BUILD_DIR
)
336 mv
$(PKG_BUILD_DIR
)/sapi
/cgi
/php-cgi
$(PKG_BUILD_DIR
)/php-cgi
340 ifneq ($(CONFIG_PACKAGE_php5-fastcgi
),)
341 define Build
/Compile
/php5-fastcgi
342 -$(MAKE
) -C
$(PKG_BUILD_DIR
) clean
343 rm $(PKG_BUILD_DIR
)/configure
344 cd
$(PKG_BUILD_DIR
) && .
/buildconf
--force
345 $(call Build
/Configure
/Default
, \
346 $(PKG_CONFIGURE_OPTS
) \
350 --enable-force-cgi-redirect \
351 --enable-discard-path \
353 LIBS
="$(PKG_CONFIGURE_LIBS)" \
354 php_cv_cc_rpath
="no" \
356 $(MAKE
) -C
$(PKG_BUILD_DIR
)
357 mv
$(PKG_BUILD_DIR
)/sapi
/cgi
/php-cgi
$(PKG_BUILD_DIR
)/php-fcgi
362 $(call Build
/Compile
/php5-cli
)
363 $(call Build
/Compile
/php5-cgi
)
364 $(call Build
/Compile
/php5-fastcgi
)
367 define Package
/php5
/conffiles
371 define Package
/php5
/install
372 $(INSTALL_DIR
) $(1)/etc
373 $(INSTALL_DATA
) .
/files
/php.ini
$(1)/etc
/
376 define Package
/php5-cli
/install
377 $(INSTALL_DIR
) $(1)/usr
/bin
378 $(CP
) $(PKG_BUILD_DIR
)/php-cli
$(1)/usr
/bin
/php-cli
381 define Package
/php5-cgi
/install
382 $(INSTALL_DIR
) $(1)/usr
/bin
383 $(CP
) $(PKG_BUILD_DIR
)/php-cgi
$(1)/usr
/bin
/php-cgi
386 define Package
/php5-fastcgi
/install
387 $(INSTALL_DIR
) $(1)/usr
/bin
388 $(CP
) $(PKG_BUILD_DIR
)/php-fcgi
$(1)/usr
/bin
/php-fcgi
389 $(INSTALL_DIR
) $(1)/etc
/init.d
390 $(INSTALL_BIN
) .
/files
/php.init
$(1)/etc
/init.d
/php
394 define Package
/$(1)/install
395 [ -z
"$(2)" ] ||
$(INSTALL_DIR
) $$(1)/usr
/lib
/php
397 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/modules
/$$$$$$$${m}.so
$$(1)/usr
/lib
/php
/ ; \
401 $$(eval
$$(call BuildPackage
,$(1)))
404 $(eval
$(call BuildPackage
,php5
))
405 $(eval
$(call BuildPackage
,php5-cli
))
406 $(eval
$(call BuildPackage
,php5-cgi
))
407 $(eval
$(call BuildPackage
,php5-fastcgi
))
408 $(eval
$(call BuildPlugin
,php5-mod-curl
,curl
))
409 $(eval
$(call BuildPlugin
,php5-mod-ftp
,ftp
))
410 $(eval
$(call BuildPlugin
,php5-mod-gd
,gd
))
411 $(eval
$(call BuildPlugin
,php5-mod-gmp
,gmp
))
412 $(eval
$(call BuildPlugin
,php5-mod-ldap
,ldap
))
413 $(eval
$(call BuildPlugin
,php5-mod-mysql
,mysql
))
414 $(eval
$(call BuildPlugin
,php5-mod-openssl
,openssl
))
415 $(eval
$(call BuildPlugin
,php5-mod-pcre
,pcre
))
416 $(eval
$(call BuildPlugin
,php5-mod-pgsql
,pgsql
))
417 $(eval
$(call BuildPlugin
,php5-mod-session
,session
))
418 $(eval
$(call BuildPlugin
,php5-mod-sockets
,sockets
))
419 $(eval
$(call BuildPlugin
,php5-mod-sqlite
,sqlite
))
420 $(eval
$(call BuildPlugin
,php5-mod-pdo
,pdo
))
421 $(eval
$(call BuildPlugin
,php5-mod-pdo-sqlite
,pdo_sqlite
))
422 $(eval
$(call BuildPlugin
,php5-mod-xml
,xml
))
423 $(eval
$(call BuildPlugin
,php5-mod-apc
))