common/autoconf/help.m4

Thu, 31 Aug 2017 15:40:18 +0800

author
aoqi
date
Thu, 31 Aug 2017 15:40:18 +0800
changeset 1133
50aaf272884f
parent 972
f3697e0783e2
parent 0
75a576e87639
child 2316
64a3eeabf6e5
permissions
-rw-r--r--

merge

aoqi@0 1 #
aoqi@0 2 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 #
aoqi@0 5 # This code is free software; you can redistribute it and/or modify it
aoqi@0 6 # under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 # published by the Free Software Foundation. Oracle designates this
aoqi@0 8 # particular file as subject to the "Classpath" exception as provided
aoqi@0 9 # by Oracle in the LICENSE file that accompanied this code.
aoqi@0 10 #
aoqi@0 11 # This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 14 # version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 15 # accompanied this code).
aoqi@0 16 #
aoqi@0 17 # You should have received a copy of the GNU General Public License version
aoqi@0 18 # 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 20 #
aoqi@0 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 22 # or visit www.oracle.com if you need additional information or have any
aoqi@0 23 # questions.
aoqi@0 24 #
aoqi@0 25
aoqi@0 26 AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
aoqi@0 27 [
aoqi@0 28 AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd)
aoqi@0 29 ])
aoqi@0 30
aoqi@0 31 AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
aoqi@0 32 [
aoqi@0 33 # Print a helpful message on how to acquire the necessary build dependency.
aoqi@0 34 # $1 is the help tag: freetype, cups, pulse, alsa etc
aoqi@0 35 MISSING_DEPENDENCY=$1
aoqi@0 36
aoqi@0 37 if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
aoqi@0 38 cygwin_help $MISSING_DEPENDENCY
aoqi@0 39 elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
aoqi@0 40 msys_help $MISSING_DEPENDENCY
aoqi@0 41 else
aoqi@0 42 PKGHANDLER_COMMAND=
aoqi@0 43
aoqi@0 44 case $PKGHANDLER in
aoqi@0 45 apt-get)
aoqi@0 46 apt_help $MISSING_DEPENDENCY ;;
aoqi@0 47 yum)
aoqi@0 48 yum_help $MISSING_DEPENDENCY ;;
aoqi@0 49 port)
aoqi@0 50 port_help $MISSING_DEPENDENCY ;;
aoqi@0 51 pkgutil)
aoqi@0 52 pkgutil_help $MISSING_DEPENDENCY ;;
aoqi@0 53 pkgadd)
aoqi@0 54 pkgadd_help $MISSING_DEPENDENCY ;;
aoqi@0 55 esac
aoqi@0 56
aoqi@0 57 if test "x$PKGHANDLER_COMMAND" != x; then
aoqi@0 58 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
aoqi@0 59 fi
aoqi@0 60 fi
aoqi@0 61 ])
aoqi@0 62
aoqi@0 63 cygwin_help() {
aoqi@0 64 case $1 in
aoqi@0 65 unzip)
aoqi@0 66 PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P unzip )"
aoqi@0 67 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
aoqi@0 68 ;;
aoqi@0 69 zip)
aoqi@0 70 PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P zip )"
aoqi@0 71 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
aoqi@0 72 ;;
aoqi@0 73 make)
aoqi@0 74 PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P make )"
aoqi@0 75 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
aoqi@0 76 ;;
aoqi@0 77 freetype)
aoqi@0 78 if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
aoqi@0 79 HELP_MSG="To install freetype, run:
aoqi@0 80 wget \"http://gnuwin32.sourceforge.net/downlinks/freetype.php\" -O /tmp/freetype-setup.exe
aoqi@0 81 chmod +x /tmp/freetype-setup.exe
aoqi@0 82 /tmp/freetype-setup.exe
aoqi@0 83 Follow GUI prompts, and install to default directory \"C:\Program Files (x86)\GnuWin32\".
aoqi@0 84 After installation, locate lib/libfreetype.dll.a and make a copy with the name freetype.dll."
aoqi@0 85 else
aoqi@0 86 HELP_MSG="You need to build a 64-bit version of freetype.
aoqi@0 87 This is not readily available.
aoqi@0 88 You can find source code and build instructions on
aoqi@0 89 http://www.freetype.org/
aoqi@0 90 If you put the resulting build in \"C:\Program Files\GnuWin32\", it will be found automatically."
aoqi@0 91 fi
aoqi@0 92 ;;
aoqi@0 93 esac
aoqi@0 94 }
aoqi@0 95
aoqi@0 96 msys_help() {
aoqi@0 97 PKGHANDLER_COMMAND=""
aoqi@0 98 }
aoqi@0 99
aoqi@0 100 apt_help() {
aoqi@0 101 case $1 in
aoqi@0 102 devkit)
aoqi@0 103 PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
aoqi@0 104 openjdk)
aoqi@0 105 PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;;
aoqi@0 106 alsa)
aoqi@0 107 PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
aoqi@0 108 cups)
aoqi@0 109 PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;;
aoqi@0 110 freetype)
aoqi@0 111 PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
aoqi@0 112 pulse)
aoqi@0 113 PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;;
aoqi@0 114 x11)
aoqi@0 115 PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;;
aoqi@0 116 ccache)
aoqi@0 117 PKGHANDLER_COMMAND="sudo apt-get install ccache" ;;
aoqi@0 118 esac
aoqi@0 119 }
aoqi@0 120
aoqi@0 121 yum_help() {
aoqi@0 122 case $1 in
aoqi@0 123 devkit)
aoqi@0 124 PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
aoqi@0 125 openjdk)
aoqi@0 126 PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;;
aoqi@0 127 alsa)
aoqi@0 128 PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
aoqi@0 129 cups)
aoqi@0 130 PKGHANDLER_COMMAND="sudo yum install cups-devel" ;;
aoqi@0 131 freetype)
aoqi@0 132 PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
aoqi@0 133 pulse)
aoqi@0 134 PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;;
aoqi@0 135 x11)
aoqi@0 136 PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel" ;;
aoqi@0 137 ccache)
aoqi@0 138 PKGHANDLER_COMMAND="sudo yum install ccache" ;;
aoqi@0 139 esac
aoqi@0 140 }
aoqi@0 141
aoqi@0 142 port_help() {
aoqi@0 143 PKGHANDLER_COMMAND=""
aoqi@0 144 }
aoqi@0 145
aoqi@0 146 pkgutil_help() {
aoqi@0 147 PKGHANDLER_COMMAND=""
aoqi@0 148 }
aoqi@0 149
aoqi@0 150 pkgadd_help() {
aoqi@0 151 PKGHANDLER_COMMAND=""
aoqi@0 152 }
aoqi@0 153
aoqi@0 154 AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
aoqi@0 155 [
aoqi@0 156 # Finally output some useful information to the user
aoqi@0 157
aoqi@0 158 if test "x$CCACHE_FOUND" != x; then
aoqi@0 159 if test "x$HAS_GOOD_CCACHE" = x; then
aoqi@0 160 CCACHE_STATUS="installed, but disabled (version older than 3.1.4)"
aoqi@0 161 CCACHE_HELP_MSG="You have ccache installed, but it is a version prior to 3.1.4. Try upgrading."
aoqi@0 162 else
aoqi@0 163 CCACHE_STATUS="installed and in use"
aoqi@0 164 fi
aoqi@0 165 else
aoqi@0 166 if test "x$GCC" = xyes; then
aoqi@0 167 CCACHE_STATUS="not installed (consider installing)"
aoqi@0 168 CCACHE_HELP_MSG="You do not have ccache installed. Try installing it."
aoqi@0 169 else
aoqi@0 170 CCACHE_STATUS="not available for your system"
aoqi@0 171 fi
aoqi@0 172 fi
aoqi@0 173
aoqi@0 174 printf "\n"
aoqi@0 175 printf "====================================================\n"
aoqi@0 176 printf "A new configuration has been successfully created in\n"
aoqi@0 177 printf "$OUTPUT_ROOT\n"
aoqi@0 178 if test "x$CONFIGURE_COMMAND_LINE" != x; then
aoqi@0 179 printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n"
aoqi@0 180 else
aoqi@0 181 printf "using default settings.\n"
aoqi@0 182 fi
aoqi@0 183
aoqi@0 184 printf "\n"
aoqi@0 185 printf "Configuration summary:\n"
aoqi@0 186 printf "* Debug level: $DEBUG_LEVEL\n"
aoqi@0 187 printf "* JDK variant: $JDK_VARIANT\n"
aoqi@0 188 printf "* JVM variants: $with_jvm_variants\n"
aoqi@0 189 printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
aoqi@0 190
aoqi@0 191 printf "\n"
aoqi@0 192 printf "Tools summary:\n"
aoqi@0 193 if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
aoqi@0 194 printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n"
aoqi@0 195 fi
aoqi@0 196 printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
aoqi@0 197 printf "* C Compiler: $CC_VENDOR version $CC_VERSION (at $CC)\n"
aoqi@0 198 printf "* C++ Compiler: $CXX_VENDOR version $CXX_VERSION (at $CXX)\n"
aoqi@0 199
aoqi@0 200 printf "\n"
aoqi@0 201 printf "Build performance summary:\n"
aoqi@0 202 printf "* Cores to use: $JOBS\n"
aoqi@0 203 printf "* Memory limit: $MEMORY_SIZE MB\n"
aoqi@0 204 printf "* ccache status: $CCACHE_STATUS\n"
aoqi@0 205 printf "\n"
aoqi@0 206
aoqi@0 207 if test "x$CCACHE_HELP_MSG" != x && test "x$HIDE_PERFORMANCE_HINTS" = "xno"; then
aoqi@0 208 printf "Build performance tip: ccache gives a tremendous speedup for C++ recompilations.\n"
aoqi@0 209 printf "$CCACHE_HELP_MSG\n"
aoqi@0 210 HELP_MSG_MISSING_DEPENDENCY([ccache])
aoqi@0 211 printf "$HELP_MSG\n"
aoqi@0 212 printf "\n"
aoqi@0 213 fi
aoqi@0 214
aoqi@0 215 if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then
aoqi@0 216 printf "NOTE: You have requested to build more than one version of the JVM, which\n"
aoqi@0 217 printf "will result in longer build times.\n"
aoqi@0 218 printf "\n"
aoqi@0 219 fi
aoqi@0 220
aoqi@0 221 if test "x$FOUND_ALT_VARIABLES" != "x"; then
aoqi@0 222 printf "WARNING: You have old-style ALT_ environment variables set.\n"
aoqi@0 223 printf "These are not respected, and will be ignored. It is recommended\n"
aoqi@0 224 printf "that you clean your environment. The following variables are set:\n"
aoqi@0 225 printf "$FOUND_ALT_VARIABLES\n"
aoqi@0 226 printf "\n"
aoqi@0 227 fi
aoqi@0 228
aoqi@0 229 if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
aoqi@0 230 printf "WARNING: Your build output directory is not on a local disk.\n"
aoqi@0 231 printf "This will severely degrade build performance!\n"
aoqi@0 232 printf "It is recommended that you create an output directory on a local disk,\n"
aoqi@0 233 printf "and run the configure script again from that directory.\n"
aoqi@0 234 printf "\n"
aoqi@0 235 fi
aoqi@0 236
aoqi@0 237 if test "x$IS_RECONFIGURE" = "xyes"; then
aoqi@0 238 printf "WARNING: The result of this configuration has overridden an older\n"
aoqi@0 239 printf "configuration. You *should* run 'make clean' to make sure you get a\n"
aoqi@0 240 printf "proper build. Failure to do so might result in strange build problems.\n"
aoqi@0 241 printf "\n"
aoqi@0 242 fi
aoqi@0 243 ])

mercurial