From 6716d0dfb9c50b388817118469d1e2b7dc7ae46a Mon Sep 17 00:00:00 2001 From: OBATA Akio Date: Fri, 25 Jan 2019 16:01:05 +0900 Subject: [PATCH] Convert GETMNTINFO_USES_STATVFS check to CMake Fix to build on such platforms, it is used but not checked with CMake. --- CMakeLists.txt | 11 +++++++++++ config.h.cmake | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3291a7090..adf408e91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -352,6 +352,17 @@ if( ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" ) endif( ) check_function_exists( getmntinfo HAVE_GETMNTINFO ) +if( HAVE_GETMNTINFO ) + check_cxx_source_compiles(" + #include + #include + int main(){ + struct statvfs *mntbufp; + int flags; + return getmntinfo(&mntbufp, flags); + }" + GETMNTINFO_USES_STATVFS ) +endif( HAVE_GETMNTINFO ) check_function_exists( getnameinfo HAVE_GETNAMEINFO ) check_function_exists( getpagesize HAVE_GETPAGESIZE ) check_function_exists( getpeereid HAVE_GETPEEREID ) diff --git a/config.h.cmake b/config.h.cmake index 900f32bfc..668ecdbcb 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -24,7 +24,7 @@ #undef GETADDRINFO_RETURNS_UNIX /* getmntinfo() uses struct statvfs */ -#undef GETMNTINFO_USES_STATVFS +#cmakedefine GETMNTINFO_USES_STATVFS /* Define if you have the MIT Kerberos libraries */ #undef GSSAPI_MIT