8043340: [macosx] Fix hard-wired paths to JavaVM.framework

Fri, 13 Jun 2014 18:04:49 -0700

author
ddehaven
date
Fri, 13 Jun 2014 18:04:49 -0700
changeset 7562
0e1aa319e805
parent 7560
06face256a8c
child 7563
c56cd30b1b20

8043340: [macosx] Fix hard-wired paths to JavaVM.framework
Summary: Build system tweaks to allow building on OS X 10.9 and later
Reviewed-by: erikj, dholmes

agent/src/os/bsd/MacosxDebuggerLocal.m file | annotate | diff | comparison | revisions
agent/src/os/bsd/Makefile file | annotate | diff | comparison | revisions
make/bsd/makefiles/saproc.make file | annotate | diff | comparison | revisions
     1.1 --- a/agent/src/os/bsd/MacosxDebuggerLocal.m	Mon Jan 12 15:24:29 2015 +0100
     1.2 +++ b/agent/src/os/bsd/MacosxDebuggerLocal.m	Fri Jun 13 18:04:49 2014 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -26,7 +26,7 @@
    1.11  #import <Foundation/Foundation.h>
    1.12  #import <JavaNativeFoundation/JavaNativeFoundation.h>
    1.13  
    1.14 -#include <JavaVM/jni.h>
    1.15 +#include <jni.h>
    1.16  
    1.17  #import <mach/mach.h>
    1.18  #import <mach/mach_types.h>
     2.1 --- a/agent/src/os/bsd/Makefile	Mon Jan 12 15:24:29 2015 +0100
     2.2 +++ b/agent/src/os/bsd/Makefile	Fri Jun 13 18:04:49 2014 -0700
     2.3 @@ -1,5 +1,5 @@
     2.4  #
     2.5 -# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
     2.6 +# Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
     2.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.8  #
     2.9  # This code is free software; you can redistribute it and/or modify it
    2.10 @@ -50,9 +50,9 @@
    2.11  	ps_core.c
    2.12  OBJS    = $(SOURCES:.c=.o)
    2.13  OBJSPLUS = MacosxDebuggerLocal.o sadis.o $(OBJS)
    2.14 -EXTINCLUDE = -I/System/Library/Frameworks/JavaVM.framework/Headers -I.
    2.15 +EXTINCLUDE = -I.
    2.16  EXTCFLAGS = -m64 -D__APPLE__ -framework JavaNativeFoundation
    2.17 -FOUNDATIONFLAGS = -framework Foundation -F/System/Library/Frameworks/JavaVM.framework/Frameworks -framework JavaNativeFoundation -framework Security -framework CoreFoundation
    2.18 +FOUNDATIONFLAGS = -framework Foundation -framework JavaNativeFoundation -framework Security -framework CoreFoundation
    2.19  LIBSA = $(ARCH)/libsaproc.dylib
    2.20  endif   # Darwin
    2.21  
     3.1 --- a/make/bsd/makefiles/saproc.make	Mon Jan 12 15:24:29 2015 +0100
     3.2 +++ b/make/bsd/makefiles/saproc.make	Fri Jun 13 18:04:49 2014 -0700
     3.3 @@ -1,5 +1,5 @@
     3.4  #
     3.5 -# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
     3.6 +# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
     3.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.8  #
     3.9  # This code is free software; you can redistribute it and/or modify it
    3.10 @@ -64,9 +64,22 @@
    3.11  else
    3.12    ifeq ($(OS_VENDOR), Darwin)
    3.13      SASRCFILES = $(DARWIN_NON_STUB_SASRCFILES)
    3.14 -    SALIBS = -g -framework Foundation -F/System/Library/Frameworks/JavaVM.framework/Frameworks -framework JavaNativeFoundation -framework Security -framework CoreFoundation
    3.15 +    SALIBS = -g \
    3.16 +             -framework Foundation \
    3.17 +             -framework JavaNativeFoundation \
    3.18 +             -framework Security \
    3.19 +             -framework CoreFoundation
    3.20      #objc compiler blows up on -march=i586, perhaps it should not be included in the macosx intel 32-bit C++ compiles?
    3.21      SAARCH = $(subst -march=i586,,$(ARCHFLAG))
    3.22 +
    3.23 +    # This is needed to locate JavaNativeFoundation.framework
    3.24 +    # JDK 8 doesn't have SYSROOT_CFLAGS, so we'll cobble it together here
    3.25 +    SA_SYSROOT_FLAGS=
    3.26 +    ifneq ($(SDKPATH),)
    3.27 +      SA_SYSROOT_FLAGS += -isysroot "$(SDKPATH)" -iframework"$(SDKPATH)/System/Library/Frameworks"
    3.28 +    endif
    3.29 +    # always needed, even if SDKPATH is empty
    3.30 +    SA_SYSROOT_FLAGS += -F"$(SDKPATH)/System/Library/Frameworks/JavaVM.framework/Frameworks"
    3.31    else
    3.32      SASRCFILES = $(SASRCDIR)/StubDebuggerLocal.c
    3.33      SALIBS = 
    3.34 @@ -100,14 +113,8 @@
    3.35  endif
    3.36  SA_LFLAGS += $(LDFLAGS_HASH_STYLE)
    3.37  
    3.38 -ifeq ($(OS_VENDOR), Darwin)
    3.39 -  BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \
    3.40 -    -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") \
    3.41 -    -I/System/Library/Frameworks/JavaVM.framework/Headers
    3.42 -else
    3.43 -  BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \
    3.44 -    -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]")
    3.45 -endif
    3.46 +BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \
    3.47 +  -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]")
    3.48  
    3.49  $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
    3.50  	$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
    3.51 @@ -116,6 +123,7 @@
    3.52  	fi
    3.53  	@echo Making SA debugger back-end...
    3.54  	$(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE                   \
    3.55 +	           $(SA_SYSROOT_FLAGS)                                  \
    3.56  	           $(SYMFLAG) $(SAARCH) $(SHARED_FLAG) $(PICFLAG)       \
    3.57  	           -I$(SASRCDIR)                                        \
    3.58  	           -I$(GENERATED)                                       \

mercurial