author | erikj |
Fri, 28 Aug 2015 10:13:30 +0200 | |
changeset 32408 | 97230ec16697 |
parent 32111 | 77f01a77573d |
child 33406 | 4680f7495292 |
permissions | -rw-r--r-- |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
1 |
# |
29261
ea6e20f98dfa
8072665: SoundLibraries.gmk and SoundDefs.h: remove isSigned8() dead code
serb
parents:
27799
diff
changeset
|
2 |
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
4 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. Oracle designates this |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
8 |
# particular file as subject to the "Classpath" exception as provided |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
10 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
15 |
# accompanied this code). |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
16 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
20 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
23 |
# questions. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
24 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
25 |
|
20547 | 26 |
LIBJSOUND_SRC_DIRS := \ |
25859 | 27 |
$(JDK_TOPDIR)/src/java.desktop/share/native/libjsound \ |
27736
8c9bd4be4a86
8058631: Rename posix to unix in build system to match file name changes
ihse
parents:
25859
diff
changeset
|
28 |
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjsound \ |
25859 | 29 |
# |
30 |
LIBJSOUND_CFLAGS := \ |
|
27565 | 31 |
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \ |
25859 | 32 |
$(LIBJAVA_HEADER_FLAGS) \ |
33 |
$(foreach dir, $(LIBJSOUND_SRC_DIRS), -I$(dir)) \ |
|
34 |
# |
|
20547 | 35 |
|
36 |
LIBJSOUND_SRC_FILES := Utilities.c Platform.c |
|
37 |
||
38 |
EXTRA_SOUND_JNI_LIBS := |
|
39 |
||
40 |
LIBJSOUND_MIDIFILES := \ |
|
41 |
MidiInDevice.c \ |
|
42 |
MidiInDeviceProvider.c \ |
|
43 |
MidiOutDevice.c \ |
|
44 |
MidiOutDeviceProvider.c \ |
|
45 |
PlatformMidi.c |
|
46 |
||
47 |
# files needed for ports |
|
48 |
LIBJSOUND_PORTFILES := \ |
|
49 |
PortMixerProvider.c \ |
|
50 |
PortMixer.c |
|
51 |
||
52 |
# files needed for direct audio |
|
53 |
LIBJSOUND_DAUDIOFILES := \ |
|
54 |
DirectAudioDeviceProvider.c \ |
|
55 |
DirectAudioDevice.c |
|
56 |
||
57 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
58 |
EXTRA_SOUND_JNI_LIBS += jsoundds |
|
59 |
LIBJSOUND_CFLAGS += -DX_PLATFORM=X_WINDOWS \ |
|
60 |
-DUSE_PLATFORM_MIDI_OUT=TRUE \ |
|
61 |
-DUSE_PLATFORM_MIDI_IN=TRUE \ |
|
62 |
-DUSE_PORTS=TRUE |
|
63 |
LIBJSOUND_SRC_FILES += \ |
|
64 |
PLATFORM_API_WinOS_MidiIn.cpp \ |
|
65 |
PLATFORM_API_WinOS_MidiOut.c \ |
|
66 |
PLATFORM_API_WinOS_Util.c \ |
|
67 |
PLATFORM_API_WinOS_Ports.c |
|
68 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES) |
|
69 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES) |
|
70 |
endif # OPENJDK_TARGET_OS windows |
|
71 |
||
72 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
|
73 |
EXTRA_SOUND_JNI_LIBS += jsoundalsa |
|
74 |
LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX |
|
75 |
endif # OPENJDK_TARGET_OS linux |
|
76 |
||
22593
938340719ac2
8024900: PPC64: Enable new build on AIX (jdk part)
simonis
parents:
22592
diff
changeset
|
77 |
ifeq ($(OPENJDK_TARGET_OS), aix) |
22595
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
78 |
LIBJSOUND_CFLAGS += -DX_PLATFORM=X_AIX |
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
79 |
endif # OPENJDK_TARGET_OS aix |
22593
938340719ac2
8024900: PPC64: Enable new build on AIX (jdk part)
simonis
parents:
22592
diff
changeset
|
80 |
|
20547 | 81 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
29931
64e274ed6567
8077824: Introduce DefineNativeToolchain to handle toolchain configurations
erikj
parents:
29374
diff
changeset
|
82 |
LIBJSOUND_TOOLCHAIN := TOOLCHAIN_LINK_CXX |
20547 | 83 |
LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX \ |
84 |
-DUSE_PORTS=TRUE \ |
|
85 |
-DUSE_DAUDIO=TRUE \ |
|
86 |
-DUSE_PLATFORM_MIDI_OUT=TRUE \ |
|
87 |
-DUSE_PLATFORM_MIDI_IN=TRUE |
|
25859 | 88 |
LIBJSOUND_SRC_DIRS += $(JDK_TOPDIR)/src/java.desktop/macosx/native/libjsound |
20547 | 89 |
LIBJSOUND_SRC_FILES += \ |
90 |
PLATFORM_API_MacOSX_Utils.cpp \ |
|
91 |
PLATFORM_API_MacOSX_PCM.cpp \ |
|
92 |
PLATFORM_API_MacOSX_Ports.cpp \ |
|
93 |
PLATFORM_API_MacOSX_MidiIn.c \ |
|
94 |
PLATFORM_API_MacOSX_MidiOut.c \ |
|
95 |
PLATFORM_API_MacOSX_MidiUtils.c |
|
96 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES) |
|
97 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES) |
|
98 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES) |
|
99 |
endif # OPENJDK_TARGET_OS macosx |
|
100 |
||
101 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
|
102 |
LIBJSOUND_CFLAGS += -DX_PLATFORM=X_SOLARIS \ |
|
103 |
-DUSE_PORTS=TRUE \ |
|
104 |
-DUSE_DAUDIO=TRUE |
|
105 |
LIBJSOUND_SRC_FILES += \ |
|
106 |
PLATFORM_API_SolarisOS_Utils.c \ |
|
107 |
PLATFORM_API_SolarisOS_Ports.c \ |
|
108 |
PLATFORM_API_SolarisOS_PCM.c |
|
109 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES) |
|
110 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES) |
|
111 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES) |
|
112 |
endif # OPENJDK_TARGET_OS solaris |
|
113 |
||
114 |
LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"' |
|
115 |
||
116 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \ |
|
117 |
LIBRARY := jsound, \ |
|
118 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
119 |
SRC := $(LIBJSOUND_SRC_DIRS), \ |
|
120 |
INCLUDE_FILES := $(LIBJSOUND_SRC_FILES), \ |
|
29931
64e274ed6567
8077824: Introduce DefineNativeToolchain to handle toolchain configurations
erikj
parents:
29374
diff
changeset
|
121 |
TOOLCHAIN := $(LIBJSOUND_TOOLCHAIN), \ |
20547 | 122 |
OPTIMIZATION := LOW, \ |
123 |
CFLAGS := $(CFLAGS_JDKLIB) \ |
|
124 |
$(LIBJSOUND_CFLAGS), \ |
|
125 |
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \ |
|
21805 | 126 |
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsound/mapfile-vers, \ |
20547 | 127 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
128 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
129 |
LDFLAGS_macosx := -framework CoreAudio -framework CoreFoundation \ |
|
130 |
-framework CoreServices -framework AudioUnit $(LIBCXX) \ |
|
131 |
-framework CoreMIDI -framework AudioToolbox, \ |
|
132 |
LDFLAGS_windows := $(WIN_JAVA_LIB) advapi32.lib winmm.lib, \ |
|
27736
8c9bd4be4a86
8058631: Rename posix to unix in build system to match file name changes
ihse
parents:
25859
diff
changeset
|
133 |
LDFLAGS_SUFFIX_unix := -ljava -ljvm, \ |
20547 | 134 |
LDFLAGS_SUFFIX_solaris := -lc, \ |
25859 | 135 |
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ |
20547 | 136 |
RC_FLAGS := $(RC_FLAGS) \ |
137 |
-D "JDK_FNAME=jsound.dll" \ |
|
138 |
-D "JDK_INTERNAL_NAME=jsound" \ |
|
139 |
-D "JDK_FTYPE=0x2L", \ |
|
27565 | 140 |
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjsound, \ |
20547 | 141 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
142 |
||
143 |
$(BUILD_LIBJSOUND): $(BUILD_LIBJAVA) |
|
144 |
||
27565 | 145 |
TARGETS += $(BUILD_LIBJSOUND) |
20547 | 146 |
|
147 |
########################################################################################## |
|
148 |
||
149 |
ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)), ) |
|
150 |
||
151 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA, \ |
|
152 |
LIBRARY := jsoundalsa, \ |
|
153 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
154 |
SRC := $(LIBJSOUND_SRC_DIRS), \ |
|
155 |
INCLUDE_FILES := Utilities.c $(LIBJSOUND_MIDIFILES) $(LIBJSOUND_PORTFILES) \ |
|
156 |
$(LIBJSOUND_DAUDIOFILES) \ |
|
157 |
PLATFORM_API_LinuxOS_ALSA_CommonUtils.c \ |
|
158 |
PLATFORM_API_LinuxOS_ALSA_PCM.c \ |
|
159 |
PLATFORM_API_LinuxOS_ALSA_PCMUtils.c \ |
|
160 |
PLATFORM_API_LinuxOS_ALSA_MidiIn.c \ |
|
161 |
PLATFORM_API_LinuxOS_ALSA_MidiOut.c \ |
|
162 |
PLATFORM_API_LinuxOS_ALSA_MidiUtils.c \ |
|
163 |
PLATFORM_API_LinuxOS_ALSA_Ports.c, \ |
|
164 |
OPTIMIZATION := LOW, \ |
|
165 |
CFLAGS := $(CFLAGS_JDKLIB) $(ALSA_CFLAGS) \ |
|
166 |
$(LIBJSOUND_CFLAGS) \ |
|
167 |
-DUSE_DAUDIO=TRUE \ |
|
168 |
-DUSE_PORTS=TRUE \ |
|
169 |
-DUSE_PLATFORM_MIDI_OUT=TRUE \ |
|
170 |
-DUSE_PLATFORM_MIDI_IN=TRUE, \ |
|
21805 | 171 |
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsoundalsa/mapfile-vers, \ |
20547 | 172 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
173 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
174 |
LDFLAGS_SUFFIX := $(ALSA_LIBS) -ljava -ljvm, \ |
|
27565 | 175 |
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjsoundalsa, \ |
20547 | 176 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
177 |
||
178 |
$(BUILD_LIBJSOUNDALSA): $(BUILD_LIBJAVA) |
|
179 |
||
27565 | 180 |
TARGETS += $(BUILD_LIBJSOUNDALSA) |
20547 | 181 |
|
182 |
endif |
|
183 |
||
184 |
########################################################################################## |
|
185 |
||
186 |
ifneq ($(filter jsoundds, $(EXTRA_SOUND_JNI_LIBS)), ) |
|
187 |
||
188 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDDS, \ |
|
189 |
LIBRARY := jsoundds, \ |
|
190 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
191 |
SRC := $(LIBJSOUND_SRC_DIRS), \ |
|
192 |
INCLUDE_FILES := Utilities.c $(LIBJSOUND_DAUDIOFILES) \ |
|
193 |
PLATFORM_API_WinOS_DirectSound.cpp, \ |
|
194 |
OPTIMIZATION := LOW, \ |
|
195 |
CFLAGS := $(CFLAGS_JDKLIB) \ |
|
196 |
$(LIBJSOUND_CFLAGS) \ |
|
197 |
-DUSE_DAUDIO=TRUE, \ |
|
198 |
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ |
|
199 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
200 |
LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX) dsound.lib winmm.lib user32.lib ole32.lib, \ |
|
25859 | 201 |
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ |
20547 | 202 |
RC_FLAGS := $(RC_FLAGS) \ |
203 |
-D "JDK_FNAME=jsoundds.dll" \ |
|
204 |
-D "JDK_INTERNAL_NAME=jsoundds" \ |
|
205 |
-D "JDK_FTYPE=0x2L", \ |
|
27565 | 206 |
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjsoundds, \ |
20547 | 207 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
208 |
||
209 |
$(BUILD_LIBJSOUNDDS): $(BUILD_LIBJAVA) |
|
210 |
||
27565 | 211 |
TARGETS += $(BUILD_LIBJSOUNDDS) |
20547 | 212 |
|
213 |
endif |