8295211: Fix autoconf 2.71 warning "AC_CHECK_HEADERS: you should use literals"

Reviewed-by: shade, erikj
This commit is contained in:
Magnus Ihse Bursie 2022-10-12 13:32:49 +00:00
parent 860784238e
commit c357b5908a

View File

@ -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
@ -96,16 +96,11 @@ 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"
else
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([$HEADERS_TO_CHECK],
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],
[
@ -113,6 +108,16 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
# include <X11/Xutil.h>
]
)
else
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
if test "x$X11_HEADERS_OK" = xno; then
HELP_MSG_MISSING_DEPENDENCY([x11])