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.

659 lines
19 KiB

php7: use mysqlnd This is in anticipation of the MariaDB upgrade from mariadb 10.1.x to 10.2.x. With the latter the PHP MySQL plugins fail to compile, e.g.: In file included from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/php_mysqli_structs.h:63:0, from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/mysqli.c:34: /home/equeiroz/src/openwrt-asus/staging_dir/target-mipsel_74kc_musl/usr/include/mysql/my_global.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp] #warning This file should not be included by clients, include only <mysql.h> ^~~~~~~ In file included from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/php_mysqli_structs.h:79:0, from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/mysqli.c:34: /home/equeiroz/src/openwrt-asus/staging_dir/target-mipsel_74kc_musl/usr/include/mysql/my_sys.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp] #warning This file should not be included by clients, include only <mysql.h> ^~~~~~~ In file included from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/mysqli.c:34:0: /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/php_mysqli_structs.h:82:10: fatal error: my_list.h: No such file or directory #include <my_list.h> Upstream seems unlikely to fix this, see https://bugs.php.net/bug.php?id=75612. In the bug report it is suggested to not use libmysqlclient/libmariadbclient and instead utilize mysqlnd (MySQL Native Driver) provided by PHP. This is the default anyway. So add the mysqlnd module and remove the libmariadbclient depends. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
7 years ago
php7: use mysqlnd This is in anticipation of the MariaDB upgrade from mariadb 10.1.x to 10.2.x. With the latter the PHP MySQL plugins fail to compile, e.g.: In file included from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/php_mysqli_structs.h:63:0, from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/mysqli.c:34: /home/equeiroz/src/openwrt-asus/staging_dir/target-mipsel_74kc_musl/usr/include/mysql/my_global.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp] #warning This file should not be included by clients, include only <mysql.h> ^~~~~~~ In file included from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/php_mysqli_structs.h:79:0, from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/mysqli.c:34: /home/equeiroz/src/openwrt-asus/staging_dir/target-mipsel_74kc_musl/usr/include/mysql/my_sys.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp] #warning This file should not be included by clients, include only <mysql.h> ^~~~~~~ In file included from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/mysqli.c:34:0: /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/php_mysqli_structs.h:82:10: fatal error: my_list.h: No such file or directory #include <my_list.h> Upstream seems unlikely to fix this, see https://bugs.php.net/bug.php?id=75612. In the bug report it is suggested to not use libmysqlclient/libmariadbclient and instead utilize mysqlnd (MySQL Native Driver) provided by PHP. This is the default anyway. So add the mysqlnd module and remove the libmariadbclient depends. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
7 years ago
php7: use mysqlnd This is in anticipation of the MariaDB upgrade from mariadb 10.1.x to 10.2.x. With the latter the PHP MySQL plugins fail to compile, e.g.: In file included from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/php_mysqli_structs.h:63:0, from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/mysqli.c:34: /home/equeiroz/src/openwrt-asus/staging_dir/target-mipsel_74kc_musl/usr/include/mysql/my_global.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp] #warning This file should not be included by clients, include only <mysql.h> ^~~~~~~ In file included from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/php_mysqli_structs.h:79:0, from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/mysqli.c:34: /home/equeiroz/src/openwrt-asus/staging_dir/target-mipsel_74kc_musl/usr/include/mysql/my_sys.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp] #warning This file should not be included by clients, include only <mysql.h> ^~~~~~~ In file included from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/mysqli.c:34:0: /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/php_mysqli_structs.h:82:10: fatal error: my_list.h: No such file or directory #include <my_list.h> Upstream seems unlikely to fix this, see https://bugs.php.net/bug.php?id=75612. In the bug report it is suggested to not use libmysqlclient/libmariadbclient and instead utilize mysqlnd (MySQL Native Driver) provided by PHP. This is the default anyway. So add the mysqlnd module and remove the libmariadbclient depends. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
7 years ago
php7: use mysqlnd This is in anticipation of the MariaDB upgrade from mariadb 10.1.x to 10.2.x. With the latter the PHP MySQL plugins fail to compile, e.g.: In file included from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/php_mysqli_structs.h:63:0, from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/mysqli.c:34: /home/equeiroz/src/openwrt-asus/staging_dir/target-mipsel_74kc_musl/usr/include/mysql/my_global.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp] #warning This file should not be included by clients, include only <mysql.h> ^~~~~~~ In file included from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/php_mysqli_structs.h:79:0, from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/mysqli.c:34: /home/equeiroz/src/openwrt-asus/staging_dir/target-mipsel_74kc_musl/usr/include/mysql/my_sys.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp] #warning This file should not be included by clients, include only <mysql.h> ^~~~~~~ In file included from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/mysqli.c:34:0: /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/php_mysqli_structs.h:82:10: fatal error: my_list.h: No such file or directory #include <my_list.h> Upstream seems unlikely to fix this, see https://bugs.php.net/bug.php?id=75612. In the bug report it is suggested to not use libmysqlclient/libmariadbclient and instead utilize mysqlnd (MySQL Native Driver) provided by PHP. This is the default anyway. So add the mysqlnd module and remove the libmariadbclient depends. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
7 years ago
php7: use mysqlnd This is in anticipation of the MariaDB upgrade from mariadb 10.1.x to 10.2.x. With the latter the PHP MySQL plugins fail to compile, e.g.: In file included from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/php_mysqli_structs.h:63:0, from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/mysqli.c:34: /home/equeiroz/src/openwrt-asus/staging_dir/target-mipsel_74kc_musl/usr/include/mysql/my_global.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp] #warning This file should not be included by clients, include only <mysql.h> ^~~~~~~ In file included from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/php_mysqli_structs.h:79:0, from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/mysqli.c:34: /home/equeiroz/src/openwrt-asus/staging_dir/target-mipsel_74kc_musl/usr/include/mysql/my_sys.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp] #warning This file should not be included by clients, include only <mysql.h> ^~~~~~~ In file included from /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/mysqli.c:34:0: /home/equeiroz/src/openwrt-asus/build_dir/target-mipsel_74kc_musl/php-7.2.6/ext/mysqli/php_mysqli_structs.h:82:10: fatal error: my_list.h: No such file or directory #include <my_list.h> Upstream seems unlikely to fix this, see https://bugs.php.net/bug.php?id=75612. In the bug report it is suggested to not use libmysqlclient/libmariadbclient and instead utilize mysqlnd (MySQL Native Driver) provided by PHP. This is the default anyway. So add the mysqlnd module and remove the libmariadbclient depends. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
7 years ago
  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.4.23
  8. PKG_RELEASE:=2
  9. PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
  10. PKG_LICENSE:=PHP-3.01
  11. PKG_LICENSE_FILES:=LICENSE
  12. PKG_CPE_ID:=cpe:/a:php:php
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  14. PKG_SOURCE_URL:=http://www.php.net/distributions/
  15. PKG_HASH:=cea52313fcffe56343bcd3c66dbb23cd5507dc559cc2e3547cf8f5452e88a05d
  16. PKG_BUILD_PARALLEL:=1
  17. PKG_USE_MIPS16:=0
  18. PHP7_MODULES= \
  19. bcmath \
  20. calendar ctype curl \
  21. dom \
  22. exif \
  23. fileinfo filter ftp \
  24. gettext gd gmp \
  25. iconv imap intl \
  26. json \
  27. ldap \
  28. mbstring mysqli mysqlnd \
  29. opcache openssl \
  30. pcntl pdo pdo-mysql pdo-pgsql pdo-sqlite pgsql phar \
  31. session shmop simplexml snmp soap sockets sqlite3 sysvmsg sysvsem sysvshm \
  32. tokenizer \
  33. xml xmlreader xmlwriter \
  34. zip
  35. PKG_CONFIG_DEPENDS:= \
  36. $(patsubst %,CONFIG_PACKAGE_php7-mod-%,$(PHP7_MODULES)) \
  37. CONFIG_PHP7_LIBXML CONFIG_PHP7_SYSTEMTZDATA
  38. include $(INCLUDE_DIR)/package.mk
  39. include $(INCLUDE_DIR)/nls.mk
  40. define Package/php7/Default
  41. SUBMENU:=PHP7
  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_LIBXML
  54. bool "PHP7 LIBXML support"
  55. depends on PACKAGE_php7-cli || PACKAGE_php7-cgi
  56. config PHP7_SYSTEMTZDATA
  57. bool "Use system timezone data instead of php's built-in database"
  58. depends on PACKAGE_php7-cli || PACKAGE_php7-cgi
  59. default y
  60. help
  61. Enabling this feature automatically selects the zoneinfo-core package
  62. which contains data for UTC timezone. To use other timezones you have
  63. to install the corresponding zoneinfo-... package(s).
  64. endef
  65. define Package/php7
  66. $(call Package/php7/Default)
  67. DEPENDS:=+libpcre2 +zlib \
  68. +PHP7_LIBXML:libxml2 \
  69. +PHP7_SYSTEMTZDATA:zoneinfo-core
  70. endef
  71. define Package/php7/description
  72. $(call Package/php7/Default/description)
  73. This package contains only the PHP config file. You must actually choose
  74. your PHP flavour (cli, cgi or fastcgi).
  75. Please note, that installing php5 and php7 in parallel on the same target
  76. is not supported in OpenWrt/LEDE.
  77. endef
  78. define Package/php7-cli
  79. $(call Package/php7/Default)
  80. DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp
  81. TITLE+= (CLI)
  82. endef
  83. define Package/php7-cli/description
  84. $(call Package/php7/Default/description)
  85. This package contains the CLI version of the PHP7 interpreter.
  86. endef
  87. define Package/php7-cgi
  88. $(call Package/php7/Default)
  89. DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp
  90. TITLE+= (CGI & FastCGI)
  91. endef
  92. define Package/php7-cgi/description
  93. $(call Package/php7/Default/description)
  94. This package contains the CGI version of the PHP7 interpreter.
  95. endef
  96. define Package/php7-fastcgi
  97. $(call Package/php7/Default)
  98. DEPENDS+= +php7-cgi
  99. TITLE:=FastCGI startup script
  100. endef
  101. define Package/php7-fastcgi/description
  102. As FastCGI support is now a core feature the php7-fastcgi package now depends
  103. on the php7-cgi package, containing just the startup script.
  104. endef
  105. define Package/php7-fpm
  106. $(call Package/php7/Default)
  107. DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp
  108. TITLE+= (FPM)
  109. endef
  110. define Package/php7-fpm/description
  111. $(call Package/php7/Default/description)
  112. This package contains the FastCGI Process Manager of the PHP7 interpreter.
  113. endef
  114. define Package/php7-mod-intl/config
  115. config PHP7_FULLICUDATA
  116. bool "Add dependency to full ICU Data"
  117. depends on PACKAGE_php7-mod-intl
  118. default n
  119. endef
  120. define Package/php7-mod-intl/description
  121. Note that this package depends in ICU library which is built without data
  122. by default. This is to satisfy programs build and run dependencies but to
  123. keep the installed footprint small on the target system(s).
  124. However, the data is required to make the ICU library useful - and thus
  125. directly affects PHPs ICU extension, too - so consider to also
  126. select/install package 'icu-full-data'.
  127. endef
  128. # not everything groks --disable-nls
  129. DISABLE_NLS:=
  130. CONFIGURE_ARGS+= \
  131. --enable-cli \
  132. --enable-cgi \
  133. --enable-fpm \
  134. --enable-shared \
  135. --disable-static \
  136. --with-pic \
  137. --disable-rpath \
  138. --disable-debug \
  139. --disable-phpdbg \
  140. --without-pear \
  141. \
  142. --with-config-file-path=/etc \
  143. --with-config-file-scan-dir=/etc/php7 \
  144. --disable-short-tags \
  145. \
  146. --without-valgrind \
  147. --with-external-pcre \
  148. --with-zlib="$(STAGING_DIR)/usr"
  149. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-bcmath),)
  150. CONFIGURE_ARGS+= --enable-bcmath=shared
  151. else
  152. CONFIGURE_ARGS+= --disable-bcmath
  153. endif
  154. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-calendar),)
  155. CONFIGURE_ARGS+= --enable-calendar=shared
  156. else
  157. CONFIGURE_ARGS+= --disable-calendar
  158. endif
  159. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ctype),)
  160. CONFIGURE_ARGS+= --enable-ctype=shared
  161. else
  162. CONFIGURE_ARGS+= --disable-ctype
  163. endif
  164. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-curl),)
  165. CONFIGURE_ARGS+= --with-curl=shared
  166. else
  167. CONFIGURE_ARGS+= --without-curl
  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-fileinfo),)
  180. CONFIGURE_ARGS+= --enable-fileinfo=shared,"$(STAGING_DIR)/usr"
  181. else
  182. CONFIGURE_ARGS+= --disable-fileinfo
  183. endif
  184. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-filter),)
  185. CONFIGURE_ARGS+= --enable-filter=shared,"$(STAGING_DIR)/usr"
  186. else
  187. CONFIGURE_ARGS+= --disable-filter
  188. endif
  189. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ftp),)
  190. CONFIGURE_ARGS+= --enable-ftp=shared
  191. else
  192. CONFIGURE_ARGS+= --disable-ftp
  193. endif
  194. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gd),)
  195. CONFIGURE_ARGS+= \
  196. --enable-gd=shared,"$(STAGING_DIR)/usr" \
  197. --with-external-gd
  198. else
  199. CONFIGURE_ARGS+= --disable-gd
  200. endif
  201. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gettext),)
  202. CONFIGURE_ARGS+= --with-gettext=shared,"$(STAGING_DIR)/usr/lib/libintl-full"
  203. else
  204. CONFIGURE_ARGS+= --without-gettext
  205. endif
  206. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gmp),)
  207. CONFIGURE_ARGS+= --with-gmp=shared,"$(STAGING_DIR)/usr"
  208. else
  209. CONFIGURE_ARGS+= --without-gmp
  210. endif
  211. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-iconv),)
  212. CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)"
  213. else
  214. CONFIGURE_ARGS+= --without-iconv
  215. endif
  216. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-imap),)
  217. CONFIGURE_ARGS+= \
  218. --with-imap=shared,"$(STAGING_DIR)/usr" \
  219. --with-kerberos=no \
  220. --with-imap-ssl="$(STAGING_DIR)/usr"
  221. else
  222. CONFIGURE_ARGS+= --without-imap
  223. endif
  224. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-intl),)
  225. CONFIGURE_ARGS+= --enable-intl=shared
  226. TARGET_CXXFLAGS+= -std=c++0x
  227. else
  228. CONFIGURE_ARGS+= --disable-intl
  229. endif
  230. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-json),)
  231. CONFIGURE_ARGS+= --enable-json=shared
  232. else
  233. CONFIGURE_ARGS+= --disable-json
  234. endif
  235. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ldap),)
  236. CONFIGURE_ARGS+= \
  237. --with-ldap=shared,"$(STAGING_DIR)/usr" \
  238. --with-ldap-sasl
  239. else
  240. CONFIGURE_ARGS+= --without-ldap
  241. endif
  242. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mbstring),)
  243. CONFIGURE_ARGS+= \
  244. --enable-mbstring=shared \
  245. --enable-mbregex
  246. else
  247. CONFIGURE_ARGS+= --disable-mbstring
  248. endif
  249. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mysqli),)
  250. CONFIGURE_ARGS+= --with-mysqli=shared
  251. else
  252. CONFIGURE_ARGS+= --without-mysqli
  253. endif
  254. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mysqlnd),)
  255. CONFIGURE_ARGS+= --enable-mysqlnd=shared
  256. else
  257. CONFIGURE_ARGS+= --disable-mysqlnd
  258. endif
  259. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-opcache),)
  260. CONFIGURE_ARGS+= --enable-opcache=shared
  261. else
  262. CONFIGURE_ARGS+= --disable-opcache
  263. endif
  264. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-openssl)$(CONFIG_PACKAGE_php7-mod-ftp)$(CONFIG_PACKAGE_php7-mod-imap)$(CONFIG_PACKAGE_php7-mod-snmp),)
  265. CONFIGURE_ARGS+= \
  266. --with-openssl=shared \
  267. --with-kerberos=no \
  268. --with-openssl-dir="$(STAGING_DIR)/usr"
  269. else
  270. CONFIGURE_ARGS+= --without-openssl
  271. endif
  272. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pcntl),)
  273. CONFIGURE_ARGS+= --enable-pcntl=shared
  274. else
  275. CONFIGURE_ARGS+= --disable-pcntl
  276. endif
  277. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo),)
  278. CONFIGURE_ARGS+= --enable-pdo=shared
  279. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-mysql),)
  280. CONFIGURE_ARGS+= --with-pdo-mysql=shared
  281. else
  282. CONFIGURE_ARGS+= --without-pdo-mysql
  283. endif
  284. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-pgsql),)
  285. CONFIGURE_ARGS+= --with-pdo-pgsql=shared,"$(STAGING_DIR)/usr"
  286. else
  287. CONFIGURE_ARGS+= --without-pdo-pgsql
  288. endif
  289. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-sqlite),)
  290. CONFIGURE_ARGS+= --with-pdo-sqlite=shared
  291. else
  292. CONFIGURE_ARGS+= --without-pdo-sqlite
  293. endif
  294. else
  295. CONFIGURE_ARGS+= --disable-pdo
  296. endif
  297. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pgsql),)
  298. CONFIGURE_ARGS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
  299. else
  300. CONFIGURE_ARGS+= --without-pgsql
  301. endif
  302. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-phar),)
  303. CONFIGURE_ARGS+= --enable-phar=shared
  304. else
  305. CONFIGURE_ARGS+= --disable-phar
  306. endif
  307. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-session),)
  308. CONFIGURE_ARGS+= --enable-session=shared
  309. else
  310. CONFIGURE_ARGS+= --disable-session
  311. endif
  312. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-shmop),)
  313. CONFIGURE_ARGS+= --enable-shmop=shared
  314. else
  315. CONFIGURE_ARGS+= --disable-shmop
  316. endif
  317. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-simplexml),)
  318. CONFIGURE_ARGS+= --enable-simplexml=shared
  319. else
  320. CONFIGURE_ARGS+= --disable-simplexml
  321. endif
  322. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-snmp),)
  323. CONFIGURE_ARGS+= --with-snmp=shared,"$(STAGING_DIR)/usr"
  324. else
  325. CONFIGURE_ARGS+= --without-snmp
  326. endif
  327. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-soap),)
  328. CONFIGURE_ARGS+= --enable-soap=shared
  329. else
  330. CONFIGURE_ARGS+= --disable-soap
  331. endif
  332. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sockets),)
  333. CONFIGURE_ARGS+= --enable-sockets=shared
  334. else
  335. CONFIGURE_ARGS+= --disable-sockets
  336. endif
  337. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sqlite3),)
  338. CONFIGURE_ARGS+= --with-sqlite3=shared
  339. else
  340. CONFIGURE_ARGS+= --without-sqlite3
  341. endif
  342. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvmsg),)
  343. CONFIGURE_ARGS+= --enable-sysvmsg=shared
  344. else
  345. CONFIGURE_ARGS+= --disable-sysvmsg
  346. endif
  347. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvsem),)
  348. CONFIGURE_ARGS+= --enable-sysvsem=shared
  349. else
  350. CONFIGURE_ARGS+= --disable-sysvsem
  351. endif
  352. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvshm),)
  353. CONFIGURE_ARGS+= --enable-sysvshm=shared
  354. else
  355. CONFIGURE_ARGS+= --disable-sysvshm
  356. endif
  357. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-tokenizer),)
  358. CONFIGURE_ARGS+= --enable-tokenizer=shared
  359. else
  360. CONFIGURE_ARGS+= --disable-tokenizer
  361. endif
  362. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xml),)
  363. CONFIGURE_ARGS+= --enable-xml=shared,"$(STAGING_DIR)/usr"
  364. ifneq ($(CONFIG_PHP7_LIBXML),y)
  365. CONFIGURE_ARGS+= --with-expat
  366. endif
  367. else
  368. CONFIGURE_ARGS+= --disable-xml
  369. endif
  370. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xmlreader),)
  371. CONFIGURE_ARGS+= --enable-xmlreader=shared,"$(STAGING_DIR)/usr"
  372. else
  373. CONFIGURE_ARGS+= --disable-xmlreader
  374. endif
  375. ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xmlwriter),)
  376. CONFIGURE_ARGS+= --enable-xmlwriter=shared,"$(STAGING_DIR)/usr"
  377. else
  378. CONFIGURE_ARGS+= --disable-xmlwriter
  379. endif
  380. ifneq ($(CONFIG_PACKAGE_php7-mod-zip),)
  381. CONFIGURE_ARGS+= --with-zip=shared,"$(STAGING_DIR)/usr"
  382. else
  383. CONFIGURE_ARGS+= --without-zip
  384. endif
  385. ifneq ($(SDK)$(CONFIG_PHP7_LIBXML),)
  386. CONFIGURE_ARGS+= --with-libxml
  387. else
  388. CONFIGURE_ARGS+= --without-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_have_pcre2_jit=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-fastcgi/conffiles
  426. /etc/config/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 Package/php7-mod-openssl/postinst
  446. #!/bin/sh
  447. [ -n "$$IPKG_INSTROOT" ] || {
  448. if [ -e "/etc/php7/20_openssl.ini" ] && [ -e "/etc/php7/15_openssl.ini" ]; then
  449. echo "Renaming PHP ini file '/etc/php7/20_openssl.ini' -> '/etc/php7/15_openssl.ini'"
  450. mv /etc/php7/20_openssl.ini /etc/php7/15_openssl.ini
  451. fi
  452. }
  453. endef
  454. define Package/php7-mod-mysqli/postinst
  455. #!/bin/sh
  456. [ -n "$$IPKG_INSTROOT" ] || {
  457. if [ -e "/etc/php7/20_mysqli.ini" ] && [ -e "/etc/php7/30_mysqli.ini" ]; then
  458. echo "Renaming PHP ini file '/etc/php7/20_mysqli.ini' -> '/etc/php7/30_mysqli.ini'"
  459. mv /etc/php7/20_mysqli.ini /etc/php7/30_mysqli.ini
  460. fi
  461. }
  462. endef
  463. define Build/Prepare
  464. $(call Build/Prepare/Default)
  465. $(if $(QUILT),,( cd $(PKG_BUILD_DIR); touch configure.ac; ./buildconf --force ))
  466. endef
  467. define Build/Configure
  468. $(if $(QUILT),( cd $(PKG_BUILD_DIR); touch configure.ac; ./buildconf --force ))
  469. $(call Build/Configure/Default)
  470. endef
  471. define Build/InstallDev
  472. rm -rf $(PKG_BUILD_DIR)/staging
  473. make -C $(PKG_BUILD_DIR) install INSTALL_ROOT=$(PKG_BUILD_DIR)/staging
  474. rm -rf $(PKG_BUILD_DIR)/staging/usr/{share,man,sbin}
  475. rm -f $(PKG_BUILD_DIR)/staging/usr/bin/{php,php-cgi,php-cli}
  476. mv $(PKG_BUILD_DIR)/staging/usr/bin/phpize $(PKG_BUILD_DIR)/staging/usr/bin/phpize7
  477. mv $(PKG_BUILD_DIR)/staging/usr/bin/php-config $(PKG_BUILD_DIR)/staging/usr/bin/php7-config
  478. mv $(PKG_BUILD_DIR)/staging/usr/include/php $(PKG_BUILD_DIR)/staging/usr/include/php7
  479. mv $(PKG_BUILD_DIR)/staging/usr/lib/php $(PKG_BUILD_DIR)/staging/usr/lib/php7
  480. $(CP) $(PKG_BUILD_DIR)/staging/usr $(STAGING_DIR)/
  481. sed -i -e "s#prefix='/usr'#prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize7
  482. sed -i -e "s#exec_prefix=\"\`eval echo /usr\`\"#exec_prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize7
  483. sed -i -e "s#/include\`/php\"#/include\`/php7\"#" $(STAGING_DIR)/usr/bin/phpize7
  484. sed -i -e "s#/lib/php\`/build\"#/lib/php7\`/build\"#" $(STAGING_DIR)/usr/bin/phpize7
  485. sed -i -e "s#prefix=\"/usr\"#prefix=\"$(STAGING_DIR)/usr\"#" $(STAGING_DIR)/usr/bin/php7-config
  486. sed -i -e "s#/include/php\"#/include/php7\"#" $(STAGING_DIR)/usr/bin/php7-config
  487. endef
  488. define BuildModule
  489. define Package/php7-mod-$(1)
  490. $(call Package/php7/Default)
  491. ifneq ($(3),)
  492. DEPENDS+=$(3)
  493. endif
  494. TITLE:=$(2) shared module
  495. endef
  496. define Package/php7-mod-$(1)/install
  497. $(INSTALL_DIR) $$(1)/usr/lib/php
  498. $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/
  499. $(INSTALL_DIR) $$(1)/etc/php7
  500. ifeq ($(5),zend)
  501. echo "zend_extension=/usr/lib/php/$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
  502. else
  503. echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
  504. endif
  505. endef
  506. $$(eval $$(call BuildPackage,php7-mod-$(1)))
  507. endef
  508. $(eval $(call BuildPackage,php7))
  509. $(eval $(call BuildPackage,php7-cgi))
  510. $(eval $(call BuildPackage,php7-cli))
  511. $(eval $(call BuildPackage,php7-fastcgi))
  512. $(eval $(call BuildPackage,php7-fpm))
  513. #$(eval $(call BuildModule,NAME,TITLE[,PKG DEPENDS]))
  514. $(eval $(call BuildModule,bcmath,Bcmath))
  515. $(eval $(call BuildModule,calendar,Calendar))
  516. $(eval $(call BuildModule,ctype,Ctype))
  517. $(eval $(call BuildModule,curl,cURL,+PACKAGE_php7-mod-curl:libcurl))
  518. $(eval $(call BuildModule,dom,DOM,+@PHP7_LIBXML +PACKAGE_php7-mod-dom:libxml2))
  519. $(eval $(call BuildModule,exif,EXIF))
  520. $(eval $(call BuildModule,fileinfo,Fileinfo))
  521. $(eval $(call BuildModule,filter,Filter))
  522. $(eval $(call BuildModule,ftp,FTP,+PACKAGE_php7-mod-ftp:libopenssl))
  523. $(eval $(call BuildModule,gd,GD graphics,+PACKAGE_php7-mod-gd:libgd-full))
  524. $(eval $(call BuildModule,gettext,Gettext,+PACKAGE_php7-mod-gettext:libintl-full))
  525. $(eval $(call BuildModule,gmp,GMP,+PACKAGE_php7-mod-gmp:libgmp))
  526. $(eval $(call BuildModule,iconv,iConv,$(ICONV_DEPENDS)))
  527. $(eval $(call BuildModule,imap,IMAP,+PACKAGE_php7-mod-imap:libopenssl +PACKAGE_libpam:libpam +PACKAGE_php7-mod-imap:uw-imap))
  528. $(eval $(call BuildModule,intl,Internationalization Functions,+PACKAGE_php7-mod-intl:icu +PHP7_FULLICUDATA:icu-full-data))
  529. $(eval $(call BuildModule,json,JSON))
  530. $(eval $(call BuildModule,ldap,LDAP,+PACKAGE_php7-mod-ldap:libopenldap +PACKAGE_php7-mod-ldap:libsasl2))
  531. $(eval $(call BuildModule,mbstring,MBString,+PACKAGE_php7-mod-mbstring:oniguruma))
  532. $(eval $(call BuildModule,mysqli,MySQL Improved Extension,+PACKAGE_php7-mod-mysqli:php7-mod-mysqlnd,30))
  533. $(eval $(call BuildModule,mysqlnd,MySQL Native Driver,+PACKAGE_php7-mod-openssl:php7-mod-openssl))
  534. $(eval $(call BuildModule,opcache,OPcache,,,zend))
  535. $(eval $(call BuildModule,openssl,OpenSSL,+PACKAGE_php7-mod-openssl:libopenssl,15))
  536. $(eval $(call BuildModule,pcntl,PCNTL))
  537. $(eval $(call BuildModule,pdo,PHP Data Objects))
  538. $(eval $(call BuildModule,pdo-mysql,PDO driver for MySQL,+php7-mod-pdo +PACKAGE_php7-mod-pdo-mysql:php7-mod-mysqlnd))
  539. $(eval $(call BuildModule,pdo-pgsql,PDO driver for PostgreSQL,+php7-mod-pdo +PACKAGE_php7-mod-pdo-pgsql:libpq))
  540. $(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))
  541. $(eval $(call BuildModule,pgsql,PostgreSQL,+PACKAGE_php7-mod-pgsql:libpq))
  542. $(eval $(call BuildModule,phar,Phar Archives))
  543. $(eval $(call BuildModule,session,Session))
  544. $(eval $(call BuildModule,shmop,Shared Memory))
  545. $(eval $(call BuildModule,simplexml,SimpleXML,+@PHP7_LIBXML +PACKAGE_php7-mod-simplexml:libxml2))
  546. $(eval $(call BuildModule,snmp,SNMP,+PACKAGE_php7-mod-snmp:libnetsnmp +PACKAGE_php7-mod-snmp:libopenssl))
  547. $(eval $(call BuildModule,soap,SOAP,+@PHP7_LIBXML +PACKAGE_php7-mod-soap:libxml2))
  548. $(eval $(call BuildModule,sockets,Sockets))
  549. $(eval $(call BuildModule,sqlite3,SQLite3,+PACKAGE_php7-mod-sqlite3:libsqlite3))
  550. $(eval $(call BuildModule,sysvmsg,System V messages))
  551. $(eval $(call BuildModule,sysvsem,System V shared memory))
  552. $(eval $(call BuildModule,sysvshm,System V semaphore))
  553. $(eval $(call BuildModule,tokenizer,Tokenizer))
  554. $(eval $(call BuildModule,xml,XML,+PHP7_LIBXML:libxml2 +!PHP7_LIBXML:libexpat))
  555. $(eval $(call BuildModule,xmlreader,XMLReader,+@PHP7_LIBXML +PACKAGE_php7-mod-dom:php7-mod-dom +PACKAGE_php7-mod-xmlreader:libxml2))
  556. $(eval $(call BuildModule,xmlwriter,XMLWriter,+@PHP7_LIBXML +PACKAGE_php7-mod-xmlwriter:libxml2))
  557. $(eval $(call BuildModule,zip,ZIP,+PACKAGE_php7-mod-zip:libzip))