usbmuxd: Update to latest git
[feed/packages.git] / lang / php7 / Makefile
1 #
2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
4 #
5
6 include $(TOPDIR)/rules.mk
7
8 PKG_NAME:=php
9 PKG_VERSION:=7.2.16
10 PKG_RELEASE:=1
11
12 PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
13
14 PKG_LICENSE:=PHPv3.01
15 PKG_LICENSE_FILES:=LICENSE
16 PKG_CPE_ID:=cpe:/a:php:php
17
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
19 PKG_SOURCE_URL:=http://www.php.net/distributions/
20 PKG_HASH:=7d91ed3c1447c6358a3d53f84599ef854aca4c3622de7435e2df115bf196e482
21
22 PKG_FIXUP:=libtool autoreconf
23 PKG_BUILD_PARALLEL:=1
24 PKG_USE_MIPS16:=0
25
26 PHP7_MODULES = \
27 bcmath \
28 calendar ctype curl \
29 fileinfo \
30 dom \
31 exif \
32 ftp \
33 gettext gd gmp \
34 hash \
35 iconv imap intl \
36 json \
37 ldap \
38 mbstring mysqli mysqlnd \
39 opcache openssl \
40 pcntl pdo pdo-mysql pdo-pgsql pdo-sqlite pgsql phar \
41 session shmop simplexml snmp soap sockets sqlite3 sysvmsg sysvsem sysvshm \
42 tokenizer \
43 xml xmlreader xmlwriter zip \
44
45 PKG_CONFIG_DEPENDS:= \
46 $(patsubst %,CONFIG_PACKAGE_php7-mod-%,$(PHP7_MODULES)) \
47 CONFIG_PHP7_FILTER CONFIG_PHP7_LIBXML CONFIG_PHP7_SYSTEMTZDATA CONFIG_PHP7_LIBFREETYPE
48
49 include $(INCLUDE_DIR)/package.mk
50 include $(INCLUDE_DIR)/nls.mk
51
52 define Package/php7/Default
53 SUBMENU:=PHP
54 SECTION:=lang
55 CATEGORY:=Languages
56 TITLE:=PHP7 Hypertext preprocessor
57 URL:=http://www.php.net/
58 DEPENDS:=php7
59 endef
60
61 define Package/php7/Default/description
62 PHP is a widely-used general-purpose scripting language that is especially
63 suited for Web development and can be embedded into HTML.
64 endef
65
66 define Package/php7/config
67 config PHP7_FILTER
68 bool "PHP7 Filter support"
69 depends on PACKAGE_php7-cli || PACKAGE_php7-cgi
70 default y
71
72 config PHP7_LIBXML
73 bool "PHP7 LIBXML support"
74 depends on PACKAGE_php7-cli || PACKAGE_php7-cgi
75
76 config PHP7_SYSTEMTZDATA
77 bool "Use system timezone data instead of php's built-in database"
78 depends on PACKAGE_php7-cli || PACKAGE_php7-cgi
79 default y
80 help
81 Enabling this feature automatically selects the zoneinfo-core package
82 which contains data for UTC timezone. To use other timezones you have
83 to install the corresponding zoneinfo-... package(s).
84 endef
85
86 define Package/php7
87 $(call Package/php7/Default)
88
89 DEPENDS:=+libpcre +zlib \
90 +PHP7_LIBXML:libxml2 \
91 +PHP7_SYSTEMTZDATA:zoneinfo-core
92 endef
93
94 define Package/php7/description
95 $(call Package/php7/Default/description)
96 This package contains only the PHP config file. You must actually choose
97 your PHP flavour (cli, cgi or fastcgi).
98
99 Please note, that installing php5 and php7 in parallel on the same target
100 is not supported in OpenWrt/LEDE.
101 endef
102
103 define Package/php7-cli
104 $(call Package/php7/Default)
105 DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp
106 TITLE+= (CLI)
107 endef
108
109 define Package/php7-cli/description
110 $(call Package/php7/Default/description)
111 This package contains the CLI version of the PHP7 interpreter.
112 endef
113
114 define Package/php7-cgi
115 $(call Package/php7/Default)
116 DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp
117 TITLE+= (CGI & FastCGI)
118 endef
119
120 define Package/php7-cgi/description
121 $(call Package/php7/Default/description)
122 This package contains the CGI version of the PHP7 interpreter.
123 endef
124
125 define Package/php7-fastcgi
126 $(call Package/php7/Default)
127 DEPENDS+= +php7-cgi
128 TITLE:=FastCGI startup script
129 endef
130
131 define Package/php7-fastcgi/description
132 As FastCGI support is now a core feature the php7-fastcgi package now depends
133 on the php7-cgi package, containing just the startup script.
134 endef
135
136 define Package/php7-fpm
137 $(call Package/php7/Default)
138 DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp
139 TITLE+= (FPM)
140 endef
141
142 define Package/php7-fpm/description
143 $(call Package/php7/Default/description)
144 This package contains the FastCGI Process Manager of the PHP7 interpreter.
145 endef
146
147 define Package/php7-mod-gd/config
148 config PHP7_LIBFREETYPE
149 bool "Enable Freetype 2 support in php7-mod-gd"
150 depends on PACKAGE_php7-mod-gd
151 default y
152 endef
153
154 define Package/php7-mod-intl/config
155 config PHP7_FULLICUDATA
156 bool "Add dependency to full ICU Data"
157 depends on PACKAGE_php7-mod-intl
158 default n
159 endef
160
161 define Package/php7-mod-intl/description
162 Note that this package depends in ICU library which is built without data
163 by default. This is to satisfy programs build and run dependencies but to
164 keep the installed footprint small on the target system(s).
165 However, the data is required to make the ICU library useful - and thus
166 directly affects PHPs ICU extension, too - so consider to also
167 select/install package 'icu-full-data'.
168 endef
169
170 # not everything groks --disable-nls
171 DISABLE_NLS:=
172
173 CONFIGURE_ARGS+= \
174 --enable-cli \
175 --enable-cgi \
176 --enable-fpm \
177 --enable-shared \
178 --disable-static \
179 --with-pic \
180 --disable-rpath \
181 --disable-debug \
182 --disable-phpdbg \
183 --without-pear \
184 \
185 --with-config-file-path=/etc \
186 --with-config-file-scan-dir=/etc/php7 \
187 --disable-short-tags \
188 \
189 --without-valgrind \
190 --with-pcre-regex="$(STAGING_DIR)/usr" \
191 --with-zlib="$(STAGING_DIR)/usr" \
192 --with-zlib-dir="$(STAGING_DIR)/usr"
193
194 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-bcmath),)
195 CONFIGURE_ARGS+= --enable-bcmath=shared
196 else
197 CONFIGURE_ARGS+= --disable-bcmath
198 endif
199
200 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-calendar),)
201 CONFIGURE_ARGS+= --enable-calendar=shared
202 else
203 CONFIGURE_ARGS+= --disable-calendar
204 endif
205
206 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ctype),)
207 CONFIGURE_ARGS+= --enable-ctype=shared
208 else
209 CONFIGURE_ARGS+= --disable-ctype
210 endif
211
212 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-curl),)
213 CONFIGURE_ARGS+= --with-curl=shared,"$(STAGING_DIR)/usr"
214 else
215 CONFIGURE_ARGS+= --without-curl
216 endif
217
218 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-fileinfo),)
219 CONFIGURE_ARGS+= --enable-fileinfo=shared
220 else
221 CONFIGURE_ARGS+= --disable-fileinfo
222 endif
223
224 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gettext),)
225 CONFIGURE_ARGS+= --with-gettext=shared,"$(STAGING_DIR)/usr/lib/libintl-full"
226 else
227 CONFIGURE_ARGS+= --without-gettext
228 endif
229
230 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-dom),)
231 CONFIGURE_ARGS+= --enable-dom=shared
232 else
233 CONFIGURE_ARGS+= --disable-dom
234 endif
235
236 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-exif),)
237 CONFIGURE_ARGS+= --enable-exif=shared
238 else
239 CONFIGURE_ARGS+= --disable-exif
240 endif
241
242 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ftp),)
243 CONFIGURE_ARGS+= --enable-ftp=shared
244 else
245 CONFIGURE_ARGS+= --disable-ftp
246 endif
247
248 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gd),)
249 CONFIGURE_ARGS+= \
250 --with-gd=shared \
251 --with-jpeg-dir="$(STAGING_DIR)/usr" \
252 --with-png-dir="$(STAGING_DIR)/usr" \
253 --without-xpm-dir \
254 --enable-gd-native-ttf \
255 --disable-gd-jis-conv
256 else
257 CONFIGURE_ARGS+= --without-gd
258 endif
259 ifneq ($(CONFIG_PHP7_LIBFREETYPE),)
260 CONFIGURE_ARGS+= --with-freetype-dir="$(STAGING_DIR)"
261 else
262 CONFIGURE_ARGS+= --without-freetype-dir
263 endif
264
265 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gmp),)
266 CONFIGURE_ARGS+= --with-gmp=shared,"$(STAGING_DIR)/usr"
267 else
268 CONFIGURE_ARGS+= --without-gmp
269 endif
270
271 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-hash),)
272 CONFIGURE_ARGS+= --enable-hash=shared
273 else
274 CONFIGURE_ARGS+= --disable-hash
275 endif
276
277 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-iconv),)
278 CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)"
279 else
280 CONFIGURE_ARGS+= --without-iconv
281 endif
282
283 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-imap),)
284 CONFIGURE_ARGS+= \
285 --with-imap=shared,"$(STAGING_DIR)/usr" \
286 --with-imap-kerberos=no \
287 --with-imap-ssl="$(STAGING_DIR)/usr"
288 else
289 CONFIGURE_ARGS+= --without-imap
290 endif
291
292 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-intl),)
293 CONFIGURE_ARGS+= --enable-intl=shared
294 TARGET_CXXFLAGS+= -std=c++0x
295 else
296 CONFIGURE_ARGS+= --disable-intl
297 endif
298
299 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-json),)
300 CONFIGURE_ARGS+= --enable-json=shared
301 else
302 CONFIGURE_ARGS+= --disable-json
303 endif
304
305 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ldap),)
306 CONFIGURE_ARGS+= \
307 --with-ldap=shared,"$(STAGING_DIR)/usr" \
308 --with-ldap-sasl="$(STAGING_DIR)/usr"
309 else
310 CONFIGURE_ARGS+= --without-ldap
311 endif
312
313 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mbstring),)
314 CONFIGURE_ARGS+= --enable-mbstring=shared --enable-mbregex
315 else
316 CONFIGURE_ARGS+= --disable-mbstring
317 endif
318
319 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mysqli),)
320 CONFIGURE_ARGS+= --with-mysqli=shared
321 else
322 CONFIGURE_ARGS+= --without-mysqli
323 endif
324
325 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mysqlnd),)
326 CONFIGURE_ARGS+= --enable-mysqlnd=shared
327 else
328 CONFIGURE_ARGS+= --disable-mysqlnd
329 endif
330
331 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-opcache),)
332 CONFIGURE_ARGS+= --enable-opcache=shared
333 else
334 CONFIGURE_ARGS+= --disable-opcache
335 endif
336
337 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-openssl)$(CONFIG_PACKAGE_php7-mod-ftp)$(CONFIG_PACKAGE_php7-mod-imap)$(CONFIG_PACKAGE_php7-mod-snmp),)
338 CONFIGURE_ARGS+= \
339 --with-openssl=shared,"$(STAGING_DIR)/usr" \
340 --with-kerberos=no \
341 --with-openssl-dir="$(STAGING_DIR)/usr"
342 else
343 CONFIGURE_ARGS+= --without-openssl
344 endif
345
346 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pcntl),)
347 CONFIGURE_ARGS+= --enable-pcntl=shared
348 else
349 CONFIGURE_ARGS+= --disable-pcntl
350 endif
351
352 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo),)
353 CONFIGURE_ARGS+= --enable-pdo=shared
354 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-mysql),)
355 CONFIGURE_ARGS+= --with-pdo-mysql=shared
356 else
357 CONFIGURE_ARGS+= --without-pdo-mysql
358 endif
359 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-pgsql),)
360 CONFIGURE_ARGS+= --with-pdo-pgsql=shared,"$(STAGING_DIR)/usr"
361 else
362 CONFIGURE_ARGS+= --without-pdo-pgsql
363 endif
364 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-sqlite),)
365 CONFIGURE_ARGS+= --with-pdo-sqlite=shared,"$(STAGING_DIR)/usr"
366 else
367 CONFIGURE_ARGS+= --without-pdo-sqlite
368 endif
369 else
370 CONFIGURE_ARGS+= --disable-pdo
371 endif
372
373 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pgsql),)
374 CONFIGURE_ARGS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
375 else
376 CONFIGURE_ARGS+= --without-pgsql
377 endif
378
379 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-phar),)
380 CONFIGURE_ARGS+= --enable-phar=shared
381 else
382 CONFIGURE_ARGS+= --disable-phar
383 endif
384
385 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-session),)
386 CONFIGURE_ARGS+= --enable-session=shared
387 else
388 CONFIGURE_ARGS+= --disable-session
389 endif
390
391 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-shmop),)
392 CONFIGURE_ARGS+= --enable-shmop=shared
393 else
394 CONFIGURE_ARGS+= --disable-shmop
395 endif
396
397 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-simplexml),)
398 CONFIGURE_ARGS+= --enable-simplexml=shared
399 else
400 CONFIGURE_ARGS+= --disable-simplexml
401 endif
402
403 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-snmp),)
404 CONFIGURE_ARGS+= --with-snmp=shared,"$(STAGING_DIR)/usr"
405 else
406 CONFIGURE_ARGS+= --without-snmp
407 endif
408
409 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-soap),)
410 CONFIGURE_ARGS+= --enable-soap=shared
411 else
412 CONFIGURE_ARGS+= --disable-soap
413 endif
414
415 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sockets),)
416 CONFIGURE_ARGS+= --enable-sockets=shared
417 else
418 CONFIGURE_ARGS+= --disable-sockets
419 endif
420
421 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sqlite3),)
422 CONFIGURE_ARGS+= --with-sqlite3=shared,"$(STAGING_DIR)/usr"
423 else
424 CONFIGURE_ARGS+= --without-sqlite3
425 endif
426
427 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvmsg),)
428 CONFIGURE_ARGS+= --enable-sysvmsg=shared
429 else
430 CONFIGURE_ARGS+= --disable-sysvmsg
431 endif
432
433 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvsem),)
434 CONFIGURE_ARGS+= --enable-sysvsem=shared
435 else
436 CONFIGURE_ARGS+= --disable-sysvsem
437 endif
438
439 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvshm),)
440 CONFIGURE_ARGS+= --enable-sysvshm=shared
441 else
442 CONFIGURE_ARGS+= --disable-sysvshm
443 endif
444
445 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-tokenizer),)
446 CONFIGURE_ARGS+= --enable-tokenizer=shared
447 else
448 CONFIGURE_ARGS+= --disable-tokenizer
449 endif
450
451 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xml),)
452 CONFIGURE_ARGS+= --enable-xml=shared,"$(STAGING_DIR)/usr"
453 ifneq ($(CONFIG_PHP7_LIBXML),)
454 CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
455 else
456 CONFIGURE_ARGS+= --with-libexpat-dir="$(STAGING_DIR)/usr"
457 endif
458 else
459 CONFIGURE_ARGS+= --disable-xml
460 endif
461
462 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xmlreader),)
463 CONFIGURE_ARGS+= --enable-xmlreader=shared,"$(STAGING_DIR)/usr"
464 else
465 CONFIGURE_ARGS+= --disable-xmlreader
466 endif
467
468 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xmlwriter),)
469 CONFIGURE_ARGS+= --enable-xmlwriter=shared,"$(STAGING_DIR)/usr"
470 else
471 CONFIGURE_ARGS+= --disable-xmlwriter
472 endif
473
474 ifneq ($(CONFIG_PACKAGE_php7-mod-zip),)
475 CONFIGURE_ARGS+= --enable-zip=shared
476 else
477 CONFIGURE_ARGS+= --disable-zip
478 endif
479
480 ifneq ($(SDK)$(CONFIG_PHP7_FILTER),)
481 CONFIGURE_ARGS+= --enable-filter
482 else
483 CONFIGURE_ARGS+= --disable-filter
484 endif
485
486 ifneq ($(SDK)$(CONFIG_PHP7_LIBXML),)
487 CONFIGURE_ARGS+= --enable-libxml
488 CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
489 else
490 CONFIGURE_ARGS+= --disable-libxml
491 endif
492
493 ifneq ($(CONFIG_PHP7_SYSTEMTZDATA),)
494 CONFIGURE_ARGS+= --with-system-tzdata
495 else
496 CONFIGURE_ARGS+= --without-system-tzdata
497 endif
498
499 CONFIGURE_VARS+= \
500 ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no) \
501 php_cv_cc_rpath="no" \
502 iconv_impl_name="gnu_libiconv" \
503 ac_cv_php_xml2_config_path="$(STAGING_DIR)/host/bin/xml2-config" \
504 ac_cv_u8t_decompose=yes
505
506 define Package/php7/conffiles
507 /etc/php.ini
508 /etc/php7/
509 endef
510
511 define Package/php7/install
512 $(INSTALL_DIR) $(1)/etc
513 $(INSTALL_DATA) ./files/php.ini $(1)/etc/
514 endef
515
516 define Package/php7-cli/install
517 $(INSTALL_DIR) $(1)/usr/bin
518 $(CP) $(PKG_BUILD_DIR)/sapi/cli/php $(1)/usr/bin/php-cli
519 endef
520
521 define Package/php7-cgi/install
522 $(INSTALL_DIR) $(1)/usr/bin
523 $(CP) $(PKG_BUILD_DIR)/sapi/cgi/php-cgi $(1)/usr/bin/php-cgi
524 ln -sf php-cgi $(1)/usr/bin/php-fcgi
525 endef
526
527 define Package/php7-fastcgi/install
528 $(INSTALL_DIR) $(1)/etc/config
529 $(INSTALL_DATA) ./files/php7-fastcgi.config $(1)/etc/config/php7-fastcgi
530
531 $(INSTALL_DIR) $(1)/etc/init.d
532 $(INSTALL_BIN) ./files/php7-fastcgi.init $(1)/etc/init.d/php7-fastcgi
533 endef
534
535 define Package/php7-fpm/install
536 $(INSTALL_DIR) $(1)/usr/bin
537 $(INSTALL_BIN) $(PKG_BUILD_DIR)/sapi/fpm/php-fpm $(1)/usr/bin/php-fpm
538
539 $(INSTALL_DIR) $(1)/etc
540 $(INSTALL_DATA) ./files/php7-fpm.conf $(1)/etc/php7-fpm.conf
541
542 $(INSTALL_DIR) $(1)/etc/config
543 $(INSTALL_DATA) ./files/php7-fpm.config $(1)/etc/config/php7-fpm
544
545 $(INSTALL_DIR) $(1)/etc/php7-fpm.d
546 $(INSTALL_DATA) ./files/php7-fpm-www.conf $(1)/etc/php7-fpm.d/www.conf
547
548 $(INSTALL_DIR) $(1)/etc/init.d
549 $(INSTALL_BIN) ./files/php7-fpm.init $(1)/etc/init.d/php7-fpm
550 endef
551
552 define Package/php7-fpm/conffiles
553 /etc/php7-fpm.conf
554 /etc/php7-fpm.d/
555 /etc/config/php7-fpm
556 endef
557
558 define Build/Prepare
559 $(call Build/Prepare/Default)
560 ( cd $(PKG_BUILD_DIR); touch configure.in; ./buildconf --force )
561 endef
562
563 define Build/InstallDev
564 rm -rf $(PKG_BUILD_DIR)/staging
565 make -C $(PKG_BUILD_DIR) install INSTALL_ROOT=$(PKG_BUILD_DIR)/staging
566 rm -rf $(PKG_BUILD_DIR)/staging/usr/{share,man,sbin}
567 rm -f $(PKG_BUILD_DIR)/staging/usr/bin/{php,php-cgi,php-cli}
568 mv $(PKG_BUILD_DIR)/staging/usr/bin/phpize $(PKG_BUILD_DIR)/staging/usr/bin/phpize7
569 mv $(PKG_BUILD_DIR)/staging/usr/bin/php-config $(PKG_BUILD_DIR)/staging/usr/bin/php7-config
570 mv $(PKG_BUILD_DIR)/staging/usr/include/php $(PKG_BUILD_DIR)/staging/usr/include/php7
571 mv $(PKG_BUILD_DIR)/staging/usr/lib/php $(PKG_BUILD_DIR)/staging/usr/lib/php7
572
573 $(CP) $(PKG_BUILD_DIR)/staging/usr $(STAGING_DIR)/
574
575 sed -i -e "s#prefix='/usr'#prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize7
576 sed -i -e "s#exec_prefix=\"\`eval echo /usr\`\"#exec_prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize7
577 sed -i -e "s#/include\`/php\"#/include\`/php7\"#" $(STAGING_DIR)/usr/bin/phpize7
578 sed -i -e "s#/lib/php\`/build\"#/lib/php7\`/build\"#" $(STAGING_DIR)/usr/bin/phpize7
579
580 sed -i -e "s#prefix=\"/usr\"#prefix=\"$(STAGING_DIR)/usr\"#" $(STAGING_DIR)/usr/bin/php7-config
581 sed -i -e "s#/include/php\"#/include/php7\"#" $(STAGING_DIR)/usr/bin/php7-config
582 endef
583
584 define BuildModule
585
586 define Package/php7-mod-$(1)
587 $(call Package/php7/Default)
588
589 ifneq ($(3),)
590 DEPENDS+=$(3)
591 endif
592
593 TITLE:=$(2) shared module
594 endef
595
596 define Package/php7-mod-$(1)/install
597 $(INSTALL_DIR) $$(1)/usr/lib/php
598 $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/
599 $(INSTALL_DIR) $$(1)/etc/php7
600 ifeq ($(5),zend)
601 echo "zend_extension=/usr/lib/php/$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
602 else
603 echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
604 endif
605 endef
606
607 $$(eval $$(call BuildPackage,php7-mod-$(1)))
608
609 endef
610
611 $(eval $(call BuildPackage,php7))
612 $(eval $(call BuildPackage,php7-cgi))
613 $(eval $(call BuildPackage,php7-cli))
614 $(eval $(call BuildPackage,php7-fastcgi))
615 $(eval $(call BuildPackage,php7-fpm))
616
617 #$(eval $(call BuildModule,NAME,TITLE[,PKG DEPENDS]))
618 $(eval $(call BuildModule,bcmath,Bcmath))
619 $(eval $(call BuildModule,calendar,Calendar))
620 $(eval $(call BuildModule,ctype,Ctype))
621 $(eval $(call BuildModule,curl,cURL,+PACKAGE_php7-mod-curl:libcurl))
622 $(eval $(call BuildModule,dom,DOM,+@PHP7_LIBXML +PACKAGE_php7-mod-dom:libxml2))
623 $(eval $(call BuildModule,exif,EXIF))
624 $(eval $(call BuildModule,fileinfo,Fileinfo))
625 $(eval $(call BuildModule,ftp,FTP,+PACKAGE_php7-mod-ftp:libopenssl))
626 $(eval $(call BuildModule,gd,GD graphics,+PACKAGE_php7-mod-gd:libjpeg +PACKAGE_php7-mod-gd:libpng +PHP7_LIBFREETYPE:libfreetype))
627 $(eval $(call BuildModule,gettext,Gettext,+PACKAGE_php7-mod-gettext:libintl-full))
628 $(eval $(call BuildModule,gmp,GMP,+PACKAGE_php7-mod-gmp:libgmp))
629 $(eval $(call BuildModule,hash,Hash))
630 $(eval $(call BuildModule,iconv,iConv,$(ICONV_DEPENDS)))
631 $(eval $(call BuildModule,imap,IMAP,+PACKAGE_php7-mod-imap:libopenssl +PACKAGE_libpam:libpam +PACKAGE_php7-mod-imap:uw-imap))
632 $(eval $(call BuildModule,intl,Internationalization Functions,+PACKAGE_php7-mod-intl:icu +PHP7_FULLICUDATA:icu-full-data))
633 $(eval $(call BuildModule,json,JSON))
634 $(eval $(call BuildModule,ldap,LDAP,+PACKAGE_php7-mod-ldap:libopenldap +PACKAGE_php7-mod-ldap:libsasl2))
635 $(eval $(call BuildModule,mbstring,MBString))
636 $(eval $(call BuildModule,mysqli,MySQL Improved Extension,+PACKAGE_php7-mod-mysqli:php7-mod-mysqlnd,30))
637 $(eval $(call BuildModule,mysqlnd,MySQL Native Driver,+php7-mod-hash))
638 $(eval $(call BuildModule,opcache,OPcache,,,zend))
639 $(eval $(call BuildModule,openssl,OpenSSL,+PACKAGE_php7-mod-openssl:libopenssl,15))
640 $(eval $(call BuildModule,pcntl,PCNTL))
641 $(eval $(call BuildModule,pdo,PHP Data Objects))
642 $(eval $(call BuildModule,pdo-mysql,PDO driver for MySQL,+php7-mod-pdo +PACKAGE_php7-mod-pdo-mysql:php7-mod-mysqlnd))
643 $(eval $(call BuildModule,pdo-pgsql,PDO driver for PostgreSQL,+php7-mod-pdo +PACKAGE_php7-mod-pdo-pgsql:libpq))
644 $(eval $(call BuildModule,pdo-sqlite,PDO driver for SQLite 3.x,+php7-mod-pdo +PACKAGE_php7-mod-pdo-sqlite:libsqlite3 +PACKAGE_php7-mod-pdo-sqlite:librt))
645 $(eval $(call BuildModule,pgsql,PostgreSQL,+PACKAGE_php7-mod-pgsql:libpq))
646 $(eval $(call BuildModule,phar,Phar Archives,+php7-mod-hash))
647 $(eval $(call BuildModule,session,Session))
648 $(eval $(call BuildModule,shmop,Shared Memory))
649 $(eval $(call BuildModule,simplexml,SimpleXML,+@PHP7_LIBXML +PACKAGE_php7-mod-simplexml:libxml2))
650 $(eval $(call BuildModule,snmp,SNMP,+PACKAGE_php7-mod-snmp:libnetsnmp +PACKAGE_php7-mod-snmp:libopenssl))
651 $(eval $(call BuildModule,soap,SOAP,+@PHP7_LIBXML +PACKAGE_php7-mod-soap:libxml2))
652 $(eval $(call BuildModule,sockets,Sockets))
653 $(eval $(call BuildModule,sqlite3,SQLite3,+PACKAGE_php7-mod-sqlite3:libsqlite3))
654 $(eval $(call BuildModule,sysvmsg,System V messages))
655 $(eval $(call BuildModule,sysvsem,System V shared memory))
656 $(eval $(call BuildModule,sysvshm,System V semaphore))
657 $(eval $(call BuildModule,tokenizer,Tokenizer))
658 $(eval $(call BuildModule,xml,XML,+PHP7_LIBXML:libxml2 +!PHP7_LIBXML:libexpat))
659 $(eval $(call BuildModule,xmlreader,XMLReader,+@PHP7_LIBXML +PACKAGE_php7-mod-xmlreader:libxml2))
660 $(eval $(call BuildModule,xmlwriter,XMLWriter,+@PHP7_LIBXML +PACKAGE_php7-mod-xmlwriter:libxml2))
661 $(eval $(call BuildModule,zip,ZIP,+PACKAGE_php7-mod-zip:zlib))