jdk

Форк
0
/
libraries.m4 
203 строки · 6.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

26
# Major library component reside in separate files.
27
m4_include([lib-alsa.m4])
28
m4_include([lib-bundled.m4])
29
m4_include([lib-cups.m4])
30
m4_include([lib-ffi.m4])
31
m4_include([lib-fontconfig.m4])
32
m4_include([lib-freetype.m4])
33
m4_include([lib-hsdis.m4])
34
m4_include([lib-std.m4])
35
m4_include([lib-x11.m4])
36

37
m4_include([lib-tests.m4])
38

39
################################################################################
40
# Determine which libraries are needed for this configuration
41
################################################################################
42
AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
43
[
44
  # Check if X11 is needed
45
  if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then
46
    # No X11 support on windows or macosx
47
    NEEDS_LIB_X11=false
48
  else
49
    # All other instances need X11, even if building headless only, libawt still
50
    # needs X11 headers.
51
    NEEDS_LIB_X11=true
52
  fi
53

54
  # Check if fontconfig is needed
55
  if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then
56
    # No fontconfig support on windows or macosx
57
    NEEDS_LIB_FONTCONFIG=false
58
  else
59
    # All other instances need fontconfig, even if building headless only,
60
    # libawt still needs fontconfig headers.
61
    NEEDS_LIB_FONTCONFIG=true
62
  fi
63

64
  # Check if cups is needed
65
  if test "x$OPENJDK_TARGET_OS" = xwindows; then
66
    # Windows have a separate print system
67
    NEEDS_LIB_CUPS=false
68
  else
69
    NEEDS_LIB_CUPS=true
70
  fi
71

72
  # A custom hook may have set this already
73
  if test "x$NEEDS_LIB_FREETYPE" = "x"; then
74
    NEEDS_LIB_FREETYPE=true
75
  fi
76

77
  # Check if alsa is needed
78
  if test "x$OPENJDK_TARGET_OS" = xlinux; then
79
    NEEDS_LIB_ALSA=true
80
  else
81
    NEEDS_LIB_ALSA=false
82
  fi
83

84
  # Check if ffi is needed
85
  if HOTSPOT_CHECK_JVM_VARIANT(zero) || test "x$ENABLE_FALLBACK_LINKER" = "xtrue"; then
86
    NEEDS_LIB_FFI=true
87
  else
88
    NEEDS_LIB_FFI=false
89
  fi
90
])
91

92
################################################################################
93
# Setup BASIC_JVM_LIBS that can be different depending on build/target platform
94
################################################################################
95
AC_DEFUN([LIB_SETUP_JVM_LIBS],
96
[
97
  # Atomic library
98
  # 32-bit platforms needs fallback library for 8-byte atomic ops on Zero
99
  if HOTSPOT_CHECK_JVM_VARIANT(zero); then
100
    if test "x$OPENJDK_$1_OS" = xlinux &&
101
        (test "x$OPENJDK_$1_CPU" = xarm ||
102
         test "x$OPENJDK_$1_CPU" = xm68k ||
103
         test "x$OPENJDK_$1_CPU" = xmips ||
104
         test "x$OPENJDK_$1_CPU" = xmipsel ||
105
         test "x$OPENJDK_$1_CPU" = xppc ||
106
         test "x$OPENJDK_$1_CPU" = xsh ||
107
         test "x$OPENJDK_$1_CPU" = xriscv32); then
108
      BASIC_JVM_LIBS_$1="$BASIC_JVM_LIBS_$1 -latomic"
109
    fi
110
  fi
111
])
112

113
################################################################################
114
# Parse library options, and setup needed libraries
115
################################################################################
116
AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
117
[
118
  LIB_SETUP_STD_LIBS
119

120
  LIB_SETUP_ALSA
121
  LIB_SETUP_BUNDLED_LIBS
122
  LIB_SETUP_CUPS
123
  LIB_SETUP_FONTCONFIG
124
  LIB_SETUP_FREETYPE
125
  LIB_SETUP_HSDIS
126
  LIB_SETUP_LIBFFI
127
  LIB_SETUP_MISC_LIBS
128
  LIB_SETUP_X11
129

130
  LIB_TESTS_SETUP_GTEST
131

132
  # Math library
133
  BASIC_JVM_LIBS="$LIBM"
134

135
  # Dynamic loading library
136
  if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xaix; then
137
    BASIC_JVM_LIBS="$BASIC_JVM_LIBS $LIBDL"
138
  fi
139

140
  # Threading library
141
  if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xaix; then
142
    BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lpthread"
143
  fi
144

145
  # librt for legacy clock_gettime
146
  if test "x$OPENJDK_TARGET_OS" = xlinux; then
147
    # Hotspot needs to link librt to get the clock_* functions.
148
    # But once our supported minimum build and runtime platform
149
    # has glibc 2.17, this can be removed as the functions are
150
    # in libc.
151
    BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lrt"
152
  fi
153

154
  # perfstat lib
155
  if test "x$OPENJDK_TARGET_OS" = xaix; then
156
    BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lperfstat"
157
  fi
158

159
  if test "x$OPENJDK_TARGET_OS" = xwindows; then
160
    BASIC_JVM_LIBS="$BASIC_JVM_LIBS kernel32.lib user32.lib gdi32.lib winspool.lib \
161
        comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib powrprof.lib uuid.lib \
162
        ws2_32.lib winmm.lib version.lib psapi.lib"
163
  fi
164
  LIB_SETUP_JVM_LIBS(BUILD)
165
  LIB_SETUP_JVM_LIBS(TARGET)
166

167
  JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_TARGET"
168
  OPENJDK_BUILD_JDKLIB_LIBS=""
169
  OPENJDK_BUILD_JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_BUILD"
170

171
  AC_SUBST(JVM_LIBS)
172
  AC_SUBST(OPENJDK_BUILD_JDKLIB_LIBS)
173
  AC_SUBST(OPENJDK_BUILD_JVM_LIBS)
174
])
175

176
################################################################################
177
# Setup various libraries, typically small system libraries
178
################################################################################
179
AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
180
[
181
  # Setup libm (the maths library)
182
  if test "x$OPENJDK_TARGET_OS" != "xwindows"; then
183
    AC_CHECK_LIB(m, cos, [], [
184
        AC_MSG_NOTICE([Maths library was not found])
185
    ])
186
    LIBM="-lm"
187
  else
188
    LIBM=""
189
  fi
190
  AC_SUBST(LIBM)
191

192
  # Setup libdl (for dynamic library loading)
193
  save_LIBS="$LIBS"
194
  LIBS=""
195
  AC_CHECK_LIB(dl, dlopen)
196
  LIBDL="$LIBS"
197
  AC_SUBST(LIBDL)
198
  LIBS="$save_LIBS"
199

200
  # Control if libzip can use mmap. Available for purposes of overriding.
201
  LIBZIP_CAN_USE_MMAP=true
202
  AC_SUBST(LIBZIP_CAN_USE_MMAP)
203
])
204

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.