8062661: Do not perform X11 checks in configure when X11 is not needed

Reviewed-by: tbell
This commit is contained in:
Magnus Ihse Bursie 2014-11-05 10:21:59 +01:00
parent f2253115a2
commit 9b6713919a
3 changed files with 174 additions and 157 deletions

View File

@ -3944,7 +3944,7 @@ yum_help() {
pulse) pulse)
PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;; PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;;
x11) x11)
PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel" ;; PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXi-devel" ;;
ccache) ccache)
PKGHANDLER_COMMAND="sudo yum install ccache" ;; PKGHANDLER_COMMAND="sudo yum install ccache" ;;
esac esac
@ -4328,7 +4328,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
#CUSTOM_AUTOCONF_INCLUDE #CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks: # Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1415177189 DATE_WHEN_GENERATED=1415177972
############################################################################### ###############################################################################
# #
@ -43273,6 +43273,14 @@ $as_echo "alsa" >&6; }
# Check for X Windows # Check for X Windows
# #
if test "x$X11_NOT_NEEDED" = xyes; then
if test "x${with_x}" != x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: X11 is not used, so --with-x is ignored" >&5
$as_echo "$as_me: WARNING: X11 is not used, so --with-x is ignored" >&2;}
fi
X_CFLAGS=
X_LIBS=
else
# Check if the user has specified sysroot, but not --x-includes or --x-libraries. # Check if the user has specified sysroot, but not --x-includes or --x-libraries.
# Make a simple check for the libraries at the sysroot, and setup --x-includes and # Make a simple check for the libraries at the sysroot, and setup --x-includes and
# --x-libraries for the sysroot, if that seems to be correct. # --x-libraries for the sysroot, if that seems to be correct.
@ -43988,7 +43996,7 @@ fi
X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[^ ]*//g'` X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[^ ]*//g'`
fi fi
if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then if test "x$no_x" = xyes; then
# Print a helpful message on how to acquire the necessary build dependency. # Print a helpful message on how to acquire the necessary build dependency.
# x11 is the help tag: freetype, cups, pulse, alsa etc # x11 is the help tag: freetype, cups, pulse, alsa etc
@ -44054,14 +44062,48 @@ if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF _ACEOF
X11_A_OK=yes X11_HEADERS_OK=yes
else else
X11_A_OK=no; break X11_HEADERS_OK=no; break
fi fi
done done
if test "x$X11_HEADERS_OK" = xno; then
# Print a helpful message on how to acquire the necessary build dependency.
# x11 is the help tag: freetype, cups, pulse, alsa etc
MISSING_DEPENDENCY=x11
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
cygwin_help $MISSING_DEPENDENCY
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
msys_help $MISSING_DEPENDENCY
else
PKGHANDLER_COMMAND=
case $PKGHANDLER in
apt-get)
apt_help $MISSING_DEPENDENCY ;;
yum)
yum_help $MISSING_DEPENDENCY ;;
port)
port_help $MISSING_DEPENDENCY ;;
pkgutil)
pkgutil_help $MISSING_DEPENDENCY ;;
pkgadd)
pkgadd_help $MISSING_DEPENDENCY ;;
esac
if test "x$PKGHANDLER_COMMAND" != x; then
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
fi
fi
as_fn_error $? "Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG" "$LINENO" 5
fi
# If XLinearGradient isn't available in Xrender.h, signal that it needs to be # If XLinearGradient isn't available in Xrender.h, signal that it needs to be
# defined in libawt_xawt. # defined in libawt_xawt.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if XlinearGradient is defined in Xrender.h" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if XlinearGradient is defined in Xrender.h" >&5
@ -44094,40 +44136,7 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
fi # X11_NOT_NEEDED
if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then
# Print a helpful message on how to acquire the necessary build dependency.
# x11 is the help tag: freetype, cups, pulse, alsa etc
MISSING_DEPENDENCY=x11
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
cygwin_help $MISSING_DEPENDENCY
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
msys_help $MISSING_DEPENDENCY
else
PKGHANDLER_COMMAND=
case $PKGHANDLER in
apt-get)
apt_help $MISSING_DEPENDENCY ;;
yum)
yum_help $MISSING_DEPENDENCY ;;
port)
port_help $MISSING_DEPENDENCY ;;
pkgutil)
pkgutil_help $MISSING_DEPENDENCY ;;
pkgadd)
pkgadd_help $MISSING_DEPENDENCY ;;
esac
if test "x$PKGHANDLER_COMMAND" != x; then
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
fi
fi
as_fn_error $? "Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG" "$LINENO" 5
fi

View File

@ -131,7 +131,7 @@ yum_help() {
pulse) pulse)
PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;; PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;;
x11) x11)
PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel" ;; PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXi-devel" ;;
ccache) ccache)
PKGHANDLER_COMMAND="sudo yum install ccache" ;; PKGHANDLER_COMMAND="sudo yum install ccache" ;;
esac esac

View File

@ -91,6 +91,13 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
# Check for X Windows # Check for X Windows
# #
if test "x$X11_NOT_NEEDED" = xyes; then
if test "x${with_x}" != x; then
AC_MSG_WARN([X11 is not used, so --with-x is ignored])
fi
X_CFLAGS=
X_LIBS=
else
# Check if the user has specified sysroot, but not --x-includes or --x-libraries. # Check if the user has specified sysroot, but not --x-includes or --x-libraries.
# Make a simple check for the libraries at the sysroot, and setup --x-includes and # Make a simple check for the libraries at the sysroot, and setup --x-includes and
# --x-libraries for the sysroot, if that seems to be correct. # --x-libraries for the sysroot, if that seems to be correct.
@ -125,7 +132,7 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'` X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'`
fi fi
if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then if test "x$no_x" = xyes; then
HELP_MSG_MISSING_DEPENDENCY([x11]) HELP_MSG_MISSING_DEPENDENCY([x11])
AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG]) AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG])
fi fi
@ -145,14 +152,19 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
# Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10 # 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([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h],
[X11_A_OK=yes], [X11_HEADERS_OK=yes],
[X11_A_OK=no; break], [X11_HEADERS_OK=no; break],
[ [
# include <X11/Xlib.h> # include <X11/Xlib.h>
# include <X11/Xutil.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 XTest.h Intrinsic.h). $HELP_MSG])
fi
# If XLinearGradient isn't available in Xrender.h, signal that it needs to be # If XLinearGradient isn't available in Xrender.h, signal that it needs to be
# defined in libawt_xawt. # defined in libawt_xawt.
AC_MSG_CHECKING([if XlinearGradient is defined in Xrender.h]) AC_MSG_CHECKING([if XlinearGradient is defined in Xrender.h])
@ -165,11 +177,7 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
CFLAGS="$OLD_CFLAGS" CFLAGS="$OLD_CFLAGS"
AC_LANG_POP(C) AC_LANG_POP(C)
fi # X11_NOT_NEEDED
if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; 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])
fi
AC_SUBST(X_CFLAGS) AC_SUBST(X_CFLAGS)
AC_SUBST(X_LIBS) AC_SUBST(X_LIBS)