summaryrefslogtreecommitdiff
path: root/.zsh/zshfunctions
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2011-03-13 23:19:50 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2011-03-13 23:19:52 +0100
commitc666df70b0321c9711a8a965daff1e2608c38b59 (patch)
tree2864d89ebb82e2614a371bcdd6827ca8febf3aba /.zsh/zshfunctions
parentb4f9d6e0b325c71c62b19825b42758e8110ee871 (diff)
downloaddotfiles-c666df70b0321c9711a8a965daff1e2608c38b59.tar.gz
dotfiles-c666df70b0321c9711a8a965daff1e2608c38b59.tar.bz2
dotfiles-c666df70b0321c9711a8a965daff1e2608c38b59.zip
Add list_cc_flags
Diffstat (limited to '.zsh/zshfunctions')
-rw-r--r--.zsh/zshfunctions23
1 files changed, 23 insertions, 0 deletions
diff --git a/.zsh/zshfunctions b/.zsh/zshfunctions
index 92f88f2..db01a95 100644
--- a/.zsh/zshfunctions
+++ b/.zsh/zshfunctions
@@ -153,6 +153,29 @@ menc()
unset p
}
+list_cc_flags()
+{
+ Usage()
+ {
+ printf '%s\n' "Usage: ${0##*/} c|o [gcc-Flags e.g. -march=native -O2]
+ Show which compile|optimization flags are selected when you chose gcc-Flags"
+ return ${1:-1}
+ }
+
+ case "${1}" in
+ c)
+ shift
+ gcc -v -c -Q "${@}" -o /dev/null -x c - 2>&1 <<PROG
+int main(){return 0;}
+PROG
+ ;;
+ o)
+ shift
+ gcc -c -Q "${@}" -o /dev/null --help=optimizer 2>&1;;
+ *) Usage;;
+ esac
+}
+
if [[ $UID == 0 ]]; then
# unpack a package