1 #
2 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
82 if test "x$COMPILE_TYPE" = xcross; then
83 X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'`
84 fi
85
86 if test "x$no_x" = xyes; then
87 HELP_MSG_MISSING_DEPENDENCY([x11])
88 AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG])
89 fi
90
91 if test "x$OPENJDK_TARGET_OS" = xsolaris; then
92 OPENWIN_HOME="/usr/openwin"
93 X_CFLAGS="-I$SYSROOT$OPENWIN_HOME/include -I$SYSROOT$OPENWIN_HOME/include/X11/extensions"
94 X_LIBS="-L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \
95 -R$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR"
96 fi
97
98 AC_LANG_PUSH(C)
99 OLD_CFLAGS="$CFLAGS"
100 CFLAGS="$CFLAGS $SYSROOT_CFLAGS $X_CFLAGS"
101
102 # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
103 AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h],
104 [X11_HEADERS_OK=yes],
105 [X11_HEADERS_OK=no; break],
106 [
107 # include <X11/Xlib.h>
108 # include <X11/Xutil.h>
109 ]
110 )
111
112 if test "x$X11_HEADERS_OK" = xno; then
113 HELP_MSG_MISSING_DEPENDENCY([x11])
114 AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG])
115 fi
116
117 # If XLinearGradient isn't available in Xrender.h, signal that it needs to be
118 # defined in libawt_xawt.
119 AC_MSG_CHECKING([if XlinearGradient is defined in Xrender.h])
120 AC_COMPILE_IFELSE(
121 [AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],
122 [[XLinearGradient x;]])],
123 [AC_MSG_RESULT([yes])],
124 [AC_MSG_RESULT([no])
125 X_CFLAGS="$X_CFLAGS -DSOLARIS10_NO_XRENDER_STRUCTS"])
126
127 CFLAGS="$OLD_CFLAGS"
128 AC_LANG_POP(C)
129 fi # NEEDS_LIB_X11
130
131 AC_SUBST(X_CFLAGS)
132 AC_SUBST(X_LIBS)
133 ])
|
1 #
2 # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
82 if test "x$COMPILE_TYPE" = xcross; then
83 X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'`
84 fi
85
86 if test "x$no_x" = xyes; then
87 HELP_MSG_MISSING_DEPENDENCY([x11])
88 AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG])
89 fi
90
91 if test "x$OPENJDK_TARGET_OS" = xsolaris; then
92 OPENWIN_HOME="/usr/openwin"
93 X_CFLAGS="-I$SYSROOT$OPENWIN_HOME/include -I$SYSROOT$OPENWIN_HOME/include/X11/extensions"
94 X_LIBS="-L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \
95 -R$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR"
96 fi
97
98 AC_LANG_PUSH(C)
99 OLD_CFLAGS="$CFLAGS"
100 CFLAGS="$CFLAGS $SYSROOT_CFLAGS $X_CFLAGS"
101
102 HEADERS_TO_CHECK="X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h"
103 # There is no Xrandr extension on AIX
104 if test "x$OPENJDK_TARGET_OS" != xaix; then
105 HEADERS_TO_CHECK="$HEADERS_TO_CHECK X11/extensions/Xrandr.h"
106 fi
107
108 # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
109 AC_CHECK_HEADERS([$HEADERS_TO_CHECK],
110 [X11_HEADERS_OK=yes],
111 [X11_HEADERS_OK=no; break],
112 [
113 # include <X11/Xlib.h>
114 # include <X11/Xutil.h>
115 ]
116 )
117
118 if test "x$X11_HEADERS_OK" = xno; then
119 HELP_MSG_MISSING_DEPENDENCY([x11])
120 AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h Xrander.h XTest.h Intrinsic.h). $HELP_MSG])
121 fi
122
123 # If XLinearGradient isn't available in Xrender.h, signal that it needs to be
124 # defined in libawt_xawt.
125 AC_MSG_CHECKING([if XlinearGradient is defined in Xrender.h])
126 AC_COMPILE_IFELSE(
127 [AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],
128 [[XLinearGradient x;]])],
129 [AC_MSG_RESULT([yes])],
130 [AC_MSG_RESULT([no])
131 X_CFLAGS="$X_CFLAGS -DSOLARIS10_NO_XRENDER_STRUCTS"])
132
133 CFLAGS="$OLD_CFLAGS"
134 AC_LANG_POP(C)
135 fi # NEEDS_LIB_X11
136
137 AC_SUBST(X_CFLAGS)
138 AC_SUBST(X_LIBS)
139 ])
|