qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure: Check if struct fsxattr is available from linux header
@ 2016-04-29 13:07 Jan Vesely
  2016-04-29 13:54 ` Peter Maydell
  2016-04-29 13:54 ` Stefan Weil
  0 siblings, 2 replies; 11+ messages in thread
From: Jan Vesely @ 2016-04-29 13:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Markus Armbruster, Peter Maydell, Stefan Weil

Fixes build failure with --enable-xfsctl and
new linux headers (>=4.5) and older xfsprogs(<4.5):
In file included from /usr/include/xfs/xfs.h:38:0,
                 from /var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/block/raw-posix.c:97:
/usr/include/xfs/xfs_fs.h:42:8: error: redefinition of ‘struct fsxattr’
 struct fsxattr {
        ^
In file included from /var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/block/raw-posix.c:60:0:
/usr/include/linux/fs.h:155:8: note: originally defined here
 struct fsxattr {

CC: qemu-trivial@nongnu.org
CC: Markus Armbruster <armbru@redhat.com>
CC: Peter Maydell <peter.maydell@linaro.org>
CC: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
---
One can argue that the failure only happens for invalid linux-headers,
xfsprogs combinations, feel free to reject the patch in that case.

This patch relies on functionality introduced in
559607ea173 io: add QIOChannelSocket class

 configure | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/configure b/configure
index b88d0db..bb64d6c 100755
--- a/configure
+++ b/configure
@@ -4474,6 +4474,21 @@ if test "$fortify_source" != "no"; then
   fi
 fi
 
+########################################
+# check if struct fsxattr is available
+
+have_fsxattr=no
+cat > $TMPC << EOF
+#include <linux/fs.h>
+struct fsxattr foo;
+int main(void) {
+  return 0;
+}
+EOF
+if compile_prog "" "" ; then
+    have_fsxattr=yes
+fi
+
 ##########################################
 # End of CC checks
 # After here, no more $cc or $ld runs
@@ -5137,6 +5152,9 @@ fi
 if test "$have_ifaddrs_h" = "yes" ; then
     echo "HAVE_IFADDRS_H=y" >> $config_host_mak
 fi
+if test "$have_fsxattr" = "yes" ; then
+    echo "HAVE_FSXATTR=y" >> $config_host_mak
+fi
 if test "$vte" = "yes" ; then
   echo "CONFIG_VTE=y" >> $config_host_mak
   echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-04-29 17:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1458436706-20743-1-git-send-email-jano.vesely@gmail.com>
2016-04-12 21:09 ` [Qemu-devel] [PATCH] configure: Check if struct fsxattr is available from linux header Jan Vesely
2016-04-29  0:54   ` Jan Vesely
2016-04-29  7:52     ` Markus Armbruster
2016-04-29 13:07 Jan Vesely
2016-04-29 13:54 ` Peter Maydell
2016-04-29 13:56   ` Stefan Weil
2016-04-29 14:00     ` Peter Maydell
2016-04-29 14:31       ` Stefan Weil
2016-04-29 14:49         ` Peter Maydell
2016-04-29 17:14           ` Jan Vesely
2016-04-29 13:54 ` Stefan Weil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).