From efa410f6db547d4a09defd3ce3dddb51db8b4400 Mon Sep 17 00:00:00 2001 From: ddehaven Date: Tue, 17 Jun 2014 11:18:10 -0700 Subject: [PATCH] 8043340: [macosx] Fix hard-wired paths to JavaVM.framework Summary: Build system tweaks to allow building with Xcode 5 and on OS X 10.9 and later Reviewed-by: erikj, henryjen, dholmes --- .../agent/src/os/bsd/MacosxDebuggerLocal.m | 4 +-- hotspot/agent/src/os/bsd/Makefile | 6 ++--- hotspot/make/bsd/makefiles/saproc.make | 27 ++++++++++++------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m b/hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m index 0f0ff4e5da..044340aa51 100644 --- a/hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m +++ b/hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ #import #import -#include +#include #import #import diff --git a/hotspot/agent/src/os/bsd/Makefile b/hotspot/agent/src/os/bsd/Makefile index ce3e2c4c32..eabe1f7730 100644 --- a/hotspot/agent/src/os/bsd/Makefile +++ b/hotspot/agent/src/os/bsd/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -50,9 +50,9 @@ SOURCES = symtab.c \ ps_core.c OBJS = $(SOURCES:.c=.o) OBJSPLUS = MacosxDebuggerLocal.o sadis.o $(OBJS) -EXTINCLUDE = -I/System/Library/Frameworks/JavaVM.framework/Headers -I. +EXTINCLUDE = -I. EXTCFLAGS = -m64 -D__APPLE__ -framework JavaNativeFoundation -FOUNDATIONFLAGS = -framework Foundation -F/System/Library/Frameworks/JavaVM.framework/Frameworks -framework JavaNativeFoundation -framework Security -framework CoreFoundation +FOUNDATIONFLAGS = -framework Foundation -framework JavaNativeFoundation -framework Security -framework CoreFoundation LIBSA = $(ARCH)/libsaproc.dylib endif # Darwin diff --git a/hotspot/make/bsd/makefiles/saproc.make b/hotspot/make/bsd/makefiles/saproc.make index a147325979..1b0d5d603e 100644 --- a/hotspot/make/bsd/makefiles/saproc.make +++ b/hotspot/make/bsd/makefiles/saproc.make @@ -64,9 +64,23 @@ ifeq ($(OS_VENDOR), FreeBSD) else ifeq ($(OS_VENDOR), Darwin) SASRCFILES = $(DARWIN_NON_STUB_SASRCFILES) - SALIBS = -g -framework Foundation -F/System/Library/Frameworks/JavaVM.framework/Frameworks -framework JavaNativeFoundation -framework Security -framework CoreFoundation + SALIBS = -g \ + -framework Foundation \ + -framework JavaNativeFoundation \ + -framework Security \ + -framework CoreFoundation #objc compiler blows up on -march=i586, perhaps it should not be included in the macosx intel 32-bit C++ compiles? SAARCH = $(subst -march=i586,,$(ARCHFLAG)) + + # This is needed to locate JavaNativeFoundation.framework + ifeq ($(SYSROOT_CFLAGS),) + # this will happen when building without spec.gmk, set SDKROOT to a valid SDK + # path if your system does not have headers installed in the system frameworks + SA_SYSROOT_FLAGS = -F"$(SDKROOT)/System/Library/Frameworks/JavaVM.framework/Frameworks" + else + # Just use SYSROOT_CFLAGS + SA_SYSROOT_FLAGS=$(SYSROOT_CFLAGS) + endif else SASRCFILES = $(SASRCDIR)/StubDebuggerLocal.c SALIBS = @@ -100,14 +114,8 @@ SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) endif SA_LFLAGS += $(LDFLAGS_HASH_STYLE) -ifeq ($(OS_VENDOR), Darwin) - BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \ - -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") \ - -I/System/Library/Frameworks/JavaVM.framework/Headers -else - BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \ - -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") -endif +BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \ + -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ @@ -116,6 +124,7 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) fi @echo Making SA debugger back-end... $(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \ + $(SA_SYSROOT_FLAGS) \ $(SYMFLAG) $(SAARCH) $(SHARED_FLAG) $(PICFLAG) \ -I$(SASRCDIR) \ -I$(GENERATED) \ -- GitLab