Blame autoconf-archive/m4/ax_append_compile_flags.m4

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