libmicrohttpd2

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

mhd_check_add_cc_ldflags.m4 (1442B)


      1 # SPDX-License-Identifier: FSFAP
      2 #
      3 # SYNOPSIS
      4 #
      5 #   MHD_CHECK_ADD_CC_LDFLAGS([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 (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. 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_LDFLAGS([-W,--strip-all -Wl,--fatal-warnings],
     23 #                              [additional_LDFLAGS])
     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_LDFLAGS],[dnl
     38 m4_foreach_w([test_flag],[$1],
     39 [MHD_CHECK_ADD_CC_LDFLAG([test_flag],[$2])
     40 ])dnl
     41 ])