tslib: remove comments from config file
[qi-bootmenu-system.git] / sources / sections / uClibc.sh
blob30bb079ca36ba663b3fee2d483e90c6b5f13267a
1 # Build and install uClibc.
3 setupfor uClibc
5 # We need to unset the environment variable for ccwrap from include.sh
6 # because there is no libc to link against we are building it here.
7 # The reason why it is set in include.sh is that it works for manual
8 # package builds ala ./build.sh qi-bootmenu
10 OLD_CCWRAP_TOPDIR=$CCWRAP_TOPDIR
11 unset CCWRAP_TOPDIR
13 make CROSS="$CROSS" KCONFIG_ALLCONFIG="$CONFIG_DIR/miniconfig-uClibc" allnoconfig &&
14 cp .config "$CONFIG_DIR/config-uClibc" || dienow
16 UCLIBC_MAKE_FLAGS="CROSS=$CROSS KERNEL_HEADERS=$STAGING_DIR/usr/include \
17 RUNTIME_PREFIX=/ UCLIBC_LDSO_NAME=ld-uClibc $VERBOSITY"
19 # prepare the headers files this is a pre requirement for locale generation
21 make $UCLIBC_MAKE_FLAGS PREFIX="$STAGING_DIR/usr" DEVEL_PREFIX="/" headers
22 make $UCLIBC_MAKE_FLAGS PREFIX="$STAGING_DIR/usr" DEVEL_PREFIX="/" include/bits/sysnum.h
24 # configure/generate just the minimal needed locales
25 # UCLIBC_BUILD_MINIMAL_LOCALE doesn't seem to be present
26 # in the Kconfig files but it is nevertheless used in the
27 # Makefile
29 cd extra/locale
30 make clean
31 make $UCLIBC_MAKE_FLAGS PREFIX="$STAGING_DIR/usr" UCLIBC_BUILD_MINIMAL_LOCALE=y DEVEL_PREFIX="/"
32 cd - >/dev/null
34 # build and install into $STAGING_DIR
36 make $UCLIBC_MAKE_FLAGS PREFIX="$STAGING_DIR/usr" DEVEL_PREFIX="/" -j $CPUS install &&
37 make $UCLIBC_MAKE_FLAGS PREFIX="$STAGING_DIR/usr" DEVEL_PREFIX="/" -j $CPUS install_utils
39 [ $? -ne 0 ] && dienow
41 # install into $ROOT_DIR
43 make $UCLIBC_MAKE_FLAGS PREFIX="$ROOT_DIR" install_runtime
45 [ -e "$STAGING_DIR/usr/lib/libc.so" ] && cp "$STAGING_DIR/usr/lib/libc.so" \
46 "$ROOT_DIR/lib/libc.so"
48 # remove some hardwired paths from libc.so linker script
49 # which point to / because of RUNTIME_PREFIX which would
50 # try to leak in bits from the host system. Maybe we should
51 # install uClibc twice with different RUNTIME_PREFIX one
52 # for the STAGING_DIR and one for the rootfs /.
54 [ -e "$STAGING_DIR/usr/lib/libc.so" ] && \
55 sed -i 's,/lib/,,g' "$STAGING_DIR/usr/lib/libc.so"
57 # copy compiler related include files and libraries into
58 # $STAGING_DIR so that the compiler wrapper (ccwrap) will
59 # find it were it expects them.
61 cp -r "$(dirname $(which $CC))/../cc" "$STAGING_DIR/usr" || dienow
62 cp -P $(dirname $(which $CC))/../lib/libgcc* "$STAGING_DIR/usr/lib" || dienow
64 # tell the compiler wrapper to link all further packages
65 # against the newly built libc
67 export CCWRAP_TOPDIR=$OLD_CCWRAP_TOPDIR
69 cleanup uClibc