Skip to content

Commit aca38cf

Browse files
committed
Fix build on OSX
Needs gnu tools from homebrew
1 parent 9e94c0b commit aca38cf

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

build.conf

+15-7
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,22 @@ MPC_SOURCES="http://www.multiprecision.org/mpc/download"
1818
# With any luck, you don't need to edit the below
1919
################################################################################
2020

21-
# Defaut the versions of gmp/mpfr/mpc to those specified in the SOURCES.README
21+
if [[ "$OSTYPE" == "darwin"* ]]; then
22+
SED=gsed
23+
else
24+
SED=sed
25+
fi
26+
27+
GREP=grep
28+
29+
#fallback for grep without pearl regexp
2230
SOURCES_README="$(wget -O - http://distribute.atmel.no/tools/opensource/Atmel-AVR-GNU-Toolchain/${AVR_VERSION}/SOURCES.README 2>/dev/null)"
23-
[ -z "$GCC_VERSION" ] && GCC_VERSION="$(echo "$SOURCES_README" | grep -Po "GCC\s+([0-9]+\.)+[0-9]+" | sed -r 's/GCC\s//')"
24-
[ -z "$AUTOMAKE_VERSION" ] && AUTOMAKE_VERSION="$(echo "$SOURCES_README" | grep -Po "automake-([0-9]+\.)+[0-9]+" | sed -r 's/[^-]+-//')"
25-
[ -z "$AUTOCONF_VERSION" ] && AUTOCONF_VERSION="$(echo "$SOURCES_README" | grep -Po "autoconf-([0-9]+\.)+[0-9]+" | sed -r 's/[^-]+-//')"
26-
[ -z "$GMP_VERSION" ] && GMP_VERSION="$(echo "$SOURCES_README" | grep -Po "gmp-([0-9]+\.)+[0-9]+" | sed -r 's/[^-]+-//')"
27-
[ -z "$MPFR_VERSION" ] && MPFR_VERSION="$(echo "$SOURCES_README" | grep -Po "mpfr-([0-9]+\.)+[0-9]+" | sed -r 's/[^-]+-//')"
28-
[ -z "$MPC_VERSION" ] && MPC_VERSION="$(echo "$SOURCES_README" | grep -Po "mpc-([0-9]+\.)+[0-9]+" | sed -r 's/[^-]+-//')"
31+
[ -z "$GCC_VERSION" ] && GCC_VERSION="$(echo "$SOURCES_README" | $GREP "GCC" | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")"
32+
[ -z "$AUTOMAKE_VERSION" ] && AUTOMAKE_VERSION="$(echo "$SOURCES_README" | $GREP "automake" | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")"
33+
[ -z "$AUTOCONF_VERSION" ] && AUTOCONF_VERSION="$(echo "$SOURCES_README" | $GREP "autoconf" | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")"
34+
[ -z "$GMP_VERSION" ] && GMP_VERSION="$(echo "$SOURCES_README" | $GREP "gmp" | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")"
35+
[ -z "$MPFR_VERSION" ] && MPFR_VERSION="$(echo "$SOURCES_README" | $GREP "mpfr" | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")"
36+
[ -z "$MPC_VERSION" ] && MPC_VERSION="$(echo "$SOURCES_README" | $GREP "mpc" | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")"
2937

3038
# Build the URLs from which to grab the archives for those components
3139
AUTOCONF_SOURCE="${GNU_SOURCES}/autoconf/autoconf-${AUTOCONF_VERSION}.tar.bz2"

tools.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ CONFARGS="--prefix=$TOOLS_PATH"
6666

6767
# Prevent compilation problem with docs complaining about @itemx not following @item
6868
cp doc/automake.texi doc/automake.texi2
69-
cat doc/automake.texi2 | sed -r 's/@itemx/@c @itemx/' >doc/automake.texi
69+
cat doc/automake.texi2 | $SED -r 's/@itemx/@c @itemx/' >doc/automake.texi
7070
rm doc/automake.texi2
7171

7272
nice -n 10 make -j $MAKE_JOBS

0 commit comments

Comments
 (0)