kumquat-buildroot/package/php/php.mk

186 lines
4.4 KiB
Makefile
Raw Normal View History

2007-08-07 19:47:03 +02:00
#############################################################
#
# php
#
#############################################################
PHP_VERSION = 5.2.9
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
PHP_DEPENDENCIES = uclibc
PHP_CONF_OPT = $(DISABLE_IPV6) \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-all \
--without-pear \
--with-config-file-path=/etc \
--localstatedir=/var \
2007-08-07 19:47:03 +02:00
ifneq ($(BR2_PACKAGE_PHP_CLI),y)
PHP_CONF_OPT += --disable-cli
2007-08-07 19:47:03 +02:00
else
PHP_CONF_OPT += --enable-cli
2007-08-07 19:47:03 +02:00
endif
ifneq ($(BR2_PACKAGE_PHP_CGI),y)
PHP_CONF_OPT += --disable-cgi
2007-08-07 19:47:03 +02:00
else
PHP_CONF_OPT += --enable-cgi
ifeq ($(BR2_PACKAGE_PHP_FASTCGI),y)
PHP_CONF_OPT += --enable-fastcgi
endif
2007-08-07 19:47:03 +02:00
endif
### Extensions
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_SOCKETS),y)
PHP_CONF_OPT += --enable-sockets
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_POSIX),y)
PHP_CONF_OPT += --enable-posix
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_SPL),y)
PHP_CONF_OPT += --enable-spl
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_SESSION),y)
PHP_CONF_OPT += --enable-session
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_OPENSSL),y)
PHP_CONF_OPT += --with-openssl=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += openssl
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_LIBXML2),y)
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
PHP_DEPENDENCIES += libxml2
2007-08-07 19:47:03 +02:00
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_SIMPLEXML),y)
PHP_CONF_OPT += --enable-simplexml
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_ZLIB),y)
PHP_CONF_OPT += --with-zlib=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += zlib
2007-08-07 19:47:03 +02:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_EXIF),y)
PHP_CONF_OPT += --enable-exif
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_FTP),y)
PHP_CONF_OPT += --enable-ftp
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_GETTEXT),y)
PHP_CONF_OPT += --with-gettext=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += gettext
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_GMP),y)
PHP_CONF_OPT += --with-gmp=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += libgmp
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_JSON),y)
PHP_CONF_OPT += --enable-json
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_READLINE),y)
PHP_CONF_OPT += --with-readline=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += readline
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_NCURSES),y)
PHP_CONF_OPT += --with-ncurses=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += ncurses
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_SYSVMSG),y)
PHP_CONF_OPT += --enable-sysvmsg
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_SYSVSEM),y)
PHP_CONF_OPT += --enable-sysvsem
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_SYSVSHM),y)
PHP_CONF_OPT += --enable-sysvshm
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_ZIP),y)
PHP_CONF_OPT += --enable-zip
2008-03-06 19:21:33 +01:00
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_FILTER),y)
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
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)
PHP_CONF_OPT += --with-sqlite
ifneq ($(BR2_LARGEFILE),y)
PHP_CONF_ENV += CFLAGS+=" -DSQLITE_DISABLE_LFS"
endif
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_SQLITE_UTF8),y)
PHP_CONF_OPT += --enable-sqlite-utf8
2008-03-06 19:21:33 +01:00
endif
endif
### PDO
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO),y)
PHP_CONF_OPT += --enable-pdo
2008-03-06 19:21:33 +01:00
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_SQLITE),y)
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_SQLITE_EXTERNAL),y)
PHP_CONF_OPT += --with-pdo-sqlite=$(STAGING_DIR)/usr
else
PHP_CONF_OPT += --with-pdo-sqlite
endif
PHP_CONF_ENV += CFLAGS+=" -DSQLITE_OMIT_LOAD_EXTENSION"
2008-03-06 19:21:33 +01:00
endif
ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_MYSQL),y)
PHP_CONF_OPT += --with-pdo-mysql=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += mysql_client
endif
endif
2007-08-07 19:47:03 +02:00
$(eval $(call AUTOTARGETS,package,php))
2007-08-07 19:47:03 +02:00
$(PHP_HOOK_POST_INSTALL):
rm -rf $(TARGET_DIR)/usr/lib/php
rm -f $(TARGET_DIR)/usr/bin/phpize
rm -f $(TARGET_DIR)/usr/bin/php-config
if [ ! -f $(TARGET_DIR)/etc/php.ini ]; then \
$(INSTALL) -m 0755 $(BR2_PACKAGE_PHP_CONFIG) $(TARGET_DIR)/etc/php.ini; fi
2009-03-05 22:38:36 +01:00
touch $@
$(PHP_TARGET_UNINSTALL):
$(call MESSAGE,"Uninstalling")
rm -rf $(STAGING_DIR)/usr/include/php
rm -rf $(STAGING_DIR)/usr/lib/php
rm -f $(STAGING_DIR)/usr/bin/php*
rm -f $(STAGING_DIR)/usr/share/man/man1/php*.1
rm -f $(TARGET_DIR)/etc/php.ini
rm -f $(TARGET_DIR)/usr/bin/php*
rm -f $(PHP_TARGET_INSTALL_TARGET) $(PHP_HOOK_POST_INSTALL)
2007-08-07 19:47:03 +02:00