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.
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 creates a condition in a header so that the struct flock will not be redefined:
patch -Np1 -i ../uClibc-0.9.30-rc3-flock_fixes-1.patch
Create the default configuration:
make defconfig ARCH=i386
We will need to edit the configuration file, to make sure everything gets compiled and put into its proper location:
cp .config{,.orig}
sed -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${CLFS_TARGET}-\":" \
-e "/^KERNEL_HEADERS/s:=.*:=\"${CLFS}/usr/include\":" \
-e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/lib\":" \
-e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \
-e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \
.config.orig > .config
We will need to make sure that some settings in uClibc are set so we can utilize all the features of BusyBox:
UCLIBC_OPTIONS="DO_C99_MATH UCLIBC_HAS_RPC UCLIBC_HAS_CTYPE_CHECKED
UCLIBC_HAS_WCHAR UCLIBC_HAS_HEXADECIMAL_FLOATS LDSO_PRELOAD_FILE_SUPPORT
UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE UCLIBC_HAS_PRINTF_M_SPEC UCLIBC_HAS_IPV6
UCLIBC_HAS_GLIBC_CUSTOM_PRINTF UCLIBC_USE_NETLINK UCLIBC_HAS_FTW"
for config in $UCLIBC_OPTIONS; do
cp .config{,.orig}
sed -e "s:# ${config} is not set:${config}=y:" .config.orig > .config
done
UCLIBC_OPTIONS="UCLIBC_HAS_CTYPE_UNSAFE"
for config in $UCLIBC_OPTIONS; do
cp .config{,.orig}
sed -e "s:${config}=y:# ${config} is not set:" .config.orig > .config
done
echo "UCLIBC_HAS_FULL_RPC=y" >> .config
echo "UCLIBC_HAS_REENTRANT_RPC=y" >> .config
We have made some changes to our config, let's make sure that we didn't miss and dependencies:
make oldconfig
Compile the package:
make CC="${CC} ${BUILD}"
Install the package:
make PREFIX=${CLFS} install