Index: llvm/trunk/cmake/config-ix.cmake =================================================================== --- llvm/trunk/cmake/config-ix.cmake +++ llvm/trunk/cmake/config-ix.cmake @@ -88,6 +88,15 @@ HAVE_CRASHREPORTER_INFO) endif() +if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + check_include_file(linux/magic.h HAVE_LINUX_MAGIC_H) + if(NOT HAVE_LINUX_MAGIC_H) + # older kernels use split files + check_include_file(linux/nfs_fs.h HAVE_LINUX_NFS_FS_H) + check_include_file(linux/smb.h HAVE_LINUX_SMB_H) + endif() +endif() + # library checks if( NOT PURE_WINDOWS ) check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD) Index: llvm/trunk/lib/Support/Unix/Path.inc =================================================================== --- llvm/trunk/lib/Support/Unix/Path.inc +++ llvm/trunk/lib/Support/Unix/Path.inc @@ -76,7 +76,16 @@ #include #include #elif defined(__linux__) +#if defined(HAVE_LINUX_MAGIC_H) #include +#else +#if defined(HAVE_LINUX_NFS_FS_H) +#include +#endif +#if defined(HAVE_LINUX_SMB_H) +#include +#endif +#endif #include #else #include @@ -346,6 +355,12 @@ static bool is_local_impl(struct STATVFS &Vfs) { #if defined(__linux__) +#ifndef NFS_SUPER_MAGIC +#define NFS_SUPER_MAGIC 0x6969 +#endif +#ifndef SMB_SUPER_MAGIC +#define SMB_SUPER_MAGIC 0x517B +#endif #ifndef CIFS_MAGIC_NUMBER #define CIFS_MAGIC_NUMBER 0xFF534D42 #endif