Merge pull request #79 from ibmsoe/AIX-fixes

AIX Fixes
This commit is contained in:
Taro L. Saito 2014-07-13 12:54:05 +09:00
commit d75f6088b7
7 changed files with 137 additions and 3 deletions

View File

@ -42,7 +42,7 @@ endif
# os=Default is meant to be generic unix/linux # os=Default is meant to be generic unix/linux
known_os_archs := Linux-x86 Linux-x86_64 Linux-arm Linux-armhf Linux-ppc64 Mac-x86 Mac-x86_64 FreeBSD-x86_64 Windows-x86 Windows-x86_64 SunOS-x86 SunOS-sparc SunOS-x86_64 known_os_archs := Linux-x86 Linux-x86_64 Linux-arm Linux-armhf Linux-ppc64 Mac-x86 Mac-x86_64 FreeBSD-x86_64 Windows-x86 Windows-x86_64 SunOS-x86 SunOS-sparc SunOS-x86_64 AIX-ppc64
os_arch := $(OS_NAME)-$(OS_ARCH) os_arch := $(OS_NAME)-$(OS_ARCH)
IBM_JDK_7 := $(findstring IBM, $(shell $(JAVA) -version 2>&1 | grep IBM | grep "JRE 1.7")) IBM_JDK_7 := $(findstring IBM, $(shell $(JAVA) -version 2>&1 | grep IBM | grep "JRE 1.7"))
@ -50,12 +50,14 @@ ifeq (,$(findstring $(strip $(os_arch)),$(known_os_archs)))
os_arch := Default os_arch := Default
endif endif
os_folder := $(shell echo $(OS_NAME) | tr A-Z a-z)
ifneq ($(IBM_JDK_7),) ifneq ($(IBM_JDK_7),)
$(shell mkdir -p $(IBM_JDK_LIB)) $(shell mkdir -p $(IBM_JDK_LIB))
$(shell cp $(JAVA_HOME)/include/jniport.h $(IBM_JDK_LIB)) $(shell cp $(JAVA_HOME)/include/jniport.h $(IBM_JDK_LIB))
$(shell sed -i "s|#define JNIEXPORT *$$|#define JNIEXPORT __attribute__((__visibility__(\"default\")))|" $(IBM_JDK_LIB)/jniport.h) $(shell sed -i "s|#define JNIEXPORT *$$|#define JNIEXPORT __attribute__((__visibility__(\"default\")))|" $(IBM_JDK_LIB)/jniport.h)
$(shell sed -i "s|typedef long long jlong;.*|/*typedef long long jlong;*/|" $(IBM_JDK_LIB)/jniport.h) $(shell sed -i "s|typedef long long jlong;.*|/*typedef long long jlong;*/|" $(IBM_JDK_LIB)/jniport.h)
$(shell cp $(JAVA_HOME)/include/linux/jni_md.h $(IBM_JDK_LIB)) $(shell cp $(JAVA_HOME)/include/$(os_folder)/jni_md.h $(IBM_JDK_LIB))
$(shell sed -i "s|#define JNIEXPORT|#define JNIEXPORT __attribute__((__visibility__(\"default\")))|" $(IBM_JDK_LIB)/jni_md.h) $(shell sed -i "s|#define JNIEXPORT|#define JNIEXPORT __attribute__((__visibility__(\"default\")))|" $(IBM_JDK_LIB)/jni_md.h)
$(shell sed -i "s|typedef long long jlong;.*|/*typedef long long jlong;*/|" $(IBM_JDK_LIB)/jni_md.h) $(shell sed -i "s|typedef long long jlong;.*|/*typedef long long jlong;*/|" $(IBM_JDK_LIB)/jni_md.h)
endif endif
@ -103,6 +105,17 @@ Linux-ppc64_LINKFLAGS := -shared -static-libgcc -static-libstdc++
Linux-ppc64_LIBNAME := libsnappyjava.so Linux-ppc64_LIBNAME := libsnappyjava.so
Linux-ppc64_SNAPPY_FLAGS := Linux-ppc64_SNAPPY_FLAGS :=
AIX-ppc64_CXX := g++
AIX-ppc64_STRIP := strip -X64
AIX-ppc64_LIBNAME := libsnappyjava.a
ifeq ($(IBM_JDK_7),)
AIX-ppc64_CXXFLAGS := -DHAVE_CONFIG_H -Ilib/inc_linux -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC -fvisibility=hidden -m64
else
AIX-ppc64_CXXFLAGS := -DHAVE_CONFIG_H -I$(JAVA_HOME)/include/aix -Ilib/inc_ibm -I$(JAVA_HOME)/include -Ilib/inc_mac -O2 -fPIC -maix64
endif
AIX-ppc64_LINKFLAGS := -shared -static-libgcc -static-libstdc++ -lcrypt
AIX-ppc64_SNAPPY_FLAGS :=
SunOS-x86_CXX := g++ SunOS-x86_CXX := g++
SunOS-x86_STRIP := strip SunOS-x86_STRIP := strip
SunOS-x86_CXXFLAGS := -include lib/inc_linux/jni_md.h -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden SunOS-x86_CXXFLAGS := -include lib/inc_linux/jni_md.h -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden
@ -193,3 +206,4 @@ ifneq ($(jni_include),)
CXXFLAGS := $(CXXFLAGS) -I"$(jni_include)" CXXFLAGS := $(CXXFLAGS) -I"$(jni_include)"
endif endif

View File

@ -91,6 +91,7 @@ OsgiKeys.additionalHeaders := Map(
"org/xerial/snappy/native/Linux/arm/libsnappyjava.so;osname=linux;processor=arm", "org/xerial/snappy/native/Linux/arm/libsnappyjava.so;osname=linux;processor=arm",
"org/xerial/snappy/native/Linux/ppc64/libsnappyjava.so;osname=linux;processor=ppc64", "org/xerial/snappy/native/Linux/ppc64/libsnappyjava.so;osname=linux;processor=ppc64",
"org/xerial/snappy/native/Linux/ppc64le/libsnappyjava.so;osname=linux;processor=ppc64le", "org/xerial/snappy/native/Linux/ppc64le/libsnappyjava.so;osname=linux;processor=ppc64le",
"org/xerial/snappy/native/AIX/ppc64/libsnappyjava.a;osname=aix;processor=ppc64",
"org/xerial/snappy/native/SunOS/x86/libsnappyjava.so;osname=sunos;processor=x86", "org/xerial/snappy/native/SunOS/x86/libsnappyjava.so;osname=sunos;processor=x86",
"org/xerial/snappy/native/SunOS/x86_64/libsnappyjava.so;osname=sunos;processor=x86-64", "org/xerial/snappy/native/SunOS/x86_64/libsnappyjava.so;osname=sunos;processor=x86-64",
"org/xerial/snappy/native/SunOS/sparc/libsnappyjava.so;osname=sunos;processor=sparc" "org/xerial/snappy/native/SunOS/sparc/libsnappyjava.so;osname=sunos;processor=sparc"

53
lib/inc_ibm/jni_md.h Normal file
View File

@ -0,0 +1,53 @@
/*===========================================================================
* Licensed Materials - Property of IBM
* "Restricted Materials of IBM"
*
* IBM SDK, Java(tm) Technology Edition, v7
* (C) Copyright IBM Corp. 2014, 2014. All Rights Reserved
*
* US Government Users Restricted Rights - Use, duplication or disclosure
* restricted by GSA ADP Schedule Contract with IBM Corp.
*===========================================================================
*/
/*
* Copyright (c) 1996, 2000, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
#ifndef _JAVASOFT_JNI_MD_H_
#define _JAVASOFT_JNI_MD_H_
#define JNIEXPORT __attribute__((__visibility__("default")))
#define JNIIMPORT
#define JNICALL
typedef int jint;
#ifdef _LP64 /* 64-bit Solaris */
typedef long jlong;
#else
/*typedef long long jlong;*/
#endif
typedef signed char jbyte;
#endif /* !_JAVASOFT_JNI_MD_H_ */

56
lib/inc_ibm/jniport.h Normal file
View File

@ -0,0 +1,56 @@
/*******************************************************************************
* Licensed Materials - Property of IBM
* "Restricted Materials of IBM"
*
* (c) Copyright IBM Corp. 1991, 2014 All Rights Reserved
*
* US Government Users Restricted Rights - Use, duplication or disclosure
* restricted by GSA ADP Schedule Contract with IBM Corp.
*******************************************************************************/
#ifndef jniport_h
#define jniport_h
#if defined(WIN32) || defined(_WIN32) || defined(RIM386) || (defined(BREW) && defined(AEE_SIMULATOR))
#define JNIEXPORT __declspec(dllexport)
#define JNICALL __stdcall
typedef signed char jbyte;
typedef int jint;
typedef __int64 jlong;
#else
#define JNIEXPORT __attribute__((__visibility__("default")))
typedef signed char jbyte;
/*typedef long long jlong;*/
#ifdef BREW
#include "AEEFile.h"
#define FILE IFile
#endif
typedef int jint;
#endif /* WIN32 */
#ifndef JNICALL
#define JNICALL
#endif
#ifndef JNIEXPORT
#define JNIEXPORT __attribute__((__visibility__("default")))
#endif
#ifndef JNIIMPORT
#define JNIIMPORT
#endif
#ifdef _JNI_IMPLEMENTATION_
#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT
#else
#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT
#endif
#endif /* jniport_h */

View File

@ -43,6 +43,7 @@ public class OSInfo
public static final String IA64_32 = "ia64_32"; public static final String IA64_32 = "ia64_32";
public static final String IA64 = "ia64"; public static final String IA64 = "ia64";
public static final String PPC = "ppc"; public static final String PPC = "ppc";
public static final String PPC64 = "ppc64";
static { static {
// x86 mappings // x86 mappings
@ -75,6 +76,11 @@ public class OSInfo
archMapping.put("power_rs", PPC); archMapping.put("power_rs", PPC);
// TODO: PowerPC 64bit mappings // TODO: PowerPC 64bit mappings
archMapping.put(PPC64, PPC64);
archMapping.put("power64", PPC64);
archMapping.put("powerpc64", PPC64);
archMapping.put("power_pc64", PPC64);
archMapping.put("power_rs64", PPC64);
} }
@ -140,7 +146,11 @@ public class OSInfo
else if (osName.contains("Linux")) { else if (osName.contains("Linux")) {
return "Linux"; return "Linux";
} }
else { else if (osName.contains("AIX")) {
return "AIX";
}
else {
return osName.replaceAll("\\W", ""); return osName.replaceAll("\\W", "");
} }
} }