[klibc] Simplify build instructions
Recommend installing the kernel UAPI headers under the klibc source
directory. This reduces the second build step to just "make" (for
most native builds).
Explain the alternative options in a subsection of README.klibc.
Signed-off-by: Ben Hutchings <firstname.lastname@example.org>
diff --git a/Makefile b/Makefile
index 0df463a..c99b962 100644
@@ -99,10 +99,10 @@
- @echo "Cannot find kernel UAPI headers."
- @echo "Either make a 'linux' symlink point to the usr subdirectory "
- @echo "of a kernel tree with headers installed for the $(KLIBCARCH) "
- @echo "architecture or specify KLIBCKERNELSRC=<path>."
+ @echo 'Missing kernel UAPI headers in $(KLIBCKERNELSRC)/include.'
+ @echo 'Install them by running:'
+ @echo ' make headers_install INSTALL_HDR_PATH=$(abspath $(KLIBCKERNELSRC))'
+ @echo 'in the kernel source directory.'
rpmbuild = $(shell which rpmbuild 2>/dev/null || which rpm)
diff --git a/usr/klibc/README.klibc b/usr/klibc/README.klibc
index 59ffd35..ea10c55 100644
@@ -9,17 +9,13 @@
-The build procedure is not very polished yet, but it should work like
+The build procedure is not very polished yet, but for a native build
+with the default configuration it should be simple:
-Extract a recent Linux kernel into a directory and run
-Now enter the klibc dir and point KLIBCKERNELSRC to the
-usr subdirectory of the configured linux tree
-It is also possible to install the kernel headers elsewhere and
-point to them there.
+1. In a recent Linux kernel source directory, run:
+ make headers_install INSTALL_HDR_PATH=<klibc-source-dir>/linux
+2. In the klibc source directory, run:
@@ -40,6 +36,17 @@
(this is supported), change OPTFLAGS in arch/arm/MCONFIG to build
+Building without kernel source
+If you already have a copy of the current kernel UAPI headers, you
+don't need the kernel source as well. You can either:
+1. Copy or link to the UAPI headers so that they appear under the
+ "linux/include" subdirectory.
+2. Set the KLIBCKERNELSRC variable on the "make" command line to
+ point to the *parent* of the UAPI headers directory.