Add Linux kernel build instructions
[qi-bootmenu-system.git] / sources / sections / uClibc.sh
blob2f53bea40d2d7b5e2964922c9715000765c24e88
1 # Build and install uClibc.
3 setupfor uClibc
4 make CROSS="$CROSS" KCONFIG_ALLCONFIG="$CONFIG_DIR/miniconfig-uClibc" allnoconfig &&
5 cp .config "$CONFIG_DIR/config-uClibc" || dienow
7 UCLIBC_MAKE_FLAGS="CROSS=$CROSS KERNEL_HEADERS=$STAGING_DIR/usr/include \
8 RUNTIME_PREFIX=/ UCLIBC_LDSO_NAME=ld-uClibc $VERBOSITY"
10 # prepare the headers files this is a pre requirement for locale generation
12 make $UCLIBC_MAKE_FLAGS PREFIX="$STAGING_DIR/usr" DEVEL_PREFIX="/" headers
13 make $UCLIBC_MAKE_FLAGS PREFIX="$STAGING_DIR/usr" DEVEL_PREFIX="/" include/bits/sysnum.h
15 # configure/generate just the minimal needed locales
16 # UCLIBC_BUILD_MINIMAL_LOCALE doesn't seem to be present
17 # in the Kconfig files but it is nevertheless used in the
18 # Makefile
20 cd extra/locale
21 make clean
22 make $UCLIBC_MAKE_FLAGS PREFIX="$STAGING_DIR/usr" UCLIBC_BUILD_MINIMAL_LOCALE=y DEVEL_PREFIX="/"
23 cd - >/dev/null
25 # build and install into $STAGING_DIR
27 make $UCLIBC_MAKE_FLAGS PREFIX="$STAGING_DIR/usr" DEVEL_PREFIX="/" -j $CPUS install
28 make $UCLIBC_MAKE_FLAGS PREFIX="$STAGING_DIR/usr" DEVEL_PREFIX="/" -j $CPUS install_utils
30 # install into $ROOT_DIR
32 make $UCLIBC_MAKE_FLAGS PREFIX="$ROOT_DIR" install_runtime
34 [ -e "$STAGING_DIR/usr/lib/libc.so" ] && cp "$STAGING_DIR/usr/lib/libc.so" \
35 "$ROOT_DIR/lib/libc.so"
37 # remove some hardwired paths from libc.so linker script
38 # which point to / because of RUNTIME_PREFIX which would
39 # try to leak in bits from the host system. Maybe we should
40 # install uClibc twice with different RUNTIME_PREFIX one
41 # for the STAGING_DIR and one for the rootfs /.
43 [ -e "$STAGING_DIR/usr/lib/libc.so" ] && \
44 sed -i 's,/lib/,,g' "$STAGING_DIR/usr/lib/libc.so"
46 # delete the headers, static libs and example source code.
48 #rm -rf "$ROOT_DIR/usr/include" &&
49 #rm -rf "$ROOT_DIR"/usr/lib/*.a &&
50 #rm -rf "$ROOT_DIR/usr/src" || dienow
52 cleanup uClibc