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,6 +2,16 @@ ifndef JAVA_HOME
$(error JAVA_HOME is required. Invoke with 'make JAVA_HOME=/path/to/java/home')
unamem := $(shell uname -m)
ifeq ($(unamem),x86_64)
JDKARCH := amd64
else ifeq ($(unamem),aarch64)
JDKARCH := aarch64
$(error Unsupported architecture: $(unamem))
CFLAGS += -std=gnu11 -g -I $(JAVA_HOME)/include
ifndef OS
......@@ -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/'
else ifeq ($(OS),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
.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