GitLab will be upgraded on June 2nd 2020 at 2.00 pm (AEDT) to 3.00 pm (AEDT) due to Critical Security Patch Availability. During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to local Gitlab admin team.

Commit 72dcd8b1 authored by Kunshan Wang's avatar Kunshan Wang

cbinding makefile for aarch64

It now determines the JDK library path by the result of uname -m, rather than
hard-coding amd64
parent bc1bd06d
...@@ -2,10 +2,20 @@ ifndef JAVA_HOME ...@@ -2,10 +2,20 @@ ifndef JAVA_HOME
$(error JAVA_HOME is required. Invoke with 'make JAVA_HOME=/path/to/java/home') $(error JAVA_HOME is required. Invoke with 'make JAVA_HOME=/path/to/java/home')
endif endif
unamem := $(shell uname -m)
ifeq ($(unamem),x86_64)
JDKARCH := amd64
else ifeq ($(unamem),aarch64)
JDKARCH := aarch64
else
$(error Unsupported architecture: $(unamem))
endif
CFLAGS += -std=gnu11 -g -I $(JAVA_HOME)/include CFLAGS += -std=gnu11 -g -I $(JAVA_HOME)/include
ifndef OS ifndef OS
uname := $(shell uname) uname := $(shell uname)
ifeq ($(uname),Darwin) ifeq ($(uname),Darwin)
OS = OSX OS = OSX
else ifeq ($(uname),Linux) else ifeq ($(uname),Linux)
...@@ -20,7 +30,7 @@ ifeq ($(OS),OSX) ...@@ -20,7 +30,7 @@ ifeq ($(OS),OSX)
LDFLAGS += -L $(JAVA_HOME)/jre/lib/server -l jvm -rpath $(JAVA_HOME)/jre/lib/server -install_name '@rpath/libmurefimpl2start.so' LDFLAGS += -L $(JAVA_HOME)/jre/lib/server -l jvm -rpath $(JAVA_HOME)/jre/lib/server -install_name '@rpath/libmurefimpl2start.so'
else ifeq ($(OS),LINUX) else ifeq ($(OS),LINUX)
CFLAGS += -I $(JAVA_HOME)/include/linux CFLAGS += -I $(JAVA_HOME)/include/linux
LDFLAGS += -Wl,--no-as-needed -L $(JAVA_HOME)/jre/lib/amd64/server -l jvm -Wl,-rpath,$(JAVA_HOME)/jre/lib/amd64/server LDFLAGS += -Wl,--no-as-needed -L $(JAVA_HOME)/jre/lib/$(JDKARCH)/server -l jvm -Wl,-rpath,$(JAVA_HOME)/jre/lib/$(JDKARCH)/server
endif endif
.PHONY: all .PHONY: all
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment