summaryrefslogtreecommitdiff
path: root/libssh2-sys/lib.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-11-01 13:24:31 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-11-01 13:24:31 -0700
commite4cb4d3306a53f381f6b5b936c4df8b8d3551fc0 (patch)
tree284f8b2176589b644ad202315a6268aec5b73df9 /libssh2-sys/lib.rs
parent719471f6e8069626965ed348f7d5abedcce514e2 (diff)
downloadssh2-rs-e4cb4d3306a53f381f6b5b936c4df8b8d3551fc0.zip
Update with build script for libssh2
Diffstat (limited to 'libssh2-sys/lib.rs')
-rw-r--r--libssh2-sys/lib.rs24
1 files changed, 8 insertions, 16 deletions
diff --git a/libssh2-sys/lib.rs b/libssh2-sys/lib.rs
index 76059d5..1c533b4 100644
--- a/libssh2-sys/lib.rs
+++ b/libssh2-sys/lib.rs
@@ -2,8 +2,9 @@
#![allow(bad_style)]
extern crate libc;
-#[phase(plugin)]
-extern crate "link-config" as link_conifg;
+
+#[cfg(unix)] extern crate "openssl-sys" as openssl;
+#[cfg(unix)] extern crate "libz-sys" as libz;
use libc::{c_int, size_t, c_void, c_char, c_long, c_uchar, c_uint, c_ulong};
use libc::ssize_t;
@@ -205,20 +206,6 @@ pub type LIBSSH2_PASSWD_CHANGEREQ_FUNC = extern fn(sess: *mut LIBSSH2_SESSION,
#[cfg(unix)] pub type libssh2_socket_t = c_int;
#[cfg(windows)] pub type libssh2_socket_t = libc::SOCKET;
-#[cfg(unix)]
-link_config!("libssh2", ["favor_static"])
-
-#[cfg(unix)]
-#[link(name = "z")]
-extern {}
-
-#[cfg(windows)]
-#[link(name = "ws2_32")] // needed by ssh2
-#[link(name = "bcrypt")] // needed by ssh2
-#[link(name = "crypt32")] // needed by ssh2
-#[link(name = "ssh2", kind = "static")]
-extern {}
-
extern {
// misc
pub fn libssh2_init(flag: c_int) -> c_int;
@@ -517,3 +504,8 @@ extern {
longentry_len: size_t,
attrs: *mut LIBSSH2_SFTP_ATTRIBUTES) -> c_int;
}
+
+#[test]
+fn smoke() {
+ unsafe { libssh2_init(0) };
+}