update buildroot to 2017.02.11

This commit is contained in:
jbnadal
2018-05-22 15:35:47 +02:00
parent 4bf1f5e091
commit a3c10bd762
9257 changed files with 433426 additions and 1701 deletions

View File

@@ -0,0 +1,38 @@
From 7a4168062fbab2e33ef9a42bca9f87a5921afac2 Mon Sep 17 00:00:00 2001
From: Gustavo Zacarias <gustavo@zacarias.com.ar>
Date: Tue, 9 Aug 2016 11:49:56 +0200
Subject: [PATCH] acinclude.m4: don't unset variables
Unsetting ac_cv_{func,lib}_* is bad, you can't feed the configure cache.
Terminate them with extreme prejudice.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
acinclude.m4 | 4 ----
1 file changed, 4 deletions(-)
diff --git a/acinclude.m4 b/acinclude.m4
index 28506b6..af4aa06 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1898,8 +1898,6 @@ define([phpshift],[ifelse(index([$@],[,]),-1,,[substr([$@],incr(index([$@],[,]))
dnl
AC_DEFUN([PHP_CHECK_FUNC_LIB],[
ifelse($2,,:,[
- unset ac_cv_lib_$2[]_$1
- unset ac_cv_lib_$2[]___$1
unset found
AC_CHECK_LIB($2, $1, [found=yes], [
AC_CHECK_LIB($2, __$1, [found=yes], [found=no])
@@ -1931,8 +1929,6 @@ dnl in the default libraries and as a fall back in the specified library.
dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS.
dnl
AC_DEFUN([PHP_CHECK_FUNC],[
- unset ac_cv_func_$1
- unset ac_cv_func___$1
unset found
AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ])
--
2.7.4

View File

@@ -0,0 +1,69 @@
From 1357df0196806d5697b1f84497ef72aab5faa8a3 Mon Sep 17 00:00:00 2001
From: Gustavo Zacarias <gustavo@zacarias.com.ar>
Date: Tue, 9 Aug 2016 11:50:49 +0200
Subject: [PATCH] iconv: tweak iconv detection
Tweak PHP_SETUP_ICONV from aclocal/acinclude.m4 to not
PHP_ADD_INCLUDE $ICONV_DIR/include since the tests use
test instead of AC_TRY_LINK to find headers which is bad,
specially when adding /usr and /usr/local to the mix.
Do basically the same with ext/iconv/config.m4 by tweaking
PHP_ICONV_H_PATH which, again, uses test and absolute paths.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
[Gustavo: convert to nice m4 instead of patching configure]
[Gustavo: update for 5.6.10]
---
acinclude.m4 | 2 +-
ext/iconv/config.m4 | 22 ----------------------
2 files changed, 1 insertion(+), 23 deletions(-)
diff --git a/acinclude.m4 b/acinclude.m4
index af4aa06..1bd2652 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -2471,7 +2471,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
dnl
if test "$found_iconv" = "no"; then
- for i in $PHP_ICONV /usr/local /usr; do
+ for i in $PHP_ICONV; do
if test -r $i/include/giconv.h; then
AC_DEFINE(HAVE_GICONV_H, 1, [ ])
ICONV_DIR=$i
diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4
index 6a05697..694fcb8 100644
--- a/ext/iconv/config.m4
+++ b/ext/iconv/config.m4
@@ -14,28 +14,6 @@ if test "$PHP_ICONV" != "no"; then
])
if test "$iconv_avail" != "no"; then
- if test -z "$ICONV_DIR"; then
- for i in /usr/local /usr; do
- if test -f "$i/include/iconv.h" || test -f "$i/include/giconv.h"; then
- PHP_ICONV_PREFIX="$i"
- break
- fi
- done
- if test -z "$PHP_ICONV_PREFIX"; then
- PHP_ICONV_PREFIX="/usr"
- fi
- else
- PHP_ICONV_PREFIX="$ICONV_DIR"
- fi
-
- CFLAGS="-I$PHP_ICONV_PREFIX/include $CFLAGS"
- LDFLAGS="-L$PHP_ICONV_PREFIX/$PHP_LIBDIR $LDFLAGS"
-
- if test -r "$PHP_ICONV_PREFIX/include/giconv.h"; then
- PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h"
- else
- PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h"
- fi
AC_MSG_CHECKING([if iconv is glibc's])
AC_TRY_LINK([#include <gnu/libc-version.h>],[gnu_get_libc_version();],
--
2.7.4

View File

@@ -0,0 +1,39 @@
From 5ba6355e489f647c88ca48afbc75965468193181 Mon Sep 17 00:00:00 2001
From: Gustavo Zacarias <gustavo@zacarias.com.ar>
Date: Tue, 9 Aug 2016 11:51:53 +0200
Subject: [PATCH] configure: disable the 'phar' tool
Disable the 'phar' command-line tool build/installation since it requires
php to run and pack up phar itself in phar format. This would require
a host-php instance and really probably nobody needs the phar tool
on the target.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
[Gustavo: update for autoreconf/configure.in]
---
configure.in | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/configure.in b/configure.in
index 25c8abf..4dc8a09 100644
--- a/configure.in
+++ b/configure.in
@@ -1445,13 +1445,8 @@ CFLAGS="\$(CFLAGS_CLEAN) $standard_libtool_flag"
INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
CXXFLAGS="$CXXFLAGS $standard_libtool_flag \$(PROF_FLAGS)"
-if test "$PHP_PHAR" != "no" && test "$PHP_CLI" != "no"; then
- pharcmd=pharcmd
- pharcmd_install=install-pharcmd
-else
- pharcmd=
- pharcmd_install=
-fi;
+pharcmd=
+pharcmd_install=
all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_BINARIES) $pharcmd"
install_targets="$install_sapi $install_modules $install_binaries install-build install-headers install-programs $install_pear $pharcmd_install"
--
2.7.4

View File

@@ -0,0 +1,58 @@
From bedbd41ef0a5ce80b83a6f6eaebd7c90f0bc5615 Mon Sep 17 00:00:00 2001
From: Gustavo Zacarias <gustavo@zacarias.com.ar>
Date: Tue, 9 Aug 2016 11:52:19 +0200
Subject: [PATCH] OPcache: flock mechanism is obviously linux so force it.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
ext/opcache/config.m4 | 34 ++--------------------------------
1 file changed, 2 insertions(+), 32 deletions(-)
diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
index fbb9b21..ffddc8e 100644
--- a/ext/opcache/config.m4
+++ b/ext/opcache/config.m4
@@ -343,38 +343,8 @@ int main() {
msg=yes,msg=no,msg=no)
AC_MSG_RESULT([$msg])
-flock_type=unknown
-AC_MSG_CHECKING("whether flock struct is linux ordered")
-AC_TRY_RUN([
- #include <fcntl.h>
- struct flock lock = { 1, 2, 3, 4, 5 };
- int main() {
- if(lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 3 && lock.l_len == 4) {
- return 0;
- }
- return 1;
- }
-], [
- flock_type=linux
- AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
- AC_MSG_RESULT("yes")
-], AC_MSG_RESULT("no") )
-
-AC_MSG_CHECKING("whether flock struct is BSD ordered")
-AC_TRY_RUN([
- #include <fcntl.h>
- struct flock lock = { 1, 2, 3, 4, 5 };
- int main() {
- if(lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 && lock.l_whence == 5) {
- return 0;
- }
- return 1;
- }
-], [
- flock_type=bsd
- AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type])
- AC_MSG_RESULT("yes")
-], AC_MSG_RESULT("no") )
+flock_type=linux
+AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
if test "$flock_type" = "unknown"; then
AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])
--
2.7.4

View File

@@ -0,0 +1,35 @@
From a874ba472151c6811018de322a5787d0ca6148c9 Mon Sep 17 00:00:00 2001
From: Gustavo Zacarias <gustavo@zacarias.com.ar>
Date: Tue, 9 Aug 2016 11:52:51 +0200
Subject: [PATCH] ext/fileinfo/config.m4: allow cache answer for strcasestr
discovery
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
ext/fileinfo/config.m4 | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ext/fileinfo/config.m4 b/ext/fileinfo/config.m4
index 7e98d62..8561962 100644
--- a/ext/fileinfo/config.m4
+++ b/ext/fileinfo/config.m4
@@ -14,6 +14,7 @@ if test "$PHP_FILEINFO" != "no"; then
libmagic/readcdf.c libmagic/softmagic.c"
AC_MSG_CHECKING([for strcasestr])
+ AC_CACHE_VAL(ac_cv_func_strcasestr,
AC_TRY_RUN([
#include <string.h>
#include <strings.h>
@@ -46,7 +47,7 @@ int main(void)
AC_MSG_RESULT(no)
AC_MSG_NOTICE(using libmagic strcasestr implementation)
libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
- ])
+ ]))
PHP_NEW_EXTENSION(fileinfo, fileinfo.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic)
PHP_ADD_BUILD_DIR($ext_builddir/libmagic)
--
2.7.4

View File

@@ -0,0 +1,16 @@
Avoid gcc segmentation fault
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
diff -Nur php-7.0.12.orig/Zend/zend_portability.h php-7.0.12/Zend/zend_portability.h
--- php-7.0.12.orig/Zend/zend_portability.h 2016-10-13 16:04:17.000000000 +0200
+++ php-7.0.12/Zend/zend_portability.h 2016-11-08 02:49:39.118388999 +0100
@@ -97,7 +97,7 @@
#if defined(ZEND_WIN32) && !defined(__clang__)
# define ZEND_ASSUME(c) __assume(c)
-#elif ((defined(__GNUC__) && ZEND_GCC_VERSION >= 4005) || __has_builtin(__builtin_unreachable)) && PHP_HAVE_BUILTIN_EXPECT
+#elif ((defined(__GNUC__) && ZEND_GCC_VERSION >= 4005) || __has_builtin(__builtin_unreachable)) && PHP_HAVE_BUILTIN_EXPECT && !defined(__bfin__)
# define ZEND_ASSUME(c) do { \
if (__builtin_expect(!(c), 0)) __builtin_unreachable(); \
} while (0)

View File

@@ -0,0 +1,49 @@
From 4342bdea7a1a21430ce0d051fa4387441166c473 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fabrice.fontaine@orange.com>
Date: Sun, 11 Dec 2016 23:12:46 +0100
Subject: [PATCH] Call apxs with correct prefix
php uses apache's apxs script from staging directory to install libphp
dynamic library and update /etc/apache2/httpd.conf in the staging and target
directories. Here is the full command line:
"apxs -S LIBEXECDIR='$(INSTALL_ROOT)/usr/modules'
-S SYSCONFDIR='$(INSTALL_ROOT)/etc/apache2' -i -a -n php7"
This does not work for target directory as apxs sets the full path of the
library and not the relative one. Indeed, apxs is smart enough to substitute
away the prefix specified in $(STAGING_DIR)/usr/build/config_vars.mk so
httpd.conf will only be correct in the staging directory.
To fix this, add -S PREFIX='$(INSTALL_ROOT)/usr' to apxs call in configure
Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
---
sapi/apache2handler/config.m4 | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4
index 2e64b21..f5bf002 100644
--- a/sapi/apache2handler/config.m4
+++ b/sapi/apache2handler/config.m4
@@ -66,10 +66,12 @@ if test "$PHP_APXS2" != "no"; then
AC_MSG_ERROR([Please note that Apache version >= 2.0.44 is required])
fi
+ APXS_PREFIX='$(INSTALL_ROOT)'/usr
APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
if test -z `$APXS -q SYSCONFDIR`; then
INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
$APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
+ -S PREFIX='$APXS_PREFIX' \
-i -n php7"
else
APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
@@ -77,6 +79,7 @@ if test "$PHP_APXS2" != "no"; then
\$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
$APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-S SYSCONFDIR='$APXS_SYSCONFDIR' \
+ -S PREFIX='$APXS_PREFIX' \
-i -a -n php7"
fi
--
2.5.0

View File

@@ -0,0 +1,380 @@
menu "Extensions"
config BR2_PACKAGE_PHP_EXT_CALENDAR
bool "Calendar"
help
Calendar and event support
config BR2_PACKAGE_PHP_EXT_FILEINFO
bool "Fileinfo"
help
File Information support
config BR2_PACKAGE_PHP_EXT_OPCACHE
bool "OPcache"
help
Enable the Zend OPcache accelerator.
comment "Readline needs a toolchain w/ dynamic library"
depends on BR2_STATIC_LIBS
config BR2_PACKAGE_PHP_EXT_READLINE
bool "Readline"
depends on !BR2_STATIC_LIBS
select BR2_PACKAGE_NCURSES
select BR2_PACKAGE_READLINE
help
Readline support
config BR2_PACKAGE_PHP_EXT_SESSION
bool "Session"
default y
help
Session support
comment "Compression extensions"
config BR2_PACKAGE_PHP_EXT_BZIP2
bool "bzip2"
select BR2_PACKAGE_BZIP2
help
bzip2 read/write support
config BR2_PACKAGE_PHP_EXT_PHAR
bool "phar"
help
PHP Archive support
config BR2_PACKAGE_PHP_EXT_ZIP
bool "zip"
select BR2_PACKAGE_ZLIB
help
Zip read/write support
config BR2_PACKAGE_PHP_EXT_ZLIB
bool "zlib"
select BR2_PACKAGE_ZLIB
default y
help
zlib support
comment "Cryptography extensions"
config BR2_PACKAGE_PHP_EXT_HASH
bool "hash"
help
HASH message digest framework
config BR2_PACKAGE_PHP_EXT_MCRYPT
bool "mcrypt"
select BR2_PACKAGE_LIBMCRYPT
help
mcrypt support
config BR2_PACKAGE_PHP_EXT_OPENSSL
bool "openssl"
select BR2_PACKAGE_OPENSSL
help
openssl support
comment "Database extensions"
config BR2_PACKAGE_PHP_EXT_DBA
bool "DBA"
help
Database Abstraction Layer
if BR2_PACKAGE_PHP_EXT_DBA
config BR2_PACKAGE_PHP_EXT_DBA_CDB
bool "cdb"
help
CDB handler
config BR2_PACKAGE_PHP_EXT_DBA_DB4
bool "db4/5"
select BR2_PACKAGE_BERKELEYDB
help
BerkeleyDB version 4/5 handler
config BR2_PACKAGE_PHP_EXT_DBA_FLAT
bool "flat"
default y
help
Flat file handler
config BR2_PACKAGE_PHP_EXT_DBA_INI
bool "ini"
default y
help
INI file handler
endif
config BR2_PACKAGE_PHP_EXT_MYSQLI
bool "Mysqli"
help
MySQL Improved extension support
config BR2_PACKAGE_PHP_EXT_SQLITE
bool "SQLite3"
select BR2_PACKAGE_SQLITE
help
SQLite3 support
config BR2_PACKAGE_PHP_EXT_PDO
bool "PDO"
help
PHP Data Objects support
if BR2_PACKAGE_PHP_EXT_PDO
config BR2_PACKAGE_PHP_EXT_PDO_MYSQL
bool "MySQL"
help
PDO driver for MySQL
config BR2_PACKAGE_PHP_EXT_PDO_POSTGRESQL
bool "PostgreSQL"
select BR2_PACKAGE_POSTGRESQL
depends on BR2_USE_MMU # postgresql
depends on !BR2_STATIC_LIBS
help
PDO driver for PostgreSQL
comment "PostgreSQL drivers need a toolchain w/ dynamic library"
depends on BR2_USE_MMU
depends on BR2_STATIC_LIBS
config BR2_PACKAGE_PHP_EXT_PDO_SQLITE
bool "SQLite3"
select BR2_PACKAGE_SQLITE
help
SQLite3 driver for PDO
config BR2_PACKAGE_PHP_EXT_PDO_UNIXODBC
bool "unixODBC"
select BR2_PACKAGE_UNIXODBC
help
unixODBC driver for PDO
endif
comment "Human language and character encoding support"
config BR2_PACKAGE_PHP_EXT_GETTEXT
bool "Gettext"
select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT
depends on BR2_USE_WCHAR
help
Gettext support
comment "Gettext support needs a toolchain w/ wchar"
depends on !BR2_USE_WCHAR
config BR2_PACKAGE_PHP_EXT_ICONV
bool "iconv"
select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
help
iconv character set conversion support
config BR2_PACKAGE_PHP_EXT_INTL
bool "intl"
select BR2_PACKAGE_ICU
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_USE_WCHAR
depends on !BR2_BINFMT_FLAT # icu
depends on BR2_TOOLCHAIN_HAS_THREADS # icu
help
Internationalization support
comment "intl support needs a toolchain w/ C++, wchar, threads"
depends on !BR2_BINFMT_FLAT
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
config BR2_PACKAGE_PHP_EXT_MBSTRING
bool "mbstring"
help
multibyte string support
comment "Image processing"
config BR2_PACKAGE_PHP_EXT_EXIF
bool "EXIF"
help
EXIF support
config BR2_PACKAGE_PHP_EXT_GD
bool "GD"
select BR2_PACKAGE_FREETYPE
select BR2_PACKAGE_JPEG
select BR2_PACKAGE_LIBPNG
help
GD support
comment "Mathematical extensions"
config BR2_PACKAGE_PHP_EXT_BCMATH
bool "BC math"
help
BCMath arbitrary precision mathematics support
config BR2_PACKAGE_PHP_EXT_GMP
bool "GMP"
select BR2_PACKAGE_GMP
help
GNU Multiple Precision support
comment "Other basic extensions"
config BR2_PACKAGE_PHP_EXT_JSON
bool "JSON"
help
JavaScript Object Serialization support
config BR2_PACKAGE_PHP_EXT_TOKENIZER
bool "Tokenizer"
help
Tokenizer functions support
comment "Other services"
config BR2_PACKAGE_PHP_EXT_CURL
bool "cURL"
select BR2_PACKAGE_LIBCURL
help
cURL for URL streams
config BR2_PACKAGE_PHP_EXT_FTP
bool "FTP"
help
FTP support
config BR2_PACKAGE_PHP_EXT_SNMP
bool "SNMP"
depends on BR2_USE_MMU # netsnmp fork()
select BR2_PACKAGE_NETSNMP
select BR2_PACKAGE_NETSNMP_ENABLE_MIBS
help
SNMP support
config BR2_PACKAGE_PHP_EXT_SOCKETS
bool "sockets"
help
Sockets support
comment "Process Control"
config BR2_PACKAGE_PHP_EXT_PCNTL
bool "PCNTL"
depends on BR2_USE_MMU # fork()
help
Process control support
config BR2_PACKAGE_PHP_EXT_POSIX
bool "Posix"
default y
help
POSIX.1 (IEEE 1003.1) function support
config BR2_PACKAGE_PHP_EXT_SHMOP
bool "shmop"
help
Shared memory support
config BR2_PACKAGE_PHP_EXT_SYSVMSG
bool "sysvmsg"
help
System V message queue support
config BR2_PACKAGE_PHP_EXT_SYSVSEM
bool "sysvsem"
help
System V semaphore support
config BR2_PACKAGE_PHP_EXT_SYSVSHM
bool "sysvshm"
help
System V shared memory support
comment "Variable and Type related"
config BR2_PACKAGE_PHP_EXT_CTYPE
bool "Ctype"
help
Character type checking support
config BR2_PACKAGE_PHP_EXT_FILTER
bool "Filter"
help
Input filter support
comment "Web services"
config BR2_PACKAGE_PHP_EXT_SOAP
bool "SOAP"
select BR2_PACKAGE_PHP_EXT_LIBXML2
help
SOAP support
config BR2_PACKAGE_PHP_EXT_XMLRPC
bool "XML-RPC"
select BR2_PACKAGE_PHP_EXT_LIBXML2
select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
help
XML-RPC support
comment "XML manipulation"
config BR2_PACKAGE_PHP_EXT_DOM
bool "DOM"
select BR2_PACKAGE_PHP_EXT_LIBXML2
help
Document Object Model support
config BR2_PACKAGE_PHP_EXT_LIBXML2
bool "libxml"
select BR2_PACKAGE_LIBXML2
help
libxml2 support
config BR2_PACKAGE_PHP_EXT_SIMPLEXML
bool "SimpleXML"
select BR2_PACKAGE_PHP_EXT_LIBXML2
help
SimpleXML support
config BR2_PACKAGE_PHP_EXT_WDDX
bool "WDDX"
select BR2_PACKAGE_EXPAT
select BR2_PACKAGE_PHP_EXT_LIBXML2
help
WDDX support
config BR2_PACKAGE_PHP_EXT_XML
bool "XML Parser"
select BR2_PACKAGE_PHP_EXT_LIBXML2
help
XML Parser support
config BR2_PACKAGE_PHP_EXT_XMLREADER
bool "XMLReader"
select BR2_PACKAGE_PHP_EXT_LIBXML2
help
XMLReader support
config BR2_PACKAGE_PHP_EXT_XMLWRITER
bool "XMLWriter"
select BR2_PACKAGE_PHP_EXT_LIBXML2
help
XMLWriter support
config BR2_PACKAGE_PHP_EXT_XSL
bool "XSL"
select BR2_PACKAGE_PHP_EXT_DOM
select BR2_PACKAGE_PHP_EXT_LIBXML2
select BR2_PACKAGE_LIBXSLT
help
XSL transformation support
endmenu

View File

@@ -0,0 +1,46 @@
config BR2_PACKAGE_PHP
bool "php"
select BR2_PACKAGE_PHP_SAPI_CGI if \
!BR2_PACKAGE_PHP_SAPI_APACHE && \
!BR2_PACKAGE_PHP_SAPI_CLI && \
!BR2_PACKAGE_PHP_SAPI_FPM && \
BR2_USE_MMU
select BR2_PACKAGE_PHP_SAPI_CLI if !BR2_USE_MMU
help
PHP is a widely-used general-purpose scripting
language that is especially suited for Web development
and can be embedded into HTML.
http://www.php.net
if BR2_PACKAGE_PHP
config BR2_PACKAGE_PHP_SAPI_APACHE
bool "Apache interface"
depends on BR2_PACKAGE_APACHE
help
Apache module
config BR2_PACKAGE_PHP_SAPI_CGI
bool "CGI interface"
# CGI uses fork()
depends on BR2_USE_MMU
help
Common Gateway Interface
config BR2_PACKAGE_PHP_SAPI_CLI
bool "CLI interface"
help
Command Line Interface
config BR2_PACKAGE_PHP_SAPI_FPM
bool "FPM interface"
depends on BR2_USE_MMU
# "Sparc v8 and predecessors are not and will not be supported"
depends on !BR2_sparc
help
PHP-FPM (FastCGI Process Manager)
source "package/php/Config.ext"
endif

View File

@@ -0,0 +1,11 @@
[www]
pm = ondemand
pm.process_idle_timeout = 120s
pm.max_children = 5
listen = /var/run/php-fpm.sock
listen.owner = www-data
listen.group = www-data
user = www-data
group = www-data

View File

@@ -0,0 +1,5 @@
# From http://php.net/downloads.php
sha256 1a0b3f2fb61959b57a3ee01793a77ed3f19bde5aa90c43dcacc85ea32f64fc10 php-7.1.13.tar.xz
# License file
sha256 a44951f93b10c87c3f7cd9f311d95999c57c95ed950eec32b14c1c7ea6baf25e LICENSE

View File

@@ -0,0 +1,348 @@
################################################################################
#
# php
#
################################################################################
PHP_VERSION = 7.1.13
PHP_SITE = http://www.php.net/distributions
PHP_SOURCE = php-$(PHP_VERSION).tar.xz
PHP_INSTALL_STAGING = YES
PHP_INSTALL_STAGING_OPTS = INSTALL_ROOT=$(STAGING_DIR) install
PHP_INSTALL_TARGET_OPTS = INSTALL_ROOT=$(TARGET_DIR) install
PHP_DEPENDENCIES = host-pkgconf
PHP_LICENSE = PHP-3.01
PHP_LICENSE_FILES = LICENSE
PHP_CONF_OPTS = \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-all \
--without-pear \
--with-config-file-path=/etc \
--disable-phpdbg \
--disable-rpath
PHP_CONF_ENV = \
ac_cv_func_strcasestr=yes \
EXTRA_LIBS="$(PHP_EXTRA_LIBS)"
ifeq ($(BR2_STATIC_LIBS),y)
PHP_CONF_ENV += LIBS="$(PHP_STATIC_LIBS)"
endif
ifeq ($(BR2_STATIC_LIBS)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
PHP_STATIC_LIBS += -lpthread
endif
ifeq ($(call qstrip,$(BR2_TARGET_LOCALTIME)),)
PHP_LOCALTIME = UTC
else
# Not q-stripping this value, as we need quotes in the php.ini file
PHP_LOCALTIME = $(BR2_TARGET_LOCALTIME)
endif
# PHP can't be AUTORECONFed the standard way unfortunately
PHP_DEPENDENCIES += host-autoconf host-automake host-libtool
define PHP_BUILDCONF
cd $(@D) ; $(TARGET_MAKE_ENV) ./buildconf --force
endef
PHP_PRE_CONFIGURE_HOOKS += PHP_BUILDCONF
ifeq ($(BR2_ENDIAN),"BIG")
PHP_CONF_ENV += ac_cv_c_bigendian_php=yes
else
PHP_CONF_ENV += ac_cv_c_bigendian_php=no
endif
PHP_CONFIG_SCRIPTS = php-config
PHP_CFLAGS = $(TARGET_CFLAGS)
# The OPcache extension isn't cross-compile friendly
# Throw some defines here to avoid patching heavily
ifeq ($(BR2_PACKAGE_PHP_EXT_OPCACHE),y)
PHP_CONF_OPTS += --enable-opcache
PHP_CONF_ENV += ac_cv_func_mprotect=yes
PHP_CFLAGS += \
-DHAVE_SHM_IPC \
-DHAVE_SHM_MMAP_ANON \
-DHAVE_SHM_MMAP_ZERO \
-DHAVE_SHM_MMAP_POSIX \
-DHAVE_SHM_MMAP_FILE
endif
# We need to force dl "detection"
ifeq ($(BR2_STATIC_LIBS),)
PHP_CONF_ENV += ac_cv_func_dlopen=yes ac_cv_lib_dl_dlopen=yes
PHP_EXTRA_LIBS += -ldl
else
PHP_CONF_ENV += ac_cv_func_dlopen=no ac_cv_lib_dl_dlopen=no
endif
PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_SAPI_CLI),--enable-cli,--disable-cli)
PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_SAPI_CGI),--enable-cgi,--disable-cgi)
PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_SAPI_FPM),--enable-fpm,--disable-fpm)
ifeq ($(BR2_PACKAGE_PHP_SAPI_APACHE),y)
PHP_DEPENDENCIES += apache
PHP_CONF_OPTS += --with-apxs2=$(STAGING_DIR)/usr/bin/apxs
# Enable thread safety option if Apache MPM is event or worker
ifeq ($(BR2_PACKAGE_APACHE_MPM_EVENT)$(BR2_PACKAGE_APACHE_MPM_WORKER),y)
PHP_CONF_OPTS += --enable-maintainer-zts
endif
endif
### Extensions
PHP_CONF_OPTS += \
$(if $(BR2_PACKAGE_PHP_EXT_SOCKETS),--enable-sockets) \
$(if $(BR2_PACKAGE_PHP_EXT_POSIX),--enable-posix) \
$(if $(BR2_PACKAGE_PHP_EXT_SESSION),--enable-session) \
$(if $(BR2_PACKAGE_PHP_EXT_HASH),--enable-hash) \
$(if $(BR2_PACKAGE_PHP_EXT_DOM),--enable-dom) \
$(if $(BR2_PACKAGE_PHP_EXT_SIMPLEXML),--enable-simplexml) \
$(if $(BR2_PACKAGE_PHP_EXT_SOAP),--enable-soap) \
$(if $(BR2_PACKAGE_PHP_EXT_XML),--enable-xml) \
$(if $(BR2_PACKAGE_PHP_EXT_XMLREADER),--enable-xmlreader) \
$(if $(BR2_PACKAGE_PHP_EXT_XMLWRITER),--enable-xmlwriter) \
$(if $(BR2_PACKAGE_PHP_EXT_EXIF),--enable-exif) \
$(if $(BR2_PACKAGE_PHP_EXT_FTP),--enable-ftp) \
$(if $(BR2_PACKAGE_PHP_EXT_JSON),--enable-json) \
$(if $(BR2_PACKAGE_PHP_EXT_TOKENIZER),--enable-tokenizer) \
$(if $(BR2_PACKAGE_PHP_EXT_PCNTL),--enable-pcntl) \
$(if $(BR2_PACKAGE_PHP_EXT_SHMOP),--enable-shmop) \
$(if $(BR2_PACKAGE_PHP_EXT_SYSVMSG),--enable-sysvmsg) \
$(if $(BR2_PACKAGE_PHP_EXT_SYSVSEM),--enable-sysvsem) \
$(if $(BR2_PACKAGE_PHP_EXT_SYSVSHM),--enable-sysvshm) \
$(if $(BR2_PACKAGE_PHP_EXT_ZIP),--enable-zip) \
$(if $(BR2_PACKAGE_PHP_EXT_CTYPE),--enable-ctype) \
$(if $(BR2_PACKAGE_PHP_EXT_FILTER),--enable-filter) \
$(if $(BR2_PACKAGE_PHP_EXT_CALENDAR),--enable-calendar) \
$(if $(BR2_PACKAGE_PHP_EXT_FILEINFO),--enable-fileinfo) \
$(if $(BR2_PACKAGE_PHP_EXT_BCMATH),--enable-bcmath) \
$(if $(BR2_PACKAGE_PHP_EXT_MBSTRING),--enable-mbstring) \
$(if $(BR2_PACKAGE_PHP_EXT_PHAR),--enable-phar)
ifeq ($(BR2_PACKAGE_PHP_EXT_MCRYPT),y)
PHP_CONF_OPTS += --with-mcrypt=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += libmcrypt
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_OPENSSL),y)
PHP_CONF_OPTS += --with-openssl=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += openssl
# openssl needs zlib, but the configure script forgets to link against
# it causing detection failures with static linking
PHP_STATIC_LIBS += `$(PKG_CONFIG_HOST_BINARY) --libs openssl`
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_LIBXML2),y)
PHP_CONF_ENV += php_cv_libxml_build_works=yes
PHP_CONF_OPTS += --enable-libxml --with-libxml-dir=${STAGING_DIR}/usr
PHP_DEPENDENCIES += libxml2
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_WDDX),y)
PHP_CONF_OPTS += --enable-wddx --with-libexpat-dir=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += expat
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_XMLRPC),y)
PHP_CONF_OPTS += \
--with-xmlrpc \
$(if $(BR2_PACKAGE_LIBICONV),--with-iconv-dir=$(STAGING_DIR)/usr)
PHP_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv)
endif
ifneq ($(BR2_PACKAGE_PHP_EXT_ZLIB)$(BR2_PACKAGE_PHP_EXT_ZIP),)
PHP_CONF_OPTS += --with-zlib=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += zlib
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_GETTEXT),y)
PHP_CONF_OPTS += --with-gettext=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += $(if $(BR2_NEEDS_GETTEXT),gettext)
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_ICONV),y)
ifeq ($(BR2_PACKAGE_LIBICONV),y)
PHP_CONF_OPTS += --with-iconv=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += libiconv
else
PHP_CONF_OPTS += --with-iconv
endif
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_INTL),y)
PHP_CONF_OPTS += --enable-intl --with-icu-dir=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += icu
# The intl module is implemented in C++, but PHP fails to use
# g++ as the compiler for the final link. As a workaround,
# tell it to link libstdc++.
PHP_EXTRA_LIBS += -lstdc++
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_GMP),y)
PHP_CONF_OPTS += --with-gmp=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += gmp
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_READLINE),y)
PHP_CONF_OPTS += --with-readline=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += readline
endif
### Native SQL extensions
ifeq ($(BR2_PACKAGE_PHP_EXT_MYSQLI),y)
PHP_CONF_OPTS += --with-mysqli
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_SQLITE),y)
PHP_CONF_OPTS += --with-sqlite3=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += sqlite
PHP_STATIC_LIBS += `$(PKG_CONFIG_HOST_BINARY) --libs sqlite3`
endif
### PDO
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO),y)
PHP_CONF_OPTS += --enable-pdo
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_SQLITE),y)
PHP_CONF_OPTS += --with-pdo-sqlite=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += sqlite
PHP_CFLAGS += -DSQLITE_OMIT_LOAD_EXTENSION
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_MYSQL),y)
PHP_CONF_OPTS += --with-pdo-mysql
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_POSTGRESQL),y)
PHP_CONF_OPTS += --with-pdo-pgsql=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += postgresql
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_UNIXODBC),y)
PHP_CONF_OPTS += --with-pdo-odbc=unixODBC,$(STAGING_DIR)/usr
PHP_DEPENDENCIES += unixodbc
endif
endif
ifneq ($(BR2_PACKAGE_PHP_EXT_MYSQLI)$(BR2_PACKAGE_PHP_EXT_PDO_MYSQL),)
# Set default MySQL unix socket to what the MySQL server is using by default
PHP_CONF_OPTS += --with-mysql-sock=$(MYSQL_SOCKET)
endif
define PHP_DISABLE_PCRE_JIT
$(SED) '/^#define SUPPORT_JIT/d' $(@D)/ext/pcre/pcrelib/config.h
endef
### Use external PCRE if it's available
ifeq ($(BR2_PACKAGE_PCRE),y)
PHP_CONF_OPTS += --with-pcre-regex=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += pcre
else
# The bundled pcre library is not configurable through ./configure options,
# and by default is configured to be thread-safe, so it wants pthreads. So
# we must explicitly tell it when we don't have threads.
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
PHP_CFLAGS += -DSLJIT_SINGLE_THREADED=1
endif
# check ext/pcre/pcrelib/sljit/sljitConfigInternal.h for supported archs
ifeq ($(BR2_i386)$(BR2_x86_64)$(BR2_arm)$(BR2_armeb)$(BR2_aarch64)$(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el)$(BR2_powerpc)$(BR2_sparc),)
PHP_POST_CONFIGURE_HOOKS += PHP_DISABLE_PCRE_JIT
endif
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_CURL),y)
PHP_CONF_OPTS += --with-curl=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += libcurl
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_XSL),y)
PHP_CONF_OPTS += --with-xsl=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += libxslt
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_BZIP2),y)
PHP_CONF_OPTS += --with-bz2=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += bzip2
endif
### DBA
ifeq ($(BR2_PACKAGE_PHP_EXT_DBA),y)
PHP_CONF_OPTS += --enable-dba
ifneq ($(BR2_PACKAGE_PHP_EXT_DBA_CDB),y)
PHP_CONF_OPTS += --without-cdb
endif
ifneq ($(BR2_PACKAGE_PHP_EXT_DBA_FLAT),y)
PHP_CONF_OPTS += --without-flatfile
endif
ifneq ($(BR2_PACKAGE_PHP_EXT_DBA_INI),y)
PHP_CONF_OPTS += --without-inifile
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_DBA_DB4),y)
PHP_CONF_OPTS += --with-db4=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += berkeleydb
endif
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_SNMP),y)
PHP_CONF_OPTS += --with-snmp=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += netsnmp
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_GD),y)
PHP_CONF_OPTS += \
--with-gd \
--with-jpeg-dir=$(STAGING_DIR)/usr \
--with-png-dir=$(STAGING_DIR)/usr \
--with-zlib-dir=$(STAGING_DIR)/usr \
--with-freetype-dir=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += jpeg libpng freetype
endif
ifeq ($(BR2_PACKAGE_PHP_SAPI_FPM),y)
define PHP_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 $(@D)/sapi/fpm/init.d.php-fpm \
$(TARGET_DIR)/etc/init.d/S49php-fpm
endef
define PHP_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 0644 $(@D)/sapi/fpm/php-fpm.service \
$(TARGET_DIR)/usr/lib/systemd/system/php-fpm.service
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
ln -fs ../../../../usr/lib/systemd/system/php-fpm.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/php-fpm.service
endef
define PHP_INSTALL_FPM_CONF
$(INSTALL) -D -m 0644 package/php/php-fpm.conf \
$(TARGET_DIR)/etc/php-fpm.conf
rm -f $(TARGET_DIR)/etc/php-fpm.conf.default
# remove unused sample status page /usr/php/php/fpm/status.html
rm -rf $(TARGET_DIR)/usr/php
endef
PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FPM_CONF
endif
define PHP_EXTENSIONS_FIXUP
$(SED) "/prefix/ s:/usr:$(STAGING_DIR)/usr:" \
$(STAGING_DIR)/usr/bin/phpize
$(SED) "/extension_dir/ s:/usr:$(TARGET_DIR)/usr:" \
$(STAGING_DIR)/usr/bin/php-config
endef
PHP_POST_INSTALL_TARGET_HOOKS += PHP_EXTENSIONS_FIXUP
define PHP_INSTALL_FIXUP
rm -rf $(TARGET_DIR)/usr/lib/php/build
rm -f $(TARGET_DIR)/usr/bin/phpize
$(INSTALL) -D -m 0755 $(PHP_DIR)/php.ini-production \
$(TARGET_DIR)/etc/php.ini
$(SED) 's%;date.timezone =.*%date.timezone = $(PHP_LOCALTIME)%' \
$(TARGET_DIR)/etc/php.ini
$(if $(BR2_PACKAGE_PHP_EXT_OPCACHE),
$(SED) '/;extension=php_xsl.dll/azend_extension=opcache.so' \
$(TARGET_DIR)/etc/php.ini)
endef
PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FIXUP
PHP_CONF_ENV += CFLAGS="$(PHP_CFLAGS)"
$(eval $(autotools-package))