Add buildroot 2018-02

This commit is contained in:
Pascal Vizeli
2018-03-17 23:47:00 +00:00
parent 3776c47f83
commit 67742041ad
10007 changed files with 405098 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
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>
Signed-off-by: Adam Duskett <aduskett@gmail.com>
[aduskett@gmail.com: Update for 7.2.2]
---
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
@@ -1890,8 +1890,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])
@@ -1923,8 +1921,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,71 @@
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]
Signed-off-by: Adam Duskett <aduskett@gmail.com>
[aduskett@gmail.com: Update for 7.2.2]
---
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
@@ -2463,7 +2463,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,41 @@
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]
Signed-off-by: Adam Duskett <Adamduskett@outlook.com>
[Aduskett: update for 7.2.2]
---
configure.ac | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index d20af76..7f02f1a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1420,13 +1420,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.14.3

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,37 @@
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>
[aduskett@gmail.com: Update for 7.2.2]
Signed-off-by: Adam Duskett <aduskett@gmail.com>
---
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
@@ -15,6 +15,7 @@ libmagic/readcdf.c libmagic/softmagic.c libmagic/der.c"
AC_MSG_CHECKING([for strcasestr])
+ AC_CACHE_VAL(ac_cv_func_strcasestr,
AC_TRY_RUN([
#include <string.h>
#include <strings.h>
#include <stdlib.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,17 @@
Avoid gcc segmentation fault
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Adam Duskett <aduskett@gmail.com>
[aduskett@gmail.com: Update for 7.2.2]
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
@@ -95,7 +95,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,51 @@
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>
Signed-off-by: Adam Duskett <aduskett@gmail.com>
[aduskett@gmail.com: Update for 7.2.2]
---
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,55 @@
From 923cab3a5ee112d3de44b5571e73402f1fa3d619 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Mon, 26 Feb 2018 19:06:40 +0100
Subject: [PATCH] ext/sockets: make AI_IDN usage optional
AI_IDN is not supported by all C libraries (uClibc, musl), so make it
optional, like AI_ALL.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Upstream-status: https://github.com/php/php-src/pull/3160
---
ext/sockets/config.m4 | 13 +++++++++++++
ext/sockets/sockets.c | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/ext/sockets/config.m4 b/ext/sockets/config.m4
index fe7d22a10a..2bf6a2bd11 100644
--- a/ext/sockets/config.m4
+++ b/ext/sockets/config.m4
@@ -69,6 +69,19 @@ if test "$PHP_SOCKETS" != "no"; then
AC_DEFINE(HAVE_AI_ALL,1,[Whether you have AI_ALL])
fi
+ dnl Check for AI_IDN flag
+ AC_CACHE_CHECK([if getaddrinfo supports AI_IDN],[ac_cv_gai_ai_idn],
+ [
+ AC_TRY_COMPILE([
+#include <netdb.h>
+ ], [int flag = AI_IDN;],
+ ac_cv_gai_ai_idn=yes, ac_cv_gai_ai_idn=no)
+ ])
+
+ if test "$ac_cv_gai_ai_idn" = yes; then
+ AC_DEFINE(HAVE_AI_IDN,1,[Whether you have AI_IDN])
+ fi
+
PHP_NEW_EXTENSION([sockets], [sockets.c multicast.c conversions.c sockaddr_conv.c sendrecvmsg.c], [$ext_shared],, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([ext/sockets/], [php_sockets.h])
fi
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 6db56c2816..ee9651ce09 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -796,7 +796,7 @@ static PHP_MINIT_FUNCTION(sockets)
REGISTER_LONG_CONSTANT("AI_ALL", AI_ALL, CONST_CS | CONST_PERSISTENT);
#endif
REGISTER_LONG_CONSTANT("AI_ADDRCONFIG", AI_ADDRCONFIG, CONST_CS | CONST_PERSISTENT);
-#ifdef __USE_GNU
+#if defined(HAVE_AI_IDN) && defined(__USE_GNU)
REGISTER_LONG_CONSTANT("AI_IDN", AI_IDN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("AI_CANONIDN", AI_CANONIDN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("AI_IDN_ALLOW_UNASSIGNED", AI_IDN_ALLOW_UNASSIGNED, CONST_CS | CONST_PERSISTENT);
--
2.14.3

View File

@@ -0,0 +1,62 @@
From b7bbdfbcb0869b5c068143d4e27bab9eac4ae72b Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Mon, 26 Feb 2018 19:30:55 +0100
Subject: [PATCH] main/php_ini.c: build empty php_load_zend_extension_cb() when
!HAVE_LIBDL
Commit 0782a7fc6314c8bd3cbfd57f12d0479bf9cc8dc7 ("Fixed bug #74866
extension_dir = "./ext" now use current directory for base") modified
the php_load_zend_extension_cb() function to use php_load_shlib(), and
pass a handle to the newly introduced zend_load_extension_handle()
function instead of passing the extension path to
zend_load_extension().
While doing so, it introduced a call to php_load_shlib() from code
that is built even when HAVE_LIBDL is not defined. However,
php_load_shlib() is not implemented when HAVE_LIBDL is not defined,
for obvious reasons.
It turns out that zend_load_extension_handle() anyway doesn't do
anything when ZEND_EXTENSIONS_SUPPORT is defined to 0, and
ZEND_EXTENSIONS_SUPPORT is not defined when HAVE_LIBDL is not defined
(Zend/zend_portability.h).
Fixes the following build failure when building on a system that
doesn't have libdl:
main/php_ini.o: In function `php_load_zend_extension_cb':
php_ini.c:(.text+0x478): undefined reference to `php_load_shlib'
php_ini.c:(.text+0x4b0): undefined reference to `php_load_shlib'
collect2: error: ld returned 1 exit status
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Upstream-status: https://github.com/php/php-src/pull/3161
---
main/php_ini.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/main/php_ini.c b/main/php_ini.c
index ba58eb1180..fca263e5f0 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -350,6 +350,7 @@ static void php_load_php_extension_cb(void *arg)
/* {{{ php_load_zend_extension_cb
*/
+#ifdef HAVE_LIBDL
static void php_load_zend_extension_cb(void *arg)
{
char *filename = *((char **) arg);
@@ -409,6 +410,9 @@ static void php_load_zend_extension_cb(void *arg)
efree(libpath);
}
}
+#else
+static void php_load_zend_extension_cb(void *arg) { }
+#endif
/* }}} */
/* {{{ php_init_config
--
2.14.3

View File

@@ -0,0 +1,384 @@
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"
default y
select BR2_PACKAGE_ZLIB
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"
depends on BR2_USE_MMU # postgresql
depends on !BR2_STATIC_LIBS
select BR2_PACKAGE_POSTGRESQL
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"
depends on BR2_SYSTEM_ENABLE_NLS
help
Gettext support
comment "Gettext support needs NLS enabled"
depends on !BR2_SYSTEM_ENABLE_NLS
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"
depends on BR2_HOST_GCC_AT_LEAST_4_8 # icu
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_USE_WCHAR
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # icu
depends on !BR2_BINFMT_FLAT # icu
depends on BR2_TOOLCHAIN_HAS_THREADS # icu
select BR2_PACKAGE_ICU
help
Internationalization support
comment "intl support needs a toolchain w/ C++, wchar, threads, gcc >= 4.8, host gcc >= 4.8"
depends on !BR2_BINFMT_FLAT
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
!BR2_TOOLCHAIN_HAS_THREADS || \
!BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 || \
!BR2_HOST_GCC_AT_LEAST_4_8
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,50 @@
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
# PHP uses -export-dynamic, which breaks with elf2flt with a
# message like "ld.real: section .junk LMA [...,...] overlaps
# section .text LMA [...,...]"
depends on !BR2_BINFMT_FLAT
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 b3a94f1b562f413c0b96f54bc309706d83b29ac65d9b172bc7ed9fb40a5e651f php-7.2.3.tar.xz
# License file
sha256 00e567a8d50359d93ee1f9afdd9511277660c1e70a0cbf3229f84403aa9aebb1 LICENSE

View File

@@ -0,0 +1,355 @@
################################################################################
#
# php
#
################################################################################
PHP_VERSION = 7.2.3
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)
PHP_CXXFLAGS = $(TARGET_CXXFLAGS)
# 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 += $(TARGET_NLS_DEPENDENCIES)
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_CXXFLAGS += "`$(STAGING_DIR)/usr/bin/icu-config --cxxflags`"
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
define PHP_DISABLE_VALGRIND
$(SED) '/^#define HAVE_VALGRIND/d' $(@D)/main/php_config.h
endef
PHP_POST_CONFIGURE_HOOKS += PHP_DISABLE_VALGRIND
### 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)" CXXFLAGS="$(PHP_CXXFLAGS)"
$(eval $(autotools-package))