Cleaning up SRC and EXTRA_SRC. ihse-jdk-library-branch
authorihse
Fri, 04 May 2018 01:17:28 +0200
branchihse-jdk-library-branch
changeset 56521 7bc4639175fe
parent 56520 e9a717e79a59
child 56522 76b0a9b8f417
Cleaning up SRC and EXTRA_SRC.
make/common/JdkNativeCompilation.gmk
make/lib/Awt2dLibraries.gmk
make/lib/Lib-jdk.accessibility.gmk
make/lib/Lib-jdk.pack.gmk
--- a/make/common/JdkNativeCompilation.gmk	Fri May 04 00:52:25 2018 +0200
+++ b/make/common/JdkNativeCompilation.gmk	Fri May 04 01:17:28 2018 +0200
@@ -84,10 +84,11 @@
 
   ifeq ($$($1_SRC), )
     $1_SRC := $$(call FindSrcDirsForLib, $$(MODULE), $$($1_NAME))
+  else
+    $1_SRC :=  $$(foreach dir, $$($1_SRC), $$(call ProcessDir, $$(dir)))
   endif
-  $1_PRE_SRC := $$($1_SRC)
   ifneq ($$($1_EXTRA_SRC), )
-    $1_SRC += $$($1_EXTRA_SRC)
+    $1_SRC += $$(foreach dir, $$($1_EXTRA_SRC), $$(call ProcessDir, $$(dir)))
   endif
 
   ifneq ($$($1_EXCLUDE_SRC_PATTERNS), )
@@ -111,7 +112,7 @@
   endif
 
   ifneq ($$($1_HEADERS_FROM_SRC), false)
-    $1_SRC_HEADER_FLAGS := $$(foreach dir, $$(wildcard $$($1_SRC) $$($1_EXTRA_SRC) \
+    $1_SRC_HEADER_FLAGS := $$(foreach dir, $$(wildcard $$($1_SRC) \
         $$(call GetJavaHeaderDir, $$(MODULE))), -I$$(dir))
   endif
   ifneq ($$($1_EXTRA_HEADER_DIRS), )
--- a/make/lib/Awt2dLibraries.gmk	Fri May 04 00:52:25 2018 +0200
+++ b/make/lib/Awt2dLibraries.gmk	Fri May 04 01:17:28 2018 +0200
@@ -49,7 +49,7 @@
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE, \
     NAME := mlib_image, \
-    EXTRA_SRC := $(call FindSrcDirsForComponent, $(MODULE), common/awt/medialib), \
+    EXTRA_SRC := common/awt/medialib, \
     EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \
     EXCLUDE_SRC_PATTERNS := $(BUILD_LIBMLIB_EXCLUDE_SRC_PATTERNS), \
     OPTIMIZATION := HIGHEST, \
@@ -69,9 +69,11 @@
 
 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
 
+  # libmlib_image_v is basically built from mlib_image sources, with some additions
+  # and some exclusions.
   LIBMLIB_IMAGE_V_SRC := \
-    $(call FindSrcDirsForComponent, $(MODULE), libmlib_image) \
-    $(call FindSrcDirsForComponent, $(MODULE), common/awt/medialib) \
+     libmlib_image \
+     common/awt/medialib \
     #
 
   LIBMLIB_IMAGE_V_CFLAGS := -xarch=sparcvis -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
@@ -121,7 +123,7 @@
 ################################################################################
 
 LIBAWT_EXTRA_SRC := \
-    $(TOPDIR)/src/$(MODULE)/share/native/common/awt/debug \
+    common/awt/debug \
     $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
     #
 
@@ -272,9 +274,9 @@
   ifeq ($(ENABLE_HEADLESS_ONLY), false)
 
     LIBAWT_XAWT_EXTRA_SRC := \
-        $(call FindSrcDirsForComponent, $(MODULE), common/awt) \
-        $(call FindSrcDirsForComponent, $(MODULE), common/java2d) \
-        $(TOPDIR)/src/$(MODULE)/share/native/common/font \
+        common/awt \
+        common/java2d \
+        common/font \
         #
 
     LIBAWT_XAWT_EXCLUDES := medialib
@@ -443,9 +445,9 @@
 ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
 
   LIBAWT_HEADLESS_EXTRA_SRC := \
-      $(call FindSrcDirsForComponent, $(MODULE), common/java2d) \
+      common/font \
+      common/java2d \
       $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
-      $(TOPDIR)/src/$(MODULE)/share/native/common/font \
       #
 
   LIBAWT_HEADLESS_EXCLUDES := medialib
@@ -754,44 +756,38 @@
 
 ifeq ($(ENABLE_HEADLESS_ONLY), false)
 
-  LIBSPLASHSCREEN_DIRS := \
-      $(TOPDIR)/src/$(MODULE)/share/native/libjavajpeg \
-      $(TOPDIR)/src/$(MODULE)/share/native/libsplashscreen \
+  LIBSPLASHSCREEN_EXTRA_SRC := \
+      common/awt/systemscale \
       #
 
-  ifeq ($(USE_EXTERNAL_LIBGIF), true)
-    GIFLIB_LIBS := -lgif
+  ifeq ($(USE_EXTERNAL_LIBGIF), false)
+    LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/giflib
+  else
     LIBSPLASHSCREEN_EXCLUDES := giflib
-  else
-    LIBSPLASHSCREEN_HEADER_DIRS += $(TOPDIR)/src/$(MODULE)/share/native/libsplashscreen/giflib
+    GIFLIB_LIBS := -lgif
   endif
 
-  ifeq ($(USE_EXTERNAL_LIBJPEG), true)
-    LIBJPEG_LIBS := -ljpeg
+  ifeq ($(USE_EXTERNAL_LIBJPEG), false)
+    LIBSPLASHSCREEN_EXTRA_SRC += libjavajpeg
   else
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/$(MODULE)/share/native/libjavajpeg
-    LIBSPLASHSCREEN_HEADER_DIRS += $(TOPDIR)/src/$(MODULE)/share/native/libjavajpeg
+    LIBJPEG_LIBS := -ljpeg
   endif
 
   ifeq ($(USE_EXTERNAL_LIBPNG), false)
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/$(MODULE)/share/native/libsplashscreen/libpng
+    LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/libpng
   else
     LIBSPLASHSCREEN_EXCLUDES += libpng
   endif
 
-  ifneq ($(OPENJDK_TARGET_OS), macosx)
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/libsplashscreen
-  else
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/$(MODULE)/macosx/native/libsplashscreen
+  ifeq ($(USE_EXTERNAL_LIBZ), false)
+    LIBSPLASHSCREEN_EXTRA_SRC += java.base:libzip/zlib
   endif
 
-  ifneq ($(filter $(OPENJDK_TARGET_OS),linux solaris aix), )
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/systemscale
+  ifeq ($(OPENJDK_TARGET_OS), macosx)
+    # libsplashscreen on macosx do not use the unix code
+    LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS := unix
   endif
 
-  ifeq ($(OPENJDK_TARGET_OS), windows)
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/$(MODULE)/windows/native/common/awt/systemscale
-  endif
   LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
@@ -811,11 +807,7 @@
     LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
   endif
 
-  LIBSPLASHSCREEN_LIBS :=
-
-  ifeq ($(USE_EXTERNAL_LIBZ), false)
-    LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.base/share/native/libzip/zlib
-  else
+  ifeq ($(USE_EXTERNAL_LIBZ), true)
     ifeq ($(OPENJDK_TARGET_OS), macosx)
       ifeq ($(USE_EXTERNAL_LIBPNG), false)
         # When building our own libpng and using an external libz, we need to
@@ -827,6 +819,8 @@
     endif
   endif
 
+  LIBSPLASHSCREEN_LIBS :=
+
   ifeq ($(OPENJDK_TARGET_OS), macosx)
     LIBSPLASHSCREEN_LIBS += \
         $(LIBM) -lpthread -liconv -losxapp \
@@ -848,7 +842,8 @@
 
   $(eval $(call SetupJdkLibrary, BUILD_LIBSPLASHSCREEN, \
       NAME := splashscreen, \
-      SRC := $(LIBSPLASHSCREEN_DIRS), \
+      EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC), \
+      EXCLUDE_SRC_PATTERNS := $(LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS), \
       EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
       EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
       OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.accessibility.gmk	Fri May 04 00:52:25 2018 +0200
+++ b/make/lib/Lib-jdk.accessibility.gmk	Fri May 04 01:17:28 2018 +0200
@@ -35,8 +35,8 @@
 
     $(call SetupJdkLibrary, BUILD_JAVAACCESSBRIDGE$1, \
         NAME := javaaccessbridge$1, \
-        SRC := $(call FindSrcDirsForComponent, $(MODULE), libjavaaccessbridge), \
-        EXTRA_SRC := $(call FindSrcDirsForComponent, $(MODULE), common), \
+        SRC := libjavaaccessbridge, \
+        EXTRA_SRC := common, \
         OPTIMIZATION := LOW, \
         DISABLED_WARNINGS_microsoft := 4311 4302 4312, \
         CFLAGS := $(CFLAGS_JDKLIB) \
@@ -63,8 +63,8 @@
     # Parameter 2 ACCESSBRIDGE_ARCH_ suffix
     $(call SetupJdkLibrary, BUILD_WINDOWSACCESSBRIDGE$1, \
         NAME := windowsaccessbridge$1, \
-        SRC := $(call FindSrcDirsForComponent, $(MODULE), libwindowsaccessbridge), \
-        EXTRA_SRC := $(call FindSrcDirsForComponent, $(MODULE), common), \
+        SRC := libwindowsaccessbridge, \
+        EXTRA_SRC := common, \
         OPTIMIZATION := LOW, \
         DISABLED_WARNINGS_microsoft := 4311 4302 4312, \
         CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT \
--- a/make/lib/Lib-jdk.pack.gmk	Fri May 04 00:52:25 2018 +0200
+++ b/make/lib/Lib-jdk.pack.gmk	Fri May 04 01:17:28 2018 +0200
@@ -29,7 +29,7 @@
 
 $(eval $(call SetupJdkLibrary, BUILD_LIBUNPACK, \
     NAME := unpack, \
-    EXTRA_SRC := $(call FindSrcDirsForComponent, jdk.pack, common-unpack), \
+    EXTRA_SRC := common-unpack, \
     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
     OPTIMIZATION := LOW, \
     CXXFLAGS := $(CXXFLAGS_JDKLIB) \