[packages] zaptel: update and fix kernel module build for 2.6.34
[openwrt/svn-archive/archive.git] / libs / zaptel-1.4.x / Makefile
index 9688d59d963e5f21aad904146479d934f9e2c555..5cd9deed6313f747958e2dce2ec23bb63449e5cd 100644 (file)
 # 
-# Copyright (C) 2006 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: Makefile 5624 2006-11-23 00:29:07Z nbd $
 
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=zaptel
-PKG_VERSION:=1.4.9.2
+PKG_VERSION:=1.4.12.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://ftp.digium.com/pub/zaptel/releases/
-PKG_MD5SUM:=f6af404cc0244b93a2fc88b237f374bd
+PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/zaptel/releases/ \
+        http://ftp.digium.com/pub/zaptel/releases/
+PKG_MD5SUM:=71e83a020b020fa60905edecf70e95a3
 
 include $(INCLUDE_DIR)/package.mk
 
 define Package/zaptel14/Default
-       TITLE:=Zaptel
-       URL:=http://ftp.digium.com/pub/zaptel/releases
+  TITLE:=Zaptel
+  URL:=http://ftp.digium.com/pub/zaptel/releases
 endef
 
 define KernelPackage/zaptel14
-       SUBMENU:=Other modules
-       $(call Package/zaptel14/Default)
-       TITLE+= (kernel module)
-       VERSION:=$(LINUX_VERSION)-$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)
-       FILES:=$(PKG_BUILD_DIR)/kernel/zaptel.$(LINUX_KMOD_SUFFIX) \
-               $(PKG_BUILD_DIR)/kernel/ztdummy.$(LINUX_KMOD_SUFFIX)
-       AUTOLOAD:=$(call AutoLoad,70,zaptel ztdummy)
+  $(call Package/zaptel14/Default)
+  SUBMENU:=Other modules
+  TITLE+= (kernel module)
+  KCONFIG:=CONFIG_FTRACE=y \
+                       CONFIG_TRACING \
+                       CONFIG_KMEMTRACE
+  FILES:=$(PKG_BUILD_DIR)/kernel/zaptel.$(LINUX_KMOD_SUFFIX) \
+       $(PKG_BUILD_DIR)/kernel/ztdummy.$(LINUX_KMOD_SUFFIX)
+  AUTOLOAD:=$(call AutoLoad,70,zaptel ztdummy)
 endef
 
 define KernelPackage/zaptel14/description
      This package contains the Zaptel core module and ztdummy driver.
+ This package contains the Zaptel core module and ztdummy driver.
 endef
 
 define Package/zaptel14-util
-       $(call Package/zaptel14/Default)
-       SECTION:=utils
-       CATEGORY:=Utilities
-       TITLE+= utils
-       DEPENDS := +kmod-zaptel14
+  $(call Package/zaptel14/Default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE+= utils
+  DEPENDS += +kmod-zaptel14
 endef
 
 define Package/zaptel14-util/description
      This package contains the zttest program
+ This package contains the zttest program
 endef
 
 define Package/zaptel14-libtonezone
-       $(call Package/zaptel14/Default)
-       SECTION:=libs
-       CATEGORY:=Libraries
-       TITLE+= libtonezone (library)
-       DEPENDS := +kmod-zaptel14
+  $(call Package/zaptel14/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= libtonezone (library)
+  DEPENDS += +kmod-zaptel14
 endef
 
 define Package/zaptel14-libtonezone/description
      This package contains the libraries for accessing zaptel/dummy drivers.
+ This package contains the libraries for accessing zaptel/dummy drivers.
 endef
 
-define Build/Compile/zaptel14
+MAKE_FLAGS:= \
+       ARCH="$(LINUX_KARCH)" \
+       CC="$(TARGET_CC) $(TARGET_CFLAGS)" \
+       LD="$(TARGET_CROSS)ld" \
+       CROSS_COMPILE="$(TARGET_CROSS)" \
+       KVERS="$(LINUX_VERSION)" \
+       KSRC="$(LINUX_DIR)" \
+       TOPDIR_MODULES="zaptel ztdummy" \
+       SUBDIR_MODULES=""
+
+define Build/Compile/kmod
        $(MAKE) -C $(PKG_BUILD_DIR) \
-               DESTDIR="$(PKG_INSTALL_DIR)" \
-               ARCH="$(LINUX_KARCH)" \
-               CC=$(KERNEL_CC) \
-               LD=$(TARGET_CROSS)ld \
-               HOSTCC=$(HOSTCC) \
-               KVERS=$(LINUX_VERSION) \
-               KSRC=$(LINUX_DIR) \
-               KFLAGS_PPC="-G 0 -mno-abicalls -fno-pic -pipe -finline-limit=100000 -mabi=32 $(TARGET_CFLAGS) -mlong-calls -fno-common -nostdinc -iwithprefix include" \
-               TOPDIR_MODULES="zaptel ztdummy" \
-               SUBDIR_MODULES="" \
-               modules zttest
+               $(MAKE_FLAGS) \
+               modules
 endef
 
-define Build/Compile/zaptel14-libtonezone
+define Build/Compile/user
        $(MAKE) -C $(PKG_BUILD_DIR) \
+               ARCH="$(LINUX_KARCH)" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
-               CC=$(TARGET_CC) \
-               LD=$(TARGET_CROSS)ld \
-               AR=$(TARGET_CROSS)ar \
-               KSRC=$(LINUX_DIR) \
-               HOSTCC=$(HOSTCC) \
-               install-libs install-include
+               install-libs install-include zttest
 endef
 
 define Build/Compile
-       $(call Build/Compile/zaptel14)
-       $(call Build/Compile/zaptel14-libtonezone)
+       $(call Build/Compile/kmod)
+       $(call Build/Compile/user)
 endef
 
 define Build/InstallDev
-       $(INSTALL_DIR)  $(STAGING_DIR)/usr/include/zaptel/
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/zaptel/zaptel.h $(STAGING_DIR)/usr/include/zaptel/
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/zaptel/tonezone.h $(STAGING_DIR)/usr/include/zaptel/
-       $(INSTALL_DIR)  $(STAGING_DIR)/usr/lib/
-       $(INSTALL_DATA)  $(PKG_INSTALL_DIR)/usr/lib/libtonezone* $(STAGING_DIR)/usr/lib/
+       $(INSTALL_DIR)  $(STAGING_DIR)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/zaptel $(STAGING_DIR)/usr/include/
+       $(INSTALL_DIR)  $(STAGING_DIR)/usr/lib
+       $(CP)  $(PKG_INSTALL_DIR)/usr/lib/libtonezone.* $(STAGING_DIR)/usr/lib/
 endef
 
 define Package/zaptel14-util/install
@@ -108,7 +106,7 @@ endef
 
 define Package/zaptel14-libtonezone/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libtonezone.so.* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtonezone.so.* $(1)/usr/lib/
 endef
 
 $(eval $(call KernelPackage,zaptel14))