2007-08-07 19:47:03 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# php
|
|
|
|
#
|
|
|
|
#############################################################
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2011-01-07 19:59:04 +01:00
|
|
|
PHP_VERSION = 5.2.17
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_SOURCE = php-$(PHP_VERSION).tar.bz2
|
|
|
|
PHP_SITE = http://www.php.net/distributions
|
|
|
|
PHP_INSTALL_STAGING = YES
|
|
|
|
PHP_INSTALL_STAGING_OPT = INSTALL_ROOT=$(STAGING_DIR) install
|
|
|
|
PHP_INSTALL_TARGET_OPT = INSTALL_ROOT=$(TARGET_DIR) install
|
|
|
|
PHP_LIBTOOL_PATCH = NO
|
2010-03-22 14:29:00 +01:00
|
|
|
PHP_CONF_OPT = --mandir=/usr/share/man \
|
2009-03-04 21:58:08 +01:00
|
|
|
--infodir=/usr/share/info \
|
|
|
|
--disable-all \
|
|
|
|
--without-pear \
|
|
|
|
--with-config-file-path=/etc \
|
|
|
|
--localstatedir=/var \
|
2007-08-07 19:47:03 +02:00
|
|
|
|
2011-01-02 12:28:35 +01:00
|
|
|
PHP_CFLAGS = $(TARGET_CFLAGS)
|
|
|
|
|
2007-08-07 19:47:03 +02:00
|
|
|
ifneq ($(BR2_PACKAGE_PHP_CLI),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --disable-cli
|
2007-08-07 19:47:03 +02:00
|
|
|
else
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-cli
|
2007-08-07 19:47:03 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(BR2_PACKAGE_PHP_CGI),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --disable-cgi
|
2007-08-07 19:47:03 +02:00
|
|
|
else
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-cgi
|
2007-08-19 23:02:46 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_FASTCGI),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-fastcgi
|
2007-08-19 23:02:46 +02:00
|
|
|
endif
|
2007-08-07 19:47:03 +02:00
|
|
|
endif
|
|
|
|
|
2008-08-04 21:07:05 +02:00
|
|
|
### Extensions
|
2008-03-06 19:21:33 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_SOCKETS),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-sockets
|
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_POSIX),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-posix
|
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_SPL),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-spl
|
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_SESSION),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-session
|
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_OPENSSL),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --with-openssl=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += 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)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-libxml \
|
2007-08-07 19:47:03 +02:00
|
|
|
--with-libxml-dir=${STAGING_DIR}/usr \
|
|
|
|
--enable-xml \
|
|
|
|
--enable-xmlreader \
|
|
|
|
--enable-xmlwriter
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_DEPENDENCIES += libxml2
|
2007-08-07 19:47:03 +02:00
|
|
|
endif
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2008-06-01 20:04:13 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_SIMPLEXML),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-simplexml
|
2008-06-01 20:04:13 +02:00
|
|
|
endif
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2008-03-06 19:21:33 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_ZLIB),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --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
|
|
|
|
2008-03-06 19:21:33 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_EXIF),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-exif
|
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_FTP),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-ftp
|
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_GETTEXT),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --with-gettext=$(STAGING_DIR)/usr
|
2010-05-14 09:44:03 +02:00
|
|
|
PHP_DEPENDENCIES += $(if $(BR2_NEEDS_GETTEXT),gettext)
|
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)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --with-gmp=$(STAGING_DIR)/usr
|
2010-12-06 20:40:08 +01:00
|
|
|
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_JSON),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-json
|
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)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --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
|
|
|
|
2008-03-06 19:21:33 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_NCURSES),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --with-ncurses=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += ncurses
|
2008-03-06 19:21:33 +01:00
|
|
|
endif
|
2009-03-04 21:58:08 +01:00
|
|
|
|
2010-11-15 21:12:49 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_PCNTL),y)
|
|
|
|
PHP_CONF_OPT += --enable-pcntl
|
|
|
|
endif
|
|
|
|
|
2008-03-06 19:21:33 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_SYSVMSG),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-sysvmsg
|
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_SYSVSEM),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-sysvsem
|
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_SYSVSHM),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-sysvshm
|
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_ZIP),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-zip
|
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_FILTER),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-filter
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_CALENDAR),y)
|
|
|
|
PHP_CONF_OPT += --enable-calendar
|
2008-03-06 19:21:33 +01:00
|
|
|
endif
|
2007-08-07 19:47:03 +02:00
|
|
|
|
2009-03-04 21:58:08 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_PCRE),y)
|
|
|
|
PHP_CONF_OPT += --with-pcre-regex
|
|
|
|
endif
|
|
|
|
|
|
|
|
### Legacy sqlite2 support
|
2008-03-06 19:21:33 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_SQLITE),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --with-sqlite
|
2009-02-21 10:06:43 +01:00
|
|
|
ifneq ($(BR2_LARGEFILE),y)
|
2011-01-02 12:28:35 +01:00
|
|
|
PHP_CFLAGS += -DSQLITE_DISABLE_LFS
|
2009-02-21 10:06:43 +01:00
|
|
|
endif
|
2008-03-06 19:21:33 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_SQLITE_UTF8),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-sqlite-utf8
|
2008-03-06 19:21:33 +01:00
|
|
|
endif
|
|
|
|
endif
|
2009-03-04 21:58:08 +01:00
|
|
|
|
|
|
|
### PDO
|
2008-03-06 19:21:33 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --enable-pdo
|
2008-03-06 19:21:33 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_SQLITE),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_SQLITE_EXTERNAL),y)
|
|
|
|
PHP_CONF_OPT += --with-pdo-sqlite=$(STAGING_DIR)/usr
|
2010-06-03 20:45:24 +02:00
|
|
|
PHP_DEPENDENCIES += sqlite
|
2009-03-04 21:58:08 +01:00
|
|
|
else
|
|
|
|
PHP_CONF_OPT += --with-pdo-sqlite
|
|
|
|
endif
|
2011-01-02 12:28:35 +01:00
|
|
|
PHP_CFLAGS += -DSQLITE_OMIT_LOAD_EXTENSION
|
2009-11-23 14:25:24 +01:00
|
|
|
ifneq ($(BR2_LARGEFILE),y)
|
2011-01-02 12:28:35 +01:00
|
|
|
PHP_CFLAGS += -DSQLITE_DISABLE_LFS
|
2009-11-23 14:25:24 +01:00
|
|
|
endif
|
2008-03-06 19:21:33 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_MYSQL),y)
|
2009-03-04 21:58:08 +01:00
|
|
|
PHP_CONF_OPT += --with-pdo-mysql=$(STAGING_DIR)/usr
|
|
|
|
PHP_DEPENDENCIES += mysql_client
|
|
|
|
endif
|
|
|
|
endif
|
2007-08-07 19:47:03 +02:00
|
|
|
|
2010-09-01 17:21:27 +02:00
|
|
|
define PHP_INSTALL_FIXUP
|
2009-03-04 21:58:08 +01:00
|
|
|
rm -rf $(TARGET_DIR)/usr/lib/php
|
|
|
|
rm -f $(TARGET_DIR)/usr/bin/phpize
|
|
|
|
rm -f $(TARGET_DIR)/usr/bin/php-config
|
2009-03-04 21:58:12 +01:00
|
|
|
if [ ! -f $(TARGET_DIR)/etc/php.ini ]; then \
|
|
|
|
$(INSTALL) -m 0755 $(BR2_PACKAGE_PHP_CONFIG) $(TARGET_DIR)/etc/php.ini; fi
|
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
|
|
|
|
2010-09-01 17:21:27 +02:00
|
|
|
define PHP_UNINSTALL_STAGING_CMDS
|
2007-08-19 23:02:46 +02:00
|
|
|
rm -rf $(STAGING_DIR)/usr/include/php
|
2009-03-04 21:58:08 +01:00
|
|
|
rm -rf $(STAGING_DIR)/usr/lib/php
|
|
|
|
rm -f $(STAGING_DIR)/usr/bin/php*
|
|
|
|
rm -f $(STAGING_DIR)/usr/share/man/man1/php*.1
|
2010-09-01 17:21:27 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define PHP_UNINSTALL_TARGET_CMDS
|
2009-03-04 21:58:08 +01:00
|
|
|
rm -f $(TARGET_DIR)/etc/php.ini
|
|
|
|
rm -f $(TARGET_DIR)/usr/bin/php*
|
2010-09-01 17:21:27 +02:00
|
|
|
endef
|
2007-08-07 19:47:03 +02:00
|
|
|
|
2011-01-02 12:28:35 +01:00
|
|
|
PHP_CONF_ENV += CFLAGS="$(PHP_CFLAGS)"
|
|
|
|
|
2010-09-01 17:21:27 +02:00
|
|
|
$(eval $(call AUTOTARGETS,package,php))
|