summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOBATA Akio <obache@wizdas.com>2019-01-25 16:01:05 +0900
committerSlávek Banko <slavek.banko@axis.cz>2019-01-25 14:23:15 +0100
commit6f0a158d33fb412c1cfd2aad6db1d323f86b0826 (patch)
treecb10ba446009d1494309046fe65ccdadf269b15d
parent50aef34ec6ec149215c1b09dce22e6c92ca75137 (diff)
downloadtdelibs-6f0a158d33fb412c1cfd2aad6db1d323f86b0826.tar.gz
tdelibs-6f0a158d33fb412c1cfd2aad6db1d323f86b0826.zip
Convert GETMNTINFO_USES_STATVFS check to CMake
Fix to build on such platforms, it is used but not checked with CMake. (cherry picked from commit 6716d0dfb9c50b388817118469d1e2b7dc7ae46a)
-rw-r--r--CMakeLists.txt11
-rw-r--r--config.h.cmake2
2 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b10250ad7..54726f505 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -335,6 +335,17 @@ if( ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" )
endif( )
check_function_exists( getmntinfo HAVE_GETMNTINFO )
+if( HAVE_GETMNTINFO )
+ check_cxx_source_compiles("
+ #include <sys/types.h>
+ #include <sys/statvfs.h>
+ 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 56e28ba6a..b2e5b7258 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