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.

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