summaryrefslogtreecommitdiff
path: root/tools/build-toolchains.sh
blob: 077c444515b704ed82e36519e4961277ddc68e3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /bin/sh
# Build the Windows cross and native toolchains for x86 and x86_64

WIPE=$1
CURDIR=`pwd`
set -e

for a in "w64" "w32"
do
  for p in "lin" "win"
  do
      echo "Building $p-$a toolchain"
      if test "x$WIPE" = "x1"; then
        ./cerbero-uninstalled -c config/mingw-$a-$p.cbc wipe --force
      fi
    ./cerbero-uninstalled -c config/mingw-$a-$p.cbc build toolchain


    if test "x$a" = "xw64"; then
        ARCH=x86_64
    else
        ARCH=x86
    fi
    if test "x$p" = "xwin"; then
        PLAT=windows
    else
        PLAT=linux
    fi
    TC=mingw-$a-gcc-4.7.3-$PLAT-$ARCH.tar.xz
    echo "Creating tarball $TC"
    cd  ~/mingw/$PLAT/$a
    XZ_OPT=-9 tar cJf $CURDIR/$TC *
    cd $CURDIR
    md5sum  $TC | awk '{print $1}' > $TC.md5
    sha1sum $TC | awk '{print $1}' > $TC.sha1
  done
done