Add GNU gettext to stage3 chroot.
authorRichard W.M. Jones <rjones@redhat.com>
Wed, 10 Aug 2016 21:31:26 +0000 (22:31 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Wed, 10 Aug 2016 21:39:30 +0000 (22:39 +0100)
This is required to build the 'iso-codes' RPM.

.gitignore
Makefile

index 48aae81..0c49a18 100644 (file)
@@ -25,6 +25,7 @@ stamp-*
 /diffutils-3.4/
 /file-5.28/
 /findutils-4.6.0/
+/gettext-0.19/
 /gmp-6.1.1/
 /grep-2.25/
 /gzip-1.8/
index 1388e75..3f9c6dc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -74,6 +74,7 @@ FINDUTILS_VERSION  = 4.6.0
 SED_VERSION        = 4.2
 PATCH_VERSION      = 2.7.5
 HOSTNAME_VERSION   = 3.15
+GETTEXT_VERSION    = 0.19
 
 all: stage1 stage2 stage3 stage4
 
@@ -299,6 +300,7 @@ stage3: stage3-kernel/linux-$(KERNEL_VERSION)/vmlinux \
        stage3-chroot/usr/bin/sed \
        stage3-chroot/usr/bin/patch \
        stage3-chroot/usr/bin/hostname \
+       stage3-chroot/usr/bin/gettext \
        stage3-chroot/usr/bin/rpm \
        stage3-chroot/init \
        stage3-disk.img
@@ -851,6 +853,24 @@ hostname-$(HOSTNAME_VERSION).tar.gz:
        wget -O $@-t http://ftp.de.debian.org/debian/pool/main/h/hostname/hostname_$(HOSTNAME_VERSION).tar.gz
        mv $@-t $@
 
+# Cross-compile GNU gettext.
+stage3-chroot/usr/bin/gettext: gettext-$(GETTEXT_VERSION).tar.gz
+       rm -rf gettext-$(GETTEXT_VERSION)
+       tar -zxf $^
+       cd gettext-$(GETTEXT_VERSION) && \
+       PATH=$(ROOT)/fixed-gcc:$$PATH \
+       ./configure \
+           --host=riscv64-unknown-linux-gnu \
+           --prefix=/usr --libdir=/usr/lib64
+       cd gettext-$(GETTEXT_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make
+       cd gettext-$(GETTEXT_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make install DESTDIR=$(ROOT)/stage3-chroot
+       rm -f stage3-chroot/usr/lib64/*.la
+
+gettext-$(GETTEXT_VERSION).tar.gz:
+       rm -f $@ $@-t
+       wget -O $@-t https://ftp.gnu.org/gnu/gettext/gettext-$(GETTEXT_VERSION).tar.gz
+       mv $@-t $@
+
 # Cross-compile RPM / rpmbuild.
 # We build this from a git commit, with a few hacks to the configure
 # script.