PageRenderTime 49ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Tools/config/ac_compile_warnings.m4

#
m4 | 56 lines | 52 code | 4 blank | 0 comment | 0 complexity | aa6afcdc710fe9d1ee2d29f97675dd20 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. dnl @synopsis AC_COMPILE_WARNINGS
  2. dnl
  3. dnl Set the maximum warning verbosity according to C and C++ compiler used.
  4. dnl Currently supports g++ and gcc.
  5. dnl
  6. dnl The compiler options are always added CFLAGS and CXXFLAGS even if
  7. dnl these are overidden at configure time. Removing the maximum warning
  8. dnl flags can be removed with --without-maximum-compile-warnings. For example:
  9. dnl
  10. dnl ./configure --without-maximum-compile-warnings CFLAGS= CXXFLAGS=
  11. dnl
  12. dnl @category Misc
  13. dnl @author Loic Dachary <loic@senga.org>
  14. dnl @author William Fulton <wsf@fultondesigns.co.uk>
  15. dnl @version 2005-04-29
  16. dnl @license GPLWithACException
  17. AC_DEFUN([AC_COMPILE_WARNINGS], [
  18. AC_MSG_CHECKING([maximum warning verbosity option])
  19. AC_REQUIRE([AC_PROG_CC])
  20. AC_REQUIRE([AC_PROG_CXX])
  21. AC_ARG_WITH([maximum-compile-warnings],
  22. AS_HELP_STRING([--without-maximum-compile-warnings],
  23. [Disable maximum warning verbosity]),
  24. [ac_compile_warnings_on="$withval"],
  25. [ac_compile_warnings_on=""])
  26. if test x"$ac_compile_warnings_on" = xno
  27. then
  28. ac_compile_warnings_msg=no
  29. else
  30. if test -n "$CXX"
  31. then
  32. if test "$GXX" = "yes"
  33. then
  34. ac_compile_warnings_opt='-Wall -W -ansi -pedantic'
  35. fi
  36. CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt"
  37. ac_compile_warnings_msg="$ac_compile_warnings_opt for C++"
  38. fi
  39. if test -n "$CC"
  40. then
  41. if test "$GCC" = "yes"
  42. then
  43. ac_compile_warnings_opt='-Wall -W -ansi -pedantic'
  44. fi
  45. CFLAGS="$CFLAGS $ac_compile_warnings_opt"
  46. ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C"
  47. fi
  48. fi
  49. AC_MSG_RESULT([$ac_compile_warnings_msg])
  50. unset ac_compile_warnings_msg
  51. unset ac_compile_warnings_opt
  52. ])