Add popt to stage3 chroot.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 9 Aug 2016 12:35:31 +0000 (13:35 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 9 Aug 2016 12:35:31 +0000 (13:35 +0100)
.gitignore
Makefile

index dd70165..ba3ce2f 100644 (file)
@@ -24,6 +24,7 @@ stamp-*
 /mpc-1.0.3/
 /mpfr-3.1.4/
 /ncurses-6.0-20160730/
+/popt-1.16/
 /riscv-binutils-gdb-riscv-binutils-2.26/
 /riscv-gcc-riscv-gcc-6.1.0/
 /tar-1.29/
index 30b2c83..3b461fc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,7 @@ ZLIB_VERSION       = 1.2.8
 # Needs to match the installed (on host) version, otherwise:
 # "Cannot use the installed version of file (xx) to cross-compile file yy"
 FILE_VERSION       = 5.25
+POPT_VERSION       = 1.16
 
 all: stage1 stage2 stage3 stage4
 
@@ -266,6 +267,7 @@ stage3: stage3-kernel/linux-$(KERNEL_VERSION)/vmlinux \
        stage3-chroot/usr/bin/gzip \
        stage3-chroot/usr/lib64/libz.so \
        stage3-chroot/usr/bin/file \
+       stage3-chroot/usr/lib64/libpopt.so \
        stage3-chroot/init \
        stage3-disk.img
 
@@ -572,6 +574,25 @@ file-$(FILE_VERSION).tar.gz:
        wget -O $@-t ftp://ftp.astron.com/pub/file/file-$(FILE_VERSION).tar.gz
        mv $@-t $@
 
+# Cross-compile popt.
+stage3-chroot/usr/lib64/libpopt.so: popt-$(POPT_VERSION).tar.gz
+       rm -rf popt-$(POPT_VERSION)
+       tar -zxf $^
+       cd popt-$(POPT_VERSION) && \
+       PATH=$(ROOT)/fixed-gcc:$$PATH \
+       LDFLAGS=-L/home/rjones/d/fedora-riscv/stage3-chroot/usr/lib64 \
+       ./configure \
+           --host=riscv64-unknown-linux-gnu \
+           --prefix=/usr --libdir=/usr/lib64 \
+           --disable-static --enable-shared
+       cd popt-$(POPT_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make V=1
+       cd popt-$(POPT_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot
+
+popt-$(POPT_VERSION).tar.gz:
+       rm -f $@ $@-t
+       wget -O $@-t http://rpm5.org/files/popt/popt-$(POPT_VERSION).tar.gz
+       mv $@-t $@
+
 # Create an /init script.
 stage3-chroot/init: init.sh
        install -m 0755 $^ $@