Move all to deprecated folder.

This commit is contained in:
2016-11-16 21:57:57 +01:00
parent 01738a7684
commit 05de7d6c04
9777 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
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>
diff -Nura php-5.6.8.orig/acinclude.m4 php-5.6.8/acinclude.m4
--- php-5.6.8.orig/acinclude.m4 2015-04-15 20:05:57.000000000 +0200
+++ php-5.6.8/acinclude.m4 2015-05-18 20:03:50.833099001 +0200
@@ -1897,8 +1897,6 @@
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])
@@ -1930,8 +1928,6 @@
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]) ])

View File

@@ -0,0 +1,55 @@
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]
diff -Nura php-5.6.10.orig/acinclude.m4 php-5.6.10/acinclude.m4
--- php-5.6.10.orig/acinclude.m4 2015-06-12 16:09:06.274355813 -0300
+++ php-5.6.10/acinclude.m4 2015-06-12 16:10:10.884544865 -0300
@@ -2474,7 +2474,7 @@
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 -Nura php-5.6.10.orig/ext/iconv/config.m4 php-5.6.10/ext/iconv/config.m4
--- php-5.6.10.orig/ext/iconv/config.m4 2015-06-12 16:09:07.792407246 -0300
+++ php-5.6.10/ext/iconv/config.m4 2015-06-12 16:11:07.752471600 -0300
@@ -14,28 +14,6 @@
])
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();],

View File

@@ -0,0 +1,27 @@
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]
diff -Nura php-5.6.7.orig/configure.in php-5.6.7/configure.in
--- php-5.6.7.orig/configure.in 2015-04-08 11:08:10.815835010 -0300
+++ php-5.6.7/configure.in 2015-04-08 11:16:20.460467444 -0300
@@ -1437,13 +1437,8 @@
INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
CXXFLAGS="$CXXFLAGS $standard_libtool_flag"
-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"

View File

@@ -0,0 +1,48 @@
OPcache: flock mechanism is obviously linux so force it.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
diff -Nura php-5.6.7.orig/ext/opcache/config.m4 php-5.6.7/ext/opcache/config.m4
--- php-5.6.7.orig/ext/opcache/config.m4 2015-04-08 11:08:11.125845540 -0300
+++ php-5.6.7/ext/opcache/config.m4 2015-04-08 11:57:23.648831436 -0300
@@ -326,38 +326,8 @@
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])

View File

@@ -0,0 +1,24 @@
Allow cache answer for strcasestr discovery.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
diff -Nura php-5.6.7.orig/ext/fileinfo/config.m4 php-5.6.7/ext/fileinfo/config.m4
--- php-5.6.7.orig/ext/fileinfo/config.m4 2015-04-08 22:19:45.798770792 -0300
+++ php-5.6.7/ext/fileinfo/config.m4 2015-04-08 22:26:33.110654338 -0300
@@ -14,6 +14,7 @@
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 @@
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)

View File

@@ -0,0 +1,35 @@
From bb19125781c0794da9a63fee62e263ff4efff661 Mon Sep 17 00:00:00 2001
From: Floris Bos <bos@je-eigen-domein.nl>
Date: Fri, 1 May 2015 15:28:55 +0200
Subject: [PATCH] Fix php-fpm.service.in
- Expand file paths.
- Remove obsolete After=syslog.target. Syslog is socket activated nowadays.
Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
---
sapi/fpm/php-fpm.service.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sapi/fpm/php-fpm.service.in b/sapi/fpm/php-fpm.service.in
index a2df30e..c135f04 100644
--- a/sapi/fpm/php-fpm.service.in
+++ b/sapi/fpm/php-fpm.service.in
@@ -1,11 +1,11 @@
[Unit]
Description=The PHP FastCGI Process Manager
-After=syslog.target network.target
+After=network.target
[Service]
Type=@php_fpm_systemd@
-PIDFile=@localstatedir@/run/php-fpm.pid
-ExecStart=@sbindir@/php-fpm --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf
+PIDFile=@EXPANDED_LOCALSTATEDIR@/run/php-fpm.pid
+ExecStart=@EXPANDED_SBINDIR@/php-fpm --nodaemonize --fpm-config @EXPANDED_SYSCONFDIR@/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
[Install]
--
2.1.4

View File

@@ -0,0 +1,402 @@
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_MYSQL
bool "Mysql"
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_USE_MMU # mysql
depends on BR2_TOOLCHAIN_HAS_THREADS # mysql
select BR2_PACKAGE_MYSQL
help
MySQL support
config BR2_PACKAGE_PHP_EXT_MYSQLI
bool "Mysqli"
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_USE_MMU # mysql
depends on BR2_TOOLCHAIN_HAS_THREADS # mysql
select BR2_PACKAGE_MYSQL
select BR2_PACKAGE_PHP_EXT_MYSQL
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"
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_USE_MMU # mysql
depends on BR2_TOOLCHAIN_HAS_THREADS # mysql
select BR2_PACKAGE_MYSQL
help
PDO driver for MySQL
comment "MySQL drivers need a toolchain w/ C++, threads"
depends on BR2_USE_MMU
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
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,69 @@
config BR2_PACKAGE_PHP
bool "php"
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
source "package/php/Config.ext"
config BR2_PACKAGE_PHP_CLI
bool
config BR2_PACKAGE_PHP_CGI
bool
config BR2_PACKAGE_PHP_FPM
bool
choice
prompt "Interface"
default BR2_PACKAGE_PHP_SAPI_CGI
help
Select the PHP interface(s).
config BR2_PACKAGE_PHP_SAPI_CGI
bool "CGI"
# CGI uses fork()
depends on BR2_USE_MMU
select BR2_PACKAGE_PHP_CGI
help
Common Gateway Interface
config BR2_PACKAGE_PHP_SAPI_CLI
bool "CLI"
select BR2_PACKAGE_PHP_CLI
help
Command Line Interface
config BR2_PACKAGE_PHP_SAPI_FPM
bool "FPM"
depends on BR2_USE_MMU
select BR2_PACKAGE_PHP_FPM
help
PHP-FPM (FastCGI Process Manager)
config BR2_PACKAGE_PHP_SAPI_CLI_CGI
bool "CGI and CLI"
# CGI uses fork()
depends on BR2_USE_MMU
select BR2_PACKAGE_PHP_CLI
select BR2_PACKAGE_PHP_CGI
help
Command line and Common gateway interfaces
config BR2_PACKAGE_PHP_SAPI_CLI_FPM
bool "FPM and CLI"
depends on BR2_USE_MMU
select BR2_PACKAGE_PHP_CLI
select BR2_PACKAGE_PHP_FPM
help
Command line and PHP-FPM (FastCGI Process Manager)
endchoice
endif

View File

@@ -0,0 +1,14 @@
[www]
# Only start children when there are requests to be processed
pm = ondemand
# Terminate them again after there haven't been any for 2 minutes
pm.process_idle_timeout = 120s
# Maximum number of children processing PHP requests concurrently
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,2 @@
# From http://php.net/downloads.php
sha256 54dd9106c3469bc7028644d72ac140af00655420bbaaf4a742a64e9ed02ec1b0 php-5.6.18.tar.xz

View File

@@ -0,0 +1,337 @@
################################################################################
#
# php
#
################################################################################
PHP_VERSION = 5.6.18
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
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-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 ($(BR2_TARGET_LOCALTIME),)
PHP_LOCALTIME = UTC
else
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_CLI),,--disable-cli)
PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_CGI),,--disable-cgi)
PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_FPM),--enable-fpm,--disable-fpm)
### 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 MySQL extensions
ifeq ($(BR2_PACKAGE_PHP_EXT_MYSQL),y)
PHP_CONF_OPTS += --with-mysql=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += mysql
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_MYSQLI),y)
PHP_CONF_OPTS += --with-mysqli=$(STAGING_DIR)/usr/bin/mysql_config
PHP_DEPENDENCIES += mysql
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=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += 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
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_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))