Tried to get arm32 to work, but sysroot is missing getrandom, and no getrandom no libsodium as far as I understand. Everything compiles now, including the sample, tested kexe on arm64, runs and does sodium init at least

This commit is contained in:
Ugljesa Jovanovic 2020-06-02 23:59:01 +02:00 committed by Ugljesa Jovanovic
parent 641d950384
commit 006dd47873
No known key found for this signature in database
GPG Key ID: 178E6DFCECCB0E0F
13 changed files with 83 additions and 386 deletions

View File

@ -80,7 +80,7 @@ fun independentDependencyBlock(nativeDeps : KotlinDependencyHandler.() -> Unit)
*/ */
fun NamedDomainObjectContainer<KotlinSourceSet>.createWorkaroundNativeMainSourceSet(name : String, nativeDeps : KotlinDependencyHandler.() -> Unit) : KotlinSourceSet { fun NamedDomainObjectContainer<KotlinSourceSet>.createWorkaroundNativeMainSourceSet(name : String, nativeDeps : KotlinDependencyHandler.() -> Unit) : KotlinSourceSet {
return create("${name}Workaround") { return create("${name}Workaround") {
kotlin.srcDir("src/nativeMain/kotlin") kotlin.srcDir("src/nativeMain")
dependencies { dependencies {
nativeDeps.invoke(this) nativeDeps.invoke(this)
} }
@ -90,7 +90,7 @@ fun NamedDomainObjectContainer<KotlinSourceSet>.createWorkaroundNativeMainSource
fun NamedDomainObjectContainer<KotlinSourceSet>.createWorkaround32bitNativeMainSourceSet(name : String, nativeDeps : KotlinDependencyHandler.() -> Unit) : KotlinSourceSet { fun NamedDomainObjectContainer<KotlinSourceSet>.createWorkaround32bitNativeMainSourceSet(name : String, nativeDeps : KotlinDependencyHandler.() -> Unit) : KotlinSourceSet {
return create("${name}Workaround") { return create("${name}Workaround") {
kotlin.srcDir("src/native32Main/kotlin") kotlin.srcDir("src/native32Main")
dependencies { dependencies {
nativeDeps.invoke(this) nativeDeps.invoke(this)
} }

View File

@ -19,6 +19,6 @@ kotlin.code.style=official
kotlin.js.compiler=ir kotlin.js.compiler=ir
#kotlin.js.experimental.generateKotlinExternals=true #kotlin.js.experimental.generateKotlinExternals=true
kotlin.mpp.enableGranularSourceSetsMetadata=true #kotlin.mpp.enableGranularSourceSetsMetadata=true
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=4096m org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=4096m

View File

@ -61,7 +61,7 @@ kotlin {
js { js {
browser { browser {
testTask { testTask {
enabled = true //Until I sort out testing on travis enabled = false //Until I sort out testing on travis
useKarma { useKarma {
useChrome() useChrome()
} }
@ -109,22 +109,31 @@ kotlin {
) )
} }
} }
// Linux 32 is using target-sysroot-2-raspberrypi which is missing getrandom and explicit_bzero in stdlib
// so konanc can't build klib because getrandom missing will cause sodium_misuse()
// ld.lld: error: undefined symbol: explicit_bzero
// >>> referenced by utils.c
// >>> libsodium_la-utils.o:(sodium_memzero) in archive /tmp/included11051337748775083797/libsodium.a
//
// ld.lld: error: undefined symbol: getrandom
// >>> referenced by randombytes_sysrandom.c
// >>> libsodium_la-randombytes_sysrandom.o:(_randombytes_linux_getrandom) in archive /tmp/included11051337748775083797/libsodium.a
linuxArm32Hfp() { // linuxArm32Hfp() {
binaries { // binaries {
staticLib { // staticLib {
} // }
} // }
compilations.getByName("main") { // compilations.getByName("main") {
val libsodiumCinterop by cinterops.creating { // val libsodiumCinterop by cinterops.creating {
defFile(project.file("src/nativeInterop/cinterop/libsodium.def")) // defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-arm32/include/") // compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-arm32/include/")
} // }
kotlinOptions.freeCompilerArgs = listOf( // kotlinOptions.freeCompilerArgs = listOf(
"-include-binary", "${project.rootDir}/sodiumWrapper/static-arm32/lib/libsodium.a" // "-include-binary", "${project.rootDir}/sodiumWrapper/static-arm32/lib/libsodium.a"
) // )
} // }
} // }
} }
@ -299,8 +308,9 @@ kotlin {
"linuxX64", "linuxArm64" "linuxX64", "linuxArm64"
) )
val linux32Bit = setOf( val linux32Bit = setOf(
"linuxArm32Hfp" "" // "linuxArm32Hfp"
) )
//iosArm32, iosArm64, iosX64, macosX64, metadata, tvosArm64, tvosX64, watchosArm32, watchosArm64, watchosX86 //iosArm32, iosArm64, iosX64, macosX64, metadata, tvosArm64, tvosX64, watchosArm32, watchosArm64, watchosX86
val macos64Bit = setOf( val macos64Bit = setOf(
"macosX64" "macosX64"
@ -441,28 +451,28 @@ kotlin {
val linuxX64Main by getting { val linuxX64Main by getting {
dependsOn(nativeMain) dependsOn(nativeMain)
isRunningInIdea { isRunningInIdea {
kotlin.srcDir("src/nativeMain/kotlin") kotlin.srcDir("src/nativeMain")
} }
} }
val linuxX64Test by getting { val linuxX64Test by getting {
dependsOn(nativeTest) dependsOn(nativeTest)
isRunningInIdea { isRunningInIdea {
kotlin.srcDir("src/nativeTest/kotlin") kotlin.srcDir("src/nativeTest")
}
}
val linuxArm32HfpMain by getting {
dependsOn(native32Main)
isRunningInIdea {
kotlin.srcDir("src/native32Main/kotlin")
}
}
val linuxArm32HfpTest by getting {
dependsOn(native32Test)
isRunningInIdea {
kotlin.srcDir("src/native32Test/kotlin")
} }
} }
//can still be useful for cinterop and debugging
// val linuxArm32HfpMain by getting {
// dependsOn(native32Main)
// isRunningInIdea {
// kotlin.srcDir("src/native32Main/kotlin")
// }
// }
// val linuxArm32HfpTest by getting {
// dependsOn(native32Test)
// isRunningInIdea {
// kotlin.srcDir("src/native32Test/kotlin")
// }
// }
} }
runningOnMacos { runningOnMacos {

View File

@ -1,201 +0,0 @@
{
"name": "kotlin-multiplatform-crypto-js",
"version": "0.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"browser-stdout": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
"integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
"dev": true
},
"commander": {
"version": "2.15.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
"integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
"dev": true
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"diff": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
"dev": true
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
},
"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"growl": {
"version": "1.10.5",
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
"integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
"dev": true
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"he": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz",
"integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=",
"dev": true
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true,
"requires": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
},
"kotlin": {
"version": "1.3.40",
"resolved": "https://registry.npmjs.org/kotlin/-/kotlin-1.3.40.tgz",
"integrity": "sha512-3l718c3QznxsFNUrnsyGworQZrczyzKRhf+Rx/+7XhSS95S/QrCnlUVuEXA1l9iJpfxx4t9Ecc7+jC1JD28aYg=="
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
},
"mkdirp": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true,
"requires": {
"minimist": "0.0.8"
}
},
"mocha": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz",
"integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==",
"dev": true,
"requires": {
"browser-stdout": "1.3.1",
"commander": "2.15.1",
"debug": "3.1.0",
"diff": "3.5.0",
"escape-string-regexp": "1.0.5",
"glob": "7.1.2",
"growl": "1.10.5",
"he": "1.1.1",
"minimatch": "3.0.4",
"mkdirp": "0.5.1",
"supports-color": "5.4.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"dev": true
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"requires": {
"wrappy": "1"
}
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true
},
"supports-color": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
"integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true
}
}
}

View File

@ -1,15 +0,0 @@
{
"name": "kotlin-multiplatform-crypto-js",
"version": "0.0.1",
"description": "Kotlin Multiplatform Crypto",
"main": "crypto.js",
"author": "Ugljesa Jovanovic",
"license": "Apache 2.0",
"homepage": "",
"dependencies": {
"kotlin": "1.3.40"
},
"devDependencies": {
"mocha": "5.2.0"
}
}

View File

@ -17,11 +17,8 @@
@file:Suppress("UnstableApiUsage") @file:Suppress("UnstableApiUsage")
import com.moowork.gradle.node.task.NodeTask
import org.gradle.api.tasks.testing.logging.TestLogging
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
plugins { plugins {
kotlin(PluginsDeps.multiplatform) kotlin(PluginsDeps.multiplatform)
@ -51,32 +48,11 @@ version = "0.0.4-SNAPSHOT"
val ideaActive = System.getProperty("idea.active") == "true" val ideaActive = System.getProperty("idea.active") == "true"
fun getHostOsName(): String {
val target = System.getProperty("os.name")
if (target == "Linux") return "linux"
if (target.startsWith("Windows")) return "windows"
if (target.startsWith("Mac")) return "macos"
return "unknown"
}
kotlin { kotlin {
val hostOsName = getHostOsName() val hostOsName = getHostOsName()
if (hostOsName == "linux") { runningOnLinuxx86_64 {
jvm() jvm()
js { js {
compilations {
this.forEach {
it.compileKotlinTask.kotlinOptions.sourceMap = true
it.compileKotlinTask.kotlinOptions.moduleKind = "commonjs"
it.compileKotlinTask.kotlinOptions.metaInfo = true
if (it.name == "main") {
it.compileKotlinTask.kotlinOptions.main = "call"
}
println("Compilation name ${it.name} set")
println("Destination dir ${it.compileKotlinTask.destinationDir}")
}
}
browser { browser {
testTask { testTask {
enabled = false //Until I sort out testing on travis enabled = false //Until I sort out testing on travis
@ -99,28 +75,28 @@ kotlin {
binaries { binaries {
executable { executable {
println("Optimized: $optimized")
} }
} }
} }
//Not supported in coroutines at the moment // Linux 32 is using target-sysroot-2-raspberrypi which is missing getrandom and explicit_bzero in stdlib
linuxArm32Hfp() { // so konanc can't build klib because getrandom missing will cause sodium_misuse()
binaries { // so 32bit will be only available from non-delegated flavor
staticLib { // linuxArm32Hfp() {
} // binaries {
} // executable {
} // }
//Not supported in coroutines at the moment // }
// }
linuxArm64() { linuxArm64() {
binaries { binaries {
staticLib { executable {
} }
} }
} }
} }
if (hostOsName == "macos") { runningOnMacos {
iosX64("ios") { iosX64("ios") {
binaries { binaries {
framework { framework {
@ -151,7 +127,7 @@ kotlin {
} }
} }
} }
if (hostOsName == "windows") { runningOnWindows {
mingwX64() { mingwX64() {
binaries { binaries {
@ -161,15 +137,6 @@ kotlin {
} }
} }
} }
// No coroutines support for mingwX86
// mingwX86() {
// binaries {
// staticLib {
//
// }
// }
// }
println(targets.names) println(targets.names)
@ -205,24 +172,7 @@ kotlin {
} }
} }
targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget> { runningOnLinuxx86_64 {
compilations.getByName("main") {
println("Setting native sourceset dependancy for $name")
if (this@withType.name.contains("ios").not()) {
println("Setting native sourceset deps for $this@withType.name")
defaultSourceSet.dependsOn(nativeMain)
}
}
compilations.getByName("test") {
println("Setting native sourceset dependancy for $name")
if (this@withType.name.contains("ios").not()) {
println("Setting native test deps for $this@withType.name")
defaultSourceSet.dependsOn(nativeTest)
}
}
}
if (hostOsName == "linux") {
val jvmMain by getting { val jvmMain by getting {
dependencies { dependencies {
implementation(kotlin(Deps.Jvm.stdLib)) implementation(kotlin(Deps.Jvm.stdLib))
@ -253,58 +203,45 @@ kotlin {
} }
val linuxMain by getting { val linuxMain by getting {
dependsOn(nativeMain) dependsOn(nativeMain)
//Force idea to consider native sourceset
if (ideaActive) {
kotlin.srcDir("src/nativeMain/kotlin")
}
} }
val linuxTest by getting { val linuxTest by getting {
dependsOn(nativeTest) dependsOn(nativeTest)
//Force idea to consider native sourceset
if (ideaActive) {
kotlin.srcDir("src/nativeTest/kotlin")
}
} }
//Not supported in coroutines at the moment
// val linuxArm32HfpMain by getting { // val linuxArm32HfpMain by getting {
// dependsOn(nativeMain) // dependsOn(nativeMain)
// } // }
//
// val linuxArm32HfpTest by getting { // val linuxArm32HfpTest by getting {
// dependsOn(nativeTest) // dependsOn(nativeTest)
// } // }
val linuxArm64Main by getting {
// val linuxArm64Main by getting { dependsOn(nativeMain)
// dependsOn(nativeMain) }
// } val linuxArm64Test by getting {
// dependsOn(nativeTest)
// val linuxArm64Test by getting { }
// dependsOn(nativeTest)
// }
} }
if (hostOsName == "macos") { runningOnMacos {
val iosMain by getting { val iosMain by getting {
// dependsOn(nativeMain) dependsOn(nativeMain)
} }
val iosTest by getting { val iosTest by getting {
// dependsOn(nativeTest) dependsOn(nativeTest)
} }
val ios64ArmMain by getting { val ios64ArmMain by getting {
// dependsOn(nativeMain) dependsOn(nativeMain)
} }
val ios64ArmTest by getting { val ios64ArmTest by getting {
// dependsOn(nativeTest) dependsOn(nativeTest)
} }
val ios32ArmMain by getting { val ios32ArmMain by getting {
// dependsOn(nativeMain) dependsOn(nativeMain)
} }
val ios32ArmTest by getting { val ios32ArmTest by getting {
// dependsOn(nativeTest) dependsOn(nativeTest)
} }
val macosX64Main by getting { val macosX64Main by getting {
@ -315,19 +252,8 @@ kotlin {
} }
} }
// Coroutines don't support mingwx86 yet
// val mingwX86Main by getting {
// dependsOn(commonMain)
// dependencies {
// implementation(Deps.Native.coroutines)
// }
// }
// val mingwX86Test by getting { runningOnWindows {
// dependsOn(commonTest)
// }
//
if (hostOsName == "windows") {
val mingwX64Main by getting { val mingwX64Main by getting {
dependsOn(commonMain) dependsOn(commonMain)
dependencies { dependencies {
@ -349,16 +275,6 @@ kotlin {
} }
task<Copy>("copyPackageJson") {
dependsOn("compileKotlinJs")
println("Copying package.json from $projectDir/core/src/jsMain/npm")
from ("$projectDir/src/jsMain/npm")
println("Node modules dir ${node.nodeModulesDir}")
into ("${node.nodeModulesDir}")
}
tasks { tasks {
@ -368,23 +284,8 @@ tasks {
from(dokka.get().outputDirectory) from(dokka.get().outputDirectory)
} }
dokka {
println ("Dokka !")
impliedPlatforms = mutableListOf("Common")
kotlinTasks {
listOf()
}
sourceRoot {
println ("Common !")
path = "/home/ionspin/Projects/Future/kotlin-multiplatform-crypto/crypto/src/commonMain" //TODO remove static path!
platforms = listOf("Common")
}
}
if (getHostOsName() == "linux") { if (getHostOsName() == "linux") {
val npmInstall by getting
val compileKotlinJs by getting(AbstractCompile::class)
val compileTestKotlinJs by getting(Kotlin2JsCompile::class)
val jvmTest by getting(Test::class) { val jvmTest by getting(Test::class) {
testLogging { testLogging {

View File

@ -1,5 +1,7 @@
package com.ionspin.kotlin.crypto.sample package com.ionspin.kotlin.crypto.sample
class Sample { object Sample {
fun blakehash() {
}
} }

View File

@ -8,5 +8,5 @@ fun main() {
println("Test") println("Test")
// Blake // Blake
val blake = Blake2bDelegated() val blake = Blake2bDelegated()
blake.digest() println("Result ${blake.digest()}")
} }

View File

@ -37,5 +37,5 @@ rootProject.name = "KotlinMultiplatformCrypto"
include("multiplatform-crypto-api") include("multiplatform-crypto-api")
include("multiplatform-crypto") include("multiplatform-crypto")
include("multiplatform-crypto-delegated") include("multiplatform-crypto-delegated")
//include("sample") include("sample")

View File

@ -1,10 +1,10 @@
#! /bin/sh #! /bin/sh
export PREFIX="$(pwd)/static-arm32" export PREFIX="$(pwd)/static-arm32"
#export CC=/usr/bin/arm-none-eabi-gcc #export CC=/usr/bin/arm-none-eabi-gcc
export TARGET_ARCH=armv7 export SYSROOT=$HOME/.konan/dependencies/target-sysroot-2-raspberrypi
export SYSROOT="$HOME/.konan/dependencies/target-sysroot-2-raspberrypi --host=arm-none-eabi" #export CFLAGS="-fno-stack-protector -mfpu=vfp -mfloat-abi=hard -I$SYSROOT/usr/include/c++/4.8.3 -I$SYSROOT/usr/include/c++/4.8.3/arm-linux-gnueabihf"
export CFLAGS="" export CFLAGS=""
export LDFLAGS="--specs=nosys.specs" export LDFLAGS=""
cd libsodium cd libsodium
./configure --prefix=$PREFIX --with-sysroot=$SYSROOT --host=arm-none-eabi "$@" ./autogen.sh -s -f
./configure --prefix=$PREFIX --with-sysroot=$SYSROOT --host=arm-linux-gnueabihf "$@"