source: branches/packages_10.03.1/lang/php5/Makefile @ 27835

Last change on this file since 27835 was 27835, checked in by jow, 5 years ago

[packages_10.03.1] merge r27834

  • Property copyright set to Copyright (C) 2006 OpenWrt.org
  • Property licence set to GPLv2
  • Property svn:eol-style set to native
File size: 13.7 KB
Line 
1#
2# Copyright (C) 2006-2011 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=php
11PKG_VERSION:=5.3.6
12PKG_RELEASE:=3.2
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15PKG_SOURCE_URL:=http://www.php.net/distributions/
16PKG_MD5SUM:=2286f5a82a6e8397955a0025c1c2ad98
17
18PKG_FIXUP:=libtool no-autoreconf
19PKG_BUILD_PARALLEL:=1
20
21PHP5_MODULES = \
22        apc \
23        ctype curl \
24        fileinfo \
25        dom \
26        exif \
27        ftp \
28        gettext gd gmp \
29        hash \
30        iconv \
31        json \
32        ldap \
33        mbstring mcrypt mysql \
34        openssl \
35        pcntl pdo pdo-mysql pdo-pgsql pdo-sqlite pgsql \
36        session simplexml soap sockets sqlite sqlite3 sysvmsg sysvsem sysvshm \
37        tokenizer \
38        xml xmlreader xmlwriter \
39
40PKG_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
44
45include $(INCLUDE_DIR)/package.mk
46include $(INCLUDE_DIR)/nls.mk
47
48define Package/php5/Default
49  SUBMENU:=PHP
50  SECTION:=lang
51  CATEGORY:=Languages
52  TITLE:=PHP5 Hypertext preprocessor
53  URL:=http://www.php.net/
54  MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
55  DEPENDS:=php5
56endef
57
58define 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.
61endef
62
63define Package/php5/config
64        config PHP5_FILTER
65                bool "PHP5 Filter support"
66                depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
67
68        config PHP5_LIBXML
69                bool "PHP5 LIBXML support"
70                depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
71endef
72
73define Package/php5
74  $(call Package/php5/Default)
75
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
81endef
82
83define 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).
87endef
88
89define Package/php5-cli
90  $(call Package/php5/Default)
91  TITLE+= (CLI)
92endef
93
94define Package/php5-cli/description
95  $(call Package/php5/Default/description)
96  This package contains the CLI version of the PHP5 interpreter.
97endef
98
99define Package/php5-cgi
100  $(call Package/php5/Default)
101  TITLE+= (CGI & FastCGI)
102endef
103
104define Package/php5-cgi/description
105  $(call Package/php5/Default/description)
106  This package contains the CGI version of the PHP5 interpreter.
107endef
108
109define Package/php5-fastcgi
110  $(call Package/php5/Default)
111  DEPENDS+= +php5-cgi
112  TITLE:=FastCGI startup script
113endef
114
115define 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.
118endef
119
120CONFIGURE_ARGS+= \
121        --enable-shared \
122        --disable-static \
123        --disable-rpath \
124        --disable-debug \
125        --without-pear \
126        \
127        --with-config-file-path=/etc \
128        --with-config-file-scan-dir=/etc/php5 \
129        --enable-magic-quotes \
130        --disable-short-tags \
131        \
132        --with-zlib="$(STAGING_DIR)/usr" \
133          --with-zlib-dir="$(STAGING_DIR)/usr" \
134        --with-pcre-regex="$(STAGING_DIR)/usr" \
135        --disable-phar
136
137ifneq ($(SDK),)
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
152endif
153
154ifneq ($(CONFIG_PACKAGE_php5-cli),)
155  CONFIGURE_ARGS+= --enable-cli
156else
157  CONFIGURE_ARGS+= --disable-cli
158endif
159
160ifneq ($(CONFIG_PACKAGE_php5-cgi),)
161  CONFIGURE_ARGS+= --enable-cgi
162else
163  CONFIGURE_ARGS+= --disable-cgi
164endif
165
166ifneq ($(CONFIG_PACKAGE_php5-mod-apc),)
167  CONFIGURE_ARGS+= --enable-apc=shared --disable-apc-mmap --disable-apc-pthreadmutex
168  CONFIGURE_LIBS+= -lrt
169else
170  CONFIGURE_ARGS+= --disable-apc
171endif
172
173ifneq ($(CONFIG_PACKAGE_php5-mod-ctype),)
174  CONFIGURE_ARGS+= --enable-ctype=shared
175else
176  CONFIGURE_ARGS+= --disable-ctype
177endif
178
179ifneq ($(CONFIG_PACKAGE_php5-mod-curl),)
180  CONFIGURE_ARGS+= --with-curl=shared,"$(STAGING_DIR)/usr"
181else
182  CONFIGURE_ARGS+= --without-curl
183endif
184
185ifneq ($(CONFIG_PACKAGE_php5-mod-fileinfo),)
186  CONFIGURE_ARGS+= --enable-fileinfo=shared
187else
188  CONFIGURE_ARGS+= --disable-fileinfo
189endif
190
191ifneq ($(CONFIG_PACKAGE_php5-mod-gettext),)
192  CONFIGURE_ARGS+= --with-gettext=shared,"$(STAGING_DIR)/usr/lib/libintl-full"
193else
194  CONFIGURE_ARGS+= --without-gettext
195endif
196
197ifneq ($(CONFIG_PACKAGE_php5-mod-dom),)
198  CONFIGURE_ARGS+= --enable-dom=shared
199else
200  CONFIGURE_ARGS+= --disable-dom
201endif
202
203ifneq ($(CONFIG_PACKAGE_php5-mod-exif),)
204  CONFIGURE_ARGS+= --enable-exif=shared
205else
206  CONFIGURE_ARGS+= --disable-exif
207endif
208
209ifneq ($(CONFIG_PACKAGE_php5-mod-ftp),)
210  CONFIGURE_ARGS+= --enable-ftp=shared
211else
212  CONFIGURE_ARGS+= --disable-ftp
213endif
214
215ifneq ($(CONFIG_PACKAGE_php5-mod-gd),)
216  CONFIGURE_ARGS+= \
217        --with-gd=shared,"$(STAGING_DIR)/usr" \
218        --without-freetype-dir \
219        --with-jpeg-dir="$(STAGING_DIR)/usr" \
220        --with-png-dir="$(STAGING_DIR)/usr" \
221        --without-xpm-dir \
222        --without-t1lib \
223        --enable-gd-native-ttf \
224        --disable-gd-jis-conv
225else
226  CONFIGURE_ARGS+= --without-gd
227endif
228
229ifneq ($(CONFIG_PACKAGE_php5-mod-gmp),)
230  CONFIGURE_ARGS+= --with-gmp=shared,"$(STAGING_DIR)/usr"
231else
232  CONFIGURE_ARGS+= --without-gmp
233endif
234
235ifneq ($(CONFIG_PACKAGE_php5-mod-hash),)
236  CONFIGURE_ARGS+= --enable-hash=shared
237else
238  CONFIGURE_ARGS+= --disable-hash
239endif
240
241ifneq ($(CONFIG_PACKAGE_php5-mod-iconv),)
242  CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)"
243else
244  CONFIGURE_ARGS+= --without-iconv
245endif
246
247ifneq ($(CONFIG_PACKAGE_php5-mod-json),)
248  CONFIGURE_ARGS+= --enable-json=shared
249else
250  CONFIGURE_ARGS+= --disable-json
251endif
252
253ifneq ($(CONFIG_PACKAGE_php5-mod-ldap),)
254  CONFIGURE_ARGS+= \
255        --with-ldap=shared,"$(STAGING_DIR)/usr" \
256        --with-ldap-sasl="$(STAGING_DIR)/usr"
257else
258  CONFIGURE_ARGS+= --without-ldap
259endif
260
261ifneq ($(CONFIG_PACKAGE_php5-mod-mbstring),)
262  CONFIGURE_ARGS+= --enable-mbstring=shared --enable-mbregex
263else
264  CONFIGURE_ARGS+= --disable-mbstring
265endif
266
267ifneq ($(CONFIG_PACKAGE_php5-mod-mcrypt),)
268  CONFIGURE_ARGS+=  --with-mcrypt=shared,"$(STAGING_DIR)/usr"
269else
270  CONFIGURE_ARGS+= --without-mcrypt
271endif
272
273ifneq ($(CONFIG_PACKAGE_php5-mod-mysql),)
274  CONFIGURE_ARGS+= --with-mysql=shared,"$(STAGING_DIR)/usr"
275else
276  CONFIGURE_ARGS+= --without-mysql
277endif
278
279ifneq ($(CONFIG_PACKAGE_php5-mod-openssl),)
280  CONFIGURE_ARGS+= \
281        --with-openssl=shared,"$(STAGING_DIR)/usr" \
282        --with-kerberos=no \
283        --with-openssl-dir="$(STAGING_DIR)/usr"
284else
285  CONFIGURE_ARGS+= --without-openssl
286endif
287
288ifneq ($(CONFIG_PACKAGE_php5-mod-pcntl),)
289  CONFIGURE_ARGS+= --enable-pcntl=shared
290else
291  CONFIGURE_ARGS+= --disable-pcntl
292endif
293
294ifneq ($(CONFIG_PACKAGE_php5-mod-pdo),)
295  CONFIGURE_ARGS+= --enable-pdo=shared
296  ifneq ($(CONFIG_PACKAGE_php5-mod-pdo-mysql),)
297    CONFIGURE_ARGS+= --with-pdo-mysql=shared,"$(STAGING_DIR)/usr"
298  else
299    CONFIGURE_ARGS+= --without-pdo-mysql
300  endif
301  ifneq ($(CONFIG_PACKAGE_php5-mod-pdo-pgsql),)
302    CONFIGURE_ARGS+= --with-pdo-pgsql=shared,"$(STAGING_DIR)/usr"
303  else
304    CONFIGURE_ARGS+= --without-pdo-pgsql
305  endif
306  ifneq ($(CONFIG_PACKAGE_php5-mod-pdo-sqlite),)
307    CONFIGURE_ARGS+= --with-pdo-sqlite=shared,"$(STAGING_DIR)/usr"
308    CONFIGURE_LIBS+= -lsqlite3 -lpthread
309  else
310    CONFIGURE_ARGS+= --without-pdo-sqlite
311  endif
312else
313  CONFIGURE_ARGS+= --disable-pdo
314endif
315
316ifneq ($(CONFIG_PACKAGE_php5-mod-pgsql),)
317  CONFIGURE_ARGS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
318else
319  CONFIGURE_ARGS+= --without-pgsql
320endif
321
322ifneq ($(CONFIG_PACKAGE_php5-mod-session),)
323  CONFIGURE_ARGS+= --enable-session=shared
324else
325  CONFIGURE_ARGS+= --disable-session
326endif
327
328ifneq ($(CONFIG_PACKAGE_php5-mod-simplexml),)
329  CONFIGURE_ARGS+= --enable-simplexml=shared
330else
331  CONFIGURE_ARGS+= --disable-simplexml
332endif
333
334ifneq ($(CONFIG_PACKAGE_php5-mod-soap),)
335  CONFIGURE_ARGS+= --enable-soap=shared
336else
337  CONFIGURE_ARGS+= --disable-soap
338endif
339
340ifneq ($(CONFIG_PACKAGE_php5-mod-sockets),)
341  CONFIGURE_ARGS+= --enable-sockets=shared
342else
343  CONFIGURE_ARGS+= --disable-sockets
344endif
345
346ifneq ($(CONFIG_PACKAGE_php5-mod-sqlite),)
347  CONFIGURE_ARGS+= --with-sqlite=shared,"$(STAGING_DIR)/usr"
348else
349  CONFIGURE_ARGS+= --without-sqlite
350endif
351
352ifneq ($(CONFIG_PACKAGE_php5-mod-sqlite3),)
353  CONFIGURE_ARGS+= --with-sqlite3=shared,"$(STAGING_DIR)/usr"
354  CONFIGURE_LIBS+= -lsqlite3 -lpthread
355else
356  CONFIGURE_ARGS+= --without-sqlite3
357endif
358
359ifneq ($(CONFIG_PACKAGE_php5-mod-sysvmsg),)
360  CONFIGURE_ARGS+= --enable-sysvmsg=shared
361else
362  CONFIGURE_ARGS+= --disable-sysvmsg
363endif
364
365ifneq ($(CONFIG_PACKAGE_php5-mod-sysvsem),)
366  CONFIGURE_ARGS+= --enable-sysvsem=shared
367else
368  CONFIGURE_ARGS+= --disable-sysvsem
369endif
370
371ifneq ($(CONFIG_PACKAGE_php5-mod-sysvshm),)
372  CONFIGURE_ARGS+= --enable-sysvshm=shared
373else
374  CONFIGURE_ARGS+= --disable-sysvshm
375endif
376
377ifneq ($(CONFIG_PACKAGE_php5-mod-tokenizer),)
378  CONFIGURE_ARGS+= --enable-tokenizer=shared
379else
380  CONFIGURE_ARGS+= --disable-tokenizer
381endif
382
383ifneq ($(CONFIG_PACKAGE_php5-mod-xml),)
384  CONFIGURE_ARGS+= --enable-xml=shared,"$(STAGING_DIR)/usr"
385  ifneq ($(CONFIG_PHP5_LIBXML),)
386    CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
387  else
388    CONFIGURE_ARGS+= --with-libexpat-dir="$(STAGING_DIR)/usr"
389  endif
390else
391  CONFIGURE_ARGS+= --disable-xml
392endif
393
394ifneq ($(CONFIG_PACKAGE_php5-mod-xmlreader),)
395  CONFIGURE_ARGS+= --enable-xmlreader=shared,"$(STAGING_DIR)/usr"
396else
397  CONFIGURE_ARGS+= --disable-xmlreader
398endif
399
400ifneq ($(CONFIG_PACKAGE_php5-mod-xmlwriter),)
401  CONFIGURE_ARGS+= --enable-xmlwriter=shared,"$(STAGING_DIR)/usr"
402else
403  CONFIGURE_ARGS+= --disable-xmlwriter
404endif
405
406ifneq ($(CONFIG_PHP5_FILTER),)
407  CONFIGURE_ARGS+= --enable-filter
408else
409  CONFIGURE_ARGS+= --disable-filter
410endif
411
412ifneq ($(CONFIG_PHP5_LIBXML),)
413  CONFIGURE_ARGS+= --enable-libxml
414  CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
415else
416  CONFIGURE_ARGS+= --disable-libxml
417endif
418
419CONFIGURE_VARS+= \
420        LIBS="$(CONFIGURE_LIBS)" \
421        ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no) \
422        php_cv_cc_rpath="no" \
423        iconv_impl_name="gnu_libiconv" \
424        ac_cv_php_xml2_config_path="$(STAGING_DIR)/host/bin/xml2-config" \
425
426define Package/php5/conffiles
427/etc/php.ini
428endef
429
430define Package/php5/install
431        $(INSTALL_DIR) $(1)/etc
432        $(INSTALL_DATA) ./files/php.ini $(1)/etc/
433endef
434
435define Package/php5-cli/install
436        $(INSTALL_DIR) $(1)/usr/bin
437        $(CP) $(PKG_BUILD_DIR)/sapi/cli/php $(1)/usr/bin/php-cli
438endef
439
440define Package/php5-cgi/install
441        $(INSTALL_DIR) $(1)/usr/bin
442        $(CP) $(PKG_BUILD_DIR)/sapi/cgi/php-cgi $(1)/usr/bin/php-cgi
443        ln -sf php-cgi $(1)/usr/bin/php-fcgi
444endef
445
446define Package/php5-fastcgi/install
447        $(INSTALL_DIR) $(1)/etc/init.d
448        $(INSTALL_BIN) ./files/php.init $(1)/etc/init.d/php
449endef
450
451define BuildModule
452
453  define Package/php5-mod-$(1)
454    $(call Package/php5/Default)
455
456    ifneq ($(3),)
457      DEPENDS+=$(3)
458    endif
459
460    TITLE:=$(2) shared module
461  endef
462
463  define Package/php5-mod-$(1)/install
464        $(INSTALL_DIR) $$(1)/usr/lib/php
465        $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/
466        $(INSTALL_DIR) $$(1)/etc/php5
467        echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php5/$(subst -,_,$(1)).ini
468  endef
469
470  $$(eval $$(call BuildPackage,php5-mod-$(1)))
471
472endef
473
474$(eval $(call BuildPackage,php5))
475$(eval $(call BuildPackage,php5-cli))
476$(eval $(call BuildPackage,php5-cgi))
477$(eval $(call BuildPackage,php5-fastcgi))
478
479#$(eval $(call BuildModule,NAME,TITLE[,PKG DEPENDS]))
480$(eval $(call BuildModule,apc,APC,+librt))
481$(eval $(call BuildModule,ctype,Ctype))
482$(eval $(call BuildModule,curl,cURL,+libcurl))
483$(eval $(call BuildModule,fileinfo,Fileinfo,+libmagic))
484$(eval $(call BuildModule,dom,DOM,@PHP5_LIBXML +libxml2))
485$(eval $(call BuildModule,exif,EXIF))
486$(eval $(call BuildModule,ftp,FTP))
487$(eval $(call BuildModule,gettext,Gettext,+libintl-full))
488$(eval $(call BuildModule,gd,GD graphics,+libgd))
489$(eval $(call BuildModule,gmp,GMP,+libgmp))
490$(eval $(call BuildModule,hash,Hash))
491$(eval $(call BuildModule,iconv,iConv,+libiconv))
492$(eval $(call BuildModule,json,JSON))
493$(eval $(call BuildModule,ldap,LDAP,+libopenldap +libsasl2))
494$(eval $(call BuildModule,mbstring,MBString))
495$(eval $(call BuildModule,mcrypt,Mcrypt,+libmcrypt +libltdl))
496$(eval $(call BuildModule,mysql,MySQL,+libmysqlclient))
497$(eval $(call BuildModule,openssl,OpenSSL,+libopenssl))
498$(eval $(call BuildModule,pcntl,PCNTL))
499$(eval $(call BuildModule,pdo,PHP Data Objects))
500$(eval $(call BuildModule,pdo-mysql,PDO driver for MySQL,php5-mod-pdo +libmysqlclient))
501$(eval $(call BuildModule,pdo-pgsql,PDO driver for PostgreSQL,php5-mod-pdo +libpq))
502$(eval $(call BuildModule,pdo-sqlite,PDO driver for SQLite 3.x,php5-mod-pdo +libsqlite3 +libpthread))
503$(eval $(call BuildModule,pgsql,PostgreSQL,+libpq))
504$(eval $(call BuildModule,session,Session))
505$(eval $(call BuildModule,simplexml,SimpleXML,@PHP5_LIBXML +libxml2))
506$(eval $(call BuildModule,soap,SOAP,@PHP5_LIBXML +libxml2))
507$(eval $(call BuildModule,sockets,Sockets))
508$(eval $(call BuildModule,sqlite,SQLite 2.x,+libsqlite2))
509$(eval $(call BuildModule,sqlite3,SQLite3,+libsqlite3 +libpthread))
510$(eval $(call BuildModule,sysvmsg,System V messages))
511$(eval $(call BuildModule,sysvsem,System V shared memory))
512$(eval $(call BuildModule,sysvshm,System V semaphore))
513$(eval $(call BuildModule,tokenizer,Tokenizer))
514$(eval $(call BuildModule,xml,XML,+PHP5_LIBXML:libxml2 +!PHP5_LIBXML:libexpat))
515$(eval $(call BuildModule,xmlreader,XMLReader,@PHP5_LIBXML +libxml2 +libiconv))
516$(eval $(call BuildModule,xmlwriter,XMLWriter,@PHP5_LIBXML +libxml2 +libiconv))
Note: See TracBrowser for help on using the repository browser.