mirror of
https://github.com/aaru-dps/fstester.git
synced 2025-12-16 19:24:39 +00:00
Add Darwin target.
This commit is contained in:
42
setter/src/darwin/CMakeLists.txt
Normal file
42
setter/src/darwin/CMakeLists.txt
Normal file
@@ -0,0 +1,42 @@
|
||||
# /****************************************************************************
|
||||
# Aaru Data Preservation Suite
|
||||
# -----------------------------------------------------------------------------
|
||||
#
|
||||
# Author(s) : Natalia Portillo
|
||||
#
|
||||
# --[ License ] ---------------------------------------------------------------
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# -----------------------------------------------------------------------------
|
||||
# Copyright (C) 2011-2021 Natalia Portillo
|
||||
# *****************************************************************************/
|
||||
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
return()
|
||||
endif()
|
||||
|
||||
project(
|
||||
fssetter-darwin
|
||||
DESCRIPTION "Filesystem test creator for Darwin"
|
||||
LANGUAGES C)
|
||||
|
||||
add_definitions(-DHAVE_SYS_MOUNT_H)
|
||||
|
||||
set(PLATFORM_SOURCES os.c darwin.h)
|
||||
|
||||
set(EXECUTABLE_NAME "fssetter-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
||||
|
||||
add_executable(${EXECUTABLE_NAME} ${PLATFORM_SOURCES})
|
||||
|
||||
target_link_libraries(${EXECUTABLE_NAME} core unix)
|
||||
10
setter/src/darwin/darwin.h
Normal file
10
setter/src/darwin/darwin.h
Normal file
@@ -0,0 +1,10 @@
|
||||
//
|
||||
// Created by claunia on 14/3/21.
|
||||
//
|
||||
|
||||
#ifndef SETTER_SRC_DARWIN_DARWIN_H_
|
||||
#define SETTER_SRC_DARWIN_DARWIN_H_
|
||||
|
||||
void DarwinGetOsInfo();
|
||||
|
||||
#endif // SETTER_SRC_DARWIN_DARWIN_H_
|
||||
52
setter/src/darwin/os.c
Normal file
52
setter/src/darwin/os.c
Normal file
@@ -0,0 +1,52 @@
|
||||
/****************************************************************************
|
||||
Aaru Data Preservation Suite
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Author(s) : Natalia Portillo
|
||||
|
||||
--[ License ] ---------------------------------------------------------------
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2021 Natalia Portillo
|
||||
*****************************************************************************/
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include "../include/defs.h"
|
||||
#include "../log.h"
|
||||
|
||||
void DarwinGetOsInfo()
|
||||
{
|
||||
struct utsname buf;
|
||||
int ret;
|
||||
struct stat finder;
|
||||
|
||||
ret = uname(&buf);
|
||||
|
||||
if(ret)
|
||||
{
|
||||
log_write("Error %d retrieving OS information.\n", errno);
|
||||
return;
|
||||
}
|
||||
|
||||
log_write("OS information:\n");
|
||||
log_write("\tOS name: %s\n", buf.sysname);
|
||||
log_write("\tRelease: %s\n", buf.release);
|
||||
log_write("\tVersion: %s\n", buf.version);
|
||||
log_write("\tMachine: %s\n", buf.machine);
|
||||
}
|
||||
@@ -22,7 +22,7 @@
|
||||
# Copyright (C) 2011-2021 Natalia Portillo
|
||||
# *****************************************************************************/
|
||||
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user