Print this page
Split |
Close |
Expand all |
Collapse all |
--- old/common/autoconf/lib-x11.m4
+++ new/common/autoconf/lib-x11.m4
1 1 #
2 2 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
3 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 4 #
5 5 # This code is free software; you can redistribute it and/or modify it
6 6 # under the terms of the GNU General Public License version 2 only, as
7 7 # published by the Free Software Foundation. Oracle designates this
8 8 # particular file as subject to the "Classpath" exception as provided
9 9 # by Oracle in the LICENSE file that accompanied this code.
10 10 #
11 11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 14 # version 2 for more details (a copy is included in the LICENSE file that
15 15 # accompanied this code).
16 16 #
17 17 # You should have received a copy of the GNU General Public License version
18 18 # 2 along with this work; if not, write to the Free Software Foundation,
19 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 20 #
21 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 22 # or visit www.oracle.com if you need additional information or have any
23 23 # questions.
24 24 #
25 25
26 26 ################################################################################
27 27 # Setup X11 Windows system
28 28 ################################################################################
29 29 AC_DEFUN_ONCE([LIB_SETUP_X11],
30 30 [
31 31 if test "x$NEEDS_LIB_X11" = xfalse; then
32 32 if (test "x${with_x}" != x && test "x${with_x}" != xno); then
33 33 AC_MSG_WARN([X11 is not used, so --with-x is ignored])
34 34 fi
35 35 X_CFLAGS=
36 36 X_LIBS=
37 37 else
38 38
39 39 if test "x${with_x}" = xno; then
40 40 AC_MSG_ERROR([It is not possible to disable the use of X11. Remove the --without-x option.])
41 41 fi
42 42
43 43 if test "x${with_x}" != x && test "x${with_x}" != xyes; then
44 44 # The user has specified a X11 base directory. Use it for includes and
45 45 # libraries, unless explicitely overridden.
46 46 if test "x$x_includes" = xNONE; then
47 47 x_includes="${with_x}/include"
48 48 fi
49 49 if test "x$x_libraries" = xNONE; then
50 50 x_libraries="${with_x}/lib"
51 51 fi
52 52 else
53 53 # Check if the user has specified sysroot, but not --with-x, --x-includes or --x-libraries.
54 54 # Make a simple check for the libraries at the sysroot, and setup --x-includes and
55 55 # --x-libraries for the sysroot, if that seems to be correct.
56 56 if test "x$SYSROOT" != "x"; then
57 57 if test "x$x_includes" = xNONE; then
58 58 if test -f "$SYSROOT/usr/X11R6/include/X11/Xlib.h"; then
59 59 x_includes="$SYSROOT/usr/X11R6/include"
60 60 elif test -f "$SYSROOT/usr/include/X11/Xlib.h"; then
61 61 x_includes="$SYSROOT/usr/include"
62 62 fi
63 63 fi
64 64 if test "x$x_libraries" = xNONE; then
65 65 if test -f "$SYSROOT/usr/X11R6/lib/libX11.so"; then
66 66 x_libraries="$SYSROOT/usr/X11R6/lib"
67 67 elif test -f "$SYSROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
68 68 x_libraries="$SYSROOT/usr/lib64"
69 69 elif test -f "$SYSROOT/usr/lib/libX11.so"; then
70 70 x_libraries="$SYSROOT/usr/lib"
71 71 fi
72 72 fi
73 73 fi
74 74 fi
75 75
76 76 # Now let autoconf do it's magic
77 77 AC_PATH_X
78 78 AC_PATH_XTRA
79 79
80 80 # AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling
81 81 # this doesn't make sense so we remove it.
82 82 if test "x$COMPILE_TYPE" = xcross; then
83 83 X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'`
↓ open down ↓ |
83 lines elided |
↑ open up ↑ |
84 84 fi
85 85
86 86 if test "x$no_x" = xyes; then
87 87 HELP_MSG_MISSING_DEPENDENCY([x11])
88 88 AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG])
89 89 fi
90 90
91 91 if test "x$OPENJDK_TARGET_OS" = xsolaris; then
92 92 OPENWIN_HOME="/usr/openwin"
93 93 X_CFLAGS="-I$SYSROOT$OPENWIN_HOME/include -I$SYSROOT$OPENWIN_HOME/include/X11/extensions"
94 - X_LIBS="-L$SYSROOT$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \
95 - -L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \
96 - -R$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \
94 + X_LIBS="-L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \
97 95 -R$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR"
98 96 fi
99 97
100 98 AC_LANG_PUSH(C)
101 99 OLD_CFLAGS="$CFLAGS"
102 100 CFLAGS="$CFLAGS $SYSROOT_CFLAGS $X_CFLAGS"
103 101
104 102 # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
105 103 AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h],
106 104 [X11_HEADERS_OK=yes],
107 105 [X11_HEADERS_OK=no; break],
108 106 [
109 107 # include <X11/Xlib.h>
110 108 # include <X11/Xutil.h>
111 109 ]
112 110 )
113 111
114 112 if test "x$X11_HEADERS_OK" = xno; then
115 113 HELP_MSG_MISSING_DEPENDENCY([x11])
116 114 AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG])
117 115 fi
118 116
119 117 # If XLinearGradient isn't available in Xrender.h, signal that it needs to be
120 118 # defined in libawt_xawt.
121 119 AC_MSG_CHECKING([if XlinearGradient is defined in Xrender.h])
122 120 AC_COMPILE_IFELSE(
123 121 [AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],
124 122 [[XLinearGradient x;]])],
125 123 [AC_MSG_RESULT([yes])],
126 124 [AC_MSG_RESULT([no])
127 125 X_CFLAGS="$X_CFLAGS -DSOLARIS10_NO_XRENDER_STRUCTS"])
128 126
129 127 CFLAGS="$OLD_CFLAGS"
130 128 AC_LANG_POP(C)
131 129 fi # NEEDS_LIB_X11
132 130
133 131 AC_SUBST(X_CFLAGS)
134 132 AC_SUBST(X_LIBS)
135 133 ])
↓ open down ↓ |
29 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX