builder: msys2 fixes

Build zlib before ccache so that ccache does not try to use its bundled
zlib, which does not compile cleanly on cygwin/msys2.

A couple of related PRs for ccache:

https://github.com/ccache/ccache/pull/311
https://github.com/ccache/ccache/pull/310

Replace the usage of xzcat/bzcat in archive unpacking with `xz -dc` and
`bzip2 -dc` because @ZachBacon had some issues with xzcat trying to
compress instead of decompress.

When switching msys2 build modes, unset related env vars first,
sometimes they can get mixed up for some reason.
This commit is contained in:
Rafael Kitover 2018-09-12 17:21:40 -07:00
parent 3aa00bfbbf
commit be0d49a304
2 changed files with 9 additions and 3 deletions

View File

@ -114,11 +114,11 @@ DISTS=$DISTS'
bzip2 https://github.com/nemequ/bzip2/releases/download/v1.0.6/bzip2-1.0.6.tar.gz lib/libbz2.a
xz https://tukaani.org/xz/xz-5.2.3.tar.gz lib/liblzma.a
unzip https://downloads.sourceforge.net/project/infozip/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz bin/unzip
zlib https://zlib.net/zlib-1.2.11.tar.gz lib/libz.a
ccache https://www.samba.org/ftp/ccache/ccache-3.4.3.tar.xz bin/ccache
zip https://downloads.sourceforge.net/project/infozip/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz bin/zip
openssl https://www.openssl.org/source/openssl-1.0.2o.tar.gz lib/libssl.a
cmake https://cmake.org/files/v3.10/cmake-3.10.3.tar.gz bin/cmake
zlib https://zlib.net/zlib-1.2.11.tar.gz lib/libz.a
m4 http://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.xz bin/m4
autoconf https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.xz bin/autoconf
autoconf-archive http://mirror.team-cymru.org/gnu/autoconf-archive/autoconf-archive-2017.09.28.tar.xz share/aclocal/ax_check_gl.m4
@ -1059,10 +1059,10 @@ unpack_dist() {
$TAR $@ -zxf "$dist_file"
;;
*.tar.xz)
xzcat "$dist_file" | $TAR $@ -xf -
xz -dc "$dist_file" | $TAR $@ -xf -
;;
*.tar.bz2)
bzcat "$dist_file" | $TAR $@ -xf -
bzip2 -dc "$dist_file" | $TAR $@ -xf -
;;
*.zip)
unzip -q "$dist_file"

View File

@ -6,6 +6,7 @@ case "$1" in
-32)
shift
if [ "$MSYSTEM" != MINGW32 ]; then
unset MSYSTEM_PREFIX MSYSTEM_CARCH MSYSTEM_CHOST MINGW_CHOST MINGW_PREFIX MINGW_PACKAGE_PREFIX CONFIG_SITE ACLOCAL_PATH PKG_CONFIG_PATH
OPWD=$PWD
export MSYSTEM=MINGW32
. /etc/profile || :
@ -15,6 +16,7 @@ case "$1" in
-64)
shift
if [ "$MSYSTEM" != MINGW64 ]; then
unset MSYSTEM_PREFIX MSYSTEM_CARCH MSYSTEM_CHOST MINGW_CHOST MINGW_PREFIX MINGW_PACKAGE_PREFIX CONFIG_SITE ACLOCAL_PATH PKG_CONFIG_PATH
OPWD=$PWD
export MSYSTEM=MINGW64
. /etc/profile || :
@ -105,6 +107,8 @@ DIST_TAR_ARGS="
set_host_env() {
ln -sf "$BUILD_ROOT/host" "$BUILD_ROOT/root"
unset MSYSTEM_PREFIX MSYSTEM_CARCH MSYSTEM_CHOST MINGW_CHOST MINGW_PREFIX MINGW_PACKAGE_PREFIX CONFIG_SITE ACLOCAL_PATH PKG_CONFIG_PATH
OPWD=$PWD
MSYSTEM=MSYS . /etc/profile || :
eval "$BUILD_ENV"
@ -114,6 +118,8 @@ set_host_env() {
unset_host_env() {
ln -sf "$BUILD_ROOT/target" "$BUILD_ROOT/root"
unset MSYSTEM_PREFIX MSYSTEM_CARCH MSYSTEM_CHOST MINGW_CHOST MINGW_PREFIX MINGW_PACKAGE_PREFIX CONFIG_SITE ACLOCAL_PATH PKG_CONFIG_PATH
OPWD=$PWD
MSYSTEM=$OMSYSTEM . /etc/profile || :
eval "$BUILD_ENV"