Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0B10C200B5E for ; Wed, 10 Aug 2016 22:17:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 09D0F160ABD; Wed, 10 Aug 2016 20:17:38 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5BAEE160AA4 for ; Wed, 10 Aug 2016 22:17:37 +0200 (CEST) Received: (qmail 58332 invoked by uid 500); 10 Aug 2016 20:17:36 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 58296 invoked by uid 99); 10 Aug 2016 20:17:36 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Aug 2016 20:17:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4B637E38B5; Wed, 10 Aug 2016 20:17:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ctubbsii@apache.org To: commits@accumulo.apache.org Date: Wed, 10 Aug 2016 20:17:36 -0000 Message-Id: <17ab6966149a493ca32541dced59ced7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [01/10] accumulo git commit: ACCUMULO-4399 Handle files w/ spaces in Makefile archived-at: Wed, 10 Aug 2016 20:17:38 -0000 Repository: accumulo Updated Branches: refs/heads/1.6 d79776d78 -> fc9bd0719 refs/heads/1.7 268922b21 -> a7b482ad8 refs/heads/1.8 3fded56a1 -> f1c3f38d8 refs/heads/master f5c9f7f73 -> 71fde9e63 ACCUMULO-4399 Handle files w/ spaces in Makefile Add quotes and escaping, as needed, to ensure paths with spaces and parentheses are handled properly. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/fc9bd071 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/fc9bd071 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/fc9bd071 Branch: refs/heads/1.6 Commit: fc9bd0719518e7822f84472e495e1ef96f58d836 Parents: d79776d Author: Christopher Tubbs Authored: Wed Aug 10 15:54:32 2016 -0400 Committer: Christopher Tubbs Committed: Wed Aug 10 16:07:24 2016 -0400 ---------------------------------------------------------------------- server/native/src/main/resources/Makefile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc9bd071/server/native/src/main/resources/Makefile ---------------------------------------------------------------------- diff --git a/server/native/src/main/resources/Makefile b/server/native/src/main/resources/Makefile index 9ffeefe..1e26303 100644 --- a/server/native/src/main/resources/Makefile +++ b/server/native/src/main/resources/Makefile @@ -23,10 +23,10 @@ USERFLAGS=$(shell env | grep "^USERFLAGS=" | cut -d= -f2) ifeq ($(shell uname),Linux) JAVA_HOME=$(shell env | grep "^JAVA_HOME=" | cut -d= -f2) ifeq ($(strip $(JAVA_HOME)),) - JAVA_HOME=$(shell dirname $$(dirname $$(readlink -ef $$(which javah)))) + JAVA_HOME=$(shell dirname "$$(dirname "$$(readlink -e "$$(which javah)")")") endif NATIVE_LIB := libaccumulo.so - CXXFLAGS=-g -fPIC -shared -O3 -Wall -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -Ijavah $(USERFLAGS) + CXXFLAGS=-g -fPIC -shared -O3 -Wall -I'$(JAVA_HOME)'/include -I'$(JAVA_HOME)'/include/linux -Ijavah $(USERFLAGS) endif ifeq ($(shell uname),Darwin) @@ -38,10 +38,12 @@ ifeq ($(shell uname),Darwin) ifneq (,$(findstring 10.9,$(shell sw_vers -productVersion))) MAVERICKFLAGS=-stdlib=libstdc++ endif - 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) + 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 -ifeq (,$(wildcard $(JAVA_HOME)/bin/javah)) +# escape space and parens in path for wildcard +JAVA_HOME_ESCAPED=$(shell echo '$(JAVA_HOME)' | sed 's/ /\\ /g' | sed 's/\([()]\)/\\\1/g') +ifeq (,$(wildcard $(JAVA_HOME_ESCAPED)/bin/javah)) $(error "JAVA_HOME does not point to a JDK. Exiting...") endif @@ -53,11 +55,12 @@ $(NATIVE_LIB) : $(SRCS) $(HDRS) test : $(NATIVE_LIB) testJavaHome runTests testJavaHome : - @echo JAVA_HOME is $(JAVA_HOME) + @echo 'JAVA_HOME is $(JAVA_HOME)' -runTests : $(NATIVE_LIB) $(TESTSRCS) - $(CXX) -g -Wall -I/System/Library/Frameworks/JavaVM.framework/Headers -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -I$(JAVA_HOME)/include/darwin -InativeMap -o $@ $(TESTSRCS) $(NATIVE_LIB) $(MAVERICK_FLAGS) +runTests : $(NATIVE_LIB) $(TESTSRCS) $(OUTPUT_DIR) + $(CXX) -g -Wall -I/System/Library/Frameworks/JavaVM.framework/Headers -I'$(JAVA_HOME)'/include -I'$(JAVA_HOME)'/include/linux -I'$(JAVA_HOME)'/include/darwin -InativeMap -o $@ $(TESTSRCS) $(NATIVE_LIB) $(MAVERICK_FLAGS) LD_LIBRARY_PATH=./ ./$@ 20 20 20 20 20 20 20 20 true + if [ ! -z "$(OUTPUT_DIR)" ]; then cp '$(NATIVE_LIB)' "$(OUTPUT_DIR)"; fi clean : - rm -f $(NATIVE_LIB) runTests + rm -f '$(NATIVE_LIB)' runTests