Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/m4/acinclude.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/acinclude.m4')
-rw-r--r--m4/acinclude.m420
1 files changed, 20 insertions, 0 deletions
diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
index df4f83a4..8ea45973 100644
--- a/m4/acinclude.m4
+++ b/m4/acinclude.m4
@@ -101,6 +101,26 @@ AC_DEFUN([GCC_GNU89_INLINE_CC],[
fi
])
+dnl CFLAGS_ADD(PARAMETER, VARIABLE)
+dnl Adds parameter to VARIABLE if the compiler supports it. For example,
+dnl CFLAGS_ADD([-Wall],[WARN_FLAGS]).
+AC_DEFUN([CFLAGS_ADD],
+[AS_VAR_PUSHDEF([my_cflags], [cflags_cv_warn_$1])dnl
+AC_CACHE_CHECK([whether compiler handles $1], [my_cflags], [
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="${CFLAGS} $1"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
+ [AS_VAR_SET([my_cflags], [yes])],
+ [AS_VAR_SET([my_cflags], [no])])
+ CFLAGS="$save_CFLAGS"
+])
+AS_VAR_PUSHDEF([new_cflags], [[$2]])dnl
+AS_VAR_IF([my_cflags], [yes], [AS_VAR_APPEND([new_cflags], [" $1"])])
+AS_VAR_POPDEF([new_cflags])dnl
+AS_VAR_POPDEF([my_cflags])dnl
+m4_ifval([$2], [AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])])dnl
+])
+
dnl Checks for getmntinfo and determines whether it uses statfs or statvfs
AC_DEFUN([FS_STATS_TYPE],
[AC_CACHE_CHECK([filesystem statistics type], fs_stats_cv_type,