The uClibc package contains the main C library. This library provides the basic routines for allocating memory, searching directories, opening and closing files, reading and writing files, string handling, pattern matching, arithmetic, and so on.
![[Note]](../images/note.png)
Below we are just telling uClibc to use its default configuration. For those for more adventureous, you can use make menuconfig, and do a more custom build for your uClibc installation.
The following patch contains a number of updates to the 0.9.30.1 branch by the uClibc developers:
patch -Np1 -i ../uClibc-0.9.30.1-branch_update-1.patch
Copy the uClibc config file from where you downloaded it:
cp ${CLFS}/sources/uClibc-0.9.30.1.config .configWe will need to edit the configuration file, to make sure everything gets compiled and it's compiled to the proper architecture:
cp .config{,.orig}
sed -e "s@# TARGET_${CLFS_ARCH} is not set@TARGET_${CLFS_ARCH}=y@" \
-e "s@\(^TARGET_ARCH=\).*@\1\"${CLFS_ARCH}\"@" \
-e "s@\(^CROSS_COMPILER_PREFIX=\).*@\1\"${CLFS_TARGET}-\"@" \
-e "s@\(^KERNEL_HEADERS=\).*@\1\"${CLFS}/usr/include\"@" \
-e "s@.*\(^ARCH_${CLFS_NOT_ENDIAN}_ENDIAN\).*@# \1 is not set@g" \
-e "s@.*\(ARCH_${CLFS_ENDIAN}_ENDIAN\).*@\1=y@g" \
-e "s@.*\(ARCH_WANTS_${CLFS_ENDIAN}_ENDIAN\).*@\1=y@g" \
.config.orig > .configThe config is a basic working system, but there are some options that are architecture specifc that need to be set. The following command will only bring up items that need a value that we did not specify in our Generic config file:
make oldconfig
Compile the package:
make CROSS=${CLFS_TARGET}- CC="${CLFS_TARGET}-gcc ${BUILD}"Install the package:
make PREFIX=${CLFS} install