#!/bin/sh # # Build busybox prerelease binaries # TARGETS="build_pre_32 build_pre_64 build_pre_64a build_pre_64u" # If an argument is supplied it overrides the default source directory. SRC=busybox-w32 if [ $# -eq 1 ] then SRC=$1 fi if [ ! -d $SRC ] then echo "$SRC doesn't exist" exit 0 fi # remove old and make new build directories for i in $TARGETS do rm -rf $i cp -rp $SRC $i done # apply default configuration for i in $TARGETS do ( if [ $i = "build_pre_64" ] then CONFIG=mingw64_defconfig elif [ $i = "build_pre_64u" ] then CONFIG=mingw64u_defconfig elif [ $i = "build_pre_64a" ] then CONFIG=mingw64a_defconfig PATH="/data2/llvm/current/bin:$PATH" elif [ $i = "build_pre_32" ] then CONFIG=mingw32_defconfig fi cd $i git checkout master SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) TZ=UTC0 \ make ${CONFIG} ) done # perform build for i in $TARGETS do BITS=64 if [ $i = "build_pre_32" ] then BITS=32; fi ( cd $i if [ $i = "build_pre_64a" ] then # /data2/llvm/current should be a symlink PATH="/data2/llvm/current/bin:$PATH" VERSION=$(readlink /data2/llvm/current) else GCCV=$(rpm -q --qf '%{name} %{version}-%{release}\n' mingw${BITS}-gcc) CRTV=$(rpm -q --qf '%{name} %{version}-%{release}\n' mingw${BITS}-crt) VERSION="$GCCV; $CRTV" fi SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) TZ=UTC0 \ make -j $(nproc) EXTRAVERSION="-$(git describe --match=FRP | sed 's/FRP/PRE/')" MINGW_VER="$VERSION" ) done # Check the expected binaries exist echo for i in $TARGETS do ls -l $i/busybox.exe done