Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
8213944: Fix AIX build after the removal of Xrandr.h and add a config…
Browse files Browse the repository at this point in the history
…ure check for it

Reviewed-by: shade, erikj, stuefe, ihse, goetz
  • Loading branch information
simonis committed Nov 22, 2018
1 parent fc87959 commit 62b2f0f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
4 changes: 2 additions & 2 deletions make/autoconf/help.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
12 changes: 9 additions & 3 deletions make/autoconf/lib-x11.m4
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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],
[
Expand All @@ -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
Expand Down
20 changes: 15 additions & 5 deletions src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 */

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -1830,6 +1834,8 @@ X11GD_AddDisplayMode(JNIEnv *env, jobject arrayList,
}
}

#endif /* !_AIX */

static void
X11GD_SetFullscreenMode(Window win, jboolean enabled)
{
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -2226,6 +2235,7 @@ static char *get_output_screen_name(JNIEnv *env, int screen) {
}
AWT_UNLOCK();
return name;
#endif /* _AIX */
}

/*
Expand Down

0 comments on commit 62b2f0f

Please sign in to comment.