mhd_find_add_cc_ldflag.m4 1.4 KB

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