From 12ec2faba0cca41a3f411f58bd63f2b4e199a6b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krystian=20Bac=C5=82awski?= Date: Fri, 3 Aug 2012 14:27:44 +0200 Subject: [PATCH] Fix problems with awk & libnix / libstubs. --- archives/fetch.sh | 1 + bootstrap.conf | 5 ++++ bootstrap.sh | 76 ++++++++++++++++++++++++++++------------------- 3 files changed, 52 insertions(+), 30 deletions(-) diff --git a/archives/fetch.sh b/archives/fetch.sh index c4a6549..3724faa 100755 --- a/archives/fetch.sh +++ b/archives/fetch.sh @@ -9,6 +9,7 @@ function download { fi } +download "ftp://ftp.gnu.org/gnu/gawk/gawk-3.1.8.tar.gz" download "ftp://ftp.gnu.org/gnu/bison/bison-1.35.tar.gz" download "ftp://ftp.gnu.org/gnu/gcc/gcc-2.95.3/gcc-core-2.95.3.tar.gz" download "ftp://ftp.gnu.org/gnu/gcc/gcc-2.95.3/gcc-g++-2.95.3.tar.gz" diff --git a/bootstrap.conf b/bootstrap.conf index 5f60636..d32ad61 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -37,6 +37,11 @@ readonly LIBNIX_SRC="${LIBNIX}.tar.gz" readonly BISON="bison-1.35" readonly BISON_SRC="${BISON}.tar.gz" +# Needed to replace built-in awk on MacOS X. +# Otherwise libnix cannot produce complete libstubs. +readonly GAWK="gawk-3.1.8" +readonly GAWK_SRC="${GAWK}.tar.gz" + readonly NDK="NDK_3.9" readonly NDK_SRC="NDK39.lha" diff --git a/bootstrap.sh b/bootstrap.sh index e40b718..a910428 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -36,6 +36,28 @@ function mkdir_empty { mkdir -p "$1" } +function unpack_clean { + local cmd + + rm -rf "$1" + + while (( "$#" > 1 )); do + shift + + if grep "\.tar\.gz$" <<<"$1"; then + cmd="tar -xzf" + elif grep "\.tar.bz2$" <<<"$1"; then + cmd="tar -xjf" + elif grep "\.lha$" <<<"$1"; then + cmd="lha -xgq" + else + cmd="false" + fi + + ${cmd} "${ARCHIVES}/$1" + done +} + function compare_version { python - "$1" "$2" "$3" <