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
$(error JAVA_HOME is required. Invoke with 'make JAVA_HOME=/path/to/java/home')
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
ifndef OS
uname := $(shell uname)
uname := $(shell uname)
ifeq ($(uname),Darwin)
OS = OSX
else ifeq ($(uname),Linux)
......@@ -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'
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
endif
.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