%general-entities; ]> uClibc-&uclibc-version; uClibc cross tools <para>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.</para> </sect2> <sect2 role="installation"> <title>Installation of uClibc Since we are cross-compiling, we need to make sure when we configuration for our architecture we get the correct information. The following sed makes sure we are using the proper settings for our architecture: (This is a place holder for the other architectures cp extra/Configs/Config.in extra/Configs/Config.in.orig sed -e "s:default TARGET_i386:default TARGET_i386:" \ extra/Configs/Config.in.orig > extra/Configs/Config.in By default uClibc symlinks the headers to the source directory. This is not acceptable in our build scenario. So sed the Makefiles to copy them instead. cp Makefile Makefile.orig sed -e 's/$(LN) -fs/cp/g' Makefile.orig > Makefile for file in `find libc/sysdeps/linux -name Makefile`; do cp $file $file.orig sed -e 's/$(LN) -fs/cp/g' -e 's@../libc/@$(TOPDIR)libc/@g' $file.orig > $file done Below we are just telling uClibc to use the default configuration of uClibc. For those for more adventureous, you can use make menuconfig, and do a more custom build of your uClibc. Create default configuration: make defconfig We will need to edit the configuration file, to make sure everything gets compiled and put into it's proper locations: cp .config .config.orig sed -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${CLFS_TARGET}-\":" \ -e "/^KERNEL_SOURCE/s:=.*:=\"${CLFS}/usr\":" \ -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 UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE UCLIBC_HAS_PRINTF_M_SPEC UCLIBC_HAS_FTW UCLIBC_HAS_IPV6" for config in $UCLIBC_OPTIONS; do cp .config .config.orig sed -e "s:# ${config} is not set:${config}=y:" .config.orig > .config done echo "UCLIBC_HAS_FULL_RPC=y" >> .config Compile the package: make TARGET_ARCH=i386 We will remove the files that were copied over from our Linux Headers during the building of uClibc. These files were copied into the include directory of the source directory of uClibc: rm include/{asm,asm-generic,linux} Install the package: make PREFIX=${CLFS} install Contents of uClibc Installed uClibc To Be Written