Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
8295211: Fix autoconf 2.71 warning "AC_CHECK_HEADERS: you should use …
Browse files Browse the repository at this point in the history
…literals"

Backport-of: c357b5908a091a77bc2b26d74a38785412b88a73
  • Loading branch information
Yuri Nesterenko committed Oct 21, 2022
1 parent 8781ccc commit 489dd4f
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions make/autoconf/lib-x11.m4
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2022, 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 @@ -92,24 +92,29 @@ 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
# There is no Xrandr extension on AIX. Code is duplicated to avoid autoconf
# 2.71+ warning "AC_CHECK_HEADERS: you should use literals"
X_CFLAGS="$X_CFLAGS -DNO_XRANDR"
AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h],
[X11_HEADERS_OK=yes],
[X11_HEADERS_OK=no; break],
[
# include <X11/Xlib.h>
# include <X11/Xutil.h>
]
)
else
HEADERS_TO_CHECK="$HEADERS_TO_CHECK X11/extensions/Xrandr.h"
AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h X11/extensions/Xrandr.h],
[X11_HEADERS_OK=yes],
[X11_HEADERS_OK=no; break],
[
# include <X11/Xlib.h>
# include <X11/Xutil.h>
]
)
fi
# Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
AC_CHECK_HEADERS([$HEADERS_TO_CHECK],
[X11_HEADERS_OK=yes],
[X11_HEADERS_OK=no; break],
[
# include <X11/Xlib.h>
# include <X11/Xutil.h>
]
)
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 Xrandr.h XTest.h Intrinsic.h). $HELP_MSG])
Expand Down

0 comments on commit 489dd4f

Please sign in to comment.