annotate make/autoconf/help.m4 @ 53999:d7852bb72332

8219920: dependency help output in configure-step : support zypper tool Reviewed-by: erikj, ihse
author mbaesken
date Tue, 05 Mar 2019 09:55:00 +0100
parents 2d18e5ed0f8d
children 8b1f7d88746a
rev   line source
ohair@12258 1 #
mbaesken@53999 2 # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
ohair@12258 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@12258 4 #
ohair@12258 5 # This code is free software; you can redistribute it and/or modify it
ohair@12258 6 # under the terms of the GNU General Public License version 2 only, as
ohair@12258 7 # published by the Free Software Foundation. Oracle designates this
ohair@12258 8 # particular file as subject to the "Classpath" exception as provided
ohair@12258 9 # by Oracle in the LICENSE file that accompanied this code.
ohair@12258 10 #
ohair@12258 11 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@12258 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@12258 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@12258 14 # version 2 for more details (a copy is included in the LICENSE file that
ohair@12258 15 # accompanied this code).
ohair@12258 16 #
ohair@12258 17 # You should have received a copy of the GNU General Public License version
ohair@12258 18 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@12258 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@12258 20 #
ohair@12258 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@12258 22 # or visit www.oracle.com if you need additional information or have any
ohair@12258 23 # questions.
ohair@12258 24 #
ohair@12258 25
erikj@13132 26 AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
erikj@13132 27 [
mbaesken@53999 28 AC_CHECK_PROGS(PKGHANDLER, zypper apt-get yum brew port pkgutil pkgadd)
erikj@13132 29 ])
erikj@13132 30
erikj@13132 31 AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
erikj@13132 32 [
ihse@20363 33 # Print a helpful message on how to acquire the necessary build dependency.
prr@49234 34 # $1 is the help tag: cups, alsa etc
ihse@20363 35 MISSING_DEPENDENCY=$1
ohair@12258 36
ihse@20648 37 if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
ihse@20648 38 cygwin_help $MISSING_DEPENDENCY
ihse@20648 39 elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
ihse@20648 40 msys_help $MISSING_DEPENDENCY
ihse@20648 41 else
ihse@20648 42 PKGHANDLER_COMMAND=
ohair@12258 43
ihse@20648 44 case $PKGHANDLER in
ihse@20648 45 apt-get)
ihse@20648 46 apt_help $MISSING_DEPENDENCY ;;
ihse@20648 47 yum)
ihse@20648 48 yum_help $MISSING_DEPENDENCY ;;
ihse@43046 49 brew)
ihse@43046 50 brew_help $MISSING_DEPENDENCY ;;
ihse@20648 51 port)
ihse@20648 52 port_help $MISSING_DEPENDENCY ;;
ihse@20648 53 pkgutil)
ihse@20648 54 pkgutil_help $MISSING_DEPENDENCY ;;
ihse@20648 55 pkgadd)
ihse@20648 56 pkgadd_help $MISSING_DEPENDENCY ;;
mbaesken@53999 57 zypper)
mbaesken@53999 58 zypper_help $MISSING_DEPENDENCY ;;
ihse@20648 59 esac
ihse@20648 60
ihse@20648 61 if test "x$PKGHANDLER_COMMAND" != x; then
ihse@20648 62 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
ihse@20648 63 fi
ihse@20363 64 fi
erikj@13132 65 ])
ohair@12258 66
ohair@14111 67 cygwin_help() {
ihse@20363 68 case $1 in
ohair@14111 69 unzip)
ihse@20648 70 PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P unzip )"
ihse@20648 71 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
ihse@20648 72 ;;
ohair@14111 73 zip)
ihse@20648 74 PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P zip )"
ihse@20648 75 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
ihse@20648 76 ;;
ohair@14111 77 make)
ihse@20648 78 PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P make )"
ihse@20648 79 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
ihse@20648 80 ;;
ihse@20363 81 esac
ohair@14111 82 }
ohair@14111 83
ihse@20648 84 msys_help() {
ihse@20648 85 PKGHANDLER_COMMAND=""
ihse@20648 86 }
ihse@20648 87
erikj@13132 88 apt_help() {
ihse@20363 89 case $1 in
ihse@32809 90 reduced)
ihse@32809 91 PKGHANDLER_COMMAND="sudo apt-get install gcc-multilib g++-multilib" ;;
ohair@12258 92 devkit)
ihse@20363 93 PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
ohair@12258 94 openjdk)
erikj@36296 95 PKGHANDLER_COMMAND="sudo apt-get install openjdk-8-jdk" ;;
ohair@12258 96 alsa)
ihse@20363 97 PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
ohair@12258 98 cups)
ihse@20363 99 PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;;
prr@47507 100 fontconfig)
prr@47507 101 PKGHANDLER_COMMAND="sudo apt-get install libfontconfig1-dev" ;;
ihse@20654 102 freetype)
ihse@20363 103 PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
ihse@32921 104 ffi)
ihse@32921 105 PKGHANDLER_COMMAND="sudo apt-get install libffi-dev" ;;
ohair@12258 106 x11)
simonis@52658 107 PKGHANDLER_COMMAND="sudo apt-get install libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev" ;;
ohair@12258 108 ccache)
ihse@20363 109 PKGHANDLER_COMMAND="sudo apt-get install ccache" ;;
erikj@37402 110 dtrace)
erikj@37402 111 PKGHANDLER_COMMAND="sudo apt-get install systemtap-sdt-dev" ;;
ihse@20363 112 esac
ohair@12258 113 }
ohair@12258 114
mbaesken@53999 115 zypper_help() {
mbaesken@53999 116 case $1 in
mbaesken@53999 117 devkit)
mbaesken@53999 118 PKGHANDLER_COMMAND="sudo zypper install gcc gcc-c++" ;;
mbaesken@53999 119 alsa)
mbaesken@53999 120 PKGHANDLER_COMMAND="sudo zypper install alsa-devel" ;;
mbaesken@53999 121 cups)
mbaesken@53999 122 PKGHANDLER_COMMAND="sudo zypper install cups-devel" ;;
mbaesken@53999 123 fontconfig)
mbaesken@53999 124 PKGHANDLER_COMMAND="sudo zypper install fontconfig-devel" ;;
mbaesken@53999 125 freetype)
mbaesken@53999 126 PKGHANDLER_COMMAND="sudo zypper install freetype-devel" ;;
mbaesken@53999 127 x11)
mbaesken@53999 128 PKGHANDLER_COMMAND="sudo zypper install libX11-devel libXext-devel libXrender-devel libXrandr-devel libXtst-devel libXt-devel libXi-devel" ;;
mbaesken@53999 129 ccache)
mbaesken@53999 130 PKGHANDLER_COMMAND="sudo zypper install ccache" ;;
mbaesken@53999 131 esac
mbaesken@53999 132 }
mbaesken@53999 133
erikj@13132 134 yum_help() {
ihse@20363 135 case $1 in
ohair@12258 136 devkit)
ihse@20363 137 PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
ohair@12258 138 openjdk)
erikj@36296 139 PKGHANDLER_COMMAND="sudo yum install java-1.8.0-openjdk-devel" ;;
ohair@12258 140 alsa)
ihse@20363 141 PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
ohair@12258 142 cups)
ihse@20363 143 PKGHANDLER_COMMAND="sudo yum install cups-devel" ;;
prr@47507 144 fontconfig)
prr@47507 145 PKGHANDLER_COMMAND="sudo yum install fontconfig-devel" ;;
ihse@20654 146 freetype)
ihse@20363 147 PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
ohair@12258 148 x11)
simonis@52658 149 PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel" ;;
ohair@12258 150 ccache)
ihse@20363 151 PKGHANDLER_COMMAND="sudo yum install ccache" ;;
ihse@20363 152 esac
ohair@12258 153 }
ohair@12258 154
ihse@43046 155 brew_help() {
ihse@43046 156 case $1 in
ihse@43046 157 openjdk)
ihse@43046 158 PKGHANDLER_COMMAND="brew cask install java" ;;
ihse@43046 159 freetype)
ihse@43046 160 PKGHANDLER_COMMAND="brew install freetype" ;;
ihse@43046 161 ccache)
ihse@43046 162 PKGHANDLER_COMMAND="brew install ccache" ;;
ihse@43046 163 esac
ihse@43046 164 }
ihse@43046 165
erikj@13132 166 port_help() {
ihse@20363 167 PKGHANDLER_COMMAND=""
ohair@12258 168 }
ohair@12258 169
erikj@13132 170 pkgutil_help() {
ihse@20363 171 PKGHANDLER_COMMAND=""
ohair@12258 172 }
ohair@12258 173
erikj@13132 174 pkgadd_help() {
ihse@20363 175 PKGHANDLER_COMMAND=""
ohair@12258 176 }
erikj@13132 177
ihse@22721 178 # This function will check if we're called from the "configure" wrapper while
ihse@22721 179 # printing --help. If so, we will print out additional information that can
ihse@22721 180 # only be extracted within the autoconf script, and then exit. This must be
ihse@22721 181 # called at the very beginning in configure.ac.
ihse@22721 182 AC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT],
ihse@22721 183 [
ihse@35747 184 if test "x$CONFIGURE_PRINT_ADDITIONAL_HELP" != x; then
ihse@35747 185
ihse@35747 186 # Print available toolchains
ihse@22721 187 $PRINTF "The following toolchains are available as arguments to --with-toolchain-type.\n"
ihse@22721 188 $PRINTF "Which are valid to use depends on the build platform.\n"
ihse@22721 189 for toolchain in $VALID_TOOLCHAINS_all; do
ihse@22721 190 # Use indirect variable referencing
ihse@22721 191 toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain
ihse@22721 192 TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
ihse@22721 193 $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION"
ihse@22721 194 done
erikj@37402 195 $PRINTF "\n"
erikj@37402 196
erikj@37402 197 # Print available jvm features
erikj@37402 198 $PRINTF "The following JVM features are available as arguments to --with-jvm-features.\n"
erikj@37402 199 $PRINTF "Which are valid to use depends on the target platform.\n "
erikj@37402 200 $PRINTF "%s " $VALID_JVM_FEATURES
erikj@37402 201 $PRINTF "\n"
ihse@22721 202
ihse@22721 203 # And now exit directly
ihse@22721 204 exit 0
ihse@22721 205 fi
ihse@22721 206 ])
ihse@22721 207
erikj@13132 208 AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
erikj@13132 209 [
ihse@20363 210 # Finally output some useful information to the user
erikj@13132 211
ihse@20363 212 printf "\n"
ihse@20363 213 printf "====================================================\n"
mduigou@22717 214 if test "x$no_create" != "xyes"; then
mduigou@22717 215 if test "x$IS_RECONFIGURE" != "xyes"; then
ihse@47253 216 printf "A new configuration has been successfully created in\n%s\n" "$OUTPUTDIR"
mduigou@22717 217 else
ihse@47253 218 printf "The existing configuration has been successfully updated in\n%s\n" "$OUTPUTDIR"
mduigou@22717 219 fi
mduigou@22717 220 else
mduigou@22717 221 if test "x$IS_RECONFIGURE" != "xyes"; then
mduigou@22717 222 printf "A configuration has been successfully checked but not created\n"
mduigou@22717 223 else
ihse@47253 224 printf "The existing configuration has been successfully checked in\n%s\n" "$OUTPUTDIR"
mduigou@22717 225 fi
mduigou@22717 226 fi
ihse@20363 227 if test "x$CONFIGURE_COMMAND_LINE" != x; then
ihse@20363 228 printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n"
ihse@20363 229 else
ihse@20363 230 printf "using default settings.\n"
ihse@20363 231 fi
erikj@13132 232
ihse@20363 233 printf "\n"
ihse@20363 234 printf "Configuration summary:\n"
ihse@20363 235 printf "* Debug level: $DEBUG_LEVEL\n"
simonis@23424 236 printf "* HS debug level: $HOTSPOT_DEBUG_LEVEL\n"
erikj@37402 237 printf "* JVM variants: $JVM_VARIANTS\n"
ihse@49582 238 printf "* JVM features: "
ihse@49582 239
ihse@49582 240 for variant in $JVM_VARIANTS; do
ihse@49582 241 features_var_name=JVM_FEATURES_$variant
ihse@49582 242 JVM_FEATURES_FOR_VARIANT=${!features_var_name}
ihse@49582 243 printf "$variant: \'$JVM_FEATURES_FOR_VARIANT\' "
ihse@49582 244 done
ihse@49582 245 printf "\n"
ihse@49582 246
ihse@20363 247 printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
ihse@33926 248 printf "* Version string: $VERSION_STRING ($VERSION_SHORT)\n"
ohair@14111 249
ihse@20363 250 printf "\n"
ihse@20363 251 printf "Tools summary:\n"
ihse@20363 252 if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
ihse@20363 253 printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n"
ihse@20363 254 fi
ihse@20363 255 printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
erikj@48678 256 printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n"
ihse@22721 257 printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n"
ihse@22721 258 printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n"
erikj@13132 259
ihse@20363 260 printf "\n"
ihse@20363 261 printf "Build performance summary:\n"
ihse@20363 262 printf "* Cores to use: $JOBS\n"
ihse@20363 263 printf "* Memory limit: $MEMORY_SIZE MB\n"
ihse@22474 264 if test "x$CCACHE_STATUS" != "x"; then
ihse@22474 265 printf "* ccache status: $CCACHE_STATUS\n"
ihse@22474 266 fi
ihse@20363 267 printf "\n"
erikj@13132 268
erikj@37402 269 if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then
ihse@20363 270 printf "NOTE: You have requested to build more than one version of the JVM, which\n"
ihse@20363 271 printf "will result in longer build times.\n"
ihse@20363 272 printf "\n"
ihse@20363 273 fi
erikj@13132 274
ihse@20363 275 if test "x$FOUND_ALT_VARIABLES" != "x"; then
ihse@20363 276 printf "WARNING: You have old-style ALT_ environment variables set.\n"
ihse@20363 277 printf "These are not respected, and will be ignored. It is recommended\n"
ihse@20363 278 printf "that you clean your environment. The following variables are set:\n"
ihse@20363 279 printf "$FOUND_ALT_VARIABLES\n"
ihse@20363 280 printf "\n"
ihse@20363 281 fi
erikj@13132 282
ihse@20363 283 if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
ihse@20363 284 printf "WARNING: Your build output directory is not on a local disk.\n"
ihse@20363 285 printf "This will severely degrade build performance!\n"
ihse@20363 286 printf "It is recommended that you create an output directory on a local disk,\n"
ihse@20363 287 printf "and run the configure script again from that directory.\n"
ihse@20363 288 printf "\n"
ihse@20363 289 fi
erikj@13132 290
mduigou@22717 291 if test "x$IS_RECONFIGURE" = "xyes" && test "x$no_create" != "xyes"; then
ihse@20363 292 printf "WARNING: The result of this configuration has overridden an older\n"
ihse@20363 293 printf "configuration. You *should* run 'make clean' to make sure you get a\n"
ihse@20363 294 printf "proper build. Failure to do so might result in strange build problems.\n"
ihse@20363 295 printf "\n"
ihse@20363 296 fi
mduigou@22717 297
mduigou@22717 298 if test "x$IS_RECONFIGURE" != "xyes" && test "x$no_create" = "xyes"; then
mduigou@22717 299 printf "WARNING: The result of this configuration was not saved.\n"
mduigou@22717 300 printf "You should run without '--no-create | -n' to create the configuration.\n"
mduigou@22717 301 printf "\n"
mduigou@22717 302 fi
erikj@48678 303
erikj@48678 304 if test "x$UNSUPPORTED_TOOLCHAIN_VERSION" = "xyes"; then
erikj@48678 305 printf "WARNING: The toolchain version used is known to have issues. Please\n"
erikj@48678 306 printf "consider using a supported version unless you know what you are doing.\n"
erikj@48678 307 printf "\n"
erikj@48678 308 fi
erikj@13132 309 ])
ihse@27587 310
ihse@27587 311 AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS],
ihse@27587 312 [
ihse@30417 313 # Locate config.log.
ihse@30417 314 if test -e "$CONFIGURESUPPORT_OUTPUTDIR/config.log"; then
ihse@30417 315 CONFIG_LOG_PATH="$CONFIGURESUPPORT_OUTPUTDIR"
ihse@30417 316 elif test -e "./config.log"; then
ihse@30417 317 CONFIG_LOG_PATH="."
ihse@27587 318 fi
ihse@27587 319
ihse@30417 320 if test -e "$CONFIG_LOG_PATH/config.log"; then
ihse@30417 321 $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1
ihse@30417 322 if test $? -eq 0; then
ihse@30417 323 printf "The following warnings were produced. Repeated here for convenience:\n"
ihse@30417 324 # We must quote sed expression (using []) to stop m4 from eating the [].
ihse@30417 325 $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ]
ihse@30417 326 printf "\n"
ihse@30417 327 fi
ihse@30417 328 fi
ihse@27587 329 ])