Blame m4/ax_append_compile_flags.m4

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