build: Rework BSD_STYLE_STATVFS check to match autoconf build
authorAndrew Bartlett <abartlet@samba.org>
Tue, 21 May 2013 14:14:29 +0000 (00:14 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 27 May 2013 01:56:48 +0000 (11:56 +1000)
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
lib/util/wscript_configure

index 3cb2ffcfae3aadcdf3d7731b5e7ba63c0f775917..1270ab3f4183c4c252a33f290ec8138a08183f2f 100644 (file)
@@ -58,18 +58,16 @@ if not found_statfs:
     print("FATAL: Failed to find a statfs method")
     raise
 
-if conf.CONFIG_SET('STAT_STATFS2_BSIZE'):
-    conf.CHECK_CODE("""#ifdef HAVE_SYS_PARAM_H
-                     #include <sys/param.h>
-                     #endif
-                     #ifdef HAVE_SYS_MOUNT_H
-                     #include <sys/mount.h>
-                     #endif
-                     struct statfs fsd; fsd.f_iosize = 0;""",
-                    define='BSD_STYLE_STATVFS',
-                    msg='Checking for *bsd style statfs with statfs.f_iosize',
-                    execute=False,
-                    local_include=False)
+conf.CHECK_CODE("""struct statfs fsd;
+               fsd.f_bsize = 0;
+               fsd.f_iosize = 0;
+               return (statfs (".", &fsd));
+               """,
+                headers='sys/param.h sys/mount.h sys/vfs.h',
+                define='BSD_STYLE_STATVFS',
+                msg='Checking for *bsd style statfs with statfs.f_iosize',
+                execute=True,
+                local_include=False)
 
 conf.CHECK_CODE('struct statvfs buf; buf.f_fsid = 0',
                 define='HAVE_FSID_INT',