aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-01-09 10:38:02 -0400
committerDavid Bremner <david@tethera.net>2022-01-22 21:14:29 -0400
commit5620dc142eded4dd210e8dc0d16dd0c257f88819 (patch)
tree6de4d39ecc424f8b569e04d7ecab2ff926614c9a
parentcc180507b03d9826c92d48ee91dbd9bb5f15cd56 (diff)
configure: check for ASAN support
This will allow conditionally running tests that use the address sanitizer.
-rwxr-xr-xconfigure15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure b/configure
index 9e45cbe6..36f3f606 100755
--- a/configure
+++ b/configure
@@ -410,6 +410,18 @@ EOF
exit 1
fi
+printf "C compiler supports address sanitizer... "
+test_cmdline="${CC} ${CFLAGS} ${CPPFLAGS} -fsanitize=address minimal.c ${LDFLAGS} -o minimal"
+if ${test_cmdline} >/dev/null 2>&1 && ./minimal
+then
+ printf "Yes.\n"
+ have_asan=1
+else
+ printf "Nope, skipping those tests.\n"
+ have_asan=0
+fi
+unset test_cmdline
+
printf "Reading libnotmuch version from source... "
cat > _libversion.c <<EOF
#include <stdio.h>
@@ -1548,6 +1560,9 @@ NOTMUCH_GMIME_X509_CERT_VALIDITY=${gmime_x509_cert_validity}
# Whether GMime can verify signatures when decrypting with a session key:
NOTMUCH_GMIME_VERIFY_WITH_SESSION_KEY=${gmime_verify_with_session_key}
+# Does the C compiler support the address sanitizer
+NOTMUCH_HAVE_ASAN=${have_asan}
+
# do we have man pages?
NOTMUCH_HAVE_MAN=$((have_sphinx))