]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - zfs/config/user-no-format-truncation.m4
UBUNTU: SAUCE: (noup) Update spl to 0.6.5.11-1, zfs to 0.6.5.11-1ubuntu1
[mirror_ubuntu-artful-kernel.git] / zfs / config / user-no-format-truncation.m4
diff --git a/zfs/config/user-no-format-truncation.m4 b/zfs/config/user-no-format-truncation.m4
new file mode 100644 (file)
index 0000000..4426907
--- /dev/null
@@ -0,0 +1,22 @@
+dnl #
+dnl # Check if gcc supports -Wno-format-truncation option.
+dnl #
+AC_DEFUN([ZFS_AC_CONFIG_USER_NO_FORMAT_TRUNCATION], [
+       AC_MSG_CHECKING([for -Wno-format-truncation support])
+
+       saved_flags="$CFLAGS"
+       CFLAGS="$CFLAGS -Wno-format-truncation"
+
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
+       [
+               NO_FORMAT_TRUNCATION=-Wno-format-truncation
+               AC_MSG_RESULT([yes])
+       ],
+       [
+               NO_FORMAT_TRUNCATION=
+               AC_MSG_RESULT([no])
+       ])
+
+       CFLAGS="$saved_flags"
+       AC_SUBST([NO_FORMAT_TRUNCATION])
+])