changeset 49444:bf53d82a51e5

8200357: Inline SoundLibraries.gmk into Lib-java.desktop.gmk Reviewed-by: stuefe, erikj
author ihse
date Wed, 28 Mar 2018 21:00:09 +0200
parents 879cf9f18688
children 396ea30afbd5 6abf856d4adc
files make/autoconf/flags-cflags.m4 make/autoconf/platform.m4 make/autoconf/spec.gmk.in make/lib/Lib-java.desktop.gmk make/lib/SoundLibraries.gmk
diffstat 5 files changed, 60 insertions(+), 94 deletions(-) [+]
line wrap: on
line diff
--- a/make/autoconf/flags-cflags.m4	Wed Mar 28 14:15:41 2018 -0400
+++ b/make/autoconf/flags-cflags.m4	Wed Mar 28 21:00:09 2018 +0200
@@ -394,8 +394,6 @@
     CFLAGS_OS_DEF_JVM="-D_WINDOWS -DWIN32 -D_JNI_IMPLEMENTATION_"
   fi
 
-  # Setup target OS define. Use OS target name but in upper case.
-  OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
   CFLAGS_OS_DEF_JDK="$CFLAGS_OS_DEF_JDK -D$OPENJDK_TARGET_OS_UPPERCASE"
 
   #### GLOBAL DEFINES
--- a/make/autoconf/platform.m4	Wed Mar 28 14:15:41 2018 -0400
+++ b/make/autoconf/platform.m4	Wed Mar 28 21:00:09 2018 +0200
@@ -256,9 +256,12 @@
   OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH"
   OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS"
   OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN"
+  OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+
   AC_SUBST(OPENJDK_TARGET_OS)
   AC_SUBST(OPENJDK_TARGET_OS_TYPE)
   AC_SUBST(OPENJDK_TARGET_OS_ENV)
+  AC_SUBST(OPENJDK_TARGET_OS_UPPERCASE)
   AC_SUBST(OPENJDK_TARGET_CPU)
   AC_SUBST(OPENJDK_TARGET_CPU_ARCH)
   AC_SUBST(OPENJDK_TARGET_CPU_BITS)
--- a/make/autoconf/spec.gmk.in	Wed Mar 28 14:15:41 2018 -0400
+++ b/make/autoconf/spec.gmk.in	Wed Mar 28 21:00:09 2018 +0200
@@ -65,6 +65,7 @@
 OPENJDK_TARGET_OS:=@OPENJDK_TARGET_OS@
 OPENJDK_TARGET_OS_TYPE:=@OPENJDK_TARGET_OS_TYPE@
 OPENJDK_TARGET_OS_ENV:=@OPENJDK_TARGET_OS_ENV@
+OPENJDK_TARGET_OS_UPPERCASE:=@OPENJDK_TARGET_OS_UPPERCASE@
 
 OPENJDK_TARGET_CPU:=@OPENJDK_TARGET_CPU@
 OPENJDK_TARGET_CPU_ARCH:=@OPENJDK_TARGET_CPU_ARCH@
--- a/make/lib/Lib-java.desktop.gmk	Wed Mar 28 14:15:41 2018 -0400
+++ b/make/lib/Lib-java.desktop.gmk	Wed Mar 28 21:00:09 2018 +0200
@@ -34,10 +34,64 @@
 $(eval $(call FillCacheFind, $(wildcard $(LIB_java.desktop_SRC_DIRS))))
 
 ################################################################################
-# Create the AWT/2D and sound libraries
+# Create the AWT/2D libraries
 
 include Awt2dLibraries.gmk
-include SoundLibraries.gmk
+
+################################################################################
+# Create the libjsound library
+
+ifneq ($(OPENJDK_TARGET_OS), aix)
+
+  LIBJSOUND_SRC_DIRS := $(wildcard \
+      $(TOPDIR)/src/java.desktop/share/native/libjsound \
+      $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/libjsound \
+      )
+
+  LIBJSOUND_CFLAGS := \
+      -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
+      $(LIBJAVA_HEADER_FLAGS) \
+      $(foreach dir, $(LIBJSOUND_SRC_DIRS), -I$(dir)) \
+      -DX_PLATFORM=X_$(OPENJDK_TARGET_OS_UPPERCASE) \
+      -DUSE_PORTS=TRUE \
+      -DUSE_DAUDIO=TRUE \
+      #
+
+  ifneq ($(OPENJDK_TARGET_OS), solaris)
+    LIBJSOUND_CFLAGS += \
+        -DUSE_PLATFORM_MIDI_OUT=TRUE \
+        -DUSE_PLATFORM_MIDI_IN=TRUE \
+        #
+  endif
+
+  ifeq ($(OPENJDK_TARGET_OS), macosx)
+    LIBJSOUND_TOOLCHAIN := TOOLCHAIN_LINK_CXX
+  endif
+
+  $(eval $(call SetupJdkLibrary, BUILD_LIBJSOUND, \
+      NAME := jsound, \
+      SRC := $(LIBJSOUND_SRC_DIRS), \
+      TOOLCHAIN := $(LIBJSOUND_TOOLCHAIN), \
+      OPTIMIZATION := LOW, \
+      CFLAGS := $(CFLAGS_JDKLIB) \
+          $(LIBJSOUND_CFLAGS), \
+      CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
+      MAPFILE := $(TOPDIR)/make/mapfiles/libjsound/mapfile-vers, \
+      LDFLAGS := $(LDFLAGS_JDKLIB) \
+          $(call SET_SHARED_LIBRARY_ORIGIN), \
+      LIBS_unix := -ljava -ljvm, \
+      LIBS_linux := $(ALSA_LIBS), \
+      LIBS_macosx := -framework CoreAudio -framework CoreFoundation \
+          -framework CoreServices -framework AudioUnit \
+          -framework CoreMIDI -framework AudioToolbox $(LIBCXX), \
+      LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib dsound.lib winmm.lib user32.lib ole32.lib, \
+  ))
+
+  $(BUILD_LIBJSOUND): $(call FindLib, java.base, java)
+
+  TARGETS += $(BUILD_LIBJSOUND)
+
+endif
 
 ################################################################################
 # Create the macosx specific osxapp and osx libraries
--- a/make/lib/SoundLibraries.gmk	Wed Mar 28 14:15:41 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-#
-# Copyright (c) 2011, 2018, 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
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-LIBJSOUND_SRC_DIRS := $(wildcard \
-    $(TOPDIR)/src/java.desktop/share/native/libjsound \
-    $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/libjsound \
-    )
-
-LIBJSOUND_CFLAGS := \
-    -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
-    $(LIBJAVA_HEADER_FLAGS) \
-    $(foreach dir, $(LIBJSOUND_SRC_DIRS), -I$(dir)) \
-    -DUSE_PORTS=TRUE \
-    -DUSE_DAUDIO=TRUE \
-    #
-
-ifneq ($(OPENJDK_TARGET_OS), solaris)
-  LIBJSOUND_CFLAGS += \
-      -DUSE_PLATFORM_MIDI_OUT=TRUE \
-      -DUSE_PLATFORM_MIDI_IN=TRUE \
-      #
-endif
-
-ifeq ($(OPENJDK_TARGET_OS), windows)
-  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_WINDOWS
-endif
-
-ifeq ($(OPENJDK_TARGET_OS), linux)
-  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX
-endif
-
-ifeq ($(OPENJDK_TARGET_OS), aix)
-  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_AIX
-endif
-
-ifeq ($(OPENJDK_TARGET_OS), macosx)
-  LIBJSOUND_TOOLCHAIN := TOOLCHAIN_LINK_CXX
-  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX
-endif
-
-ifeq ($(OPENJDK_TARGET_OS), solaris)
-  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_SOLARIS
-endif
-
-$(eval $(call SetupJdkLibrary, BUILD_LIBJSOUND, \
-    NAME := jsound, \
-    SRC := $(LIBJSOUND_SRC_DIRS), \
-    TOOLCHAIN := $(LIBJSOUND_TOOLCHAIN), \
-    OPTIMIZATION := LOW, \
-    CFLAGS := $(CFLAGS_JDKLIB) \
-        $(LIBJSOUND_CFLAGS), \
-    CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
-    MAPFILE := $(TOPDIR)/make/mapfiles/libjsound/mapfile-vers, \
-    LDFLAGS := $(LDFLAGS_JDKLIB) \
-        $(call SET_SHARED_LIBRARY_ORIGIN), \
-    LIBS_unix := -ljava -ljvm, \
-    LIBS_linux := $(ALSA_LIBS), \
-    LIBS_macosx := -framework CoreAudio -framework CoreFoundation \
-        -framework CoreServices -framework AudioUnit \
-        -framework CoreMIDI -framework AudioToolbox $(LIBCXX), \
-    LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib dsound.lib winmm.lib user32.lib ole32.lib, \
-))
-
-$(BUILD_LIBJSOUND): $(call FindLib, java.base, java)
-
-TARGETS += $(BUILD_LIBJSOUND)
-
-##########################################################################################