mac80211: compile kconf with host gcc
[openwrt/staging/jow.git] / package / kernel / mac80211 / patches / build / 004-fix-kconf-compiling.patch
1 --- a/Makefile.real
2 +++ b/Makefile.real
3 @@ -6,6 +6,18 @@ else
4 export BACKPORTS_GIT_TRACKER_DEF=
5 endif
6
7 +ifneq ($(LLVM),)
8 +ifneq ($(filter %/,$(LLVM)),)
9 +LLVM_PREFIX := $(LLVM)
10 +else ifneq ($(filter -%,$(LLVM)),)
11 +LLVM_SUFFIX := $(LLVM)
12 +endif
13 +
14 +HOSTCC = $(LLVM_PREFIX)clang$(LLVM_SUFFIX)
15 +else
16 +HOSTCC = gcc
17 +endif
18 +
19 # disable built-in rules for this file
20 .SUFFIXES:
21
22 @@ -24,21 +36,21 @@ listnewconfig oldaskconfig oldconfig \
23 silentoldconfig olddefconfig oldnoconfig \
24 allnoconfig allyesconfig allmodconfig \
25 alldefconfig randconfig:
26 - @$(MAKE) -C kconf conf
27 + @$(MAKE) -C kconf CC=$(HOSTCC) conf
28 @./kconf/conf --$@ Kconfig
29
30 .PHONY: usedefconfig
31 usedefconfig:
32 - @$(MAKE) -C kconf conf
33 + @$(MAKE) -C kconf CC=$(HOSTCC) conf
34 @./kconf/conf --defconfig=defconfig Kconfig
35
36 .PHONY: savedefconfig
37 savedefconfig:
38 - @$(MAKE) -C kconf conf
39 + @$(MAKE) -C kconf CC=$(HOSTCC) conf
40 @./kconf/conf --savedefconfig=defconfig Kconfig
41
42 defconfig-%::
43 - @$(MAKE) -C kconf conf
44 + @$(MAKE) -C kconf CC=$(HOSTCC) conf
45 @./kconf/conf --defconfig=defconfigs/$(@:defconfig-%=%) Kconfig
46
47 .config: