1 #
   2 # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 LIBJSOUND_SRC_DIRS := $(wildcard \
  27     $(TOPDIR)/src/java.desktop/share/native/libjsound \
  28     $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/libjsound \
  29     )
  30 
  31 LIBJSOUND_CFLAGS := \
  32     -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
  33     $(LIBJAVA_HEADER_FLAGS) \
  34     $(foreach dir, $(LIBJSOUND_SRC_DIRS), -I$(dir)) \
  35     -DUSE_PORTS=TRUE \
  36     -DUSE_DAUDIO=TRUE \
  37     #
  38 
  39 ifneq ($(OPENJDK_TARGET_OS), solaris)
  40   LIBJSOUND_CFLAGS += \
  41       -DUSE_PLATFORM_MIDI_OUT=TRUE \
  42       -DUSE_PLATFORM_MIDI_IN=TRUE \
  43       #
  44 endif
  45 
  46 ifeq ($(OPENJDK_TARGET_OS), windows)
  47   LIBJSOUND_CFLAGS += -DX_PLATFORM=X_WINDOWS
  48 endif
  49 
  50 ifeq ($(OPENJDK_TARGET_OS), linux)
  51   LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX
  52 endif
  53 
  54 ifeq ($(OPENJDK_TARGET_OS), aix)
  55   LIBJSOUND_CFLAGS += -DX_PLATFORM=X_AIX
  56 endif
  57 
  58 ifeq ($(OPENJDK_TARGET_OS), macosx)
  59   LIBJSOUND_TOOLCHAIN := TOOLCHAIN_LINK_CXX
  60   LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX
  61 endif
  62 
  63 ifeq ($(OPENJDK_TARGET_OS), solaris)
  64   LIBJSOUND_CFLAGS += -DX_PLATFORM=X_SOLARIS
  65 endif
  66 
  67 $(eval $(call SetupJdkLibrary, BUILD_LIBJSOUND, \
  68     NAME := jsound, \
  69     SRC := $(LIBJSOUND_SRC_DIRS), \
  70     TOOLCHAIN := $(LIBJSOUND_TOOLCHAIN), \
  71     OPTIMIZATION := LOW, \
  72     CFLAGS := $(CFLAGS_JDKLIB) \
  73         $(LIBJSOUND_CFLAGS), \
  74     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
  75     LDFLAGS := $(LDFLAGS_JDKLIB) \
  76         $(call SET_SHARED_LIBRARY_ORIGIN), \
  77     LIBS_unix := -ljava -ljvm, \
  78     LIBS_linux := $(ALSA_LIBS), \
  79     LIBS_macosx := -framework CoreAudio -framework CoreFoundation \
  80         -framework CoreServices -framework AudioUnit \
  81         -framework CoreMIDI -framework AudioToolbox $(LIBCXX), \
  82     LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib dsound.lib winmm.lib user32.lib ole32.lib, \
  83 ))
  84 
  85 $(BUILD_LIBJSOUND): $(call FindLib, java.base, java)
  86 
  87 TARGETS += $(BUILD_LIBJSOUND)
  88 
  89 ##########################################################################################