ettercap: Fix parallel build
[openwrt/svn-archive/archive.git] / lang / php4 / Makefile
index f3bdc99d7c5f361bcda6391af627a87329808250..867ae9d8bd606cd4ced01603d3ad3bc96bb4563b 100644 (file)
@@ -1,75 +1,79 @@
-# 
-# Copyright (C) 2006 OpenWrt.org
+#
+# Copyright (C) 2006-2010 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:=4.3.11
-PKG_RELEASE:=2
+PKG_NAME:=php4
+PKG_VERSION:=4.4.7
+PKG_RELEASE:=3
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE:=php-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://fr.php.net/distributions/
-PKG_MD5SUM:=fbc67d240812136a9842bc1f2a217b7a
-PKG_CAT:=bzcat
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_MD5SUM:=3f21b44d37a57ca3876d3aea713c700d
+PKG_BUILD_DIR:=$(BUILD_DIR)/php-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 
 define Package/php4/Default
+  SUBMENU:=PHP
   SECTION:=lang
   CATEGORY:=Languages
   TITLE:=PHP4 Hypertext preprocessor
-  DESCRIPTION:=\
-       PHP is a widely-used general-purpose scripting language that is especially \\\
-       suited for Web development and can be embedded into HTML.
+  DEPENDS:=@!TARGET_ixp4xx
   URL:=http://www.php.net/
 endef
 
+define Package/php4/Default/description
+ PHP is a widely-used general-purpose scripting language that is especially
+ suited for Web development and can be embedded into HTML.
+endef
+
 define Package/php4
   $(call Package/php4/Default)
   DEPENDS:=+libopenssl +zlib
-  DESCRIPTION+=\\\
-       \\\
-       This package contains only the PHP config file. You must actually choose your \\\
-       PHP flavour (cli, cgi or fastcgi).
-  MENU:=1
 endef
 
-define Package/php4/conffiles
-/etc/php.ini
+define Package/php4/description
+$(call Package/php4/Default/description)
+ This package contains only the PHP config file. You must actually choose
+ your PHP flavour (cli, cgi or fastcgi).
 endef
 
 define Package/php4-cli
   $(call Package/php4/Default)
   DEPENDS:=php4
   TITLE+= (CLI)
-  DESCRIPTION+=\\\
-       \\\
-       This package contains the CLI version of the PHP4 interpreter.
+endef
+
+define Package/php4-cli/description
+$(call Package/php4/Default/description)
+ This package contains the CLI version of the PHP4 interpreter.
 endef
 
 define Package/php4-cgi
   $(call Package/php4/Default)
   DEPENDS:=php4
   TITLE+= (CGI)
-  DESCRIPTION+=\\\
-       \\\
-       This package contains the CGI version of the PHP4 interpreter.
+endef
+
+define Package/php4-cgi/description
+$(call Package/php4/Default/description)
+ This package contains the CGI version of the PHP4 interpreter.
 endef
 
 define Package/php4-fastcgi
   $(call Package/php4/Default)
   DEPENDS:=php4
   TITLE+= (FastCGI)
-  DESCRIPTION+=\\\
-       \\\
-       This package contains the FastCGI version of the PHP4 interpreter.
+endef
+
+define Package/php4-fastcgi/description
+$(call Package/php4/Default/description)
+ This package contains the FastCGI version of the PHP4 interpreter.
 endef
 
 define Package/php4-mod-curl
@@ -138,12 +142,6 @@ define Package/php4-mod-sockets
   TITLE:=Sockets module
 endef
 
-define Package/php4-mod-sqlite
-  $(call Package/php4/Default)
-  DEPENDS:=php4 +libsqlite2
-  TITLE:=SQLite module
-endef
-
 define Package/php4-mod-xml
   $(call Package/php4/Default)
   DEPENDS:=php4 +libexpat
@@ -159,7 +157,6 @@ PKG_CONFIGURE_OPTS:= \
        --without-pear \
        \
        --with-config-file-path=/etc \
-       --disable-ipv6 \
        --enable-magic-quotes \
        --enable-memory-limit \
        --disable-overload \
@@ -182,7 +179,7 @@ PKG_CONFIGURE_OPTS:= \
          --with-zlib-dir="$(STAGING_DIR)/usr" \
 
 ifneq ($(SDK),)
-  PKG_BUILDDEP:=libopenssl zlib libcurl libgd libgmp libopenldap libmysqlclient libpq libsqlite2 libexpat
+  PKG_BUILD_DEPENDS:=libopenssl zlib libcurl libgd libgmp libopenldap libmysqlclient libpq libexpat
 # force PKG_CONFIGURE_{LIBS,OPTS} below when built in the SDK
   CONFIG_PACKAGE_php4-cli:=m
   CONFIG_PACKAGE_php4-cgi:=m
@@ -194,7 +191,6 @@ ifneq ($(SDK),)
   CONFIG_PACKAGE_php4-mod-mysql:=m
   CONFIG_PACKAGE_php4-mod-pcre:=m
   CONFIG_PACKAGE_php4-mod-pgsql:=m
-  CONFIG_PACKAGE_php4-mod-sqlite:=m
   CONFIG_PACKAGE_php4-mod-xml:=m
 endif
 
@@ -242,11 +238,6 @@ ifneq ($(CONFIG_PACKAGE_php4-mod-pgsql),)
 else
   PKG_CONFIGURE_OPTS+= --without-pgsql
 endif
-ifneq ($(CONFIG_PACKAGE_php4-mod-sqlite),)
-  PKG_CONFIGURE_OPTS+= --with-sqlite=shared,"$(STAGING_DIR)/usr"
-else
-  PKG_CONFIGURE_OPTS+= --without-sqlite
-endif
 ifneq ($(CONFIG_PACKAGE_php4-mod-xml),)
   PKG_CONFIGURE_OPTS+= --enable-xml=shared \
        --with-expat-dir="$(STAGING_DIR)/usr"
@@ -257,6 +248,8 @@ endif
 define Build/Configure
 endef
 
+TARGET_CFLAGS += $(if $(CONFIG_BIG_ENDIAN),-DIEEE_BIG_ENDIAN,-DIEEE_LITTLE_ENDIAN) $(FPIC)
+
 ifneq ($(CONFIG_PACKAGE_php4-cli),)
   define Build/Compile/php4-cli
        -$(MAKE) -C $(PKG_BUILD_DIR) clean
@@ -271,7 +264,7 @@ ifneq ($(CONFIG_PACKAGE_php4-cli),)
                LIBS="$(PKG_CONFIGURE_LIBS)" \
                php_cv_cc_rpath="no" \
        )
-       $(MAKE) -C $(PKG_BUILD_DIR)
+       LD_LIBRARY_PATH="" $(MAKE) -C $(PKG_BUILD_DIR)
        mv $(PKG_BUILD_DIR)/sapi/cli/php $(PKG_BUILD_DIR)/php-cli
   endef
 endif
@@ -290,7 +283,7 @@ ifneq ($(CONFIG_PACKAGE_php4-cgi),)
                LIBS="$(PKG_CONFIGURE_LIBS)" \
                php_cv_cc_rpath="no" \
        )
-       $(MAKE) -C $(PKG_BUILD_DIR)
+       LD_LIBRARY_PATH="" $(MAKE) -C $(PKG_BUILD_DIR)
        mv $(PKG_BUILD_DIR)/sapi/cgi/php $(PKG_BUILD_DIR)/php-cgi
   endef
 endif
@@ -309,7 +302,7 @@ ifneq ($(CONFIG_PACKAGE_php4-fastcgi),)
                LIBS="$(PKG_CONFIGURE_LIBS)" \
                php_cv_cc_rpath="no" \
        )
-       $(MAKE) -C $(PKG_BUILD_DIR)
+       LD_LIBRARY_PATH="" $(MAKE) -C $(PKG_BUILD_DIR)
        mv $(PKG_BUILD_DIR)/sapi/cgi/php $(PKG_BUILD_DIR)/php-fastcgi
   endef
 endif
@@ -320,33 +313,37 @@ define Build/Compile
        $(call Build/Compile/php4-fastcgi)
 endef
 
+define Package/php4/conffiles
+/etc/php.ini
+endef
+
 define Package/php4/install
-       install -d -m0755 $(1)/etc
-       install -m0644 ./files/php.ini $(1)/etc/
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_DATA) ./files/php.ini $(1)/etc/
 endef
 
 define Package/php4-cli/install
-       install -d -m0755 $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(PKG_BUILD_DIR)/php-cli $(1)/usr/bin/php
 endef
 
 define Package/php4-cgi/install
-       install -d -m0755 $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(PKG_BUILD_DIR)/php-cgi $(1)/usr/bin/php
 endef
 
 define Package/php4-fastcgi/install
-       install -d -m0755 $(1)/usr/sbin
+       $(INSTALL_DIR) $(1)/usr/sbin
        $(CP) $(PKG_BUILD_DIR)/php-fastcgi $(1)/usr/sbin/php
-       install -d -m0755 $(1)/etc/init.d
-       install -m0755 ./files/php.init $(1)/etc/init.d/php
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/php.init $(1)/etc/init.d/php
 endef
 
 define BuildPlugin
   define Package/$(1)/install
-       [ -z "$(2)" ] || install -d -m0755 $$(1)/usr/lib/php
+       [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/php
        for m in $(2); do \
-               install -m0755 $(PKG_BUILD_DIR)/modules/$$$$$$$${m}.so $$(1)/usr/lib/php/ ; \
+               $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$$$$$$$${m}.so $$(1)/usr/lib/php/ ; \
        done
   endef
 
@@ -368,5 +365,5 @@ $(eval $(call BuildPlugin,php4-mod-pcre,pcre))
 $(eval $(call BuildPlugin,php4-mod-pgsql,pgsql))
 $(eval $(call BuildPlugin,php4-mod-session,session))
 $(eval $(call BuildPlugin,php4-mod-sockets,sockets))
-$(eval $(call BuildPlugin,php4-mod-sqlite,sqlite))
 $(eval $(call BuildPlugin,php4-mod-xml,xml))
+