Blame autoconf-archive/m4/ax_append_compile_flags.m4

Packit Service 630f6f
# ===========================================================================
Packit Service 630f6f
#  http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html
Packit Service 630f6f
# ===========================================================================
Packit Service 630f6f
#
Packit Service 630f6f
# SYNOPSIS
Packit Service 630f6f
#
Packit Service 630f6f
#   AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS])
Packit Service 630f6f
#
Packit Service 630f6f
# DESCRIPTION
Packit Service 630f6f
#
Packit Service 630f6f
#   For every FLAG1, FLAG2 it is checked whether the compiler works with the
Packit Service 630f6f
#   flag.  If it does, the flag is added FLAGS-VARIABLE
Packit Service 630f6f
#
Packit Service 630f6f
#   If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
Packit Service 630f6f
#   CFLAGS) is used.  During the check the flag is always added to the
Packit Service 630f6f
#   current language's flags.
Packit Service 630f6f
#
Packit Service 630f6f
#   If EXTRA-FLAGS is defined, it is added to the current language's default
Packit Service 630f6f
#   flags (e.g. CFLAGS) when the check is done.  The check is thus made with
Packit Service 630f6f
#   the flags: "CFLAGS EXTRA-FLAGS FLAG".  This can for example be used to
Packit Service 630f6f
#   force the compiler to issue an error when a bad flag is given.
Packit Service 630f6f
#
Packit Service 630f6f
#   NOTE: This macro depends on the AX_APPEND_FLAG and
Packit Service 630f6f
#   AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with
Packit Service 630f6f
#   AX_APPEND_LINK_FLAGS.
Packit Service 630f6f
#
Packit Service 630f6f
# LICENSE
Packit Service 630f6f
#
Packit Service 630f6f
#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
Packit Service 630f6f
#
Packit Service 630f6f
#   This program is free software: you can redistribute it and/or modify it
Packit Service 630f6f
#   under the terms of the GNU General Public License as published by the
Packit Service 630f6f
#   Free Software Foundation, either version 3 of the License, or (at your
Packit Service 630f6f
#   option) any later version.
Packit Service 630f6f
#
Packit Service 630f6f
#   This program is distributed in the hope that it will be useful, but
Packit Service 630f6f
#   WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 630f6f
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Packit Service 630f6f
#   Public License for more details.
Packit Service 630f6f
#
Packit Service 630f6f
#   You should have received a copy of the GNU General Public License along
Packit Service 630f6f
#   with this program. If not, see <http://www.gnu.org/licenses/>.
Packit Service 630f6f
#
Packit Service 630f6f
#   As a special exception, the respective Autoconf Macro's copyright owner
Packit Service 630f6f
#   gives unlimited permission to copy, distribute and modify the configure
Packit Service 630f6f
#   scripts that are the output of Autoconf when processing the Macro. You
Packit Service 630f6f
#   need not follow the terms of the GNU General Public License when using
Packit Service 630f6f
#   or distributing such scripts, even though portions of the text of the
Packit Service 630f6f
#   Macro appear in them. The GNU General Public License (GPL) does govern
Packit Service 630f6f
#   all other use of the material that constitutes the Autoconf Macro.
Packit Service 630f6f
#
Packit Service 630f6f
#   This special exception to the GPL applies to versions of the Autoconf
Packit Service 630f6f
#   Macro released by the Autoconf Archive. When you make and distribute a
Packit Service 630f6f
#   modified version of the Autoconf Macro, you may extend this special
Packit Service 630f6f
#   exception to the GPL to apply to your modified version as well.
Packit Service 630f6f
Packit Service 630f6f
#serial 4
Packit Service 630f6f
Packit Service 630f6f
AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
Packit Service 630f6f
[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
Packit Service 630f6f
AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
Packit Service 630f6f
for flag in $1; do
Packit Service 630f6f
  AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3])
Packit Service 630f6f
done
Packit Service 630f6f
])dnl AX_APPEND_COMPILE_FLAGS