Refuse to build the library if deprecated features are excluded

Mbed Crypto is no longer being updated, so using it is deprecated.

Don't test with MBEDTLS_DEPRECATED_REMOVED anymore since the library
deliberately no longer builds when it's enabled.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h
index df35a16..ae7469e 100644
--- a/include/mbedtls/check_config.h
+++ b/include/mbedtls/check_config.h
@@ -30,6 +30,9 @@
 #ifndef MBEDTLS_CHECK_CONFIG_H
 #define MBEDTLS_CHECK_CONFIG_H
 
+#if defined(MBEDTLS_DEPRECATED_REMOVED)
+#error "Mbed Crypto is no longer being updated. Please use Mbed TLS instead. See README.md."
+#endif
 #if defined(MBEDTLS_DEPRECATED_WARNING)
 #warning "Mbed Crypto is no longer being updated. Please use Mbed TLS instead. See README.md."
 #endif
diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh
index 17ca346..fd31773 100755
--- a/tests/scripts/all.sh
+++ b/tests/scripts/all.sh
@@ -712,15 +712,6 @@
     msg "test: make, full config + DEPRECATED_WARNING, expect warnings" # ~ 30s
     make -C tests clean
     make CC=gcc CFLAGS='-O -Werror -Wall -Wextra -Wno-error=deprecated-declarations -DMBEDTLS_TEST_DEPRECATED' tests
-
-    msg "build: make, full config + DEPRECATED_REMOVED, clang -O" # ~ 30s
-    # No cleanup, just tweak the configuration and rebuild
-    make clean
-    scripts/config.py unset MBEDTLS_DEPRECATED_WARNING
-    scripts/config.py set MBEDTLS_DEPRECATED_REMOVED
-    # Build with -O -Wextra to catch a maximum of issues.
-    make CC=clang CFLAGS='-O -Werror -Wall -Wextra' lib programs
-    make CC=clang CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests
 }
 
 component_test_depends_curves () {