forked from radareorg/radare2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmingw32.sh
executable file
·39 lines (33 loc) · 852 Bytes
/
mingw32.sh
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
#!/bin/sh
# find root
cd `dirname $PWD/$0` ; cd ..
#TODO: add support for ccache
# XXX. fails with >1
MAKE_JOBS=8
OLD_LDFLAGS="${LDFLAGS}"
unset LDFLAGS
CFGFLAGS="--with-ostype=windows"
type i686-pc-mingw32-gcc >/dev/null 2>&1
if [ $? = 0 ]; then
C=i686-pc-mingw32-gcc
H=i686-unknown-windows
elif [ -x /usr/bin/i686-w64-mingw32-gcc ]; then
C=i686-w64-mingw32-gcc
H=i686-unknown-windows
elif [ -x /usr/bin/pacman ]; then
C=i486-mingw32-gcc
H=i486-unknown-windows
elif [ `uname` = Darwin ]; then
C=i386-mingw32-gcc
H=i386-unknown-windows
elif [ -x /usr/bin/apt-get ]; then
C=i586-mingw32msvc-gcc
H=i586-unknown-windows
else
echo "arch/opensuse/ubuntu/debian mingw32 package required."
exit 1
fi
make mrproper
./configure ${CFGFLAGS} --with-compiler=$C --host=$H && \
make -s -j ${MAKE_JOBS} CC="${C} -static-libgcc" && \
make w32dist