initial support for Solaris
This commit is contained in:
@@ -32,10 +32,14 @@ libraries {
|
||||
includes(["${org.gradle.internal.jvm.Jvm.current().javaHome}/include"])
|
||||
includes(["${org.gradle.internal.jvm.Jvm.current().javaHome}/include/win32"])
|
||||
args("/DWIN32")
|
||||
} else {
|
||||
} else if (org.gradle.internal.os.OperatingSystem.current().linux) {
|
||||
includes(["${org.gradle.internal.jvm.Jvm.current().javaHome}/include"])
|
||||
includes(["${org.gradle.internal.jvm.Jvm.current().javaHome}/include/linux"])
|
||||
args("-lcurses")
|
||||
} else {
|
||||
includes(["${org.gradle.internal.jvm.Jvm.current().javaHome}/include"])
|
||||
includes(["${org.gradle.internal.jvm.Jvm.current().javaHome}/include/solaris"])
|
||||
args("-DSOLARIS", "-lcurses")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
Provides Java bindings for various native APIs.
|
||||
|
||||
# Available bindings
|
||||
@@ -42,6 +41,10 @@ You need to install Visual studio, and build from a Visual studio command prompt
|
||||
|
||||
The g++ compiler is required to build the native library. You will need to install the XCode tools.
|
||||
|
||||
## Solaris
|
||||
|
||||
For Solaris 11, you need to install the `gcc-45` and `system/header` packages.
|
||||
|
||||
# TODO
|
||||
|
||||
* Fix TERM=dumb
|
||||
|
||||
@@ -92,7 +92,13 @@ Java_net_rubygrapefruit_platform_internal_jni_PosixTerminalFunctions_getTerminal
|
||||
|
||||
int current_terminal = -1;
|
||||
|
||||
int write_to_terminal(int ch) {
|
||||
#ifdef SOLARIS
|
||||
#define TERMINAL_CHAR_TYPE char
|
||||
#else
|
||||
#define TERMINAL_CHAR_TYPE int
|
||||
#endif
|
||||
|
||||
int write_to_terminal(TERMINAL_CHAR_TYPE ch) {
|
||||
write(current_terminal, &ch, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ public abstract class Platform {
|
||||
platform = new Linux();
|
||||
} else if (osName.contains("os x")) {
|
||||
platform = new OsX();
|
||||
} else if (osName.contains("sunos")) {
|
||||
platform = new Solaris();
|
||||
} else {
|
||||
platform = new Unsupported();
|
||||
}
|
||||
@@ -54,12 +56,18 @@ public abstract class Platform {
|
||||
}
|
||||
}
|
||||
|
||||
private static class Linux extends Posix {
|
||||
private static class Unix extends Posix {
|
||||
@Override
|
||||
public String getLibraryName() {
|
||||
return "libnative-platform.so";
|
||||
}
|
||||
}
|
||||
|
||||
private static class Linux extends Unix {
|
||||
}
|
||||
|
||||
private static class Solaris extends Unix {
|
||||
}
|
||||
|
||||
private static class OsX extends Posix {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user