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