11cb0ef41Sopenharmony_ci# ===========================================================================
21cb0ef41Sopenharmony_ci#   https://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html
31cb0ef41Sopenharmony_ci# ===========================================================================
41cb0ef41Sopenharmony_ci#
51cb0ef41Sopenharmony_ci# SYNOPSIS
61cb0ef41Sopenharmony_ci#
71cb0ef41Sopenharmony_ci#   AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
81cb0ef41Sopenharmony_ci#
91cb0ef41Sopenharmony_ci# DESCRIPTION
101cb0ef41Sopenharmony_ci#
111cb0ef41Sopenharmony_ci#   For every FLAG1, FLAG2 it is checked whether the linker works with the
121cb0ef41Sopenharmony_ci#   flag.  If it does, the flag is added FLAGS-VARIABLE
131cb0ef41Sopenharmony_ci#
141cb0ef41Sopenharmony_ci#   If FLAGS-VARIABLE is not specified, the linker's flags (LDFLAGS) is
151cb0ef41Sopenharmony_ci#   used. During the check the flag is always added to the linker's flags.
161cb0ef41Sopenharmony_ci#
171cb0ef41Sopenharmony_ci#   If EXTRA-FLAGS is defined, it is added to the linker's default flags
181cb0ef41Sopenharmony_ci#   when the check is done.  The check is thus made with the flags: "LDFLAGS
191cb0ef41Sopenharmony_ci#   EXTRA-FLAGS FLAG".  This can for example be used to force the linker to
201cb0ef41Sopenharmony_ci#   issue an error when a bad flag is given.
211cb0ef41Sopenharmony_ci#
221cb0ef41Sopenharmony_ci#   INPUT gives an alternative input source to AC_COMPILE_IFELSE.
231cb0ef41Sopenharmony_ci#
241cb0ef41Sopenharmony_ci#   NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG.
251cb0ef41Sopenharmony_ci#   Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS.
261cb0ef41Sopenharmony_ci#
271cb0ef41Sopenharmony_ci# LICENSE
281cb0ef41Sopenharmony_ci#
291cb0ef41Sopenharmony_ci#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
301cb0ef41Sopenharmony_ci#
311cb0ef41Sopenharmony_ci#   Copying and distribution of this file, with or without modification, are
321cb0ef41Sopenharmony_ci#   permitted in any medium without royalty provided the copyright notice
331cb0ef41Sopenharmony_ci#   and this notice are preserved.  This file is offered as-is, without any
341cb0ef41Sopenharmony_ci#   warranty.
351cb0ef41Sopenharmony_ci
361cb0ef41Sopenharmony_ci#serial 7
371cb0ef41Sopenharmony_ci
381cb0ef41Sopenharmony_ciAC_DEFUN([AX_APPEND_LINK_FLAGS],
391cb0ef41Sopenharmony_ci[AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
401cb0ef41Sopenharmony_ciAX_REQUIRE_DEFINED([AX_APPEND_FLAG])
411cb0ef41Sopenharmony_cifor flag in $1; do
421cb0ef41Sopenharmony_ci  AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3], [$4])
431cb0ef41Sopenharmony_cidone
441cb0ef41Sopenharmony_ci])dnl AX_APPEND_LINK_FLAGS
45