diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2021-08-05 12:44:41 +0100 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2021-08-05 12:52:34 +0100 |
commit | 07ed3ac992d5086dcd47273236ad72e496d9620f (patch) | |
tree | 50317b83a0bda7e954cbb51a0894c40a9f06bcc5 /configure | |
parent | 0521e115b2230852135db5cc8bbf9022443a95c4 (diff) | |
download | pack-07ed3ac992d5086dcd47273236ad72e496d9620f.tar.gz pack-07ed3ac992d5086dcd47273236ad72e496d9620f.tar.xz pack-07ed3ac992d5086dcd47273236ad72e496d9620f.zip |
Separate gcc specific warnings
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -9,13 +9,14 @@ Options: -C cflag Append cflag to CFLAGS -L ldflag Append ldflag to LDFLAGS -P cppflag Append cppflag to CPPFLAGS + -W profile Enable compiler specific warnings (clang|gcc) (overrides -w) -c when Enable compiler colours (always|auto|off) [default: auto] -d Enable debugging flags -e Enable -Werror -h Show this help -o Enable optimisation flags -v Print results of configuration - -w Enable warning flags + -w Enable warning flags (overrides -W) Environment: CC C compiler EOF @@ -25,20 +26,21 @@ exec 3>config.rc conf() { echo "$1" >&3; } colour=auto -while getopts B:C:L:P:c:dehovw opt; do +while getopts B:C:L:P:W:c:dehovw opt; do qopt=${OPTARG@Q} case $opt in B) conf "LDLIBS+=($qopt)";; C) conf "CFLAGS+=($qopt)";; L) conf "LDFLAGS+=($qopt)";; P) conf "CPPFLAGS+=($qopt)";; + W) warn="$OPTARG";; c) colour="$OPTARG";; d) conf "debug=1" >&3;; e) conf "werror=1" >&3;; h) usage; help; exit;; o) conf "optimise=1" >&3;; v) conf "verbose=1" >&3;; - w) conf "warn=1" >&3;; + w) warn=1;; ?) usage >&2; exit 1;; esac done @@ -49,5 +51,9 @@ case "$colour" in off) conf "colour=0";; *) usage >&2; exit 1;; esac +case "$warn" in + 1|clang|gcc) conf "warn=$warn";; + ?*) usage >&2; exit 1;; +esac if [[ $CC ]]; then conf "CC=${CC@Q}"; fi |