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.

627 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.2.1
  8. PKG_RELEASE:=1
  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:=6c6cf82fda6660ed963821eb0525214bb3547e8e29f447b9c15b2d8e6efd8822
  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 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-mysqli),)
  246. CONFIGURE_ARGS+= --with-mysqli=shared,"$(STAGING_DIR)/usr/bin/mysql_config"
  247. else
  248. CONFIGURE_ARGS+= --without-mysqli
  249. endif
  250. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-opcache),)
  251. CONFIGURE_ARGS+= --enable-opcache=shared
  252. else
  253. CONFIGURE_ARGS+= --disable-opcache
  254. endif
  255. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-openssl)$(CONFIG_PACKAGE_php7-mod-ftp)$(CONFIG_PACKAGE_php7-mod-imap)$(CONFIG_PACKAGE_php7-mod-snmp),)
  256. CONFIGURE_ARGS+= \
  257. --with-openssl=shared,"$(STAGING_DIR)/usr" \
  258. --with-kerberos=no \
  259. --with-openssl-dir="$(STAGING_DIR)/usr"
  260. else
  261. CONFIGURE_ARGS+= --without-openssl
  262. endif
  263. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pcntl),)
  264. CONFIGURE_ARGS+= --enable-pcntl=shared
  265. else
  266. CONFIGURE_ARGS+= --disable-pcntl
  267. endif
  268. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo),)
  269. CONFIGURE_ARGS+= --enable-pdo=shared
  270. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-mysql),)
  271. CONFIGURE_ARGS+= --with-pdo-mysql=shared,"$(STAGING_DIR)/usr"
  272. else
  273. CONFIGURE_ARGS+= --without-pdo-mysql
  274. endif
  275. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-pgsql),)
  276. CONFIGURE_ARGS+= --with-pdo-pgsql=shared,"$(STAGING_DIR)/usr"
  277. else
  278. CONFIGURE_ARGS+= --without-pdo-pgsql
  279. endif
  280. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-sqlite),)
  281. CONFIGURE_ARGS+= --with-pdo-sqlite=shared,"$(STAGING_DIR)/usr"
  282. else
  283. CONFIGURE_ARGS+= --without-pdo-sqlite
  284. endif
  285. else
  286. CONFIGURE_ARGS+= --disable-pdo
  287. endif
  288. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pgsql),)
  289. CONFIGURE_ARGS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
  290. else
  291. CONFIGURE_ARGS+= --without-pgsql
  292. endif
  293. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-phar),)
  294. CONFIGURE_ARGS+= --enable-phar=shared
  295. else
  296. CONFIGURE_ARGS+= --disable-phar
  297. endif
  298. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-session),)
  299. CONFIGURE_ARGS+= --enable-session=shared
  300. else
  301. CONFIGURE_ARGS+= --disable-session
  302. endif
  303. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-shmop),)
  304. CONFIGURE_ARGS+= --enable-shmop=shared
  305. else
  306. CONFIGURE_ARGS+= --disable-shmop
  307. endif
  308. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-simplexml),)
  309. CONFIGURE_ARGS+= --enable-simplexml=shared
  310. else
  311. CONFIGURE_ARGS+= --disable-simplexml
  312. endif
  313. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-snmp),)
  314. CONFIGURE_ARGS+= --with-snmp=shared,"$(STAGING_DIR)/usr"
  315. else
  316. CONFIGURE_ARGS+= --without-snmp
  317. endif
  318. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-soap),)
  319. CONFIGURE_ARGS+= --enable-soap=shared
  320. else
  321. CONFIGURE_ARGS+= --disable-soap
  322. endif
  323. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sockets),)
  324. CONFIGURE_ARGS+= --enable-sockets=shared
  325. else
  326. CONFIGURE_ARGS+= --disable-sockets
  327. endif
  328. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sqlite3),)
  329. CONFIGURE_ARGS+= --with-sqlite3=shared,"$(STAGING_DIR)/usr"
  330. else
  331. CONFIGURE_ARGS+= --without-sqlite3
  332. endif
  333. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvmsg),)
  334. CONFIGURE_ARGS+= --enable-sysvmsg=shared
  335. else
  336. CONFIGURE_ARGS+= --disable-sysvmsg
  337. endif
  338. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvsem),)
  339. CONFIGURE_ARGS+= --enable-sysvsem=shared
  340. else
  341. CONFIGURE_ARGS+= --disable-sysvsem
  342. endif
  343. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvshm),)
  344. CONFIGURE_ARGS+= --enable-sysvshm=shared
  345. else
  346. CONFIGURE_ARGS+= --disable-sysvshm
  347. endif
  348. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-tokenizer),)
  349. CONFIGURE_ARGS+= --enable-tokenizer=shared
  350. else
  351. CONFIGURE_ARGS+= --disable-tokenizer
  352. endif
  353. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xml),)
  354. CONFIGURE_ARGS+= --enable-xml=shared,"$(STAGING_DIR)/usr"
  355. ifneq ($(CONFIG_PHP7_LIBXML),)
  356. CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
  357. else
  358. CONFIGURE_ARGS+= --with-libexpat-dir="$(STAGING_DIR)/usr"
  359. endif
  360. else
  361. CONFIGURE_ARGS+= --disable-xml
  362. endif
  363. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xmlreader),)
  364. CONFIGURE_ARGS+= --enable-xmlreader=shared,"$(STAGING_DIR)/usr"
  365. else
  366. CONFIGURE_ARGS+= --disable-xmlreader
  367. endif
  368. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xmlwriter),)
  369. CONFIGURE_ARGS+= --enable-xmlwriter=shared,"$(STAGING_DIR)/usr"
  370. else
  371. CONFIGURE_ARGS+= --disable-xmlwriter
  372. endif
  373. ifneq ($(CONFIG_PACKAGE_php7-mod-zip),)
  374. CONFIGURE_ARGS+= --enable-zip=shared
  375. else
  376. CONFIGURE_ARGS+= --disable-zip
  377. endif
  378. ifneq ($(SDK)$(CONFIG_PHP7_FILTER),)
  379. CONFIGURE_ARGS+= --enable-filter
  380. else
  381. CONFIGURE_ARGS+= --disable-filter
  382. endif
  383. ifneq ($(SDK)$(CONFIG_PHP7_LIBXML),)
  384. CONFIGURE_ARGS+= --enable-libxml
  385. CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
  386. else
  387. CONFIGURE_ARGS+= --disable-libxml
  388. endif
  389. ifneq ($(CONFIG_PHP7_SYSTEMTZDATA),)
  390. CONFIGURE_ARGS+= --with-system-tzdata
  391. else
  392. CONFIGURE_ARGS+= --without-system-tzdata
  393. endif
  394. CONFIGURE_VARS+= \
  395. ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no) \
  396. php_cv_cc_rpath="no" \
  397. iconv_impl_name="gnu_libiconv" \
  398. ac_cv_php_xml2_config_path="$(STAGING_DIR)/host/bin/xml2-config" \
  399. ac_cv_u8t_decompose=yes \
  400. ac_cv_enable_valgrind_check=no \
  401. define Package/php7/conffiles
  402. /etc/php.ini
  403. /etc/php7/
  404. endef
  405. define Package/php7/install
  406. $(INSTALL_DIR) $(1)/etc
  407. $(INSTALL_DATA) ./files/php.ini $(1)/etc/
  408. endef
  409. define Package/php7-cli/install
  410. $(INSTALL_DIR) $(1)/usr/bin
  411. $(CP) $(PKG_BUILD_DIR)/sapi/cli/php $(1)/usr/bin/php-cli
  412. endef
  413. define Package/php7-cgi/install
  414. $(INSTALL_DIR) $(1)/usr/bin
  415. $(CP) $(PKG_BUILD_DIR)/sapi/cgi/php-cgi $(1)/usr/bin/php-cgi
  416. ln -sf php-cgi $(1)/usr/bin/php-fcgi
  417. endef
  418. define Package/php7-fastcgi/install
  419. $(INSTALL_DIR) $(1)/etc/config
  420. $(INSTALL_DATA) ./files/php7-fastcgi.config $(1)/etc/config/php7-fastcgi
  421. $(INSTALL_DIR) $(1)/etc/init.d
  422. $(INSTALL_BIN) ./files/php7-fastcgi.init $(1)/etc/init.d/php7-fastcgi
  423. endef
  424. define Package/php7-fpm/install
  425. $(INSTALL_DIR) $(1)/usr/bin
  426. $(INSTALL_BIN) $(PKG_BUILD_DIR)/sapi/fpm/php-fpm $(1)/usr/bin/php-fpm
  427. $(INSTALL_DIR) $(1)/etc
  428. $(INSTALL_DATA) ./files/php7-fpm.conf $(1)/etc/php7-fpm.conf
  429. $(INSTALL_DIR) $(1)/etc/config
  430. $(INSTALL_DATA) ./files/php7-fpm.config $(1)/etc/config/php7-fpm
  431. $(INSTALL_DIR) $(1)/etc/php7-fpm.d
  432. $(INSTALL_DATA) ./files/php7-fpm-www.conf $(1)/etc/php7-fpm.d/www.conf
  433. $(INSTALL_DIR) $(1)/etc/init.d
  434. $(INSTALL_BIN) ./files/php7-fpm.init $(1)/etc/init.d/php7-fpm
  435. endef
  436. define Package/php7-fpm/conffiles
  437. /etc/php7-fpm.conf
  438. /etc/php7-fpm.d/
  439. /etc/config/php7-fpm
  440. endef
  441. define Build/Prepare
  442. $(call Build/Prepare/Default)
  443. ( cd $(PKG_BUILD_DIR); touch configure.in; ./buildconf --force )
  444. endef
  445. define Build/InstallDev
  446. rm -rf $(PKG_BUILD_DIR)/staging
  447. make -C $(PKG_BUILD_DIR) install INSTALL_ROOT=$(PKG_BUILD_DIR)/staging
  448. rm -rf $(PKG_BUILD_DIR)/staging/usr/{share,man,sbin}
  449. rm -f $(PKG_BUILD_DIR)/staging/usr/bin/{php,php-cgi,php-cli}
  450. mv $(PKG_BUILD_DIR)/staging/usr/bin/phpize $(PKG_BUILD_DIR)/staging/usr/bin/phpize7
  451. mv $(PKG_BUILD_DIR)/staging/usr/bin/php-config $(PKG_BUILD_DIR)/staging/usr/bin/php7-config
  452. mv $(PKG_BUILD_DIR)/staging/usr/include/php $(PKG_BUILD_DIR)/staging/usr/include/php7
  453. mv $(PKG_BUILD_DIR)/staging/usr/lib/php $(PKG_BUILD_DIR)/staging/usr/lib/php7
  454. $(CP) $(PKG_BUILD_DIR)/staging/usr $(STAGING_DIR)/
  455. sed -i -e "s#prefix='/usr'#prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize7
  456. sed -i -e "s#exec_prefix=\"\`eval echo /usr\`\"#exec_prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize7
  457. sed -i -e "s#/include\`/php\"#/include\`/php7\"#" $(STAGING_DIR)/usr/bin/phpize7
  458. sed -i -e "s#/lib/php\`/build\"#/lib/php7\`/build\"#" $(STAGING_DIR)/usr/bin/phpize7
  459. sed -i -e "s#prefix=\"/usr\"#prefix=\"$(STAGING_DIR)/usr\"#" $(STAGING_DIR)/usr/bin/php7-config
  460. sed -i -e "s#/include/php\"#/include/php7\"#" $(STAGING_DIR)/usr/bin/php7-config
  461. endef
  462. define BuildModule
  463. define Package/php7-mod-$(1)
  464. $(call Package/php7/Default)
  465. ifneq ($(3),)
  466. DEPENDS+=$(3)
  467. endif
  468. TITLE:=$(2) shared module
  469. endef
  470. define Package/php7-mod-$(1)/install
  471. $(INSTALL_DIR) $$(1)/usr/lib/php
  472. $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/
  473. $(INSTALL_DIR) $$(1)/etc/php7
  474. ifeq ($(5),zend)
  475. echo "zend_extension=/usr/lib/php/$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
  476. else
  477. echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
  478. endif
  479. endef
  480. $$(eval $$(call BuildPackage,php7-mod-$(1)))
  481. endef
  482. $(eval $(call BuildPackage,php7))
  483. $(eval $(call BuildPackage,php7-cgi))
  484. $(eval $(call BuildPackage,php7-cli))
  485. $(eval $(call BuildPackage,php7-fastcgi))
  486. $(eval $(call BuildPackage,php7-fpm))
  487. #$(eval $(call BuildModule,NAME,TITLE[,PKG DEPENDS]))
  488. $(eval $(call BuildModule,calendar,Calendar))
  489. $(eval $(call BuildModule,ctype,Ctype))
  490. $(eval $(call BuildModule,curl,cURL,+PACKAGE_php7-mod-curl:libcurl))
  491. $(eval $(call BuildModule,dom,DOM,+@PHP7_LIBXML +PACKAGE_php7-mod-dom:libxml2))
  492. $(eval $(call BuildModule,exif,EXIF))
  493. $(eval $(call BuildModule,fileinfo,Fileinfo))
  494. $(eval $(call BuildModule,ftp,FTP,+PACKAGE_php7-mod-ftp:libopenssl))
  495. $(eval $(call BuildModule,gd,GD graphics,+PACKAGE_php7-mod-gd:libjpeg +PACKAGE_php7-mod-gd:libpng +PHP7_LIBFREETYPE:libfreetype))
  496. $(eval $(call BuildModule,gettext,Gettext,+PACKAGE_php7-mod-gettext:libintl-full))
  497. $(eval $(call BuildModule,gmp,GMP,+PACKAGE_php7-mod-gmp:libgmp))
  498. $(eval $(call BuildModule,hash,Hash))
  499. $(eval $(call BuildModule,iconv,iConv,$(ICONV_DEPENDS)))
  500. $(eval $(call BuildModule,imap,IMAP,+PACKAGE_php7-mod-imap:libopenssl +PACKAGE_libpam:libpam +PACKAGE_php7-mod-imap:uw-imap))
  501. $(eval $(call BuildModule,intl,Internationalization Functions,+PACKAGE_php7-mod-intl:icu))
  502. $(eval $(call BuildModule,json,JSON))
  503. $(eval $(call BuildModule,ldap,LDAP,+PACKAGE_php7-mod-ldap:libopenldap +PACKAGE_php7-mod-ldap:libsasl2))
  504. $(eval $(call BuildModule,mbstring,MBString))
  505. $(eval $(call BuildModule,mysqli,MySQL Improved Extension,+PACKAGE_php7-mod-mysqli:libmysqlclient))
  506. $(eval $(call BuildModule,opcache,OPcache,,,zend))
  507. $(eval $(call BuildModule,openssl,OpenSSL,+PACKAGE_php7-mod-openssl:libopenssl))
  508. $(eval $(call BuildModule,pcntl,PCNTL))
  509. $(eval $(call BuildModule,pdo,PHP Data Objects))
  510. $(eval $(call BuildModule,pdo-mysql,PDO driver for MySQL,+php7-mod-pdo +PACKAGE_php7-mod-pdo-mysql:libmysqlclient))
  511. $(eval $(call BuildModule,pdo-pgsql,PDO driver for PostgreSQL,+php7-mod-pdo +PACKAGE_php7-mod-pdo-pgsql:libpq))
  512. $(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))
  513. $(eval $(call BuildModule,pgsql,PostgreSQL,+PACKAGE_php7-mod-pgsql:libpq))
  514. $(eval $(call BuildModule,phar,Phar Archives,+php7-mod-hash))
  515. $(eval $(call BuildModule,session,Session))
  516. $(eval $(call BuildModule,shmop,Shared Memory))
  517. $(eval $(call BuildModule,simplexml,SimpleXML,+@PHP7_LIBXML +PACKAGE_php7-mod-simplexml:libxml2))
  518. $(eval $(call BuildModule,snmp,SNMP,+PACKAGE_php7-mod-snmp:libnetsnmp +PACKAGE_php7-mod-snmp:libopenssl))
  519. $(eval $(call BuildModule,soap,SOAP,+@PHP7_LIBXML +PACKAGE_php7-mod-soap:libxml2))
  520. $(eval $(call BuildModule,sockets,Sockets))
  521. $(eval $(call BuildModule,sqlite3,SQLite3,+PACKAGE_php7-mod-sqlite3:libsqlite3))
  522. $(eval $(call BuildModule,sysvmsg,System V messages))
  523. $(eval $(call BuildModule,sysvsem,System V shared memory))
  524. $(eval $(call BuildModule,sysvshm,System V semaphore))
  525. $(eval $(call BuildModule,tokenizer,Tokenizer))
  526. $(eval $(call BuildModule,xml,XML,+PHP7_LIBXML:libxml2 +!PHP7_LIBXML:libexpat))
  527. $(eval $(call BuildModule,xmlreader,XMLReader,+@PHP7_LIBXML +PACKAGE_php7-mod-xmlreader:libxml2))
  528. $(eval $(call BuildModule,xmlwriter,XMLWriter,+@PHP7_LIBXML +PACKAGE_php7-mod-xmlwriter:libxml2))
  529. $(eval $(call BuildModule,zip,ZIP,+PACKAGE_php7-mod-zip:zlib))