summaryrefslogtreecommitdiff
path: root/m4/cflags.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/cflags.m4')
-rw-r--r--m4/cflags.m414
1 files changed, 14 insertions, 0 deletions
diff --git a/m4/cflags.m4 b/m4/cflags.m4
new file mode 100644
index 0000000..87d5143
--- /dev/null
+++ b/m4/cflags.m4
@@ -0,0 +1,14 @@
+dnl AC_TRY_CFLAGS (CFLAGS, [ACTION-IF-WORKS], [ACTION-IF-FAILS])
+dnl check if $CC supports a given set of cflags
+AC_DEFUN([AC_TRY_CFLAGS],
+ [AC_MSG_CHECKING([if $CC supports $1 flags])
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$1"
+ AC_TRY_COMPILE([],[],[ac_cv_try_cflags_ok=yes],[ac_cv_try_cflags_ok=no])
+ CFLAGS="$SAVE_CFLAGS"
+ AC_MSG_RESULT([$ac_cv_try_cflags_ok])
+ if test x"$ac_cv_try_cflags_ok" = x"yes"; then
+ ifelse([$2],[],[:],[$2])
+ else
+ ifelse([$3],[],[:],[$3])
+ fi])