Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#9 Provide Arm Build for mac #11

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ To build the Java side of JNLua, a simple "./gradlew build" is sufficient.

Building the natives is more involved. Generally, JNLua expects natives to be present with the following filenames:

libjnlua-[5.2,5.3]-[windows,linux]-[i686,amd64].[dll,so]
libjnlua-[5.2,5.3]-[windows,linux,mac]-[i686,amd64,aarch64].[dll,so]

To build the natives on Linux you need:

Expand Down
4 changes: 2 additions & 2 deletions build-natives-eris_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi
cd native

for lua_ver in 5.2 5.3; do
for arch_type in amd64; do
for arch_type in amd64 aarch64; do
for plat_type in mac; do

MY_GCC="gcc"
Expand Down Expand Up @@ -46,7 +46,7 @@ make CC="$MY_GCC" CFLAGS="$MY_CFLAGS $MY_LUA_CFLAGS" LDFLAGS="$MY_LDFLAGS" $LUA_
cd ../native
rm *.dll *.so build/*.o

CFLAGS="$MY_CFLAGS -DJNLUA_USE_ERIS -DLUA_USE_POSIX" LDFLAGS="$MY_LDFLAGS" ARCH=amd64 JNLUA_SUFFIX="$MY_JNLUA_SUFFIX" \
CFLAGS="$MY_CFLAGS -DJNLUA_USE_ERIS -DLUA_USE_POSIX" LDFLAGS="$MY_LDFLAGS" ARCH="$arch_type" JNLUA_SUFFIX="$MY_JNLUA_SUFFIX" \
LUA_LIB_NAME=lua LUA_INC_DIR=../eris/src LUA_LIB_DIR=../eris/src LIB_SUFFIX="$MY_LIB_SUFFIX" \
CC="$MY_GCC" LUA_VERSION="$lua_ver" \
make -f Makefile.mac libjnlua
Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
testCompile 'junit:junit:4.12'
testImplementation("junit:junit:4.13.2")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.8.2")
}

version = '0.1.0-SNAPSHOT'
version = '0.1.1-SNAPSHOT'
group = 'org.terasology.jnlua'

tasks.withType(Test) {
Expand Down
1 change: 0 additions & 1 deletion native/Makefile.mac
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ JNLUA_SUFFIX?=53
LUA_INC_DIR?=/usr/include/lua$(LUA_VERSION)
LUA_LIB_NAME?=lua$(LUA_VERSION)
LIB_SUFFIX?=so
ARCH?=amd64
CFLAGS?=-O2 -DLUA_USE_POSIX
LDFLAGS?=

Expand Down
2 changes: 1 addition & 1 deletion publishNatives.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'base'
apply plugin: 'maven-publish'

version = '0.1.0-SNAPSHOT'
version = '0.1.1-SNAPSHOT'
group = 'org.terasology.jnlua'

task zipNatives(type: Zip) {
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/terasology/jnlua/NativeSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ public void load(Class src) {
builder.append("linux-");
}

if (System.getProperty("os.arch").endsWith("64")) {
if (System.getProperty("os.arch").endsWith("aarch64")) {
builder.append("aarch64");
} else if (System.getProperty("os.arch").endsWith("64")) {
// Assume x86_64
builder.append("amd64");
} else {
Expand Down