mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-23 03:11:30 +00:00
Add ARMv8 Syncthing binary for faster hashing on new devices
This commit is contained in:
parent
044c2cf568
commit
1814479b47
4 changed files with 19 additions and 18 deletions
|
@ -8,3 +8,5 @@
|
||||||
./make-go.bash 386
|
./make-go.bash 386
|
||||||
./make-syncthing.bash 386
|
./make-syncthing.bash 386
|
||||||
|
|
||||||
|
./make-go.bash arm64
|
||||||
|
./make-syncthing.bash arm64
|
||||||
|
|
11
make-go.bash
11
make-go.bash
|
@ -27,17 +27,18 @@ case "$1" in
|
||||||
export GOARCH=arm
|
export GOARCH=arm
|
||||||
export GOARM=5
|
export GOARM=5
|
||||||
;;
|
;;
|
||||||
|
arm64)
|
||||||
|
export GOOS=linux
|
||||||
|
export GOARCH=arm64
|
||||||
|
export GOARM=8
|
||||||
|
;;
|
||||||
386)
|
386)
|
||||||
export GOOS=linux
|
export GOOS=linux
|
||||||
export GOARCH=386
|
export GOARCH=386
|
||||||
export GO386=387
|
export GO386=387
|
||||||
;;
|
;;
|
||||||
amd64)
|
|
||||||
export GOOS=linux
|
|
||||||
export GOARCH=amd64
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "Must specify either arm or 386 or amd64"
|
echo "Invalid architecture"
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,13 @@ case "$1" in
|
||||||
export GOARM=5
|
export GOARM=5
|
||||||
export TARGETDIR=$MYDIR$JNIDIR/armeabi
|
export TARGETDIR=$MYDIR$JNIDIR/armeabi
|
||||||
;;
|
;;
|
||||||
|
arm64)
|
||||||
|
export CGO_ENABLED=0
|
||||||
|
export GOOS=linux
|
||||||
|
export GOARCH=arm64
|
||||||
|
export GOARM=8
|
||||||
|
export TARGETDIR=$MYDIR$JNIDIR/arm64-v8a
|
||||||
|
;;
|
||||||
386)
|
386)
|
||||||
export CGO_ENABLED=0
|
export CGO_ENABLED=0
|
||||||
export GOOS=linux
|
export GOOS=linux
|
||||||
|
@ -20,14 +27,8 @@ case "$1" in
|
||||||
export GO386=387
|
export GO386=387
|
||||||
export TARGETDIR=$MYDIR$JNIDIR/x86
|
export TARGETDIR=$MYDIR$JNIDIR/x86
|
||||||
;;
|
;;
|
||||||
amd64)
|
|
||||||
export CGO_ENABLED=0
|
|
||||||
export GOOS=linux
|
|
||||||
export GOARCH=amd64
|
|
||||||
export TARGETDIR=$MYDIR$JNIDIR/x86_64
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "Must specify either arm or 386 or amd64"
|
echo "Invalid architecture"
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -37,10 +37,7 @@ public class SyncthingRunnable implements Runnable {
|
||||||
private static final String TAG_NICE = "SyncthingRunnableIoNice";
|
private static final String TAG_NICE = "SyncthingRunnableIoNice";
|
||||||
private static final String TAG_KILL = "SyncthingRunnableKill";
|
private static final String TAG_KILL = "SyncthingRunnableKill";
|
||||||
public static final String UNIT_TEST_PATH = "was running";
|
public static final String UNIT_TEST_PATH = "was running";
|
||||||
/**
|
public static final String BINARY_NAME = "libsyncthing.so";
|
||||||
* Path to the native, integrated syncthing binary, relative to the data folder
|
|
||||||
*/
|
|
||||||
public static final String BINARY_NAME = "lib/libsyncthing.so";
|
|
||||||
private static final int LOG_FILE_MAX_LINES = 1000;
|
private static final int LOG_FILE_MAX_LINES = 1000;
|
||||||
|
|
||||||
private static final AtomicReference<Process> mSyncthing = new AtomicReference<>();
|
private static final AtomicReference<Process> mSyncthing = new AtomicReference<>();
|
||||||
|
@ -63,7 +60,7 @@ public class SyncthingRunnable implements Runnable {
|
||||||
*/
|
*/
|
||||||
public SyncthingRunnable(Context context, Command command) {
|
public SyncthingRunnable(Context context, Command command) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mSyncthingBinary = mContext.getApplicationInfo().dataDir + "/" + BINARY_NAME;
|
mSyncthingBinary = mContext.getApplicationInfo().nativeLibraryDir + "/" + BINARY_NAME;
|
||||||
mLogFile = new File(mContext.getExternalFilesDir(null), "syncthing.log");
|
mLogFile = new File(mContext.getExternalFilesDir(null), "syncthing.log");
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case generate:
|
case generate:
|
||||||
|
@ -87,7 +84,7 @@ public class SyncthingRunnable implements Runnable {
|
||||||
*/
|
*/
|
||||||
public SyncthingRunnable(Context context, String[] manualCommand) {
|
public SyncthingRunnable(Context context, String[] manualCommand) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mSyncthingBinary = mContext.getApplicationInfo().dataDir + "/" + BINARY_NAME;
|
mSyncthingBinary = mContext.getApplicationInfo().nativeLibraryDir + "/" + BINARY_NAME;
|
||||||
mCommand = manualCommand;
|
mCommand = manualCommand;
|
||||||
mLogFile = new File(mContext.getExternalFilesDir(null), "syncthing.log");
|
mLogFile = new File(mContext.getExternalFilesDir(null), "syncthing.log");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue