[a9e389d] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-cross-tools-uclibc" role="wrap">
|
---|
| 9 | <?dbhtml filename="uclibc.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>uClibc-&uclibc-version;</title>
|
---|
| 12 |
|
---|
| 13 | <indexterm zone="ch-cross-tools-uclibc">
|
---|
| 14 | <primary sortas="a-uClibc">uClibc</primary>
|
---|
| 15 | <secondary>cross tools</secondary>
|
---|
| 16 | </indexterm>
|
---|
| 17 |
|
---|
| 18 | <sect2 role="package">
|
---|
| 19 | <title/>
|
---|
| 20 |
|
---|
| 21 | <para>The uClibc package contains the main C library. This library provides
|
---|
| 22 | the basic routines for allocating memory, searching directories, opening and
|
---|
| 23 | closing files, reading and writing files, string handling, pattern matching,
|
---|
| 24 | arithmetic, and so on.</para>
|
---|
| 25 |
|
---|
| 26 | </sect2>
|
---|
| 27 |
|
---|
| 28 | <sect2 role="installation">
|
---|
| 29 | <title>Installation of uClibc</title>
|
---|
| 30 |
|
---|
| 31 | <para os="a">Since we are cross-compiling, we need to make sure when we
|
---|
| 32 | configuration for our architecture we get the correct information. The
|
---|
| 33 | following sed makes sure we are using the proper settings for our
|
---|
| 34 | architecture: (This is a place holder for the other architectures</para>
|
---|
| 35 |
|
---|
| 36 | <screen os="b"><userinput>cp extra/Configs/Config.in extra/Configs/Config.in.orig
|
---|
| 37 | sed -e "s:default TARGET_i386:default TARGET_i386:" \
|
---|
| 38 | extra/Configs/Config.in.orig > extra/Configs/Config.in</userinput></screen>
|
---|
| 39 |
|
---|
[0bd108d] | 40 | <para os="c">By default uClibc symlinks the headers to the source directory.
|
---|
| 41 | This is not acceptable in our build scenario. So sed the Makefiles to copy them
|
---|
| 42 | instead.</para>
|
---|
| 43 |
|
---|
| 44 | <screen os="d"><userinput>cp Makefile Makefile.orig
|
---|
| 45 | sed -e 's/$(LN) -fs/cp/g' Makefile.orig > Makefile
|
---|
| 46 | for file in `find libc/sysdeps/linux -name Makefile`; do
|
---|
| 47 | cp $file $file.orig
|
---|
| 48 | sed -e 's/$(LN) -fs/cp/g' -e 's@../libc/@$(TOPDIR)libc/@g' $file.orig > $file
|
---|
| 49 | done</userinput></screen>
|
---|
| 50 |
|
---|
| 51 | <note os="e">
|
---|
[e2d2a2d] | 52 | <para>Below we are just telling uClibc to use the default configuration of
|
---|
| 53 | uClibc. For those for more adventureous, you can use make menuconfig, and
|
---|
| 54 | do a more custom build of your uClibc.</para>
|
---|
| 55 | </note>
|
---|
[a9e389d] | 56 |
|
---|
[0bd108d] | 57 | <para os="f">Create default configuration:</para>
|
---|
[a9e389d] | 58 |
|
---|
[0bd108d] | 59 | <screen os="g"><userinput>make defconfig</userinput></screen>
|
---|
[e2d2a2d] | 60 |
|
---|
[0bd108d] | 61 | <para os="h">We will need to edit the configuration file, to make sure everything gets
|
---|
[a9e389d] | 62 | compiled and put into it's proper locations:</para>
|
---|
| 63 |
|
---|
[0bd108d] | 64 | <screen os="i"><userinput>cp .config .config.orig
|
---|
[a9e389d] | 65 | sed -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${CLFS_TARGET}-\":" \
|
---|
| 66 | -e "/^KERNEL_SOURCE/s:=.*:=\"${CLFS}/usr\":" \
|
---|
| 67 | -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/lib\":" \
|
---|
| 68 | -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \
|
---|
| 69 | -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \
|
---|
| 70 | .config.orig > .config</userinput></screen>
|
---|
| 71 |
|
---|
[0bd108d] | 72 | <para os="j">We will need to make sure that some settings in uClibc are set so we
|
---|
[e666df1] | 73 | can utilize all the features of BusyBox:</para>
|
---|
[a9e389d] | 74 |
|
---|
[0bd108d] | 75 | <screen os="k"><userinput>UCLIBC_OPTIONS="DO_C99_MATH UCLIBC_HAS_RPC UCLIBC_HAS_CTYPE_CHECKED UCLIBC_HAS_WCHAR UCLIBC_HAS_HEXADECIMAL_FLOATS
|
---|
[e666df1] | 76 | UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE UCLIBC_HAS_PRINTF_M_SPEC UCLIBC_HAS_FTW UCLIBC_HAS_IPV6"
|
---|
| 77 | for config in $UCLIBC_OPTIONS; do
|
---|
| 78 | cp .config .config.orig
|
---|
| 79 | sed -e "s:# ${config} is not set:${config}=y:" .config.orig > .config
|
---|
| 80 | done
|
---|
| 81 | echo "UCLIBC_HAS_FULL_RPC=y" >> .config</userinput></screen>
|
---|
[a9e389d] | 82 |
|
---|
[0bd108d] | 83 | <para os="l">Compile the package:</para>
|
---|
[e666df1] | 84 |
|
---|
[0bd108d] | 85 | <screen os="m"><userinput>make TARGET_ARCH=i386</userinput></screen>
|
---|
[e666df1] | 86 |
|
---|
[0bd108d] | 87 | <para os="n">We will remove the files that were copied over from our Linux Headers during
|
---|
[492e5a3] | 88 | the building of uClibc. These files were copied into the include directory of the source
|
---|
| 89 | directory of uClibc:</para>
|
---|
[a9e389d] | 90 |
|
---|
[0bd108d] | 91 | <screen os="o"><userinput>rm include/{asm,asm-generic,linux}</userinput></screen>
|
---|
[a9e389d] | 92 |
|
---|
[0bd108d] | 93 | <para os="p">Install the package:</para>
|
---|
[a9e389d] | 94 |
|
---|
[0bd108d] | 95 | <screen os="q"><userinput>make PREFIX=${CLFS} install</userinput></screen>
|
---|
[a9e389d] | 96 |
|
---|
| 97 | </sect2>
|
---|
| 98 |
|
---|
| 99 | <sect2 id="contents-uclibc" role="content">
|
---|
| 100 | <title>Contents of uClibc</title>
|
---|
| 101 |
|
---|
| 102 | <segmentedlist>
|
---|
| 103 | <segtitle>Installed uClibc</segtitle>
|
---|
| 104 |
|
---|
| 105 | <seglistitem>
|
---|
| 106 | <seg>To Be Written</seg>
|
---|
| 107 | </seglistitem>
|
---|
| 108 | </segmentedlist>
|
---|
[6561a0f] | 109 | <!--
|
---|
[a9e389d] | 110 | <variablelist>
|
---|
| 111 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 112 | <?dbfo list-presentation="list"?>
|
---|
| 113 | <?dbhtml list-presentation="table"?>
|
---|
| 114 |
|
---|
[6561a0f] | 115 | <varlistentry id="uclibc">
|
---|
[a9e389d] | 116 | <term><filename
|
---|
| 117 | class="headerfile">/usr/include/{asm,linux}/*.h</filename></term>
|
---|
| 118 | <listitem>
|
---|
| 119 | <para>The Linux API headers</para>
|
---|
| 120 | <indexterm zone="ch-system-linux-headers linux-headers">
|
---|
| 121 | <primary
|
---|
| 122 | sortas="e-/usr/include/{asm,linux}/*.h">/usr/include/{asm,linux}/*.h</primary>
|
---|
| 123 | </indexterm>
|
---|
| 124 | </listitem>
|
---|
| 125 | </varlistentry>
|
---|
| 126 | </variablelist>
|
---|
[6561a0f] | 127 | -->
|
---|
[a9e389d] | 128 |
|
---|
| 129 | </sect2>
|
---|
| 130 | </sect1>
|
---|