Blame m4/ax_compiler_flags_gir.m4

Packit 130fc8
# ===========================================================================
Packit 130fc8
#   http://www.gnu.org/software/autoconf-archive/ax_compiler_flags_gir.html
Packit 130fc8
# ===========================================================================
Packit 130fc8
#
Packit 130fc8
# SYNOPSIS
Packit 130fc8
#
Packit 130fc8
#   AX_COMPILER_FLAGS_GIR([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS])
Packit 130fc8
#
Packit 130fc8
# DESCRIPTION
Packit 130fc8
#
Packit 130fc8
#   Add warning flags for the g-ir-scanner (from GObject Introspection) to
Packit 130fc8
#   VARIABLE, which defaults to WARN_SCANNERFLAGS.  VARIABLE is AC_SUBST-ed
Packit 130fc8
#   by this macro, but must be manually added to the SCANNERFLAGS variable
Packit 130fc8
#   for each GIR target in the code base.
Packit 130fc8
#
Packit 130fc8
#   This macro depends on the environment set up by AX_COMPILER_FLAGS.
Packit 130fc8
#   Specifically, it uses the value of $ax_enable_compile_warnings to decide
Packit 130fc8
#   which flags to enable.
Packit 130fc8
#
Packit 130fc8
# LICENSE
Packit 130fc8
#
Packit 130fc8
#   Copyright (c) 2015 Philip Withnall <philip@tecnocode.co.uk>
Packit 130fc8
#
Packit 130fc8
#   Copying and distribution of this file, with or without modification, are
Packit 130fc8
#   permitted in any medium without royalty provided the copyright notice
Packit 130fc8
#   and this notice are preserved.  This file is offered as-is, without any
Packit 130fc8
#   warranty.
Packit 130fc8
Packit 130fc8
#serial 4
Packit 130fc8
Packit 130fc8
AC_DEFUN([AX_COMPILER_FLAGS_GIR],[
Packit 130fc8
    AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
Packit 130fc8
Packit 130fc8
    # Variable names
Packit 130fc8
    m4_define(ax_warn_scannerflags_variable,
Packit 130fc8
              [m4_normalize(ifelse([$1],,[WARN_SCANNERFLAGS],[$1]))])
Packit 130fc8
Packit 130fc8
    # Base flags
Packit 130fc8
    AX_APPEND_FLAG([$3],ax_warn_scannerflags_variable)
Packit 130fc8
Packit 130fc8
    AS_IF([test "$ax_enable_compile_warnings" != "no"],[
Packit 130fc8
        # "yes" flags
Packit 130fc8
        AX_APPEND_FLAG([ dnl
Packit 130fc8
            --warn-all dnl
Packit 130fc8
            $4 dnl
Packit 130fc8
            $5 dnl
Packit 130fc8
            $6 dnl
Packit 130fc8
            $7 dnl
Packit 130fc8
        ],ax_warn_scannerflags_variable)
Packit 130fc8
    ])
Packit 130fc8
    AS_IF([test "$ax_enable_compile_warnings" = "error"],[
Packit 130fc8
        # "error" flags
Packit 130fc8
        AX_APPEND_FLAG([ dnl
Packit 130fc8
            --warn-error dnl
Packit 130fc8
        ],ax_warn_scannerflags_variable)
Packit 130fc8
    ])
Packit 130fc8
Packit 130fc8
    # Substitute the variables
Packit 130fc8
    AC_SUBST(ax_warn_scannerflags_variable)
Packit 130fc8
])dnl AX_COMPILER_FLAGS