diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-08-11 18:16:43 +0200 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-08-11 18:16:43 +0200 |
commit | db284d60b97bbee864d88737b4f8c6ae5b03c8ff (patch) | |
tree | 468b35289d169c3a0c28399145e3a03cbc3fdf55 /include/libssh/libssh.h | |
parent | bfc6c7e6063e81677e0026669f391a5127cf5975 (diff) | |
download | libssh-db284d60b97bbee864d88737b4f8c6ae5b03c8ff.tar.gz libssh-db284d60b97bbee864d88737b4f8c6ae5b03c8ff.tar.xz libssh-db284d60b97bbee864d88737b4f8c6ae5b03c8ff.zip |
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
Diffstat (limited to 'include/libssh/libssh.h')
-rw-r--r-- | include/libssh/libssh.h | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index 9a6b9f8..cf2ab16 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -22,26 +22,30 @@ #ifndef _LIBSSH_H #define _LIBSSH_H -#if defined _WIN32 || defined __CYGWIN__ - #ifdef SSH_EXPORTS - #ifdef __GNUC__ - #define LIBSSH_API __attribute__((dllexport)) +#ifdef LIBSSH_STATIC + #define LIBSSH_API +#else + #if defined _WIN32 || defined __CYGWIN__ + #ifdef LIBSSH_EXPORTS + #ifdef __GNUC__ + #define LIBSSH_API __attribute__((dllexport)) + #else + #define LIBSSH_API __declspec(dllexport) + #endif #else - #define LIBSSH_API __declspec(dllexport) + #ifdef __GNUC__ + #define LIBSSH_API __attribute__((dllimport)) + #else + #define LIBSSH_API __declspec(dllimport) + #endif #endif #else - #ifdef __GNUC__ - #define LIBSSH_API __attribute__((dllimport)) + #if __GNUC__ >= 4 + #define LIBSSH_API __attribute__((visibility("default"))) #else - #define LIBSSH_API __declspec(dllimport) + #define LIBSSH_API #endif #endif -#else - #if __GNUC__ >= 4 - #define LIBSSH_API __attribute__((visibility("default"))) - #else - #define LIBSSH_API - #endif #endif #ifdef _MSC_VER |