From b2738264872f0cc95cd1058d37608a0c5340b83a Mon Sep 17 00:00:00 2001 From: cy384 Date: Sat, 26 Oct 2024 17:29:11 -0400 Subject: [PATCH] include my libssh2 and mbedtls as submodules and cmake it up --- .gitmodules | 6 ++++++ CMakeLists.txt | 26 +++++++++++++++++++------- opentransport-libssh2 | 1 + opentransport-mbedtls | 1 + 4 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 .gitmodules create mode 160000 opentransport-libssh2 create mode 160000 opentransport-mbedtls diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c01ecca --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "opentransport-libssh2"] + path = opentransport-libssh2 + url = git@github.com:cy384/opentransport-libssh2.git +[submodule "opentransport-mbedtls"] + path = opentransport-mbedtls + url = git@github.com:cy384/opentransport-mbedtls.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 8851449..fa370cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,15 +8,27 @@ cmake_minimum_required(VERSION 3.9) project(ssheven) add_application(ssheven CREATOR "SSH7" ssheven.c ssheven-console.c ssheven.r ssheven-net.c ssheven-debug.c) +# set up and build mbedtls +set(ENABLE_PROGRAMS OFF CACHE BOOL "disable mbedtls programs" FORCE) +set(UNSAFE_BUILD ON CACHE BOOL "ignore mac os jank fro mbedtls" FORCE) +set(ENABLE_TESTING OFF CACHE BOOL "disable mbedtls tests" FORCE) +add_subdirectory(opentransport-mbedtls) + +# set up and build libssh2 +set(CRYPTO_BACKEND mbedTLS) +set(BUILD_SHARED_LIBS OFF CACHE BOOL "disable libssh2 shared libs" FORCE) +set(BUILD_EXAMPLES OFF CACHE BOOL "disable libssh2 examples" FORCE) +set(BUILD_TESTING OFF CACHE BOOL "disable libssh2 tests" FORCE) +add_subdirectory(opentransport-libssh2) + IF(CMAKE_SYSTEM_NAME MATCHES Retro68) # for 68k -set_target_properties(ssheven PROPERTIES COMPILE_FLAGS "-ffunction-sections -mcpu=68020 -O3 -Wall -Wextra -Wno-unused-parameter") -set_target_properties(ssheven PROPERTIES LINK_FLAGS "-Wl,-gc-sections -Wl,--mac-segments -Wl,${CMAKE_CURRENT_SOURCE_DIR}/ssheven.segmap") -target_link_libraries(ssheven ssh2 mbedtls mbedx509 mbedcrypto OpenTransportApp OpenTransport OpenTptInet vterm retrocrt) + set_target_properties(ssheven PROPERTIES COMPILE_FLAGS "-ffunction-sections -mcpu=68020 -O3 -Wall -Wextra -Wno-unused-parameter") + set_target_properties(ssheven PROPERTIES LINK_FLAGS "-Wl,-gc-sections -Wl,--mac-segments -Wl,${CMAKE_CURRENT_SOURCE_DIR}/ssheven.segmap") + target_link_libraries(ssheven libssh2 mbedtls mbedx509 mbedcrypto OpenTransportApp OpenTransport OpenTptInet vterm retrocrt) ELSE() # for PPC -set_target_properties(ssheven PROPERTIES COMPILE_FLAGS "-ffunction-sections -mcpu=601 -O3 -Wall -Wextra -Wno-unused-parameter") -set_target_properties(ssheven PROPERTIES LINK_FLAGS "-Wl,-gc-sections") -target_link_libraries(ssheven ThreadsLib ssh2 mbedtls mbedx509 mbedcrypto OpenTransportAppPPC OpenTransportLib OpenTptInternetLib vterm retrocrt) + set_target_properties(ssheven PROPERTIES COMPILE_FLAGS "-ffunction-sections -mcpu=601 -O3 -Wall -Wextra -Wno-unused-parameter") + set_target_properties(ssheven PROPERTIES LINK_FLAGS "-Wl,-gc-sections") + target_link_libraries(ssheven ThreadsLib ssh2 mbedtls mbedx509 mbedcrypto OpenTransportAppPPC OpenTransportLib OpenTptInternetLib vterm retrocrt) ENDIF() - diff --git a/opentransport-libssh2 b/opentransport-libssh2 new file mode 160000 index 0000000..2b176f2 --- /dev/null +++ b/opentransport-libssh2 @@ -0,0 +1 @@ +Subproject commit 2b176f21910bd7f82d7ca3a6ceb4cfb0bd4cbaf4 diff --git a/opentransport-mbedtls b/opentransport-mbedtls new file mode 160000 index 0000000..01162ec --- /dev/null +++ b/opentransport-mbedtls @@ -0,0 +1 @@ +Subproject commit 01162ec6e5853cb9a94374ab2139023b74d65c9d