aboutsummaryrefslogtreecommitdiff
path: root/m4/mhd_check_add_cc_ldflags.m4
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-04-13 20:53:21 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-04-16 13:37:52 +0300
commit9b1865f6918057e6600ff6b455bb8486a016fce1 (patch)
treeffdd46232704ffcf53e7b240677ef6b5b74036ab /m4/mhd_check_add_cc_ldflags.m4
parentfff6d80c4bfa70a1d3368c9135b67eae2716a4b5 (diff)
downloadlibmicrohttpd-9b1865f6918057e6600ff6b455bb8486a016fce1.tar.gz
libmicrohttpd-9b1865f6918057e6600ff6b455bb8486a016fce1.zip
configure: added --enable-build-type=TYPE
Useful to quickly define settings combination. Individual settings still could be overridden by individual parameters. Added autoconf macros for compiler and linker flags
Diffstat (limited to 'm4/mhd_check_add_cc_ldflags.m4')
-rw-r--r--m4/mhd_check_add_cc_ldflags.m439
1 files changed, 39 insertions, 0 deletions
diff --git a/m4/mhd_check_add_cc_ldflags.m4 b/m4/mhd_check_add_cc_ldflags.m4
new file mode 100644
index 00000000..5b013f29
--- /dev/null
+++ b/m4/mhd_check_add_cc_ldflags.m4
@@ -0,0 +1,39 @@
1# SYNOPSIS
2#
3# MHD_CHECK_ADD_CC_LDFLAGS([FLAGS-TO-TEST], [VARIABLE-TO-EXTEND])
4#
5# DESCRIPTION
6#
7# This macro checks whether the specific compiler flags are supported.
8# The FLAGS-TO-TEST parameter is whitespace-separated flagto to test.
9# The flags are tested one-by-one, all supported flags are added to the
10# VARIABLE-TO-EXTEND.
11# Every flag check is performing by appending one flag 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_LDFLAGS([-W,--strip-all -Wl,--fatal-warnings],
21# [additional_LDFLAGS])
22#
23#
24# LICENSE
25#
26# Copyright (c) 2022 Karlson2k (Evgeny Grin) <k2k@narod.ru>
27#
28# Copying and distribution of this file, with or without modification, are
29# permitted in any medium without royalty provided the copyright notice
30# and this notice are preserved. This file is offered as-is, without any
31# warranty.
32
33#serial 1
34
35AC_DEFUN([MHD_CHECK_ADD_CC_LDFLAGS],[dnl
36m4_foreach_w([test_flag],[$1],
37[MHD_CHECK_ADD_CC_LDFLAG([test_flag],[$2])
38])dnl
39])