aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2019-02-01 23:52:48 +0100
committerBen Hutchings <ben@decadent.org.uk>2019-02-02 00:09:23 +0100
commitb8fc25ef83f8fbf85c07a237f4d8a0af95ea88ad (patch)
tree33c5170d99aceb1cfb2ace4f8c81e2a4ac32e15c
parent0959d3e5a37096f4f110362b46cd7ecc678bf44c (diff)
downloadklibc-b8fc25ef83f8fbf85c07a237f4d8a0af95ea88ad.tar.gz
[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 <ben@decadent.org.uk>
-rw-r--r--Makefile8
-rw-r--r--usr/klibc/README.klibc27
2 files changed, 21 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 0df463a5e0c985..c99b962fd2a322 100644
--- a/Makefile
+++ b/Makefile
@@ -99,10 +99,10 @@ $(objtree)/.config: $(srctree)/defconfig
@false
$(KLIBCKERNELSRC)/include:
- @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.'
@false
rpmbuild = $(shell which rpmbuild 2>/dev/null || which rpm)
diff --git a/usr/klibc/README.klibc b/usr/klibc/README.klibc
index 59ffd351fffc19..ea10c55fc52ae5 100644
--- a/usr/klibc/README.klibc
+++ b/usr/klibc/README.klibc
@@ -9,17 +9,13 @@ work in progress, and a lot of things are still missing.
Building
========
-The build procedure is not very polished yet, but it should work like
-this:
+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
-"make headers_install".
-Now enter the klibc dir and point KLIBCKERNELSRC to the
-usr subdirectory of the configured linux tree
-"make KLIBCKERNELSRC=`pwd`/../linux/usr/".
-
-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:
+ make
Cross-compiling
---------------
@@ -40,6 +36,17 @@ If you are on ARM, and want to build a thumb version of the library
(this is supported), change OPTFLAGS in arch/arm/MCONFIG to build
thumb code.
+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.
+
Architecture support
====================