Cleaning up src format. ihse-jdk-library-branch
authorihse
Thu, 03 May 2018 23:33:28 +0200
branchihse-jdk-library-branch
changeset 56517 cb0f21f5f307
parent 56512 c030d6f39dfd
child 56518 e3340e2f594f
Cleaning up src format.
make/common/JdkNativeCompilation.gmk
make/lib/Awt2dLibraries.gmk
make/lib/Lib-java.desktop.gmk
make/lib/Lib-java.prefs.gmk
make/lib/Lib-jdk.accessibility.gmk
make/lib/Lib-jdk.jdi.gmk
make/lib/Lib-jdk.jdwp.agent.gmk
make/lib/LibCommon.gmk
--- a/make/common/JdkNativeCompilation.gmk	Thu May 03 14:46:44 2018 +0200
+++ b/make/common/JdkNativeCompilation.gmk	Thu May 03 23:33:28 2018 +0200
@@ -79,6 +79,11 @@
     $1_SRC += $$($1_EXTRA_SRC)
   endif
 
+  ifneq ($$($1_EXCLUDE_SRC_PATTERNS), )
+    $1_EXCLUDE_SRC := $$(call containing, $$($1_EXCLUDE_SRC_PATTERNS), $$($1_SRC))
+    $1_SRC := $$(filter-out $$($1_EXCLUDE_SRC), $$($1_SRC))
+  endif
+
   ifeq ($$($1_VERSIONINFO_RESOURCE), )
     $1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
   else ifeq ($$($1_VERSIONINFO_RESOURCE), DISABLE)
--- a/make/lib/Awt2dLibraries.gmk	Thu May 03 14:46:44 2018 +0200
+++ b/make/lib/Awt2dLibraries.gmk	Thu May 03 23:33:28 2018 +0200
@@ -31,8 +31,7 @@
 
 # We must not include java.desktop/unix/native/libmlib_image, which is only
 # for usage by solaris-sparc in libmlib_image_v.
-BUILD_LIBMLIB_SRC := $(TOPDIR)/src/java.desktop/share/native/libmlib_image \
-    $(TOPDIR)/src/java.desktop/share/native/common/awt/medialib
+BUILD_LIBMLIB_EXCLUDE_SRC_PATTERNS := unix
 
 BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES -DMLIB_NO_LIBSUNMATH
 
@@ -42,8 +41,9 @@
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE, \
     NAME := mlib_image, \
-    SRC := $(BUILD_LIBMLIB_SRC), \
+    EXTRA_SRC := $(call FindSrcDirsForComponent, $(MODULE), common/awt/medialib), \
     EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \
+    EXCLUDE_SRC_PATTERNS := $(BUILD_LIBMLIB_EXCLUDE_SRC_PATTERNS), \
     OPTIMIZATION := HIGHEST, \
     CFLAGS := $(CFLAGS_JDKLIB) \
         $(BUILD_LIBMLIB_CFLAGS), \
@@ -62,12 +62,12 @@
 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
 
   LIBMLIB_IMAGE_V_SRC := \
-    $(call FindSrcDirsForComponent, java.desktop, libmlib_image) \
-    $(call FindSrcDirsForComponent, java.desktop, common/awt/medialib) \
+    $(call FindSrcDirsForComponent, $(MODULE), libmlib_image) \
+    $(call FindSrcDirsForComponent, $(MODULE), common/awt/medialib) \
     #
 
   LIBMLIB_IMAGE_V_CFLAGS := -xarch=sparcvis -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
-      $(TOPDIR)/src/java.desktop/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il
+      $(TOPDIR)/src/$(MODULE)/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il
 
   ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
     LIBMLIB_IMAGE_V_CFLAGS += -DMLIB_OS64BIT
@@ -113,20 +113,20 @@
 ################################################################################
 
 LIBAWT_EXTRA_SRC := \
-    $(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
-    $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
+    $(TOPDIR)/src/$(MODULE)/share/native/common/awt/debug \
+    $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
     #
 
 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
-  LIBAWT_EXTRA_SRC += $(TOPDIR)/src/java.desktop/share/native/common/awt/medialib
+  LIBAWT_EXTRA_SRC += $(TOPDIR)/src/$(MODULE)/share/native/common/awt/medialib
 endif
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
   LIBAWT_EXTRA_SRC += \
-      $(TOPDIR)/src/java.desktop/share/native/common/awt/utility \
-      $(TOPDIR)/src/java.desktop/share/native/common/font \
-      $(TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
-      $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt/systemscale \
+      $(TOPDIR)/src/$(MODULE)/share/native/common/awt/utility \
+      $(TOPDIR)/src/$(MODULE)/share/native/common/font \
+      $(TOPDIR)/src/$(MODULE)/share/native/common/java2d/opengl \
+      $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt/systemscale \
       #
 endif
 
@@ -149,9 +149,9 @@
   LIBAWT_EXFILES += java2d/loops/MapAccelFunc.c
 else
   LIBAWT_EXCLUDES += \
-      $(TOPDIR)/src/java.desktop/unix/native/libawt/awt/medialib \
-      $(TOPDIR)/src/java.desktop/unix/native/libawt/java2d/loops \
-      $(TOPDIR)/src/java.desktop/unix/native/common/awt/medialib \
+      $(TOPDIR)/src/$(MODULE)/unix/native/libawt/awt/medialib \
+      $(TOPDIR)/src/$(MODULE)/unix/native/libawt/java2d/loops \
+      $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib \
       #
 endif
 
@@ -159,7 +159,7 @@
 
 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-sparcv9)
   LIBAWT_CFLAGS += -xarch=sparcvis -DMLIB_ADD_SUFF \
-      $(TOPDIR)/src/java.desktop/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il
+      $(TOPDIR)/src/$(MODULE)/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il
 
   LIBAWT_ASFLAGS = -P -xarch=v9a
 endif
@@ -175,7 +175,7 @@
   endif
 
   LIBAWT_RC_FLAGS ?= -I $(TOPDIR)/src/java.base/windows/native/launcher/icons
-  LIBAWT_VERSIONINFO_RESOURCE := $(TOPDIR)/src/java.desktop/windows/native/libawt/windows/awt.rc
+  LIBAWT_VERSIONINFO_RESOURCE := $(TOPDIR)/src/$(MODULE)/windows/native/libawt/windows/awt.rc
 endif
 
 ifeq ($(OPENJDK_TARGET_OS), linux)
@@ -192,6 +192,25 @@
   LIBAWT_CFLAGS += -fgcse-after-reload
 endif
 
+LIBAWT_EXTRA_HEADER_DIRS := \
+    $(call FindHeaderDirForModule, java.base) \
+    $(call FindSrcDirsForComponent, $(MODULE), libawt/java2d) \
+    $(call FindSrcDirsForComponent, $(MODULE), libawt/java2d/d3d) \
+    $(call FindSrcDirsForComponent, $(MODULE), libawt/java2d/loops) \
+    $(call FindSrcDirsForComponent, $(MODULE), libawt/java2d/opengl) \
+    $(call FindSrcDirsForComponent, $(MODULE), libawt/java2d/windows) \
+    $(call FindSrcDirsForComponent, $(MODULE), libawt/windows) \
+    $(call FindSrcDirsForComponent, $(MODULE), common/awt/medialib) \
+    $(call FindSrcDirsForComponent, $(MODULE), libmlib_image) \
+    $(call FindSrcDirsForComponent, java.base, libjava) \
+    $(call FindSrcDirsForComponent, java.base, include) \
+    $(call FindSrcDirsForComponent, $(MODULE), include) \
+    $(TOPDIR)/src/$(MODULE)/share/native/libawt/awt/image \
+    $(TOPDIR)/src/$(MODULE)/share/native/libawt/awt/image/cvutils \
+    $(TOPDIR)/src/$(MODULE)/share/native/libawt/awt/medialib \
+    $(TOPDIR)/src/$(MODULE)/share/native/libawt/java2d/pipe \
+    #
+
 $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
     NAME := awt, \
     EXTRA_SRC := $(LIBAWT_EXTRA_SRC), \
@@ -199,23 +218,7 @@
     EXCLUDE_FILES := $(LIBAWT_EXFILES), \
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
-    EXTRA_HEADER_DIRS := \
-        $(call FindHeaderDirForModule, java.base) \
-        $(call FindSrcDirsForComponent, java.desktop, libawt/java2d) \
-        $(call FindSrcDirsForComponent, java.desktop, libawt/java2d/d3d) \
-        $(call FindSrcDirsForComponent, java.desktop, libawt/java2d/loops) \
-        $(call FindSrcDirsForComponent, java.desktop, libawt/java2d/opengl) \
-        $(call FindSrcDirsForComponent, java.desktop, libawt/java2d/windows) \
-        $(call FindSrcDirsForComponent, java.desktop, libawt/windows) \
-        $(call FindSrcDirsForComponent, java.desktop, common/awt/medialib) \
-        $(call FindSrcDirsForComponent, java.desktop, libmlib_image) \
-        $(call FindSrcDirsForComponent, java.base, libjava) \
-        $(call FindSrcDirsForComponent, java.base, include) \
-        $(call FindSrcDirsForComponent, java.desktop, include) \
-        $(TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
-        $(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
-        $(TOPDIR)/src/java.desktop/share/native/libawt/awt/medialib \
-        $(TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe, \
+    EXTRA_HEADER_DIRS := $(LIBAWT_EXTRA_HEADER_DIRS), \
     DISABLED_WARNINGS_gcc := sign-compare unused-result maybe-uninitialized \
         format-nonliteral parentheses, \
     DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer, \
@@ -265,9 +268,9 @@
   ifeq ($(ENABLE_HEADLESS_ONLY), false)
 
     LIBAWT_XAWT_EXTRA_SRC := \
-        $(call FindSrcDirsForComponent, java.desktop, common/awt) \
-        $(call FindSrcDirsForComponent, java.desktop, common/java2d) \
-        $(TOPDIR)/src/java.desktop/share/native/common/font \
+        $(call FindSrcDirsForComponent, $(MODULE), common/awt) \
+        $(call FindSrcDirsForComponent, $(MODULE), common/java2d) \
+        $(TOPDIR)/src/$(MODULE)/share/native/common/font \
         #
 
     LIBAWT_XAWT_EXCLUDES := medialib
@@ -304,23 +307,25 @@
       BUILD_LIBAWT_XAWT_debug_mem.c_CFLAGS := -w
     endif
 
+    LIBAWT_XAWT_EXTRA_HEADER_DIRS := \
+        $(call FindSrcDirsForComponent, $(MODULE), libawt_xawt/awt) \
+        $(call FindSrcDirsForComponent, $(MODULE), include) \
+        $(call FindSrcDirsForComponent, $(MODULE), common/awt/systemscale) \
+        $(call FindSrcDirsForComponent, $(MODULE), common/font) \
+        $(call FindSrcDirsForComponent, $(MODULE), common/java2d/opengl) \
+        $(call FindSrcDirsForComponent, $(MODULE), common/java2d/x11) \
+        $(call FindSrcDirsForComponent, $(MODULE), libawt/java2d) \
+        $(TOPDIR)/src/$(MODULE)/share/native/libawt/awt/image \
+        $(TOPDIR)/src/$(MODULE)/share/native/libawt/awt/image/cvutils \
+        $(TOPDIR)/src/$(MODULE)/share/native/libawt/java2d/loops \
+        $(TOPDIR)/src/$(MODULE)/share/native/libawt/java2d/pipe \
+        $(TOPDIR)/src/$(MODULE)/share/native/common/awt/debug \
+    #
 
     $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_XAWT, \
         NAME := awt_xawt, \
         EXTRA_SRC := $(LIBAWT_XAWT_EXTRA_SRC), \
-        EXTRA_HEADER_DIRS := \
-            $(call FindSrcDirsForComponent, java.desktop, libawt_xawt/awt) \
-            $(call FindSrcDirsForComponent, java.desktop, include) \
-            $(call FindSrcDirsForComponent, java.desktop, common/awt/systemscale) \
-            $(call FindSrcDirsForComponent, java.desktop, common/font) \
-            $(call FindSrcDirsForComponent, java.desktop, common/java2d/opengl) \
-            $(call FindSrcDirsForComponent, java.desktop, common/java2d/x11) \
-            $(call FindSrcDirsForComponent, java.desktop, libawt/java2d) \
-            $(TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
-            $(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
-            $(TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
-            $(TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
-            $(TOPDIR)/src/java.desktop/share/native/common/awt/debug, \
+        EXTRA_HEADER_DIRS := $(LIBAWT_XAWT_EXTRA_HEADER_DIRS), \
         EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
         OPTIMIZATION := LOW, \
         CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
@@ -374,8 +379,8 @@
     CFLAGS_solaris := -xc99=no_lib, \
     CFLAGS_windows := -DCMS_IS_WINDOWS_, \
     EXTRA_HEADER_DIRS := \
-        $(call FindSrcDirsForComponent, java.desktop, common/awt/debug) \
-        $(call FindSrcDirsForComponent, java.desktop, libawt/java2d), \
+        $(call FindSrcDirsForComponent, $(MODULE), common/awt/debug) \
+        $(call FindSrcDirsForComponent, $(MODULE), libawt/java2d), \
     HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \
     DISABLED_WARNINGS_gcc := format-nonliteral type-limits misleading-indentation, \
     DISABLED_WARNINGS_clang := tautological-compare, \
@@ -438,15 +443,26 @@
 ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
 
   LIBAWT_HEADLESS_EXTRA_SRC := \
-      $(call FindSrcDirsForComponent, java.desktop, common/java2d) \
-      $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
-      $(TOPDIR)/src/java.desktop/share/native/common/font \
+      $(call FindSrcDirsForComponent, $(MODULE), common/java2d) \
+      $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
+      $(TOPDIR)/src/$(MODULE)/share/native/common/font \
       #
 
   LIBAWT_HEADLESS_EXCLUDES := medialib
   LIBAWT_HEADLESS_CFLAGS := $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) $(X_CFLAGS) \
       -DHEADLESS=true -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
 
+  LIBAWT_HEADLESS_EXTRA_HEADER_DIRS := \
+      $(call FindSrcDirsForComponent, $(MODULE), common/awt/debug) \
+      $(call FindSrcDirsForComponent, $(MODULE), common/font) \
+      $(call FindSrcDirsForComponent, $(MODULE), common/java2d/opengl) \
+      $(call FindSrcDirsForComponent, $(MODULE), libawt/java2d) \
+      $(TOPDIR)/src/$(MODULE)/share/native/libawt/awt/image \
+      $(TOPDIR)/src/$(MODULE)/share/native/libawt/awt/image/cvutils \
+      $(TOPDIR)/src/$(MODULE)/share/native/libawt/java2d/loops \
+      $(TOPDIR)/src/$(MODULE)/share/native/libawt/java2d/pipe \
+  #
+
   $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_HEADLESS, \
       NAME := awt_headless, \
       EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
@@ -454,15 +470,7 @@
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           $(LIBAWT_HEADLESS_CFLAGS), \
-      EXTRA_HEADER_DIRS := \
-            $(call FindSrcDirsForComponent, java.desktop, common/awt/debug) \
-            $(call FindSrcDirsForComponent, java.desktop, common/font) \
-            $(call FindSrcDirsForComponent, java.desktop, common/java2d/opengl) \
-            $(call FindSrcDirsForComponent, java.desktop, libawt/java2d) \
-            $(TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
-            $(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
-            $(TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
-            $(TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe, \
+      EXTRA_HEADER_DIRS := $(LIBAWT_HEADLESS_EXTRA_HEADER_DIRS), \
       DISABLED_WARNINGS_xlc := 1506-356, \
       DISABLED_WARNINGS_solstudio := E_EMPTY_TRANSLATION_UNIT, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
@@ -490,7 +498,7 @@
   LIBFREETYPE_CFLAGS := $(FREETYPE_CFLAGS)
   LIBFREETYPE_LIBS := $(FREETYPE_LIBS)
 else
-  BUILD_LIBFREETYPE_HEADER_DIRS := $(TOPDIR)/src/java.desktop/share/native/libfreetype/include
+  BUILD_LIBFREETYPE_HEADER_DIRS := $(TOPDIR)/src/$(MODULE)/share/native/libfreetype/include
   BUILD_LIBFREETYPE_CFLAGS := -DFT2_BUILD_LIBRARY $(EXPORT_ALL_SYMBOLS)
 
   # For use by libfontmanager:
@@ -576,6 +584,17 @@
   BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
 endif
 
+LIBFONTMANAGER_EXTRA_HEADER_DIRS := \
+    $(call FindSrcDirsForComponent, $(MODULE), common/awt) \
+    $(call FindSrcDirsForComponent, $(MODULE), common/font) \
+    $(call FindSrcDirsForComponent, $(MODULE), libawt/java2d) \
+    $(TOPDIR)/src/$(MODULE)/share/native/libfontmanager/harfbuzz \
+    $(TOPDIR)/src/$(MODULE)/share/native/libfontmanager/harfbuzz/hb-ucdn \
+    $(TOPDIR)/src/$(MODULE)/share/native/libawt/java2d/loops \
+    $(TOPDIR)/src/$(MODULE)/share/native/libawt/java2d/pipe \
+    #
+
+#
 # LDFLAGS clarification:
 #   Filter relevant linker flags disallowing unresolved symbols as we cannot
 #   build-time decide to which library to link against (libawt_headless or
@@ -589,14 +608,7 @@
     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
     OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
     CFLAGS_windows = -DCC_NOEX, \
-    EXTRA_HEADER_DIRS := \
-        $(call FindSrcDirsForComponent, java.desktop, common/awt) \
-        $(call FindSrcDirsForComponent, java.desktop, common/font) \
-        $(call FindSrcDirsForComponent, java.desktop, libawt/java2d) \
-        $(TOPDIR)/src/java.desktop/share/native/libfontmanager/harfbuzz \
-        $(TOPDIR)/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn \
-        $(TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
-        $(TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe, \
+    EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \
     WARNINGS_AS_ERRORS_xlc := false, \
     DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast \
         type-limits missing-field-initializers implicit-fallthrough, \
@@ -632,7 +644,7 @@
 endif
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  $(BUILD_LIBFONTMANAGER): $(call FindLib, java.desktop, awt_lwawt)
+  $(BUILD_LIBFONTMANAGER): $(call FindLib, $(MODULE), awt_lwawt)
 endif
 
 ifeq ($(FREETYPE_TO_USE), bundled)
@@ -651,6 +663,17 @@
     KERNEL32_LIB := kernel32.lib
   endif
 
+  LIBJAWT_EXTRA_HEADER_DIRS := \
+      $(call FindSrcDirsForComponent, java.base, include) \
+      $(call FindSrcDirsForComponent, $(MODULE), include) \
+      $(call FindSrcDirsForComponent, $(MODULE), common/awt/debug) \
+      $(call FindSrcDirsForComponent, $(MODULE), libawt/awt/image/cvutils) \
+      $(call FindSrcDirsForComponent, $(MODULE), libawt/java2d) \
+      $(call FindSrcDirsForComponent, $(MODULE), libawt/java2d/windows) \
+      $(call FindSrcDirsForComponent, $(MODULE), libawt/windows) \
+      $(call FindSrcDirsForComponent, java.base, libjava) \
+  #
+
   $(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
       NAME := jawt, \
       OPTIMIZATION := LOW, \
@@ -658,15 +681,7 @@
           $(LIBJAWT_CFLAGS), \
       CXXFLAGS := $(CXXFLAGS_JDKLIB) \
           $(LIBJAWT_CFLAGS), \
-      EXTRA_HEADER_DIRS := \
-          $(call FindSrcDirsForComponent, java.base, include) \
-          $(call FindSrcDirsForComponent, java.desktop, include) \
-          $(call FindSrcDirsForComponent, java.desktop, common/awt/debug) \
-          $(call FindSrcDirsForComponent, java.desktop, libawt/awt/image/cvutils) \
-          $(call FindSrcDirsForComponent, java.desktop, libawt/java2d) \
-          $(call FindSrcDirsForComponent, java.desktop, libawt/java2d/windows) \
-          $(call FindSrcDirsForComponent, java.desktop, libawt/windows) \
-          $(call FindSrcDirsForComponent, java.base, libjava),\
+      EXTRA_HEADER_DIRS := $(LIBJAWT_EXTRA_HEADER_DIRS), \
       LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
       LIBS := $(JDKLIB_LIBS) $(KERNEL32_LIB) advapi32.lib $(WIN_AWT_LIB), \
   ))
@@ -685,9 +700,8 @@
 else # OPENJDK_TARGET_OS not windows
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
-    LIBJAWT_SRC := $(TOPDIR)/src/java.desktop/macosx/native/libjawt
-  else
-    LIBJAWT_SRC := $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt
+    # libjawt on macosx do not use the unix code
+    LIBJAWT_EXCLUDE_SRC_PATTERNS := unix
   endif
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
@@ -709,14 +723,14 @@
 
   $(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
       NAME := jawt, \
-      SRC := $(LIBJAWT_SRC), \
+      EXCLUDE_SRC_PATTERNS := $(LIBJAWT_EXCLUDE_SRC_PATTERNS), \
       INCLUDE_FILES := $(JAWT_FILES), \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           $(JAWT_CFLAGS), \
       EXTRA_HEADER_DIRS := \
-          $(call FindSrcDirsForComponent, java.desktop, include) \
-          $(call FindSrcDirsForComponent, java.desktop, common/awt), \
+          $(call FindSrcDirsForComponent, $(MODULE), include) \
+          $(call FindSrcDirsForComponent, $(MODULE), common/awt), \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
@@ -745,42 +759,42 @@
 ifeq ($(ENABLE_HEADLESS_ONLY), false)
 
   LIBSPLASHSCREEN_DIRS := \
-      $(TOPDIR)/src/java.desktop/share/native/libjavajpeg \
-      $(TOPDIR)/src/java.desktop/share/native/libsplashscreen \
+      $(TOPDIR)/src/$(MODULE)/share/native/libjavajpeg \
+      $(TOPDIR)/src/$(MODULE)/share/native/libsplashscreen \
       #
 
   ifeq ($(USE_EXTERNAL_LIBGIF), true)
     GIFLIB_LIBS := -lgif
     LIBSPLASHSCREEN_EXCLUDES := giflib
   else
-    LIBSPLASHSCREEN_HEADER_DIRS += $(TOPDIR)/src/java.desktop/share/native/libsplashscreen/giflib
+    LIBSPLASHSCREEN_HEADER_DIRS += $(TOPDIR)/src/$(MODULE)/share/native/libsplashscreen/giflib
   endif
 
   ifeq ($(USE_EXTERNAL_LIBJPEG), true)
     LIBJPEG_LIBS := -ljpeg
   else
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/share/native/libjavajpeg
-    LIBSPLASHSCREEN_HEADER_DIRS += $(TOPDIR)/src/java.desktop/share/native/libjavajpeg
+    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/$(MODULE)/share/native/libjavajpeg
+    LIBSPLASHSCREEN_HEADER_DIRS += $(TOPDIR)/src/$(MODULE)/share/native/libjavajpeg
   endif
 
   ifeq ($(USE_EXTERNAL_LIBPNG), false)
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/share/native/libsplashscreen/libpng
+    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/$(MODULE)/share/native/libsplashscreen/libpng
   else
     LIBSPLASHSCREEN_EXCLUDES += libpng
   endif
 
   ifneq ($(OPENJDK_TARGET_OS), macosx)
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsplashscreen
+    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/libsplashscreen
   else
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen
+    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/$(MODULE)/macosx/native/libsplashscreen
   endif
 
   ifneq ($(filter $(OPENJDK_TARGET_OS),linux solaris aix), )
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/unix/native/common/awt/systemscale
+    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/systemscale
   endif
 
   ifeq ($(OPENJDK_TARGET_OS), windows)
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/windows/native/common/awt/systemscale
+    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/$(MODULE)/windows/native/common/awt/systemscale
   endif
   LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0
 
@@ -812,7 +826,7 @@
         # inject our own libz.h to tweak the exported ZLIB_VERNUM macro. See
         # $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen/libpng/zlib.h
         # for details.
-        LIBSPLASHSCREEN_CFLAGS += -iquote $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen/libpng
+        LIBSPLASHSCREEN_CFLAGS += -iquote $(TOPDIR)/src/$(MODULE)/macosx/native/libsplashscreen/libpng
       endif
     endif
   endif
@@ -830,6 +844,12 @@
     LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread -ldl
   endif
 
+  LIBSPLASHSCREEN_HEADER_DIRS += \
+      $(call FindSrcDirsForComponent, java.base, libjava) \
+      $(call FindSrcDirsForComponent, $(MODULE), libosxapp) \
+      $(call FindSrcDirsForComponent, java.base, include) \
+  #
+
   $(eval $(call SetupJdkLibrary, BUILD_LIBSPLASHSCREEN, \
       NAME := splashscreen, \
       SRC := $(LIBSPLASHSCREEN_DIRS), \
@@ -840,11 +860,7 @@
           $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
       CXXFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
           $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
-      EXTRA_HEADER_DIRS := \
-          $(call FindSrcDirsForComponent, java.base, libjava) \
-          $(call FindSrcDirsForComponent, java.desktop, libosxapp) \
-          $(call FindSrcDirsForComponent, java.base, include) \
-          $(LIBSPLASHSCREEN_HEADER_DIRS), \
+      EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS), \
       DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result \
           maybe-uninitialized shift-negative-value implicit-fallthrough, \
       DISABLED_WARNINGS_clang := incompatible-pointer-types, \
@@ -863,7 +879,7 @@
   TARGETS += $(BUILD_LIBSPLASHSCREEN)
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
-    $(BUILD_LIBSPLASHSCREEN): $(call FindLib, java.desktop, osxapp)
+    $(BUILD_LIBSPLASHSCREEN): $(call FindLib, $(MODULE), osxapp)
   endif
 
 endif
@@ -873,15 +889,30 @@
 ifeq ($(OPENJDK_TARGET_OS), macosx)
 
   LIBAWT_LWAWT_EXTRA_SRC := \
-      $(TOPDIR)/src/java.desktop/unix/native/common/awt \
-      $(TOPDIR)/src/java.desktop/share/native/common/font \
-      $(TOPDIR)/src/java.desktop/share/native/common/java2d \
+      $(TOPDIR)/src/$(MODULE)/unix/native/common/awt \
+      $(TOPDIR)/src/$(MODULE)/share/native/common/font \
+      $(TOPDIR)/src/$(MODULE)/share/native/common/java2d \
       #
 
   LIBAWT_LWAWT_CFLAGS := $(X_CFLAGS) $(X_LIBS)
 
   LIBAWT_LWAWT_EXFILES := fontpath.c awt_Font.c X11Color.c
-  LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/java.desktop/unix/native/common/awt/medialib
+  LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib
+
+  LIBAWT_LWAWT_EXTRA_HEADER_DIRS := \
+      $(call FindSrcDirsForComponent, $(MODULE), libawt_lwawt/java2d/opengl) \
+      $(call FindSrcDirsForComponent, $(MODULE), libawt_lwawt/awt) \
+      $(call FindSrcDirsForComponent, $(MODULE), libawt_lwawt/font) \
+      $(call FindSrcDirsForComponent, $(MODULE), include) \
+      $(call FindSrcDirsForComponent, $(MODULE), common/awt/debug) \
+      $(call FindSrcDirsForComponent, $(MODULE), common/java2d/opengl) \
+      $(call FindSrcDirsForComponent, $(MODULE), libawt/awt/image) \
+      $(call FindSrcDirsForComponent, $(MODULE), libawt/awt/image/cvutils) \
+      $(call FindSrcDirsForComponent, $(MODULE), libawt/java2d) \
+      $(call FindSrcDirsForComponent, $(MODULE), libawt/java2d/loops) \
+      $(call FindSrcDirsForComponent, $(MODULE), libawt/java2d/pipe) \
+      $(call FindSrcDirsForComponent, $(MODULE), libosxapp) \
+  #
 
   $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_LWAWT, \
       NAME := awt_lwawt, \
@@ -892,19 +923,7 @@
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           $(LIBAWT_LWAWT_CFLAGS), \
-      EXTRA_HEADER_DIRS := \
-          $(call FindSrcDirsForComponent, java.desktop, libawt_lwawt/java2d/opengl) \
-          $(call FindSrcDirsForComponent, java.desktop, libawt_lwawt/awt) \
-          $(call FindSrcDirsForComponent, java.desktop, libawt_lwawt/font) \
-          $(call FindSrcDirsForComponent, java.desktop, include) \
-          $(call FindSrcDirsForComponent, java.desktop, common/awt/debug) \
-          $(call FindSrcDirsForComponent, java.desktop, common/java2d/opengl) \
-          $(call FindSrcDirsForComponent, java.desktop, libawt/awt/image) \
-          $(call FindSrcDirsForComponent, java.desktop, libawt/awt/image/cvutils) \
-          $(call FindSrcDirsForComponent, java.desktop, libawt/java2d) \
-          $(call FindSrcDirsForComponent, java.desktop, libawt/java2d/loops) \
-          $(call FindSrcDirsForComponent, java.desktop, libawt/java2d/pipe) \
-          $(call FindSrcDirsForComponent, java.desktop, libosxapp), \
+      EXTRA_HEADER_DIRS := $(LIBAWT_LWAWT_EXTRA_HEADER_DIRS), \
       DISABLED_WARNINGS_clang := incomplete-implementation enum-conversion \
           deprecated-declarations objc-method-access bitwise-op-parentheses \
           incompatible-pointer-types parentheses-equality extra-tokens, \
@@ -931,7 +950,7 @@
 
   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)
 
-  $(BUILD_LIBAWT_LWAWT): $(call FindLib, java.desktop, osxapp)
+  $(BUILD_LIBAWT_LWAWT): $(call FindLib, $(MODULE), osxapp)
 
   $(BUILD_LIBAWT_LWAWT): $(call FindLib, java.base, java)
 
@@ -946,8 +965,8 @@
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB), \
       EXTRA_HEADER_DIRS := \
-          $(call FindSrcDirsForComponent, java.desktop, libawt_lwawt/awt) \
-          $(call FindSrcDirsForComponent, java.desktop, libosxapp), \
+          $(call FindSrcDirsForComponent, $(MODULE), libawt_lwawt/awt) \
+          $(call FindSrcDirsForComponent, $(MODULE), libosxapp), \
       DISABLED_WARNINGS_clang := deprecated-declarations, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN) \
@@ -966,7 +985,7 @@
 
   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
 
-  $(BUILD_LIBOSXUI): $(call FindLib, java.desktop, osxapp)
+  $(BUILD_LIBOSXUI): $(call FindLib, $(MODULE), osxapp)
 
   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
 
--- a/make/lib/Lib-java.desktop.gmk	Thu May 03 14:46:44 2018 +0200
+++ b/make/lib/Lib-java.desktop.gmk	Thu May 03 23:33:28 2018 +0200
@@ -118,7 +118,7 @@
       NAME := osx, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB), \
-      EXTRA_HEADER_DIRS := $(call FindSrcDirsForComponent, java.desktop, libosxapp), \
+      EXTRA_HEADER_DIRS := $(call FindSrcDirsForComponent, $MODULE, libosxapp), \
       DISABLED_WARNINGS_clang := deprecated-declarations, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.desktop \
--- a/make/lib/Lib-java.prefs.gmk	Thu May 03 14:46:44 2018 +0200
+++ b/make/lib/Lib-java.prefs.gmk	Thu May 03 23:33:28 2018 +0200
@@ -27,16 +27,14 @@
 
 ################################################################################
 
-# libprefs on macosx do not use the unix code, so we need to specify this explicitly.
+# libprefs on macosx do not use the unix code
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  LIBPREF_SRC_DIRS := $(TOPDIR)/src/java.prefs/macosx/native/libprefs
-else
-  LIBPREF_SRC_DIRS := $(TOPDIR)/src/java.prefs/$(OPENJDK_TARGET_OS_TYPE)/native/libprefs
+  LIBPREFS_EXCLUDE_SRC_PATTERNS := unix
 endif
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBPREFS, \
     NAME := prefs, \
-    SRC := $(LIBPREF_SRC_DIRS), \
+    EXCLUDE_SRC_PATTERNS := $(LIBPREFS_EXCLUDE_SRC_PATTERNS), \
     OPTIMIZATION := HIGH, \
     CFLAGS := $(CFLAGS_JDKLIB), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
--- a/make/lib/Lib-jdk.accessibility.gmk	Thu May 03 14:46:44 2018 +0200
+++ b/make/lib/Lib-jdk.accessibility.gmk	Thu May 03 23:33:28 2018 +0200
@@ -29,7 +29,7 @@
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
 
-  ROOT_SRCDIR := $(TOPDIR)/src/jdk.accessibility/windows/native
+  ROOT_SRCDIR := $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS)/native
   JAVA_AB_SRCDIR := $(ROOT_SRCDIR)/libjavaaccessbridge $(ROOT_SRCDIR)/common
   WIN_AB_SRCDIR := $(ROOT_SRCDIR)/libwindowsaccessbridge $(ROOT_SRCDIR)/common
   SYSINFO_SRCDIR := $(ROOT_SRCDIR)/libjabsysinfo
--- a/make/lib/Lib-jdk.jdi.gmk	Thu May 03 14:46:44 2018 +0200
+++ b/make/lib/Lib-jdk.jdi.gmk	Thu May 03 23:33:28 2018 +0200
@@ -34,8 +34,8 @@
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP, \
       EXTRA_HEADER_DIRS := \
-          $(TOPDIR)/src/jdk.jdwp.agent/share/native/include \
-          $(TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp/export, \
+          $(call FindSrcDirsForComponent, jdk.jdwp.agent, include) \
+          $(call FindSrcDirsForComponent, jdk.jdwp.agent, libjdwp/export), \
       LDFLAGS := $(LDFLAGS_JDKLIB), \
       LIBS := $(JDKLIB_LIBS), \
   ))
--- a/make/lib/Lib-jdk.jdwp.agent.gmk	Thu May 03 14:46:44 2018 +0200
+++ b/make/lib/Lib-jdk.jdwp.agent.gmk	Thu May 03 23:33:28 2018 +0200
@@ -33,8 +33,8 @@
     CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \
         $(LIBDT_SOCKET_CPPFLAGS), \
     EXTRA_HEADER_DIRS := \
-        $(TOPDIR)/src/jdk.jdwp.agent/share/native/include \
-        $(TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp/export, \
+        $(call FindSrcDirsForComponent, $(MODULE), include) \
+        $(call FindSrcDirsForComponent, $(MODULE), libjdwp/export), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LIBS_linux := -lpthread, \
@@ -55,8 +55,8 @@
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) -DJDWP_LOGGING, \
     EXTRA_HEADER_DIRS := \
-      $(TOPDIR)/src/jdk.jdwp.agent/share/native/include \
-      $(TOPDIR)/src/jdk.jdwp.agent/share/native/libjdwp/export, \
+      $(call FindSrcDirsForComponent, $(MODULE), include) \
+      $(call FindSrcDirsForComponent, $(MODULE), libjdwp/export), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LIBS := $(JDKLIB_LIBS), \
--- a/make/lib/LibCommon.gmk	Thu May 03 14:46:44 2018 +0200
+++ b/make/lib/LibCommon.gmk	Thu May 03 23:33:28 2018 +0200
@@ -25,9 +25,6 @@
 
 include JdkNativeCompilation.gmk
 
-# Hook to include the corresponding custom file, if present.
-$(eval $(call IncludeCustomExtension, lib/LibCommon.gmk))
-
 ################################################################################
 
 GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc