summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-05-24 02:01:21 +0200
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-05-24 02:01:21 +0200
commita2583761573b98127ae9396785875a88a4a4b8ad (patch)
tree660e8bce46b571c49118d333b09d33f6c33bf7ce
parentfc24f6446e014c087e4a84ec2934784f89a6bbb3 (diff)
downloadxine-lib-a2583761573b98127ae9396785875a88a4a4b8ad.tar.gz
xine-lib-a2583761573b98127ae9396785875a88a4a4b8ad.tar.bz2
Backport CC_CHECK_LDFLAGS macro from 1.2 branch.
-rw-r--r--m4/attributes.m415
1 files changed, 15 insertions, 0 deletions
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