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

Last change on this file since c14754c was 0bd108d, checked in by Jim Gifford <clfs@…>, 18 years ago

Fixed uclibc headers so they install instead of symlinking

  • Property mode set to 100644
File size: 4.7 KB
Line 
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
37sed -e "s:default TARGET_i386:default TARGET_i386:" \
38 extra/Configs/Config.in.orig > extra/Configs/Config.in</userinput></screen>
39
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
45sed -e 's/$(LN) -fs/cp/g' Makefile.orig > Makefile
46for 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
49done</userinput></screen>
50
51 <note os="e">
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>
56
57 <para os="f">Create default configuration:</para>
58
59<screen os="g"><userinput>make defconfig</userinput></screen>
60
61 <para os="h">We will need to edit the configuration file, to make sure everything gets
62 compiled and put into it's proper locations:</para>
63
64<screen os="i"><userinput>cp .config .config.orig
65sed -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
72 <para os="j">We will need to make sure that some settings in uClibc are set so we
73 can utilize all the features of BusyBox:</para>
74
75<screen os="k"><userinput>UCLIBC_OPTIONS="DO_C99_MATH UCLIBC_HAS_RPC UCLIBC_HAS_CTYPE_CHECKED UCLIBC_HAS_WCHAR UCLIBC_HAS_HEXADECIMAL_FLOATS
76 UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE UCLIBC_HAS_PRINTF_M_SPEC UCLIBC_HAS_FTW UCLIBC_HAS_IPV6"
77for config in $UCLIBC_OPTIONS; do
78 cp .config .config.orig
79 sed -e "s:# ${config} is not set:${config}=y:" .config.orig > .config
80done
81echo "UCLIBC_HAS_FULL_RPC=y" >> .config</userinput></screen>
82
83 <para os="l">Compile the package:</para>
84
85<screen os="m"><userinput>make TARGET_ARCH=i386</userinput></screen>
86
87 <para os="n">We will remove the files that were copied over from our Linux Headers during
88 the building of uClibc. These files were copied into the include directory of the source
89 directory of uClibc:</para>
90
91<screen os="o"><userinput>rm include/{asm,asm-generic,linux}</userinput></screen>
92
93 <para os="p">Install the package:</para>
94
95<screen os="q"><userinput>make PREFIX=${CLFS} install</userinput></screen>
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>
109<!--
110 <variablelist>
111 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
112 <?dbfo list-presentation="list"?>
113 <?dbhtml list-presentation="table"?>
114
115 <varlistentry id="uclibc">
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>
127-->
128
129 </sect2>
130</sect1>
Note: See TracBrowser for help on using the repository browser.