author | ihse |
Mon, 09 Mar 2015 10:39:50 +0100 | |
changeset 29374 | f031a666744a |
parent 29263 | 66e30e926405 |
child 29931 | 64e274ed6567 |
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 |
LIBJSOUND_LANG := C |
|
39 |
||
40 |
EXTRA_SOUND_JNI_LIBS := |
|
41 |
||
42 |
LIBJSOUND_MIDIFILES := \ |
|
43 |
MidiInDevice.c \ |
|
44 |
MidiInDeviceProvider.c \ |
|
45 |
MidiOutDevice.c \ |
|
46 |
MidiOutDeviceProvider.c \ |
|
47 |
PlatformMidi.c |
|
48 |
||
49 |
# files needed for ports |
|
50 |
LIBJSOUND_PORTFILES := \ |
|
51 |
PortMixerProvider.c \ |
|
52 |
PortMixer.c |
|
53 |
||
54 |
# files needed for direct audio |
|
55 |
LIBJSOUND_DAUDIOFILES := \ |
|
56 |
DirectAudioDeviceProvider.c \ |
|
57 |
DirectAudioDevice.c |
|
58 |
||
59 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
60 |
EXTRA_SOUND_JNI_LIBS += jsoundds |
|
61 |
LIBJSOUND_CFLAGS += -DX_PLATFORM=X_WINDOWS \ |
|
62 |
-DUSE_PLATFORM_MIDI_OUT=TRUE \ |
|
63 |
-DUSE_PLATFORM_MIDI_IN=TRUE \ |
|
64 |
-DUSE_PORTS=TRUE |
|
65 |
LIBJSOUND_SRC_FILES += \ |
|
66 |
PLATFORM_API_WinOS_MidiIn.cpp \ |
|
67 |
PLATFORM_API_WinOS_MidiOut.c \ |
|
68 |
PLATFORM_API_WinOS_Util.c \ |
|
69 |
PLATFORM_API_WinOS_Ports.c |
|
70 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES) |
|
71 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES) |
|
72 |
endif # OPENJDK_TARGET_OS windows |
|
73 |
||
74 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
|
75 |
EXTRA_SOUND_JNI_LIBS += jsoundalsa |
|
76 |
LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX |
|
77 |
endif # OPENJDK_TARGET_OS linux |
|
78 |
||
22593
938340719ac2
8024900: PPC64: Enable new build on AIX (jdk part)
simonis
parents:
22592
diff
changeset
|
79 |
ifeq ($(OPENJDK_TARGET_OS), aix) |
22595
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
80 |
LIBJSOUND_CFLAGS += -DX_PLATFORM=X_AIX |
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
81 |
endif # OPENJDK_TARGET_OS aix |
22593
938340719ac2
8024900: PPC64: Enable new build on AIX (jdk part)
simonis
parents:
22592
diff
changeset
|
82 |
|
20547 | 83 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
84 |
LIBJSOUND_LANG := C++ |
|
85 |
LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX \ |
|
86 |
-DUSE_PORTS=TRUE \ |
|
87 |
-DUSE_DAUDIO=TRUE \ |
|
88 |
-DUSE_PLATFORM_MIDI_OUT=TRUE \ |
|
89 |
-DUSE_PLATFORM_MIDI_IN=TRUE |
|
25859 | 90 |
LIBJSOUND_SRC_DIRS += $(JDK_TOPDIR)/src/java.desktop/macosx/native/libjsound |
20547 | 91 |
LIBJSOUND_SRC_FILES += \ |
92 |
PLATFORM_API_MacOSX_Utils.cpp \ |
|
93 |
PLATFORM_API_MacOSX_PCM.cpp \ |
|
94 |
PLATFORM_API_MacOSX_Ports.cpp \ |
|
95 |
PLATFORM_API_MacOSX_MidiIn.c \ |
|
96 |
PLATFORM_API_MacOSX_MidiOut.c \ |
|
97 |
PLATFORM_API_MacOSX_MidiUtils.c |
|
98 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES) |
|
99 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES) |
|
100 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES) |
|
101 |
endif # OPENJDK_TARGET_OS macosx |
|
102 |
||
103 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
|
104 |
LIBJSOUND_CFLAGS += -DX_PLATFORM=X_SOLARIS \ |
|
105 |
-DUSE_PORTS=TRUE \ |
|
106 |
-DUSE_DAUDIO=TRUE |
|
107 |
LIBJSOUND_SRC_FILES += \ |
|
108 |
PLATFORM_API_SolarisOS_Utils.c \ |
|
109 |
PLATFORM_API_SolarisOS_Ports.c \ |
|
110 |
PLATFORM_API_SolarisOS_PCM.c |
|
111 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES) |
|
112 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES) |
|
113 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES) |
|
114 |
endif # OPENJDK_TARGET_OS solaris |
|
115 |
||
116 |
||
29233 | 117 |
ifeq ($(OPENJDK_TARGET_CPU), aarch64) |
118 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_AARCH64 |
|
119 |
endif |
|
20547 | 120 |
LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"' |
121 |
||
122 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \ |
|
123 |
LIBRARY := jsound, \ |
|
124 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
125 |
SRC := $(LIBJSOUND_SRC_DIRS), \ |
|
126 |
INCLUDE_FILES := $(LIBJSOUND_SRC_FILES), \ |
|
127 |
LANG := $(LIBJSOUND_LANG), \ |
|
128 |
OPTIMIZATION := LOW, \ |
|
129 |
CFLAGS := $(CFLAGS_JDKLIB) \ |
|
130 |
$(LIBJSOUND_CFLAGS), \ |
|
131 |
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \ |
|
29374
f031a666744a
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
29263
diff
changeset
|
132 |
DISABLED_WARNINGS_clang := implicit-function-declaration \ |
f031a666744a
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
29263
diff
changeset
|
133 |
deprecated-writable-strings, \ |
21805 | 134 |
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsound/mapfile-vers, \ |
20547 | 135 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
136 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
137 |
LDFLAGS_macosx := -framework CoreAudio -framework CoreFoundation \ |
|
138 |
-framework CoreServices -framework AudioUnit $(LIBCXX) \ |
|
139 |
-framework CoreMIDI -framework AudioToolbox, \ |
|
140 |
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
|
141 |
LDFLAGS_SUFFIX_unix := -ljava -ljvm, \ |
20547 | 142 |
LDFLAGS_SUFFIX_solaris := -lc, \ |
25859 | 143 |
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ |
20547 | 144 |
RC_FLAGS := $(RC_FLAGS) \ |
145 |
-D "JDK_FNAME=jsound.dll" \ |
|
146 |
-D "JDK_INTERNAL_NAME=jsound" \ |
|
147 |
-D "JDK_FTYPE=0x2L", \ |
|
27565 | 148 |
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjsound, \ |
20547 | 149 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
150 |
||
151 |
$(BUILD_LIBJSOUND): $(BUILD_LIBJAVA) |
|
152 |
||
27565 | 153 |
TARGETS += $(BUILD_LIBJSOUND) |
20547 | 154 |
|
155 |
########################################################################################## |
|
156 |
||
157 |
ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)), ) |
|
158 |
||
159 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA, \ |
|
160 |
LIBRARY := jsoundalsa, \ |
|
161 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
162 |
SRC := $(LIBJSOUND_SRC_DIRS), \ |
|
163 |
INCLUDE_FILES := Utilities.c $(LIBJSOUND_MIDIFILES) $(LIBJSOUND_PORTFILES) \ |
|
164 |
$(LIBJSOUND_DAUDIOFILES) \ |
|
165 |
PLATFORM_API_LinuxOS_ALSA_CommonUtils.c \ |
|
166 |
PLATFORM_API_LinuxOS_ALSA_PCM.c \ |
|
167 |
PLATFORM_API_LinuxOS_ALSA_PCMUtils.c \ |
|
168 |
PLATFORM_API_LinuxOS_ALSA_MidiIn.c \ |
|
169 |
PLATFORM_API_LinuxOS_ALSA_MidiOut.c \ |
|
170 |
PLATFORM_API_LinuxOS_ALSA_MidiUtils.c \ |
|
171 |
PLATFORM_API_LinuxOS_ALSA_Ports.c, \ |
|
172 |
LANG := C, \ |
|
173 |
OPTIMIZATION := LOW, \ |
|
174 |
CFLAGS := $(CFLAGS_JDKLIB) $(ALSA_CFLAGS) \ |
|
175 |
$(LIBJSOUND_CFLAGS) \ |
|
176 |
-DUSE_DAUDIO=TRUE \ |
|
177 |
-DUSE_PORTS=TRUE \ |
|
178 |
-DUSE_PLATFORM_MIDI_OUT=TRUE \ |
|
179 |
-DUSE_PLATFORM_MIDI_IN=TRUE, \ |
|
29374
f031a666744a
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
29263
diff
changeset
|
180 |
DISABLED_WARNINGS_gcc := parentheses, \ |
21805 | 181 |
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsoundalsa/mapfile-vers, \ |
20547 | 182 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
183 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
184 |
LDFLAGS_SUFFIX := $(ALSA_LIBS) -ljava -ljvm, \ |
|
27565 | 185 |
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjsoundalsa, \ |
20547 | 186 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
187 |
||
188 |
$(BUILD_LIBJSOUNDALSA): $(BUILD_LIBJAVA) |
|
189 |
||
27565 | 190 |
TARGETS += $(BUILD_LIBJSOUNDALSA) |
20547 | 191 |
|
192 |
endif |
|
193 |
||
194 |
########################################################################################## |
|
195 |
||
196 |
ifneq ($(filter jsoundds, $(EXTRA_SOUND_JNI_LIBS)), ) |
|
197 |
||
198 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDDS, \ |
|
199 |
LIBRARY := jsoundds, \ |
|
200 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
201 |
SRC := $(LIBJSOUND_SRC_DIRS), \ |
|
202 |
INCLUDE_FILES := Utilities.c $(LIBJSOUND_DAUDIOFILES) \ |
|
203 |
PLATFORM_API_WinOS_DirectSound.cpp, \ |
|
204 |
LANG := C++, \ |
|
205 |
OPTIMIZATION := LOW, \ |
|
206 |
CFLAGS := $(CFLAGS_JDKLIB) \ |
|
207 |
$(LIBJSOUND_CFLAGS) \ |
|
208 |
-DUSE_DAUDIO=TRUE, \ |
|
209 |
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ |
|
210 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
211 |
LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX) dsound.lib winmm.lib user32.lib ole32.lib, \ |
|
25859 | 212 |
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ |
20547 | 213 |
RC_FLAGS := $(RC_FLAGS) \ |
214 |
-D "JDK_FNAME=jsoundds.dll" \ |
|
215 |
-D "JDK_INTERNAL_NAME=jsoundds" \ |
|
216 |
-D "JDK_FTYPE=0x2L", \ |
|
27565 | 217 |
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjsoundds, \ |
20547 | 218 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
219 |
||
220 |
$(BUILD_LIBJSOUNDDS): $(BUILD_LIBJAVA) |
|
221 |
||
27565 | 222 |
TARGETS += $(BUILD_LIBJSOUNDDS) |
20547 | 223 |
|
224 |
endif |