diff options
Diffstat (limited to 'm4/mhd_find_add_cc_ldflag.m4')
-rw-r--r-- | m4/mhd_find_add_cc_ldflag.m4 | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/m4/mhd_find_add_cc_ldflag.m4 b/m4/mhd_find_add_cc_ldflag.m4 new file mode 100644 index 00000000..224a4e29 --- /dev/null +++ b/m4/mhd_find_add_cc_ldflag.m4 | |||
@@ -0,0 +1,39 @@ | |||
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 | |||
36 | #serial 1 | ||
37 | |||
38 | AC_DEFUN([MHD_FIND_ADD_CC_LDFLAG],[dnl | ||
39 | _MHD_FIND_ADD_CC_XFLAG([[LDFLAGS]],$@)]) | ||