mirror of
https://github.com/glfs-book/glfs.git
synced 2026-01-14 00:49:06 +00:00
202 lines
6.7 KiB
XML
202 lines
6.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
%general-entities;
|
|
]>
|
|
|
|
<sect1 id="important" xreflabel="Important Information">
|
|
<?dbhtml filename="important.html"?>
|
|
|
|
<title>Important Information</title>
|
|
|
|
<para>
|
|
BLFS has more information regarding compilation, /usr vs /usr/local,
|
|
boot scripts, etc. at
|
|
<ulink url="&blfs-svn;/introduction/important.html"/>.
|
|
Unlike this book, this would be a chapter in BLFS.
|
|
A lot of that information has been omitted as this book is more linear
|
|
and doesn't follow how BLFS follows. However, we will cover some bases
|
|
here.
|
|
</para>
|
|
|
|
<sect2 id="which-instructions" xreflabel="Which Instructions to Follow">
|
|
<title>Which Instructions to Follow</title>
|
|
|
|
<para>
|
|
This book is different from the main LFS and BLFS books as it also has
|
|
lib32 installation instructions. This is bound to cause confusion.
|
|
</para>
|
|
|
|
<para>
|
|
When you see <quote>Installation of ...</quote>, those instructions
|
|
should be followed if you need that package. As you progress, you may
|
|
come across a different format, and the book will instruct you on what to
|
|
follow at that point. You should read <xref linkend="multilib"/> firstly,
|
|
and second, you will probably have to do more than the normal
|
|
installation.
|
|
</para>
|
|
|
|
<para>
|
|
This is where the sections labeled
|
|
<quote>lib32 Installation of ...</quote> come in. These sections provide
|
|
32-bit libraries for 32-bit software compatibility, ie. multilib support.
|
|
If you don't need the 32-bit libraries from a given package, you may skip
|
|
the lib32 installation instructions of that package.
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
<sect2>
|
|
<title>Stability</title>
|
|
|
|
&important-stability;
|
|
|
|
</sect2>
|
|
|
|
<sect2>
|
|
<title>Init System</title>
|
|
|
|
<para revision="sysv">
|
|
This version of this book is meant for SysV LFS systems. The Systemd
|
|
version of the book is not viewable online by ©holder; due to Github
|
|
Pages restraints. Thus you will need to download or render the book
|
|
yourself. Follow the <ulink url="&glfs-repo;">GLFS rendering
|
|
instructions</ulink> in order to render the book yourself. You will need
|
|
<ulink url='&blfs-svn;/general/git.html'>Git</ulink> to clone the
|
|
repository. You can download the book <ulink
|
|
url="&glfs-repo;/releases">here</ulink>.
|
|
</para>
|
|
|
|
<para revision="systemd">
|
|
This version of this book is meant for Systemd LFS systems.
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
<sect2>
|
|
<title>Building software</title>
|
|
|
|
<para>
|
|
Building software on GLFS is identical to how it's done in the
|
|
BLFS books, along with having lib32 compilation instructions. It
|
|
goes without saying firstmost that you should have <envar>MAKEFLAGS</envar>
|
|
set to save yourself a lot of time. This is useful for the <command>make
|
|
</command> utility to use the amount of threads that you both want
|
|
and have.
|
|
</para>
|
|
|
|
<screen><userinput>export MAKEFLAGS='-jx'</userinput></screen>
|
|
|
|
<para>
|
|
Replace <option>x</option> with the amount of threads you have.
|
|
You can check the amount of threads you have with:
|
|
</para>
|
|
|
|
<screen><userinput>grep processor /proc/cpuinfo</userinput></screen>
|
|
|
|
<important>
|
|
<para>
|
|
Make sure that you have enough RAM for your system!
|
|
A general method is having 2.5G per thread that is thrown at
|
|
<command>make</command>. For instance, if you want to use 6 threads,
|
|
multiply 6 by 2.5 (which is 15), then make sure you have 15G of RAM.
|
|
If you don't have that RAM, try and limit the threads you throw at
|
|
<command>make</command> or allot swap to meet that requirement.
|
|
</para>
|
|
</important>
|
|
|
|
<para>
|
|
Next is compiling for lib32. There are many packages which will have
|
|
a lib32 counterpart. If you just got done with a normal compilation
|
|
of a package and wish to do a lib32 compilation of that same package,
|
|
make sure to clean the directory first:
|
|
</para>
|
|
|
|
<screen><userinput>make distclean</userinput></screen>
|
|
|
|
<para>Or, if you made a build directory, do this in the build
|
|
directory:</para>
|
|
|
|
<screen><userinput>rm -rf *</userinput></screen>
|
|
|
|
<para>Then proceed with the lib32 compilation instructions.</para>
|
|
|
|
<para>
|
|
Generally, the format of targeting lib32 goes like this:
|
|
</para>
|
|
|
|
<para>For <command>./configure</command>:</para>
|
|
|
|
<screen><userinput>CC="gcc -m32" CXX="g++ -m32" \
|
|
PKG_CONFIG_PATH=/usr/lib32/pkgconfig \
|
|
./configure --prefix=/usr --libdir=/usr/lib32 \
|
|
--host=i686-pc-linux-gnu &&
|
|
|
|
make &&
|
|
|
|
make DESTDIR=$PWD/DESTDIR install &&
|
|
cp -vr DESTDIR/usr/lib32/* /usr/lib32 &&
|
|
rm -rf DESTDIR &&
|
|
ldconfig</userinput></screen>
|
|
|
|
<para>For <command>meson</command>:</para>
|
|
|
|
<screen><userinput>mkdir build &&
|
|
cd build &&
|
|
|
|
CC="gcc -m32" CXX="g++ -m32" \
|
|
PKG_CONFIG_PATH=/usr/lib32/pkgconfig \
|
|
meson setup --prefix=/usr \
|
|
--libdir=/usr/lib32 \
|
|
--buildtype=release \
|
|
.. &&
|
|
|
|
ninja &&
|
|
|
|
DESTDIR=$PWD/DESTDIR ninja install &&
|
|
cp -vr DESTDIR/usr/lib32/* /usr/lib32 &&
|
|
rm -rf DESTDIR &&
|
|
ldconfig</userinput></screen>
|
|
|
|
<para>For <command>cmake</command>:</para>
|
|
|
|
<screen><userinput>mkdir build &&
|
|
cd build &&
|
|
|
|
CC="gcc -m32" CXX="g++ -m32" \
|
|
PKG_CONFIG_PATH="/usr/lib32/pkgconfig" \
|
|
cmake -D CMAKE_INSTALL_PREFIX=/usr \
|
|
-D CMAKE_INSTALL_LIBDIR=lib32 \
|
|
-D CMAKE_BUILD_TYPE=Release \
|
|
.. &&
|
|
|
|
make &&
|
|
|
|
make DESTDIR=$PWD/DESTDIR install &&
|
|
cp -vr DESTDIR/usr/lib32/* /usr/lib32 &&
|
|
rm -rf DESTDIR &&
|
|
ldconfig</userinput></screen>
|
|
|
|
<note>
|
|
<para>
|
|
After you do a DESTDIR installation, it is recommended to
|
|
to use <command>file</command> on one of the libraries in
|
|
<filename>DESTDIR/usr/lib32</filename>. An output of such
|
|
a command for a lib32 build of a library should be
|
|
comparable to the following:
|
|
</para>
|
|
|
|
<screen><computeroutput>ELF 32-bit LSB shared object, Intel i386, version 1 (GNU/Linux), dynamically linked ...</computeroutput></screen>
|
|
|
|
<para>
|
|
Note the <computeroutput>32-bit LSB shared object</computeroutput> part.
|
|
A 64-bit library would show as a <computeroutput>64-bit LSB shared
|
|
object</computeroutput>.
|
|
</para>
|
|
</note>
|
|
|
|
</sect2>
|
|
|
|
</sect1>
|