2012-07-06 01:27:07 +00:00
|
|
|
#
|
2024-03-22 14:12:26 +00:00
|
|
|
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
2012-07-06 01:27:07 +00:00
|
|
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
#
|
|
|
|
# This code is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU General Public License version 2 only, as
|
|
|
|
# published by the Free Software Foundation. Oracle designates this
|
|
|
|
# particular file as subject to the "Classpath" exception as provided
|
|
|
|
# by Oracle in the LICENSE file that accompanied this code.
|
|
|
|
#
|
|
|
|
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
# version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
# accompanied this code).
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License version
|
|
|
|
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
# or visit www.oracle.com if you need additional information or have any
|
|
|
|
# questions.
|
|
|
|
#
|
|
|
|
|
2015-10-07 13:26:48 +00:00
|
|
|
# Major library component reside in separate files.
|
|
|
|
m4_include([lib-alsa.m4])
|
|
|
|
m4_include([lib-bundled.m4])
|
|
|
|
m4_include([lib-cups.m4])
|
|
|
|
m4_include([lib-ffi.m4])
|
2022-03-02 18:17:47 +00:00
|
|
|
m4_include([lib-fontconfig.m4])
|
2015-10-07 13:26:48 +00:00
|
|
|
m4_include([lib-freetype.m4])
|
2022-03-02 18:17:47 +00:00
|
|
|
m4_include([lib-hsdis.m4])
|
2015-10-07 13:26:48 +00:00
|
|
|
m4_include([lib-std.m4])
|
|
|
|
m4_include([lib-x11.m4])
|
2022-03-02 18:17:47 +00:00
|
|
|
|
2018-06-29 00:07:34 +00:00
|
|
|
m4_include([lib-tests.m4])
|
2015-10-07 13:26:48 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Determine which libraries are needed for this configuration
|
|
|
|
################################################################################
|
|
|
|
AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
|
2012-07-06 01:27:07 +00:00
|
|
|
[
|
2015-10-07 13:26:48 +00:00
|
|
|
# Check if X11 is needed
|
|
|
|
if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
|
|
|
# No X11 support on windows or macosx
|
|
|
|
NEEDS_LIB_X11=false
|
2013-10-10 12:58:19 +00:00
|
|
|
else
|
2021-08-27 13:13:36 +00:00
|
|
|
# All other instances need X11, even if building headless only, libawt still
|
|
|
|
# needs X11 headers.
|
2016-09-26 12:57:00 +00:00
|
|
|
NEEDS_LIB_X11=true
|
2014-05-23 15:04:32 +00:00
|
|
|
fi
|
|
|
|
|
2017-10-25 20:11:07 +00:00
|
|
|
# Check if fontconfig is needed
|
|
|
|
if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
|
|
|
# No fontconfig support on windows or macosx
|
|
|
|
NEEDS_LIB_FONTCONFIG=false
|
|
|
|
else
|
|
|
|
# All other instances need fontconfig, even if building headless only,
|
|
|
|
# libawt still needs fontconfig headers.
|
|
|
|
NEEDS_LIB_FONTCONFIG=true
|
|
|
|
fi
|
|
|
|
|
2015-10-07 13:26:48 +00:00
|
|
|
# Check if cups is needed
|
|
|
|
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
|
|
|
# Windows have a separate print system
|
|
|
|
NEEDS_LIB_CUPS=false
|
2013-10-10 12:58:19 +00:00
|
|
|
else
|
2015-10-07 13:26:48 +00:00
|
|
|
NEEDS_LIB_CUPS=true
|
2014-04-29 19:44:14 +00:00
|
|
|
fi
|
|
|
|
|
2016-07-08 06:55:54 +00:00
|
|
|
# A custom hook may have set this already
|
|
|
|
if test "x$NEEDS_LIB_FREETYPE" = "x"; then
|
2015-10-07 13:26:48 +00:00
|
|
|
NEEDS_LIB_FREETYPE=true
|
2014-04-29 19:44:14 +00:00
|
|
|
fi
|
|
|
|
|
2015-10-07 13:26:48 +00:00
|
|
|
# Check if alsa is needed
|
|
|
|
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
|
|
|
NEEDS_LIB_ALSA=true
|
2014-02-20 15:07:46 +00:00
|
|
|
else
|
2015-10-07 13:26:48 +00:00
|
|
|
NEEDS_LIB_ALSA=false
|
2014-02-20 15:07:46 +00:00
|
|
|
fi
|
|
|
|
|
2015-10-07 13:26:48 +00:00
|
|
|
# Check if ffi is needed
|
2023-04-27 09:00:58 +00:00
|
|
|
if HOTSPOT_CHECK_JVM_VARIANT(zero) || test "x$ENABLE_FALLBACK_LINKER" = "xtrue"; then
|
2015-10-07 13:26:48 +00:00
|
|
|
NEEDS_LIB_FFI=true
|
2013-10-10 12:58:19 +00:00
|
|
|
else
|
2015-10-07 13:26:48 +00:00
|
|
|
NEEDS_LIB_FFI=false
|
2013-10-10 12:58:19 +00:00
|
|
|
fi
|
2012-07-06 01:27:07 +00:00
|
|
|
])
|
|
|
|
|
2023-01-18 20:09:34 +00:00
|
|
|
################################################################################
|
|
|
|
# Setup BASIC_JVM_LIBS that can be different depending on build/target platform
|
|
|
|
################################################################################
|
|
|
|
AC_DEFUN([LIB_SETUP_JVM_LIBS],
|
|
|
|
[
|
|
|
|
# Atomic library
|
|
|
|
# 32-bit platforms needs fallback library for 8-byte atomic ops on Zero
|
|
|
|
if HOTSPOT_CHECK_JVM_VARIANT(zero); then
|
|
|
|
if test "x$OPENJDK_$1_OS" = xlinux &&
|
|
|
|
(test "x$OPENJDK_$1_CPU" = xarm ||
|
2024-08-30 08:58:18 +00:00
|
|
|
test "x$OPENJDK_$1_CPU" = xm68k ||
|
|
|
|
test "x$OPENJDK_$1_CPU" = xmips ||
|
|
|
|
test "x$OPENJDK_$1_CPU" = xmipsel ||
|
|
|
|
test "x$OPENJDK_$1_CPU" = xppc ||
|
|
|
|
test "x$OPENJDK_$1_CPU" = xsh ||
|
|
|
|
test "x$OPENJDK_$1_CPU" = xriscv32); then
|
2023-01-18 20:09:34 +00:00
|
|
|
BASIC_JVM_LIBS_$1="$BASIC_JVM_LIBS_$1 -latomic"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
2015-10-07 13:26:48 +00:00
|
|
|
################################################################################
|
|
|
|
# Parse library options, and setup needed libraries
|
|
|
|
################################################################################
|
|
|
|
AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
2012-07-06 01:27:07 +00:00
|
|
|
[
|
2015-10-07 13:26:48 +00:00
|
|
|
LIB_SETUP_STD_LIBS
|
2022-03-02 18:17:47 +00:00
|
|
|
|
|
|
|
LIB_SETUP_ALSA
|
|
|
|
LIB_SETUP_BUNDLED_LIBS
|
2015-10-07 13:26:48 +00:00
|
|
|
LIB_SETUP_CUPS
|
2017-10-25 20:11:07 +00:00
|
|
|
LIB_SETUP_FONTCONFIG
|
2015-10-07 13:26:48 +00:00
|
|
|
LIB_SETUP_FREETYPE
|
2022-03-02 18:17:47 +00:00
|
|
|
LIB_SETUP_HSDIS
|
2015-10-07 13:26:48 +00:00
|
|
|
LIB_SETUP_LIBFFI
|
|
|
|
LIB_SETUP_MISC_LIBS
|
2022-03-02 18:17:47 +00:00
|
|
|
LIB_SETUP_X11
|
|
|
|
|
2020-05-26 20:33:00 +00:00
|
|
|
LIB_TESTS_SETUP_GTEST
|
2018-03-02 09:59:25 +00:00
|
|
|
|
|
|
|
# Math library
|
2018-03-29 00:20:06 +00:00
|
|
|
BASIC_JVM_LIBS="$LIBM"
|
2018-03-02 09:59:25 +00:00
|
|
|
|
|
|
|
# Dynamic loading library
|
8244224: Implementation of JEP 381: Remove the Solaris and SPARC Ports
Reviewed-by: alanb, bchristi, dcubed, dfuchs, eosterlund, erikj, glaubitz, ihse, iignatyev, jjiang, kbarrett, ksrini, kvn, naoto, prr, rriggs, serb, sspitsyn, stefank, tschatzl, valeriep, weijun, weijun
2020-05-21 00:33:37 +00:00
|
|
|
if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xaix; then
|
2018-03-02 09:59:25 +00:00
|
|
|
BASIC_JVM_LIBS="$BASIC_JVM_LIBS $LIBDL"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Threading library
|
|
|
|
if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xaix; then
|
|
|
|
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lpthread"
|
|
|
|
fi
|
|
|
|
|
2021-04-15 12:59:21 +00:00
|
|
|
# librt for legacy clock_gettime
|
|
|
|
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
|
|
|
# Hotspot needs to link librt to get the clock_* functions.
|
|
|
|
# But once our supported minimum build and runtime platform
|
|
|
|
# has glibc 2.17, this can be removed as the functions are
|
|
|
|
# in libc.
|
|
|
|
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lrt"
|
|
|
|
fi
|
|
|
|
|
2019-04-12 07:13:50 +00:00
|
|
|
# perfstat lib
|
|
|
|
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
|
|
|
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lperfstat"
|
|
|
|
fi
|
|
|
|
|
2018-03-02 09:59:25 +00:00
|
|
|
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
|
|
|
BASIC_JVM_LIBS="$BASIC_JVM_LIBS kernel32.lib user32.lib gdi32.lib winspool.lib \
|
2023-02-21 08:17:56 +00:00
|
|
|
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib powrprof.lib uuid.lib \
|
2023-03-07 22:56:33 +00:00
|
|
|
ws2_32.lib winmm.lib version.lib psapi.lib"
|
2018-03-02 09:59:25 +00:00
|
|
|
fi
|
2023-01-18 20:09:34 +00:00
|
|
|
LIB_SETUP_JVM_LIBS(BUILD)
|
|
|
|
LIB_SETUP_JVM_LIBS(TARGET)
|
2018-03-02 09:59:25 +00:00
|
|
|
|
2023-01-18 20:09:34 +00:00
|
|
|
JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_TARGET"
|
2024-04-11 09:40:12 +00:00
|
|
|
OPENJDK_BUILD_JDKLIB_LIBS=""
|
2023-01-18 20:09:34 +00:00
|
|
|
OPENJDK_BUILD_JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_BUILD"
|
2018-03-02 09:59:25 +00:00
|
|
|
|
|
|
|
AC_SUBST(JVM_LIBS)
|
|
|
|
AC_SUBST(OPENJDK_BUILD_JDKLIB_LIBS)
|
|
|
|
AC_SUBST(OPENJDK_BUILD_JVM_LIBS)
|
2015-10-07 13:26:48 +00:00
|
|
|
])
|
2013-04-08 18:07:32 +00:00
|
|
|
|
2015-10-07 13:26:48 +00:00
|
|
|
################################################################################
|
|
|
|
# Setup various libraries, typically small system libraries
|
|
|
|
################################################################################
|
|
|
|
AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
|
2014-02-24 11:16:58 +00:00
|
|
|
[
|
2015-10-07 13:26:48 +00:00
|
|
|
# Setup libm (the maths library)
|
2016-02-22 10:22:55 +00:00
|
|
|
if test "x$OPENJDK_TARGET_OS" != "xwindows"; then
|
|
|
|
AC_CHECK_LIB(m, cos, [], [
|
|
|
|
AC_MSG_NOTICE([Maths library was not found])
|
|
|
|
])
|
|
|
|
LIBM="-lm"
|
|
|
|
else
|
|
|
|
LIBM=""
|
|
|
|
fi
|
2015-10-07 13:26:48 +00:00
|
|
|
AC_SUBST(LIBM)
|
|
|
|
|
|
|
|
# Setup libdl (for dynamic library loading)
|
|
|
|
save_LIBS="$LIBS"
|
|
|
|
LIBS=""
|
|
|
|
AC_CHECK_LIB(dl, dlopen)
|
|
|
|
LIBDL="$LIBS"
|
|
|
|
AC_SUBST(LIBDL)
|
|
|
|
LIBS="$save_LIBS"
|
|
|
|
|
|
|
|
# Control if libzip can use mmap. Available for purposes of overriding.
|
|
|
|
LIBZIP_CAN_USE_MMAP=true
|
|
|
|
AC_SUBST(LIBZIP_CAN_USE_MMAP)
|
2014-02-24 11:16:58 +00:00
|
|
|
])
|