add missing SH_FUNC for remaining md5s calls (#7888)
[openwrt/svn-archive/archive.git] / package / ifxmips-dsl-api / Makefile
index 992c241e14337e3e092a29eea58ddbe787004874..f34932e39be1350d17100a53a20f432c481f91ad 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2009 OpenWrt.org
+# Copyright (C) 2009-2010 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -12,11 +12,16 @@ include $(INCLUDE_DIR)/kernel.mk
 PKG_NAME:=ifxmips-dsl-api
 PKG_BASE_NAME:=drv_dsl_cpe_api_danube
 PKG_VERSION:=3.24.4.4
+PKG_RELEASE:=2
 PKG_SOURCE:=$(PKG_BASE_NAME)-$(PKG_VERSION).tar.gz
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/drv_dsl_cpe_api-$(PKG_VERSION)
 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
 PKG_MD5SUM:=c45bc531c1ed2ac80f68fb986b63bb87
 
+ifeq ($(DUMP),)
+  STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell $(SH_FUNC) grep '^CONFIG_IFXMIPS_DSL_' $(TOPDIR)/.config | md5s)
+endif
+
 FW_BASE_NAME:=dsl_danube_firmware_adsl
 FW_A_VER:=02.04.04.00.00.01
 FW_B_VER:=02.04.01.07.00.02
@@ -25,6 +30,8 @@ FW_B_FILE_VER:=241702
 FW_A_MD5:=f717db3067a0049a26e233ab11238710
 FW_B_MD5:=349de7cd20368f4ac9b7e8322114a512
 
+PATCH_DIR ?= ./patches$(if $(wildcard ./patches-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
+
 include $(INCLUDE_DIR)/package.mk
 
 define KernelPackage/ifxmips-dsl-api
@@ -33,12 +40,13 @@ define KernelPackage/ifxmips-dsl-api
   SUBMENU:=Network Devices
   TITLE:=DSL CPE API driver
   URL:=http://www.infineon.com/
-  MAINTAINER:=Infineon Technologies AG / Lantiq / blogic@openwrt.org
-  DEPENDS:=@TARGET_ifxmips
-  FILES:=$(PKG_BUILD_DIR)/src/mei/ifxmips_mei.$(LINUX_KMOD_SUFFIX) \
-       $(PKG_BUILD_DIR)/src/drv_dsl_cpe_api.$(LINUX_KMOD_SUFFIX) \
-       $(PKG_BUILD_DIR)/src/mei/ifxmips_atm.$(LINUX_KMOD_SUFFIX)
+  MAINTAINER:=Infineon Technologies AG / Lantiq / John Crispin <blogic@openwrt.org>
+  DEPENDS:=@TARGET_ifxmips +kmod-atm @BROKEN
+  FILES:=$(PKG_BUILD_DIR)/src/mei/ifxmips_mei.ko \
+       $(PKG_BUILD_DIR)/src/drv_dsl_cpe_api.ko \
+       $(PKG_BUILD_DIR)/src/mei/ifxmips_atm.ko
   AUTOLOAD:=$(call AutoLoad,50,ifxmips_mei drv_dsl_cpe_api ifxmips_atm)
+  MENU:=1
 endef
 
 define KernelPackage/ifxmips-dsl-api/description
@@ -57,6 +65,17 @@ define KernelPackage/ifxmips-dsl-api/config
        source "$(SOURCE)/Config.in"
 endef
 
+ifeq ($(CONFIG_IFXMIPS_DSL_FIRMWARE),y)
+FW_FILE:=arcor_A800_452CPW_FW_1.02.206(20081201).bin
+define Download/firmware
+  URL:=http://www.arcor.de/hilfe/files/pdf/
+  FILE=$(FW_FILE)
+  MD5SUM:=19d9af4e369287a0f0abaed415cdac10
+endef
+$(eval $(call Download,firmware))
+
+else
+
 define Download/annex-a
        FILE:=$(FW_BASE_NAME)_a-$(FW_A_VER).tar.gz
        URL:=http://mirror2.openwrt.org/sources/
@@ -70,6 +89,7 @@ define Download/annex-b
        MD5SUM:=$(FW_B_MD5)
 endef
 $(eval $(call Download,annex-b))
+endif
 
 IFX_DSL_MAX_DEVICE=1
 IFX_DSL_LINES_PER_DEVICE=1
@@ -81,8 +101,6 @@ CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \
        --with-channels-per-line="$(IFX_DSL_CHANNELS_PER_LINE)" \
        --enable-danube \
        --enable-add-drv-cflags="-DMODULE" \
-       --enable-debug=yes \
-       --enable-debug-prints=yes \
        --disable-dsl-delt-static \
        --disable-adsl-led \
        --enable-dsl-ceoc \
@@ -103,13 +121,27 @@ CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \
 
 EXTRA_CFLAGS = -fno-pic -mno-abicalls -mlong-calls -G 0
 
+ifeq ($(CONFIG_IFXMIPS_DSL_DEBUG),y)
+CONFIGURE_ARGS += \
+       --enable-debug=yes \
+       --enable-debug-prints=yes
+EXTRA_CFLAGS += -DDEBUG
+endif
+
 define Build/Prepare
        $(PKG_UNPACK)
        $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/mei/ 
        $(CP) ./src/* $(PKG_BUILD_DIR)/src/mei/
        $(Build/Patch)
+ifeq ($(CONFIG_IFXMIPS_DSL_FIRMWARE),)
        $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(FW_BASE_NAME)_a-$(FW_A_VER).tar.gz
        $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(FW_BASE_NAME)_b-$(FW_B_VER).tar.gz
+endif
+endef
+
+define Build/Configure
+       (cd $(PKG_BUILD_DIR); aclocal && autoconf && automake)
+       $(call Build/Configure/Default)
 endef
 
 define Build/Compile
@@ -135,7 +167,12 @@ endef
 
 define KernelPackage/ifxmips-dsl-api/install
        $(INSTALL_DIR) $(1)/lib/firmware/
+ifeq ($(CONFIG_IFXMIPS_DSL_FIRMWARE),y)
+       $(PLATFORM_DIR)/extract.sh $(DL_DIR) '$(FW_FILE)' 
+       $(CP) $(DL_DIR)/dsl_$(if $(CONFIG_IFXMIPS_ANNEX_A),a,b).bin $(1)/lib/firmware/ModemHWE.bin
+else
        $(CP) $(PKG_BUILD_DIR)/$(FW_BASE_NAME)_$(if $(CONFIG_IFXMIPS_ANNEX_A),a_$(FW_A_FILE_VER),b_$(FW_B_FILE_VER)).bin $(1)/lib/firmware/ModemHWE.bin
+endif
 endef
 
 $(eval $(call KernelPackage,ifxmips-dsl-api))