Skip to content

Commit a7337ad

Browse files
committed
Fix toolchain crosscompilation with mingw
1 parent 3a3682c commit a7337ad

File tree

5 files changed

+28
-7
lines changed

5 files changed

+28
-7
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- /automake.in 2017-12-18 12:26:59.455263520 +0100
2+
+++ /automake.in 2017-12-18 12:27:21.228596603 +0100
3+
@@ -4110,7 +4110,7 @@
4+
sub substitute_ac_subst_variables ($)
5+
{
6+
my ($text) = @_;
7+
- $text =~ s/\${([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge;
8+
+ $text =~ s/\$[{]([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
9+
return $text;
10+
}
11+

binutils.build.bash

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ then
2323
exit 1
2424
fi
2525

26+
if [[ $CROSS_COMPILE == "mingw" ]] ; then
27+
EXTRA_CONFARGS="--host=i686-w64-mingw32"
28+
fi
29+
2630
cd toolsdir/bin
2731
TOOLS_BIN_PATH=`pwd`
2832
cd -
@@ -63,7 +67,7 @@ CONFARGS=" \
6367
--with-pic \
6468
--target=avr"
6569

66-
CFLAGS="-w -O2 -g0 $CFLAGS" CXXFLAGS="-w -O2 -g0 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" ../binutils/configure $CONFARGS
70+
CFLAGS="-w -O2 -g0 $CFLAGS" CXXFLAGS="-w -O2 -g0 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" ../binutils/configure $CONFARGS $EXTRA_CONFARGS
6771

6872
if [ -z "$MAKE_JOBS" ]; then
6973
MAKE_JOBS="2"

gcc.build.bash

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ pushd gcc
6363
#cat avr-mcus.def | awk -f genmultilib.awk FORMAT="Makefile" > t-multilib
6464
#popd
6565
pushd gcc
66-
#for p in ../../avr-gcc-patches/*.patch
67-
#do
68-
# echo Applying $p
69-
# patch -p1 < $p
70-
#done
66+
for p in ../../avr-gcc-patches/*.patch
67+
do
68+
echo Applying $p
69+
patch -p1 < $p
70+
done
7171
autoconf
7272
popd
7373
popd

gdb.build.bash

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ cd toolsdir/bin
2727
TOOLS_BIN_PATH=`pwd`
2828
cd -
2929

30+
if [[ $CROSS_COMPILE == "mingw" ]] ; then
31+
EXTRA_CONFARGS="--host=i686-w64-mingw32"
32+
fi
33+
3034
export PATH="$TOOLS_BIN_PATH:$PATH"
3135

3236
if [[ ! -f avr-gdb.tar.bz2 ]] ;
@@ -59,7 +63,7 @@ CONFARGS=" \
5963
--disable-binutils \
6064
--target=avr"
6165

62-
CFLAGS="-w -O2 -g0 $CFLAGS" CXXFLAGS="-w -O2 -g0 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" ../gdb/configure $CONFARGS
66+
CFLAGS="-w -O2 -g0 $CFLAGS" CXXFLAGS="-w -O2 -g0 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" ../gdb/configure $CONFARGS $EXTRA_CONFARGS
6367

6468
if [ -z "$MAKE_JOBS" ]; then
6569
MAKE_JOBS="2"

tools.bash

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ tar xfjv automake-${AUTOMAKE_VERSION}.tar.bz2
5858

5959
cd automake-${AUTOMAKE_VERSION}
6060

61+
patch -p1 < ../automake-patches/0001-fix-perl-522.patch
62+
6163
./bootstrap
6264

6365
CONFARGS="--prefix=$TOOLS_PATH"

0 commit comments

Comments
 (0)