Add diffutils (diff), findutils (find), sed and patch to the stage3 chroot.
authorRichard W.M. Jones <rjones@redhat.com>
Wed, 10 Aug 2016 17:04:56 +0000 (18:04 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Wed, 10 Aug 2016 17:09:30 +0000 (18:09 +0100)
.gitignore
Makefile

index b05ec7e..a8fab17 100644 (file)
@@ -22,7 +22,9 @@ stamp-*
 /beecrypt-4.2.1/
 /bzip2-1.0.6/
 /coreutils-8.25/
+/diffutils-3.4/
 /file-5.28/
+/findutils-4.6.0/
 /gmp-6.1.1/
 /grep-2.25/
 /gzip-1.8/
@@ -32,11 +34,13 @@ stamp-*
 /mpfr-3.1.4/
 /nano-2.6.2/
 /ncurses-6.0-20160730/
+/patch-2.7.5/
 /popt-1.16/
 /riscv-binutils-gdb-riscv-binutils-2.26/
 /riscv-gcc-riscv-gcc-6.1.0/
 /riscv-strace-f320e1897832fd07a62e18ed288e75d8e79f4c5b/
 /rpm-9571218/
+/sed-4.2/
 /tar-1.29/
 /util-linux-2.28/
 /zlib-1.2.8/
index 9c07b0c..b137fd1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -69,6 +69,10 @@ STRACE_COMMIT      = f320e1897832fd07a62e18ed288e75d8e79f4c5b
 STRACE_SHORT_COMMIT = f320e189
 BZIP2_VERSION      = 1.0.6
 MAKE_VERSION       = 4.1
+DIFFUTILS_VERSION  = 3.4
+FINDUTILS_VERSION  = 4.6.0
+SED_VERSION        = 4.2
+PATCH_VERSION      = 2.7.5
 
 all: stage1 stage2 stage3 stage4
 
@@ -289,6 +293,10 @@ stage3: stage3-kernel/linux-$(KERNEL_VERSION)/vmlinux \
        stage3-chroot/usr/bin/strace \
        stage3-chroot/usr/bin/bzip2 \
        stage3-chroot/usr/bin/make \
+       stage3-chroot/usr/bin/diff \
+       stage3-chroot/usr/bin/find \
+       stage3-chroot/usr/bin/sed \
+       stage3-chroot/usr/bin/patch \
        stage3-chroot/usr/bin/rpm \
        stage3-chroot/init \
        stage3-disk.img
@@ -756,6 +764,74 @@ make-$(MAKE_VERSION).tar.gz:
        wget -O $@-t https://ftp.gnu.org/gnu/make/make-$(MAKE_VERSION).tar.gz
        mv $@-t $@
 
+# Cross-compile GNU diffutils.
+stage3-chroot/usr/bin/diff: diffutils-$(DIFFUTILS_VERSION).tar.xz
+       rm -rf diffutils-$(DIFFUTILS_VERSION)
+       tar -Jxf $^
+       cd diffutils-$(DIFFUTILS_VERSION) && \
+       PATH=$(ROOT)/fixed-gcc:$$PATH \
+       ./configure \
+           --host=riscv64-unknown-linux-gnu \
+           --prefix=/usr --libdir=/usr/lib64
+       cd diffutils-$(DIFFUTILS_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make
+       cd diffutils-$(DIFFUTILS_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot
+
+diffutils-$(DIFFUTILS_VERSION).tar.xz:
+       rm -f $@ $@-t
+       wget -O $@-t https://ftp.gnu.org/gnu/diffutils/diffutils-$(DIFFUTILS_VERSION).tar.xz
+       mv $@-t $@
+
+# Cross-compile GNU findutils.
+stage3-chroot/usr/bin/find: findutils-$(FINDUTILS_VERSION).tar.gz
+       rm -rf findutils-$(FINDUTILS_VERSION)
+       tar -zxf $^
+       cd findutils-$(FINDUTILS_VERSION) && \
+       PATH=$(ROOT)/fixed-gcc:$$PATH \
+       ./configure \
+           --host=riscv64-unknown-linux-gnu \
+           --prefix=/usr --libdir=/usr/lib64
+       cd findutils-$(FINDUTILS_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make
+       cd findutils-$(FINDUTILS_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot
+
+findutils-$(FINDUTILS_VERSION).tar.gz:
+       rm -f $@ $@-t
+       wget -O $@-t https://ftp.gnu.org/gnu/findutils/findutils-$(FINDUTILS_VERSION).tar.gz
+       mv $@-t $@
+
+# Cross-compile GNU sed.
+stage3-chroot/usr/bin/sed: sed-$(SED_VERSION).tar.gz
+       rm -rf sed-$(SED_VERSION)
+       tar -zxf $^
+       cd sed-$(SED_VERSION) && \
+       PATH=$(ROOT)/fixed-gcc:$$PATH \
+       ./configure \
+           --host=riscv64-unknown-linux-gnu \
+           --prefix=/usr --libdir=/usr/lib64
+       cd sed-$(SED_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make
+       cd sed-$(SED_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot
+
+sed-$(SED_VERSION).tar.gz:
+       rm -f $@ $@-t
+       wget -O $@-t https://ftp.gnu.org/gnu/sed/sed-$(SED_VERSION).tar.gz
+       mv $@-t $@
+
+# Cross-compile patch.
+stage3-chroot/usr/bin/patch: patch-$(PATCH_VERSION).tar.gz
+       rm -rf patch-$(PATCH_VERSION)
+       tar -zxf $^
+       cd patch-$(PATCH_VERSION) && \
+       PATH=$(ROOT)/fixed-gcc:$$PATH \
+       ./configure \
+           --host=riscv64-unknown-linux-gnu \
+           --prefix=/usr --libdir=/usr/lib64
+       cd patch-$(PATCH_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make
+       cd patch-$(PATCH_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot
+
+patch-$(PATCH_VERSION).tar.gz:
+       rm -f $@ $@-t
+       wget -O $@-t https://ftp.gnu.org/gnu/patch/patch-$(PATCH_VERSION).tar.gz
+       mv $@-t $@
+
 # Cross-compile RPM / rpmbuild.
 # We build this from a git commit, with a few hacks to the configure
 # script.