diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 06:53:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 06:53:20 +0000 |
commit | e5a812082ae033afb1eed82c0f2df3d0f6bdc93f (patch) | |
tree | a6716c9275b4b413f6c9194798b34b91affb3cc7 /m4/CC_CHECK_LDFLAGS.m4 | |
parent | Initial commit. (diff) | |
download | pacemaker-e5a812082ae033afb1eed82c0f2df3d0f6bdc93f.tar.xz pacemaker-e5a812082ae033afb1eed82c0f2df3d0f6bdc93f.zip |
Adding upstream version 2.1.6.upstream/2.1.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/CC_CHECK_LDFLAGS.m4')
-rw-r--r-- | m4/CC_CHECK_LDFLAGS.m4 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/m4/CC_CHECK_LDFLAGS.m4 b/m4/CC_CHECK_LDFLAGS.m4 new file mode 100644 index 0000000..be20df3 --- /dev/null +++ b/m4/CC_CHECK_LDFLAGS.m4 @@ -0,0 +1,21 @@ +dnl Check if the flag is supported by linker (cacheable) +dnl CC_CHECK_LDFLAGS([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) +dnl +dnl Origin (declared license: GPLv2+ with less restrictive exception): +dnl https://git.gnome.org/browse/glib/tree/m4macros/attributes.m4?h=2.49.1 +dnl (AC_LANG_PROGRAM substituted by Jan Pokorny <jpokorny@redhat.com>) + +AC_DEFUN([CC_CHECK_LDFLAGS], [ + AC_CACHE_CHECK([if $CC supports $1 flag], + AS_TR_SH([cc_cv_ldflags_$1]), + [ac_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $1" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"], + [eval "AS_TR_SH([cc_cv_ldflags_$1])="]) + LDFLAGS="$ac_save_LDFLAGS" + ]) + + AS_IF([eval test x$]AS_TR_SH([cc_cv_ldflags_$1])[ = xyes], + [$2], [$3]) +]) |