1 #
2 # Copyright (c) 2011, 2018, 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
84 NEEDS_LIB_FFI=true
85 else
86 NEEDS_LIB_FFI=false
87 fi
88 ])
89
90 ################################################################################
91 # Parse library options, and setup needed libraries
92 ################################################################################
93 AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
94 [
95 LIB_SETUP_STD_LIBS
96 LIB_SETUP_X11
97 LIB_SETUP_CUPS
98 LIB_SETUP_FONTCONFIG
99 LIB_SETUP_FREETYPE
100 LIB_SETUP_ALSA
101 LIB_SETUP_LIBFFI
102 LIB_SETUP_BUNDLED_LIBS
103 LIB_SETUP_MISC_LIBS
104 LIB_SETUP_SOLARIS_STLPORT
105 LIB_TESTS_SETUP_GRAALUNIT
106
107 if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
108 GLOBAL_LIBS="-lc"
109 else
110 GLOBAL_LIBS=""
111 fi
112
113 BASIC_JDKLIB_LIBS=""
114 if test "x$TOOLCHAIN_TYPE" != xmicrosoft; then
115 BASIC_JDKLIB_LIBS="-ljava -ljvm"
116 fi
117
118 # Math library
119 BASIC_JVM_LIBS="$LIBM"
120
121 # Dynamic loading library
122 if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xaix; then
123 BASIC_JVM_LIBS="$BASIC_JVM_LIBS $LIBDL"
124 fi
125
126 # Threading library
127 if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xaix; then
128 BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lpthread"
129 elif test "x$OPENJDK_TARGET_OS" = xsolaris; then
130 BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lthread"
131 fi
132
133 # perfstat lib
134 if test "x$OPENJDK_TARGET_OS" = xaix; then
135 BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lperfstat"
136 fi
137
138 if test "x$OPENJDK_TARGET_OS" = xsolaris; then
139 BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lsocket -lsched -ldoor -ldemangle -lnsl \
140 -lrt -lkstat"
141 BASIC_JVM_LIBS="$BASIC_JVM_LIBS $LIBCXX_JVM"
142 fi
143
144 if test "x$OPENJDK_TARGET_OS" = xwindows; then
145 BASIC_JVM_LIBS="$BASIC_JVM_LIBS kernel32.lib user32.lib gdi32.lib winspool.lib \
146 comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \
147 wsock32.lib winmm.lib version.lib psapi.lib"
148 fi
149
150 JDKLIB_LIBS="$BASIC_JDKLIB_LIBS"
151 JDKEXE_LIBS=""
152 JVM_LIBS="$BASIC_JVM_LIBS"
153 OPENJDK_BUILD_JDKLIB_LIBS="$BASIC_JDKLIB_LIBS"
154 OPENJDK_BUILD_JVM_LIBS="$BASIC_JVM_LIBS"
155
156 AC_SUBST(JDKLIB_LIBS)
157 AC_SUBST(JDKEXE_LIBS)
158 AC_SUBST(JVM_LIBS)
159 AC_SUBST(OPENJDK_BUILD_JDKLIB_LIBS)
160 AC_SUBST(OPENJDK_BUILD_JVM_LIBS)
161 AC_SUBST(GLOBAL_LIBS)
162 ])
163
164 ################################################################################
165 # Setup various libraries, typically small system libraries
166 ################################################################################
167 AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
168 [
169 # Setup libm (the maths library)
170 if test "x$OPENJDK_TARGET_OS" != "xwindows"; then
171 AC_CHECK_LIB(m, cos, [], [
172 AC_MSG_NOTICE([Maths library was not found])
173 ])
174 LIBM="-lm"
175 else
176 LIBM=""
177 fi
178 AC_SUBST(LIBM)
179
180 # Setup libdl (for dynamic library loading)
181 save_LIBS="$LIBS"
182 LIBS=""
183 AC_CHECK_LIB(dl, dlopen)
184 LIBDL="$LIBS"
185 AC_SUBST(LIBDL)
186 LIBS="$save_LIBS"
187
188 # Control if libzip can use mmap. Available for purposes of overriding.
189 LIBZIP_CAN_USE_MMAP=true
190 AC_SUBST(LIBZIP_CAN_USE_MMAP)
191 ])
192
193 ################################################################################
194 # libstlport.so.1 is needed for running gtest on Solaris. Find it to
195 # redistribute it in the test image.
196 ################################################################################
197 AC_DEFUN_ONCE([LIB_SETUP_SOLARIS_STLPORT],
198 [
199 if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
200 # Find the root of the Solaris Studio installation from the compiler path
201 SOLARIS_STUDIO_DIR="$(dirname $CC)/.."
202 STLPORT_LIB="$SOLARIS_STUDIO_DIR/lib/stlport4$OPENJDK_TARGET_CPU_ISADIR/libstlport.so.1"
203 AC_MSG_CHECKING([for libstlport.so.1])
204 if ! test -f "$STLPORT_LIB" && test "x$OPENJDK_TARGET_CPU_ISADIR" = "x/sparcv9"; then
205 # SS12u3 has libstlport under 'stlport4/v9' instead of 'stlport4/sparcv9'
206 STLPORT_LIB="$SOLARIS_STUDIO_DIR/lib/stlport4/v9/libstlport.so.1"
207 fi
208 if test -f "$STLPORT_LIB"; then
209 AC_MSG_RESULT([yes, $STLPORT_LIB])
210 UTIL_FIXUP_PATH([STLPORT_LIB])
211 else
212 AC_MSG_RESULT([no, not found at $STLPORT_LIB, cannot build Hotspot gtests])
213 fi
214 AC_SUBST(STLPORT_LIB)
215 fi
216 ])
|
1 #
2 # Copyright (c) 2011, 2020, 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
84 NEEDS_LIB_FFI=true
85 else
86 NEEDS_LIB_FFI=false
87 fi
88 ])
89
90 ################################################################################
91 # Parse library options, and setup needed libraries
92 ################################################################################
93 AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
94 [
95 LIB_SETUP_STD_LIBS
96 LIB_SETUP_X11
97 LIB_SETUP_CUPS
98 LIB_SETUP_FONTCONFIG
99 LIB_SETUP_FREETYPE
100 LIB_SETUP_ALSA
101 LIB_SETUP_LIBFFI
102 LIB_SETUP_BUNDLED_LIBS
103 LIB_SETUP_MISC_LIBS
104 LIB_TESTS_SETUP_GRAALUNIT
105
106 BASIC_JDKLIB_LIBS=""
107 if test "x$TOOLCHAIN_TYPE" != xmicrosoft; then
108 BASIC_JDKLIB_LIBS="-ljava -ljvm"
109 fi
110
111 # Math library
112 BASIC_JVM_LIBS="$LIBM"
113
114 # Dynamic loading library
115 if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xaix; then
116 BASIC_JVM_LIBS="$BASIC_JVM_LIBS $LIBDL"
117 fi
118
119 # Threading library
120 if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xaix; then
121 BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lpthread"
122 fi
123
124 # perfstat lib
125 if test "x$OPENJDK_TARGET_OS" = xaix; then
126 BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lperfstat"
127 fi
128
129 if test "x$OPENJDK_TARGET_OS" = xwindows; then
130 BASIC_JVM_LIBS="$BASIC_JVM_LIBS kernel32.lib user32.lib gdi32.lib winspool.lib \
131 comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \
132 wsock32.lib winmm.lib version.lib psapi.lib"
133 fi
134
135 JDKLIB_LIBS="$BASIC_JDKLIB_LIBS"
136 JDKEXE_LIBS=""
137 JVM_LIBS="$BASIC_JVM_LIBS"
138 OPENJDK_BUILD_JDKLIB_LIBS="$BASIC_JDKLIB_LIBS"
139 OPENJDK_BUILD_JVM_LIBS="$BASIC_JVM_LIBS"
140
141 AC_SUBST(JDKLIB_LIBS)
142 AC_SUBST(JDKEXE_LIBS)
143 AC_SUBST(JVM_LIBS)
144 AC_SUBST(OPENJDK_BUILD_JDKLIB_LIBS)
145 AC_SUBST(OPENJDK_BUILD_JVM_LIBS)
146 ])
147
148 ################################################################################
149 # Setup various libraries, typically small system libraries
150 ################################################################################
151 AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
152 [
153 # Setup libm (the maths library)
154 if test "x$OPENJDK_TARGET_OS" != "xwindows"; then
155 AC_CHECK_LIB(m, cos, [], [
156 AC_MSG_NOTICE([Maths library was not found])
157 ])
158 LIBM="-lm"
159 else
160 LIBM=""
161 fi
162 AC_SUBST(LIBM)
163
164 # Setup libdl (for dynamic library loading)
165 save_LIBS="$LIBS"
166 LIBS=""
167 AC_CHECK_LIB(dl, dlopen)
168 LIBDL="$LIBS"
169 AC_SUBST(LIBDL)
170 LIBS="$save_LIBS"
171
172 # Control if libzip can use mmap. Available for purposes of overriding.
173 LIBZIP_CAN_USE_MMAP=true
174 AC_SUBST(LIBZIP_CAN_USE_MMAP)
175 ])
|