[packages] lsqlite3: fix build failure with cs toolchain (same as [18192])
[openwrt/svn-archive/archive.git] / lang / php5 / Makefile
index d28e3ebeed4712a4b3bcdbcc49e6106c025cfe96..8f662ee79c8387505e2e292c83c416b84d91451e 100644 (file)
@@ -1,20 +1,19 @@
 # 
-# Copyright (C) 2006,2007 OpenWrt.org
+# Copyright (C) 2006-2009 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
-# $Id$
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=php
-PKG_VERSION:=5.2.5
-PKG_RELEASE:=1
+PKG_VERSION:=5.2.6
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.php.net/distributions/
-PKG_MD5SUM:=1fe14ca892460b09f06729941a1bb605
+PKG_MD5SUM:=7380ffecebd95c6edb317ef861229ebd
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -31,9 +30,34 @@ define Package/php5/Default/description
  suited for Web development and can be embedded into HTML.
 endef
 
+define Package/php5/config
+       choice
+               prompt "PHP5 SPL Options"
+                          depends PACKAGE_php5
+               default PACKAGE_php5_without_spl
+
+       config PACKAGE_php5_with_spl
+               bool "With SPL (and pcre) static"
+
+       config PACKAGE_php5_without_spl
+               bool "without SPL (pcre may be enabled)"
+       endchoice
+
+          config PHP5_APC
+               bool "PHP5 APC support"
+
+          config PHP5_EXIF
+               bool "PHP5 EXIF support"
+endef
+
 define Package/php5
   $(call Package/php5/Default)
-  DEPENDS:=+libopenssl +zlib
+       ifneq ($(CONFIG_PACKAGE_php5_with_spl),)
+               DEPENDS:=+libopenssl +zlib
+               CONFIG_PACKAGE_php5-mod-pcre:=
+       else
+               DEPENDS:=+libopenssl +zlib +libpcre
+       endif
 endef
 
 define Package/php5/description
@@ -147,16 +171,22 @@ define Package/php5-mod-sqlite
   TITLE:=SQLite module
 endef
 
-define Package/php5-mod-xml
+define Package/php5-mod-pdo
   $(call Package/php5/Default)
-  DEPENDS:=php5 +libexpat
-  TITLE:=XML module
+  DEPENDS:=php5
+  TITLE:=PHP Data Objects module
 endef
 
-define Package/php5-mod-apc
+define Package/php5-mod-pdo-sqlite
   $(call Package/php5/Default)
-  DEPENDS:=php5
-  TITLE:=APC Extension
+  DEPENDS:=php5-mod-pdo +libsqlite3
+  TITLE:=PHP Data Objects module - SQLite support
+endef
+
+define Package/php5-mod-xml
+  $(call Package/php5/Default)
+  DEPENDS:=php5 +libexpat
+  TITLE:=XML module
 endef
 
 PKG_CONFIGURE_LIBS:= -lcrypto -lssl
@@ -166,10 +196,8 @@ PKG_CONFIGURE_OPTS:= \
        --disable-rpath \
        --disable-debug \
        --without-pear \
-       --disable-spl \
        \
        --with-config-file-path=/etc \
-       --disable-ipv6 \
        --enable-magic-quotes \
        --enable-memory-limit \
        --disable-short-tags \
@@ -208,7 +236,11 @@ ifneq ($(SDK),)
   CONFIG_PACKAGE_php5-mod-gmp:=m
   CONFIG_PACKAGE_php5-mod-ldap:=m
   CONFIG_PACKAGE_php5-mod-mysql:=m
-  CONFIG_PACKAGE_php5-mod-pcre:=m
+  ifneq ($(CONFIG_PACKAGE_php5_with_spl),)
+       CONFIG_PACKAGE_php5-mod-pcre:=n
+  else
+       CONFIG_PACKAGE_php5-mod-pcre:=m
+  endif
   CONFIG_PACKAGE_php5-mod-pgsql:=m
   CONFIG_PACKAGE_php5-mod-sqlite:=m
   CONFIG_PACKAGE_php5-mod-xml:=m
@@ -248,11 +280,17 @@ ifneq ($(CONFIG_PACKAGE_php5-mod-mysql),)
 else
   PKG_CONFIGURE_OPTS+= --without-mysql
 endif
+ifneq ($(CONFIG_PACKAGE_php5_with_spl),)
+  PKG_CONFIGURE_OPTS+= --with-pcre-dir="$(STAGING_DIR)/usr"
+  PKG_CONFIGURE_OPTS+= --enable-spl
+else
+  PKG_CONFIGURE_OPTS+= --disable-spl
 ifneq ($(CONFIG_PACKAGE_php5-mod-pcre),)
   PKG_CONFIGURE_OPTS+= --with-pcre-regex=shared,"$(STAGING_DIR)/usr"
 else
   PKG_CONFIGURE_OPTS+= --without-pcre-regex
 endif
+endif
 ifneq ($(CONFIG_PACKAGE_php5-mod-pgsql),)
   PKG_CONFIGURE_OPTS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
 else
@@ -263,18 +301,31 @@ ifneq ($(CONFIG_PACKAGE_php5-mod-sqlite),)
 else
   PKG_CONFIGURE_OPTS+= --without-sqlite
 endif
+ifneq ($(CONFIG_PACKAGE_php5-mod-pdo),)
+  PKG_CONFIGURE_OPTS+= --enable-pdo=shared
+  ifneq ($(CONFIG_PACKAGE_php5-mod-pdo-sqlite),)
+    PKG_CONFIGURE_OPTS+= --with-pdo-sqlite=shared,"$(STAGING_DIR)/usr"
+  endif
+else
+  PKG_CONFIGURE_OPTS+= --disable-pdo
+endif
 ifneq ($(CONFIG_PACKAGE_php5-mod-xml),)
   PKG_CONFIGURE_OPTS+= --enable-xml=shared,"$(STAGING_DIR)/usr" \
        --with-libexpat-dir="$(STAGING_DIR)/usr"
 else
   PKG_CONFIGURE_OPTS+= --disable-xml
 endif
-ifneq ($(CONFIG_PACKAGE_php5-mod-apc),)
+ifneq ($(CONFIG_PHP5_APC),)
   PKG_CONFIGURE_OPTS+= --enable-apc --disable-apc-mmap --disable-apc-pthreadmutex
   PKG_CONFIGURE_LIBS+= -lrt
 else
   PKG_CONFIGURE_OPTS+= --disable-apc
 endif
+ifneq ($(CONFIG_PHP5_EXIF),)
+  PKG_CONFIGURE_OPTS+= --enable-exif
+else
+  PKG_CONFIGURE_OPTS+= --disable-exif
+endif
 
 define Build/Configure
 endef
@@ -374,7 +425,8 @@ define BuildPlugin
   define Package/$(1)/install
        [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/php
        for m in $(2); do \
-               $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$$$$$$$${m}.so $$(1)/usr/lib/php/ ; \
+               [ -z "$(CONFIG_PACKAGE_$(1))" ] \
+                        || $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$$$$$$$${m}.so $$(1)/usr/lib/php/ ; \
        done
   endef
 
@@ -397,5 +449,6 @@ $(eval $(call BuildPlugin,php5-mod-pgsql,pgsql))
 $(eval $(call BuildPlugin,php5-mod-session,session))
 $(eval $(call BuildPlugin,php5-mod-sockets,sockets))
 $(eval $(call BuildPlugin,php5-mod-sqlite,sqlite))
+$(eval $(call BuildPlugin,php5-mod-pdo,pdo))
+$(eval $(call BuildPlugin,php5-mod-pdo-sqlite,pdo_sqlite))
 $(eval $(call BuildPlugin,php5-mod-xml,xml))
-$(eval $(call BuildPlugin,php5-mod-apc))