libmicrohttpd2

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

mhd_find_add_cc_ldflag_ifelse.m4 (1893B)


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