aboutsummaryrefslogtreecommitdiff
path: root/m4/mhd_check_cc_ldflag.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/mhd_check_cc_ldflag.m4')
-rw-r--r--m4/mhd_check_cc_ldflag.m443
1 files changed, 43 insertions, 0 deletions
diff --git a/m4/mhd_check_cc_ldflag.m4 b/m4/mhd_check_cc_ldflag.m4
new file mode 100644
index 00000000..e5f57953
--- /dev/null
+++ b/m4/mhd_check_cc_ldflag.m4
@@ -0,0 +1,43 @@
1# SYNOPSIS
2#
3# MHD_CHECK_CC_LDFLAG([FLAG-TO-TEST], [VARIABLE-TO-PREPEND-LDFLAGS],
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 prepending FLAG-TO-TEST to LDFLAGS, then
10# prepending value of VARIABLE-TO-PREPEND-LDFLAGS (if any) to LDFLAGS, and
11# then performing compile and link test. If test succeed without warnings,
12# then the flag is considered to be suppoted. Otherwise, if compile and link
13# without test flag can be done without any warning, the flag is considered
14# to be unsuppoted.
15#
16# Example usage:
17#
18# MHD_CHECK_CC_LDFLAG([-pie], [additional_LDFLAGS],
19# [additional_LDFLAGS="${additional_LDFLAGS} -pie"])
20#
21# Defined cache variable used in check so if any test will not work
22# correctly on some platform, user may simply fix it by giving cache
23# variable in configure parameters, for example:
24#
25# ./configure mhd_cv_cc_fl_supp__wshadow=no
26#
27# This simplify building from source on exotic platforms as patching
28# of configure.ac is not required to change results of tests.
29#
30# LICENSE
31#
32# Copyright (c) 2022 Karlson2k (Evgeny Grin) <k2k@narod.ru>
33#
34# Copying and distribution of this file, with or without modification, are
35# permitted in any medium without royalty provided the copyright notice
36# and this notice are preserved. This file is offered as-is, without any
37# warranty.
38
39#serial 1
40
41AC_DEFUN([MHD_CHECK_CC_LDFLAG],[dnl
42_MHD_CHECK_CC_XFLAG([$1],[$2],[$3],[$4],[[LDFLAGS]])dnl
43])