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.

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