diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2022-03-27 01:05:08 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2022-03-27 01:54:17 -0700 |
commit | 6847291ea0e3266f9ebf2c24dfe77f114a744d27 (patch) | |
tree | b27bde9bcd7c171d926527b24e8a3308d09f540b | |
parent | 735eaa1ebd5ae99b10c5824f7c9277d972693e2a (diff) | |
download | zlib-6847291ea0e3266f9ebf2c24dfe77f114a744d27.tar.gz zlib-6847291ea0e3266f9ebf2c24dfe77f114a744d27.tar.bz2 zlib-6847291ea0e3266f9ebf2c24dfe77f114a744d27.zip |
Separate out address sanitizing from warnings in configure.
-rwxr-xr-x | configure | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -87,6 +87,7 @@ build64=0 | |||
87 | gcc=0 | 87 | gcc=0 |
88 | warn=0 | 88 | warn=0 |
89 | debug=0 | 89 | debug=0 |
90 | sanitize=0 | ||
90 | old_cc="$CC" | 91 | old_cc="$CC" |
91 | old_cflags="$CFLAGS" | 92 | old_cflags="$CFLAGS" |
92 | OBJC='$(OBJZ) $(OBJG)' | 93 | OBJC='$(OBJZ) $(OBJG)' |
@@ -137,6 +138,7 @@ case "$1" in | |||
137 | -c* | --const) zconst=1; shift ;; | 138 | -c* | --const) zconst=1; shift ;; |
138 | -w* | --warn) warn=1; shift ;; | 139 | -w* | --warn) warn=1; shift ;; |
139 | -d* | --debug) debug=1; shift ;; | 140 | -d* | --debug) debug=1; shift ;; |
141 | --sanitize) sanitize=1; shift ;; | ||
140 | *) | 142 | *) |
141 | echo "unknown option: $1" | tee -a configure.log | 143 | echo "unknown option: $1" | tee -a configure.log |
142 | echo "$0 --help for help" | tee -a configure.log | 144 | echo "$0 --help for help" | tee -a configure.log |
@@ -194,11 +196,14 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then | |||
194 | fi | 196 | fi |
195 | if test "$warn" -eq 1; then | 197 | if test "$warn" -eq 1; then |
196 | if test "$zconst" -eq 1; then | 198 | if test "$zconst" -eq 1; then |
197 | CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -pedantic -DZLIB_CONST -fsanitize=address" | 199 | CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -pedantic -DZLIB_CONST" |
198 | else | 200 | else |
199 | CFLAGS="${CFLAGS} -Wall -Wextra -pedantic -fsanitize=address" | 201 | CFLAGS="${CFLAGS} -Wall -Wextra -pedantic" |
200 | fi | 202 | fi |
201 | fi | 203 | fi |
204 | if test $sanitize -eq 1; then | ||
205 | CFLAGS="${CFLAGS} -fsanitize=address" | ||
206 | fi | ||
202 | if test $debug -eq 1; then | 207 | if test $debug -eq 1; then |
203 | CFLAGS="${CFLAGS} -DZLIB_DEBUG" | 208 | CFLAGS="${CFLAGS} -DZLIB_DEBUG" |
204 | SFLAGS="${SFLAGS} -DZLIB_DEBUG" | 209 | SFLAGS="${SFLAGS} -DZLIB_DEBUG" |