This file is part of MXE. See LICENSE.md for licensing information.

Contains ad hoc patches for cross building.

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tony Theodore <tonyt@logyst.com>
Date: Sun, 29 Oct 2017 00:11:28 +1100
Subject: [PATCH 1/2] add option to disable shared libs

Taken from:
https://www.libssh.org/archive/libssh/2017-10/0000012.html

diff --git a/DefineOptions.cmake b/DefineOptions.cmake
index 1111111..2222222 100644
--- a/DefineOptions.cmake
+++ b/DefineOptions.cmake
@@ -2,6 +2,7 @@ option(WITH_GSSAPI "Build with GSSAPI support" ON)
 option(WITH_ZLIB "Build with ZLIB support" ON)
 option(WITH_SFTP "Build with SFTP support" ON)
 option(WITH_SERVER "Build with SSH server support" ON)
+option(WITH_SHARED_LIB "Build with a shared library" ON)
 option(WITH_STATIC_LIB "Build with a static library" OFF)
 option(WITH_DEBUG_CRYPTO "Build with cryto debug output" OFF)
 option(WITH_DEBUG_PACKET "Build with packet debug output" OFF)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1111111..2222222 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -303,6 +303,7 @@ include_directories(
 # Set the path to the default map file
 set(MAP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.map")
 
+if (WITH_SHARED_LIB)
 if (WITH_SYMBOL_VERSIONING AND HAVE_LD_VERSION_SCRIPT AND ABIMAP_FOUND)
     # Get the list of header files
     get_file_list(dev_header_list
@@ -382,6 +383,7 @@ install(TARGETS ${LIBSSH_SHARED_LIBRARY}
 
 install(EXPORT libssh-config
         DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
+endif (WITH_SHARED_LIB)
 
 if (BUILD_STATIC_LIB)
   add_library(${LIBSSH_STATIC_LIBRARY} STATIC ${libssh_SRCS})

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Tue, 20 Aug 2019 21:39:19 +0200
Subject: [PATCH 2/2] remove unwanted dependencies from example program


diff --git a/examples/knownhosts.c b/examples/knownhosts.c
index 1111111..2222222 100644
--- a/examples/knownhosts.c
+++ b/examples/knownhosts.c
@@ -17,14 +17,11 @@ The goal is to show the API in action. It's not a reference on how terminal
 clients must be made or how a client should react.
  */
 
-#include "config.h"
-
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#include "libssh/priv.h"
 #include <libssh/libssh.h>
 #include "examples_common.h"
 
@@ -74,7 +71,7 @@ int verify_knownhost(ssh_session session)
         fprintf(stderr,"Could not find known host file. If you accept the host key here,\n");
         fprintf(stderr,"the file will be automatically created.\n");
         /* fallback to SSH_SERVER_NOT_KNOWN behavior */
-        FALL_THROUGH;
+        /* FALL_THROUGH; */
     case SSH_SERVER_NOT_KNOWN:
         fprintf(stderr,
                 "The server is unknown. Do you trust the host key (yes/no)?\n");
