radare2/sys/mingw32.sh

48 lines
983 B
Bash
Raw Normal View History

#!/bin/sh
# find root
2015-06-17 02:59:01 +00:00
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"
2012-08-31 23:06:24 +00:00
type i586-mingw32-gcc
if [ $? = 0 ]; then
C=i586-mingw32-gcc
H=i586-unknown-windows
else
2014-07-18 06:57:43 +00:00
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
2015-06-17 02:59:01 +00:00
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
fi
2013-08-26 23:02:41 +00:00
make mrproper
./configure ${CFGFLAGS} --with-compiler=$C --host=$H && \
make -s -j ${MAKE_JOBS} CC="${C} -g -static-libgcc" && \
make w32dist
2015-06-17 02:59:01 +00:00
LDFLAGS="${OLD_LDFLAGS}"