diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-03-28 21:56:28 +0000 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-03-28 21:56:28 +0000 |
commit | e02a6e0225adb88b3eef91c479b9a50065fcdd5e (patch) | |
tree | 600ba6eef014f11ec448666afdffce55b9ae1501 | |
parent | fce4840c779045b50dc8cc45fdfee4e6ee859248 (diff) | |
download | libssh-e02a6e0225adb88b3eef91c479b9a50065fcdd5e.tar.gz libssh-e02a6e0225adb88b3eef91c479b9a50065fcdd5e.tar.xz libssh-e02a6e0225adb88b3eef91c479b9a50065fcdd5e.zip |
Add WITH_SERVER option.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@293 7dcaeef0-15fb-0310-b436-a5af3365683c
-rw-r--r-- | ConfigureChecks.cmake | 4 | ||||
-rw-r--r-- | DefineOptions.cmake | 1 | ||||
-rw-r--r-- | config.h.cmake | 3 | ||||
-rw-r--r-- | include/libssh/CMakeLists.txt | 20 | ||||
-rw-r--r-- | include/libssh/sftp.h | 4 | ||||
-rw-r--r-- | libssh/sftp.c | 4 |
6 files changed, 29 insertions, 7 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index f82a1557..bbba27ce 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -58,3 +58,7 @@ if (WITH_SSH1) set(WITH_SSH1 1) endif (WITH_SSH1) +if (WITH_SERVER) + set(WITH_SERVER 1) +endif (WITH_SERVER) + diff --git a/DefineOptions.cmake b/DefineOptions.cmake index 20301fc8..91ce25f7 100644 --- a/DefineOptions.cmake +++ b/DefineOptions.cmake @@ -1,3 +1,4 @@ option(WITH_LIBZ "Build with ZLIB support" ON) option(WITH_SSH1 "Build with SSH1 support" OFF) +option(WITH_SERVER "Build with SSH server support" ON) option(WITH_STATIC_LIB "Build with a static library" OFF) diff --git a/config.h.cmake b/config.h.cmake index d08a583a..de60ccc1 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -65,6 +65,9 @@ /* Define to 1 if you want to enable SSH1 */ #cmakedefine WITH_SSH1 1 +/* Define to 1 if you want to enable server support */ +#cmakedefine WITH_SERVER 1 + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD diff --git a/include/libssh/CMakeLists.txt b/include/libssh/CMakeLists.txt index bfbebdd8..dc67ab96 100644 --- a/include/libssh/CMakeLists.txt +++ b/include/libssh/CMakeLists.txt @@ -3,18 +3,32 @@ project(libssh-headers C) set(libssh_HDRS libssh.h crypto.h - server.h sftp.h ssh1.h ssh2.h ) -INSTALL( +install( FILES ${libssh_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/${APPLICATION_NAME} COMPONENT - libraries + headers ) +if (WITH_SERVER) + set(server_HDRS + server.h + ) + + install( + FILES + ${server_HDRS} + DESTINATION + ${INCLUDE_INSTALL_DIR}/${APPLICATION_NAME} + COMPONENT + libraries + ) +endif (WITH_SERVER) + diff --git a/include/libssh/sftp.h b/include/libssh/sftp.h index 729f0ec9..ca549e35 100644 --- a/include/libssh/sftp.h +++ b/include/libssh/sftp.h @@ -607,7 +607,7 @@ char *sftp_canonicalize_path(SFTP_SESSION *sftp, const char *path); */ int sftp_server_version(SFTP_SESSION *sftp); -#ifndef NO_SERVER +#ifdef WITH_SERVER /** * @brief Create a new sftp server session. * @@ -627,7 +627,7 @@ SFTP_SESSION *sftp_server_new(SSH_SESSION *session, CHANNEL *chan); * @return 0 on success, < 0 on error. */ int sftp_server_init(SFTP_SESSION *sftp); -#endif +#endif /* WITH_SERVER */ /* this is not a public interface */ #define SFTP_HANDLES 256 diff --git a/libssh/sftp.c b/libssh/sftp.c index a078d926..c6f7b5df 100644 --- a/libssh/sftp.c +++ b/libssh/sftp.c @@ -59,7 +59,7 @@ SFTP_SESSION *sftp_new(SSH_SESSION *session){ return sftp; } -#ifndef NO_SERVER +#ifdef WITH_SERVER SFTP_SESSION *sftp_server_new(SSH_SESSION *session, CHANNEL *chan){ SFTP_SESSION *sftp=malloc(sizeof(SFTP_SESSION)); memset(sftp,0,sizeof(SFTP_SESSION)); @@ -110,7 +110,7 @@ int sftp_server_init(SFTP_SESSION *sftp){ sftp_leave_function(); return 0; } -#endif +#endif /* WITH_SERVER */ void sftp_free(SFTP_SESSION *sftp){ struct request_queue *ptr; |