Diff

Differences From Artifact [7fa536bdae]:

To Artifact [a68c94db4c]:


     1      1   #! /bin/bash
     2      2   
     3      3   cd "$(dirname "$(which "$0")")/.." || exit 1
     4      4   
     5      5   # Generate configure script
     6      6   ./build/autogen.sh
            7  +
            8  +# Download TCC
            9  +tcc_version='0.9.26'
           10  +tcc_url="http://download.savannah.gnu.org/releases/tinycc/tcc-${tcc_version}.tar.bz2"
           11  +tcc_sha256='521e701ae436c302545c3f973a9c9b7e2694769c71d9be10f70a2460705b6d71'
           12  +(
           13  +	rm -rf __TMP__
           14  +	mkdir __TMP__ || exit 1
           15  +	cd __TMP__ || exit 1
           16  +
           17  +	wget -O 'new' "${tcc_url}" || rm -f new
           18  +	new_sha256="$(openssl sha256 new | sed 's@.*= *@@')"
           19  +
           20  +	if [ "${new_sha256}" != "${tcc_sha256}" ]; then
           21  +		echo "Checksum Mismatch: Downloaded: ${new_sha256}; Expected: ${tcc_sha256}" >&2
           22  +
           23  +		rm -f new
           24  +
           25  +		exit 1
           26  +	fi
           27  +
           28  +	mv new "tcc-${tcc_version}.tar.bz2"
           29  +
           30  +	bzip2 -dc "tcc-${tcc_version}.tar.bz2" | tar -xf -
           31  +
           32  +	rm -f "tcc-${tcc_version}.tar.bz2"
           33  +
           34  +	rm -rf ../tcc
           35  +	mkdir ../tcc || exit 1
           36  +	mv */* ../tcc/
           37  +)
           38  +rm -rf __TMP__