author | ddehaven |
Wed, 18 Jun 2014 12:52:13 -0700 | |
changeset 25034 | d9ca34c227b8 |
parent 24415 | 43aa54df554d |
child 25039 | a0f814f72ad4 |
permissions | -rw-r--r-- |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1 |
# |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
2 |
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
4 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. Oracle designates this |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
8 |
# particular file as subject to the "Classpath" exception as provided |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
10 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
15 |
# accompanied this code). |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
16 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
20 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
23 |
# questions. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
24 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
25 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
26 |
AC_DEFUN_ONCE([LIB_SETUP_INIT], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
27 |
[ |
20363 | 28 |
|
29 |
############################################################################### |
|
30 |
# |
|
31 |
# OS specific settings that we never will need to probe. |
|
32 |
# |
|
33 |
if test "x$OPENJDK_TARGET_OS" = xlinux; then |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
34 |
AC_MSG_CHECKING([what is not needed on Linux?]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
35 |
PULSE_NOT_NEEDED=yes |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
36 |
AC_MSG_RESULT([pulse]) |
20363 | 37 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
38 |
|
20363 | 39 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
40 |
AC_MSG_CHECKING([what is not needed on Solaris?]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
41 |
ALSA_NOT_NEEDED=yes |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
42 |
PULSE_NOT_NEEDED=yes |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
43 |
AC_MSG_RESULT([alsa pulse]) |
20363 | 44 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
45 |
|
22467 | 46 |
if test "x$OPENJDK_TARGET_OS" = xaix; then |
22466 | 47 |
AC_MSG_CHECKING([what is not needed on AIX?]) |
48 |
ALSA_NOT_NEEDED=yes |
|
49 |
PULSE_NOT_NEEDED=yes |
|
50 |
AC_MSG_RESULT([alsa pulse]) |
|
22467 | 51 |
fi |
22466 | 52 |
|
53 |
||
20363 | 54 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
55 |
AC_MSG_CHECKING([what is not needed on Windows?]) |
20363 | 56 |
CUPS_NOT_NEEDED=yes |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
57 |
ALSA_NOT_NEEDED=yes |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
58 |
PULSE_NOT_NEEDED=yes |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
59 |
X11_NOT_NEEDED=yes |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
60 |
AC_MSG_RESULT([alsa cups pulse x11]) |
20363 | 61 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
62 |
|
20363 | 63 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
64 |
AC_MSG_CHECKING([what is not needed on MacOSX?]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
65 |
ALSA_NOT_NEEDED=yes |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
66 |
PULSE_NOT_NEEDED=yes |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
67 |
X11_NOT_NEEDED=yes |
20654 | 68 |
AC_MSG_RESULT([alsa pulse x11]) |
20363 | 69 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
70 |
|
20363 | 71 |
if test "x$OPENJDK_TARGET_OS" = xbsd; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
72 |
AC_MSG_CHECKING([what is not needed on bsd?]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
73 |
ALSA_NOT_NEEDED=yes |
20363 | 74 |
AC_MSG_RESULT([alsa]) |
75 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
76 |
|
20363 | 77 |
if test "x$OPENJDK" = "xfalse"; then |
20654 | 78 |
FREETYPE_NOT_NEEDED=yes |
20363 | 79 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
80 |
|
20363 | 81 |
if test "x$SUPPORT_HEADFUL" = xno; then |
13697 | 82 |
X11_NOT_NEEDED=yes |
20363 | 83 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
84 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
85 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
86 |
AC_DEFUN_ONCE([LIB_SETUP_X11], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
87 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
88 |
|
20363 | 89 |
############################################################################### |
90 |
# |
|
91 |
# Check for X Windows |
|
92 |
# |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
93 |
|
20363 | 94 |
# Check if the user has specified sysroot, but not --x-includes or --x-libraries. |
95 |
# Make a simple check for the libraries at the sysroot, and setup --x-includes and |
|
96 |
# --x-libraries for the sysroot, if that seems to be correct. |
|
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
97 |
if test "x$OPENJDK_TARGET_OS" = "xlinux"; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
98 |
if test "x$SYSROOT" != "x"; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
99 |
if test "x$x_includes" = xNONE; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
100 |
if test -f "$SYSROOT/usr/X11R6/include/X11/Xlib.h"; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
101 |
x_includes="$SYSROOT/usr/X11R6/include" |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
102 |
elif test -f "$SYSROOT/usr/include/X11/Xlib.h"; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
103 |
x_includes="$SYSROOT/usr/include" |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
104 |
fi |
20363 | 105 |
fi |
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
106 |
if test "x$x_libraries" = xNONE; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
107 |
if test -f "$SYSROOT/usr/X11R6/lib/libX11.so"; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
108 |
x_libraries="$SYSROOT/usr/X11R6/lib" |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
109 |
elif test "$SYSROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
110 |
x_libraries="$SYSROOT/usr/lib64" |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
111 |
elif test -f "$SYSROOT/usr/lib/libX11.so"; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
112 |
x_libraries="$SYSROOT/usr/lib" |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
113 |
fi |
20363 | 114 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
115 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
116 |
fi |
20363 | 117 |
|
118 |
# Now let autoconf do it's magic |
|
119 |
AC_PATH_X |
|
120 |
AC_PATH_XTRA |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
121 |
|
20363 | 122 |
# AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling |
123 |
# this doesn't make sense so we remove it. |
|
124 |
if test "x$COMPILE_TYPE" = xcross; then |
|
125 |
X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'` |
|
126 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
127 |
|
20363 | 128 |
if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
129 |
HELP_MSG_MISSING_DEPENDENCY([x11]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
130 |
AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG]) |
20363 | 131 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
132 |
|
20363 | 133 |
if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
134 |
OPENWIN_HOME="/usr/openwin" |
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
135 |
X_CFLAGS="-I$SYSROOT$OPENWIN_HOME/include -I$SYSROOT$OPENWIN_HOME/include/X11/extensions" |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
136 |
X_LIBS="-L$SYSROOT$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \ |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
137 |
-L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \ |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
138 |
-R$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \ |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
139 |
-R$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR" |
20363 | 140 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
141 |
|
20363 | 142 |
# |
143 |
# Weird Sol10 something check...TODO change to try compile |
|
144 |
# |
|
145 |
if test "x${OPENJDK_TARGET_OS}" = xsolaris; then |
|
146 |
if test "`uname -r`" = "5.10"; then |
|
147 |
if test "`${EGREP} -c XLinearGradient ${OPENWIN_HOME}/share/include/X11/extensions/Xrender.h`" = "0"; then |
|
148 |
X_CFLAGS="${X_CFLAGS} -DSOLARIS10_NO_XRENDER_STRUCTS" |
|
149 |
fi |
|
150 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
151 |
fi |
20363 | 152 |
|
153 |
AC_LANG_PUSH(C) |
|
154 |
OLD_CFLAGS="$CFLAGS" |
|
155 |
CFLAGS="$CFLAGS $X_CFLAGS" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
156 |
|
20363 | 157 |
# Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10 |
158 |
AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h], |
|
159 |
[X11_A_OK=yes], |
|
160 |
[X11_A_OK=no; break], |
|
161 |
[ |
|
162 |
# include <X11/Xlib.h> |
|
163 |
# include <X11/Xutil.h> |
|
164 |
] |
|
165 |
) |
|
14111 | 166 |
|
20363 | 167 |
CFLAGS="$OLD_CFLAGS" |
168 |
AC_LANG_POP(C) |
|
14111 | 169 |
|
20363 | 170 |
if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
171 |
HELP_MSG_MISSING_DEPENDENCY([x11]) |
19524
51009a053562
8003162: build-infra: Improve suggestions for missing packages on linux
erikj
parents:
18021
diff
changeset
|
172 |
AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG]) |
20363 | 173 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
174 |
|
20363 | 175 |
AC_SUBST(X_CFLAGS) |
176 |
AC_SUBST(X_LIBS) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
177 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
178 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
179 |
AC_DEFUN_ONCE([LIB_SETUP_CUPS], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
180 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
181 |
|
20363 | 182 |
############################################################################### |
183 |
# |
|
184 |
# The common unix printing system cups is used to print from java. |
|
185 |
# |
|
186 |
AC_ARG_WITH(cups, [AS_HELP_STRING([--with-cups], |
|
187 |
[specify prefix directory for the cups package |
|
188 |
(expecting the headers under PATH/include)])]) |
|
189 |
AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include], |
|
190 |
[specify directory for the cups include files])]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
191 |
|
20363 | 192 |
if test "x$CUPS_NOT_NEEDED" = xyes; then |
193 |
if test "x${with_cups}" != x || test "x${with_cups_include}" != x; then |
|
194 |
AC_MSG_WARN([cups not used, so --with-cups is ignored]) |
|
195 |
fi |
|
196 |
CUPS_CFLAGS= |
|
197 |
else |
|
198 |
CUPS_FOUND=no |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
199 |
|
20363 | 200 |
if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then |
201 |
AC_MSG_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.]) |
|
202 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
203 |
|
20363 | 204 |
if test "x${with_cups}" != x; then |
205 |
CUPS_CFLAGS="-I${with_cups}/include" |
|
206 |
CUPS_FOUND=yes |
|
207 |
fi |
|
208 |
if test "x${with_cups_include}" != x; then |
|
209 |
CUPS_CFLAGS="-I${with_cups_include}" |
|
210 |
CUPS_FOUND=yes |
|
211 |
fi |
|
212 |
if test "x$CUPS_FOUND" = xno; then |
|
213 |
BDEPS_CHECK_MODULE(CUPS, cups, xxx, [CUPS_FOUND=yes]) |
|
214 |
fi |
|
215 |
if test "x$CUPS_FOUND" = xno; then |
|
216 |
# Are the cups headers installed in the default /usr/include location? |
|
217 |
AC_CHECK_HEADERS([cups/cups.h cups/ppd.h], |
|
218 |
[ |
|
219 |
CUPS_FOUND=yes |
|
220 |
CUPS_CFLAGS= |
|
221 |
DEFAULT_CUPS=yes |
|
222 |
] |
|
223 |
) |
|
224 |
fi |
|
225 |
if test "x$CUPS_FOUND" = xno; then |
|
226 |
# Getting nervous now? Lets poke around for standard Solaris third-party |
|
227 |
# package installation locations. |
|
228 |
AC_MSG_CHECKING([for cups headers]) |
|
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
229 |
if test -s $SYSROOT/opt/sfw/cups/include/cups/cups.h; then |
20363 | 230 |
# An SFW package seems to be installed! |
231 |
CUPS_FOUND=yes |
|
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
232 |
CUPS_CFLAGS="-I$SYSROOT/opt/sfw/cups/include" |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
233 |
elif test -s $SYSROOT/opt/csw/include/cups/cups.h; then |
20363 | 234 |
# A CSW package seems to be installed! |
235 |
CUPS_FOUND=yes |
|
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
236 |
CUPS_CFLAGS="-I$SYSROOT/opt/csw/include" |
20363 | 237 |
fi |
238 |
AC_MSG_RESULT([$CUPS_FOUND]) |
|
239 |
fi |
|
240 |
if test "x$CUPS_FOUND" = xno; then |
|
241 |
HELP_MSG_MISSING_DEPENDENCY([cups]) |
|
242 |
AC_MSG_ERROR([Could not find cups! $HELP_MSG ]) |
|
243 |
fi |
|
244 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
245 |
|
20363 | 246 |
AC_SUBST(CUPS_CFLAGS) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
247 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
248 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
249 |
|
20654 | 250 |
AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE], |
251 |
[ |
|
252 |
POTENTIAL_FREETYPE_INCLUDE_PATH="$1" |
|
253 |
POTENTIAL_FREETYPE_LIB_PATH="$2" |
|
254 |
METHOD="$3" |
|
255 |
||
256 |
# First check if the files exists. |
|
257 |
if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then |
|
258 |
# We found an arbitrary include file. That's a good sign. |
|
259 |
AC_MSG_NOTICE([Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD]) |
|
260 |
FOUND_FREETYPE=yes |
|
261 |
||
262 |
FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" |
|
263 |
if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then |
|
264 |
AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location.]) |
|
265 |
FOUND_FREETYPE=no |
|
266 |
else |
|
267 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
|
268 |
# On Windows, we will need both .lib and .dll file. |
|
269 |
if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then |
|
270 |
AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location.]) |
|
271 |
FOUND_FREETYPE=no |
|
272 |
fi |
|
24081
f98557ef4bf8
8042213: Freetype detection fails on Solaris sparcv9 when using devkit
erikj
parents:
23428
diff
changeset
|
273 |
elif test "x$OPENJDK_TARGET_OS" = xsolaris \ |
f98557ef4bf8
8042213: Freetype detection fails on Solaris sparcv9 when using devkit
erikj
parents:
23428
diff
changeset
|
274 |
&& test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then |
f98557ef4bf8
8042213: Freetype detection fails on Solaris sparcv9 when using devkit
erikj
parents:
23428
diff
changeset
|
275 |
# Found lib in isa dir, use that instead. |
f98557ef4bf8
8042213: Freetype detection fails on Solaris sparcv9 when using devkit
erikj
parents:
23428
diff
changeset
|
276 |
POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" |
20654 | 277 |
fi |
278 |
fi |
|
279 |
fi |
|
280 |
||
281 |
if test "x$FOUND_FREETYPE" = xyes; then |
|
282 |
BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_INCLUDE_PATH) |
|
283 |
BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_LIB_PATH) |
|
284 |
||
285 |
FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" |
|
286 |
AC_MSG_CHECKING([for freetype includes]) |
|
287 |
AC_MSG_RESULT([$FREETYPE_INCLUDE_PATH]) |
|
288 |
FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" |
|
289 |
AC_MSG_CHECKING([for freetype libraries]) |
|
290 |
AC_MSG_RESULT([$FREETYPE_LIB_PATH]) |
|
291 |
fi |
|
292 |
]) |
|
293 |
||
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
294 |
AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
295 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
296 |
|
20363 | 297 |
############################################################################### |
298 |
# |
|
20654 | 299 |
# The ubiquitous freetype library is used to render fonts. |
20363 | 300 |
# |
301 |
AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype], |
|
20654 | 302 |
[specify prefix directory for the freetype package |
20363 | 303 |
(expecting the libraries under PATH/lib and the headers under PATH/include)])]) |
20654 | 304 |
AC_ARG_WITH(freetype-include, [AS_HELP_STRING([--with-freetype-include], |
305 |
[specify directory for the freetype include files])]) |
|
306 |
AC_ARG_WITH(freetype-lib, [AS_HELP_STRING([--with-freetype-lib], |
|
307 |
[specify directory for the freetype library])]) |
|
308 |
AC_ARG_ENABLE(freetype-bundling, [AS_HELP_STRING([--disable-freetype-bundling], |
|
309 |
[disable bundling of the freetype library with the build result @<:@enabled on Windows or when using --with-freetype, disabled otherwise@:>@])]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
310 |
|
20654 | 311 |
FREETYPE_CFLAGS= |
312 |
FREETYPE_LIBS= |
|
313 |
FREETYPE_BUNDLE_LIB_PATH= |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
314 |
|
20654 | 315 |
if test "x$FREETYPE_NOT_NEEDED" = xyes; then |
20363 | 316 |
if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then |
317 |
AC_MSG_WARN([freetype not used, so --with-freetype is ignored]) |
|
318 |
fi |
|
20654 | 319 |
if test "x$enable_freetype_bundling" != x; then |
320 |
AC_MSG_WARN([freetype not used, so --enable-freetype-bundling is ignored]) |
|
321 |
fi |
|
20363 | 322 |
else |
20654 | 323 |
# freetype is needed to build; go get it! |
324 |
||
325 |
BUNDLE_FREETYPE="$enable_freetype_bundling" |
|
326 |
||
327 |
if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then |
|
328 |
# User has specified settings |
|
329 |
||
330 |
if test "x$BUNDLE_FREETYPE" = x; then |
|
331 |
# If not specified, default is to bundle freetype |
|
332 |
BUNDLE_FREETYPE=yes |
|
333 |
fi |
|
334 |
||
335 |
if test "x$with_freetype" != x; then |
|
336 |
POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include" |
|
337 |
POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib" |
|
338 |
fi |
|
339 |
||
340 |
# Allow --with-freetype-lib and --with-freetype-include to override |
|
341 |
if test "x$with_freetype_include" != x; then |
|
342 |
POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include" |
|
343 |
fi |
|
344 |
if test "x$with_freetype_lib" != x; then |
|
345 |
POTENTIAL_FREETYPE_LIB_PATH="$with_freetype_lib" |
|
346 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
347 |
|
20654 | 348 |
if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x && test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then |
349 |
# Okay, we got it. Check that it works. |
|
350 |
LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype]) |
|
351 |
if test "x$FOUND_FREETYPE" != xyes; then |
|
352 |
AC_MSG_ERROR([Can not find or use freetype at location given by --with-freetype]) |
|
353 |
fi |
|
354 |
else |
|
355 |
# User specified only one of lib or include. This is an error. |
|
356 |
if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" = x ; then |
|
357 |
AC_MSG_NOTICE([User specified --with-freetype-lib but not --with-freetype-include]) |
|
358 |
AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.]) |
|
359 |
else |
|
360 |
AC_MSG_NOTICE([User specified --with-freetype-include but not --with-freetype-lib]) |
|
361 |
AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.]) |
|
362 |
fi |
|
20363 | 363 |
fi |
20654 | 364 |
else |
365 |
# User did not specify settings, but we need freetype. Try to locate it. |
|
366 |
||
367 |
if test "x$BUNDLE_FREETYPE" = x; then |
|
368 |
# If not specified, default is to bundle freetype only on windows |
|
369 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
|
370 |
BUNDLE_FREETYPE=yes |
|
371 |
else |
|
372 |
BUNDLE_FREETYPE=no |
|
373 |
fi |
|
374 |
fi |
|
375 |
||
376 |
if test "x$FOUND_FREETYPE" != xyes; then |
|
377 |
# Check builddeps |
|
378 |
BDEPS_CHECK_MODULE(FREETYPE, freetype2, xxx, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no]) |
|
379 |
# BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. |
|
380 |
if test "x$FOUND_FREETYPE" = xyes; then |
|
381 |
if test "x$BUNDLE_FREETYPE" = xyes; then |
|
382 |
AC_MSG_NOTICE([Found freetype using builddeps, but ignoring since we can not bundle that]) |
|
383 |
FOUND_FREETYPE=no |
|
384 |
else |
|
385 |
AC_MSG_CHECKING([for freetype]) |
|
386 |
AC_MSG_RESULT([yes (using builddeps)]) |
|
387 |
fi |
|
388 |
fi |
|
20363 | 389 |
fi |
20654 | 390 |
|
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
391 |
# If we have a sysroot, assume that's where we are supposed to look and skip pkg-config. |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
392 |
if test "x$SYSROOT" = x; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
393 |
if test "x$FOUND_FREETYPE" != xyes; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
394 |
# Check modules using pkg-config, but only if we have it (ugly output results otherwise) |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
395 |
if test "x$PKG_CONFIG" != x; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
396 |
PKG_CHECK_MODULES(FREETYPE, freetype2, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no]) |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
397 |
if test "x$FOUND_FREETYPE" = xyes; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
398 |
# On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
399 |
FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'` |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
400 |
# 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
401 |
if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
402 |
FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'` |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
403 |
fi |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
404 |
# BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
405 |
if test "x$BUNDLE_FREETYPE" = xyes; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
406 |
AC_MSG_NOTICE([Found freetype using pkg-config, but ignoring since we can not bundle that]) |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
407 |
FOUND_FREETYPE=no |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
408 |
else |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
409 |
AC_MSG_CHECKING([for freetype]) |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
410 |
AC_MSG_RESULT([yes (using pkg-config)]) |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
411 |
fi |
20654 | 412 |
fi |
413 |
fi |
|
20363 | 414 |
fi |
20654 | 415 |
fi |
416 |
||
417 |
if test "x$FOUND_FREETYPE" != xyes; then |
|
418 |
# Check in well-known locations |
|
419 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
|
420 |
FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32" |
|
421 |
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR) |
|
422 |
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) |
|
423 |
if test "x$FOUND_FREETYPE" != xyes; then |
|
424 |
FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32" |
|
425 |
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR) |
|
426 |
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) |
|
427 |
fi |
|
428 |
else |
|
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
429 |
FREETYPE_BASE_DIR="$SYSROOT/usr" |
20654 | 430 |
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) |
431 |
||
432 |
if test "x$FOUND_FREETYPE" != xyes; then |
|
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
433 |
FREETYPE_BASE_DIR="$SYSROOT/usr/X11" |
20654 | 434 |
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) |
435 |
fi |
|
436 |
||
437 |
if test "x$FOUND_FREETYPE" != xyes; then |
|
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
438 |
FREETYPE_BASE_DIR="$SYSROOT/usr/sfw" |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
439 |
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
440 |
fi |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
441 |
|
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
442 |
if test "x$FOUND_FREETYPE" != xyes; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
443 |
FREETYPE_BASE_DIR="$SYSROOT/usr" |
20654 | 444 |
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
445 |
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/x86_64-linux-gnu], [well-known location]) |
|
446 |
else |
|
447 |
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/i386-linux-gnu], [well-known location]) |
|
448 |
if test "x$FOUND_FREETYPE" != xyes; then |
|
449 |
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib32], [well-known location]) |
|
450 |
fi |
|
451 |
fi |
|
452 |
fi |
|
20363 | 453 |
fi |
20654 | 454 |
fi # end check in well-known locations |
455 |
||
456 |
if test "x$FOUND_FREETYPE" != xyes; then |
|
457 |
HELP_MSG_MISSING_DEPENDENCY([freetype]) |
|
458 |
AC_MSG_ERROR([Could not find freetype! $HELP_MSG ]) |
|
459 |
fi |
|
460 |
fi # end user specified settings |
|
461 |
||
462 |
# Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir. |
|
463 |
if test "x$FREETYPE_CFLAGS" = x; then |
|
464 |
BASIC_FIXUP_PATH(FREETYPE_INCLUDE_PATH) |
|
465 |
if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then |
|
466 |
FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH/freetype2 -I$FREETYPE_INCLUDE_PATH" |
|
467 |
else |
|
468 |
FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH" |
|
20363 | 469 |
fi |
470 |
fi |
|
20654 | 471 |
|
472 |
if test "x$FREETYPE_LIBS" = x; then |
|
473 |
BASIC_FIXUP_PATH(FREETYPE_LIB_PATH) |
|
474 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
|
475 |
FREETYPE_LIBS="$FREETYPE_LIB_PATH/freetype.lib" |
|
476 |
else |
|
477 |
FREETYPE_LIBS="-L$FREETYPE_LIB_PATH -lfreetype" |
|
20363 | 478 |
fi |
479 |
fi |
|
14111 | 480 |
|
20654 | 481 |
# Try to compile it |
482 |
AC_MSG_CHECKING([if we can compile and link with freetype]) |
|
483 |
AC_LANG_PUSH(C++) |
|
484 |
PREV_CXXCFLAGS="$CXXFLAGS" |
|
21056
16245d19b19a
8027300: configure should use LIBS instead of LDFLAGS when testing freetype
ihse
parents:
20655
diff
changeset
|
485 |
PREV_LIBS="$LIBS" |
20654 | 486 |
PREV_CXX="$CXX" |
487 |
CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" |
|
21056
16245d19b19a
8027300: configure should use LIBS instead of LDFLAGS when testing freetype
ihse
parents:
20655
diff
changeset
|
488 |
LIBS="$LIBS $FREETYPE_LIBS" |
20654 | 489 |
CXX="$FIXPATH $CXX" |
490 |
AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
491 |
#include<ft2build.h> |
|
492 |
#include FT_FREETYPE_H |
|
493 |
int main () { |
|
494 |
FT_Init_FreeType(NULL); |
|
495 |
return 0; |
|
496 |
} |
|
497 |
]])], |
|
498 |
[ |
|
499 |
AC_MSG_RESULT([yes]) |
|
500 |
], |
|
501 |
[ |
|
502 |
AC_MSG_RESULT([no]) |
|
503 |
AC_MSG_NOTICE([Could not compile and link with freetype. This might be a 32/64-bit mismatch.]) |
|
504 |
AC_MSG_NOTICE([Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS]) |
|
505 |
||
506 |
HELP_MSG_MISSING_DEPENDENCY([freetype]) |
|
507 |
||
508 |
AC_MSG_ERROR([Can not continue without freetype. $HELP_MSG]) |
|
509 |
] |
|
510 |
) |
|
511 |
CXXCFLAGS="$PREV_CXXFLAGS" |
|
21056
16245d19b19a
8027300: configure should use LIBS instead of LDFLAGS when testing freetype
ihse
parents:
20655
diff
changeset
|
512 |
LIBS="$PREV_LIBS" |
20654 | 513 |
CXX="$PREV_CXX" |
514 |
AC_LANG_POP(C++) |
|
515 |
||
516 |
AC_MSG_CHECKING([if we should bundle freetype]) |
|
517 |
if test "x$BUNDLE_FREETYPE" = xyes; then |
|
518 |
FREETYPE_BUNDLE_LIB_PATH="$FREETYPE_LIB_PATH" |
|
20363 | 519 |
fi |
20654 | 520 |
AC_MSG_RESULT([$BUNDLE_FREETYPE]) |
521 |
||
522 |
fi # end freetype needed |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
523 |
|
20654 | 524 |
AC_SUBST(FREETYPE_BUNDLE_LIB_PATH) |
525 |
AC_SUBST(FREETYPE_CFLAGS) |
|
526 |
AC_SUBST(FREETYPE_LIBS) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
527 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
528 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
529 |
AC_DEFUN_ONCE([LIB_SETUP_ALSA], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
530 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
531 |
|
20363 | 532 |
############################################################################### |
533 |
# |
|
534 |
# Check for alsa headers and libraries. Used on Linux/GNU systems. |
|
535 |
# |
|
536 |
AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa], |
|
537 |
[specify prefix directory for the alsa package |
|
538 |
(expecting the libraries under PATH/lib and the headers under PATH/include)])]) |
|
539 |
AC_ARG_WITH(alsa-include, [AS_HELP_STRING([--with-alsa-include], |
|
540 |
[specify directory for the alsa include files])]) |
|
541 |
AC_ARG_WITH(alsa-lib, [AS_HELP_STRING([--with-alsa-lib], |
|
542 |
[specify directory for the alsa library])]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
543 |
|
20363 | 544 |
if test "x$ALSA_NOT_NEEDED" = xyes; then |
545 |
if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then |
|
546 |
AC_MSG_WARN([alsa not used, so --with-alsa is ignored]) |
|
547 |
fi |
|
548 |
ALSA_CFLAGS= |
|
549 |
ALSA_LIBS= |
|
550 |
else |
|
551 |
ALSA_FOUND=no |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
552 |
|
20363 | 553 |
if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then |
554 |
AC_MSG_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.]) |
|
555 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
556 |
|
20363 | 557 |
if test "x${with_alsa}" != x; then |
22710
3a5575792497
8033921: Build fails if --with-alsa option is used due to incorrect ALSA link parameter in autoconf script.
ihse
parents:
22467
diff
changeset
|
558 |
ALSA_LIBS="-L${with_alsa}/lib -lasound" |
20363 | 559 |
ALSA_CFLAGS="-I${with_alsa}/include" |
560 |
ALSA_FOUND=yes |
|
561 |
fi |
|
562 |
if test "x${with_alsa_include}" != x; then |
|
563 |
ALSA_CFLAGS="-I${with_alsa_include}" |
|
564 |
ALSA_FOUND=yes |
|
565 |
fi |
|
566 |
if test "x${with_alsa_lib}" != x; then |
|
22710
3a5575792497
8033921: Build fails if --with-alsa option is used due to incorrect ALSA link parameter in autoconf script.
ihse
parents:
22467
diff
changeset
|
567 |
ALSA_LIBS="-L${with_alsa_lib} -lasound" |
20363 | 568 |
ALSA_FOUND=yes |
569 |
fi |
|
570 |
if test "x$ALSA_FOUND" = xno; then |
|
571 |
BDEPS_CHECK_MODULE(ALSA, alsa, xxx, [ALSA_FOUND=yes], [ALSA_FOUND=no]) |
|
572 |
fi |
|
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
573 |
# Do not try pkg-config if we have a sysroot set. |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
574 |
if test "x$SYSROOT" = x; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
575 |
if test "x$ALSA_FOUND" = xno; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
576 |
PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no]) |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
577 |
fi |
20363 | 578 |
fi |
579 |
if test "x$ALSA_FOUND" = xno; then |
|
580 |
AC_CHECK_HEADERS([alsa/asoundlib.h], |
|
581 |
[ |
|
582 |
ALSA_FOUND=yes |
|
583 |
ALSA_CFLAGS=-Iignoreme |
|
584 |
ALSA_LIBS=-lasound |
|
585 |
DEFAULT_ALSA=yes |
|
586 |
], |
|
587 |
[ALSA_FOUND=no]) |
|
588 |
fi |
|
589 |
if test "x$ALSA_FOUND" = xno; then |
|
590 |
HELP_MSG_MISSING_DEPENDENCY([alsa]) |
|
591 |
AC_MSG_ERROR([Could not find alsa! $HELP_MSG ]) |
|
592 |
fi |
|
593 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
594 |
|
20363 | 595 |
AC_SUBST(ALSA_CFLAGS) |
596 |
AC_SUBST(ALSA_LIBS) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
597 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
598 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
599 |
AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
600 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
601 |
|
20363 | 602 |
############################################################################### |
603 |
# |
|
604 |
# Check for the jpeg library |
|
605 |
# |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
606 |
|
20363 | 607 |
USE_EXTERNAL_LIBJPEG=true |
608 |
AC_CHECK_LIB(jpeg, main, [], |
|
609 |
[ USE_EXTERNAL_LIBJPEG=false |
|
610 |
AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source]) |
|
611 |
]) |
|
612 |
AC_SUBST(USE_EXTERNAL_LIBJPEG) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
613 |
|
20363 | 614 |
############################################################################### |
615 |
# |
|
616 |
# Check for the gif library |
|
617 |
# |
|
618 |
||
619 |
AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib], |
|
620 |
[use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) |
|
16424 | 621 |
|
622 |
||
20363 | 623 |
AC_MSG_CHECKING([for which giflib to use]) |
16424 | 624 |
|
20363 | 625 |
# default is bundled |
626 |
DEFAULT_GIFLIB=bundled |
|
16424 | 627 |
|
20363 | 628 |
# |
629 |
# if user didn't specify, use DEFAULT_GIFLIB |
|
630 |
# |
|
631 |
if test "x${with_giflib}" = "x"; then |
|
16424 | 632 |
with_giflib=${DEFAULT_GIFLIB} |
20363 | 633 |
fi |
16424 | 634 |
|
20363 | 635 |
AC_MSG_RESULT(${with_giflib}) |
16424 | 636 |
|
20363 | 637 |
if test "x${with_giflib}" = "xbundled"; then |
16424 | 638 |
USE_EXTERNAL_LIBGIF=false |
20363 | 639 |
elif test "x${with_giflib}" = "xsystem"; then |
16424 | 640 |
AC_CHECK_HEADER(gif_lib.h, [], |
20363 | 641 |
[ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])]) |
16424 | 642 |
AC_CHECK_LIB(gif, DGifGetCode, [], |
20363 | 643 |
[ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])]) |
16424 | 644 |
|
645 |
USE_EXTERNAL_LIBGIF=true |
|
20363 | 646 |
else |
16424 | 647 |
AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled']) |
20363 | 648 |
fi |
649 |
AC_SUBST(USE_EXTERNAL_LIBGIF) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
650 |
|
20363 | 651 |
############################################################################### |
652 |
# |
|
24413 | 653 |
# Check for the lcms2 library |
654 |
# |
|
655 |
||
656 |
AC_ARG_WITH(lcms, [AS_HELP_STRING([--with-lcms], |
|
657 |
[use lcms2 from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) |
|
658 |
||
659 |
AC_MSG_CHECKING([for which lcms to use]) |
|
660 |
||
661 |
DEFAULT_LCMS=bundled |
|
662 |
||
663 |
# |
|
664 |
# If user didn't specify, use DEFAULT_LCMS |
|
665 |
# |
|
666 |
if test "x${with_lcms}" = "x"; then |
|
667 |
with_lcms=${DEFAULT_LCMS} |
|
668 |
fi |
|
669 |
||
670 |
if test "x${with_lcms}" = "xbundled"; then |
|
671 |
USE_EXTERNAL_LCMS=false |
|
672 |
AC_MSG_RESULT([bundled]) |
|
673 |
elif test "x${with_lcms}" = "xsystem"; then |
|
674 |
AC_MSG_RESULT([system]) |
|
675 |
PKG_CHECK_MODULES([LCMS], [lcms2], [LCMS_FOUND=yes], [LCMS_FOUND=no]) |
|
676 |
if test "x${LCMS_FOUND}" = "xyes"; then |
|
677 |
USE_EXTERNAL_LCMS=true |
|
678 |
else |
|
679 |
AC_MSG_ERROR([--with-lcms=system specified, but no lcms found!]) |
|
680 |
fi |
|
681 |
else |
|
682 |
AC_MSG_ERROR([Invalid value for --with-lcms: ${with_lcms}, use 'system' or 'bundled']) |
|
683 |
fi |
|
684 |
||
685 |
AC_SUBST(USE_EXTERNAL_LCMS) |
|
686 |
||
687 |
############################################################################### |
|
688 |
# |
|
23163 | 689 |
# Check for the png library |
690 |
# |
|
691 |
||
692 |
AC_ARG_WITH(libpng, [AS_HELP_STRING([--with-libpng], |
|
693 |
[use libpng from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) |
|
694 |
||
695 |
||
696 |
AC_MSG_CHECKING([for which libpng to use]) |
|
697 |
||
698 |
# default is bundled |
|
699 |
DEFAULT_LIBPNG=bundled |
|
700 |
||
701 |
# |
|
702 |
# if user didn't specify, use DEFAULT_LIBPNG |
|
703 |
# |
|
704 |
if test "x${with_libpng}" = "x"; then |
|
705 |
with_libpng=${DEFAULT_LIBPNG} |
|
706 |
fi |
|
707 |
||
708 |
if test "x${with_libpng}" = "xbundled"; then |
|
709 |
USE_EXTERNAL_LIBPNG=false |
|
710 |
AC_MSG_RESULT([bundled]) |
|
711 |
elif test "x${with_libpng}" = "xsystem"; then |
|
712 |
PKG_CHECK_MODULES(PNG, libpng, |
|
713 |
[ LIBPNG_FOUND=yes ], |
|
714 |
[ LIBPNG_FOUND=no ]) |
|
715 |
if test "x${LIBPNG_FOUND}" = "xyes"; then |
|
716 |
USE_EXTERNAL_LIBPNG=true |
|
717 |
AC_MSG_RESULT([system]) |
|
718 |
else |
|
719 |
AC_MSG_RESULT([system not found]) |
|
720 |
AC_MSG_ERROR([--with-libpng=system specified, but no libpng found!]) |
|
721 |
fi |
|
722 |
else |
|
723 |
AC_MSG_ERROR([Invalid value of --with-libpng: ${with_libpng}, use 'system' or 'bundled']) |
|
724 |
fi |
|
725 |
AC_SUBST(USE_EXTERNAL_LIBPNG) |
|
726 |
||
727 |
############################################################################### |
|
728 |
# |
|
20363 | 729 |
# Check for the zlib library |
730 |
# |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
731 |
|
20363 | 732 |
AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib], |
733 |
[use zlib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
734 |
|
20363 | 735 |
AC_CHECK_LIB(z, compress, |
736 |
[ ZLIB_FOUND=yes ], |
|
737 |
[ ZLIB_FOUND=no ]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
738 |
|
20363 | 739 |
AC_MSG_CHECKING([for which zlib to use]) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
740 |
|
20363 | 741 |
DEFAULT_ZLIB=bundled |
742 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
743 |
# |
|
744 |
# On macosx default is system...on others default is |
|
745 |
# |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
746 |
DEFAULT_ZLIB=system |
20363 | 747 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
748 |
|
20363 | 749 |
if test "x${ZLIB_FOUND}" != "xyes"; then |
750 |
# |
|
751 |
# If we don't find any system...set default to bundled |
|
752 |
# |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
753 |
DEFAULT_ZLIB=bundled |
20363 | 754 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
755 |
|
20363 | 756 |
# |
757 |
# If user didn't specify, use DEFAULT_ZLIB |
|
758 |
# |
|
759 |
if test "x${with_zlib}" = "x"; then |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
760 |
with_zlib=${DEFAULT_ZLIB} |
20363 | 761 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
762 |
|
20363 | 763 |
if test "x${with_zlib}" = "xbundled"; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
764 |
USE_EXTERNAL_LIBZ=false |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
765 |
AC_MSG_RESULT([bundled]) |
20363 | 766 |
elif test "x${with_zlib}" = "xsystem"; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
767 |
if test "x${ZLIB_FOUND}" = "xyes"; then |
20363 | 768 |
USE_EXTERNAL_LIBZ=true |
769 |
AC_MSG_RESULT([system]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
770 |
else |
20363 | 771 |
AC_MSG_RESULT([system not found]) |
772 |
AC_MSG_ERROR([--with-zlib=system specified, but no zlib found!]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
773 |
fi |
20363 | 774 |
else |
775 |
AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled']) |
|
776 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
777 |
|
20363 | 778 |
AC_SUBST(USE_EXTERNAL_LIBZ) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
779 |
|
20363 | 780 |
############################################################################### |
781 |
LIBZIP_CAN_USE_MMAP=true |
|
13697 | 782 |
|
20363 | 783 |
AC_SUBST(LIBZIP_CAN_USE_MMAP) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
784 |
|
20363 | 785 |
############################################################################### |
786 |
# |
|
787 |
# Check if altzone exists in time.h |
|
788 |
# |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
789 |
|
20363 | 790 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [return (int)altzone;])], |
791 |
[has_altzone=yes], |
|
792 |
[has_altzone=no]) |
|
793 |
if test "x$has_altzone" = xyes; then |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
794 |
AC_DEFINE([HAVE_ALTZONE], 1, [Define if you have the external 'altzone' variable in time.h]) |
20363 | 795 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
796 |
|
20363 | 797 |
############################################################################### |
798 |
# |
|
799 |
# Check the maths library |
|
800 |
# |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
801 |
|
20363 | 802 |
AC_CHECK_LIB(m, cos, [], |
803 |
[ |
|
804 |
AC_MSG_NOTICE([Maths library was not found]) |
|
805 |
] |
|
806 |
) |
|
807 |
AC_SUBST(LIBM) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
808 |
|
20363 | 809 |
############################################################################### |
810 |
# |
|
811 |
# Check for libdl.so |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
812 |
|
20363 | 813 |
save_LIBS="$LIBS" |
814 |
LIBS="" |
|
815 |
AC_CHECK_LIB(dl,dlopen) |
|
816 |
LIBDL="$LIBS" |
|
817 |
AC_SUBST(LIBDL) |
|
818 |
LIBS="$save_LIBS" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
819 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
820 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
821 |
AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
822 |
[ |
20363 | 823 |
############################################################################### |
824 |
# |
|
825 |
# statically link libstdc++ before C++ ABI is stablized on Linux unless |
|
826 |
# dynamic build is configured on command line. |
|
827 |
# |
|
828 |
AC_ARG_WITH([stdc++lib], [AS_HELP_STRING([--with-stdc++lib=<static>,<dynamic>,<default>], |
|
829 |
[force linking of the C++ runtime on Linux to either static or dynamic, default is static with dynamic as fallback])], |
|
830 |
[ |
|
831 |
if test "x$with_stdc__lib" != xdynamic && test "x$with_stdc__lib" != xstatic \ |
|
832 |
&& test "x$with_stdc__lib" != xdefault; then |
|
833 |
AC_MSG_ERROR([Bad parameter value --with-stdc++lib=$with_stdc__lib!]) |
|
834 |
fi |
|
835 |
], |
|
836 |
[with_stdc__lib=default] |
|
837 |
) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
838 |
|
20363 | 839 |
if test "x$OPENJDK_TARGET_OS" = xlinux; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
840 |
# Test if -lstdc++ works. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
841 |
AC_MSG_CHECKING([if dynamic link of stdc++ is possible]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
842 |
AC_LANG_PUSH(C++) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
843 |
OLD_CXXFLAGS="$CXXFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
844 |
CXXFLAGS="$CXXFLAGS -lstdc++" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
845 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])], |
20363 | 846 |
[has_dynamic_libstdcxx=yes], |
847 |
[has_dynamic_libstdcxx=no]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
848 |
CXXFLAGS="$OLD_CXXFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
849 |
AC_LANG_POP(C++) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
850 |
AC_MSG_RESULT([$has_dynamic_libstdcxx]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
851 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
852 |
# Test if stdc++ can be linked statically. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
853 |
AC_MSG_CHECKING([if static link of stdc++ is possible]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
854 |
STATIC_STDCXX_FLAGS="-Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
855 |
AC_LANG_PUSH(C++) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
856 |
OLD_LIBS="$LIBS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
857 |
OLD_CXX="$CXX" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
858 |
LIBS="$STATIC_STDCXX_FLAGS" |
20363 | 859 |
CXX="$CC" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
860 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])], |
20363 | 861 |
[has_static_libstdcxx=yes], |
862 |
[has_static_libstdcxx=no]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
863 |
LIBS="$OLD_LIBS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
864 |
CXX="$OLD_CXX" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
865 |
AC_LANG_POP(C++) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
866 |
AC_MSG_RESULT([$has_static_libstdcxx]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
867 |
|
14459
6213b3f9e08d
8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents:
14280
diff
changeset
|
868 |
if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then |
20363 | 869 |
AC_MSG_ERROR([Cannot link to stdc++, neither dynamically nor statically!]) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
870 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
871 |
|
14459
6213b3f9e08d
8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents:
14280
diff
changeset
|
872 |
if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then |
20363 | 873 |
AC_MSG_ERROR([Static linking of libstdc++ was not possible!]) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
874 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
875 |
|
14459
6213b3f9e08d
8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents:
14280
diff
changeset
|
876 |
if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then |
20363 | 877 |
AC_MSG_ERROR([Dynamic linking of libstdc++ was not possible!]) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
878 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
879 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
880 |
AC_MSG_CHECKING([how to link with libstdc++]) |
14459
6213b3f9e08d
8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents:
14280
diff
changeset
|
881 |
# If dynamic was requested, it's available since it would fail above otherwise. |
6213b3f9e08d
8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents:
14280
diff
changeset
|
882 |
# If dynamic wasn't requested, go with static unless it isn't available. |
16581
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
883 |
if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then |
20363 | 884 |
LIBCXX="$LIBCXX -lstdc++" |
885 |
LDCXX="$CXX" |
|
886 |
STATIC_CXX_SETTING="STATIC_CXX=false" |
|
887 |
AC_MSG_RESULT([dynamic]) |
|
14459
6213b3f9e08d
8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents:
14280
diff
changeset
|
888 |
else |
20363 | 889 |
LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS" |
890 |
LDCXX="$CC" |
|
891 |
STATIC_CXX_SETTING="STATIC_CXX=true" |
|
892 |
AC_MSG_RESULT([static]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
893 |
fi |
20363 | 894 |
fi |
895 |
AC_SUBST(STATIC_CXX_SETTING) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
896 |
|
20363 | 897 |
if test "x$JVM_VARIANT_ZERO" = xtrue || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then |
16581
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
898 |
# Figure out LIBFFI_CFLAGS and LIBFFI_LIBS |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
899 |
PKG_CHECK_MODULES([LIBFFI], [libffi]) |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
900 |
|
20363 | 901 |
fi |
16581
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
902 |
|
20363 | 903 |
if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then |
16581
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
904 |
AC_CHECK_PROG([LLVM_CONFIG], [llvm-config], [llvm-config]) |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
905 |
|
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
906 |
if test "x$LLVM_CONFIG" != xllvm-config; then |
20363 | 907 |
AC_MSG_ERROR([llvm-config not found in $PATH.]) |
16581
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
908 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
909 |
|
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
910 |
llvm_components="jit mcjit engine nativecodegen native" |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
911 |
unset LLVM_CFLAGS |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
912 |
for flag in $("$LLVM_CONFIG" --cxxflags); do |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
913 |
if echo "${flag}" | grep -q '^-@<:@ID@:>@'; then |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
914 |
if test "${flag}" != "-D_DEBUG" ; then |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
915 |
if test "${LLVM_CFLAGS}" != "" ; then |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
916 |
LLVM_CFLAGS="${LLVM_CFLAGS} " |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
917 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
918 |
LLVM_CFLAGS="${LLVM_CFLAGS}${flag}" |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
919 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
920 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
921 |
done |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
922 |
llvm_version=$("${LLVM_CONFIG}" --version | sed 's/\.//; s/svn.*//') |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
923 |
LLVM_CFLAGS="${LLVM_CFLAGS} -DSHARK_LLVM_VERSION=${llvm_version}" |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
924 |
|
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
925 |
unset LLVM_LDFLAGS |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
926 |
for flag in $("${LLVM_CONFIG}" --ldflags); do |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
927 |
if echo "${flag}" | grep -q '^-L'; then |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
928 |
if test "${LLVM_LDFLAGS}" != ""; then |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
929 |
LLVM_LDFLAGS="${LLVM_LDFLAGS} " |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
930 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
931 |
LLVM_LDFLAGS="${LLVM_LDFLAGS}${flag}" |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
932 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
933 |
done |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
934 |
|
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
935 |
unset LLVM_LIBS |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
936 |
for flag in $("${LLVM_CONFIG}" --libs ${llvm_components}); do |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
937 |
if echo "${flag}" | grep -q '^-l'; then |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
938 |
if test "${LLVM_LIBS}" != ""; then |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
939 |
LLVM_LIBS="${LLVM_LIBS} " |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
940 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
941 |
LLVM_LIBS="${LLVM_LIBS}${flag}" |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
942 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
943 |
done |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
944 |
|
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
945 |
AC_SUBST(LLVM_CFLAGS) |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
946 |
AC_SUBST(LLVM_LDFLAGS) |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
947 |
AC_SUBST(LLVM_LIBS) |
20363 | 948 |
fi |
16581
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
949 |
|
20363 | 950 |
# libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
951 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio && test "x$LIBCXX" = x; then |
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
952 |
LIBCXX="${SYSROOT}/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1" |
20363 | 953 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
954 |
|
20363 | 955 |
# TODO better (platform agnostic) test |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
956 |
if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$TOOLCHAIN_TYPE" = xgcc; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
957 |
LIBCXX="-lstdc++" |
20363 | 958 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
959 |
|
20363 | 960 |
AC_SUBST(LIBCXX) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
961 |
]) |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
962 |
|
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
963 |
AC_DEFUN_ONCE([LIB_SETUP_ON_WINDOWS], |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
964 |
[ |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
965 |
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
966 |
TOOLCHAIN_SETUP_MSVCR_DLL |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
967 |
BASIC_DEPRECATED_ARG_WITH([dxsdk]) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
968 |
BASIC_DEPRECATED_ARG_WITH([dxsdk-lib]) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
969 |
BASIC_DEPRECATED_ARG_WITH([dxsdk-include]) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
970 |
fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
971 |
AC_SUBST(MSVCR_DLL) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
972 |
]) |