author | ihse |
Fri, 21 Nov 2014 16:05:11 +0100 | |
changeset 27736 | 8c9bd4be4a86 |
parent 25859 | 3317bb8137f4 |
child 27799 | 097b1d6f6894 |
child 29234 | 6d33a0d76105 |
permissions | -rw-r--r-- |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
1 |
# |
16476
e269be167fae
8001334: Remove use of JVM_* functions from java.io code
dxu
parents:
15676
diff
changeset
|
2 |
# Copyright (c) 2011, 2013, 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 := \ |
|
31 |
-I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \ |
|
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 |
||
117 |
ifeq ($(JVM_VARIANT_ZERO), true) |
|
118 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_ZERO |
|
119 |
else |
|
120 |
ifeq ($(OPENJDK_TARGET_CPU), x86) |
|
121 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_I586 |
|
122 |
endif |
|
123 |
||
124 |
ifeq ($(OPENJDK_TARGET_CPU), sparc) |
|
125 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARC |
|
126 |
endif |
|
127 |
||
128 |
ifeq ($(OPENJDK_TARGET_CPU), sparcv9) |
|
129 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARCV9 |
|
130 |
endif |
|
131 |
||
132 |
ifeq ($(OPENJDK_TARGET_CPU), x86_64) |
|
133 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_AMD64 |
|
134 |
endif |
|
135 |
||
136 |
ifeq ($(OPENJDK_TARGET_CPU), arm) |
|
137 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_ARM |
|
138 |
endif |
|
139 |
||
140 |
ifeq ($(OPENJDK_TARGET_CPU), ppc) |
|
141 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC |
|
142 |
endif |
|
22587
28bea2d65a18
8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents:
18033
diff
changeset
|
143 |
|
28bea2d65a18
8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents:
18033
diff
changeset
|
144 |
ifeq ($(OPENJDK_TARGET_CPU), ppc64) |
28bea2d65a18
8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents:
18033
diff
changeset
|
145 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC64 |
28bea2d65a18
8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents:
18033
diff
changeset
|
146 |
endif |
20547 | 147 |
endif |
148 |
||
149 |
LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"' |
|
150 |
||
151 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \ |
|
152 |
LIBRARY := jsound, \ |
|
153 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
154 |
SRC := $(LIBJSOUND_SRC_DIRS), \ |
|
155 |
INCLUDE_FILES := $(LIBJSOUND_SRC_FILES), \ |
|
156 |
LANG := $(LIBJSOUND_LANG), \ |
|
157 |
OPTIMIZATION := LOW, \ |
|
158 |
CFLAGS := $(CFLAGS_JDKLIB) \ |
|
159 |
$(LIBJSOUND_CFLAGS), \ |
|
160 |
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \ |
|
21805 | 161 |
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsound/mapfile-vers, \ |
20547 | 162 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
163 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
164 |
LDFLAGS_macosx := -framework CoreAudio -framework CoreFoundation \ |
|
165 |
-framework CoreServices -framework AudioUnit $(LIBCXX) \ |
|
166 |
-framework CoreMIDI -framework AudioToolbox, \ |
|
167 |
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
|
168 |
LDFLAGS_SUFFIX_unix := -ljava -ljvm, \ |
20547 | 169 |
LDFLAGS_SUFFIX_solaris := -lc, \ |
25859 | 170 |
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ |
20547 | 171 |
RC_FLAGS := $(RC_FLAGS) \ |
172 |
-D "JDK_FNAME=jsound.dll" \ |
|
173 |
-D "JDK_INTERNAL_NAME=jsound" \ |
|
174 |
-D "JDK_FTYPE=0x2L", \ |
|
175 |
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsound, \ |
|
176 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
|
177 |
||
178 |
$(BUILD_LIBJSOUND): $(BUILD_LIBJAVA) |
|
179 |
||
25859 | 180 |
DESKTOP_LIBRARIES += $(BUILD_LIBJSOUND) |
20547 | 181 |
|
182 |
########################################################################################## |
|
183 |
||
184 |
ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)), ) |
|
185 |
||
186 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA, \ |
|
187 |
LIBRARY := jsoundalsa, \ |
|
188 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
189 |
SRC := $(LIBJSOUND_SRC_DIRS), \ |
|
190 |
INCLUDE_FILES := Utilities.c $(LIBJSOUND_MIDIFILES) $(LIBJSOUND_PORTFILES) \ |
|
191 |
$(LIBJSOUND_DAUDIOFILES) \ |
|
192 |
PLATFORM_API_LinuxOS_ALSA_CommonUtils.c \ |
|
193 |
PLATFORM_API_LinuxOS_ALSA_PCM.c \ |
|
194 |
PLATFORM_API_LinuxOS_ALSA_PCMUtils.c \ |
|
195 |
PLATFORM_API_LinuxOS_ALSA_MidiIn.c \ |
|
196 |
PLATFORM_API_LinuxOS_ALSA_MidiOut.c \ |
|
197 |
PLATFORM_API_LinuxOS_ALSA_MidiUtils.c \ |
|
198 |
PLATFORM_API_LinuxOS_ALSA_Ports.c, \ |
|
199 |
LANG := C, \ |
|
200 |
OPTIMIZATION := LOW, \ |
|
201 |
CFLAGS := $(CFLAGS_JDKLIB) $(ALSA_CFLAGS) \ |
|
202 |
$(LIBJSOUND_CFLAGS) \ |
|
203 |
-DUSE_DAUDIO=TRUE \ |
|
204 |
-DUSE_PORTS=TRUE \ |
|
205 |
-DUSE_PLATFORM_MIDI_OUT=TRUE \ |
|
206 |
-DUSE_PLATFORM_MIDI_IN=TRUE, \ |
|
21805 | 207 |
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsoundalsa/mapfile-vers, \ |
20547 | 208 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
209 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
210 |
LDFLAGS_SUFFIX := $(ALSA_LIBS) -ljava -ljvm, \ |
|
211 |
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsoundalsa, \ |
|
212 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
|
213 |
||
214 |
$(BUILD_LIBJSOUNDALSA): $(BUILD_LIBJAVA) |
|
215 |
||
25859 | 216 |
DESKTOP_LIBRARIES += $(BUILD_LIBJSOUNDALSA) |
20547 | 217 |
|
218 |
endif |
|
219 |
||
220 |
########################################################################################## |
|
221 |
||
222 |
ifneq ($(filter jsoundds, $(EXTRA_SOUND_JNI_LIBS)), ) |
|
223 |
||
224 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDDS, \ |
|
225 |
LIBRARY := jsoundds, \ |
|
226 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
227 |
SRC := $(LIBJSOUND_SRC_DIRS), \ |
|
228 |
INCLUDE_FILES := Utilities.c $(LIBJSOUND_DAUDIOFILES) \ |
|
229 |
PLATFORM_API_WinOS_DirectSound.cpp, \ |
|
230 |
LANG := C++, \ |
|
231 |
OPTIMIZATION := LOW, \ |
|
232 |
CFLAGS := $(CFLAGS_JDKLIB) \ |
|
233 |
$(LIBJSOUND_CFLAGS) \ |
|
234 |
-DUSE_DAUDIO=TRUE, \ |
|
235 |
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ |
|
236 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
237 |
LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX) dsound.lib winmm.lib user32.lib ole32.lib, \ |
|
25859 | 238 |
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ |
20547 | 239 |
RC_FLAGS := $(RC_FLAGS) \ |
240 |
-D "JDK_FNAME=jsoundds.dll" \ |
|
241 |
-D "JDK_INTERNAL_NAME=jsoundds" \ |
|
242 |
-D "JDK_FTYPE=0x2L", \ |
|
243 |
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsoundds, \ |
|
244 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
|
245 |
||
246 |
$(BUILD_LIBJSOUNDDS): $(BUILD_LIBJAVA) |
|
247 |
||
25859 | 248 |
DESKTOP_LIBRARIES += $(BUILD_LIBJSOUNDDS) |
20547 | 249 |
|
250 |
endif |