Browse Source

buildsys: allow the toolchain to search its dirs for kernel headers

Setting KERNEL_HEADERS up to the exact path all the time is a pita,
especially when the toolchain is often times already configured to
do the right thing.  So if the user has set that to "", don't force
any specific paths.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Mike Frysinger 11 years ago
parent
commit
bb701610aa
2 changed files with 9 additions and 2 deletions
  1. 3 1
      extra/Configs/Config.in.arch
  2. 6 1
      extra/scripts/gen_bits_syscall_h.sh

+ 3 - 1
extra/Configs/Config.in.arch

@@ -192,7 +192,7 @@ config UCLIBC_HAS_LONG_DOUBLE_MATH
 
 
 config KERNEL_HEADERS
 config KERNEL_HEADERS
 	string "Linux kernel header location"
 	string "Linux kernel header location"
-	default "/usr/include"
+	default ""
 	help
 	help
 	  The kernel source you use to compile with should be the same
 	  The kernel source you use to compile with should be the same
 	  as the Linux kernel you run your apps on.  uClibc doesn't even
 	  as the Linux kernel you run your apps on.  uClibc doesn't even
@@ -203,6 +203,8 @@ config KERNEL_HEADERS
 	  but then run on Linux 2.0.x, lchown will be compiled into uClibc,
 	  but then run on Linux 2.0.x, lchown will be compiled into uClibc,
 	  but won't work at all.  You have been warned.
 	  but won't work at all.  You have been warned.
 
 
+	  If you don't set this, we'll assume the toolchain can find them.
+
 config UCLIBC_UCLINUX_BROKEN_MUNMAP
 config UCLIBC_UCLINUX_BROKEN_MUNMAP
 	bool
 	bool
 	depends on !ARCH_USE_MMU
 	depends on !ARCH_USE_MMU

+ 6 - 1
extra/scripts/gen_bits_syscall_h.sh

@@ -15,7 +15,12 @@
 #
 #
 # Warning!!! This does _no_ error checking!!!
 # Warning!!! This does _no_ error checking!!!
 
 
-INCLUDE_OPTS="-nostdinc -I${KERNEL_HEADERS}"
+if [ "${KERNEL_HEADERS:-/}" != "/" ] ; then
+  INCLUDE_OPTS="-nostdinc -I${KERNEL_HEADERS}"
+else
+  # Let the toolchain use its configure paths.
+  INCLUDE_OPTS=
+fi
 
 
 case $CC in
 case $CC in
 *icc*) CC_SYSNUM_ARGS="-dM" ;;
 *icc*) CC_SYSNUM_ARGS="-dM" ;;