annotate make/lib/SoundLibraries.gmk @ 9190:6210b60a16ea

Merge
author kvn
date Thu, 05 Dec 2013 15:10:36 -0800
parents makefiles/lib/SoundLibraries.gmk@48e71aa633bd makefiles/lib/SoundLibraries.gmk@4be14673b9bf
children ec7671728ca5
rev   line source
ohair@5221 1 #
dxu@6785 2 # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
ohair@5221 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@5221 4 #
ohair@5221 5 # This code is free software; you can redistribute it and/or modify it
ohair@5221 6 # under the terms of the GNU General Public License version 2 only, as
ohair@5221 7 # published by the Free Software Foundation. Oracle designates this
ohair@5221 8 # particular file as subject to the "Classpath" exception as provided
ohair@5221 9 # by Oracle in the LICENSE file that accompanied this code.
ohair@5221 10 #
ohair@5221 11 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@5221 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@5221 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@5221 14 # version 2 for more details (a copy is included in the LICENSE file that
ohair@5221 15 # accompanied this code).
ohair@5221 16 #
ohair@5221 17 # You should have received a copy of the GNU General Public License version
ohair@5221 18 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@5221 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@5221 20 #
ohair@5221 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@5221 22 # or visit www.oracle.com if you need additional information or have any
ohair@5221 23 # questions.
ohair@5221 24 #
ohair@5221 25
ihse@8330 26 LIBJSOUND_SRC_DIRS := \
ihse@8330 27 $(JDK_TOPDIR)/src/share/native/com/sun/media/sound \
ihse@8330 28 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/media/sound
ihse@8330 29
ihse@8330 30 LIBJSOUND_SRC_FILES := Utilities.c Platform.c
ihse@8330 31
ihse@8330 32 LIBJSOUND_LANG := C
ihse@8330 33 LIBJSOUND_CFLAGS := $(foreach dir, $(LIBJSOUND_SRC_DIRS), -I$(dir))
ihse@8330 34
ihse@8330 35 EXTRA_SOUND_JNI_LIBS :=
ihse@8330 36
ihse@8330 37 LIBJSOUND_MIDIFILES := \
ihse@8330 38 MidiInDevice.c \
ihse@8330 39 MidiInDeviceProvider.c \
ihse@8330 40 MidiOutDevice.c \
ihse@8330 41 MidiOutDeviceProvider.c \
ihse@8330 42 PlatformMidi.c
ihse@8330 43
ihse@8330 44 # files needed for ports
ihse@8330 45 LIBJSOUND_PORTFILES := \
ihse@8330 46 PortMixerProvider.c \
ihse@8330 47 PortMixer.c
ihse@8330 48
ihse@8330 49 # files needed for direct audio
ihse@8330 50 LIBJSOUND_DAUDIOFILES := \
ihse@8330 51 DirectAudioDeviceProvider.c \
ihse@8330 52 DirectAudioDevice.c
ihse@8330 53
ihse@8330 54 ifeq ($(OPENJDK_TARGET_OS), windows)
ihse@8330 55 EXTRA_SOUND_JNI_LIBS += jsoundds
ihse@8330 56 LIBJSOUND_CFLAGS += -DX_PLATFORM=X_WINDOWS \
ihse@8330 57 -DUSE_PLATFORM_MIDI_OUT=TRUE \
ihse@8330 58 -DUSE_PLATFORM_MIDI_IN=TRUE \
ihse@8330 59 -DUSE_PORTS=TRUE
ihse@8330 60 LIBJSOUND_SRC_FILES += \
ihse@8330 61 PLATFORM_API_WinOS_MidiIn.cpp \
ihse@8330 62 PLATFORM_API_WinOS_MidiOut.c \
ihse@8330 63 PLATFORM_API_WinOS_Util.c \
ihse@8330 64 PLATFORM_API_WinOS_Ports.c
ihse@8330 65 LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
ihse@8330 66 LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
ihse@8330 67 endif # OPENJDK_TARGET_OS windows
ihse@8330 68
ihse@8330 69 ifeq ($(OPENJDK_TARGET_OS), linux)
ihse@8330 70 EXTRA_SOUND_JNI_LIBS += jsoundalsa
ihse@8330 71 LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX
ihse@8330 72 endif # OPENJDK_TARGET_OS linux
ihse@8330 73
simonis@9185 74 ifeq ($(OPENJDK_TARGET_OS), aix)
simonis@9187 75 LIBJSOUND_CFLAGS += -DX_PLATFORM=X_AIX
simonis@9187 76 endif # OPENJDK_TARGET_OS aix
simonis@9185 77
ihse@8330 78 ifeq ($(OPENJDK_TARGET_OS), macosx)
ihse@8330 79 LIBJSOUND_LANG := C++
ihse@8330 80 LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX \
ihse@8330 81 -DUSE_PORTS=TRUE \
ihse@8330 82 -DUSE_DAUDIO=TRUE \
ihse@8330 83 -DUSE_PLATFORM_MIDI_OUT=TRUE \
ihse@8330 84 -DUSE_PLATFORM_MIDI_IN=TRUE
ihse@8330 85 LIBJSOUND_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/com/sun/media/sound
ihse@8330 86 LIBJSOUND_SRC_FILES += \
ihse@8330 87 PLATFORM_API_MacOSX_Utils.cpp \
ihse@8330 88 PLATFORM_API_MacOSX_PCM.cpp \
ihse@8330 89 PLATFORM_API_MacOSX_Ports.cpp \
ihse@8330 90 PLATFORM_API_MacOSX_MidiIn.c \
ihse@8330 91 PLATFORM_API_MacOSX_MidiOut.c \
ihse@8330 92 PLATFORM_API_MacOSX_MidiUtils.c
ihse@8330 93 LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
ihse@8330 94 LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
ihse@8330 95 LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
ihse@8330 96 endif # OPENJDK_TARGET_OS macosx
ihse@8330 97
ihse@8330 98 ifeq ($(OPENJDK_TARGET_OS), solaris)
ihse@8330 99 LIBJSOUND_CFLAGS += -DX_PLATFORM=X_SOLARIS \
ihse@8330 100 -DUSE_PORTS=TRUE \
ihse@8330 101 -DUSE_DAUDIO=TRUE
ihse@8330 102 LIBJSOUND_SRC_FILES += \
ihse@8330 103 PLATFORM_API_SolarisOS_Utils.c \
ihse@8330 104 PLATFORM_API_SolarisOS_Ports.c \
ihse@8330 105 PLATFORM_API_SolarisOS_PCM.c
ihse@8330 106 LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
ihse@8330 107 LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
ihse@8330 108 LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
ihse@8330 109 endif # OPENJDK_TARGET_OS solaris
ihse@8330 110
ihse@8330 111
ihse@8330 112 ifeq ($(JVM_VARIANT_ZERO), true)
ihse@8330 113 LIBJSOUND_CFLAGS += -DX_ARCH=X_ZERO
ihse@8330 114 else
ihse@8330 115 ifeq ($(OPENJDK_TARGET_CPU), x86)
ihse@8330 116 LIBJSOUND_CFLAGS += -DX_ARCH=X_I586
ihse@8330 117 endif
ihse@8330 118
ihse@8330 119 ifeq ($(OPENJDK_TARGET_CPU), sparc)
ihse@8330 120 LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARC
ihse@8330 121 endif
ihse@8330 122
ihse@8330 123 ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
ihse@8330 124 LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARCV9
ihse@8330 125 endif
ihse@8330 126
ihse@8330 127 ifeq ($(OPENJDK_TARGET_CPU), x86_64)
ihse@8330 128 LIBJSOUND_CFLAGS += -DX_ARCH=X_AMD64
ihse@8330 129 endif
ihse@8330 130
ihse@8330 131 ifeq ($(OPENJDK_TARGET_CPU), arm)
ihse@8330 132 LIBJSOUND_CFLAGS += -DX_ARCH=X_ARM
ihse@8330 133 endif
ihse@8330 134
ihse@8330 135 ifeq ($(OPENJDK_TARGET_CPU), ppc)
ihse@8330 136 LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC
ihse@8330 137 endif
simonis@9179 138
simonis@9179 139 ifeq ($(OPENJDK_TARGET_CPU), ppc64)
simonis@9179 140 LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC64
simonis@9179 141 endif
ihse@8330 142 endif
ihse@8330 143
ihse@8330 144 LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
ihse@8330 145
ihse@8330 146 $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \
ihse@8330 147 LIBRARY := jsound, \
ihse@8330 148 OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
ihse@8330 149 SRC := $(LIBJSOUND_SRC_DIRS), \
ihse@8330 150 INCLUDE_FILES := $(LIBJSOUND_SRC_FILES), \
ihse@8330 151 LANG := $(LIBJSOUND_LANG), \
ihse@8330 152 OPTIMIZATION := LOW, \
ihse@8330 153 CFLAGS := $(CFLAGS_JDKLIB) \
ihse@8330 154 $(LIBJSOUND_CFLAGS), \
ihse@8330 155 CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
ihse@8845 156 MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsound/mapfile-vers, \
ihse@8330 157 LDFLAGS := $(LDFLAGS_JDKLIB) \
ihse@8330 158 $(call SET_SHARED_LIBRARY_ORIGIN), \
ihse@8330 159 LDFLAGS_macosx := -framework CoreAudio -framework CoreFoundation \
ihse@8330 160 -framework CoreServices -framework AudioUnit $(LIBCXX) \
ihse@8330 161 -framework CoreMIDI -framework AudioToolbox, \
ihse@8330 162 LDFLAGS_windows := $(WIN_JAVA_LIB) advapi32.lib winmm.lib, \
ihse@8330 163 LDFLAGS_SUFFIX_posix := -ljava -ljvm, \
ihse@8330 164 LDFLAGS_SUFFIX_solaris := -lc, \
ihse@8330 165 VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
ihse@8330 166 RC_FLAGS := $(RC_FLAGS) \
ihse@8330 167 -D "JDK_FNAME=jsound.dll" \
ihse@8330 168 -D "JDK_INTERNAL_NAME=jsound" \
ihse@8330 169 -D "JDK_FTYPE=0x2L", \
ihse@8330 170 OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsound, \
ihse@8330 171 DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
ihse@8330 172
ihse@8330 173 $(BUILD_LIBJSOUND): $(BUILD_LIBJAVA)
ihse@8330 174
ihse@8330 175 BUILD_LIBRARIES += $(BUILD_LIBJSOUND)
ihse@8330 176
ihse@8330 177 ##########################################################################################
ihse@8330 178
ihse@8330 179 ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)), )
ihse@8330 180
ihse@8330 181 $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA, \
ihse@8330 182 LIBRARY := jsoundalsa, \
ihse@8330 183 OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
ihse@8330 184 SRC := $(LIBJSOUND_SRC_DIRS), \
ihse@8330 185 INCLUDE_FILES := Utilities.c $(LIBJSOUND_MIDIFILES) $(LIBJSOUND_PORTFILES) \
ihse@8330 186 $(LIBJSOUND_DAUDIOFILES) \
ihse@8330 187 PLATFORM_API_LinuxOS_ALSA_CommonUtils.c \
ihse@8330 188 PLATFORM_API_LinuxOS_ALSA_PCM.c \
ihse@8330 189 PLATFORM_API_LinuxOS_ALSA_PCMUtils.c \
ihse@8330 190 PLATFORM_API_LinuxOS_ALSA_MidiIn.c \
ihse@8330 191 PLATFORM_API_LinuxOS_ALSA_MidiOut.c \
ihse@8330 192 PLATFORM_API_LinuxOS_ALSA_MidiUtils.c \
ihse@8330 193 PLATFORM_API_LinuxOS_ALSA_Ports.c, \
ihse@8330 194 LANG := C, \
ihse@8330 195 OPTIMIZATION := LOW, \
ihse@8330 196 CFLAGS := $(CFLAGS_JDKLIB) $(ALSA_CFLAGS) \
ihse@8330 197 $(LIBJSOUND_CFLAGS) \
ihse@8330 198 -DUSE_DAUDIO=TRUE \
ihse@8330 199 -DUSE_PORTS=TRUE \
ihse@8330 200 -DUSE_PLATFORM_MIDI_OUT=TRUE \
ihse@8330 201 -DUSE_PLATFORM_MIDI_IN=TRUE, \
ihse@8845 202 MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsoundalsa/mapfile-vers, \
ihse@8330 203 LDFLAGS := $(LDFLAGS_JDKLIB) \
ihse@8330 204 $(call SET_SHARED_LIBRARY_ORIGIN), \
ihse@8330 205 LDFLAGS_SUFFIX := $(ALSA_LIBS) -ljava -ljvm, \
ihse@8330 206 OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsoundalsa, \
ihse@8330 207 DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
ihse@8330 208
ihse@8330 209 $(BUILD_LIBJSOUNDALSA): $(BUILD_LIBJAVA)
ihse@8330 210
ihse@8330 211 BUILD_LIBRARIES += $(BUILD_LIBJSOUNDALSA)
ihse@8330 212
ihse@8330 213 endif
ihse@8330 214
ihse@8330 215 ##########################################################################################
ihse@8330 216
ihse@8330 217 ifneq ($(filter jsoundds, $(EXTRA_SOUND_JNI_LIBS)), )
ihse@8330 218
ihse@8330 219 $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDDS, \
ihse@8330 220 LIBRARY := jsoundds, \
ihse@8330 221 OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
ihse@8330 222 SRC := $(LIBJSOUND_SRC_DIRS), \
ihse@8330 223 INCLUDE_FILES := Utilities.c $(LIBJSOUND_DAUDIOFILES) \
ihse@8330 224 PLATFORM_API_WinOS_DirectSound.cpp, \
ihse@8330 225 LANG := C++, \
ihse@8330 226 OPTIMIZATION := LOW, \
ihse@8330 227 CFLAGS := $(CFLAGS_JDKLIB) \
ihse@8330 228 $(LIBJSOUND_CFLAGS) \
ihse@8330 229 -DUSE_DAUDIO=TRUE, \
ihse@8330 230 LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
ihse@8330 231 $(call SET_SHARED_LIBRARY_ORIGIN), \
ihse@8330 232 LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX) dsound.lib winmm.lib user32.lib ole32.lib, \
ihse@8330 233 VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
ihse@8330 234 RC_FLAGS := $(RC_FLAGS) \
ihse@8330 235 -D "JDK_FNAME=jsoundds.dll" \
ihse@8330 236 -D "JDK_INTERNAL_NAME=jsoundds" \
ihse@8330 237 -D "JDK_FTYPE=0x2L", \
ihse@8330 238 OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsoundds, \
ihse@8330 239 DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
ihse@8330 240
ihse@8330 241 $(BUILD_LIBJSOUNDDS): $(BUILD_LIBJAVA)
ihse@8330 242
ihse@8330 243 BUILD_LIBRARIES += $(BUILD_LIBJSOUNDDS)
ihse@8330 244
ihse@8330 245 endif