1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-27 13:21:11 +03:00

Fix static build.

If you want to link against the static library you have to define
LIBSSH_STATIC and link against ssh_static.

gcc -static -DLIBSSH_STATIC -lssh_static foo.c -o foo
This commit is contained in:
Andreas Schneider
2009-08-11 18:16:43 +02:00
parent bfc6c7e606
commit db284d60b9
2 changed files with 24 additions and 24 deletions

View File

@@ -22,25 +22,29 @@
#ifndef _LIBSSH_H
#define _LIBSSH_H
#if defined _WIN32 || defined __CYGWIN__
#ifdef SSH_EXPORTS
#ifdef __GNUC__
#define LIBSSH_API __attribute__((dllexport))
#else
#define LIBSSH_API __declspec(dllexport)
#endif
#else
#ifdef __GNUC__
#define LIBSSH_API __attribute__((dllimport))
#else
#define LIBSSH_API __declspec(dllimport)
#endif
#endif
#ifdef LIBSSH_STATIC
#define LIBSSH_API
#else
#if __GNUC__ >= 4
#define LIBSSH_API __attribute__((visibility("default")))
#if defined _WIN32 || defined __CYGWIN__
#ifdef LIBSSH_EXPORTS
#ifdef __GNUC__
#define LIBSSH_API __attribute__((dllexport))
#else
#define LIBSSH_API __declspec(dllexport)
#endif
#else
#ifdef __GNUC__
#define LIBSSH_API __attribute__((dllimport))
#else
#define LIBSSH_API __declspec(dllimport)
#endif
#endif
#else
#define LIBSSH_API
#if __GNUC__ >= 4
#define LIBSSH_API __attribute__((visibility("default")))
#else
#define LIBSSH_API
#endif
#endif
#endif