3191dc7ec67c5b73497d12cfecdca1d3fa072cf8
[openwrt/svn-archive/archive.git] / lang / php5 / Makefile
1 #
2 # Copyright (C) 2006-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=php
11 PKG_VERSION:=5.3.1
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://www.php.net/distributions/
16 PKG_MD5SUM:=63e97ad450f0f7259e785100b634c797
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/php5/Default
21 SUBMENU:=PHP
22 SECTION:=lang
23 CATEGORY:=Languages
24 TITLE:=PHP5 Hypertext preprocessor
25 URL:=http://www.php.net/
26 endef
27
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.
31 endef
32
33 define Package/php5/config
34 config PHP5_APC
35 bool "PHP5 APC support"
36 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
37
38 config PHP5_FILTER
39 bool "PHP5 Filter support"
40 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
41
42 config PHP5_LIBXML
43 bool "PHP5 LIBXML support"
44 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
45
46 config PHP5_SYSVIPC
47 bool "PHP5 Semaphore, Shared Memory and IPC support"
48 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
49 endef
50
51 define Package/php5
52 $(call Package/php5/Default)
53 DEPENDS:=+libpcre +zlib
54 ifneq ($(CONFIG_PHP5_LIBXML),)
55 DEPENDS+= +libxml2
56 endif
57 endef
58
59 define Package/php5/description
60 $(call Package/php5/Default/description)
61 This package contains only the PHP config file. You must actually choose
62 your PHP flavour (cli, cgi or fastcgi).
63 endef
64
65 define Package/php5-cli
66 $(call Package/php5/Default)
67 DEPENDS:=php5
68 TITLE+= (CLI)
69 endef
70
71 define Package/php5-cli/description
72 $(call Package/php5/Default/description)
73 This package contains the CLI version of the PHP5 interpreter.
74 endef
75
76 define Package/php5-cgi
77 $(call Package/php5/Default)
78 DEPENDS:=php5
79 TITLE+= (CGI & FastCGI)
80 endef
81
82 define Package/php5-cgi/description
83 $(call Package/php5/Default/description)
84 This package contains the CGI version of the PHP5 interpreter.
85 endef
86
87 define Package/php5-fastcgi
88 $(call Package/php5/Default)
89 DEPENDS:=php5 +php5-cgi
90 TITLE:=FastCGI startup script
91 endef
92
93 define Package/php5-cgi/description
94 As FastCGI support is now a core feature the php5-fastcgi package now depends
95 on the php5-cgi package, containing just the startup script.
96 endef
97
98 define Package/php5-mod-ctype
99 $(call Package/php5/Default)
100 DEPENDS:=php5
101 TITLE:=ctype shared module
102 endef
103 define Package/php5-mod-ctype/config
104 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
105 endef
106
107 define Package/php5-mod-curl
108 $(call Package/php5/Default)
109 DEPENDS:=php5 +libcurl
110 TITLE:=cURL shared module
111 endef
112 define Package/php5-mod-curl/config
113 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
114 endef
115
116 define Package/php5-mod-fileinfo
117 $(call Package/php5/Default)
118 DEPENDS:=php5 +libmagic
119 TITLE:=Fileinfo shared module
120 endef
121 define Package/php5-mod-fileinfo/config
122 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
123 endef
124
125 define Package/php5-mod-dom
126 $(call Package/php5/Default)
127 DEPENDS:=php5 +libxml2
128 TITLE:=DOM shared module
129 endef
130 define Package/php5-mod-dom/config
131 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
132 depends on PHP5_LIBXML
133 endef
134
135 define Package/php5-mod-exif
136 $(call Package/php5/Default)
137 DEPENDS:=php5
138 TITLE:=EXIF shared module
139 endef
140 define Package/php5-mod-exif/config
141 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
142 endef
143
144 define Package/php5-mod-ftp
145 $(call Package/php5/Default)
146 DEPENDS:=php5
147 TITLE:=FTP shared module
148 endef
149 define Package/php5-mod-ftp/config
150 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
151 endef
152
153 define Package/php5-mod-gd
154 $(call Package/php5/Default)
155 DEPENDS:=php5 +libgd
156 TITLE:=GD graphics shared module
157 endef
158 define Package/php5-mod-gd/config
159 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
160 endef
161
162 define Package/php5-mod-gmp
163 $(call Package/php5/Default)
164 DEPENDS:=php5 +libgmp
165 TITLE:=GMP shared module
166 endef
167 define Package/php5-mod-gmp/config
168 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
169 endef
170
171 define Package/php5-mod-hash
172 $(call Package/php5/Default)
173 DEPENDS:=php5
174 TITLE:=Hash shared module
175 endef
176 define Package/php5-mod-hash/config
177 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
178 endef
179
180 define Package/php5-mod-iconv
181 $(call Package/php5/Default)
182 DEPENDS:=php5 +libiconv
183 TITLE:=iConv shared module
184 endef
185 define Package/php5-mod-iconv/config
186 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
187 endef
188
189 define Package/php5-mod-json
190 $(call Package/php5/Default)
191 DEPENDS:=php5
192 TITLE:=JSON shared module
193 endef
194 define Package/php5-mod-json/config
195 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
196 endef
197
198 define Package/php5-mod-ldap
199 $(call Package/php5/Default)
200 DEPENDS:=php5 +libopenldap +libsasl2
201 TITLE:=LDAP shared module
202 endef
203 define Package/php5-mod-ldap/config
204 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
205 endef
206
207 define Package/php5-mod-mbstring
208 $(call Package/php5/Default)
209 DEPENDS:=php5
210 TITLE:=MBString shared module
211 endef
212 define Package/php5-mod-mbstring/config
213 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
214 endef
215
216 define Package/php5-mod-mcrypt
217 $(call Package/php5/Default)
218 DEPENDS:=php5 +libmcrypt +libltdl
219 TITLE:=mcrypt shared module
220 endef
221 define Package/php5-mod-mcrypt/config
222 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
223 endef
224
225 define Package/php5-mod-mysql
226 $(call Package/php5/Default)
227 DEPENDS:=php5 +libmysqlclient
228 TITLE:=MySQL shared module
229 endef
230 define Package/php5-mod-mysql/config
231 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
232 endef
233
234 define Package/php5-mod-openssl
235 $(call Package/php5/Default)
236 DEPENDS:=php5 +libopenssl
237 TITLE:=OpenSSL shared module
238 endef
239 define Package/php5-mod-openssl/config
240 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
241 endef
242
243 define Package/php5-mod-pdo
244 $(call Package/php5/Default)
245 DEPENDS:=php5
246 TITLE:=PHP Data Objects shared module
247 endef
248 define Package/php5-mod-pdo/config
249 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
250 endef
251
252 define Package/php5-mod-pdo-mysql
253 $(call Package/php5/Default)
254 DEPENDS:=php5-mod-pdo +libmysqlclient
255 TITLE:=PDO driver for MySQL
256 endef
257
258 define Package/php5-mod-pdo-pgsql
259 $(call Package/php5/Default)
260 DEPENDS:=php5-mod-pdo +libpq
261 TITLE:=PDO driver for PostgreSQL
262 endef
263
264 define Package/php5-mod-pdo-sqlite
265 $(call Package/php5/Default)
266 DEPENDS:=php5-mod-pdo +libsqlite3
267 TITLE:=PDO driver for SQLite (3.x)
268 endef
269
270 define Package/php5-mod-pgsql
271 $(call Package/php5/Default)
272 DEPENDS:=php5 +libpq
273 TITLE:=PostgreSQL shared module
274 endef
275 define Package/php5-mod-pgsql/config
276 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
277 endef
278
279 define Package/php5-mod-session
280 $(call Package/php5/Default)
281 DEPENDS:=php5
282 TITLE:=Session shared module
283 endef
284 define Package/php5-mod-session/config
285 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
286 endef
287
288 define Package/php5-mod-soap
289 $(call Package/php5/Default)
290 DEPENDS:=php5 +libxml2
291 TITLE:=SOAP shared module
292 endef
293 define Package/php5-mod-soap/config
294 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
295 depends on PHP5_LIBXML
296 endef
297
298 define Package/php5-mod-sockets
299 $(call Package/php5/Default)
300 DEPENDS:=php5
301 TITLE:=Sockets shared module
302 endef
303 define Package/php5-mod-sockets/config
304 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
305 endef
306
307 define Package/php5-mod-sqlite
308 $(call Package/php5/Default)
309 DEPENDS:=php5 +libsqlite2
310 TITLE:=SQLite shared module (2.x)
311 endef
312 define Package/php5-mod-sqlite/config
313 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
314 endef
315
316 define Package/php5-mod-sqlite3
317 $(call Package/php5/Default)
318 DEPENDS:=php5 +libsqlite3
319 TITLE:=SQLite3 shared module (3.x)
320 endef
321 define Package/php5-mod-sqlite3/config
322 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
323 endef
324
325 define Package/php5-mod-tokenizer
326 $(call Package/php5/Default)
327 DEPENDS:=php5
328 TITLE:=Tokenizer shared module
329 endef
330 define Package/php5-mod-tokenizer/config
331 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
332 endef
333
334 define Package/php5-mod-xml
335 $(call Package/php5/Default)
336 DEPENDS:=php5
337 ifneq ($(CONFIG_PHP5_LIBXML),)
338 DEPENDS+= +libxml2
339 else
340 DEPENDS+= +libexpat
341 endif
342 TITLE:=XML shared module
343 endef
344 define Package/php5-mod-xml/config
345 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
346 endef
347
348 define Package/php5-mod-xmlreader
349 $(call Package/php5/Default)
350 DEPENDS:=php5 +libxml2 +libiconv
351 TITLE:=XMLReader shared module
352 endef
353 define Package/php5-mod-xmlreader/config
354 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
355 depends on PHP5_LIBXML
356 endef
357
358 define Package/php5-mod-xmlwriter
359 $(call Package/php5/Default)
360 DEPENDS:=php5 +libxml2 +libiconv
361 TITLE:=XMLWriter shared module
362 endef
363 define Package/php5-mod-xmlwriter/config
364 depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
365 depends on PHP5_LIBXML
366 endef
367
368 PKG_CONFIGURE_OPTS:= \
369 --enable-shared \
370 --disable-static \
371 --disable-rpath \
372 --disable-debug \
373 --without-pear \
374 \
375 --with-config-file-path=/etc \
376 --enable-magic-quotes \
377 --disable-short-tags \
378 \
379 --without-gettext \
380 --disable-simplexml \
381 --with-zlib="$(STAGING_DIR)/usr" \
382 --with-zlib-dir="$(STAGING_DIR)/usr" \
383 --with-pcre-regex="$(STAGING_DIR)/usr" \
384 --disable-phar
385
386 ifneq ($(SDK),)
387 PKG_BUILD_DEPENDS:=libopenssl zlib libcurl libgd libgmp libopenldap libmysqlclient libpq libsqlite2 libsqlite3 libpcre libxml2
388 # force PKG_CONFIGURE_{LIBS,OPTS} below when built in the SDK
389 CONFIG_PACKAGE_php5-cli:=m
390 CONFIG_PACKAGE_php5-cgi:=m
391 CONFIG_PACKAGE_php5-fastcgi:=m
392 CONFIG_PACKAGE_php5-mod-curl:=m
393 CONFIG_PACKAGE_php5-mod-gd:=m
394 CONFIG_PACKAGE_php5-mod-gmp:=m
395 CONFIG_PACKAGE_php5-mod-ldap:=m
396 CONFIG_PACKAGE_php5-mod-mysql:=m
397 CONFIG_PACKAGE_php5-mod-pgsql:=m
398 CONFIG_PACKAGE_php5-mod-sqlite:=m
399 CONFIG_PACKAGE_php5-mod-sqlite3:=m
400 CONFIG_PACKAGE_php5-mod-xml:=m
401 endif
402
403 ifneq ($(CONFIG_PACKAGE_php5-mod-ctype),)
404 PKG_CONFIGURE_OPTS+= --enable-ctype=shared
405 else
406 PKG_CONFIGURE_OPTS+= --disable-ctype
407 endif
408
409 ifneq ($(CONFIG_PACKAGE_php5-mod-curl),)
410 PKG_CONFIGURE_OPTS+= --with-curl=shared,"$(STAGING_DIR)/usr"
411 else
412 PKG_CONFIGURE_OPTS+= --without-curl
413 endif
414
415 ifneq ($(CONFIG_PACKAGE_php5-mod-fileinfo),)
416 PKG_CONFIGURE_OPTS+= --enable-fileinfo=shared
417 else
418 PKG_CONFIGURE_OPTS+= --disable-fileinfo
419 endif
420
421 ifneq ($(CONFIG_PACKAGE_php5-mod-dom),)
422 PKG_CONFIGURE_OPTS+= --enable-dom=shared
423 else
424 PKG_CONFIGURE_OPTS+= --disable-dom
425 endif
426
427 ifneq ($(CONFIG_PACKAGE_php5-mod-exif),)
428 PKG_CONFIGURE_OPTS+= --enable-exif=shared
429 else
430 PKG_CONFIGURE_OPTS+= --disable-exif
431 endif
432
433 ifneq ($(CONFIG_PACKAGE_php5-mod-ftp),)
434 PKG_CONFIGURE_OPTS+= --enable-ftp=shared
435 else
436 PKG_CONFIGURE_OPTS+= --disable-ftp
437 endif
438
439 ifneq ($(CONFIG_PACKAGE_php5-mod-gd),)
440 PKG_CONFIGURE_OPTS+= --with-gd=shared,"$(STAGING_DIR)/usr" \
441 --without-freetype-dir \
442 --with-jpeg-dir="$(STAGING_DIR)/usr" \
443 --with-png-dir="$(STAGING_DIR)/usr" \
444 --without-xpm-dir \
445 --without-ttf \
446 --without-t1lib \
447 --enable-gd-native-ttf \
448 --disable-gd-jis-conv
449 else
450 PKG_CONFIGURE_OPTS+= --without-gd
451 endif
452
453 ifneq ($(CONFIG_PACKAGE_php5-mod-gmp),)
454 PKG_CONFIGURE_OPTS+= --with-gmp=shared,"$(STAGING_DIR)/usr"
455 else
456 PKG_CONFIGURE_OPTS+= --without-gmp
457 endif
458
459 ifneq ($(CONFIG_PACKAGE_php5-mod-hash),)
460 PKG_CONFIGURE_OPTS+= --enable-hash=shared
461 else
462 PKG_CONFIGURE_OPTS+= --disable-hash
463 endif
464
465 ifneq ($(CONFIG_PACKAGE_php5-mod-iconv),)
466 PKG_CONFIGURE_OPTS+= --with-iconv=shared,"$(STAGING_DIR)/usr/lib/libiconv"
467 else
468 PKG_CONFIGURE_OPTS+= --without-iconv
469 endif
470
471 ifneq ($(CONFIG_PACKAGE_php5-mod-json),)
472 PKG_CONFIGURE_OPTS+= --enable-json=shared
473 else
474 PKG_CONFIGURE_OPTS+= --disable-json
475 endif
476
477 ifneq ($(CONFIG_PACKAGE_php5-mod-ldap),)
478 PKG_CONFIGURE_OPTS+= --with-ldap=shared,"$(STAGING_DIR)/usr" \
479 --with-ldap-sasl="$(STAGING_DIR)/usr"
480 else
481 PKG_CONFIGURE_OPTS+= --without-ldap
482 endif
483
484 ifneq ($(CONFIG_PACKAGE_php5-mod-mbstring),)
485 PKG_CONFIGURE_OPTS+= --enable-mbstring=shared --enable-mbregex
486 else
487 PKG_CONFIGURE_OPTS+= --disable-mbstring
488 endif
489
490 ifneq ($(CONFIG_PACKAGE_php5-mod-mcrypt),)
491 PKG_CONFIGURE_OPTS+= --with-mcrypt=shared,"$(STAGING_DIR)/usr"
492 else
493 PKG_CONFIGURE_OPTS+= --without-mcrypt
494 endif
495
496 ifneq ($(CONFIG_PACKAGE_php5-mod-mysql),)
497 PKG_CONFIGURE_OPTS+= --with-mysql=shared,"$(STAGING_DIR)/usr"
498 else
499 PKG_CONFIGURE_OPTS+= --without-mysql
500 endif
501
502 ifneq ($(CONFIG_PACKAGE_php5-mod-openssl),)
503 PKG_CONFIGURE_OPTS+= --with-openssl=shared,"$(STAGING_DIR)/usr"
504 PKG_CONFIGURE_OPTS+= --with-kerberos=no
505 PKG_CONFIGURE_OPTS+= --with-openssl-dir="$(STAGING_DIR)/usr"
506 else
507 PKG_CONFIGURE_OPTS+= --without-openssl
508 endif
509
510 ifneq ($(CONFIG_PACKAGE_php5-mod-pdo),)
511 PKG_CONFIGURE_OPTS+= --enable-pdo=shared
512 ifneq ($(CONFIG_PACKAGE_php5-mod-pdo-mysql),)
513 PKG_CONFIGURE_OPTS+= --with-pdo-mysql=shared,"$(STAGING_DIR)/usr"
514 else
515 PKG_CONFIGURE_OPTS+= --without-pdo-mysql
516 endif
517 ifneq ($(CONFIG_PACKAGE_php5-mod-pdo-pgsql),)
518 PKG_CONFIGURE_OPTS+= --with-pdo-pgsql=shared,"$(STAGING_DIR)/usr"
519 else
520 PKG_CONFIGURE_OPTS+= --without-pdo-pgsql
521 endif
522 ifneq ($(CONFIG_PACKAGE_php5-mod-pdo-sqlite),)
523 PKG_CONFIGURE_OPTS+= --with-pdo-sqlite=shared,"$(STAGING_DIR)/usr"
524 PKG_CONFIGURE_LIBS+= -lsqlite3
525 else
526 PKG_CONFIGURE_OPTS+= --without-pdo-sqlite
527 endif
528 else
529 PKG_CONFIGURE_OPTS+= --disable-pdo
530 endif
531
532 ifneq ($(CONFIG_PACKAGE_php5-mod-pgsql),)
533 PKG_CONFIGURE_OPTS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
534 else
535 PKG_CONFIGURE_OPTS+= --without-pgsql
536 endif
537
538 ifneq ($(CONFIG_PACKAGE_php5-mod-session),)
539 PKG_CONFIGURE_OPTS+= --enable-session=shared
540 else
541 PKG_CONFIGURE_OPTS+= --disable-session
542 endif
543
544 ifneq ($(CONFIG_PACKAGE_php5-mod-soap),)
545 PKG_CONFIGURE_OPTS+= --enable-soap=shared
546 else
547 PKG_CONFIGURE_OPTS+= --disable-soap
548 endif
549
550 ifneq ($(CONFIG_PACKAGE_php5-mod-sockets),)
551 PKG_CONFIGURE_OPTS+= --enable-sockets=shared
552 else
553 PKG_CONFIGURE_OPTS+= --disable-sockets
554 endif
555
556 ifneq ($(CONFIG_PACKAGE_php5-mod-sqlite),)
557 PKG_CONFIGURE_OPTS+= --with-sqlite=shared,"$(STAGING_DIR)/usr"
558 else
559 PKG_CONFIGURE_OPTS+= --without-sqlite
560 endif
561
562 ifneq ($(CONFIG_PACKAGE_php5-mod-sqlite3),)
563 PKG_CONFIGURE_OPTS+= --with-sqlite3=shared,"$(STAGING_DIR)/usr"
564 PKG_CONFIGURE_LIBS+= -lsqlite3
565 else
566 PKG_CONFIGURE_OPTS+= --without-sqlite3
567 endif
568
569 ifneq ($(CONFIG_PACKAGE_php5-mod-tokenizer),)
570 PKG_CONFIGURE_OPTS+= --enable-tokenizer=shared
571 else
572 PKG_CONFIGURE_OPTS+= --disable-tokenizer
573 endif
574
575 ifneq ($(CONFIG_PACKAGE_php5-mod-xml),)
576 PKG_CONFIGURE_OPTS+= --enable-xml=shared,"$(STAGING_DIR)/usr"
577 ifneq ($(CONFIG_PHP5_LIBXML),)
578 PKG_CONFIGURE_OPTS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
579 else
580 PKG_CONFIGURE_OPTS+= --with-libexpat-dir="$(STAGING_DIR)/usr"
581 endif
582 else
583 PKG_CONFIGURE_OPTS+= --disable-xml
584 endif
585
586 ifneq ($(CONFIG_PACKAGE_php5-mod-xmlreader),)
587 PKG_CONFIGURE_OPTS+= --enable-xmlreader=shared,"$(STAGING_DIR)/usr"
588 else
589 PKG_CONFIGURE_OPTS+= --disable-xmlreader
590 endif
591
592 ifneq ($(CONFIG_PACKAGE_php5-mod-xmlwriter),)
593 PKG_CONFIGURE_OPTS+= --enable-xmlwriter=shared,"$(STAGING_DIR)/usr"
594 else
595 PKG_CONFIGURE_OPTS+= --disable-xmlwriter
596 endif
597
598 ifneq ($(CONFIG_PHP5_APC),)
599 PKG_CONFIGURE_OPTS+= --enable-apc --disable-apc-mmap --disable-apc-pthreadmutex
600 PKG_CONFIGURE_LIBS+= -lrt
601 else
602 PKG_CONFIGURE_OPTS+= --disable-apc
603 endif
604
605 ifneq ($(CONFIG_PHP5_FILTER),)
606 PKG_CONFIGURE_OPTS+= --enable-filter
607 else
608 PKG_CONFIGURE_OPTS+= --disable-filter
609 endif
610
611 ifneq ($(CONFIG_PHP5_LIBXML),)
612 PKG_CONFIGURE_OPTS+= --enable-libxml
613 PKG_CONFIGURE_OPTS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
614 else
615 PKG_CONFIGURE_OPTS+= --disable-libxml
616 endif
617
618 ifneq ($(CONFIG_PHP5_SYSVIPC),)
619 PKG_CONFIGURE_OPTS+= --enable-sysvsem --enable-sysvshm --enable-sysvmsg
620 else
621 PKG_CONFIGURE_OPTS+= --disable-sysvsem --disable-sysvshm --disable-sysvmsg
622 endif
623
624 define Build/Configure
625 endef
626
627 ifneq ($(CONFIG_PACKAGE_php5-cli),)
628 define Build/Compile/php5-cli
629 -$(MAKE) -C $(PKG_BUILD_DIR) clean
630 $(call Build/Configure/Default, \
631 $(PKG_CONFIGURE_OPTS) \
632 --enable-cli \
633 --disable-cgi \
634 , \
635 LIBS="$(PKG_CONFIGURE_LIBS)" \
636 php_cv_cc_rpath="no" \
637 iconv_impl_name="gnu_libiconv" \
638 ac_cv_php_xml2_config_path="$(STAGING_DIR)/host/bin/xml2-config" \
639 )
640 $(MAKE) -C $(PKG_BUILD_DIR)
641 mv $(PKG_BUILD_DIR)/sapi/cli/php $(PKG_BUILD_DIR)/php-cli
642 endef
643 endif
644
645 ifneq ($(CONFIG_PACKAGE_php5-cgi),)
646 define Build/Compile/php5-cgi
647 -$(MAKE) -C $(PKG_BUILD_DIR) clean
648 $(call Build/Configure/Default, \
649 $(PKG_CONFIGURE_OPTS) \
650 --disable-cli \
651 --enable-cgi \
652 , \
653 LIBS="$(PKG_CONFIGURE_LIBS)" \
654 php_cv_cc_rpath="no" \
655 iconv_impl_name="gnu_libiconv" \
656 ac_cv_php_xml2_config_path="$(STAGING_DIR)/host/bin/xml2-config" \
657 )
658 $(MAKE) -C $(PKG_BUILD_DIR)
659 mv $(PKG_BUILD_DIR)/sapi/cgi/php-cgi $(PKG_BUILD_DIR)/php-cgi
660 endef
661 endif
662
663 define Build/Compile
664 $(call Build/Compile/php5-cli)
665 $(call Build/Compile/php5-cgi)
666 endef
667
668 define Package/php5/conffiles
669 /etc/php.ini
670 endef
671
672 define Package/php5/install
673 $(INSTALL_DIR) $(1)/etc
674 $(INSTALL_DATA) ./files/php.ini $(1)/etc/
675 endef
676
677 define Package/php5-cli/install
678 $(INSTALL_DIR) $(1)/usr/bin
679 $(CP) $(PKG_BUILD_DIR)/php-cli $(1)/usr/bin/php-cli
680 endef
681
682 define Package/php5-cgi/install
683 $(INSTALL_DIR) $(1)/usr/bin
684 $(CP) $(PKG_BUILD_DIR)/php-cgi $(1)/usr/bin/php-cgi
685 ln -sf php-cgi $(1)/usr/bin/php-fcgi
686 endef
687
688 define Package/php5-fastcgi/install
689 $(INSTALL_DIR) $(1)/etc/init.d
690 $(INSTALL_BIN) ./files/php.init $(1)/etc/init.d/php
691 endef
692
693 define BuildPlugin
694 define Package/$(1)/install
695 [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/php
696 for m in $(2); do \
697 [ -z "$(CONFIG_PACKAGE_$(1))" ] \
698 || $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$$$$$$$${m}.so $$(1)/usr/lib/php/ ; \
699 done
700 endef
701
702 $$(eval $$(call BuildPackage,$(1)))
703 endef
704
705 $(eval $(call BuildPackage,php5))
706 $(eval $(call BuildPackage,php5-cli))
707 $(eval $(call BuildPackage,php5-cgi))
708 $(eval $(call BuildPackage,php5-fastcgi))
709 $(eval $(call BuildPlugin,php5-mod-ctype,ctype))
710 $(eval $(call BuildPlugin,php5-mod-curl,curl))
711 $(eval $(call BuildPlugin,php5-mod-fileinfo,fileinfo))
712 $(eval $(call BuildPlugin,php5-mod-dom,dom))
713 $(eval $(call BuildPlugin,php5-mod-exif,exif))
714 $(eval $(call BuildPlugin,php5-mod-ftp,ftp))
715 $(eval $(call BuildPlugin,php5-mod-gd,gd))
716 $(eval $(call BuildPlugin,php5-mod-gmp,gmp))
717 $(eval $(call BuildPlugin,php5-mod-hash,hash))
718 $(eval $(call BuildPlugin,php5-mod-iconv,iconv))
719 $(eval $(call BuildPlugin,php5-mod-json,json))
720 $(eval $(call BuildPlugin,php5-mod-ldap,ldap))
721 $(eval $(call BuildPlugin,php5-mod-mbstring,mbstring))
722 $(eval $(call BuildPlugin,php5-mod-mcrypt,mcrypt))
723 $(eval $(call BuildPlugin,php5-mod-mysql,mysql))
724 $(eval $(call BuildPlugin,php5-mod-openssl,openssl))
725 $(eval $(call BuildPlugin,php5-mod-pdo,pdo))
726 $(eval $(call BuildPlugin,php5-mod-pdo-mysql,pdo_mysql))
727 $(eval $(call BuildPlugin,php5-mod-pdo-pgsql,pdo_pgsql))
728 $(eval $(call BuildPlugin,php5-mod-pdo-sqlite,pdo_sqlite))
729 $(eval $(call BuildPlugin,php5-mod-pgsql,pgsql))
730 $(eval $(call BuildPlugin,php5-mod-session,session))
731 $(eval $(call BuildPlugin,php5-mod-soap,soap))
732 $(eval $(call BuildPlugin,php5-mod-sockets,sockets))
733 $(eval $(call BuildPlugin,php5-mod-sqlite,sqlite))
734 $(eval $(call BuildPlugin,php5-mod-sqlite3,sqlite3))
735 $(eval $(call BuildPlugin,php5-mod-tokenizer,tokenizer))
736 $(eval $(call BuildPlugin,php5-mod-xml,xml))
737 $(eval $(call BuildPlugin,php5-mod-xmlreader,xmlreader))
738 $(eval $(call BuildPlugin,php5-mod-xmlwriter,xmlwriter))