Reorganize folder structure to make cmake happy.

This commit is contained in:
2021-03-31 02:33:45 +01:00
parent 944ee1d0af
commit af4c7b33d2
38 changed files with 46 additions and 50 deletions

View File

@@ -25,3 +25,8 @@
set(MAIN_SOURCES main.c main.h log.c log.h)
add_library(core ${MAIN_SOURCES})
add_subdirectory(macos)
add_subdirectory(dos)
add_subdirectory(win32)
add_subdirectory(unix)

View File

@@ -33,14 +33,6 @@ CHECK_SYMBOL_EXISTS(statfs "sys/statfs.h" HAVE_SYS_STATFS)
CHECK_SYMBOL_EXISTS(statfs "sys/mount.h" HAVE_SYS_MOUNT)
CHECK_SYMBOL_EXISTS(statvfs "sys/statvfs.h" HAVE_SYS_STATVFS)
# NetBSD >= 3.0
if(HAVE_SYS_STATVFS)
message("-- Found statvfs in sys/statvfs.h")
add_definitions(-DHAVE_SYS_STATVFS_H)
CHECK_STRUCT_HAS_MEMBER("struct statvfs" "f_namemax" "sys/statvfs.h" HAVE_STATFS_NAMEMAX)
CHECK_STRUCT_HAS_MEMBER("struct statvfs" "f_fstypename" "sys/statvfs.h" HAVE_STATFS_FTYPENAME)
endif()
# Linux and FreeBSD
if(HAVE_SYS_STATFS)
message("-- Found statfs in sys/statfs.h")
@@ -48,15 +40,19 @@ if(HAVE_SYS_STATFS)
CHECK_STRUCT_HAS_MEMBER("struct statfs" "f_namelen" "sys/statfs.h" HAVE_STATFS_FNAMELEN)
CHECK_STRUCT_HAS_MEMBER("struct statfs" "f_fstypename" "sys/statfs.h" HAVE_STATFS_FTYPENAME)
CHECK_STRUCT_HAS_MEMBER("struct statfs" "f_namemax" "sys/statfs.h" HAVE_STATFS_NAMEMAX)
endif()
# Darwin and most other BSDs
if(HAVE_SYS_MOUNT)
elseif(HAVE_SYS_MOUNT) # Darwin and most other BSDs
message("-- Found statfs in sys/mount.h")
add_definitions(-DHAVE_SYS_MOUNT_H)
CHECK_STRUCT_HAS_MEMBER("struct statfs" "f_namelen" "sys/mount.h" HAVE_STATFS_FNAMELEN)
CHECK_STRUCT_HAS_MEMBER("struct statfs" "f_fstypename" "sys/mount.h" HAVE_STATFS_FTYPENAME)
CHECK_STRUCT_HAS_MEMBER("struct statfs" "f_namemax" "sys/mount.h" HAVE_STATFS_NAMEMAX)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # It's giving false positives sometimes
CHECK_STRUCT_HAS_MEMBER("struct statfs" "f_namemax" "sys/mount.h" HAVE_STATFS_NAMEMAX)
endif()
elseif(HAVE_SYS_STATVFS) # NetBSD >= 3.0
message("-- Found statvfs in sys/statvfs.h")
add_definitions(-DHAVE_SYS_STATVFS_H)
CHECK_STRUCT_HAS_MEMBER("struct statvfs" "f_namemax" "sys/statvfs.h" HAVE_STATFS_NAMEMAX)
CHECK_STRUCT_HAS_MEMBER("struct statvfs" "f_fstypename" "sys/statvfs.h" HAVE_STATFS_FTYPENAME)
endif()
if(HAVE_STATFS_FNAMELEN)
@@ -76,4 +72,8 @@ endif()
set(UNIX_SOURCES attr.c deleted.c dirdepth.c filename.c files.c frag.c links.c os.c perms.c rsrcfork.c sparse.c time.c volume.c xattr.c time.h)
add_library(unix ${UNIX_SOURCES})
add_library(unix ${UNIX_SOURCES})
add_subdirectory(darwin)
add_subdirectory(linux)
add_subdirectory(bsd)

View File

@@ -25,11 +25,11 @@ Copyright (C) 2011-2021 Natalia Portillo
#include "../include/defs.h"
#if defined(__linux__) || defined(__LINUX__) || defined(__gnu_linux)
#include "../linux/linux.h"
#include "linux/linux.h"
#elif defined(__APPLE__) && defined(__MACH__)
#include "../darwin/darwin.h"
#include "darwin/darwin.h"
#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include "../bsd/bsd.h"
#include "bsd/bsd.h"
#endif
void FileAttributes(const char* path)

View File

@@ -28,7 +28,7 @@ Copyright (C) 2011-2021 Natalia Portillo
#include "attr.h"
#include "../log.h"
#include "../../log.h"
void BsdFileAttributes(const char* path)
{

View File

@@ -30,7 +30,7 @@ Copyright (C) 2011-2021 Natalia Portillo
#include "xattr.h"
#include "../log.h"
#include "../../log.h"
void BsdExtendedAttributes(const char* path)
{

View File

@@ -28,7 +28,7 @@ Copyright (C) 2011-2021 Natalia Portillo
#include "attr.h"
#include "../log.h"
#include "../../log.h"
void DarwinFileAttributes(const char* path)
{

View File

@@ -9,7 +9,7 @@
#include "carbon.h"
#include "../log.h"
#include "../../log.h"
#include "rsrcfork.h"
#pragma clang diagnostic push

View File

@@ -28,7 +28,7 @@ Copyright (C) 2011-2021 Natalia Portillo
#include <sys/stat.h>
#include <sys/utsname.h>
#include "../log.h"
#include "../../log.h"
void DarwinGetOsInfo()
{

View File

@@ -29,8 +29,8 @@ Copyright (C) 2011-2021 Natalia Portillo
#include <sys/stat.h>
#include <unistd.h>
#include "../include/consts.h"
#include "../log.h"
#include "../../include/consts.h"
#include "../../log.h"
int DarwinSparse(const char* path)
{

View File

@@ -28,7 +28,7 @@ Copyright (C) 2011-2021 Natalia Portillo
#include "volume.h"
#include "../log.h"
#include "../../log.h"
void DarwinPrintStatfsFlags(uint32_t flags)
{

View File

@@ -30,7 +30,7 @@ Copyright (C) 2011-2021 Natalia Portillo
#include "xattr.h"
#include "../log.h"
#include "../../log.h"
void DarwinExtendedAttributes(const char* path)
{

View File

@@ -32,7 +32,7 @@ Copyright (C) 2011-2021 Natalia Portillo
#include "attr.h"
#include "../log.h"
#include "../../log.h"
#include "linux.h"
void LinuxFileAttributes(const char* path)

View File

@@ -22,7 +22,7 @@ Aaru Data Preservation Suite
Copyright (C) 2011-2021 Natalia Portillo
*****************************************************************************/
#include "../include/consts.h"
#include "../../include/consts.h"
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
@@ -32,7 +32,7 @@ Copyright (C) 2011-2021 Natalia Portillo
#include <sys/stat.h>
#include <unistd.h>
#include "../log.h"
#include "../../log.h"
#include "linux.h"
void LinuxSparse(const char* path)

View File

@@ -26,7 +26,7 @@ Copyright (C) 2011-2021 Natalia Portillo
#include "volume.h"
#include "../log.h"
#include "../../log.h"
void LinuxPrintStatfsFlags(__fsword_t flags)
{

View File

@@ -34,7 +34,7 @@ Copyright (C) 2011-2021 Natalia Portillo
#include "xattr.h"
#include "../log.h"
#include "../../log.h"
#include "linux.h"
void LinuxExtendedAttributes(const char* path)

View File

@@ -23,7 +23,7 @@ Copyright (C) 2011-2021 Natalia Portillo
*****************************************************************************/
#if defined(__APPLE__) && defined(__MACH__)
#include "../darwin/darwin.h"
#include "darwin/darwin.h"
#else
#include <errno.h>
#include <sys/utsname.h>

View File

@@ -25,7 +25,7 @@ Copyright (C) 2011-2021 Natalia Portillo
#include "../include/defs.h"
#if defined(__APPLE__) && defined(__MACH__)
#include "../darwin/darwin.h"
#include "darwin/darwin.h"
#endif
void ResourceFork(const char* path)

View File

@@ -27,9 +27,9 @@ Copyright (C) 2011-2021 Natalia Portillo
#include <dlfcn.h>
#include "../linux/linux.h"
#include "linux/linux.h"
#elif defined(__APPLE__) && defined(__MACH__)
#include "../darwin/darwin.h"
#include "darwin/darwin.h"
#endif
#include <errno.h>

View File

@@ -44,11 +44,11 @@ Copyright (C) 2011-2021 Natalia Portillo
#include "volume.h"
#if defined(__linux__) || defined(__LINUX__) || defined(__gnu_linux)
#include "../linux/linux.h"
#include "linux/linux.h"
#elif defined(__APPLE__) && defined(__MACH__)
#include "../darwin/darwin.h"
#include "darwin/darwin.h"
#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include "../bsd/bsd.h"
#include "bsd/bsd.h"
#endif
void GetVolumeInfo(const char* path, size_t* clusterSize)

View File

@@ -25,11 +25,11 @@ Copyright (C) 2011-2021 Natalia Portillo
#include "../include/defs.h"
#if defined(__linux__) || defined(__LINUX__) || defined(__gnu_linux)
#include "../linux/linux.h"
#include "linux/linux.h"
#elif defined(__APPLE__) && defined(__MACH__)
#include "../darwin/darwin.h"
#include "darwin/darwin.h"
#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include "../bsd/bsd.h"
#include "bsd/bsd.h"
#endif
void ExtendedAttributes(const char* path)