11cb0ef41Sopenharmony_ci# =========================================================================== 21cb0ef41Sopenharmony_ci# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html 31cb0ef41Sopenharmony_ci# =========================================================================== 41cb0ef41Sopenharmony_ci# 51cb0ef41Sopenharmony_ci# SYNOPSIS 61cb0ef41Sopenharmony_ci# 71cb0ef41Sopenharmony_ci# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) 81cb0ef41Sopenharmony_ci# 91cb0ef41Sopenharmony_ci# DESCRIPTION 101cb0ef41Sopenharmony_ci# 111cb0ef41Sopenharmony_ci# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space 121cb0ef41Sopenharmony_ci# added in between. 131cb0ef41Sopenharmony_ci# 141cb0ef41Sopenharmony_ci# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. 151cb0ef41Sopenharmony_ci# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains 161cb0ef41Sopenharmony_ci# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly 171cb0ef41Sopenharmony_ci# FLAG. 181cb0ef41Sopenharmony_ci# 191cb0ef41Sopenharmony_ci# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. 201cb0ef41Sopenharmony_ci# 211cb0ef41Sopenharmony_ci# LICENSE 221cb0ef41Sopenharmony_ci# 231cb0ef41Sopenharmony_ci# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> 241cb0ef41Sopenharmony_ci# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> 251cb0ef41Sopenharmony_ci# 261cb0ef41Sopenharmony_ci# This program is free software: you can redistribute it and/or modify it 271cb0ef41Sopenharmony_ci# under the terms of the GNU General Public License as published by the 281cb0ef41Sopenharmony_ci# Free Software Foundation, either version 3 of the License, or (at your 291cb0ef41Sopenharmony_ci# option) any later version. 301cb0ef41Sopenharmony_ci# 311cb0ef41Sopenharmony_ci# This program is distributed in the hope that it will be useful, but 321cb0ef41Sopenharmony_ci# WITHOUT ANY WARRANTY; without even the implied warranty of 331cb0ef41Sopenharmony_ci# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 341cb0ef41Sopenharmony_ci# Public License for more details. 351cb0ef41Sopenharmony_ci# 361cb0ef41Sopenharmony_ci# You should have received a copy of the GNU General Public License along 371cb0ef41Sopenharmony_ci# with this program. If not, see <http://www.gnu.org/licenses/>. 381cb0ef41Sopenharmony_ci# 391cb0ef41Sopenharmony_ci# As a special exception, the respective Autoconf Macro's copyright owner 401cb0ef41Sopenharmony_ci# gives unlimited permission to copy, distribute and modify the configure 411cb0ef41Sopenharmony_ci# scripts that are the output of Autoconf when processing the Macro. You 421cb0ef41Sopenharmony_ci# need not follow the terms of the GNU General Public License when using 431cb0ef41Sopenharmony_ci# or distributing such scripts, even though portions of the text of the 441cb0ef41Sopenharmony_ci# Macro appear in them. The GNU General Public License (GPL) does govern 451cb0ef41Sopenharmony_ci# all other use of the material that constitutes the Autoconf Macro. 461cb0ef41Sopenharmony_ci# 471cb0ef41Sopenharmony_ci# This special exception to the GPL applies to versions of the Autoconf 481cb0ef41Sopenharmony_ci# Macro released by the Autoconf Archive. When you make and distribute a 491cb0ef41Sopenharmony_ci# modified version of the Autoconf Macro, you may extend this special 501cb0ef41Sopenharmony_ci# exception to the GPL to apply to your modified version as well. 511cb0ef41Sopenharmony_ci 521cb0ef41Sopenharmony_ci#serial 2 531cb0ef41Sopenharmony_ci 541cb0ef41Sopenharmony_ciAC_DEFUN([AX_APPEND_FLAG], 551cb0ef41Sopenharmony_ci[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX 561cb0ef41Sopenharmony_ciAS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])dnl 571cb0ef41Sopenharmony_ciAS_VAR_SET_IF(FLAGS, 581cb0ef41Sopenharmony_ci [case " AS_VAR_GET(FLAGS) " in 591cb0ef41Sopenharmony_ci *" $1 "*) 601cb0ef41Sopenharmony_ci AC_RUN_LOG([: FLAGS already contains $1]) 611cb0ef41Sopenharmony_ci ;; 621cb0ef41Sopenharmony_ci *) 631cb0ef41Sopenharmony_ci AC_RUN_LOG([: FLAGS="$FLAGS $1"]) 641cb0ef41Sopenharmony_ci AS_VAR_SET(FLAGS, ["AS_VAR_GET(FLAGS) $1"]) 651cb0ef41Sopenharmony_ci ;; 661cb0ef41Sopenharmony_ci esac], 671cb0ef41Sopenharmony_ci [AS_VAR_SET(FLAGS,["$1"])]) 681cb0ef41Sopenharmony_ciAS_VAR_POPDEF([FLAGS])dnl 691cb0ef41Sopenharmony_ci])dnl AX_APPEND_FLAG 70