lfs-buildscripts/CH6Build/CH06.02-ncurses.sh

66 lines
1.1 KiB
Bash
Raw Permalink Normal View History

2024-10-02 10:32:40 +08:00
#!/bin/bash
2024-10-06 06:16:22 +08:00
source ../versions.sh
2024-10-02 10:32:40 +08:00
GLSOURCES="${LFS}/sources"
if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user"
fi
2024-10-08 15:33:13 +08:00
pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
2024-10-02 10:32:40 +08:00
2024-10-04 01:04:58 +08:00
[ -d ncurses-${ncurses_version} ] && rm -rf ncurses-${ncurses_version}
2024-10-02 10:32:40 +08:00
tar -zxf ${ncurses_tarball}
cd ncurses-${ncurses_version}
sed -i s/mawk// configure
mkdir build
pushd build
../configure
make -C include
make -C progs tic
popd
./configure --prefix=/usr \
--host=${LFS_TGT} \
--build=$(./config.guess) \
--mandir=/usr/share/man \
--with-manpage-format=normal \
--with-shared \
--without-normal \
--with-cxx-shared \
--without-debug \
--without-ada \
--disable-stripping
make
if [ $? -ne 0 ]; then
myfail "Failed building ncurses"
fi
make DESTDIR=${LFS} TIC_PATH=$(pwd)/build/progs/tic install
if [ $? -ne 0 ]; then
myfail "Failed installing ncurses"
fi
ln -sv libncursesw.so ${LFS}/usr/lib/libncurses.so
sed -e 's/^#if.*XOPEN.*$/#if 1/' \
-i ${LFS}/usr/include/curses.h
2024-10-08 15:33:13 +08:00
popd
# cleanup
pushd ${GLSOURCES}
2024-10-02 10:32:40 +08:00
2024-10-08 15:33:13 +08:00
rm -rf ncurses-${ncurses_version}
popd