aboutsummaryrefslogtreecommitdiff
path: root/m4/mhd_check_add_cc_ldflag.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_ldflag.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_ldflag.m4')
-rw-r--r--m4/mhd_check_add_cc_ldflag.m434
1 files changed, 34 insertions, 0 deletions
diff --git a/m4/mhd_check_add_cc_ldflag.m4 b/m4/mhd_check_add_cc_ldflag.m4
new file mode 100644
index 00000000..132d33ab
--- /dev/null
+++ b/m4/mhd_check_add_cc_ldflag.m4
@@ -0,0 +1,34 @@
1# SYNOPSIS
2#
3# MHD_CHECK_ADD_CC_LDFLAG([FLAG-TO-TEST], [VARIABLE-TO-EXTEND],
4# [ACTION-IF-SUPPORTED], [ACTION-IF-NOT-SUPPORTED])
5#
6# DESCRIPTION
7#
8# This macro checks whether the specific compiler flag is supported.
9# The check is performing by appending FLAG-TO-TEST to the value of
10# VARIABLE-TO-EXTEND (LDFLAGS if not specified), then prepending result to
11# LDFLAGS (unless VARIABLE-TO-EXTEND is LDFLAGS), and then performing compile
12# and link test. If test succeed without warnings, then the flag is added to
13# VARIABLE-TO-EXTEND. Otherwise, if compile and link without test flag cannot
14# be done without any warning, the flag is considered to be unsuppoted.
15#
16# Example usage:
17#
18# MHD_CHECK_ADD_CC_LDFLAG([-pie], [additional_LDFLAGS])
19#
20#
21# LICENSE
22#
23# Copyright (c) 2022 Karlson2k (Evgeny Grin) <k2k@narod.ru>
24#
25# Copying and distribution of this file, with or without modification, are
26# permitted in any medium without royalty provided the copyright notice
27# and this notice are preserved. This file is offered as-is, without any
28# warranty.
29
30#serial 1
31
32AC_DEFUN([MHD_CHECK_ADD_CC_LDFLAG],[dnl
33_MHD_CHECK_ADD_CC_XFLAG([$1],[$2],[$3],[$4],[[LDFLAGS]])dnl
34])