Cross-compile ncurses into stage3 chroot.
authorRichard W.M. Jones <rjones@redhat.com>
Sat, 6 Aug 2016 15:15:09 +0000 (16:15 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Sat, 6 Aug 2016 19:09:09 +0000 (20:09 +0100)
.gitignore
Makefile

index 81d9416..c45d10a 100644 (file)
@@ -2,6 +2,7 @@
 *.tar.gz
 *.tar.lz
 *.tar.xz
+*.tgz
 stamp-*
 
 /stage1-riscv-qemu/riscv-qemu.spec
@@ -20,4 +21,5 @@ stamp-*
 /gmp-6.1.1/
 /mpc-1.0.3/
 /mpfr-3.1.4/
+/ncurses-6.0-20160730/
 /riscv-gcc-riscv-gcc-6.1.0/
index eceb9ae..ba07225 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -39,6 +39,7 @@ LOCAL_LINUX_GIT_COPY = $(HOME)/d/linux
 STAGE3_PACKAGES = gcc rpm-build
 
 # Versions of cross-compiled packages.
+NCURSES_VERSION    = 6.0-20160730
 BASH_VERSION      = 4.3
 COREUTILS_VERSION = 8.25
 GMP_VERSION       = 6.1.1
@@ -244,6 +245,7 @@ stage3: stage3-kernel/linux-$(KERNEL_VERSION)/vmlinux \
        stage3-chroot-original/etc/fedora-release \
        stage3-chroot/etc/fedora-release \
        stage3-chroot/lib64/libc.so.6 \
+       stage3-chroot/usr/bin/tic \
        stage3-chroot/bin/bash \
        stage3-chroot/bin/ls \
        stage3-chroot/usr/lib64/libgmp.so.10 \
@@ -308,6 +310,23 @@ stage3-chroot/lib64/libc.so.6:
        done
        cd stage3-chroot/lib64 && for f in ../lib/*; do ln -sf $$f; done
 
+# Cross-compile ncurses.
+stage3-chroot/usr/bin/tic: ncurses-$(NCURSES_VERSION).tgz
+       tar zxf $^
+       cd ncurses-$(NCURSES_VERSION) && \
+       PATH=$(ROOT)/fixed-gcc:$$PATH \
+       ./configure --host=riscv64-unknown-linux-gnu \
+           --prefix=/usr --libdir=/usr/lib64 \
+           --with-shared
+       cd ncurses-$(NCURSES_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make
+       cd ncurses-$(NCURSES_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make install DESTDIR=$(ROOT)/stage3-chroot
+       cd $(ROOT)/stage3-chroot/usr/lib64 && ln -sf libtinfo.so.6 libtinfo.so
+
+ncurses-$(NCURSES_VERSION).tgz:
+       rm -f $@ $@-t
+       wget -O $@-t ftp://invisible-island.net/ncurses/current/ncurses-$(NCURSES_VERSION).tgz
+       mv $@-t $@
+
 # Cross-compile bash.
 stage3-chroot/bin/bash: bash-$(BASH_VERSION).tar.gz
        tar zxf $^