common/autoconf/help.m4

changeset 0
75a576e87639
child 1133
50aaf272884f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/common/autoconf/help.m4	Wed Apr 27 01:39:08 2016 +0800
     1.3 @@ -0,0 +1,243 @@
     1.4 +#
     1.5 +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 +#
     1.8 +# This code is free software; you can redistribute it and/or modify it
     1.9 +# under the terms of the GNU General Public License version 2 only, as
    1.10 +# published by the Free Software Foundation.  Oracle designates this
    1.11 +# particular file as subject to the "Classpath" exception as provided
    1.12 +# by Oracle in the LICENSE file that accompanied this code.
    1.13 +#
    1.14 +# This code is distributed in the hope that it will be useful, but WITHOUT
    1.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.16 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.17 +# version 2 for more details (a copy is included in the LICENSE file that
    1.18 +# accompanied this code).
    1.19 +#
    1.20 +# You should have received a copy of the GNU General Public License version
    1.21 +# 2 along with this work; if not, write to the Free Software Foundation,
    1.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.23 +#
    1.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.25 +# or visit www.oracle.com if you need additional information or have any
    1.26 +# questions.
    1.27 +#
    1.28 +
    1.29 +AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
    1.30 +[
    1.31 +  AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd)
    1.32 +])
    1.33 +
    1.34 +AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
    1.35 +[
    1.36 +  # Print a helpful message on how to acquire the necessary build dependency.
    1.37 +  # $1 is the help tag: freetype, cups, pulse, alsa etc
    1.38 +  MISSING_DEPENDENCY=$1
    1.39 +
    1.40 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
    1.41 +    cygwin_help $MISSING_DEPENDENCY
    1.42 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
    1.43 +    msys_help $MISSING_DEPENDENCY
    1.44 +  else
    1.45 +    PKGHANDLER_COMMAND=
    1.46 +
    1.47 +    case $PKGHANDLER in
    1.48 +      apt-get)
    1.49 +        apt_help     $MISSING_DEPENDENCY ;;
    1.50 +      yum)
    1.51 +        yum_help     $MISSING_DEPENDENCY ;;
    1.52 +      port)
    1.53 +        port_help    $MISSING_DEPENDENCY ;;
    1.54 +      pkgutil)
    1.55 +        pkgutil_help $MISSING_DEPENDENCY ;;
    1.56 +      pkgadd)
    1.57 +        pkgadd_help  $MISSING_DEPENDENCY ;;
    1.58 +    esac
    1.59 +
    1.60 +    if test "x$PKGHANDLER_COMMAND" != x; then
    1.61 +      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
    1.62 +    fi
    1.63 +  fi
    1.64 +])
    1.65 +
    1.66 +cygwin_help() {
    1.67 +  case $1 in
    1.68 +    unzip)
    1.69 +      PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P unzip )"
    1.70 +      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
    1.71 +      ;;
    1.72 +    zip)
    1.73 +      PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P zip )"
    1.74 +      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
    1.75 +      ;;
    1.76 +    make)
    1.77 +      PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P make )"
    1.78 +      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
    1.79 +      ;;
    1.80 +    freetype)
    1.81 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
    1.82 +        HELP_MSG="To install freetype, run:
    1.83 +wget \"http://gnuwin32.sourceforge.net/downlinks/freetype.php\" -O /tmp/freetype-setup.exe
    1.84 +chmod +x /tmp/freetype-setup.exe
    1.85 +/tmp/freetype-setup.exe
    1.86 +Follow GUI prompts, and install to default directory \"C:\Program Files (x86)\GnuWin32\".
    1.87 +After installation, locate lib/libfreetype.dll.a and make a copy with the name freetype.dll."
    1.88 +      else
    1.89 +        HELP_MSG="You need to build a 64-bit version of freetype.
    1.90 +This is not readily available.
    1.91 +You can find source code and build instructions on
    1.92 +http://www.freetype.org/
    1.93 +If you put the resulting build in \"C:\Program Files\GnuWin32\", it will be found automatically."
    1.94 +      fi
    1.95 +      ;;
    1.96 +  esac
    1.97 +}
    1.98 +
    1.99 +msys_help() {
   1.100 +  PKGHANDLER_COMMAND=""
   1.101 +}
   1.102 +
   1.103 +apt_help() {
   1.104 +  case $1 in
   1.105 +    devkit)
   1.106 +      PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
   1.107 +    openjdk)
   1.108 +      PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;;
   1.109 +    alsa)
   1.110 +      PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
   1.111 +    cups)
   1.112 +      PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;;
   1.113 +    freetype)
   1.114 +      PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
   1.115 +    pulse)
   1.116 +      PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;;
   1.117 +    x11)
   1.118 +      PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;;
   1.119 +    ccache)
   1.120 +      PKGHANDLER_COMMAND="sudo apt-get install ccache" ;;
   1.121 +  esac
   1.122 +}
   1.123 +
   1.124 +yum_help() {
   1.125 +  case $1 in
   1.126 +    devkit)
   1.127 +      PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
   1.128 +    openjdk)
   1.129 +      PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;;
   1.130 +    alsa)
   1.131 +      PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
   1.132 +    cups)
   1.133 +      PKGHANDLER_COMMAND="sudo yum install cups-devel" ;;
   1.134 +    freetype)
   1.135 +      PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
   1.136 +    pulse)
   1.137 +      PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;;
   1.138 +    x11)
   1.139 +      PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel" ;;
   1.140 +    ccache)
   1.141 +      PKGHANDLER_COMMAND="sudo yum install ccache" ;;
   1.142 +  esac
   1.143 +}
   1.144 +
   1.145 +port_help() {
   1.146 +  PKGHANDLER_COMMAND=""
   1.147 +}
   1.148 +
   1.149 +pkgutil_help() {
   1.150 +  PKGHANDLER_COMMAND=""
   1.151 +}
   1.152 +
   1.153 +pkgadd_help() {
   1.154 +  PKGHANDLER_COMMAND=""
   1.155 +}
   1.156 +
   1.157 +AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
   1.158 +[
   1.159 +  # Finally output some useful information to the user
   1.160 +
   1.161 +  if test "x$CCACHE_FOUND" != x; then
   1.162 +    if  test "x$HAS_GOOD_CCACHE" = x; then
   1.163 +      CCACHE_STATUS="installed, but disabled (version older than 3.1.4)"
   1.164 +      CCACHE_HELP_MSG="You have ccache installed, but it is a version prior to 3.1.4. Try upgrading."
   1.165 +    else
   1.166 +      CCACHE_STATUS="installed and in use"
   1.167 +    fi
   1.168 +  else
   1.169 +    if test "x$GCC" = xyes; then
   1.170 +      CCACHE_STATUS="not installed (consider installing)"
   1.171 +      CCACHE_HELP_MSG="You do not have ccache installed. Try installing it."
   1.172 +    else
   1.173 +      CCACHE_STATUS="not available for your system"
   1.174 +    fi
   1.175 +  fi
   1.176 +
   1.177 +  printf "\n"
   1.178 +  printf "====================================================\n"
   1.179 +  printf "A new configuration has been successfully created in\n"
   1.180 +  printf "$OUTPUT_ROOT\n"
   1.181 +  if test "x$CONFIGURE_COMMAND_LINE" != x; then
   1.182 +    printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n"
   1.183 +  else
   1.184 +    printf "using default settings.\n"
   1.185 +  fi
   1.186 +
   1.187 +  printf "\n"
   1.188 +  printf "Configuration summary:\n"
   1.189 +  printf "* Debug level:    $DEBUG_LEVEL\n"
   1.190 +  printf "* JDK variant:    $JDK_VARIANT\n"
   1.191 +  printf "* JVM variants:   $with_jvm_variants\n"
   1.192 +  printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
   1.193 +
   1.194 +  printf "\n"
   1.195 +  printf "Tools summary:\n"
   1.196 +  if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
   1.197 +    printf "* Environment:    $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n"
   1.198 +  fi
   1.199 +  printf "* Boot JDK:       $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
   1.200 +  printf "* C Compiler:     $CC_VENDOR version $CC_VERSION (at $CC)\n"
   1.201 +  printf "* C++ Compiler:   $CXX_VENDOR version $CXX_VERSION (at $CXX)\n"
   1.202 +
   1.203 +  printf "\n"
   1.204 +  printf "Build performance summary:\n"
   1.205 +  printf "* Cores to use:   $JOBS\n"
   1.206 +  printf "* Memory limit:   $MEMORY_SIZE MB\n"
   1.207 +  printf "* ccache status:  $CCACHE_STATUS\n"
   1.208 +  printf "\n"
   1.209 +
   1.210 +  if test "x$CCACHE_HELP_MSG" != x && test "x$HIDE_PERFORMANCE_HINTS" = "xno"; then
   1.211 +    printf "Build performance tip: ccache gives a tremendous speedup for C++ recompilations.\n"
   1.212 +    printf "$CCACHE_HELP_MSG\n"
   1.213 +    HELP_MSG_MISSING_DEPENDENCY([ccache])
   1.214 +    printf "$HELP_MSG\n"
   1.215 +    printf "\n"
   1.216 +  fi
   1.217 +
   1.218 +  if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then
   1.219 +    printf "NOTE: You have requested to build more than one version of the JVM, which\n"
   1.220 +    printf "will result in longer build times.\n"
   1.221 +    printf "\n"
   1.222 +  fi
   1.223 +
   1.224 +  if test "x$FOUND_ALT_VARIABLES" != "x"; then
   1.225 +    printf "WARNING: You have old-style ALT_ environment variables set.\n"
   1.226 +    printf "These are not respected, and will be ignored. It is recommended\n"
   1.227 +    printf "that you clean your environment. The following variables are set:\n"
   1.228 +    printf "$FOUND_ALT_VARIABLES\n"
   1.229 +    printf "\n"
   1.230 +  fi
   1.231 +
   1.232 +  if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
   1.233 +    printf "WARNING: Your build output directory is not on a local disk.\n"
   1.234 +    printf "This will severely degrade build performance!\n"
   1.235 +    printf "It is recommended that you create an output directory on a local disk,\n"
   1.236 +    printf "and run the configure script again from that directory.\n"
   1.237 +    printf "\n"
   1.238 +  fi
   1.239 +
   1.240 +  if test "x$IS_RECONFIGURE" = "xyes"; then
   1.241 +    printf "WARNING: The result of this configuration has overridden an older\n"
   1.242 +    printf "configuration. You *should* run 'make clean' to make sure you get a\n"
   1.243 +    printf "proper build. Failure to do so might result in strange build problems.\n"
   1.244 +    printf "\n"
   1.245 +  fi
   1.246 +])

mercurial