Linux port
Add jni_linux.go and scripts/find_linux_jnih.
This commit is contained in:
parent
187cd38f39
commit
70e004187d
10
jni_linux.go
Normal file
10
jni_linux.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
// +build linux
|
||||
//Generated by scripts/find_linux_jnih
|
||||
|
||||
package jni
|
||||
|
||||
/*
|
||||
#cgo CFLAGS: -I/usr/lib/jvm/java-11-openjdk-amd64/include -I/usr/lib/jvm/java-11-openjdk-amd64/include/linux
|
||||
#cgo LDFLAGS: -L/usr/lib/jvm/java-11-openjdk-amd64/lib/server -ljvm
|
||||
*/
|
||||
import "C"
|
|
@ -1,4 +1,4 @@
|
|||
// +build darwin
|
||||
// +build !android
|
||||
//go:generate javac test/AClass.java
|
||||
|
||||
package jni
|
||||
|
|
17
scripts/find_linux_jnih
Executable file
17
scripts/find_linux_jnih
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
JAVA_HOME=$(dirname $(readlink -f $(which java) | sed 's^jre/bin/^^'))
|
||||
|
||||
echo // +build linux > jni_linux.tmp
|
||||
echo //Generated by scripts/find_linux_jnih >> jni_linux.tmp
|
||||
echo >> jni_linux.tmp
|
||||
echo package jni >> jni_linux.tmp
|
||||
echo >> jni_linux.tmp
|
||||
echo /\* >> jni_linux.tmp
|
||||
echo \#cgo CFLAGS: -I$JAVA_HOME/include -I$JAVA_HOME/include/linux >> jni_linux.tmp
|
||||
echo \#cgo LDFLAGS: -L$JAVA_HOME/lib/server -ljvm >> jni_linux.tmp
|
||||
echo \*/ >> jni_linux.tmp
|
||||
echo import \"C\" >> jni_linux.tmp
|
||||
|
||||
mv -f jni_linux.go jni_linux.go-old
|
||||
mv jni_linux.tmp jni_linux.go
|
Loading…
Reference in New Issue
Block a user