8163102: Fix headless only configuration option
authorerikj
Mon, 26 Sep 2016 14:57:00 +0200
changeset 41046 bee72dd4067b
parent 41045 2e4b18e1ebff
child 41047 de6f69208f82
8163102: Fix headless only configuration option Reviewed-by: tbell
common/autoconf/generated-configure.sh
common/autoconf/jdk-options.m4
common/autoconf/libraries.m4
common/autoconf/spec.gmk.in
--- a/common/autoconf/generated-configure.sh	Thu Sep 22 18:31:10 2016 +0000
+++ b/common/autoconf/generated-configure.sh	Mon Sep 26 14:57:00 2016 +0200
@@ -926,9 +926,7 @@
 INCLUDE_SA
 UNLIMITED_CRYPTO
 CACERTS_FILE
-BUILD_HEADLESS
-SUPPORT_HEADFUL
-SUPPORT_HEADLESS
+ENABLE_HEADLESS_ONLY
 DEFAULT_MAKE_TARGET
 OS_VERSION_MICRO
 OS_VERSION_MINOR
@@ -1153,7 +1151,7 @@
 with_conf_name
 with_output_sync
 with_default_make_target
-enable_headful
+enable_headless_only
 with_cacerts_file
 enable_unlimited_crypto
 with_copyright_year
@@ -1976,8 +1974,7 @@
                           [disabled]
   --enable-debug          set the debug level to fastdebug (shorthand for
                           --with-debug-level=fastdebug) [disabled]
-  --disable-headful       disable building headful support (graphical UI
-                          support) [enabled]
+  --enable-headless-only  only build headless (no GUI) support [disabled]
   --enable-unlimited-crypto
                           Enable unlimited crypto policy [disabled]
   --disable-keep-packaged-modules
@@ -5095,7 +5092,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1474460325
+DATE_WHEN_GENERATED=1474894604
 
 ###############################################################################
 #
@@ -24192,36 +24189,30 @@
 
 # We need build & target for this.
 
-  # Should we build a JDK/JVM with headful support (ie a graphical ui)?
-  # We always build headless support.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking headful support" >&5
-$as_echo_n "checking headful support... " >&6; }
-  # Check whether --enable-headful was given.
-if test "${enable_headful+set}" = set; then :
-  enableval=$enable_headful; SUPPORT_HEADFUL=${enable_headful}
-else
-  SUPPORT_HEADFUL=yes
-fi
-
-
-  SUPPORT_HEADLESS=yes
-  BUILD_HEADLESS="BUILD_HEADLESS:=true"
-
-  if test "x$SUPPORT_HEADFUL" = xyes; then
-    # We are building both headful and headless.
-    headful_msg="include support for both headful and headless"
-  fi
-
-  if test "x$SUPPORT_HEADFUL" = xno; then
-    # Thus we are building headless only.
-    BUILD_HEADLESS="BUILD_HEADLESS:=true"
-    headful_msg="headless only"
-  fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $headful_msg" >&5
-$as_echo "$headful_msg" >&6; }
-
-
+  # Should we build a JDK without a graphical UI?
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking headless only" >&5
+$as_echo_n "checking headless only... " >&6; }
+  # Check whether --enable-headless-only was given.
+if test "${enable_headless_only+set}" = set; then :
+  enableval=$enable_headless_only;
+fi
+
+
+  if test "x$enable_headless_only" = "xyes"; then
+    ENABLE_HEADLESS_ONLY="true"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  elif test "x$enable_headless_only" = "xno"; then
+    ENABLE_HEADLESS_ONLY="false"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  elif test "x$enable_headless_only" = "x"; then
+    ENABLE_HEADLESS_ONLY="false"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  else
+    as_fn_error $? "--enable-headless-only can only take yes or no" "$LINENO" 5
+  fi
 
 
 
@@ -53045,13 +53036,9 @@
     # No X11 support on windows or macosx
     NEEDS_LIB_X11=false
   else
-    if test "x$SUPPORT_HEADFUL" = xno; then
-      # No X11 support if building headless-only
-      NEEDS_LIB_X11=false
-    else
-      # All other instances need X11
-      NEEDS_LIB_X11=true
-    fi
+    # All other instances need X11, even if building headless only, libawt still
+    # needs X11 headers.
+    NEEDS_LIB_X11=true
   fi
 
   # Check if cups is needed
--- a/common/autoconf/jdk-options.m4	Thu Sep 22 18:31:10 2016 +0000
+++ b/common/autoconf/jdk-options.m4	Mon Sep 26 14:57:00 2016 +0200
@@ -134,32 +134,25 @@
 
 AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
 [
-  # Should we build a JDK/JVM with headful support (ie a graphical ui)?
-  # We always build headless support.
-  AC_MSG_CHECKING([headful support])
-  AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful],
-      [disable building headful support (graphical UI support) @<:@enabled@:>@])],
-      [SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes])
+  # Should we build a JDK without a graphical UI?
+  AC_MSG_CHECKING([headless only])
+  AC_ARG_ENABLE([headless-only], [AS_HELP_STRING([--enable-headless-only],
+      [only build headless (no GUI) support @<:@disabled@:>@])])
 
-  SUPPORT_HEADLESS=yes
-  BUILD_HEADLESS="BUILD_HEADLESS:=true"
-
-  if test "x$SUPPORT_HEADFUL" = xyes; then
-    # We are building both headful and headless.
-    headful_msg="include support for both headful and headless"
+  if test "x$enable_headless_only" = "xyes"; then
+    ENABLE_HEADLESS_ONLY="true"
+    AC_MSG_RESULT([yes])
+  elif test "x$enable_headless_only" = "xno"; then
+    ENABLE_HEADLESS_ONLY="false"
+    AC_MSG_RESULT([no])
+  elif test "x$enable_headless_only" = "x"; then
+    ENABLE_HEADLESS_ONLY="false"
+    AC_MSG_RESULT([no])
+  else
+    AC_MSG_ERROR([--enable-headless-only can only take yes or no])
   fi
 
-  if test "x$SUPPORT_HEADFUL" = xno; then
-    # Thus we are building headless only.
-    BUILD_HEADLESS="BUILD_HEADLESS:=true"
-    headful_msg="headless only"
-  fi
-
-  AC_MSG_RESULT([$headful_msg])
-
-  AC_SUBST(SUPPORT_HEADLESS)
-  AC_SUBST(SUPPORT_HEADFUL)
-  AC_SUBST(BUILD_HEADLESS)
+  AC_SUBST(ENABLE_HEADLESS_ONLY)
 
   # Choose cacerts source file
   AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
--- a/common/autoconf/libraries.m4	Thu Sep 22 18:31:10 2016 +0000
+++ b/common/autoconf/libraries.m4	Mon Sep 26 14:57:00 2016 +0200
@@ -42,13 +42,9 @@
     # No X11 support on windows or macosx
     NEEDS_LIB_X11=false
   else
-    if test "x$SUPPORT_HEADFUL" = xno; then
-      # No X11 support if building headless-only
-      NEEDS_LIB_X11=false
-    else
-      # All other instances need X11
-      NEEDS_LIB_X11=true
-    fi
+    # All other instances need X11, even if building headless only, libawt still
+    # needs X11 headers.
+    NEEDS_LIB_X11=true
   fi
 
   # Check if cups is needed
--- a/common/autoconf/spec.gmk.in	Thu Sep 22 18:31:10 2016 +0000
+++ b/common/autoconf/spec.gmk.in	Mon Sep 26 14:57:00 2016 +0200
@@ -241,12 +241,8 @@
 # Control use of precompiled header in hotspot libjvm build
 USE_PRECOMPILED_HEADER := @USE_PRECOMPILED_HEADER@
 
-# Should we compile support for running with a graphical UI? (ie headful)
-# Should we compile support for running without? (ie headless)
-SUPPORT_HEADFUL:=@SUPPORT_HEADFUL@
-SUPPORT_HEADLESS:=@SUPPORT_HEADLESS@
-# Legacy defines controlled by the SUPPORT_HEADLESS and SUPPORT_HEADFUL options.
-@BUILD_HEADLESS@
+# Only build headless support or not
+ENABLE_HEADLESS_ONLY := @ENABLE_HEADLESS_ONLY@
 
 # Legacy support
 USE_NEW_HOTSPOT_BUILD:=@USE_NEW_HOTSPOT_BUILD@