[packages] libs/zaptel-1.4: Fix compilation on 64-bit hosts and clean up makefile
authorAndy Boyett <agb@openwrt.org>
Mon, 29 Sep 2008 03:38:01 +0000 (03:38 +0000)
committerAndy Boyett <agb@openwrt.org>
Mon, 29 Sep 2008 03:38:01 +0000 (03:38 +0000)
SVN-Revision: 12796

libs/zaptel-1.4.x/Makefile
libs/zaptel-1.4.x/patches/001-Makefile-arch.patch [new file with mode: 0644]

index 9688d59..3a99bfa 100644 (file)
@@ -62,30 +62,34 @@ define Package/zaptel14-libtonezone/description
        This package contains the libraries for accessing zaptel/dummy drivers.
 endef
 
        This package contains the libraries for accessing zaptel/dummy drivers.
 endef
 
-define Build/Compile/zaptel14
+define Build/Compile/zaptel14-template
        $(MAKE) -C $(PKG_BUILD_DIR) \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                ARCH="$(LINUX_KARCH)" \
        $(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) \
+               LD="$(TARGET_CROSS)ld" \
+               AR="$(TARGET_CROSS)ar" \
+               HOSTCC="$(HOSTCC)" \
+               DEB_HOST_GNU_TYPE="$(ARCH)" \
+               KVERS="$(LINUX_VERSION)" \
+               KSRC="$(LINUX_DIR)" \
+               $(1)
+endef
+
+define Build/Compile/zaptel14
+       $(call Build/Compile/zaptel14-template, \
+               CC="$(KERNEL_CC)" \
                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="" \
                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
+               modules zttest \
+       )
 endef
 
 define Build/Compile/zaptel14-libtonezone
 endef
 
 define Build/Compile/zaptel14-libtonezone
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               DESTDIR="$(PKG_INSTALL_DIR)" \
-               CC=$(TARGET_CC) \
-               LD=$(TARGET_CROSS)ld \
-               AR=$(TARGET_CROSS)ar \
-               KSRC=$(LINUX_DIR) \
-               HOSTCC=$(HOSTCC) \
-               install-libs install-include
+       $(call Build/Compile/zaptel14-template, \
+               CC="$(TARGET_CC)" \
+               install-libs install-include \
+       )
 endef
 
 define Build/Compile
 endef
 
 define Build/Compile
diff --git a/libs/zaptel-1.4.x/patches/001-Makefile-arch.patch b/libs/zaptel-1.4.x/patches/001-Makefile-arch.patch
new file mode 100644 (file)
index 0000000..9e754d4
--- /dev/null
@@ -0,0 +1,14 @@
+Index: zaptel-1.4.9.2/Makefile
+===================================================================
+--- zaptel-1.4.9.2.orig/Makefile       2008-08-15 01:42:26.000000000 -0700
++++ zaptel-1.4.9.2/Makefile    2008-08-15 01:42:43.000000000 -0700
+@@ -18,7 +18,9 @@
+ PWD:=$(shell pwd)
+ endif
++ifndef ARCH
+ ARCH:=$(shell uname -m | sed -e s/i.86/i386/)
++endif
+ ifeq ($(DEB_HOST_GNU_TYPE),)
+ UNAME_M:=$(shell uname -m)