diff --git a/configure b/configure index 083101ae5..feb88736b 100755 --- a/configure +++ b/configure @@ -529,6 +529,33 @@ if [[ "${CONFIG[LOG_BACKTRACE]}" = "y" ]]; then fi fi +if [[ "${CONFIG[ASAN]}" = "y" ]]; then + if ! echo -e 'int main(void) { return 0; }\n' \ + | $BUILD_CMD -fsanitize=address - 2>/dev/null; then + echo --enable-asan requires libasan. + echo Please install then re-run this script. + exit 1 + fi +fi + +if [[ "${CONFIG[UBSAN]}" = "y" ]]; then + if ! echo -e 'int main(void) { return 0; }\n' \ + | $BUILD_CMD -fsanitize=undefined - 2>/dev/null; then + echo --enable-ubsan requires libubsan. + echo Please install then re-run this script. + exit 1 + fi +fi + +if [[ "${CONFIG[TSAN]}" = "y" ]]; then + if ! echo -e 'int main(void) { return 0; }\n' \ + | $BUILD_CMD -fsanitize=thread - 2>/dev/null; then + echo --enable-tsan requires libtsan. + echo Please install then re-run this script. + exit 1 + fi +fi + if [[ "${CONFIG[OCF]}" = "y" ]]; then # If OCF_PATH is a file, assume it is a library and use it to compile with if [ -f ${CONFIG[OCF_PATH]} ]; then