From a2583761573b98127ae9396785875a88a4a4b8ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 24 May 2008 02:01:21 +0200 Subject: Backport CC_CHECK_LDFLAGS macro from 1.2 branch. --- m4/attributes.m4 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/m4/attributes.m4 b/m4/attributes.m4 index 49f71bddc..3fee49ab5 100644 --- a/m4/attributes.m4 +++ b/m4/attributes.m4 @@ -56,6 +56,21 @@ AC_DEFUN([CC_CHECK_CFLAGS], [ [$2], [$3]) ]) +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([int main() { return 1; }], + [eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"], + [eval "AS_TR_SH([cc_cv_ldflags_$1])="]) + LDFLAGS="$ac_save_LDFLAGS" + ]) + + AS_IF([test x$]AS_TR_SH([cc_cv_ldflags_$1])[ = xyes], + [$2], [$3]) +]) + dnl Check for a -Werror flag or equivalent. -Werror is the GCC dnl and ICC flag that tells the compiler to treat all the warnings dnl as fatal. We usually need this option to make sure that some -- cgit v1.2.3