diff --git a/setter/src/CMakeLists.txt b/setter/src/CMakeLists.txt index 5398038..e3bdcef 100644 --- a/setter/src/CMakeLists.txt +++ b/setter/src/CMakeLists.txt @@ -32,3 +32,4 @@ add_subdirectory(win32) add_subdirectory(unix) add_subdirectory(beos) add_subdirectory(amiga) +add_subdirectory(os2) \ No newline at end of file diff --git a/setter/src/os2/16bit/CMakeLists.txt b/setter/src/os2/16bit/CMakeLists.txt new file mode 100644 index 0000000..0b85184 --- /dev/null +++ b/setter/src/os2/16bit/CMakeLists.txt @@ -0,0 +1,39 @@ +# /**************************************************************************** +# 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 . +# +# ----------------------------------------------------------------------------- +# Copyright (C) 2011-2021 Natalia Portillo +# *****************************************************************************/ + +if(NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "I86") + return() +endif() + +project(fssetter-os2 + DESCRIPTION "Filesystem test creator for 16-bit OS/2" + LANGUAGES C) + +set(SUBPLATFORM_SOURCES os.c xattr.c xattr.h) + +set(EXECUTABLE_NAME "fssetter") + +add_executable(${EXECUTABLE_NAME} ${SUBPLATFORM_SOURCES}) + +target_link_libraries(${EXECUTABLE_NAME} core platform) \ No newline at end of file diff --git a/setter/src/os2/32bit/CMakeLists.txt b/setter/src/os2/32bit/CMakeLists.txt new file mode 100644 index 0000000..ef29439 --- /dev/null +++ b/setter/src/os2/32bit/CMakeLists.txt @@ -0,0 +1,41 @@ +# /**************************************************************************** +# 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 . +# +# ----------------------------------------------------------------------------- +# Copyright (C) 2011-2021 Natalia Portillo +# *****************************************************************************/ + +if(NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i386") + return() +endif() + +project(fssetter-os2 + DESCRIPTION "Filesystem test creator for 32-bit OS/2" + LANGUAGES C) + +set(SUBPLATFORM_SOURCES os.c xattr.c) + +set(EXECUTABLE_NAME "fssetter32") + +find_library(OS2LIB "os2386") + +add_executable(${EXECUTABLE_NAME} ${SUBPLATFORM_SOURCES}) + +target_link_libraries(${EXECUTABLE_NAME} core platform) \ No newline at end of file diff --git a/setter/src/os2/CMakeLists.txt b/setter/src/os2/CMakeLists.txt new file mode 100644 index 0000000..e24aaca --- /dev/null +++ b/setter/src/os2/CMakeLists.txt @@ -0,0 +1,35 @@ +# /**************************************************************************** +# 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 . +# +# ----------------------------------------------------------------------------- +# Copyright (C) 2011-2021 Natalia Portillo +# *****************************************************************************/ + +if(NOT OS2) + return() +endif() + +set(PLATFORM_SOURCES attr.c attr.h deleted.c dirdepth.c filename.c files.c frag.c links.c os2defs.h perms.c rsrcfork.c sparse.c time.c volume.c) + +add_library(platform ${PLATFORM_SOURCES}) + +add_subdirectory(16bit) +add_subdirectory(32bit) + diff --git a/setter/toolchains/genow.sh b/setter/toolchains/genow.sh new file mode 100755 index 0000000..7cf7573 --- /dev/null +++ b/setter/toolchains/genow.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# Generates compilation databases for OpenWatcom +mkdir -p ../projects/compdb/ow/os2v2 +cmake -B ../projects/compdb/ow/os2v2 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_TOOLCHAIN_FILE=toolchains/ow-os2.cmake .. diff --git a/setter/toolchains/ow-os2.cmake b/setter/toolchains/ow-os2.cmake new file mode 100644 index 0000000..f4f1623 --- /dev/null +++ b/setter/toolchains/ow-os2.cmake @@ -0,0 +1,46 @@ +if(NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux|Windows") + message(FATAL_ERROR "Unsupported system") +endif() + +if(NOT ${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "x86_64|i386") + message(FATAL_ERROR "Unsupported architecture") +endif() + +if("$ENV{WATCOM}" STREQUAL "") + if(${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux") + set(ENV{WATCOM} "/opt/watcom") + else() + set(ENV{WATCOM} "C:\\WATCOM") + endif() +endif() + +if(${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux") + if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "x86_64") + set(WATCOM_BIN_PATH "$ENV{WATCOM}/binl64/") + set(ENV{PATH} "$ENV{WATCOM}/binl64:$ENV{WATCOM}/binl:$ENV{PATH}") + else() + set(WATCOM_BIN_PATH "$ENV{WATCOM}/binl/") + set(ENV{PATH} "$ENV{WATCOM}/binl:$ENV{PATH}") + endif() + + set(ENV{EDPATH} "$ENV{WATCOM}/eddat") + set(ENV{WIPFC} "$ENV{WATCOM}/wipfc") +else() + if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "x86_64") + set(WATCOM_BIN_PATH "$ENV{WATCOM}\\binnt64\\") + set(ENV{PATH} "$ENV{WATCOM}\\binnt64;$ENV{WATCOM}/binnt;$ENV{PATH}") + else() + set(ENV{PATH} "$ENV{WATCOM}\\binnt;$ENV{PATH}") + set(WATCOM_BIN_PATH "$ENV{WATCOM}\\binnt\\") + endif() + + set(ENV{EDPATH} "$ENV{WATCOM}\\eddat") + set(ENV{WIPFC} "$ENV{WATCOM}\\wipfc") +endif() + +add_compile_options(-3r) +add_compile_options(-mf) +add_compile_options(-l=os2v2) +set(CMAKE_SYSTEM_NAME OS2) +set(CMAKE_SYSTEM_PROCESSOR i386) +set(CMAKE_C_COMPILER "${WATCOM_BIN_PATH}wcl386")