-### use option --enable-warnings to turn on all gcc warnings
-AC_MSG_CHECKING(if you want to see compiler warnings)
-AC_ARG_ENABLE(warnings,
- [ --enable-warnings build: turn on GCC compiler warnings],
- [with_warnings=$enableval])
-AC_MSG_RESULT($with_warnings)
-
-if test "x$with_warnings" = "xyes"; then
- CF_ADD_ADAFLAGS(-gnatg)
- CF_GCC_WARNINGS(Wno-unknown-pragmas Wswitch-enum)
+CF_ENABLE_WARNINGS(Wno-unknown-pragmas Wswitch-enum,yes)
+if test "x$enable_warnings" = "xyes"; then
+ CF_ADD_ADAFLAGS(-gnatwa -gnatyg)