mhd_check_cc_ldflag.m4 (1650B)
1 # SPDX-License-Identifier: FSFAP 2 # 3 # SYNOPSIS 4 # 5 # MHD_CHECK_CC_LDFLAG([FLAG-TO-TEST], [VARIABLE-TO-PREPEND-LDFLAGS], 6 # [ACTION-IF-SUPPORTED], [ACTION-IF-NOT-SUPPORTED]) 7 # 8 # DESCRIPTION 9 # 10 # This macro checks whether the specific compiler flag is supported. 11 # The check is performing by prepending FLAG-TO-TEST to LDFLAGS, then 12 # prepending value of VARIABLE-TO-PREPEND-LDFLAGS (if any) to LDFLAGS, and 13 # then performing compile and link test. If test succeed without warnings, 14 # then the flag is considered to be supported. Otherwise, if compile and link 15 # without test flag can be done without any warning, the flag is considered 16 # to be unsuppoted. 17 # 18 # Example usage: 19 # 20 # MHD_CHECK_CC_LDFLAG([-pie], [additional_LDFLAGS], 21 # [additional_LDFLAGS="${additional_LDFLAGS} -pie"]) 22 # 23 # Defined cache variable used in check so if any test will not work 24 # correctly on some platform, user may simply fix it by giving cache 25 # variable in configure parameters, for example: 26 # 27 # ./configure mhd_cv_cc_fl_supp__wshadow=no 28 # 29 # This simplify building from source on exotic platforms as patching 30 # of configure.ac is not required to change results of tests. 31 # 32 # LICENSE 33 # 34 # Copyright (c) 2022 Karlson2k (Evgeny Grin) <k2k@narod.ru> 35 # 36 # Copying and distribution of this file, with or without modification, are 37 # permitted in any medium without royalty provided the copyright notice 38 # and this notice are preserved. This file is offered as-is, without any 39 # warranty. 40 41 #serial 1 42 43 AC_DEFUN([MHD_CHECK_CC_LDFLAG],[dnl 44 _MHD_CHECK_CC_XFLAG([$1],[$2],[$3],[$4],[[LDFLAGS]])dnl 45 ])