2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2007-08-07 19:47:03 +02:00
|
|
|
#
|
|
|
|
# php
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2015-05-18 21:52:02 +02:00
|
|
|
PHP_VERSION_MAJOR = 5.6
|
2015-11-28 12:32:20 +01:00
|
|
|
PHP_VERSION = $(PHP_VERSION_MAJOR).16
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_SITE = http://www.php.net/distributions
|
2014-09-19 14:31:19 +02:00
|
|
|
PHP_SOURCE = php-$(PHP_VERSION).tar.xz
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_INSTALL_STAGING = YES
|
2014-09-27 21:32:41 +02:00
|
|
|
PHP_INSTALL_STAGING_OPTS = INSTALL_ROOT=$(STAGING_DIR) install
|
2014-09-27 21:32:40 +02:00
|
|
|
PHP_INSTALL_TARGET_OPTS = INSTALL_ROOT=$(TARGET_DIR) install
|
2013-12-16 13:28:07 +01:00
|
|
|
PHP_DEPENDENCIES = host-pkgconf
|
2012-09-04 06:07:38 +02:00
|
|
|
PHP_LICENSE = PHP
|
|
|
|
PHP_LICENSE_FILES = LICENSE
|
2014-12-24 08:54:24 +01:00
|
|
|
PHP_CONF_OPTS = \
|
|
|
|
--mandir=/usr/share/man \
|
|
|
|
--infodir=/usr/share/info \
|
|
|
|
--disable-all \
|
|
|
|
--without-pear \
|
|
|
|
--with-config-file-path=/etc \
|
|
|
|
--disable-rpath
|
2015-04-09 03:32:30 +02:00
|
|
|
PHP_CONF_ENV = \
|
|
|
|
ac_cv_func_strcasestr=yes \
|
|
|
|
EXTRA_LIBS="$(PHP_EXTRA_LIBS)"
|
2014-01-28 22:26:27 +01:00
|
|
|
|
2015-05-31 13:29:42 +02:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),y)
|
|
|
|
PHP_CONF_ENV += LIBS="$(PHP_STATIC_LIBS)"
|
|
|
|
endif
|
|
|
|
|
2015-11-29 14:55:51 +01:00
|
|
|
ifeq ($(BR2_STATIC_LIBS)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
|
|
|
|
PHP_STATIC_LIBS += -lpthread
|
|
|
|
endif
|
|
|
|
|
2015-05-02 17:10:15 +02:00
|
|
|
ifeq ($(BR2_TARGET_LOCALTIME),)
|
|
|
|
PHP_LOCALTIME = UTC
|
|
|
|
else
|
|
|
|
PHP_LOCALTIME = $(BR2_TARGET_LOCALTIME)
|
|
|
|
endif
|
|
|
|
|
2015-04-08 17:39:28 +02:00
|
|
|
# PHP can't be AUTORECONFed the standard way unfortunately
|
|
|
|
PHP_DEPENDENCIES += host-autoconf host-automake host-libtool
|
|
|
|
define PHP_BUILDCONF
|
2015-04-09 03:02:16 +02:00
|
|
|
cd $(@D) ; $(TARGET_MAKE_ENV) ./buildconf --force
|
2015-04-08 17:39:28 +02:00
|
|
|
endef
|
|
|
|
PHP_PRE_CONFIGURE_HOOKS += PHP_BUILDCONF
|
|
|
|
|
2013-10-24 00:44:13 +02:00
|
|
|
ifeq ($(BR2_ENDIAN),"BIG")
|
2014-01-28 22:26:27 +01:00
|
|
|
PHP_CONF_ENV += ac_cv_c_bigendian_php=yes
|
2013-10-24 00:44:13 +02:00
|
|
|
else
|
2014-01-28 22:26:27 +01:00
|
|
|
PHP_CONF_ENV += ac_cv_c_bigendian_php=no
|
2013-10-24 00:44:13 +02:00
|
|
|
endif
|
2013-02-07 13:35:05 +01:00
|
|
|
PHP_CONFIG_SCRIPTS = php-config
|
2007-08-07 19:47:03 +02:00
|
|
|
|
2011-01-02 12:28:35 +01:00
|
|
|
PHP_CFLAGS = $(TARGET_CFLAGS)
|
|
|
|
|
2015-04-08 17:39:29 +02:00
|
|
|
# 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
|
|
|
|
|
2014-01-28 22:26:27 +01:00
|
|
|
# We need to force dl "detection"
|
2014-12-03 22:41:29 +01:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),)
|
2014-01-28 22:26:27 +01:00
|
|
|
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
|
|
|
|
|
2014-09-27 21:32:44 +02:00
|
|
|
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)
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2012-05-21 03:17:54 +02:00
|
|
|
### Extensions
|
2014-12-24 08:54:24 +01:00
|
|
|
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)
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2014-10-05 19:38:58 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_MCRYPT),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-mcrypt=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += libmcrypt
|
2014-10-05 19:38:58 +02:00
|
|
|
endif
|
|
|
|
|
2008-03-06 19:21:33 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_OPENSSL),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-openssl=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += openssl
|
2015-05-11 17:37:46 +02:00
|
|
|
# openssl needs zlib, but the configure script forgets to link against
|
|
|
|
# it causing detection failures with static linking
|
2015-07-26 20:58:32 +02:00
|
|
|
PHP_STATIC_LIBS += `$(PKG_CONFIG_HOST_BINARY) --libs openssl`
|
2008-03-06 19:21:33 +01:00
|
|
|
endif
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2008-03-06 19:21:33 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_LIBXML2),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_ENV += php_cv_libxml_build_works=yes
|
|
|
|
PHP_CONF_OPTS += --enable-libxml --with-libxml-dir=${STAGING_DIR}/usr
|
|
|
|
PHP_DEPENDENCIES += libxml2
|
2007-08-07 19:47:03 +02:00
|
|
|
endif
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2012-06-02 07:32:40 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_WDDX),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --enable-wddx --with-libexpat-dir=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += expat
|
2012-06-02 07:32:40 +02:00
|
|
|
endif
|
|
|
|
|
2012-05-21 03:17:54 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_XMLRPC),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += \
|
|
|
|
--with-xmlrpc \
|
|
|
|
$(if $(BR2_PACKAGE_LIBICONV),--with-iconv-dir=$(STAGING_DIR)/usr)
|
|
|
|
PHP_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv)
|
2008-06-01 20:04:13 +02:00
|
|
|
endif
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2011-11-25 16:49:04 +01:00
|
|
|
ifneq ($(BR2_PACKAGE_PHP_EXT_ZLIB)$(BR2_PACKAGE_PHP_EXT_ZIP),)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-zlib=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += zlib
|
2007-08-07 19:47:03 +02:00
|
|
|
endif
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2012-05-21 03:17:54 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_GETTEXT),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-gettext=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += $(if $(BR2_NEEDS_GETTEXT),gettext)
|
2008-03-06 19:21:33 +01:00
|
|
|
endif
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2012-05-21 03:17:54 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_ICONV),y)
|
|
|
|
ifeq ($(BR2_PACKAGE_LIBICONV),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-iconv=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += libiconv
|
2012-05-21 03:17:54 +02:00
|
|
|
else
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-iconv
|
2012-05-21 03:17:54 +02:00
|
|
|
endif
|
2008-03-06 19:21:33 +01:00
|
|
|
endif
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2012-05-21 03:17:54 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_INTL),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
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++
|
2008-03-06 19:21:33 +01:00
|
|
|
endif
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2008-03-06 19:21:33 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_GMP),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-gmp=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += gmp
|
2008-03-06 19:21:33 +01:00
|
|
|
endif
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2008-03-06 19:21:33 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_READLINE),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-readline=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += readline
|
2008-03-06 19:21:33 +01:00
|
|
|
endif
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2012-05-21 03:17:54 +02:00
|
|
|
### Native MySQL extensions
|
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_MYSQL),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-mysql=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += mysql
|
2012-05-21 03:17:54 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_MYSQLI),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-mysqli=$(STAGING_DIR)/usr/bin/mysql_config
|
|
|
|
PHP_DEPENDENCIES += mysql
|
2012-05-21 03:17:54 +02:00
|
|
|
endif
|
2015-03-08 22:37:09 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_SQLITE),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-sqlite3=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += sqlite
|
2015-07-26 20:58:32 +02:00
|
|
|
PHP_STATIC_LIBS += `$(PKG_CONFIG_HOST_BINARY) --libs sqlite3`
|
2015-03-08 22:37:09 +01:00
|
|
|
endif
|
2012-05-21 03:17:54 +02:00
|
|
|
|
2009-03-04 21:58:08 +01:00
|
|
|
### PDO
|
2008-03-06 19:21:33 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --enable-pdo
|
2008-03-06 19:21:33 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_SQLITE),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-pdo-sqlite=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += sqlite
|
|
|
|
PHP_CFLAGS += -DSQLITE_OMIT_LOAD_EXTENSION
|
2008-03-06 19:21:33 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_MYSQL),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-pdo-mysql=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += mysql
|
2009-03-04 21:58:08 +01:00
|
|
|
endif
|
2014-08-13 15:57:11 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_POSTGRESQL),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-pdo-pgsql=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += postgresql
|
2014-08-13 15:57:11 +02:00
|
|
|
endif
|
2015-03-06 17:49:43 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_UNIXODBC),y)
|
|
|
|
PHP_CONF_OPTS += --with-pdo-odbc=unixODBC,$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += unixodbc
|
|
|
|
endif
|
2009-03-04 21:58:08 +01:00
|
|
|
endif
|
2007-08-07 19:47:03 +02:00
|
|
|
|
2015-05-31 00:55:32 +02:00
|
|
|
define PHP_DISABLE_PCRE_JIT
|
|
|
|
$(SED) '/^#define SUPPORT_JIT/d' $(@D)/ext/pcre/pcrelib/config.h
|
|
|
|
endef
|
|
|
|
|
2012-05-21 03:17:54 +02:00
|
|
|
### Use external PCRE if it's available
|
|
|
|
ifeq ($(BR2_PACKAGE_PCRE),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-pcre-regex=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += pcre
|
2015-05-23 14:57:56 +02:00
|
|
|
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
|
2015-05-31 00:55:32 +02:00
|
|
|
# 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
|
2012-05-21 03:17:54 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_CURL),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-curl=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += libcurl
|
2012-05-21 03:17:54 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_XSL),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-xsl=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += libxslt
|
2012-05-21 03:17:54 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_BZIP2),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-bz2=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += bzip2
|
2012-05-21 03:17:54 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
### DBA
|
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_DBA),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --enable-dba
|
2012-05-21 03:17:54 +02:00
|
|
|
ifneq ($(BR2_PACKAGE_PHP_EXT_DBA_CDB),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --without-cdb
|
2012-05-21 03:17:54 +02:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_PHP_EXT_DBA_FLAT),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --without-flatfile
|
2012-05-21 03:17:54 +02:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_PHP_EXT_DBA_INI),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --without-inifile
|
2012-05-21 03:17:54 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_DBA_DB4),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-db4=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += berkeleydb
|
2012-05-21 03:17:54 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_SNMP),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PHP_CONF_OPTS += --with-snmp=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += netsnmp
|
2012-05-21 03:17:54 +02:00
|
|
|
endif
|
|
|
|
|
2014-10-05 19:38:57 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_GD),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
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
|
2014-10-05 19:38:57 +02:00
|
|
|
endif
|
|
|
|
|
2015-05-01 20:12:33 +02:00
|
|
|
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
|
2015-05-01 20:12:34 +02:00
|
|
|
|
|
|
|
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
|
2015-05-18 21:52:04 +02:00
|
|
|
# remove unused sample status page /usr/php/php/fpm/status.html
|
|
|
|
rm -rf $(TARGET_DIR)/usr/php
|
2015-05-01 20:12:34 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FPM_CONF
|
2015-05-01 20:12:33 +02:00
|
|
|
endif
|
|
|
|
|
2014-01-28 22:26:27 +01:00
|
|
|
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
|
|
|
|
|
2010-09-01 17:21:27 +02:00
|
|
|
define PHP_INSTALL_FIXUP
|
2015-05-18 21:51:59 +02:00
|
|
|
rm -rf $(TARGET_DIR)/usr/lib/php/build
|
2009-03-04 21:58:08 +01:00
|
|
|
rm -f $(TARGET_DIR)/usr/bin/phpize
|
2014-11-30 15:18:59 +01:00
|
|
|
$(INSTALL) -D -m 0755 $(PHP_DIR)/php.ini-production \
|
|
|
|
$(TARGET_DIR)/etc/php.ini
|
2015-05-02 17:10:15 +02:00
|
|
|
$(SED) 's%;date.timezone =.*%date.timezone = $(PHP_LOCALTIME)%' \
|
|
|
|
$(TARGET_DIR)/etc/php.ini
|
2015-05-18 21:52:01 +02:00
|
|
|
$(if $(BR2_PACKAGE_PHP_EXT_OPCACHE),
|
|
|
|
$(SED) '/;extension=php_xsl.dll/azend_extension=opcache.so' \
|
|
|
|
$(TARGET_DIR)/etc/php.ini)
|
2010-09-01 17:21:27 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FIXUP
|
2009-01-25 21:59:30 +01:00
|
|
|
|
2011-01-02 12:28:35 +01:00
|
|
|
PHP_CONF_ENV += CFLAGS="$(PHP_CFLAGS)"
|
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(autotools-package))
|