source: clfs-embedded/BOOK/cross-tools/x86/uclibc.xml @ 0194a60

Last change on this file since 0194a60 was 3ca2208, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Several fixes for PDF look.

  • Property mode set to 100644
File size: 4.4 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3  "http://www.oasis-open.org/docbook/xml/4.5/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="c">By default uClibc symlinks the headers to the source directory.
32    This is not acceptable in our build scenario, so we modify the Makefiles
33    so that the headers will be copied instead:</para>
34
35<screen os="d"><userinput>cp Makefile{,.orig}
36sed -e 's/$(LN) -fs/cp/g' Makefile.orig &gt; Makefile
37for file in `find libc/sysdeps/linux -name Makefile`; do
38    cp $file{,.orig}
39    sed -e 's/$(LN) -fs/cp/g' -e 's@../libc/@$(TOPDIR)libc/@g' \
40        $file.orig > $file
41done</userinput></screen>
42
43    <note os="e">
44      <para>Below we are just telling uClibc to use its default configuration.
45      For those for more adventureous, you can use make menuconfig, and
46      do a more custom build for your uClibc installation.</para>
47    </note>
48
49    <para os="f">Create the default configuration:</para>
50
51<screen os="g"><userinput>make defconfig ARCH=i386</userinput></screen>
52
53   <para os="h">We will need to edit the configuration file, to make sure everything gets
54   compiled and put into its proper location:</para>
55
56<screen os="i"><userinput>cp .config{,.orig}
57sed -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${CLFS_TARGET}-\":" \
58    -e "/^KERNEL_HEADERS/s:=.*:=\"${CLFS}/usr/include\":" \
59    -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/lib\":" \
60    -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \
61    -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \
62    .config.orig > .config</userinput></screen>
63
64    <para os="j">We will need to make sure that some settings in uClibc are set so we
65    can utilize all the features of BusyBox:</para>
66
67<screen os="k"><userinput>UCLIBC_OPTIONS="DO_C99_MATH UCLIBC_HAS_RPC UCLIBC_HAS_CTYPE_CHECKED
68    UCLIBC_HAS_WCHAR UCLIBC_HAS_HEXADECIMAL_FLOATS LDSO_PRELOAD_FILE_SUPPORT
69    UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE UCLIBC_HAS_PRINTF_M_SPEC UCLIBC_HAS_IPV6
70    UCLIBC_HAS_GLIBC_CUSTOM_PRINTF UCLIBC_USE_NETLINK UCLIBC_HAS_FTW"
71for config in $UCLIBC_OPTIONS; do
72    cp .config{,.orig}
73    sed -e "s:# ${config} is not set:${config}=y:" .config.orig > .config
74done
75UCLIBC_OPTIONS="UCLIBC_HAS_CTYPE_UNSAFE"
76for config in $UCLIBC_OPTIONS; do
77    cp .config{,.orig}
78    sed -e "s:${config}=y:# ${config} is not set:" .config.orig > .config
79done
80echo "UCLIBC_HAS_FULL_RPC=y" &gt;&gt; .config
81echo "UCLIBC_HAS_REENTRANT_RPC=y" &gt;&gt; .config</userinput></screen>
82
83    <para os="l">We have made some changes to our config, let's make sure
84    that we didn't miss and dependencies:</para>
85
86<screen os="m"><userinput>make oldconfig</userinput></screen>
87
88    <para os="n">Compile the package:</para>
89
90<screen os="o"><userinput>make CC="${CC} ${BUILD}"</userinput></screen>
91
92    <para os="p">Install the package:</para>
93
94<screen os="q"><userinput>make PREFIX=${CLFS} install</userinput></screen>
95
96  </sect2>
97
98  <sect2 id="contents-uclibc" role="content">
99    <title>Contents of uClibc</title>
100
101    <segmentedlist>
102      <segtitle>Installed uClibc</segtitle>
103
104      <seglistitem>
105        <seg>To Be Written</seg>
106      </seglistitem>
107    </segmentedlist>
108<!--
109    <variablelist>
110      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
111      <?dbfo list-presentation="list"?>
112      <?dbhtml list-presentation="table"?>
113
114     <varlistentry id="uclibc">
115        <term><filename
116        class="headerfile">/usr/include/{asm,linux}/*.h</filename></term>
117        <listitem>
118          <para>The Linux API headers</para>
119          <indexterm zone="ch-system-linux-headers linux-headers">
120            <primary
121            sortas="e-/usr/include/{asm,linux}/*.h">/usr/include/{asm,linux}/*.h</primary>
122          </indexterm>
123        </listitem>
124      </varlistentry>
125    </variablelist>
126-->
127
128  </sect2>
129</sect1>
Note: See TracBrowser for help on using the repository browser.