Collection of DPF-based plugins for packaging
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.

61 lines
1.9KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_compiler_flags_gir.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_COMPILER_FLAGS_GIR([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Add warning flags for the g-ir-scanner (from GObject Introspection) to
  12. # VARIABLE, which defaults to WARN_SCANNERFLAGS. VARIABLE is AC_SUBST-ed
  13. # by this macro, but must be manually added to the SCANNERFLAGS variable
  14. # for each GIR target in the code base.
  15. #
  16. # This macro depends on the environment set up by AX_COMPILER_FLAGS.
  17. # Specifically, it uses the value of $ax_enable_compile_warnings to decide
  18. # which flags to enable.
  19. #
  20. # LICENSE
  21. #
  22. # Copyright (c) 2015 Philip Withnall <philip@tecnocode.co.uk>
  23. #
  24. # Copying and distribution of this file, with or without modification, are
  25. # permitted in any medium without royalty provided the copyright notice
  26. # and this notice are preserved. This file is offered as-is, without any
  27. # warranty.
  28. #serial 6
  29. AC_DEFUN([AX_COMPILER_FLAGS_GIR],[
  30. AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
  31. # Variable names
  32. m4_define([ax_warn_scannerflags_variable],
  33. [m4_normalize(ifelse([$1],,[WARN_SCANNERFLAGS],[$1]))])
  34. # Base flags
  35. AX_APPEND_FLAG([$3],ax_warn_scannerflags_variable)
  36. AS_IF([test "$ax_enable_compile_warnings" != "no"],[
  37. # "yes" flags
  38. AX_APPEND_FLAG([ dnl
  39. --warn-all dnl
  40. $4 dnl
  41. $5 dnl
  42. $6 dnl
  43. $7 dnl
  44. ],ax_warn_scannerflags_variable)
  45. ])
  46. AS_IF([test "$ax_enable_compile_warnings" = "error"],[
  47. # "error" flags
  48. AX_APPEND_FLAG([ dnl
  49. --warn-error dnl
  50. ],ax_warn_scannerflags_variable)
  51. ])
  52. # Substitute the variables
  53. AC_SUBST(ax_warn_scannerflags_variable)
  54. ])dnl AX_COMPILER_FLAGS