Portable build framework for OpenNTPD
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
880 B

  1. AC_DEFUN([DISABLE_COMPILER_WARNINGS], [
  2. # Clang throws a lot of warnings when it does not understand a flag. Disable
  3. # this warning for now so other warnings are visible.
  4. AC_MSG_CHECKING([if compiling with clang])
  5. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
  6. #ifndef __clang__
  7. not clang
  8. #endif
  9. ]])],
  10. [CLANG=yes],
  11. [CLANG=no]
  12. )
  13. AC_MSG_RESULT([$CLANG])
  14. AS_IF([test "x$CLANG" = "xyes"], [CLANG_FLAGS=-Qunused-arguments])
  15. CFLAGS="$CFLAGS $CLANG_FLAGS"
  16. LDFLAGS="$LDFLAGS $CLANG_FLAGS"
  17. # Removing the dependency on -Wno-pointer-sign should be a goal. These are
  18. # largely unsigned char */char* mismatches in asn1 functions.
  19. save_cflags="$CFLAGS"
  20. CFLAGS=-Wno-pointer-sign
  21. AC_MSG_CHECKING([whether CC supports -Wno-pointer-sign])
  22. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
  23. [AC_MSG_RESULT([yes])]
  24. [AM_CFLAGS=-Wno-pointer-sign],
  25. [AC_MSG_RESULT([no])]
  26. )
  27. CFLAGS="$save_cflags $AM_CFLAGS"
  28. ])