You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

633 lines
18 KiB

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