Build binutils for Windows too so that we can get addr2line.exe.
[mingw-build.git] / build_binutils_windows.sh
diff --git a/build_binutils_windows.sh b/build_binutils_windows.sh
new file mode 100644 (file)
index 0000000..a0b9a30
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash -e
+#
+# Build binutils running on Windows and targeting Windows.
+# At the moment this is just for addr2line.exe
+
+tar xzf Archives/binutils-2.24.tar.gz
+mkdir -p binutils-windows-build-$MINGW_TARGET
+cd binutils-windows-build-$MINGW_TARGET
+PATH=$MINGW_PREFIX/bin:$PATH ../binutils-2.24/configure --with-sysroot=$MINGW_PREFIX --prefix=/tmp/frobozz --disable-multilib \
+  --host=$MINGW_TARGET --target=$MINGW_TARGET --enable-targets=$MINGW_TARGET 
+PATH=$MINGW_PREFIX/bin:$PATH make $MINGW_PARALLEL
+sudo cp binutils/.libs/addr2line.exe $MINGW_PREFIX/bin
+