Package: broadcom-sta / 6.30.223.271-10

01-shipped-module.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From: Ben Hutchings <ben@decadent.org.uk>
Date: Mon, 19 Nov 2012 04:51:39 +0000
Subject: Select wlc_hybrid.o based on the target kernel architecture
Origin: http://bugs.debian.org/651787

---
 amd64/Makefile | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/amd64/Makefile b/amd64/Makefile
index a323a0d..994a146 100644
--- a/amd64/Makefile
+++ b/amd64/Makefile
@@ -145,9 +145,27 @@ ifeq "$(GE_49)" "1"
 EXTRA_CFLAGS       += -Wno-date-time
 endif
 
-EXTRA_LDFLAGS      := $(src)/lib/wlc_hybrid.o_shipped
+# Look for kernel architecture.
+# Check for a config symbol that should always be defined, so we don't
+# fail on 'make clean' which doesn't include .config
+ifeq ($(CONFIG_NET),y)
+    ifeq ($(CONFIG_X86_32),y)
+        SHIPPED=wlc_hybrid.o_i386
+        $(info Kernel architecture is X86_32)
+    else
+        ifeq ($(CONFIG_X86_64),y)
+            SHIPPED=wlc_hybrid.o_amd64
+            $(info Kernel architecture is X86_64)
+        else # Error!
+            $(error Unsupported kernel architecture)
+        endif
+    endif
+endif
+
+EXTRA_LDFLAGS      := $(src)/lib/$(SHIPPED)
 
-KBASE              ?= /lib/modules/`uname -r`
+KVER               ?= $(shell uname -r)
+KBASE              ?= /lib/modules/$(KVER)
 KBUILD_DIR         ?= $(KBASE)/build
 MDEST_DIR          ?= $(KBASE)/kernel/drivers/net/wireless