1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 16:09:03 -08:00

set up clang cross compiling

This commit is contained in:
Connor Olding 2015-12-13 10:22:18 -08:00
parent 246c4c892c
commit 91ccf02d77
2 changed files with 13 additions and 2 deletions

View file

@ -9,7 +9,8 @@ hash -d win=/cygdrive/c/Users/$USER
hash -d mm='/cygdrive/c/Program Files (x86)/mupen64plus/mm'
ADDPATH() {
grep ":$1:" <<<":$PATH:" >/dev/null || export PATH="$PATH:$1"
new="$(readlink -f "$1")"
grep ":$new:" <<<":$PATH:" >/dev/null || export PATH="$PATH:$new"
}
ADDPATH "$HOME/opt/local/bin"

12
sh/mw
View file

@ -27,7 +27,7 @@ mw-disable() {
local e=
for e in PATH PREFIX CC CPP CXX LD CFLAGS CPPFLAGS CXXFLAGS LDFLAGS \
AR RANLIB RC WINDRES OBJCOPY SDL_CFLAGS SDL_LDLIBS; do
AR RANLIB RC WINDRES OBJCOPY COMPILER_PATH SDL_CFLAGS SDL_LDLIBS; do
local v="${_mw_[$e]}"
[ -n "$v" ] && export "$e=$v" || unset "$e"
done
@ -84,6 +84,16 @@ mw() {
mw-enable $_mw_host64 ~/src/mxe/usr
export CFLAGS="-mwin32 $CFLAGS"
export CXXFLAGS="$CFLAGS"
elif [[ "$1" == 32c ]]; then
mw-enable $_mw_host32 ~/src/mxe/usr
export CC="$_mw_host32-clang"
export CXX="$_mw_host32-clang++"
export COMPILER_PATH="$HOME/src/mxe/usr/bin"
elif [[ "$1" == 64c ]]; then
mw-enable $_mw_host64 ~/src/mxe/usr
export CC="$_mw_host64-clang"
export CXX="$_mw_host64-clang++"
export COMPILER_PATH="$HOME/src/mxe/usr/bin"
elif [[ "$1" == arm ]]; then
mw-enable $_mw_hostarm /usr
export CFLAGS="-mfloat-abi=hard -mcpu=cortex-a9 $CFLAGS"