summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-07-20 15:23:26 -0400
committerAustin Foxley <austinf@cetoncorp.com>2009-08-19 12:26:10 -0700
commitd9af0dffc48c7aae40bd1dd2fff983b62913f25c (patch)
tree502eff22bd1c91392543dd054c54cb67b3ce4a97
parentbe0e9bdbe062da1afa160e99958271ae3b70bd82 (diff)
downloaduClibc-alpine-d9af0dffc48c7aae40bd1dd2fff983b62913f25c.tar.bz2
uClibc-alpine-d9af0dffc48c7aae40bd1dd2fff983b62913f25c.tar.xz
MAKEALL: find kernel headers better
Work with pre-sysroot compilers that have kernel headers available in the standard location, and let people force the location manually. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
-rwxr-xr-xextra/scripts/MAKEALL13
1 files changed, 12 insertions, 1 deletions
diff --git a/extra/scripts/MAKEALL b/extra/scripts/MAKEALL
index dc9f754a0..6bacc9a7c 100755
--- a/extra/scripts/MAKEALL
+++ b/extra/scripts/MAKEALL
@@ -101,7 +101,18 @@ for a in "$@" ; do
setconfig CROSS_COMPILER_PREFIX ${CROSS}
- header_path=$(echo '#include <linux/version.h>' | ${CROSS}cpp 2>&1 | grep -o '[^"]*linux/version.h')
+ header_path=${KERNEL_HEADERS:-$(echo '#include <linux/version.h>' | ${CROSS}cpp 2>/dev/null | grep -o '[^"]*linux/version.h')} || :
+ if [ -z "${header_path}" ] ; then
+ for p in /usr/${CROSS%-}/usr/include ; do
+ if [ -e ${p}/linux/version.h ] ; then
+ header_path=${p}
+ break
+ fi
+ done
+ if [ -z "${header_path}" ] ; then
+ echo " ## unable to locate KERNEL_HEADERS"
+ fi
+ fi
setconfig KERNEL_HEADERS ${header_path%/linux/version.h}
if do_make ; then