Blame m4/ax_append_link_flags.m4

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