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
diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk
index fe3eb02..b01786c 100644
--- a/make/lib/Awt2dLibraries.gmk
+++ b/make/lib/Awt2dLibraries.gmk
@@ -319,7 +319,6 @@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
   LIBAWT_FILES += awt_LoadLibrary.c
-  LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks
 endif
 
 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
@@ -485,7 +484,6 @@
     LDFLAGS_SUFFIX_macosx := -lmlib_image -ljvm $(LIBM) \
         -framework Cocoa \
         -framework OpenGL \
-        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
         -framework JavaNativeFoundation \
         -framework JavaRuntimeSupport \
         -framework ApplicationServices \
@@ -1120,12 +1118,6 @@
         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga \
         $(foreach dir, $(LIBAWT_HEADLESS_DIRS), -I$(dir))
 
-    ifeq ($(OPENJDK_TARGET_OS), macosx)
-      LIBAWT_HEADLESS_CFLAGS += \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
-    endif
-
     LIBAWT_HEADLESS_FILES := \
         awt_Font.c \
         HeadlessToolkit.c \
@@ -1217,8 +1209,7 @@
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
     LIBSPLASHSCREEN_CFLAGS := -I$(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen \
-        $(LIBSPLASHSCREEN_CFLAGS) \
-        -F/System/Library/Frameworks/JavaVM.framework/Frameworks
+        $(LIBSPLASHSCREEN_CFLAGS)
     LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
     LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp
 
@@ -1250,7 +1241,6 @@
         -framework ApplicationServices \
         -framework Foundation \
         -framework Cocoa \
-        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
         -framework JavaNativeFoundation
   else ifeq ($(OPENJDK_TARGET_OS), windows)
     LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll
@@ -1436,9 +1426,7 @@
           -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
           -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
           -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
-          -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
+          -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_SUFFIX_macosx := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
@@ -1449,7 +1437,6 @@
           -framework Cocoa \
           -framework Security \
           -framework ExceptionHandling \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
           -framework JavaNativeFoundation \
           -framework JavaRuntimeSupport \
           -framework OpenGL \
@@ -1482,8 +1469,7 @@
       CFLAGS := $(CFLAGS_JDKLIB) \
           -I$(JDK_TOPDIR)/src/macosx/native/com/apple/laf \
           -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
-          -I$(JDK_TOPDIR)/src/macosx/native/sun/awt \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks, \
+          -I$(JDK_TOPDIR)/src/macosx/native/sun/awt, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN) \
           -Xlinker -rpath -Xlinker @loader_path, \
@@ -1491,7 +1477,6 @@
           -framework Cocoa \
           -framework Carbon \
           -framework ApplicationServices \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
           -framework JavaNativeFoundation \
           -framework JavaRuntimeSupport \
           -ljava -ljvm, \
diff --git a/make/lib/PlatformLibraries.gmk b/make/lib/PlatformLibraries.gmk
index 533c698..a8d4d31 100644
--- a/make/lib/PlatformLibraries.gmk
+++ b/make/lib/PlatformLibraries.gmk
@@ -32,14 +32,11 @@
       LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
-          -I$(JDK_TOPDIR)/src/macosx/native/apple/applescript \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
+          -I$(JDK_TOPDIR)/src/macosx/native/apple/applescript, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_SUFFIX := -framework Cocoa \
           -framework Carbon \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
           -framework JavaNativeFoundation \
           $(LDFLAGS_JDKLIB_SUFFIX), \
       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libAppleScriptEngine, \
@@ -63,9 +60,7 @@
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
-          -I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
+          -I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_SUFFIX_macosx := \
@@ -76,7 +71,6 @@
           -framework Cocoa \
           -framework Security \
           -framework ExceptionHandling \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
           -framework JavaNativeFoundation \
           -framework JavaRuntimeSupport \
           -framework OpenGL \
@@ -108,16 +102,13 @@
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           $(foreach dir, $(LIBOSX_DIRS), -I$(dir)) \
-          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
+          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_SUFFIX_macosx := \
           -losxapp \
           -framework Cocoa \
           -framework ApplicationServices \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
           -framework JavaNativeFoundation \
           -framework JavaRuntimeSupport \
           -framework Security \