source: clfs-embedded/BOOK/cross-tools/x86/uclibc.xml@ 9b0a535

Last change on this file since 9b0a535 was f23b5ee, checked in by Jim Gifford <clfs@…>, 18 years ago

Removed uclibc-headers
Update Kernel Build
Added depmod.pl for Modular Kernel builds

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