comparison root-filesystem.sh @ 819:da1ebb2e22d3

Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
author Rob Landley <rob@landley.net>
date Sat, 12 Sep 2009 20:56:01 -0500
parents 8129df56091b
children d1a88d878e18
comparison
equal deleted inserted replaced
818:87ebc3d2a067 819:da1ebb2e22d3
45 else 45 else
46 ROOT_TOPDIR="$STAGE_DIR" 46 ROOT_TOPDIR="$STAGE_DIR"
47 mkdir -p "$STAGE_DIR/bin" || dienow 47 mkdir -p "$STAGE_DIR/bin" || dienow
48 fi 48 fi
49 49
50 # Install Linux kernel headers. 50 # Build uClibc
51 51
52 setupfor linux 52 STAGE_DIR="$ROOT_TOPDIR" . "$SOURCES"/sections/uClibc.sh
53 # Install Linux kernel headers (for use by uClibc).
54 make headers_install -j "$CPUS" ARCH="${KARCH}" INSTALL_HDR_PATH="$ROOT_TOPDIR" &&
55 # This makes some very old package builds happy.
56 ln -s ../sys/user.h "$ROOT_TOPDIR/include/asm/page.h"
57
58 cleanup
59
60 # Build and install uClibc. (We could just copy the one from the compiler
61 # toolchain, but this is cleaner.)
62
63 setupfor uClibc
64 make CROSS="${ARCH}-" KCONFIG_ALLCONFIG="$(getconfig uClibc)" allnoconfig &&
65 cp .config "${WORK}"/config-uClibc || dienow
66
67 # Alas, if we feed install and install_utils to make at the same time with
68 # -j > 1, it dies. Not SMP safe.
69 for i in install install_utils
70 do
71 make CROSS="${ARCH}-" KERNEL_HEADERS="$ROOT_TOPDIR/include" \
72 PREFIX="$ROOT_TOPDIR/" $VERBOSITY \
73 RUNTIME_PREFIX="/" DEVEL_PREFIX="/" \
74 UCLIBC_LDSO_NAME=ld-uClibc -j $CPUS $i || dienow
75 done
76
77 # There's no way to specify a prefix for the uClibc utils; rename them by hand.
78
79 if [ ! -z "$PROGRAM_PREFIX" ]
80 then
81 for i in ldd readelf
82 do
83 mv "$ROOT_TOPDIR"/bin/{"$i","${PROGRAM_PREFIX}$i"} || dienow
84 done
85 fi
86
87 cleanup
88 53
89 if [ "$NATIVE_TOOLCHAIN" == "none" ] 54 if [ "$NATIVE_TOOLCHAIN" == "none" ]
90 then 55 then
91 # If we're not installing a compiler, delete the headers, static libs, 56 # If we're not installing a compiler, delete the headers, static libs,
92 # and example source code. 57 # and example source code.