accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [18/50] [abbrv] git commit: ACCUMULO-2812 Pass options to compiler for native lib
Date Wed, 21 May 2014 01:59:37 GMT
ACCUMULO-2812 Pass options to compiler for native lib

  Use system default architecture options when compiling, instead of forcing
  -m64. Allow passing additional arguments (USERFLAGS) to specify additional
  compiler options. Set USERFLAGS with the build_native_library.sh's
  command-line arguments.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/7ccf2026
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/7ccf2026
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/7ccf2026

Branch: refs/heads/ACCUMULO-378
Commit: 7ccf2026913993d5ce076c05f78e3921c532b2ac
Parents: 10ce7af
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Thu May 15 16:01:07 2014 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Fri May 16 13:01:12 2014 -0400

----------------------------------------------------------------------
 bin/build_native_library.sh               | 1 +
 server/native/src/main/resources/Makefile | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ccf2026/bin/build_native_library.sh
----------------------------------------------------------------------
diff --git a/bin/build_native_library.sh b/bin/build_native_library.sh
index 65b2457..907ce2c 100755
--- a/bin/build_native_library.sh
+++ b/bin/build_native_library.sh
@@ -56,6 +56,7 @@ native_dir=`find "${TMP_DIR}" -maxdepth 1 -mindepth 1 -type d`
 cd "${native_dir}"
 
 # Make the native library
+export USERFLAGS=$@
 make
 
 # Make sure it didn't fail

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ccf2026/server/native/src/main/resources/Makefile
----------------------------------------------------------------------
diff --git a/server/native/src/main/resources/Makefile b/server/native/src/main/resources/Makefile
index 33c2fe9..b9211aa 100644
--- a/server/native/src/main/resources/Makefile
+++ b/server/native/src/main/resources/Makefile
@@ -18,14 +18,15 @@ HDRS=$(wildcard nativeMap/*.h) $(wildcard javah/*.h)
 TESTSRCS=$(wildcard testNativeMap/*.cc)
 CXX=g++
 MAVERICKFLAGS=
+USERFLAGS=$(shell env | grep "^USERFLAGS=" | cut -d= -f2)
 
 ifeq ($(shell uname),Linux)
-	JAVA_HOME=$(shell env | fgrep JAVA_HOME | cut -d= -f2)
+	JAVA_HOME=$(shell env | grep "^JAVA_HOME=" | cut -d= -f2)
 	ifeq ($(strip $(JAVA_HOME)),)
 		JAVA_HOME=$(shell dirname $$(dirname $$(readlink -ef $$(which javah))))
 	endif
 	NATIVE_LIB := libaccumulo.so
-	CXXFLAGS=-m64 -g -fPIC -shared -O3 -Wall -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
-Ijavah
+	CXXFLAGS=-g -fPIC -shared -O3 -Wall -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
-Ijavah $(USERFLAGS)
 endif
 
 ifeq ($(shell uname),Darwin)
@@ -34,7 +35,7 @@ ifeq ($(shell uname),Darwin)
 ifneq (,$(findstring 10.9,$(shell sw_vers -productVersion)))
 	MAVERICKFLAGS=-stdlib=libstdc++
 endif
-	CXXFLAGS=-m64 -dynamiclib -undefined dynamic_lookup -O3 -I/System/Library/Frameworks/JavaVM.framework/Headers
-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/darwin -Ijavah $(MAVERICK_FLAGS)
+	CXXFLAGS=-dynamiclib -undefined dynamic_lookup -O3 -I/System/Library/Frameworks/JavaVM.framework/Headers
-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/darwin -Ijavah $(USERFLAGS) $(MAVERICK_FLAGS)
 endif
 
 all : $(NATIVE_LIB)


Mime
View raw message