author | katleman |
Thu, 17 Apr 2014 10:14:07 -0700 | |
changeset 23965 | 987510c49ac7 |
parent 22607 | ba232b417248 |
child 25859 | 3317bb8137f4 |
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 := \ |
27 |
$(JDK_TOPDIR)/src/share/native/com/sun/media/sound \ |
|
28 |
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/media/sound |
|
29 |
||
30 |
LIBJSOUND_SRC_FILES := Utilities.c Platform.c |
|
31 |
||
32 |
LIBJSOUND_LANG := C |
|
33 |
LIBJSOUND_CFLAGS := $(foreach dir, $(LIBJSOUND_SRC_DIRS), -I$(dir)) |
|
34 |
||
35 |
EXTRA_SOUND_JNI_LIBS := |
|
36 |
||
37 |
LIBJSOUND_MIDIFILES := \ |
|
38 |
MidiInDevice.c \ |
|
39 |
MidiInDeviceProvider.c \ |
|
40 |
MidiOutDevice.c \ |
|
41 |
MidiOutDeviceProvider.c \ |
|
42 |
PlatformMidi.c |
|
43 |
||
44 |
# files needed for ports |
|
45 |
LIBJSOUND_PORTFILES := \ |
|
46 |
PortMixerProvider.c \ |
|
47 |
PortMixer.c |
|
48 |
||
49 |
# files needed for direct audio |
|
50 |
LIBJSOUND_DAUDIOFILES := \ |
|
51 |
DirectAudioDeviceProvider.c \ |
|
52 |
DirectAudioDevice.c |
|
53 |
||
54 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
55 |
EXTRA_SOUND_JNI_LIBS += jsoundds |
|
56 |
LIBJSOUND_CFLAGS += -DX_PLATFORM=X_WINDOWS \ |
|
57 |
-DUSE_PLATFORM_MIDI_OUT=TRUE \ |
|
58 |
-DUSE_PLATFORM_MIDI_IN=TRUE \ |
|
59 |
-DUSE_PORTS=TRUE |
|
60 |
LIBJSOUND_SRC_FILES += \ |
|
61 |
PLATFORM_API_WinOS_MidiIn.cpp \ |
|
62 |
PLATFORM_API_WinOS_MidiOut.c \ |
|
63 |
PLATFORM_API_WinOS_Util.c \ |
|
64 |
PLATFORM_API_WinOS_Ports.c |
|
65 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES) |
|
66 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES) |
|
67 |
endif # OPENJDK_TARGET_OS windows |
|
68 |
||
69 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
|
70 |
EXTRA_SOUND_JNI_LIBS += jsoundalsa |
|
71 |
LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX |
|
72 |
endif # OPENJDK_TARGET_OS linux |
|
73 |
||
22593
938340719ac2
8024900: PPC64: Enable new build on AIX (jdk part)
simonis
parents:
22592
diff
changeset
|
74 |
ifeq ($(OPENJDK_TARGET_OS), aix) |
22595
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
75 |
LIBJSOUND_CFLAGS += -DX_PLATFORM=X_AIX |
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
76 |
endif # OPENJDK_TARGET_OS aix |
22593
938340719ac2
8024900: PPC64: Enable new build on AIX (jdk part)
simonis
parents:
22592
diff
changeset
|
77 |
|
20547 | 78 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
79 |
LIBJSOUND_LANG := C++ |
|
80 |
LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX \ |
|
81 |
-DUSE_PORTS=TRUE \ |
|
82 |
-DUSE_DAUDIO=TRUE \ |
|
83 |
-DUSE_PLATFORM_MIDI_OUT=TRUE \ |
|
84 |
-DUSE_PLATFORM_MIDI_IN=TRUE |
|
85 |
LIBJSOUND_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/com/sun/media/sound |
|
86 |
LIBJSOUND_SRC_FILES += \ |
|
87 |
PLATFORM_API_MacOSX_Utils.cpp \ |
|
88 |
PLATFORM_API_MacOSX_PCM.cpp \ |
|
89 |
PLATFORM_API_MacOSX_Ports.cpp \ |
|
90 |
PLATFORM_API_MacOSX_MidiIn.c \ |
|
91 |
PLATFORM_API_MacOSX_MidiOut.c \ |
|
92 |
PLATFORM_API_MacOSX_MidiUtils.c |
|
93 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES) |
|
94 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES) |
|
95 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES) |
|
96 |
endif # OPENJDK_TARGET_OS macosx |
|
97 |
||
98 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
|
99 |
LIBJSOUND_CFLAGS += -DX_PLATFORM=X_SOLARIS \ |
|
100 |
-DUSE_PORTS=TRUE \ |
|
101 |
-DUSE_DAUDIO=TRUE |
|
102 |
LIBJSOUND_SRC_FILES += \ |
|
103 |
PLATFORM_API_SolarisOS_Utils.c \ |
|
104 |
PLATFORM_API_SolarisOS_Ports.c \ |
|
105 |
PLATFORM_API_SolarisOS_PCM.c |
|
106 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES) |
|
107 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES) |
|
108 |
LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES) |
|
109 |
endif # OPENJDK_TARGET_OS solaris |
|
110 |
||
111 |
||
112 |
ifeq ($(JVM_VARIANT_ZERO), true) |
|
113 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_ZERO |
|
114 |
else |
|
115 |
ifeq ($(OPENJDK_TARGET_CPU), x86) |
|
116 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_I586 |
|
117 |
endif |
|
118 |
||
119 |
ifeq ($(OPENJDK_TARGET_CPU), sparc) |
|
120 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARC |
|
121 |
endif |
|
122 |
||
123 |
ifeq ($(OPENJDK_TARGET_CPU), sparcv9) |
|
124 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARCV9 |
|
125 |
endif |
|
126 |
||
127 |
ifeq ($(OPENJDK_TARGET_CPU), x86_64) |
|
128 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_AMD64 |
|
129 |
endif |
|
130 |
||
131 |
ifeq ($(OPENJDK_TARGET_CPU), arm) |
|
132 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_ARM |
|
133 |
endif |
|
134 |
||
135 |
ifeq ($(OPENJDK_TARGET_CPU), ppc) |
|
136 |
LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC |
|
137 |
endif |
|
22587
28bea2d65a18
8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents:
18033
diff
changeset
|
138 |
|
28bea2d65a18
8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents:
18033
diff
changeset
|
139 |
ifeq ($(OPENJDK_TARGET_CPU), ppc64) |
28bea2d65a18
8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents:
18033
diff
changeset
|
140 |
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
|
141 |
endif |
20547 | 142 |
endif |
143 |
||
144 |
LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"' |
|
145 |
||
146 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \ |
|
147 |
LIBRARY := jsound, \ |
|
148 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
149 |
SRC := $(LIBJSOUND_SRC_DIRS), \ |
|
150 |
INCLUDE_FILES := $(LIBJSOUND_SRC_FILES), \ |
|
151 |
LANG := $(LIBJSOUND_LANG), \ |
|
152 |
OPTIMIZATION := LOW, \ |
|
153 |
CFLAGS := $(CFLAGS_JDKLIB) \ |
|
154 |
$(LIBJSOUND_CFLAGS), \ |
|
155 |
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \ |
|
21805 | 156 |
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsound/mapfile-vers, \ |
20547 | 157 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
158 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
159 |
LDFLAGS_macosx := -framework CoreAudio -framework CoreFoundation \ |
|
160 |
-framework CoreServices -framework AudioUnit $(LIBCXX) \ |
|
161 |
-framework CoreMIDI -framework AudioToolbox, \ |
|
162 |
LDFLAGS_windows := $(WIN_JAVA_LIB) advapi32.lib winmm.lib, \ |
|
163 |
LDFLAGS_SUFFIX_posix := -ljava -ljvm, \ |
|
164 |
LDFLAGS_SUFFIX_solaris := -lc, \ |
|
165 |
VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ |
|
166 |
RC_FLAGS := $(RC_FLAGS) \ |
|
167 |
-D "JDK_FNAME=jsound.dll" \ |
|
168 |
-D "JDK_INTERNAL_NAME=jsound" \ |
|
169 |
-D "JDK_FTYPE=0x2L", \ |
|
170 |
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsound, \ |
|
171 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
|
172 |
||
173 |
$(BUILD_LIBJSOUND): $(BUILD_LIBJAVA) |
|
174 |
||
175 |
BUILD_LIBRARIES += $(BUILD_LIBJSOUND) |
|
176 |
||
177 |
########################################################################################## |
|
178 |
||
179 |
ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)), ) |
|
180 |
||
181 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA, \ |
|
182 |
LIBRARY := jsoundalsa, \ |
|
183 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
184 |
SRC := $(LIBJSOUND_SRC_DIRS), \ |
|
185 |
INCLUDE_FILES := Utilities.c $(LIBJSOUND_MIDIFILES) $(LIBJSOUND_PORTFILES) \ |
|
186 |
$(LIBJSOUND_DAUDIOFILES) \ |
|
187 |
PLATFORM_API_LinuxOS_ALSA_CommonUtils.c \ |
|
188 |
PLATFORM_API_LinuxOS_ALSA_PCM.c \ |
|
189 |
PLATFORM_API_LinuxOS_ALSA_PCMUtils.c \ |
|
190 |
PLATFORM_API_LinuxOS_ALSA_MidiIn.c \ |
|
191 |
PLATFORM_API_LinuxOS_ALSA_MidiOut.c \ |
|
192 |
PLATFORM_API_LinuxOS_ALSA_MidiUtils.c \ |
|
193 |
PLATFORM_API_LinuxOS_ALSA_Ports.c, \ |
|
194 |
LANG := C, \ |
|
195 |
OPTIMIZATION := LOW, \ |
|
196 |
CFLAGS := $(CFLAGS_JDKLIB) $(ALSA_CFLAGS) \ |
|
197 |
$(LIBJSOUND_CFLAGS) \ |
|
198 |
-DUSE_DAUDIO=TRUE \ |
|
199 |
-DUSE_PORTS=TRUE \ |
|
200 |
-DUSE_PLATFORM_MIDI_OUT=TRUE \ |
|
201 |
-DUSE_PLATFORM_MIDI_IN=TRUE, \ |
|
21805 | 202 |
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsoundalsa/mapfile-vers, \ |
20547 | 203 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
204 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
205 |
LDFLAGS_SUFFIX := $(ALSA_LIBS) -ljava -ljvm, \ |
|
206 |
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsoundalsa, \ |
|
207 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
|
208 |
||
209 |
$(BUILD_LIBJSOUNDALSA): $(BUILD_LIBJAVA) |
|
210 |
||
211 |
BUILD_LIBRARIES += $(BUILD_LIBJSOUNDALSA) |
|
212 |
||
213 |
endif |
|
214 |
||
215 |
########################################################################################## |
|
216 |
||
217 |
ifneq ($(filter jsoundds, $(EXTRA_SOUND_JNI_LIBS)), ) |
|
218 |
||
219 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDDS, \ |
|
220 |
LIBRARY := jsoundds, \ |
|
221 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
222 |
SRC := $(LIBJSOUND_SRC_DIRS), \ |
|
223 |
INCLUDE_FILES := Utilities.c $(LIBJSOUND_DAUDIOFILES) \ |
|
224 |
PLATFORM_API_WinOS_DirectSound.cpp, \ |
|
225 |
LANG := C++, \ |
|
226 |
OPTIMIZATION := LOW, \ |
|
227 |
CFLAGS := $(CFLAGS_JDKLIB) \ |
|
228 |
$(LIBJSOUND_CFLAGS) \ |
|
229 |
-DUSE_DAUDIO=TRUE, \ |
|
230 |
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ |
|
231 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
232 |
LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX) dsound.lib winmm.lib user32.lib ole32.lib, \ |
|
233 |
VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ |
|
234 |
RC_FLAGS := $(RC_FLAGS) \ |
|
235 |
-D "JDK_FNAME=jsoundds.dll" \ |
|
236 |
-D "JDK_INTERNAL_NAME=jsoundds" \ |
|
237 |
-D "JDK_FTYPE=0x2L", \ |
|
238 |
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsoundds, \ |
|
239 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
|
240 |
||
241 |
$(BUILD_LIBJSOUNDDS): $(BUILD_LIBJAVA) |
|
242 |
||
243 |
BUILD_LIBRARIES += $(BUILD_LIBJSOUNDDS) |
|
244 |
||
245 |
endif |