File: cross-make-mingw64.sh

package info (click to toggle)
iortcw 1.51.c%2Bdfsg1-3
  • links: PTS, VCS
  • area: contrib
  • in suites: bullseye
  • size: 25,312 kB
  • sloc: ansic: 457,326; cpp: 6,507; makefile: 4,754; sh: 1,336; asm: 1,176; xml: 31
file content (45 lines) | stat: -rwxr-xr-x 1,004 bytes parent folder | download | duplicates (12)
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
38
39
40
41
42
43
44
45
#!/bin/sh

# Note: This works in Linux and cygwin

CMD_PREFIX="x86_64-w64-mingw32 amd64-mingw32msvc";

if [ "X$CC" = "X" ]; then
    for check in $CMD_PREFIX; do
        full_check="${check}-gcc"
        which "$full_check" > /dev/null 2>&1
        if [ "$?" = "0" ]; then
            export CC="$full_check"
        fi
    done
fi

if [ "X$CXX" = "X" ]; then
    for check in $CMD_PREFIX; do
        full_check="${check}-g++"
        which "$full_check" > /dev/null 2>&1
        if [ "$?" = "0" ]; then
            export CXX="$full_check"
        fi
    done
fi

if [ "X$WINDRES" = "X" ]; then
    for check in $CMD_PREFIX; do
        full_check="${check}-windres"
        which "$full_check" > /dev/null 2>&1
        if [ "$?" = "0" ]; then
            export WINDRES="$full_check"
        fi
    done
fi

if [ "X$WINDRES" = "X" -o "X$CC" = "X" -o "X$CXX" = "X" ]; then
    echo "Error: Must define or find WINDRES, CC, and CXX"
    exit 1
fi

export PLATFORM=mingw32
export ARCH=x86_64

exec make $*