From f1b112b632ffc618ff7be0592f58ba684b24ae53 Mon Sep 17 00:00:00 2001 From: nbd Date: Mon, 18 Jun 2012 15:06:33 +0000 Subject: [PATCH] zaptel-1.4.x: unbreak kernel module build, use cross-ar and cross-ranlib to fix further build issues git-svn-id: svn://svn.openwrt.org/openwrt/packages@32425 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- libs/zaptel-1.4.x/Makefile | 6 ++++-- libs/zaptel-1.4.x/patches/371-3.x.patch | 23 +++++++++++++++++++++++ libs/zaptel-1.4.x/patches/380-use_cross_ar.patch | 23 +++++++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 libs/zaptel-1.4.x/patches/371-3.x.patch create mode 100644 libs/zaptel-1.4.x/patches/380-use_cross_ar.patch diff --git a/libs/zaptel-1.4.x/Makefile b/libs/zaptel-1.4.x/Makefile index 69adbb471..0e246d99a 100644 --- a/libs/zaptel-1.4.x/Makefile +++ b/libs/zaptel-1.4.x/Makefile @@ -22,13 +22,13 @@ include $(INCLUDE_DIR)/package.mk define Package/zaptel14/Default TITLE:=Zaptel URL:=http://ftp.digium.com/pub/zaptel/releases - DEPENDS:=@BROKEN + DEPENDS:= endef define KernelPackage/zaptel14/Default TITLE:=Zaptel (kernel module) SUBMENU:=Other modules - DEPENDS:=@BROKEN + DEPENDS:= endef define KernelPackage/zaptel14 @@ -131,6 +131,8 @@ define Build/Compile/user $(MAKE) -C $(PKG_BUILD_DIR) \ ARCH="$(LINUX_KARCH)" \ DESTDIR="$(PKG_INSTALL_DIR)" \ + AR="$(TARGET_CROSS)ar" \ + RANLIB="$(TARGET_CROSS)ranlib" \ install-libs install-include zttest ztcfg zttool ztdiag fxotune ztmonitor ztscan ztspeed fxstest endef diff --git a/libs/zaptel-1.4.x/patches/371-3.x.patch b/libs/zaptel-1.4.x/patches/371-3.x.patch new file mode 100644 index 000000000..0404a4b1f --- /dev/null +++ b/libs/zaptel-1.4.x/patches/371-3.x.patch @@ -0,0 +1,23 @@ +--- a/kernel/zaptel-base.c ++++ b/kernel/zaptel-base.c +@@ -5182,14 +5182,20 @@ static int zt_ioctl(struct inode *inode, + } + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ++#ifdef CONFIG_BKL + #include ++#endif + static long zt_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long data) + { + int ret; + ++#ifdef CONFIG_BKL + lock_kernel(); ++#endif + ret = zt_ioctl(file->f_path.dentry->d_inode, file, cmd, data); ++#ifdef CONFIG_BKL + unlock_kernel(); ++#endif + + return ret; + } diff --git a/libs/zaptel-1.4.x/patches/380-use_cross_ar.patch b/libs/zaptel-1.4.x/patches/380-use_cross_ar.patch new file mode 100644 index 000000000..90f8ef54c --- /dev/null +++ b/libs/zaptel-1.4.x/patches/380-use_cross_ar.patch @@ -0,0 +1,23 @@ +--- a/Makefile ++++ b/Makefile +@@ -30,6 +30,9 @@ else + UNAME_M:=$(DEB_HOST_GNU_TYPE) + endif + ++AR ?= ar ++RANLIB ?= ranlib ++ + # If you want to build for a kernel other than the current kernel, set KVERS + ifndef KVERS + KVERS:=$(shell uname -r) +@@ -352,8 +355,8 @@ ztspeed: CFLAGS= + sethdlc-new: CFLAGS+=-I$(KINCLUDES) + + $(LTZ_A): $(LTZ_A_OBJS) +- ar rcs $@ $^ +- ranlib $@ ++ $(AR) rcs $@ $^ ++ $(RANLIB) $@ + + $(LTZ_SO): $(LTZ_SO_OBJS) + $(CC) $(CFLAGS) -shared -Wl,-soname,$(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) -o $@ $^ $(LDFLAGS) $(LDLIBS) -lm -- 2.11.0