Skip to content
Permalink
Browse files

fixed macOS development build (#4)

  • Loading branch information...
aldenml committed Oct 29, 2018
1 parent d191bbc commit a2ca1d158076aac6ac6fca2ff06a3d6eee81cf5e
Showing with 14 additions and 14 deletions.
  1. +3 −3 .gitignore
  2. +5 −5 src/main/java/org/libtorrent4j/swig/libtorrent_jni.java
  3. +1 −1 swig/Jamfile
  4. +5 −5 swig/build-macos.sh
@@ -11,6 +11,6 @@ libtorrent4j.iws
*.o
/swig/bin
/swig/build
/libjlibtorrent*.dylib
/libjlibtorrent*.so
/jlibtorrent*.dll
/libtorrent4j*.dylib
/libtorrent4j*.so
/libtorrent4j*.dll
@@ -13,25 +13,25 @@

public static String jlibtorrentVersion() {
// extracted from the gradle with the run-swig step
return "$JLIBTORRENT_VERSION$";
return "$LIBTORRENT4J_VERSION$";
}

static {
try {
String path = System.getProperty("jlibtorrent.jni.path", "");
String path = System.getProperty("libtorrent4j.jni.path", "");
if ("".equals(path)) {
try {
System.loadLibrary("jlibtorrent-" + jlibtorrentVersion());
System.loadLibrary("torrent4j-" + jlibtorrentVersion());
} catch (LinkageError e) {
// give it a try to the name without version
System.loadLibrary("jlibtorrent");
System.loadLibrary("torrent4j");
}
} else {
System.load(path);
}
} catch (LinkageError e) {
throw new LinkageError(
"Look for your architecture binary instructions at: https://github.com/frostwire/frostwire-jlibtorrent", e);
"Look for your architecture binary instructions at: https://github.com/aldenml/libtorrent4j", e);
}
}

@@ -64,7 +64,7 @@ feature.compose <ssl>on :
<openssl-lib>$(OPENSSL_ROOT)/lib
;

lib jlibtorrent
lib torrent4j

: # sources
libtorrent_jni.cpp
@@ -1,17 +1,17 @@
#!/usr/bin/env bash

export DEVELOPMENT_ROOT=~/Development
export BOOST_ROOT=$DEVELOPMENT_ROOT/boost_1_68_0
export BOOST_ROOT=$DEVELOPMENT_ROOT/boost_1_67_0
export LIBTORRENT_ROOT=$DEVELOPMENT_ROOT/libtorrent
export OPENSSL_ROOT=$DEVELOPMENT_ROOT/openssl-macos

$BOOST_ROOT/b2 -j8 --user-config=config/macosx-x86_64-config.jam variant=release toolset=darwin-x86_64 target-os=darwin location=bin/release/macosx/x86_64
strip -S -x bin/release/macosx/x86_64/libjlibtorrent.dylib
cp bin/release/macosx/x86_64/libjlibtorrent.dylib ../
strip -S -x bin/release/macosx/x86_64/libtorrent4j.dylib
cp bin/release/macosx/x86_64/libtorrent4j.dylib ../

export ANDROID_TOOLCHAIN=$DEVELOPMENT_ROOT/android-toolchain-arm
export OPENSSL_ROOT=$DEVELOPMENT_ROOT/openssl-arm
export PATH=$ANDROID_TOOLCHAIN/arm-linux-androideabi/bin:$PATH
#$BOOST_ROOT/b2 -j8 --user-config=config/android-arm-config.jam variant=release toolset=clang-linux-arm target-os=android location=bin/release/android/armeabi-v7a
#${ANDROID_TOOLCHAIN}/bin/arm-linux-androideabi-objcopy --only-keep-debug bin/release/android/armeabi-v7a/libjlibtorrent.so bin/release/android/armeabi-v7a/libjlibtorrent.so.debug
#${ANDROID_TOOLCHAIN}/bin/arm-linux-androideabi-strip --strip-unneeded -x -g bin/release/android/armeabi-v7a/libjlibtorrent.so
#${ANDROID_TOOLCHAIN}/bin/arm-linux-androideabi-objcopy --only-keep-debug bin/release/android/armeabi-v7a/libtorrent4j.so bin/release/android/armeabi-v7a/libtorrent4j.so.debug
#${ANDROID_TOOLCHAIN}/bin/arm-linux-androideabi-strip --strip-unneeded -x -g bin/release/android/armeabi-v7a/libtorrent4j.so

0 comments on commit a2ca1d1

Please sign in to comment.
You can’t perform that action at this time.