libmicrohttpd2

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

mhd_check_add_cc_ldflag.m4 (1259B)


      1 # SPDX-License-Identifier: FSFAP
      2 #
      3 # SYNOPSIS
      4 #
      5 #   MHD_CHECK_ADD_CC_LDFLAG([FLAG-TO-TEST], [VARIABLE-TO-EXTEND],
      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 appending FLAG-TO-TEST to the value of
     12 #   VARIABLE-TO-EXTEND (LDFLAGS if not specified), then prepending result to
     13 #   LDFLAGS (unless VARIABLE-TO-EXTEND is LDFLAGS), and then performing compile
     14 #   and link test. If test succeed without warnings, then the flag is added to
     15 #   VARIABLE-TO-EXTEND. Otherwise, if compile and link without test flag cannot
     16 #   be done without any warning, the flag is considered to be unsuppoted.
     17 #
     18 #   Example usage:
     19 #
     20 #     MHD_CHECK_ADD_CC_LDFLAG([-pie], [additional_LDFLAGS])
     21 #
     22 #
     23 # LICENSE
     24 #
     25 #   Copyright (c) 2022 Karlson2k (Evgeny Grin) <k2k@narod.ru>
     26 #
     27 #   Copying and distribution of this file, with or without modification, are
     28 #   permitted in any medium without royalty provided the copyright notice
     29 #   and this notice are preserved. This file is offered as-is, without any
     30 #   warranty.
     31 
     32 #serial 1
     33 
     34 AC_DEFUN([MHD_CHECK_ADD_CC_LDFLAG],[dnl
     35 _MHD_CHECK_ADD_CC_XFLAG([$1],[$2],[$3],[$4],[[LDFLAGS]])dnl
     36 ])