8213944: Fix AIX build after the removal of Xrandr.h and add a configure check for it

Reviewed-by: shade, erikj, stuefe, ihse, goetz
This commit is contained in:
Volker Simonis 2018-11-22 09:44:02 +01:00
parent fc8795984a
commit 62b2f0f5c9
3 changed files with 26 additions and 10 deletions

View File

@ -102,7 +102,7 @@ apt_help() {
ffi)
PKGHANDLER_COMMAND="sudo apt-get install libffi-dev" ;;
x11)
PKGHANDLER_COMMAND="sudo apt-get install libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;;
PKGHANDLER_COMMAND="sudo apt-get install libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev" ;;
ccache)
PKGHANDLER_COMMAND="sudo apt-get install ccache" ;;
dtrace)
@ -125,7 +125,7 @@ yum_help() {
freetype)
PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
x11)
PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXi-devel" ;;
PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel" ;;
ccache)
PKGHANDLER_COMMAND="sudo yum install ccache" ;;
esac

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -99,8 +99,14 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $SYSROOT_CFLAGS $X_CFLAGS"
HEADERS_TO_CHECK="X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h"
# There is no Xrandr extension on AIX
if test "x$OPENJDK_TARGET_OS" != xaix; then
HEADERS_TO_CHECK="$HEADERS_TO_CHECK X11/extensions/Xrandr.h"
fi
# Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h],
AC_CHECK_HEADERS([$HEADERS_TO_CHECK],
[X11_HEADERS_OK=yes],
[X11_HEADERS_OK=no; break],
[
@ -111,7 +117,7 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
if test "x$X11_HEADERS_OK" = xno; then
HELP_MSG_MISSING_DEPENDENCY([x11])
AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG])
AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h Xrander.h XTest.h Intrinsic.h). $HELP_MSG])
fi
# If XLinearGradient isn't available in Xrender.h, signal that it needs to be

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -34,7 +34,9 @@
#ifndef HEADLESS
#include <X11/extensions/Xdbe.h>
#include <X11/XKBlib.h>
#ifndef _AIX
#include <X11/extensions/Xrandr.h>
#endif
#include "GLXGraphicsConfig.h"
#endif /* !HEADLESS */
@ -1625,6 +1627,8 @@ Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint(JNIEnv *env,
#ifndef HEADLESS
#ifndef _AIX
#define BIT_DEPTH_MULTI java_awt_DisplayMode_BIT_DEPTH_MULTI
#define REFRESH_RATE_UNKNOWN java_awt_DisplayMode_REFRESH_RATE_UNKNOWN
@ -1830,6 +1834,8 @@ X11GD_AddDisplayMode(JNIEnv *env, jobject arrayList,
}
}
#endif /* !_AIX */
static void
X11GD_SetFullscreenMode(Window win, jboolean enabled)
{
@ -1869,7 +1875,7 @@ JNIEXPORT jboolean JNICALL
Java_sun_awt_X11GraphicsDevice_initXrandrExtension
(JNIEnv *env, jclass x11gd)
{
#ifdef HEADLESS
#if defined(HEADLESS) || defined(_AIX)
return JNI_FALSE;
#else
int opcode = 0, firstEvent = 0, firstError = 0;
@ -1896,7 +1902,7 @@ JNIEXPORT jobject JNICALL
Java_sun_awt_X11GraphicsDevice_getCurrentDisplayMode
(JNIEnv* env, jclass x11gd, jint screen)
{
#ifdef HEADLESS
#if defined(HEADLESS) || defined(_AIX)
return NULL;
#else
XRRScreenConfiguration *config;
@ -1992,7 +1998,7 @@ Java_sun_awt_X11GraphicsDevice_enumDisplayModes
(JNIEnv* env, jclass x11gd,
jint screen, jobject arrayList)
{
#ifndef HEADLESS
#if !defined(HEADLESS) && !defined(_AIX)
AWT_LOCK();
@ -2080,7 +2086,7 @@ Java_sun_awt_X11GraphicsDevice_configDisplayMode
(JNIEnv* env, jclass x11gd,
jint screen, jint width, jint height, jint refreshRate)
{
#ifndef HEADLESS
#if !defined(HEADLESS) && !defined(_AIX)
jboolean success = JNI_FALSE;
XRRScreenConfiguration *config;
Drawable root;
@ -2197,6 +2203,9 @@ Java_sun_awt_X11GraphicsDevice_exitFullScreenExclusive
*/
static char *get_output_screen_name(JNIEnv *env, int screen) {
#ifdef _AIX
return NULL;
#else
if (!awt_XRRGetScreenResources || !awt_XRRGetOutputInfo) {
return NULL;
}
@ -2226,6 +2235,7 @@ static char *get_output_screen_name(JNIEnv *env, int screen) {
}
AWT_UNLOCK();
return name;
#endif /* _AIX */
}
/*