mirror of
https://github.com/notwa/rc
synced 2025-02-05 07:43:22 -08:00
ash compatibility stuff
This commit is contained in:
parent
ad482288fa
commit
1ca9d7ba36
3 changed files with 72 additions and 68 deletions
89
home/-shrc
89
home/-shrc
|
@ -1,24 +1,28 @@
|
||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
# for both zsh and bash
|
# for zsh, bash, and ash.
|
||||||
|
|
||||||
# umask should be reset else pip might make faulty installations.
|
# umask should be reset else pip might make faulty installations.
|
||||||
umask 022
|
umask 022
|
||||||
|
|
||||||
[ -z "$MSYSTEM" ] && cdrive="/cygdrive/c" || cdrive="/c"
|
[ -n "$ZSH_VERSION" -o -n "$BASH" ] && FANCY=1 || FANCY=0
|
||||||
[ -z "$MSYSTEM" ] && ddrive="/cygdrive/d" || ddrive="/d"
|
|
||||||
hash -d c="$cdrive"
|
if [ $FANCY -eq 1 ]; then
|
||||||
hash -d d="$ddrive"
|
# these drive letters only help because of a bug in my zsh completions...
|
||||||
hash -d cyg=~c"/cygwin/home/$USER"
|
hash -d c="/c"
|
||||||
hash -d msys=~c"/msys64/home/$USER"
|
hash -d d="/d"
|
||||||
hash -d e="/media/chibi"
|
[ -d /media/chibi ] && hash -d e="/media/chibi" || hash -d e="/e"
|
||||||
hash -d win=~c"/Users/$USER"
|
|
||||||
hash -d mm=~c"/Program Files (x86)/mupen64plus/mm"
|
hash -d cyg=~c"/cygwin/home/$USER"
|
||||||
hash -d py=~win"/Dropbox/py"
|
hash -d msys=~c"/msys64/home/$USER"
|
||||||
|
hash -d win=~c"/Users/$USER"
|
||||||
|
hash -d mm=~c"/Program Files (x86)/mupen64plus/mm"
|
||||||
|
hash -d py=~win"/Dropbox/py"
|
||||||
|
fi
|
||||||
|
|
||||||
ADDPATH() {
|
ADDPATH() {
|
||||||
new="$(readlink -f "$1")"
|
new="$(readlink -f "$1")"
|
||||||
[ -d "$new" ] || echo -E "ADDPATH: path doesn't exist: $new" >&2
|
[ -d "$new" ] || echo -E "ADDPATH: path doesn't exist: $1" >&2
|
||||||
grep ":$new:" <<<":$PATH:" >/dev/null || export PATH="$PATH:$new"
|
echo ":$PATH:" | grep -q ":$new:" || export PATH="$PATH:$new"
|
||||||
}
|
}
|
||||||
ADDPATH "$HOME/opt/local/bin"
|
ADDPATH "$HOME/opt/local/bin"
|
||||||
[ -n "$MSYSTEM" ] && ADDPATH "/c/path"
|
[ -n "$MSYSTEM" ] && ADDPATH "/c/path"
|
||||||
|
@ -100,56 +104,6 @@ alias perlu='perl -Mopen=locale -Mutf8'
|
||||||
alias rgn="rg --no-ignore"
|
alias rgn="rg --no-ignore"
|
||||||
alias cms="cryptominisat5 --verb 0"
|
alias cms="cryptominisat5 --verb 0"
|
||||||
|
|
||||||
whoa=(
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
# -Winline # only for C
|
|
||||||
# -Wshadow # only for C
|
|
||||||
-Wwrite-strings
|
|
||||||
# -Wmissing-prototypes
|
|
||||||
|
|
||||||
-Werror=implicit-function-declaration
|
|
||||||
-Werror=uninitialized
|
|
||||||
-Werror=format-security
|
|
||||||
-Werror=format-extra-args
|
|
||||||
-Werror=pointer-to-int-cast
|
|
||||||
-Werror=int-to-pointer-cast
|
|
||||||
-Werror=return-type
|
|
||||||
-Werror=memset-transposed-args
|
|
||||||
# -Werror=tautological-constant-out-of-range-compare # gcc doesn't like this
|
|
||||||
# -Werror=undef
|
|
||||||
|
|
||||||
-Wno-unused
|
|
||||||
-Wno-padded
|
|
||||||
-Wno-missing-field-initializers
|
|
||||||
# -Wno-type-limits # bad for generated code (macros, templates)
|
|
||||||
-Wno-misleading-indentation # gcc 6
|
|
||||||
-Wno-disabled-macro-expansion # clang
|
|
||||||
-Wno-language-extension-token # clang
|
|
||||||
-Wno-unknown-warning-option # clang
|
|
||||||
|
|
||||||
# trying some stuff:
|
|
||||||
-Wduplicated-cond # gcc 6
|
|
||||||
-Wduplicated-branches # gcc 7
|
|
||||||
-Wlogical-op
|
|
||||||
-Wrestrict # gcc 7
|
|
||||||
-Wnull-dereference # gcc 6
|
|
||||||
#-Wjump-misses-init # only for C
|
|
||||||
-Wdouble-promotion
|
|
||||||
-Wformat=2
|
|
||||||
)
|
|
||||||
|
|
||||||
welp=(
|
|
||||||
-fno-exceptions
|
|
||||||
-fno-non-call-exceptions
|
|
||||||
-fno-rtti
|
|
||||||
#-fno-use-cxa-atexit
|
|
||||||
#-ffreestanding
|
|
||||||
-fno-common
|
|
||||||
-ffunction-sections -fdata-sections -Wl,--gc-sections
|
|
||||||
-finline-small-functions -findirect-inlining
|
|
||||||
)
|
|
||||||
|
|
||||||
if which sudo >/dev/null 2>/dev/null; then
|
if which sudo >/dev/null 2>/dev/null; then
|
||||||
alias maybesudo=sudo
|
alias maybesudo=sudo
|
||||||
else
|
else
|
||||||
|
@ -205,8 +159,9 @@ trash() {
|
||||||
dd status=none if=/dev/random bs=1 count="$1"
|
dd status=none if=/dev/random bs=1 count="$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
unset cdrive
|
if [ $FANCY -eq 1 ]; then
|
||||||
unset ddrive
|
source ~/.arrays
|
||||||
|
source ~/.streamcrap
|
||||||
|
fi
|
||||||
|
|
||||||
. ~/.streamcrap
|
source ~/.ea
|
||||||
. ~/.ea
|
|
||||||
|
|
49
home/arrays
Normal file
49
home/arrays
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
whoa=(
|
||||||
|
-Wall
|
||||||
|
-Wextra
|
||||||
|
# -Winline # only for C
|
||||||
|
# -Wshadow # only for C
|
||||||
|
-Wwrite-strings
|
||||||
|
# -Wmissing-prototypes
|
||||||
|
|
||||||
|
-Werror=implicit-function-declaration
|
||||||
|
-Werror=uninitialized
|
||||||
|
-Werror=format-security
|
||||||
|
-Werror=format-extra-args
|
||||||
|
-Werror=pointer-to-int-cast
|
||||||
|
-Werror=int-to-pointer-cast
|
||||||
|
-Werror=return-type
|
||||||
|
-Werror=memset-transposed-args
|
||||||
|
# -Werror=tautological-constant-out-of-range-compare # gcc doesn't like this
|
||||||
|
# -Werror=undef
|
||||||
|
|
||||||
|
-Wno-unused
|
||||||
|
-Wno-padded
|
||||||
|
-Wno-missing-field-initializers
|
||||||
|
# -Wno-type-limits # bad for generated code (macros, templates)
|
||||||
|
-Wno-misleading-indentation # gcc 6
|
||||||
|
-Wno-disabled-macro-expansion # clang
|
||||||
|
-Wno-language-extension-token # clang
|
||||||
|
-Wno-unknown-warning-option # clang
|
||||||
|
|
||||||
|
# trying some stuff:
|
||||||
|
-Wduplicated-cond # gcc 6
|
||||||
|
-Wduplicated-branches # gcc 7
|
||||||
|
-Wlogical-op
|
||||||
|
-Wrestrict # gcc 7
|
||||||
|
-Wnull-dereference # gcc 6
|
||||||
|
#-Wjump-misses-init # only for C
|
||||||
|
-Wdouble-promotion
|
||||||
|
-Wformat=2
|
||||||
|
)
|
||||||
|
|
||||||
|
welp=(
|
||||||
|
-fno-exceptions
|
||||||
|
-fno-non-call-exceptions
|
||||||
|
-fno-rtti
|
||||||
|
#-fno-use-cxa-atexit
|
||||||
|
#-ffreestanding
|
||||||
|
-fno-common
|
||||||
|
-ffunction-sections -fdata-sections -Wl,--gc-sections
|
||||||
|
-finline-small-functions -findirect-inlining
|
||||||
|
)
|
2
install
2
install
|
@ -108,7 +108,7 @@ PATH="${PATH:?No existing PATH}:$rc/sh"
|
||||||
|
|
||||||
backup_dir="$rc/backup-$(date -u '+%s')"
|
backup_dir="$rc/backup-$(date -u '+%s')"
|
||||||
|
|
||||||
for f in .bashrc .zshrc .-shrc .streamcrap .ea .vimrc \
|
for f in .bashrc .zshrc .-shrc .arrays .streamcrap .ea .vimrc \
|
||||||
.inputrc .Xresources .screenrc; do
|
.inputrc .Xresources .screenrc; do
|
||||||
dotless "$f"
|
dotless "$f"
|
||||||
r="$rc/home/$REPLY"
|
r="$rc/home/$REPLY"
|
||||||
|
|
Loading…
Add table
Reference in a new issue