Browse Source

Convert GETMNTINFO_USES_STATVFS check to CMake

Fix to build on such platforms, it is used but not checked with CMake.
OBATA Akio 1 month ago
parent
commit
6716d0dfb9
2 changed files with 12 additions and 1 deletions
  1. 11
    0
      CMakeLists.txt
  2. 1
    1
      config.h.cmake

+ 11
- 0
CMakeLists.txt View File

@@ -352,6 +352,17 @@ if( ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" )
352 352
 endif( )
353 353
 
354 354
 check_function_exists( getmntinfo HAVE_GETMNTINFO )
355
+if( HAVE_GETMNTINFO )
356
+  check_cxx_source_compiles("
357
+    #include <sys/types.h>
358
+    #include <sys/statvfs.h>
359
+    int main(){
360
+      struct statvfs *mntbufp;
361
+      int flags;
362
+      return getmntinfo(&mntbufp, flags);
363
+    }"
364
+    GETMNTINFO_USES_STATVFS )
365
+endif( HAVE_GETMNTINFO )
355 366
 check_function_exists( getnameinfo HAVE_GETNAMEINFO )
356 367
 check_function_exists( getpagesize HAVE_GETPAGESIZE )
357 368
 check_function_exists( getpeereid HAVE_GETPEEREID )

+ 1
- 1
config.h.cmake View File

@@ -24,7 +24,7 @@
24 24
 #undef GETADDRINFO_RETURNS_UNIX
25 25
 
26 26
 /* getmntinfo() uses struct statvfs */
27
-#undef GETMNTINFO_USES_STATVFS
27
+#cmakedefine GETMNTINFO_USES_STATVFS
28 28
 
29 29
 /* Define if you have the MIT Kerberos libraries */
30 30
 #undef GSSAPI_MIT

Loading…
Cancel
Save