mhd_check_add_cc_cflags.m4 (1431B)
1 # SPDX-License-Identifier: FSFAP 2 # 3 # SYNOPSIS 4 # 5 # MHD_CHECK_ADD_CC_CFLAGS([FLAGS-TO-TEST], [VARIABLE-TO-EXTEND]) 6 # 7 # DESCRIPTION 8 # 9 # This macro checks whether the specific compiler flags are supported. 10 # The FLAGS-TO-TEST parameter is whitespace-separated flagto to test. 11 # The flags are tested one-by-one, all supported flags are added to the 12 # VARIABLE-TO-EXTEND. 13 # Every flag check is performing by appending one flag to the value of 14 # VARIABLE-TO-EXTEND (CFLAGS if not specified), then prepending result to 15 # CFLAGS (unless VARIABLE-TO-EXTEND is CFLAGS), and then performing compile 16 # and link test. If test succeed without warnings, then the flag is added to 17 # VARIABLE-TO-EXTEND. Otherwise, if compile and link without test flag cannot 18 # be done without any warning, the flag is considered to be unsuppoted. 19 # 20 # Example usage: 21 # 22 # MHD_CHECK_ADD_CC_CFLAGS([-Wshadow -Walloc-zero -Winit-self], 23 # [additional_CFLAGS]) 24 # 25 # 26 # LICENSE 27 # 28 # Copyright (c) 2022 Karlson2k (Evgeny Grin) <k2k@narod.ru> 29 # 30 # Copying and distribution of this file, with or without modification, are 31 # permitted in any medium without royalty provided the copyright notice 32 # and this notice are preserved. This file is offered as-is, without any 33 # warranty. 34 35 #serial 1 36 37 AC_DEFUN([MHD_CHECK_ADD_CC_CFLAGS],[dnl 38 m4_foreach_w([test_flag],[$1], 39 [MHD_CHECK_ADD_CC_CFLAG([test_flag],[$2]) 40 ])dnl 41 ])