11cb0ef41Sopenharmony_ci# =========================================================================== 21cb0ef41Sopenharmony_ci# http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html 31cb0ef41Sopenharmony_ci# =========================================================================== 41cb0ef41Sopenharmony_ci# 51cb0ef41Sopenharmony_ci# SYNOPSIS 61cb0ef41Sopenharmony_ci# 71cb0ef41Sopenharmony_ci# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS]) 81cb0ef41Sopenharmony_ci# 91cb0ef41Sopenharmony_ci# DESCRIPTION 101cb0ef41Sopenharmony_ci# 111cb0ef41Sopenharmony_ci# For every FLAG1, FLAG2 it is checked whether the compiler 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 current language's flags (e.g. 151cb0ef41Sopenharmony_ci# CFLAGS) is used. During the check the flag is always added to the 161cb0ef41Sopenharmony_ci# current language's flags. 171cb0ef41Sopenharmony_ci# 181cb0ef41Sopenharmony_ci# If EXTRA-FLAGS is defined, it is added to the current language's default 191cb0ef41Sopenharmony_ci# flags (e.g. CFLAGS) when the check is done. The check is thus made with 201cb0ef41Sopenharmony_ci# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to 211cb0ef41Sopenharmony_ci# force the compiler to issue an error when a bad flag is given. 221cb0ef41Sopenharmony_ci# 231cb0ef41Sopenharmony_ci# NOTE: This macro depends on the AX_APPEND_FLAG and 241cb0ef41Sopenharmony_ci# AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with 251cb0ef41Sopenharmony_ci# AX_APPEND_LINK_FLAGS. 261cb0ef41Sopenharmony_ci# 271cb0ef41Sopenharmony_ci# LICENSE 281cb0ef41Sopenharmony_ci# 291cb0ef41Sopenharmony_ci# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> 301cb0ef41Sopenharmony_ci# 311cb0ef41Sopenharmony_ci# This program is free software: you can redistribute it and/or modify it 321cb0ef41Sopenharmony_ci# under the terms of the GNU General Public License as published by the 331cb0ef41Sopenharmony_ci# Free Software Foundation, either version 3 of the License, or (at your 341cb0ef41Sopenharmony_ci# option) any later version. 351cb0ef41Sopenharmony_ci# 361cb0ef41Sopenharmony_ci# This program is distributed in the hope that it will be useful, but 371cb0ef41Sopenharmony_ci# WITHOUT ANY WARRANTY; without even the implied warranty of 381cb0ef41Sopenharmony_ci# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 391cb0ef41Sopenharmony_ci# Public License for more details. 401cb0ef41Sopenharmony_ci# 411cb0ef41Sopenharmony_ci# You should have received a copy of the GNU General Public License along 421cb0ef41Sopenharmony_ci# with this program. If not, see <http://www.gnu.org/licenses/>. 431cb0ef41Sopenharmony_ci# 441cb0ef41Sopenharmony_ci# As a special exception, the respective Autoconf Macro's copyright owner 451cb0ef41Sopenharmony_ci# gives unlimited permission to copy, distribute and modify the configure 461cb0ef41Sopenharmony_ci# scripts that are the output of Autoconf when processing the Macro. You 471cb0ef41Sopenharmony_ci# need not follow the terms of the GNU General Public License when using 481cb0ef41Sopenharmony_ci# or distributing such scripts, even though portions of the text of the 491cb0ef41Sopenharmony_ci# Macro appear in them. The GNU General Public License (GPL) does govern 501cb0ef41Sopenharmony_ci# all other use of the material that constitutes the Autoconf Macro. 511cb0ef41Sopenharmony_ci# 521cb0ef41Sopenharmony_ci# This special exception to the GPL applies to versions of the Autoconf 531cb0ef41Sopenharmony_ci# Macro released by the Autoconf Archive. When you make and distribute a 541cb0ef41Sopenharmony_ci# modified version of the Autoconf Macro, you may extend this special 551cb0ef41Sopenharmony_ci# exception to the GPL to apply to your modified version as well. 561cb0ef41Sopenharmony_ci 571cb0ef41Sopenharmony_ci#serial 3 581cb0ef41Sopenharmony_ci 591cb0ef41Sopenharmony_ciAC_DEFUN([AX_APPEND_COMPILE_FLAGS], 601cb0ef41Sopenharmony_ci[AC_REQUIRE([AX_CHECK_COMPILE_FLAG]) 611cb0ef41Sopenharmony_ciAC_REQUIRE([AX_APPEND_FLAG]) 621cb0ef41Sopenharmony_cifor flag in $1; do 631cb0ef41Sopenharmony_ci AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3]) 641cb0ef41Sopenharmony_cidone 651cb0ef41Sopenharmony_ci])dnl AX_APPEND_COMPILE_FLAGS 66