changeset 1672:1bd7043059ae

8138627: Better help message in configure for reduced builds (target-bits=32) Reviewed-by: erikj
author ihse
date Wed, 30 Sep 2015 11:38:01 +0200
parents 7e3aefe760d0
children 6e5ccf55ed76 fd80ddb7553f
files common/autoconf/generated-configure.sh common/autoconf/help.m4 common/autoconf/platform.m4
diffstat 3 files changed, 90 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/common/autoconf/generated-configure.sh	Mon Sep 28 13:39:10 2015 +0100
+++ b/common/autoconf/generated-configure.sh	Wed Sep 30 11:38:01 2015 +0200
@@ -3886,6 +3886,8 @@
 
 apt_help() {
   case $1 in
+    reduced)
+      PKGHANDLER_COMMAND="sudo apt-get install gcc-multilib g++-multilib" ;;
     devkit)
       PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
     openjdk)
@@ -4362,7 +4364,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1442820958
+DATE_WHEN_GENERATED=1443605847
 
 ###############################################################################
 #
@@ -41543,8 +41545,38 @@
     { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to compile stdio.h. This likely implies missing compile dependencies." >&5
 $as_echo "$as_me: Failed to compile stdio.h. This likely implies missing compile dependencies." >&6;}
     if test "x$COMPILE_TYPE" = xreduced; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a reduced build. Check that you have 32-bit libraries installed." >&5
-$as_echo "$as_me: You are doing a reduced build. Check that you have 32-bit libraries installed." >&6;}
+
+  # Print a helpful message on how to acquire the necessary build dependency.
+  # reduced is the help tag: freetype, cups, pulse, alsa etc
+  MISSING_DEPENDENCY=reduced
+
+  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_echo "$as_me:${as_lineno-$LINENO}: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&5
+$as_echo "$as_me: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&6;}
     elif test "x$COMPILE_TYPE" = xcross; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&5
 $as_echo "$as_me: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&6;}
@@ -41603,8 +41635,8 @@
       # Let's try to implicitely set the compilers target architecture and retry the test
       { $as_echo "$as_me:${as_lineno-$LINENO}: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)." >&5
 $as_echo "$as_me: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: I'll retry after setting the platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" >&5
-$as_echo "$as_me: I'll retry after setting the platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" >&6;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Retrying with platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" >&5
+$as_echo "$as_me: Retrying with platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" >&6;}
 
   # When we add flags to the "official" CFLAGS etc, we need to
   # keep track of these additions in ADDED_CFLAGS etc. These
@@ -41667,7 +41699,46 @@
       TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p`
 
       if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then
-        as_fn_error $? "The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" "$LINENO" 5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" >&5
+$as_echo "$as_me: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" >&6;}
+        if test "x$COMPILE_TYPE" = xreduced; then
+
+  # Print a helpful message on how to acquire the necessary build dependency.
+  # reduced is the help tag: freetype, cups, pulse, alsa etc
+  MISSING_DEPENDENCY=reduced
+
+  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_echo "$as_me:${as_lineno-$LINENO}: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&5
+$as_echo "$as_me: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&6;}
+        elif test "x$COMPILE_TYPE" = xcross; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&5
+$as_echo "$as_me: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&6;}
+        fi
+        as_fn_error $? "Cannot continue." "$LINENO" 5
       fi
     fi
   fi
--- a/common/autoconf/help.m4	Mon Sep 28 13:39:10 2015 +0100
+++ b/common/autoconf/help.m4	Wed Sep 30 11:38:01 2015 +0200
@@ -97,6 +97,8 @@
 
 apt_help() {
   case $1 in
+    reduced)
+      PKGHANDLER_COMMAND="sudo apt-get install gcc-multilib g++-multilib" ;;
     devkit)
       PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
     openjdk)
--- a/common/autoconf/platform.m4	Mon Sep 28 13:39:10 2015 +0100
+++ b/common/autoconf/platform.m4	Wed Sep 30 11:38:01 2015 +0200
@@ -489,7 +489,8 @@
   AC_CHECK_HEADERS([stdio.h], , [
     AC_MSG_NOTICE([Failed to compile stdio.h. This likely implies missing compile dependencies.])
     if test "x$COMPILE_TYPE" = xreduced; then
-      AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed.])
+      HELP_MSG_MISSING_DEPENDENCY([reduced])
+      AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG])
     elif test "x$COMPILE_TYPE" = xcross; then
       AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.])
     fi
@@ -509,7 +510,7 @@
       # This situation may happen on 64-bit platforms where the compiler by default only generates 32-bit objects
       # Let's try to implicitely set the compilers target architecture and retry the test
       AC_MSG_NOTICE([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS).])
-      AC_MSG_NOTICE([I'll retry after setting the platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}])
+      AC_MSG_NOTICE([Retrying with platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}])
       PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS
 
       # We have to unset 'ac_cv_sizeof_int_p' first, otherwise AC_CHECK_SIZEOF will use the previously cached value!
@@ -524,7 +525,14 @@
       TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p`
 
       if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then
-        AC_MSG_ERROR([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)])
+        AC_MSG_NOTICE([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)])
+        if test "x$COMPILE_TYPE" = xreduced; then
+          HELP_MSG_MISSING_DEPENDENCY([reduced])
+          AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG])
+        elif test "x$COMPILE_TYPE" = xcross; then
+          AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.])
+        fi
+        AC_MSG_ERROR([Cannot continue.])
       fi
     fi
   fi