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.

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