author | shade |
Thu, 02 Oct 2014 17:13:31 +0400 | |
changeset 27003 | 19617f4c9dd0 |
parent 26400 | 4d6c6f2df610 |
child 27239 | 12771c65e334 |
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 |
|
26400
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
250 |
AC_DEFUN([LIB_BUILD_FREETYPE], |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
251 |
[ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
252 |
FREETYPE_SRC_PATH="$1" |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
253 |
BUILD_FREETYPE=yes |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
254 |
|
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
255 |
# Check if the freetype sources are acessible.. |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
256 |
if ! test -d $FREETYPE_SRC_PATH; then |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
257 |
AC_MSG_WARN([--with-freetype-src specified, but can't find path "$FREETYPE_SRC_PATH" - ignoring --with-freetype-src]) |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
258 |
BUILD_FREETYPE=no |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
259 |
fi |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
260 |
# ..and contain a vc2010 project file |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
261 |
vcxproj_path="$FREETYPE_SRC_PATH/builds/windows/vc2010/freetype.vcxproj" |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
262 |
if test "x$BUILD_FREETYPE" = xyes && ! test -s $vcxproj_path; then |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
263 |
AC_MSG_WARN([Can't find project file $vcxproj_path (you may try a newer freetype version) - ignoring --with-freetype-src]) |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
264 |
BUILD_FREETYPE=no |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
265 |
fi |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
266 |
# Now check if configure found a version of 'msbuild.exe' |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
267 |
if test "x$BUILD_FREETYPE" = xyes && test "x$MSBUILD" == x ; then |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
268 |
AC_MSG_WARN([Can't find an msbuild.exe executable (you may try to install .NET 4.0) - ignoring --with-freetype-src]) |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
269 |
BUILD_FREETYPE=no |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
270 |
fi |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
271 |
|
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
272 |
# Ready to go.. |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
273 |
if test "x$BUILD_FREETYPE" = xyes; then |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
274 |
|
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
275 |
# msbuild requires trailing slashes for output directories |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
276 |
freetype_lib_path="$FREETYPE_SRC_PATH/lib$OPENJDK_TARGET_CPU_BITS/" |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
277 |
freetype_lib_path_unix="$freetype_lib_path" |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
278 |
freetype_obj_path="$FREETYPE_SRC_PATH/obj$OPENJDK_TARGET_CPU_BITS/" |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
279 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(vcxproj_path) |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
280 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(freetype_lib_path) |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
281 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(freetype_obj_path) |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
282 |
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
283 |
freetype_platform=x64 |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
284 |
else |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
285 |
freetype_platform=win32 |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
286 |
fi |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
287 |
|
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
288 |
# The original freetype project file is for VS 2010 (i.e. 'v100'), |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
289 |
# so we have to adapt the toolset if building with any other toolsed (i.e. SDK). |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
290 |
# Currently 'PLATFORM_TOOLSET' is set in 'TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT'/ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
291 |
# 'TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT' in toolchain_windows.m4 |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
292 |
AC_MSG_NOTICE([Trying to compile freetype sources with PlatformToolset=$PLATFORM_TOOLSET to $freetype_lib_path_unix ...]) |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
293 |
|
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
294 |
# First we try to build the freetype.dll |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
295 |
$ECHO -e "@echo off\n"\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
296 |
"$MSBUILD $vcxproj_path "\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
297 |
"/p:PlatformToolset=$PLATFORM_TOOLSET "\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
298 |
"/p:Configuration=\"Release Multithreaded\" "\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
299 |
"/p:Platform=$freetype_platform "\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
300 |
"/p:ConfigurationType=DynamicLibrary "\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
301 |
"/p:TargetName=freetype "\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
302 |
"/p:OutDir=\"$freetype_lib_path\" "\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
303 |
"/p:IntDir=\"$freetype_obj_path\" > freetype.log" > freetype.bat |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
304 |
cmd /c freetype.bat |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
305 |
|
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
306 |
if test -s "$freetype_lib_path_unix/freetype.dll"; then |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
307 |
# If that succeeds we also build freetype.lib |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
308 |
$ECHO -e "@echo off\n"\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
309 |
"$MSBUILD $vcxproj_path "\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
310 |
"/p:PlatformToolset=$PLATFORM_TOOLSET "\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
311 |
"/p:Configuration=\"Release Multithreaded\" "\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
312 |
"/p:Platform=$freetype_platform "\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
313 |
"/p:ConfigurationType=StaticLibrary "\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
314 |
"/p:TargetName=freetype "\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
315 |
"/p:OutDir=\"$freetype_lib_path\" "\ |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
316 |
"/p:IntDir=\"$freetype_obj_path\" >> freetype.log" > freetype.bat |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
317 |
cmd /c freetype.bat |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
318 |
|
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
319 |
if test -s "$freetype_lib_path_unix/freetype.lib"; then |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
320 |
# Once we build both, lib and dll, set freetype lib and include path appropriately |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
321 |
POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_SRC_PATH/include" |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
322 |
POTENTIAL_FREETYPE_LIB_PATH="$freetype_lib_path_unix" |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
323 |
AC_MSG_NOTICE([Compiling freetype sources succeeded! (see freetype.log for build results)]) |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
324 |
else |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
325 |
BUILD_FREETYPE=no |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
326 |
fi |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
327 |
else |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
328 |
BUILD_FREETYPE=no |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
329 |
fi |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
330 |
fi |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
331 |
]) |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
332 |
|
20654 | 333 |
AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE], |
334 |
[ |
|
335 |
POTENTIAL_FREETYPE_INCLUDE_PATH="$1" |
|
336 |
POTENTIAL_FREETYPE_LIB_PATH="$2" |
|
337 |
METHOD="$3" |
|
26400
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
338 |
|
20654 | 339 |
# First check if the files exists. |
340 |
if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then |
|
341 |
# We found an arbitrary include file. That's a good sign. |
|
342 |
AC_MSG_NOTICE([Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD]) |
|
343 |
FOUND_FREETYPE=yes |
|
344 |
||
345 |
FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" |
|
346 |
if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then |
|
347 |
AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location.]) |
|
348 |
FOUND_FREETYPE=no |
|
349 |
else |
|
350 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
|
351 |
# On Windows, we will need both .lib and .dll file. |
|
352 |
if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then |
|
353 |
AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location.]) |
|
354 |
FOUND_FREETYPE=no |
|
355 |
fi |
|
24081
f98557ef4bf8
8042213: Freetype detection fails on Solaris sparcv9 when using devkit
erikj
parents:
23428
diff
changeset
|
356 |
elif test "x$OPENJDK_TARGET_OS" = xsolaris \ |
f98557ef4bf8
8042213: Freetype detection fails on Solaris sparcv9 when using devkit
erikj
parents:
23428
diff
changeset
|
357 |
&& 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
|
358 |
# Found lib in isa dir, use that instead. |
f98557ef4bf8
8042213: Freetype detection fails on Solaris sparcv9 when using devkit
erikj
parents:
23428
diff
changeset
|
359 |
POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" |
20654 | 360 |
fi |
361 |
fi |
|
362 |
fi |
|
363 |
||
364 |
if test "x$FOUND_FREETYPE" = xyes; then |
|
365 |
BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_INCLUDE_PATH) |
|
366 |
BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_LIB_PATH) |
|
367 |
||
368 |
FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" |
|
369 |
AC_MSG_CHECKING([for freetype includes]) |
|
370 |
AC_MSG_RESULT([$FREETYPE_INCLUDE_PATH]) |
|
371 |
FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" |
|
372 |
AC_MSG_CHECKING([for freetype libraries]) |
|
373 |
AC_MSG_RESULT([$FREETYPE_LIB_PATH]) |
|
374 |
fi |
|
375 |
]) |
|
376 |
||
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
377 |
AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
378 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
379 |
|
20363 | 380 |
############################################################################### |
381 |
# |
|
20654 | 382 |
# The ubiquitous freetype library is used to render fonts. |
20363 | 383 |
# |
384 |
AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype], |
|
20654 | 385 |
[specify prefix directory for the freetype package |
20363 | 386 |
(expecting the libraries under PATH/lib and the headers under PATH/include)])]) |
20654 | 387 |
AC_ARG_WITH(freetype-include, [AS_HELP_STRING([--with-freetype-include], |
388 |
[specify directory for the freetype include files])]) |
|
389 |
AC_ARG_WITH(freetype-lib, [AS_HELP_STRING([--with-freetype-lib], |
|
390 |
[specify directory for the freetype library])]) |
|
26400
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
391 |
AC_ARG_WITH(freetype-src, [AS_HELP_STRING([--with-freetype-src], |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
392 |
[specify directory with freetype sources to automatically build the library (experimental, Windows-only)])]) |
20654 | 393 |
AC_ARG_ENABLE(freetype-bundling, [AS_HELP_STRING([--disable-freetype-bundling], |
394 |
[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
|
395 |
|
20654 | 396 |
FREETYPE_CFLAGS= |
397 |
FREETYPE_LIBS= |
|
398 |
FREETYPE_BUNDLE_LIB_PATH= |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
399 |
|
20654 | 400 |
if test "x$FREETYPE_NOT_NEEDED" = xyes; then |
26400
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
401 |
if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x || test "x$with_freetype_src" != x; then |
20363 | 402 |
AC_MSG_WARN([freetype not used, so --with-freetype is ignored]) |
403 |
fi |
|
20654 | 404 |
if test "x$enable_freetype_bundling" != x; then |
405 |
AC_MSG_WARN([freetype not used, so --enable-freetype-bundling is ignored]) |
|
406 |
fi |
|
20363 | 407 |
else |
20654 | 408 |
# freetype is needed to build; go get it! |
409 |
||
410 |
BUNDLE_FREETYPE="$enable_freetype_bundling" |
|
411 |
||
26400
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
412 |
if test "x$with_freetype_src" != x; then |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
413 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
414 |
# Try to build freetype if --with-freetype-src was given on Windows |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
415 |
LIB_BUILD_FREETYPE([$with_freetype_src]) |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
416 |
if test "x$BUILD_FREETYPE" = xyes; then |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
417 |
# Okay, we built it. Check that it works. |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
418 |
LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype-src]) |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
419 |
if test "x$FOUND_FREETYPE" != xyes; then |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
420 |
AC_MSG_ERROR([Can not use the built freetype at location given by --with-freetype-src]) |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
421 |
fi |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
422 |
else |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
423 |
AC_MSG_NOTICE([User specified --with-freetype-src but building freetype failed. (see freetype.log for build results)]) |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
424 |
AC_MSG_ERROR([Consider building freetype manually and using --with-freetype instead.]) |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
425 |
fi |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
426 |
else |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
427 |
AC_MSG_WARN([--with-freetype-src is currently only supported on Windows - ignoring]) |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
428 |
fi |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
429 |
fi |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
430 |
|
20654 | 431 |
if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then |
432 |
# User has specified settings |
|
433 |
||
434 |
if test "x$BUNDLE_FREETYPE" = x; then |
|
435 |
# If not specified, default is to bundle freetype |
|
436 |
BUNDLE_FREETYPE=yes |
|
437 |
fi |
|
26400
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
438 |
|
20654 | 439 |
if test "x$with_freetype" != x; then |
440 |
POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include" |
|
441 |
POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib" |
|
442 |
fi |
|
26400
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
443 |
|
20654 | 444 |
# Allow --with-freetype-lib and --with-freetype-include to override |
445 |
if test "x$with_freetype_include" != x; then |
|
446 |
POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include" |
|
447 |
fi |
|
448 |
if test "x$with_freetype_lib" != x; then |
|
449 |
POTENTIAL_FREETYPE_LIB_PATH="$with_freetype_lib" |
|
450 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
451 |
|
20654 | 452 |
if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x && test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then |
453 |
# Okay, we got it. Check that it works. |
|
454 |
LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype]) |
|
455 |
if test "x$FOUND_FREETYPE" != xyes; then |
|
456 |
AC_MSG_ERROR([Can not find or use freetype at location given by --with-freetype]) |
|
457 |
fi |
|
458 |
else |
|
459 |
# User specified only one of lib or include. This is an error. |
|
460 |
if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" = x ; then |
|
461 |
AC_MSG_NOTICE([User specified --with-freetype-lib but not --with-freetype-include]) |
|
462 |
AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.]) |
|
463 |
else |
|
464 |
AC_MSG_NOTICE([User specified --with-freetype-include but not --with-freetype-lib]) |
|
465 |
AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.]) |
|
466 |
fi |
|
20363 | 467 |
fi |
20654 | 468 |
else |
469 |
# User did not specify settings, but we need freetype. Try to locate it. |
|
470 |
||
471 |
if test "x$BUNDLE_FREETYPE" = x; then |
|
472 |
# If not specified, default is to bundle freetype only on windows |
|
473 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
|
474 |
BUNDLE_FREETYPE=yes |
|
475 |
else |
|
476 |
BUNDLE_FREETYPE=no |
|
477 |
fi |
|
478 |
fi |
|
479 |
||
480 |
if test "x$FOUND_FREETYPE" != xyes; then |
|
481 |
# Check builddeps |
|
482 |
BDEPS_CHECK_MODULE(FREETYPE, freetype2, xxx, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no]) |
|
483 |
# BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. |
|
484 |
if test "x$FOUND_FREETYPE" = xyes; then |
|
485 |
if test "x$BUNDLE_FREETYPE" = xyes; then |
|
486 |
AC_MSG_NOTICE([Found freetype using builddeps, but ignoring since we can not bundle that]) |
|
487 |
FOUND_FREETYPE=no |
|
488 |
else |
|
489 |
AC_MSG_CHECKING([for freetype]) |
|
490 |
AC_MSG_RESULT([yes (using builddeps)]) |
|
491 |
fi |
|
492 |
fi |
|
20363 | 493 |
fi |
20654 | 494 |
|
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
495 |
# 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
|
496 |
if test "x$SYSROOT" = x; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
497 |
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
|
498 |
# 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
|
499 |
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
|
500 |
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
|
501 |
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
|
502 |
# 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
|
503 |
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
|
504 |
# 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
|
505 |
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
|
506 |
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
|
507 |
fi |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
508 |
# 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
|
509 |
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
|
510 |
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
|
511 |
FOUND_FREETYPE=no |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
512 |
else |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
513 |
AC_MSG_CHECKING([for freetype]) |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
514 |
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
|
515 |
fi |
20654 | 516 |
fi |
517 |
fi |
|
20363 | 518 |
fi |
20654 | 519 |
fi |
520 |
||
521 |
if test "x$FOUND_FREETYPE" != xyes; then |
|
522 |
# Check in well-known locations |
|
523 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
|
524 |
FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32" |
|
525 |
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR) |
|
526 |
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) |
|
527 |
if test "x$FOUND_FREETYPE" != xyes; then |
|
528 |
FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32" |
|
529 |
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR) |
|
530 |
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) |
|
531 |
fi |
|
532 |
else |
|
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
533 |
FREETYPE_BASE_DIR="$SYSROOT/usr" |
20654 | 534 |
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) |
535 |
||
536 |
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
|
537 |
FREETYPE_BASE_DIR="$SYSROOT/usr/X11" |
20654 | 538 |
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) |
539 |
fi |
|
540 |
||
541 |
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
|
542 |
FREETYPE_BASE_DIR="$SYSROOT/usr/sfw" |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
543 |
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
|
544 |
fi |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
545 |
|
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
546 |
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
|
547 |
FREETYPE_BASE_DIR="$SYSROOT/usr" |
20654 | 548 |
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
549 |
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/x86_64-linux-gnu], [well-known location]) |
|
550 |
else |
|
551 |
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/i386-linux-gnu], [well-known location]) |
|
552 |
if test "x$FOUND_FREETYPE" != xyes; then |
|
553 |
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib32], [well-known location]) |
|
554 |
fi |
|
555 |
fi |
|
556 |
fi |
|
20363 | 557 |
fi |
20654 | 558 |
fi # end check in well-known locations |
559 |
||
560 |
if test "x$FOUND_FREETYPE" != xyes; then |
|
561 |
HELP_MSG_MISSING_DEPENDENCY([freetype]) |
|
562 |
AC_MSG_ERROR([Could not find freetype! $HELP_MSG ]) |
|
563 |
fi |
|
564 |
fi # end user specified settings |
|
565 |
||
566 |
# Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir. |
|
567 |
if test "x$FREETYPE_CFLAGS" = x; then |
|
568 |
BASIC_FIXUP_PATH(FREETYPE_INCLUDE_PATH) |
|
569 |
if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then |
|
570 |
FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH/freetype2 -I$FREETYPE_INCLUDE_PATH" |
|
571 |
else |
|
572 |
FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH" |
|
20363 | 573 |
fi |
574 |
fi |
|
26400
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
575 |
|
20654 | 576 |
if test "x$FREETYPE_LIBS" = x; then |
577 |
BASIC_FIXUP_PATH(FREETYPE_LIB_PATH) |
|
578 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
|
579 |
FREETYPE_LIBS="$FREETYPE_LIB_PATH/freetype.lib" |
|
580 |
else |
|
581 |
FREETYPE_LIBS="-L$FREETYPE_LIB_PATH -lfreetype" |
|
20363 | 582 |
fi |
583 |
fi |
|
14111 | 584 |
|
20654 | 585 |
# Try to compile it |
586 |
AC_MSG_CHECKING([if we can compile and link with freetype]) |
|
587 |
AC_LANG_PUSH(C++) |
|
588 |
PREV_CXXCFLAGS="$CXXFLAGS" |
|
21056
16245d19b19a
8027300: configure should use LIBS instead of LDFLAGS when testing freetype
ihse
parents:
20655
diff
changeset
|
589 |
PREV_LIBS="$LIBS" |
20654 | 590 |
PREV_CXX="$CXX" |
26400
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
591 |
CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" |
21056
16245d19b19a
8027300: configure should use LIBS instead of LDFLAGS when testing freetype
ihse
parents:
20655
diff
changeset
|
592 |
LIBS="$LIBS $FREETYPE_LIBS" |
20654 | 593 |
CXX="$FIXPATH $CXX" |
594 |
AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
|
595 |
#include<ft2build.h> |
|
596 |
#include FT_FREETYPE_H |
|
597 |
int main () { |
|
598 |
FT_Init_FreeType(NULL); |
|
599 |
return 0; |
|
600 |
} |
|
601 |
]])], |
|
602 |
[ |
|
603 |
AC_MSG_RESULT([yes]) |
|
604 |
], |
|
605 |
[ |
|
606 |
AC_MSG_RESULT([no]) |
|
607 |
AC_MSG_NOTICE([Could not compile and link with freetype. This might be a 32/64-bit mismatch.]) |
|
608 |
AC_MSG_NOTICE([Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS]) |
|
26400
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
609 |
|
20654 | 610 |
HELP_MSG_MISSING_DEPENDENCY([freetype]) |
26400
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25039
diff
changeset
|
611 |
|
20654 | 612 |
AC_MSG_ERROR([Can not continue without freetype. $HELP_MSG]) |
613 |
] |
|
614 |
) |
|
615 |
CXXCFLAGS="$PREV_CXXFLAGS" |
|
21056
16245d19b19a
8027300: configure should use LIBS instead of LDFLAGS when testing freetype
ihse
parents:
20655
diff
changeset
|
616 |
LIBS="$PREV_LIBS" |
20654 | 617 |
CXX="$PREV_CXX" |
618 |
AC_LANG_POP(C++) |
|
619 |
||
620 |
AC_MSG_CHECKING([if we should bundle freetype]) |
|
621 |
if test "x$BUNDLE_FREETYPE" = xyes; then |
|
622 |
FREETYPE_BUNDLE_LIB_PATH="$FREETYPE_LIB_PATH" |
|
20363 | 623 |
fi |
20654 | 624 |
AC_MSG_RESULT([$BUNDLE_FREETYPE]) |
625 |
||
626 |
fi # end freetype needed |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
627 |
|
20654 | 628 |
AC_SUBST(FREETYPE_BUNDLE_LIB_PATH) |
629 |
AC_SUBST(FREETYPE_CFLAGS) |
|
630 |
AC_SUBST(FREETYPE_LIBS) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
631 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
632 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
633 |
AC_DEFUN_ONCE([LIB_SETUP_ALSA], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
634 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
635 |
|
20363 | 636 |
############################################################################### |
637 |
# |
|
638 |
# Check for alsa headers and libraries. Used on Linux/GNU systems. |
|
639 |
# |
|
640 |
AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa], |
|
641 |
[specify prefix directory for the alsa package |
|
642 |
(expecting the libraries under PATH/lib and the headers under PATH/include)])]) |
|
643 |
AC_ARG_WITH(alsa-include, [AS_HELP_STRING([--with-alsa-include], |
|
644 |
[specify directory for the alsa include files])]) |
|
645 |
AC_ARG_WITH(alsa-lib, [AS_HELP_STRING([--with-alsa-lib], |
|
646 |
[specify directory for the alsa library])]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
647 |
|
20363 | 648 |
if test "x$ALSA_NOT_NEEDED" = xyes; then |
649 |
if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then |
|
650 |
AC_MSG_WARN([alsa not used, so --with-alsa is ignored]) |
|
651 |
fi |
|
652 |
ALSA_CFLAGS= |
|
653 |
ALSA_LIBS= |
|
654 |
else |
|
655 |
ALSA_FOUND=no |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
656 |
|
20363 | 657 |
if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then |
658 |
AC_MSG_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.]) |
|
659 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
660 |
|
20363 | 661 |
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
|
662 |
ALSA_LIBS="-L${with_alsa}/lib -lasound" |
20363 | 663 |
ALSA_CFLAGS="-I${with_alsa}/include" |
664 |
ALSA_FOUND=yes |
|
665 |
fi |
|
666 |
if test "x${with_alsa_include}" != x; then |
|
667 |
ALSA_CFLAGS="-I${with_alsa_include}" |
|
668 |
ALSA_FOUND=yes |
|
669 |
fi |
|
670 |
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
|
671 |
ALSA_LIBS="-L${with_alsa_lib} -lasound" |
20363 | 672 |
ALSA_FOUND=yes |
673 |
fi |
|
674 |
if test "x$ALSA_FOUND" = xno; then |
|
675 |
BDEPS_CHECK_MODULE(ALSA, alsa, xxx, [ALSA_FOUND=yes], [ALSA_FOUND=no]) |
|
676 |
fi |
|
23428
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
677 |
# 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
|
678 |
if test "x$SYSROOT" = x; then |
3c8a05bf4656
8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents:
23165
diff
changeset
|
679 |
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
|
680 |
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
|
681 |
fi |
20363 | 682 |
fi |
683 |
if test "x$ALSA_FOUND" = xno; then |
|
684 |
AC_CHECK_HEADERS([alsa/asoundlib.h], |
|
685 |
[ |
|
686 |
ALSA_FOUND=yes |
|
687 |
ALSA_CFLAGS=-Iignoreme |
|
688 |
ALSA_LIBS=-lasound |
|
689 |
DEFAULT_ALSA=yes |
|
690 |
], |
|
691 |
[ALSA_FOUND=no]) |
|
692 |
fi |
|
693 |
if test "x$ALSA_FOUND" = xno; then |
|
694 |
HELP_MSG_MISSING_DEPENDENCY([alsa]) |
|
695 |
AC_MSG_ERROR([Could not find alsa! $HELP_MSG ]) |
|
696 |
fi |
|
697 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
698 |
|
20363 | 699 |
AC_SUBST(ALSA_CFLAGS) |
700 |
AC_SUBST(ALSA_LIBS) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
701 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
702 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
703 |
AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
704 |
[ |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
705 |
|
20363 | 706 |
############################################################################### |
707 |
# |
|
708 |
# Check for the jpeg library |
|
709 |
# |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
710 |
|
25035 | 711 |
AC_ARG_WITH(libjpeg, [AS_HELP_STRING([--with-libjpeg], |
712 |
[use libjpeg from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) |
|
713 |
||
714 |
AC_MSG_CHECKING([for which libjpeg to use]) |
|
715 |
||
716 |
# default is bundled |
|
717 |
DEFAULT_LIBJPEG=bundled |
|
718 |
||
719 |
# |
|
720 |
# if user didn't specify, use DEFAULT_LIBJPEG |
|
721 |
# |
|
722 |
if test "x${with_libjpeg}" = "x"; then |
|
723 |
with_libjpeg=${DEFAULT_LIBJPEG} |
|
724 |
fi |
|
725 |
||
726 |
AC_MSG_RESULT(${with_libjpeg}) |
|
727 |
||
728 |
if test "x${with_libjpeg}" = "xbundled"; then |
|
729 |
USE_EXTERNAL_LIBJPEG=false |
|
730 |
elif test "x${with_libjpeg}" = "xsystem"; then |
|
731 |
AC_CHECK_HEADER(jpeglib.h, [], |
|
732 |
[ AC_MSG_ERROR([--with-libjpeg=system specified, but jpeglib.h not found!])]) |
|
733 |
AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, [], |
|
734 |
[ AC_MSG_ERROR([--with-libjpeg=system specified, but no libjpeg found])]) |
|
735 |
||
736 |
USE_EXTERNAL_LIBJPEG=true |
|
737 |
else |
|
738 |
AC_MSG_ERROR([Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled']) |
|
739 |
fi |
|
740 |
||
20363 | 741 |
AC_SUBST(USE_EXTERNAL_LIBJPEG) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
742 |
|
20363 | 743 |
############################################################################### |
744 |
# |
|
745 |
# Check for the gif library |
|
746 |
# |
|
747 |
||
748 |
AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib], |
|
749 |
[use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) |
|
16424 | 750 |
|
751 |
||
20363 | 752 |
AC_MSG_CHECKING([for which giflib to use]) |
16424 | 753 |
|
20363 | 754 |
# default is bundled |
755 |
DEFAULT_GIFLIB=bundled |
|
16424 | 756 |
|
20363 | 757 |
# |
758 |
# if user didn't specify, use DEFAULT_GIFLIB |
|
759 |
# |
|
760 |
if test "x${with_giflib}" = "x"; then |
|
16424 | 761 |
with_giflib=${DEFAULT_GIFLIB} |
20363 | 762 |
fi |
16424 | 763 |
|
20363 | 764 |
AC_MSG_RESULT(${with_giflib}) |
16424 | 765 |
|
20363 | 766 |
if test "x${with_giflib}" = "xbundled"; then |
16424 | 767 |
USE_EXTERNAL_LIBGIF=false |
20363 | 768 |
elif test "x${with_giflib}" = "xsystem"; then |
16424 | 769 |
AC_CHECK_HEADER(gif_lib.h, [], |
20363 | 770 |
[ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])]) |
16424 | 771 |
AC_CHECK_LIB(gif, DGifGetCode, [], |
20363 | 772 |
[ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])]) |
16424 | 773 |
|
774 |
USE_EXTERNAL_LIBGIF=true |
|
20363 | 775 |
else |
16424 | 776 |
AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled']) |
20363 | 777 |
fi |
778 |
AC_SUBST(USE_EXTERNAL_LIBGIF) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
779 |
|
20363 | 780 |
############################################################################### |
781 |
# |
|
24413 | 782 |
# Check for the lcms2 library |
783 |
# |
|
784 |
||
785 |
AC_ARG_WITH(lcms, [AS_HELP_STRING([--with-lcms], |
|
786 |
[use lcms2 from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) |
|
787 |
||
788 |
AC_MSG_CHECKING([for which lcms to use]) |
|
789 |
||
790 |
DEFAULT_LCMS=bundled |
|
791 |
||
792 |
# |
|
793 |
# If user didn't specify, use DEFAULT_LCMS |
|
794 |
# |
|
795 |
if test "x${with_lcms}" = "x"; then |
|
796 |
with_lcms=${DEFAULT_LCMS} |
|
797 |
fi |
|
798 |
||
799 |
if test "x${with_lcms}" = "xbundled"; then |
|
800 |
USE_EXTERNAL_LCMS=false |
|
801 |
AC_MSG_RESULT([bundled]) |
|
802 |
elif test "x${with_lcms}" = "xsystem"; then |
|
803 |
AC_MSG_RESULT([system]) |
|
804 |
PKG_CHECK_MODULES([LCMS], [lcms2], [LCMS_FOUND=yes], [LCMS_FOUND=no]) |
|
805 |
if test "x${LCMS_FOUND}" = "xyes"; then |
|
806 |
USE_EXTERNAL_LCMS=true |
|
807 |
else |
|
808 |
AC_MSG_ERROR([--with-lcms=system specified, but no lcms found!]) |
|
809 |
fi |
|
810 |
else |
|
811 |
AC_MSG_ERROR([Invalid value for --with-lcms: ${with_lcms}, use 'system' or 'bundled']) |
|
812 |
fi |
|
813 |
||
814 |
AC_SUBST(USE_EXTERNAL_LCMS) |
|
815 |
||
816 |
############################################################################### |
|
817 |
# |
|
23163 | 818 |
# Check for the png library |
819 |
# |
|
820 |
||
821 |
AC_ARG_WITH(libpng, [AS_HELP_STRING([--with-libpng], |
|
822 |
[use libpng from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) |
|
823 |
||
824 |
||
825 |
AC_MSG_CHECKING([for which libpng to use]) |
|
826 |
||
827 |
# default is bundled |
|
828 |
DEFAULT_LIBPNG=bundled |
|
829 |
||
830 |
# |
|
831 |
# if user didn't specify, use DEFAULT_LIBPNG |
|
832 |
# |
|
833 |
if test "x${with_libpng}" = "x"; then |
|
834 |
with_libpng=${DEFAULT_LIBPNG} |
|
835 |
fi |
|
836 |
||
837 |
if test "x${with_libpng}" = "xbundled"; then |
|
838 |
USE_EXTERNAL_LIBPNG=false |
|
839 |
AC_MSG_RESULT([bundled]) |
|
840 |
elif test "x${with_libpng}" = "xsystem"; then |
|
841 |
PKG_CHECK_MODULES(PNG, libpng, |
|
842 |
[ LIBPNG_FOUND=yes ], |
|
843 |
[ LIBPNG_FOUND=no ]) |
|
844 |
if test "x${LIBPNG_FOUND}" = "xyes"; then |
|
845 |
USE_EXTERNAL_LIBPNG=true |
|
846 |
AC_MSG_RESULT([system]) |
|
847 |
else |
|
848 |
AC_MSG_RESULT([system not found]) |
|
849 |
AC_MSG_ERROR([--with-libpng=system specified, but no libpng found!]) |
|
850 |
fi |
|
851 |
else |
|
852 |
AC_MSG_ERROR([Invalid value of --with-libpng: ${with_libpng}, use 'system' or 'bundled']) |
|
853 |
fi |
|
854 |
AC_SUBST(USE_EXTERNAL_LIBPNG) |
|
855 |
||
856 |
############################################################################### |
|
857 |
# |
|
20363 | 858 |
# Check for the zlib library |
859 |
# |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
860 |
|
20363 | 861 |
AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib], |
862 |
[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
|
863 |
|
20363 | 864 |
AC_CHECK_LIB(z, compress, |
865 |
[ ZLIB_FOUND=yes ], |
|
866 |
[ ZLIB_FOUND=no ]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
867 |
|
20363 | 868 |
AC_MSG_CHECKING([for which zlib to use]) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
869 |
|
20363 | 870 |
DEFAULT_ZLIB=bundled |
871 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
872 |
# |
|
873 |
# On macosx default is system...on others default is |
|
874 |
# |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
875 |
DEFAULT_ZLIB=system |
20363 | 876 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
877 |
|
20363 | 878 |
if test "x${ZLIB_FOUND}" != "xyes"; then |
879 |
# |
|
880 |
# If we don't find any system...set default to bundled |
|
881 |
# |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
882 |
DEFAULT_ZLIB=bundled |
20363 | 883 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
884 |
|
20363 | 885 |
# |
886 |
# If user didn't specify, use DEFAULT_ZLIB |
|
887 |
# |
|
888 |
if test "x${with_zlib}" = "x"; then |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
889 |
with_zlib=${DEFAULT_ZLIB} |
20363 | 890 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
891 |
|
20363 | 892 |
if test "x${with_zlib}" = "xbundled"; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
893 |
USE_EXTERNAL_LIBZ=false |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
894 |
AC_MSG_RESULT([bundled]) |
20363 | 895 |
elif test "x${with_zlib}" = "xsystem"; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
896 |
if test "x${ZLIB_FOUND}" = "xyes"; then |
20363 | 897 |
USE_EXTERNAL_LIBZ=true |
898 |
AC_MSG_RESULT([system]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
899 |
else |
20363 | 900 |
AC_MSG_RESULT([system not found]) |
901 |
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
|
902 |
fi |
20363 | 903 |
else |
904 |
AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled']) |
|
905 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
906 |
|
20363 | 907 |
AC_SUBST(USE_EXTERNAL_LIBZ) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
908 |
|
20363 | 909 |
############################################################################### |
910 |
LIBZIP_CAN_USE_MMAP=true |
|
13697 | 911 |
|
20363 | 912 |
AC_SUBST(LIBZIP_CAN_USE_MMAP) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
913 |
|
20363 | 914 |
############################################################################### |
915 |
# |
|
916 |
# Check if altzone exists in time.h |
|
917 |
# |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
918 |
|
20363 | 919 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [return (int)altzone;])], |
920 |
[has_altzone=yes], |
|
921 |
[has_altzone=no]) |
|
922 |
if test "x$has_altzone" = xyes; then |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
923 |
AC_DEFINE([HAVE_ALTZONE], 1, [Define if you have the external 'altzone' variable in time.h]) |
20363 | 924 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
925 |
|
20363 | 926 |
############################################################################### |
927 |
# |
|
928 |
# Check the maths library |
|
929 |
# |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
930 |
|
20363 | 931 |
AC_CHECK_LIB(m, cos, [], |
932 |
[ |
|
933 |
AC_MSG_NOTICE([Maths library was not found]) |
|
934 |
] |
|
935 |
) |
|
936 |
AC_SUBST(LIBM) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
937 |
|
20363 | 938 |
############################################################################### |
939 |
# |
|
940 |
# Check for libdl.so |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
941 |
|
20363 | 942 |
save_LIBS="$LIBS" |
943 |
LIBS="" |
|
944 |
AC_CHECK_LIB(dl,dlopen) |
|
945 |
LIBDL="$LIBS" |
|
946 |
AC_SUBST(LIBDL) |
|
947 |
LIBS="$save_LIBS" |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
948 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
949 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
950 |
AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
951 |
[ |
20363 | 952 |
############################################################################### |
953 |
# |
|
954 |
# statically link libstdc++ before C++ ABI is stablized on Linux unless |
|
955 |
# dynamic build is configured on command line. |
|
956 |
# |
|
957 |
AC_ARG_WITH([stdc++lib], [AS_HELP_STRING([--with-stdc++lib=<static>,<dynamic>,<default>], |
|
958 |
[force linking of the C++ runtime on Linux to either static or dynamic, default is static with dynamic as fallback])], |
|
959 |
[ |
|
960 |
if test "x$with_stdc__lib" != xdynamic && test "x$with_stdc__lib" != xstatic \ |
|
961 |
&& test "x$with_stdc__lib" != xdefault; then |
|
962 |
AC_MSG_ERROR([Bad parameter value --with-stdc++lib=$with_stdc__lib!]) |
|
963 |
fi |
|
964 |
], |
|
965 |
[with_stdc__lib=default] |
|
966 |
) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
967 |
|
20363 | 968 |
if test "x$OPENJDK_TARGET_OS" = xlinux; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
969 |
# Test if -lstdc++ works. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
970 |
AC_MSG_CHECKING([if dynamic link of stdc++ is possible]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
971 |
AC_LANG_PUSH(C++) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
972 |
OLD_CXXFLAGS="$CXXFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
973 |
CXXFLAGS="$CXXFLAGS -lstdc++" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
974 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])], |
20363 | 975 |
[has_dynamic_libstdcxx=yes], |
976 |
[has_dynamic_libstdcxx=no]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
977 |
CXXFLAGS="$OLD_CXXFLAGS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
978 |
AC_LANG_POP(C++) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
979 |
AC_MSG_RESULT([$has_dynamic_libstdcxx]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
980 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
981 |
# Test if stdc++ can be linked statically. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
982 |
AC_MSG_CHECKING([if static link of stdc++ is possible]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
983 |
STATIC_STDCXX_FLAGS="-Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
984 |
AC_LANG_PUSH(C++) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
985 |
OLD_LIBS="$LIBS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
986 |
OLD_CXX="$CXX" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
987 |
LIBS="$STATIC_STDCXX_FLAGS" |
20363 | 988 |
CXX="$CC" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
989 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])], |
20363 | 990 |
[has_static_libstdcxx=yes], |
991 |
[has_static_libstdcxx=no]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
992 |
LIBS="$OLD_LIBS" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
993 |
CXX="$OLD_CXX" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
994 |
AC_LANG_POP(C++) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
995 |
AC_MSG_RESULT([$has_static_libstdcxx]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
996 |
|
14459
6213b3f9e08d
8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents:
14280
diff
changeset
|
997 |
if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then |
20363 | 998 |
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
|
999 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1000 |
|
14459
6213b3f9e08d
8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents:
14280
diff
changeset
|
1001 |
if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then |
20363 | 1002 |
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
|
1003 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1004 |
|
14459
6213b3f9e08d
8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents:
14280
diff
changeset
|
1005 |
if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then |
20363 | 1006 |
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
|
1007 |
fi |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1008 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1009 |
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
|
1010 |
# 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
|
1011 |
# 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
|
1012 |
if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then |
20363 | 1013 |
LIBCXX="$LIBCXX -lstdc++" |
1014 |
LDCXX="$CXX" |
|
1015 |
STATIC_CXX_SETTING="STATIC_CXX=false" |
|
1016 |
AC_MSG_RESULT([dynamic]) |
|
14459
6213b3f9e08d
8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents:
14280
diff
changeset
|
1017 |
else |
20363 | 1018 |
LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS" |
1019 |
LDCXX="$CC" |
|
1020 |
STATIC_CXX_SETTING="STATIC_CXX=true" |
|
1021 |
AC_MSG_RESULT([static]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1022 |
fi |
20363 | 1023 |
fi |
1024 |
AC_SUBST(STATIC_CXX_SETTING) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1025 |
|
20363 | 1026 |
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
|
1027 |
# Figure out LIBFFI_CFLAGS and LIBFFI_LIBS |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1028 |
PKG_CHECK_MODULES([LIBFFI], [libffi]) |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1029 |
|
20363 | 1030 |
fi |
16581
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1031 |
|
20363 | 1032 |
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
|
1033 |
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
|
1034 |
|
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1035 |
if test "x$LLVM_CONFIG" != xllvm-config; then |
20363 | 1036 |
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
|
1037 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1038 |
|
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1039 |
llvm_components="jit mcjit engine nativecodegen native" |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1040 |
unset LLVM_CFLAGS |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1041 |
for flag in $("$LLVM_CONFIG" --cxxflags); do |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1042 |
if echo "${flag}" | grep -q '^-@<:@ID@:>@'; then |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1043 |
if test "${flag}" != "-D_DEBUG" ; then |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1044 |
if test "${LLVM_CFLAGS}" != "" ; then |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1045 |
LLVM_CFLAGS="${LLVM_CFLAGS} " |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1046 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1047 |
LLVM_CFLAGS="${LLVM_CFLAGS}${flag}" |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1048 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1049 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1050 |
done |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1051 |
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
|
1052 |
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
|
1053 |
|
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1054 |
unset LLVM_LDFLAGS |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1055 |
for flag in $("${LLVM_CONFIG}" --ldflags); do |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1056 |
if echo "${flag}" | grep -q '^-L'; then |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1057 |
if test "${LLVM_LDFLAGS}" != ""; then |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1058 |
LLVM_LDFLAGS="${LLVM_LDFLAGS} " |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1059 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1060 |
LLVM_LDFLAGS="${LLVM_LDFLAGS}${flag}" |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1061 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1062 |
done |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1063 |
|
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1064 |
unset LLVM_LIBS |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1065 |
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
|
1066 |
if echo "${flag}" | grep -q '^-l'; then |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1067 |
if test "${LLVM_LIBS}" != ""; then |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1068 |
LLVM_LIBS="${LLVM_LIBS} " |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1069 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1070 |
LLVM_LIBS="${LLVM_LIBS}${flag}" |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1071 |
fi |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1072 |
done |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1073 |
|
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1074 |
AC_SUBST(LLVM_CFLAGS) |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1075 |
AC_SUBST(LLVM_LDFLAGS) |
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1076 |
AC_SUBST(LLVM_LIBS) |
20363 | 1077 |
fi |
16581
b2cddec593f4
8011388: Support building zero and zeroshark with the new build
omajid
parents:
16424
diff
changeset
|
1078 |
|
20363 | 1079 |
# 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
|
1080 |
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
|
1081 |
LIBCXX="${SYSROOT}/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1" |
20363 | 1082 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1083 |
|
20363 | 1084 |
# TODO better (platform agnostic) test |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
1085 |
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
|
1086 |
LIBCXX="-lstdc++" |
20363 | 1087 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1088 |
|
20363 | 1089 |
AC_SUBST(LIBCXX) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1090 |
]) |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
1091 |
|
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
1092 |
AC_DEFUN_ONCE([LIB_SETUP_ON_WINDOWS], |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
1093 |
[ |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
1094 |
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
1095 |
TOOLCHAIN_SETUP_MSVCR_DLL |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
1096 |
BASIC_DEPRECATED_ARG_WITH([dxsdk]) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
1097 |
BASIC_DEPRECATED_ARG_WITH([dxsdk-lib]) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
1098 |
BASIC_DEPRECATED_ARG_WITH([dxsdk-include]) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
1099 |
fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
1100 |
AC_SUBST(MSVCR_DLL) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22710
diff
changeset
|
1101 |
]) |