Fix jni library name for PowerPC Architecture

Summary:
Right now, building rocksdbjava in PowerPC is broken due to JNI library name. I figured it out that "uname -m" and java's os.arch matches in PowerPC architecture. I made use of this advantage to fix the issue. More info can found from this issue  --> https://github.com/facebook/rocksdb/issues/1317
Closes https://github.com/facebook/rocksdb/pull/2040

Differential Revision: D4779967

Pulled By: siying

fbshipit-source-id: 259f939
This commit is contained in:
Ayappan 2017-03-27 13:57:07 -07:00 committed by Facebook Github Bot
parent 34a70859bc
commit 69c8d524a3
2 changed files with 7 additions and 2 deletions

View File

@ -1380,7 +1380,12 @@ ifeq ($(PLATFORM), OS_SOLARIS)
else
ARCH := $(shell getconf LONG_BIT)
endif
ifeq (,$(findstring ppc,$(MACHINE)))
ROCKSDBJNILIB = librocksdbjni-linux$(ARCH).so
else
ROCKSDBJNILIB = librocksdbjni-linux-$(MACHINE).so
endif
ROCKSDB_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux$(ARCH).jar
ROCKSDB_JAR_ALL = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).jar
ROCKSDB_JAVADOCS_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-javadoc.jar

View File

@ -42,7 +42,7 @@ public class Environment {
if (isUnix()) {
final String arch = is64Bit() ? "64" : "32";
if(isPowerPC()) {
return String.format("%sjni-linux-ppc%s", name, arch);
return String.format("%sjni-linux-%s", name, ARCH);
} else {
return String.format("%sjni-linux%s", name, arch);
}