Sunday, December 27, 2020

Chapter 18 : Compile and Install Ncurses - Cross Compiling Temporary Tools

Hi,
In this chapter we are going to discuss about install Ncurses package.

Note :
- Please check the version of the package when you compile and install, at the time of writing the package was at version 6.2
- You should be logged in as lfs user, when you perform the actions described here.
- Change directory to the sources folder (/mnt/lfs/sources)

Unpack the package tar ball and change directory to ncurses-6.2
$ tar -xvf ncurses-6.2.tar.gz
$ cd ncurses-6.2

Ensure that gawk is found first during configuration.
$ sed -i s/mawk// configure

Run the following commands to build the “tic” program on the build host
$ mkdir build
$ pushd build
  ./configure
  make -C include
  make -C progs tic
  popd
$ cd build

Prepare Ncurses for Compilation.
../configure --prefix=/usr                \
            --host=$LFS_TGT              \
            --build=$(./config.guess)    \
            --mandir=/usr/share/man      \
            --with-manpage-format=normal \
            --with-shared                \
            --without-debug              \
            --without-ada                \
            --without-normal             \
            --enable-widec

Compiling the Ncurses.
$ make -j4

Installing the Ncursed.
make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install

The libncurses.so library is needed by a few packages we will build soon hence we create this small linker script
$ echo "INPUT(-lncursesw)" > $LFS/usr/lib/libncurses.so

Move the shared libraries to the /lib directory
$ mv -v $LFS/usr/lib/libncursesw.so.6* $LFS/lib

Change directory to the Ncurses home
$ cd ..

Because the libraries have been moved, one symlink points to a non-existent file. Recreate it
$ ln -sfv ../../lib/$(readlink $LFS/usr/lib/libncursesw.so) $LFS/usr/lib/libncursesw.so

If you would like to have a detailed explanation on what we discussed so far, you can refer the link below




No comments:

Post a Comment

How to change the root password in linux when it is forgotten/to change

This blog is all about changing the root password of the Linux system when it is forgotten or to reset the password...   Let's get it ...