Fix "Too many levels of symbolic links" in chapter 8 ncurses

The problem is that TIC_PATH is nor honored anymore in chapter
6, so that tic from the host is used to create the terminfo
database in chapter 6. The problem is that old versions of
tic create symlinks in the database, while newer versions
create hardlinks. Since we use a DESTDIR install in chapter 8
(with a recent version of ncurses, so with hardlinks), and copy
it in place with cp -a, then it seems that copying hardlinks to
symlinks. If an old version of tic has been used in chapter 6,
this copies hardlinks to symlinks, which creates symlinks
pointing to themselves (cp bug?).

Anyway, the solution is to copy the auxilliary tic built
in chapter 6 to $LFS/tools/bin (suggestion by Xi Ruoyao).
Now, there is no need to set TIC_PATH or whatever because this
tic is in the PATH.

Bug first reported by Marcin Dulak. Analysis with the help of
Bruce Dubbs and Thomas Trepl.

Fixes https://wiki.linuxfromscratch.org/lfs/ticket/5744
This commit is contained in:
Pierre Labastie 2025-06-13 15:52:08 +02:00
parent 5544caf28e
commit 5e4ff8cb2e

View File

@ -44,13 +44,16 @@
<title>Installation of Ncurses</title>
<para>First, run the following commands to build the <quote>tic</quote>
program on the build host:</para>
program on the build host. We install it in
<filename class="directory">$LFS/tools</filename>, so that it is found
in the <envar>PATH</envar> when needed:</para>
<screen><userinput remap="pre">mkdir build
pushd build
../configure AWK=gawk
../configure --prefix=$LFS/tools AWK=gawk
make -C include
make -C progs tic
install progs/tic $LFS/tools/bin
popd</userinput></screen>
<para>Prepare Ncurses for compilation:</para>
@ -147,28 +150,14 @@ popd</userinput></screen>
<para>Install the package:</para>
<screen><userinput remap="install">make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install
<screen><userinput remap="install">make DESTDIR=$LFS install
ln -sv libncursesw.so $LFS/usr/lib/libncurses.so
sed -e 's/^#if.*XOPEN.*$/#if 1/' \
-i $LFS/usr/include/curses.h</userinput></screen>
<!--
<para>Remove an unneeded static library not handled by
<command>configure</command>:</para>
<screen><userinput remap="install">rm -v $LFS/usr/lib/libncurses++w.a</userinput></screen>
-->
<variablelist>
<title>The meaning of the install options:</title>
<varlistentry>
<term><parameter>TIC_PATH=$(pwd)/build/progs/tic</parameter></term>
<listitem>
<para>We need to pass the path of the newly built
<command>tic</command> program that runs on the building machine, so
the terminal database can be created without errors.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>ln -sv libncursesw.so $LFS/usr/lib/libncurses.so</command></term>
<listitem>