diff --git a/build.sh b/build.sh index e609029..84c623b 100755 --- a/build.sh +++ b/build.sh @@ -50,6 +50,9 @@ LINUX_URL=https://cdn.kernel.org/pub/linux/kernel/v$LINUX_VERSION_MAJOR.x/linux- M4_VERSION=1.4.20 M4_URL=https://mirror.ufs.ac.za/gnu/m4/m4-$M4_VERSION.tar.xz +NCURSES_VERSION=6.6 +NCURSES_URL=https://mirror.ufs.ac.za/gnu/ncurses/ncurses-$NCURSES_VERSION.tar.gz + if [ ! -d "$SYSROOT" ]; then mkdir -p "$SYSROOT"/{etc,cross,sources,usr,dev,proc,sys,run} mkdir -p "$SYSROOT"/usr/{bin,sbin,lib,include} @@ -63,7 +66,6 @@ fetch() { wget -N -c --show-progress -q -P "$SOURCES" $1 } - bootstrap_binutils() { fetch $BINUTILS_URL @@ -215,9 +217,49 @@ toolchain_m4() { cd "$SOURCES" && rm -rf m4-$M4_VERSION } +toolchain_ncurses() { + fetch $NCURSES_URL + + cd "$SOURCES" && tar xf ncurses-$NCURSES_VERSION.tar.gz && cd ncurses-$NCURSES_VERSION + + mkdir -p build + + pushd build + ../configure \ + --prefix="$CROSS" \ + AWK=gawk + make -C include + make -C progs tic + install progs/tic "$CROSS/bin" + popd + + ./configure \ + --prefix=/usr \ + --host=$TARGET \ + --build=$(./config.guess) \ + --mandir=/usr/share/man \ + --with-manpage-format=normal \ + --with-shared \ + --without-normal \ + --with-cxx-shared \ + --without-debug \ + --without-ada \ + --disable-stripping \ + AWK=gawk + + make && make DESTDIR="$SYSROOT" install + + ln -s libncursesw.so "$SYSROOT"/usr/lib/libncurses.so + + sed -e 's/^#if.*XOPEN.*$/#if 1/' -i "$SYSROOT"/usr/include/curses.h + + cd "$SOURCES" && rm -rf ncurses-$NCURSES_VERSION +} + #bootstrap_binutils #bootstap_gcc #bootstap_linux #bootstap_glibc #bootstap_libstdcpp -toolchain_m4 \ No newline at end of file +#toolchain_m4 +toolchain_ncurses \ No newline at end of file