]> git.saurik.com Git - apt.git/commitdiff
CMake/private-download: Fix statfs includes on FreeBSD
authorJulian Andres Klode <jak@debian.org>
Tue, 23 Aug 2016 12:40:46 +0000 (14:40 +0200)
committerJulian Andres Klode <jak@debian.org>
Fri, 26 Aug 2016 13:49:14 +0000 (15:49 +0200)
On FreeBSD, we have to include sys/params.h and sys/mount.h,
not sys/vfs.h.

Gbp-Dch: ignore

CMakeLists.txt
apt-private/private-download.cc

index 4f4c8b37eebb81849e6a2b6cfb575112a2cd2026..b2e5bfe9ce4613164f7b1a37fc1f25e589930dd3 100644 (file)
@@ -89,14 +89,15 @@ if (LZ4_FOUND)
 endif()
 
 # Mount()ing and stat()ing and friends
 endif()
 
 # Mount()ing and stat()ing and friends
+check_symbol_exists(statfs sys/vfs.h HAVE_VFS_H)
+check_include_files(sys/params.h HAVE_PARAMS_H)
+check_symbol_exists(statfs sys/mount.h HAVE_MOUNT_H)
+if (NOT HAVE_VFS_H AND NOT HAVE_MOUNT_H)
+  message(FATAL_ERROR "Can find neither statvfs() nor statfs()")
+endif()
 
 check_function_exists(statvfs HAVE_STATVFS)
 if (NOT HAVE_STATVFS)
 
 check_function_exists(statvfs HAVE_STATVFS)
 if (NOT HAVE_STATVFS)
-  check_symbol_exists(statfs sys/vfs.h HAVE_VFS_H)
-  check_symbol_exists(statfs sys/mount.h HAVE_MOUNT_H)
-  if (NOT HAVE_VFS_H AND NOT HAVE_MOUNT_H)
-    message(FATAL_ERROR "Can find neither statvfs() nor statfs()")
-  endif()
   configure_file(CMake/statvfs.h.in ${PROJECT_BINARY_DIR}/include/statvfs.h COPYONLY)
 endif()
 
   configure_file(CMake/statvfs.h.in ${PROJECT_BINARY_DIR}/include/statvfs.h COPYONLY)
 endif()
 
index c85a497274e009535583a6ddc6fda488682eea66..d0cbbcf50200bc814ae02d7003e0ded44f71f089 100644 (file)
 #include <sys/types.h>
 #include <pwd.h>
 #include <fcntl.h>
 #include <sys/types.h>
 #include <pwd.h>
 #include <fcntl.h>
+#ifdef HAVE_VFS_H
 #include <sys/vfs.h>
 #include <sys/vfs.h>
+#else
+#ifdef HAVE_PARAMS_H
+#include <sys/params.h>
+#endif
+#include <sys/mount.h>
+#endif
 #include <sys/statvfs.h>
 #include <sys/stat.h>
 #include <errno.h>
 #include <sys/statvfs.h>
 #include <sys/stat.h>
 #include <errno.h>