include(CheckIncludeFile)
set(include_files
+ dirent.h
linux/fs.h
pwd.h
sys/clonefile.h
+ sys/file.h
sys/ioctl.h
sys/mman.h
- sys/time.h
+ sys/utime.h
sys/wait.h
- sys/file.h
syslog.h
- termios.h
- dirent.h
- strings.h
unistd.h
utime.h
- sys/utime.h
- varargs.h)
+)
foreach(include_file IN ITEMS ${include_files})
string(TOUPPER ${include_file} include_var)
string(REGEX REPLACE "[/.]" "_" include_var ${include_var})
getpwuid
localtime_r
posix_fallocate
- realpath
setenv
- strndup
syslog
unsetenv
utimensat
include(CheckStructHasMember)
check_struct_has_member("struct stat" st_atim sys/stat.h
HAVE_STRUCT_STAT_ST_ATIM LANGUAGE CXX)
-check_struct_has_member("struct stat" st_ctim sys/stat.h
- HAVE_STRUCT_STAT_ST_CTIM LANGUAGE CXX)
-check_struct_has_member("struct stat" st_mtim sys/stat.h
- HAVE_STRUCT_STAT_ST_MTIM LANGUAGE CXX)
check_struct_has_member("struct stat" st_atimespec sys/stat.h
HAVE_STRUCT_STAT_ST_ATIMESPEC LANGUAGE CXX)
+check_struct_has_member("struct stat" st_ctim sys/stat.h
+ HAVE_STRUCT_STAT_ST_CTIM LANGUAGE CXX)
check_struct_has_member("struct stat" st_ctimespec sys/stat.h
HAVE_STRUCT_STAT_ST_CTIMESPEC LANGUAGE CXX)
+check_struct_has_member("struct stat" st_mtim sys/stat.h
+ HAVE_STRUCT_STAT_ST_MTIM LANGUAGE CXX)
check_struct_has_member("struct stat" st_mtimespec sys/stat.h
HAVE_STRUCT_STAT_ST_MTIMESPEC LANGUAGE CXX)
check_struct_has_member("struct statfs" f_fstypename sys/mount.h
#cmakedefine MTR_ENABLED
-// Define if you have the "asctime_r" function.
-#cmakedefine HAVE_ASCTIME_R
-
-// Define if your compiler supports AVX2.
-#cmakedefine HAVE_AVX2
-
-// Define if you have the "getopt_long" function.
-#cmakedefine HAVE_GETOPT_LONG
+// === Header files ===
-// Define if you have the "getpwuid" function.
-#cmakedefine HAVE_GETPWUID
+// Define if you have the <dirent.h> header file.
+#cmakedefine HAVE_DIRENT_H
// Define if you have the <linux/fs.h> header file.
#cmakedefine HAVE_LINUX_FS_H
-// Define if you have the "localtime_r" function.
-#cmakedefine HAVE_LOCALTIME_R
-
-// Define if the system has the type "long long".
-#cmakedefine HAVE_LONG_LONG
-
-// Define if you have the "posix_fallocate.
-#cmakedefine HAVE_POSIX_FALLOCATE
-
// Define if you have the <pwd.h> header file.
#cmakedefine HAVE_PWD_H
-// Define if you have the "realpath"" function.
-#cmakedefine HAVE_REALPATH
-
-// Define if you have the "setenv" function.
-#cmakedefine HAVE_SETENV
-
-// Define if you have the "strndup" function.
-#cmakedefine HAVE_STRNDUP
-
-// Define if "f_fstypename" is a member of "struct statfs".
-#cmakedefine HAVE_STRUCT_STATFS_F_FSTYPENAME
-
-// Define if "st_atim" is a member of "struct stat".
-#cmakedefine HAVE_STRUCT_STAT_ST_ATIM
-
-// Define if "st_ctim" is a member of "struct stat".
-#cmakedefine HAVE_STRUCT_STAT_ST_CTIM
-
-// Define if "st_mtim" is a member of "struct stat".
-#cmakedefine HAVE_STRUCT_STAT_ST_MTIM
-
-// Define if "st_atimespec" is a member of "struct stat".
-#cmakedefine HAVE_STRUCT_STAT_ST_ATIMESPEC
-
-// Define if "st_ctimespec" is a member of "struct stat".
-#cmakedefine HAVE_STRUCT_STAT_ST_CTIMESPEC
-
-// Define if "st_mtimespec" is a member of "struct stat".
-#cmakedefine HAVE_STRUCT_STAT_ST_MTIMESPEC
-
-// Define if you have the "syslog" function.
-#cmakedefine HAVE_SYSLOG
-
-// Define if you have the <syslog.h> header file.
-#cmakedefine HAVE_SYSLOG_H
-
// Define if you have the <sys/clonefile.h> header file.
#cmakedefine HAVE_SYS_CLONEFILE_H
// Define if you have the <sys/mman.h> header file.
#cmakedefine HAVE_SYS_MMAN_H
-// Define if you have the <sys/time.h> header file.
-#cmakedefine HAVE_SYS_TIME_H
+// Define if you have the <sys/utime.h> header file.
+#cmakedefine HAVE_SYS_UTIME_H
-// Define if you have <sys/wait.h> that is POSIX.1 compatible.
+// Define if you have the <sys/wait.h> header file.
#cmakedefine HAVE_SYS_WAIT_H
-// Define if you have the <sys/file.h> header file.
-#cmakedefine HAVE_SYS_FILE_H
-
-// Define if you have the <termios.h> header file.
-#cmakedefine HAVE_TERMIOS_H
-
-// Define if you have the <dirent.h> header file.
-#cmakedefine HAVE_DIRENT_H
-
-// Define if you have the <strings.h> header file.
-#cmakedefine HAVE_STRINGS_H
+// Define if you have the <syslog.h> header file.
+#cmakedefine HAVE_SYSLOG_H
// Define if you have the <unistd.h> header file.
#cmakedefine HAVE_UNISTD_H
// Define if you have the <utime.h> header file.
#cmakedefine HAVE_UTIME_H
-// Define if you have the <sys/utime.h> header file.
-#cmakedefine HAVE_SYS_UTIME_H
+// === Functions ===
-// Define if you have the <varargs.h> header file.
-#cmakedefine HAVE_VARARGS_H
+// Define if you have the "asctime_r" function.
+#cmakedefine HAVE_ASCTIME_R
+
+// Define if you have the "getopt_long" function.
+#cmakedefine HAVE_GETOPT_LONG
+
+// Define if you have the "getpwuid" function.
+#cmakedefine HAVE_GETPWUID
+
+// Define if you have the "localtime_r" function.
+#cmakedefine HAVE_LOCALTIME_R
+
+// Define if you have the "posix_fallocate" function.
+#cmakedefine HAVE_POSIX_FALLOCATE
+
+// Define if you have the "setenv" function.
+#cmakedefine HAVE_SETENV
+
+// Define if you have the "syslog" function.
+#cmakedefine HAVE_SYSLOG
// Define if you have the "unsetenv" function.
#cmakedefine HAVE_UNSETENV
// Define if you have the "utimes" function.
#cmakedefine HAVE_UTIMES
+// === Struct members ===
+
+// Define if "st_atim" is a member of "struct stat".
+#cmakedefine HAVE_STRUCT_STAT_ST_ATIM
+
+// Define if "st_atimespec" is a member of "struct stat".
+#cmakedefine HAVE_STRUCT_STAT_ST_ATIMESPEC
+
+// Define if "st_ctim" is a member of "struct stat".
+#cmakedefine HAVE_STRUCT_STAT_ST_CTIM
+
+// Define if "st_ctimespec" is a member of "struct stat".
+#cmakedefine HAVE_STRUCT_STAT_ST_CTIMESPEC
+
+// Define if "st_mtim" is a member of "struct stat".
+#cmakedefine HAVE_STRUCT_STAT_ST_MTIM
+
+// Define if "st_mtimespec" is a member of "struct stat".
+#cmakedefine HAVE_STRUCT_STAT_ST_MTIMESPEC
+
+// Define if "f_fstypename" is a member of "struct statfs".
+#cmakedefine HAVE_STRUCT_STATFS_F_FSTYPENAME
+
+// === Instruction sets ===
+
+// Define if your compiler supports AVX2.
+#cmakedefine HAVE_AVX2
+
+// === Other ===
+
#if defined(__ibmxl__) && defined(__clang__) // Compiler xlclang
-# undef HAVE_VARARGS_H // varargs.h would hide macros of stdarg.h
# undef HAVE_STRUCT_STAT_ST_CTIM
# undef HAVE_STRUCT_STAT_ST_MTIM
#endif