stages/1: use GNU patch/ed instead of the versions provided by busybox
[dragora.git] / stages / 1 / x2-patch
blob62538704ca338ff8b09450516df8bac4ff615d9a
1 # Build script for GNU patch
3 # Copyright (C) 2017 Matias Fonzo, <selk@dragora.org>
5 # This script is free software: you have unlimited permission
6 # to copy, distribute and modify it.
8 version=2.7.5
10 rm -rf -- "${TMPDIR}/patch-${version}"
11 untar "${worktree}/sources/patch-${version}.tar.gz" "$TMPDIR"
13 # Build instructions
14 cd -- "${TMPDIR}/patch-${version}"
16 # Import and export toolchain variables
17 . "${worktree}/stages/env.d/cross-staticenv"
19 ./configure \
20 AR="$AR" AS="$AS" LD="$LD" RANLIB="$RANLIB" READELF="$READELF" STRIP="$STRIP" \
21 CC="$BTCC" CXX="$BTCXX" \
22 CFLAGS="$BTCFLAGS" LDFLAGS="$BTLDFLAGS" \
23  --prefix=/tools \
24  --build=$host \
25  --host=$target
27 make -j${jobs}
28 make install
30 # Unset some imported variables from file
31 unset AR AS LD RANLIB READELF STRIP
33 cleanup()
35     cd -- "$TMPDIR" && rm -rf patch-*