diff options
author | bgermann <bgermann@users.noreply.github.com> | 2017-11-18 14:57:54 +0100 |
---|---|---|
committer | bgermann <bgermann@users.noreply.github.com> | 2017-11-18 14:57:54 +0100 |
commit | b3870b405b4c59785ff56a1ae64c3b2731ecbb8f (patch) | |
tree | 9762e0d205ed40cbc2c672263c83f8a8730c8bb4 /libc-test | |
parent | 2b948828c5b552c192403827a0a83b8f285fbb7e (diff) | |
download | rust-libc-b3870b405b4c59785ff56a1ae64c3b2731ecbb8f.tar.gz |
Prerequisites for Solaris testing support
With these changes there are no "undeclared"
errors for libc-test on Solaris anymore.
Diffstat (limited to 'libc-test')
-rw-r--r-- | libc-test/build.rs | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs index ce3c6f5f55..62d181a24c 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -24,6 +24,7 @@ fn main() { let netbsd = target.contains("netbsd"); let openbsd = target.contains("openbsd"); let rumprun = target.contains("rumprun"); + let solaris = target.contains("solaris"); let bsdlike = freebsd || apple || netbsd || openbsd || dragonfly; let mut cfg = ctest::TestGenerator::new(); @@ -34,6 +35,8 @@ fn main() { cfg.define("_NETBSD_SOURCE", Some("1")); } else if windows { cfg.define("_WIN32_WINNT", Some("0x8000")); + } else if solaris { + cfg.define("_REENTRANT", None); } // Android doesn't actually have in_port_t but it's much easier if we @@ -103,7 +106,9 @@ fn main() { cfg.header("pwd.h"); cfg.header("grp.h"); cfg.header("sys/utsname.h"); - cfg.header("sys/ptrace.h"); + if !solaris { + cfg.header("sys/ptrace.h"); + } cfg.header("sys/mount.h"); cfg.header("sys/uio.h"); cfg.header("sched.h"); @@ -132,11 +137,11 @@ fn main() { cfg.header("ifaddrs.h"); cfg.header("langinfo.h"); - if !openbsd && !freebsd && !dragonfly { + if !openbsd && !freebsd && !dragonfly && !solaris { cfg.header("sys/quota.h"); } - if !musl && !x32 { + if !musl && !x32 && !solaris { cfg.header("sys/sysctl.h"); } @@ -291,6 +296,13 @@ fn main() { cfg.header("sys/ioctl_compat.h"); } + if solaris { + cfg.header("port.h"); + cfg.header("ucontext.h"); + cfg.header("sys/filio.h"); + cfg.header("sys/loadavg.h"); + } + if linux || freebsd || dragonfly || netbsd || apple || emscripten { if !uclibc { cfg.header("aio.h"); @@ -428,6 +440,8 @@ fn main() { "FILE_ATTRIBUTE_INTEGRITY_STREAM" | "ERROR_NOTHING_TO_TERMINATE" if mingw => true, + "SIG_DFL" | + "SIG_ERR" | "SIG_IGN" => true, // sighandler_t weirdness "SIGUNUSED" => true, // removed in glibc 2.26 @@ -515,6 +529,14 @@ fn main() { "BOTHER" => true, "MFD_CLOEXEC" | "MFD_ALLOW_SEALING" if !mips && musl => true, + + "DT_FIFO" | "DT_CHR" | "DT_DIR" | "DT_BLK" | "DT_REG" | "DT_LNK" | "DT_SOCK" if solaris => true, + "USRQUOTA" | "GRPQUOTA" if solaris => true, + "PRIO_MIN" | "PRIO_MAX" if solaris => true, + + // These are defined for Solaris 11, but the crate is tested on illumos, where they are currently not defined + "EADI" | "PORT_SOURCE_POSTWAIT" | "PORT_SOURCE_SIGNAL" | "PTHREAD_STACK_MIN" => true, + _ => false, } }); @@ -636,6 +658,11 @@ fn main() { // Ignore these until next major version. "bind" | "writev" | "readv" | "sendmsg" | "recvmsg" if android && (aarch64 || x86_64) => true, + // signal is defined with sighandler_t, so ignore + "signal" if solaris => true, + + "cfmakeraw" | "cfsetspeed" if solaris => true, + _ => false, } }); |