jdk
130 строк · 4.5 Кб
1#
2# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
7# published by the Free Software Foundation. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle in the LICENSE file that accompanied this code.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
24#
25
26include LibCommon.gmk
27include Execute.gmk
28
29# Hook to include the corresponding custom file, if present.
30$(eval $(call IncludeCustomExtension, modules/java.desktop/Lib.gmk))
31
32# Prepare the find cache.
33$(call FillFindCache, $(wildcard $(TOPDIR)/src/java.desktop/*/native))
34
35################################################################################
36# Create the AWT/2D libraries
37
38include lib/AwtLibraries.gmk
39include lib/ClientLibraries.gmk
40
41ifeq ($(call isTargetOs, aix), false)
42##############################################################################
43# Build libjsound
44##############################################################################
45
46LIBJSOUND_CFLAGS := \
47$(ALSA_CFLAGS) \
48-DX_PLATFORM=X_$(OPENJDK_TARGET_OS_UPPERCASE) \
49-DUSE_PORTS=TRUE \
50-DUSE_DAUDIO=TRUE \
51-DUSE_PLATFORM_MIDI_OUT=TRUE \
52-DUSE_PLATFORM_MIDI_IN=TRUE \
53#
54
55LIBJSOUND_LINK_TYPE := C
56ifeq ($(call isTargetOs, macosx), true)
57LIBJSOUND_LINK_TYPE := C++
58endif
59
60$(eval $(call SetupJdkLibrary, BUILD_LIBJSOUND, \
61NAME := jsound, \
62LINK_TYPE := $(LIBJSOUND_LINK_TYPE), \
63OPTIMIZATION := LOW, \
64EXTRA_HEADER_DIRS := java.base:libjava, \
65CFLAGS := $(LIBJSOUND_CFLAGS), \
66CXXFLAGS := $(LIBJSOUND_CFLAGS), \
67DISABLED_WARNINGS_gcc := undef, \
68DISABLED_WARNINGS_clang := undef, \
69LIBS_linux := $(ALSA_LIBS), \
70LIBS_macosx := \
71-framework AudioToolbox \
72-framework AudioUnit \
73-framework CoreAudio \
74-framework CoreFoundation \
75-framework CoreMIDI \
76-framework CoreServices, \
77LIBS_windows := advapi32.lib dsound.lib ole32.lib user32.lib winmm.lib, \
78))
79
80TARGETS += $(BUILD_LIBJSOUND)
81endif
82
83ifeq ($(call isTargetOs, macosx), true)
84##############################################################################
85# Build libosxapp
86##############################################################################
87
88$(eval $(call SetupJdkLibrary, BUILD_LIBOSXAPP, \
89NAME := osxapp, \
90OPTIMIZATION := LOW, \
91DISABLED_WARNINGS_clang_NSApplicationAWT.m := deprecated-declarations \
92format-nonliteral, \
93DISABLED_WARNINGS_clang_QueuingApplicationDelegate.m := \
94objc-method-access, \
95JDK_LIBS := java.base:libjava, \
96LIBS_macosx := \
97-framework Accelerate \
98-framework ApplicationServices \
99-framework AudioToolbox \
100-framework Carbon \
101-framework Cocoa \
102-framework ExceptionHandling \
103-framework IOSurface \
104-framework JavaRuntimeSupport \
105-framework OpenGL \
106-framework QuartzCore \
107-framework Security, \
108))
109
110TARGETS += $(BUILD_LIBOSXAPP)
111
112##############################################################################
113# Build libosx
114##############################################################################
115
116$(eval $(call SetupJdkLibrary, BUILD_LIBOSX, \
117NAME := osx, \
118OPTIMIZATION := LOW, \
119EXTRA_HEADER_DIRS := java.base:libjava, \
120DISABLED_WARNINGS_clang_CFileManager.m := deprecated-declarations, \
121JDK_LIBS := libosxapp, \
122LIBS_macosx := \
123-framework ApplicationServices \
124-framework Cocoa \
125-framework JavaRuntimeSupport \
126-framework SystemConfiguration, \
127))
128
129TARGETS += $(BUILD_LIBOSX)
130endif
131