File tree 5 files changed +11
-15
lines changed
src/main/kotlin/fr/acinq/secp256k1/jni
5 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ buildscript {
22
22
23
23
allprojects {
24
24
group = " fr.acinq.secp256k1"
25
- version = " 0.15.0 "
25
+ version = " 0.16.0-SNAPSHOT "
26
26
27
27
repositories {
28
28
google()
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ if [ "$TARGET" == "linux" ]; then
17
17
CC_OPTS=" -fPIC"
18
18
elif [ " $TARGET " == " darwin" ]; then
19
19
OUTFILE=libsecp256k1-jni.dylib
20
+ CC_OPTS=" -arch arm64 -arch x86_64"
20
21
elif [ " $TARGET " == " mingw" ]; then
21
22
OUTFILE=secp256k1-jni.dll
22
23
CC=x86_64-w64-mingw32-gcc
Original file line number Diff line number Diff line change @@ -12,12 +12,8 @@ dependencies {
12
12
val copyJni by tasks.creating(Sync ::class ) {
13
13
onlyIf { org.gradle.internal.os.OperatingSystem .current().isMacOsX }
14
14
dependsOn(" :jni:jvm:buildNativeHost" )
15
- val arch = when (System .getProperty(" os.arch" )) {
16
- " aarch64" -> " aarch64"
17
- else -> " x86_64"
18
- }
19
15
from(rootDir.resolve(" jni/jvm/build/darwin/libsecp256k1-jni.dylib" ))
20
- into(buildDir.resolve(" jniResources/fr/acinq/secp256k1/jni/native/darwin- $arch " ))
16
+ into(buildDir.resolve(" jniResources/fr/acinq/secp256k1/jni/native/darwin" ))
21
17
}
22
18
23
19
(tasks[" processResources" ] as ProcessResources ).apply {
Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ internal object OSInfo {
19
19
private const val PPC = " ppc"
20
20
private const val PPC64 = " ppc64"
21
21
22
- @JvmStatic val nativeSuffix: String get() = " $os -$arch "
22
+ // on macos we build a universal library that contains arm64 and x64 binaries
23
+ @JvmStatic val nativeSuffix: String get() = if (os == " darwin" ) os else " $os -$arch "
23
24
24
25
@JvmStatic val os: String get() = translateOSName(System .getProperty(" os.name" ))
25
26
Original file line number Diff line number Diff line change @@ -12,22 +12,20 @@ cd "$(dirname "$0")"
12
12
cd secp256k1
13
13
14
14
if [ " $TARGET " == " mingw" ]; then
15
- CONF_OPTS=" CFLAGS=-fPIC --host=x86_64-w64-mingw32"
15
+ CFLAGS=" -fPIC"
16
+ CONF_OPTS=" --host=x86_64-w64-mingw32"
16
17
elif [ " $TARGET " == " linux" ]; then
17
- CONF_OPTS= " CFLAGS=-fPIC"
18
+ CFLAGS=" -fPIC"
18
19
elif [ " $TARGET " == " darwin" ]; then
19
- CONF_OPTS=" "
20
+ CFLAGS=" -arch arm64 -arch x86_64"
21
+ LDFLAGS=" -arch arm64 -arch x86_64"
20
22
else
21
23
echo " Unknown TARGET=$TARGET "
22
24
exit 1
23
25
fi
24
26
25
27
./autogen.sh
26
- if [ " $TARGET " == " darwin" ]; then
27
- CFLAGS=" -arch arm64 -arch x86_64" ./configure $CONF_OPTS --enable-experimental --enable-module_ecdh --enable-module-recovery --enable-module-schnorrsig --enable-module-musig --enable-benchmark=no --enable-shared=no --enable-exhaustive-tests=no --enable-tests=no
28
- else
29
- ./configure $CONF_OPTS --enable-experimental --enable-module_ecdh --enable-module-recovery --enable-module-schnorrsig --enable-module-musig --enable-benchmark=no --enable-shared=no --enable-exhaustive-tests=no --enable-tests=no
30
- fi
28
+ CFLAGS=" $CFLAGS " LDFLAGS=" $LDFLAGS " ./configure $CONF_OPTS --enable-experimental --enable-module_ecdh --enable-module-recovery --enable-module-schnorrsig --enable-module-musig --enable-benchmark=no --enable-shared=no --enable-exhaustive-tests=no --enable-tests=no
31
29
make clean
32
30
make
33
31
You can’t perform that action at this time.
0 commit comments