1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-18 09:53:22 -07:00

mingw scripts

This commit is contained in:
Connor Olding 2013-06-29 11:47:01 -07:00
parent b4916f1c30
commit 593b8a1718
5 changed files with 62 additions and 7 deletions

2
bashrc
View File

@ -31,3 +31,5 @@ PROMPT_COMMAND='[ $? = 0 ] && PS1=${ret_succ} || PS1=${ret_fail}'
# this doesn't work for all scripts at the moment, but
PATH="$PATH:$HOME/sh"
unset x

View File

@ -40,7 +40,7 @@ PATH="$PATH:$rc/sh"
umask 027
for f in .bashrc .zshrc shrc.zsh .conkyrc .inputrc .screenrc .xinitrc; do
for f in .bashrc .zshrc shrc.zsh mingw.sh .conkyrc .inputrc .screenrc .xinitrc; do
r="$rc/$(dotless "$f")"
hardlink "$f" "$r"
done

46
mingw.sh Normal file
View File

@ -0,0 +1,46 @@
# FYI you use /opt/mingw-w64 for mingw itself
# but /opt/mingw for things built with mingw...
#[ -d "$HOME/opt/mingw-w64" ] || echo -E "crap no mingw" >&2
mkdir -p ~/opt/mingw
alias cmakem='cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=~/mingw.cmake'
_mw_enabled=0
_mw_name=i686-w64-mingw32
_mw_bin=~/opt/mingw-w64/bin/$_mw_name
_mw_misc=~/opt/mingw-w64/$_mw_name
_mw_prefix=~/opt/mingw
declare -A _mw_
_mw_export() {
[ -z "$1" ] && return 1
[ -n "${ZSH_VERSION:-}" ] && _mw_[$1]=${(P)1} || _mw_[$1]="${!1}"
export "$1=$2"
}
mingw-disable() {
[ $_mw_enabled -eq 0 ] && return 1
_mw_enabled=0
local e=
for e in PATH AR CC CPP CXX CFLAGS CPPFLAGS CXXFLAGS LDFLAGS RANLIB RC WINDRES; do
export "$e=${_mw_[$e]}"
done
}
mingw-enable() {
[ $_mw_enabled -eq 1 ] && return 1
_mw_enabled=1
set -- CC gcc CXX g++ CPP cpp AR ar RANLIB ranlib RC windres WINDRES windres
while _mw_export "$1" "$_mw_bin-$2"; do
shift 2
done
_mw_export PATH "$PATH:$HOME/opt/mingw-w64/bin"
_mw_export CFLAGS "-O2 -I $_mw_misc/include -I $_mw_prefix/include"
_mw_export LDFLAGS "-s -L $_mw_misc/lib -L $_mw_prefix/lib"
_mw_export CPPFLAGS ''
_mw_export CXXFLAGS "$CFLAGS"
}

View File

@ -3,7 +3,11 @@
umask 027 # screw others
export PATH="$PATH:$HOME/opt/local/bin"
export PATH="$PATH:$HOME/opt/mingw-w64/bin"
# cleanup in case of inherited exports
for x in AR CC CPP CXX CFLAGS CPPFLAGS CXXFLAGS LDFLAGS RANLIB RC WINDRES; do
export $x=
done
export PREFIX="$HOME/opt/local"
export CC=clang
@ -24,6 +28,7 @@ alias make="colormake"
# just flags
export LESS='-SR'
alias makedbg='CFLAGS="-O0" LDFLAGS="-g" make'
alias fils="du -bad1"
alias lsfm="lsf -ugpms"
alias lsa="ls -A --group-directories-first"
@ -36,7 +41,6 @@ alias erc="e ~/.zshrc ~/shrc.zsh ~/.bashrc"
alias irc="screen -dR irc irssi"
alias crawl='screen -dR crawl ssh crawl@crawl.develz.org -i ~/.ssh/crawl'
alias crawla='screen -dR crawl ssh crawl@crawl.akrasiac.org -l joshua -i ~/.ssh/crawl'
alias cmakem="cmake -G \"Unix Makefiles\" -DCMAKE_TOOLCHAIN_FILE=~/mingw.cmake"
# providing extra functionality
# TODO: dotfiles first, like `LC_ALL=C ls -A` which doesnt work with -X flag
@ -49,5 +53,6 @@ alias unwrap='awk '"'"'BEGIN{RS="\n\n";FS="\n"}{for(i=1;i<=NF;i++)printf "%s ",$
alias picky='{ pacman -Qgq base base-devel; pacman -Qtq; } | sort | uniq -u'
alias unused='{ pacman -Qt; pacman -Qe | tee -; } | sort | uniq -u'
. ~/mingw.sh
. ~/sh/lsf.sh/lsf.sh
. ~/sh/z/z.sh

10
zshrc
View File

@ -77,10 +77,10 @@ bindkey '^Xe' edit-command-line # ctrl+x -> e
alias -g STFU="2>/dev/null"
for c in ack cd cp ebuild gcc gist grep ln man mkdir mv rm
alias $c="nocorrect $c"
for c in arith fc find ftp history let locate rsync scp sftp wget
alias $c="noglob $c"
for x in ack cd cp ebuild gcc gist grep ln man mkdir mv rm
alias $x="nocorrect $x"
for x in arith fc find ftp history let locate rsync scp sftp wget
alias $x="noglob $x"
if [[ "$TERM" = xterm* ]]; then
precmd() { print -Pn "\e]2;%M: %~\a" }
@ -101,3 +101,5 @@ reload() {
[ -f .zcompdump.zwc.old ] && rm -f .zcompdump.zwc.old
exec zsh # reload zsh (ends script execution)
}
unset x