libmicrohttpd2

HTTP server C library (MHD 2.x, alpha)
Log | Files | Refs | README | LICENSE

mhd_find_add_cc_ldflag.m4 (1510B)


      1 # SPDX-License-Identifier: FSFAP
      2 #
      3 # SYNOPSIS
      4 #
      5 #   MHD_FIND_ADD_CC_LDFLAG([VARIABLE-TO-EXTEND],
      6 #                         [FLAG1-TO-TEST], [FLAG2-TO-TEST], ...)
      7 #
      8 # DESCRIPTION
      9 #
     10 #   This macro checks whether the specific compiler flags are supported.
     11 #   The flags are checked one-by-one. The checking is stopped when the first
     12 #   supported flag found.
     13 #   The checks are performing by appending FLAGx-TO-TEST to the value of
     14 #   VARIABLE-TO-EXTEND (LDFLAGS if not specified), then prepending result to
     15 #   LDFLAGS (unless VARIABLE-TO-EXTEND is LDFLAGS), and then performing compile
     16 #   and link test. If test succeed without warnings, then the flag is added to
     17 #   VARIABLE-TO-EXTEND and next flags are not checked. If compile-link cycle
     18 #   cannot be performed without warning with all tested flags, no flag is
     19 #   added to the VARIABLE-TO-EXTEND.
     20 #
     21 #   Example usage:
     22 #
     23 #     MHD_CHECK_CC_LDFLAG([additional_LDFLAGS],
     24 #                         [-Wl,--strip-all], [-Wl,--strip-debug])
     25 #
     26 #   Note: Unlike others MHD_CHECK_*CC_LDFLAG* macro, this macro uses another
     27 #   order of parameters.
     28 #
     29 # LICENSE
     30 #
     31 #   Copyright (c) 2022 Karlson2k (Evgeny Grin) <k2k@narod.ru>
     32 #
     33 #   Copying and distribution of this file, with or without modification, are
     34 #   permitted in any medium without royalty provided the copyright notice
     35 #   and this notice are preserved. This file is offered as-is, without any
     36 #   warranty.
     37 
     38 #serial 2
     39 
     40 AC_DEFUN([MHD_FIND_ADD_CC_LDFLAG],[dnl
     41 _MHD_FIND_ADD_CC_XFLAG([[LDFLAGS]],[],[],$@)])