summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-12-09 10:00:28 +0000
committernico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-12-09 10:00:28 +0000
commitfab36944b82bc97f895079c4cd5eae8ba272e8ac (patch)
treea29381bc24710f8e3c8ad55d68c02e11c2e60a91
parentb369478658856b8ef8f1b46e397e6004a54da55f (diff)
fix 2.6 module build when compiling on a 2.4 host system
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@2606 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/package/spca5xx/Makefile3
-rw-r--r--target/linux/package/spca5xx/patches/01-kmod-build.patch44
2 files changed, 29 insertions, 18 deletions
diff --git a/target/linux/package/spca5xx/Makefile b/target/linux/package/spca5xx/Makefile
index a2b43e997..95a48a9a3 100644
--- a/target/linux/package/spca5xx/Makefile
+++ b/target/linux/package/spca5xx/Makefile
@@ -28,6 +28,9 @@ $(PKG_BUILD_DIR)/.configured:
$(PKG_BUILD_DIR)/.built:
$(MAKE) -C $(KERNEL_DIR) \
+ ARCH="$(LINUX_KARCH)" \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ KERNELVERSION="$(KERNEL_VERSION)" \
SUBDIRS="$(PKG_BUILD_DIR)" \
modules
touch $@
diff --git a/target/linux/package/spca5xx/patches/01-kmod-build.patch b/target/linux/package/spca5xx/patches/01-kmod-build.patch
index 5aeca16d6..f69caf8b9 100644
--- a/target/linux/package/spca5xx/patches/01-kmod-build.patch
+++ b/target/linux/package/spca5xx/patches/01-kmod-build.patch
@@ -1,7 +1,18 @@
diff -ruN spca5xx-20051105-old/Makefile spca5xx-20051105-new/Makefile
--- spca5xx-20051105-old/Makefile 2005-11-05 19:18:26.000000000 +0100
-+++ spca5xx-20051105-new/Makefile 2005-12-08 21:50:20.000000000 +0100
-@@ -68,157 +68,18 @@
++++ spca5xx-20051105-new/Makefile 2005-12-09 10:34:47.000000000 +0100
+@@ -33,7 +33,9 @@
+ DEFINES += -DCONFIG_USB_SPCA5XX_MODULE=1 -DMODULE -D__KERNEL__
+ DEFINES += -DVID_HARDWARE_SPCA5XX=0xFF -DSPCA5XX_VERSION=\"$(VERSION)\"
+
+-ifneq ($(shell uname -r | cut -d. -f1,2), 2.4)
++KERNELVERSION=$(shell uname -r | cut -d. -f1,2)
++
++ifneq ($(KERNELVERSION), 2.4)
+
+ ifneq ($(KERNELRELEASE),) # We were called by kbuild
+ CFLAGS += $(DEFINES)
+@@ -68,158 +70,19 @@
else # kernel version test
@@ -15,9 +26,11 @@ diff -ruN spca5xx-20051105-old/Makefile spca5xx-20051105-new/Makefile
-# This makefile will build the spca50x driver module external to the kernel
-# source tree. It makes it easier to swap kernels.
-
--
++CFLAGS += $(DEFINES)
+
-KERNEL_VERSION = `uname -r`
--
++spca5xx-objs := drivers/usb/spca5xx.o drivers/usb/spcadecoder.o
+
-###
-# Location of the header files (most importantly the config files)
-# for the kernel you want to build the module against.
@@ -31,12 +44,15 @@ diff -ruN spca5xx-20051105-old/Makefile spca5xx-20051105-new/Makefile
-ifneq ($(strip $(shell grep 'define CONFIG_MODVERSIONS 1' $(KERNEL_ACFILE))),)
- DEFINES += -DMODVERSIONS -include $(KERNEL_MODVERSIONSFILE)
-endif
--
++obj-m += spca5xx.o
++obj-y := $(spca5xx-objs)
+
-# Detect SMP support
-ifneq ($(strip $(shell grep 'define CONFIG_SMP 1' $(KERNEL_ACFILE))),)
- DEFINES += -D__SMP__ -DSMP
-endif
--
++O_TARGET := $(obj-m)
+
-# Setup the tools
-CC = gcc
-LD = ld
@@ -153,19 +169,11 @@ diff -ruN spca5xx-20051105-old/Makefile spca5xx-20051105-new/Makefile
-drivers/usb/spcadecoder.o: drivers/usb/spcadecoder.h \
- drivers/usb/spcagamma.h \
- drivers/usb/jpeg_header.h
-+EXTRA_CFLAGS += $(DEFINES)
-
--endif # End kernel version test
-+spca5xx-objs := drivers/usb/spca5xx.o drivers/usb/spcadecoder.o
-+
-+obj-m += spca5xx.o
-+obj-y := $(spca5xx-objs)
-+
-+O_TARGET := $(obj-m)
-
+-include $(TOPDIR)/Rules.make
-+
-+endif # End kernel version test
+ endif # End kernel version test
+
+-
##############################################################################
# OTHER TARGETS
+ ##############################################################################