Skip to contentSkip to conversation

Use the kernel source tree for includes, not the kernel build tree

PATCH In review Pavel Roskin 2 participants 4 messages Sep 16, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use the kernel source tree for includes, not the kernel build tree

If the build is done outside the source tree, nl80211.h won't be in the build tree. We only need only definitions from the sources, not the kernel configuration.

---
 Makefile  |    2 +-
 defconfig |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Makefile +1 -1
index 74cb1e1..9e79381 100644
@@ -6,7 +6,7 @@ INSTALL ?= install
 PREFIX ?= /usr
 CC ?= "gcc"
 CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
-CFLAGS += -I/lib/modules/`uname -r`/build/include
+CFLAGS += -I/lib/modules/`uname -r`/source/include
 CFLAGS += -O2 -g
 LDFLAGS += -lnl
 
defconfig +1 -1
index 346f699..0081911 100644
@@ -11,7 +11,7 @@
 
 # Kernel location for GIT NL80211 kernel code (assumed to be running,
 # by default); only required if your installed nl80211.h is out of date.
-CONFIG_KERNEL_LOC = /lib/modules/`uname -r`/build/
+CONFIG_KERNEL_LOC = /lib/modules/`uname -r`/source/
 CFLAGS += -I$(CONFIG_KERNEL_LOC)/include
 
 # LibNL location
#1 lore raw
Quoted 3 lines · Pavel Roskin

If the build is done outside the source tree, nl80211.h won't be in the build tree. We only need only definitions from the sources, not the kernel configuration.

good catch

Quoted 11 lines
---
 Makefile  |    2 +-
 defconfig |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Makefile +0 -0
index 74cb1e1..9e79381 100644

Makefile INSTALL ?= install · line 9

Quoted 5 lines
Makefile +1 -1
@@ -6,7 +6,7 @@ INSTALL ?= install
 PREFIX ?= /usr
 CC ?= "gcc"
 CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
-CFLAGS += -I/lib/modules/`uname -r`/build/include
+CFLAGS += -I/lib/modules/`uname -r`/source/include

I'll remove that line entirely though.

johannes

#2 lore raw
Quoted 4 lines · Johannes Berg
Quoted 4 lines
Makefile +0 -0
index 74cb1e1..9e79381 100644
Quoted 8 lines

Makefile INSTALL ?= install · line 9

Quoted 6 lines
Makefile +1 -1
@@ -6,7 +6,7 @@ INSTALL ?= install
 PREFIX ?= /usr
 CC ?= "gcc"
 CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
-CFLAGS += -I/lib/modules/`uname -r`/build/include
+CFLAGS += -I/lib/modules/`uname -r`/source/include

I'll remove that line entirely though.

In Makefile? Please make sure that .config remains optional.

Signature · 2 lines
Regards,
Pavel Roskin
#3 lore raw
Quoted 15 lines · Pavel Roskin
Quoted 4 lines · Johannes Berg
Quoted 4 lines
Makefile +0 -0
index 74cb1e1..9e79381 100644
Quoted 8 lines

Makefile INSTALL ?= install · line 9

Quoted 6 lines
Makefile +1 -1
@@ -6,7 +6,7 @@ INSTALL ?= install
 PREFIX ?= /usr
 CC ?= "gcc"
 CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
-CFLAGS += -I/lib/modules/`uname -r`/build/include
+CFLAGS += -I/lib/modules/`uname -r`/source/include

I'll remove that line entirely though.

Quoted 1 line

In Makefile? Please make sure that .config remains optional.

Yes; we actually ship nl80211.h out of the kernel already. So if your installed kernel headers are new enough, you don't need .config, if they aren't you might need .config, before you had to have it always anyway.

johannes