common/autoconf/help.m4

Thu, 27 Dec 2018 11:47:57 +0800

author
aoqi
date
Thu, 27 Dec 2018 11:47:57 +0800
changeset 2316
64a3eeabf6e5
parent 2228
1a5c98aae346
parent 1133
50aaf272884f
child 2408
2e38e8d106de
permissions
-rw-r--r--

Merge

aoqi@0 1 #
kevinw@2206 2 # Copyright (c) 2011, 2018, 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)
kevinw@2220 78 HELP_MSG="
kevinw@2220 79 The freetype library can now be build during the configure process.
kevinw@2220 80 Download the freetype sources and unpack them into an arbitrary directory:
kevinw@2220 81
kevinw@2220 82 wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz
kevinw@2220 83 tar -xzf freetype-2.5.3.tar.gz
kevinw@2220 84
kevinw@2220 85 Then run configure with '--with-freetype-src=<freetype_src>'. This will
kevinw@2220 86 automatically build the freetype library into '<freetype_src>/lib64' for 64-bit
kevinw@2220 87 builds or into '<freetype_src>/lib32' for 32-bit builds.
kevinw@2220 88 Afterwards you can always use '--with-freetype-include=<freetype_src>/include'
kevinw@2220 89 and '--with-freetype-lib=<freetype_src>/lib[32|64]' for other builds."
aoqi@0 90 ;;
aoqi@0 91 esac
aoqi@0 92 }
aoqi@0 93
aoqi@0 94 msys_help() {
aoqi@0 95 PKGHANDLER_COMMAND=""
aoqi@0 96 }
aoqi@0 97
aoqi@0 98 apt_help() {
aoqi@0 99 case $1 in
aoqi@0 100 devkit)
aoqi@0 101 PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
aoqi@0 102 openjdk)
aoqi@0 103 PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;;
aoqi@0 104 alsa)
aoqi@0 105 PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
aoqi@0 106 cups)
aoqi@0 107 PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;;
aoqi@0 108 freetype)
aoqi@0 109 PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
aoqi@0 110 pulse)
aoqi@0 111 PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;;
aoqi@0 112 x11)
aoqi@0 113 PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;;
aoqi@0 114 ccache)
aoqi@0 115 PKGHANDLER_COMMAND="sudo apt-get install ccache" ;;
aoqi@0 116 esac
aoqi@0 117 }
aoqi@0 118
aoqi@0 119 yum_help() {
aoqi@0 120 case $1 in
aoqi@0 121 devkit)
aoqi@0 122 PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
aoqi@0 123 openjdk)
aoqi@0 124 PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;;
aoqi@0 125 alsa)
aoqi@0 126 PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
aoqi@0 127 cups)
aoqi@0 128 PKGHANDLER_COMMAND="sudo yum install cups-devel" ;;
aoqi@0 129 freetype)
aoqi@0 130 PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
aoqi@0 131 pulse)
aoqi@0 132 PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;;
aoqi@0 133 x11)
aoqi@0 134 PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel" ;;
aoqi@0 135 ccache)
aoqi@0 136 PKGHANDLER_COMMAND="sudo yum install ccache" ;;
aoqi@0 137 esac
aoqi@0 138 }
aoqi@0 139
aoqi@0 140 port_help() {
aoqi@0 141 PKGHANDLER_COMMAND=""
aoqi@0 142 }
aoqi@0 143
aoqi@0 144 pkgutil_help() {
aoqi@0 145 PKGHANDLER_COMMAND=""
aoqi@0 146 }
aoqi@0 147
aoqi@0 148 pkgadd_help() {
aoqi@0 149 PKGHANDLER_COMMAND=""
aoqi@0 150 }
aoqi@0 151
kevinw@2206 152 # This function will check if we're called from the "configure" wrapper while
kevinw@2206 153 # printing --help. If so, we will print out additional information that can
kevinw@2206 154 # only be extracted within the autoconf script, and then exit. This must be
kevinw@2206 155 # called at the very beginning in configure.ac.
kevinw@2206 156 AC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT],
kevinw@2206 157 [
kevinw@2206 158 if test "x$CONFIGURE_PRINT_TOOLCHAIN_LIST" != x; then
kevinw@2206 159 $PRINTF "The following toolchains are available as arguments to --with-toolchain-type.\n"
kevinw@2206 160 $PRINTF "Which are valid to use depends on the build platform.\n"
kevinw@2206 161 for toolchain in $VALID_TOOLCHAINS_all; do
kevinw@2206 162 # Use indirect variable referencing
kevinw@2206 163 toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain
kevinw@2206 164 TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
kevinw@2206 165 $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION"
kevinw@2206 166 done
kevinw@2206 167
kevinw@2206 168 # And now exit directly
kevinw@2206 169 exit 0
kevinw@2206 170 fi
kevinw@2206 171 ])
kevinw@2206 172
aoqi@0 173 AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
aoqi@0 174 [
aoqi@0 175 # Finally output some useful information to the user
aoqi@0 176
aoqi@0 177 printf "\n"
aoqi@0 178 printf "====================================================\n"
aoqi@0 179 printf "A new configuration has been successfully created in\n"
aoqi@0 180 printf "$OUTPUT_ROOT\n"
aoqi@0 181 if test "x$CONFIGURE_COMMAND_LINE" != x; then
aoqi@0 182 printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n"
aoqi@0 183 else
aoqi@0 184 printf "using default settings.\n"
aoqi@0 185 fi
aoqi@0 186
aoqi@0 187 printf "\n"
aoqi@0 188 printf "Configuration summary:\n"
aoqi@0 189 printf "* Debug level: $DEBUG_LEVEL\n"
aoqi@0 190 printf "* JDK variant: $JDK_VARIANT\n"
aoqi@0 191 printf "* JVM variants: $with_jvm_variants\n"
aoqi@0 192 printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
aoqi@0 193
aoqi@0 194 printf "\n"
aoqi@0 195 printf "Tools summary:\n"
aoqi@0 196 if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
aoqi@0 197 printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n"
aoqi@0 198 fi
aoqi@0 199 printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
kevinw@2228 200 printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n"
kevinw@2206 201 printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n"
kevinw@2206 202 printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n"
aoqi@0 203
aoqi@0 204 printf "\n"
aoqi@0 205 printf "Build performance summary:\n"
aoqi@0 206 printf "* Cores to use: $JOBS\n"
aoqi@0 207 printf "* Memory limit: $MEMORY_SIZE MB\n"
kevinw@2203 208 if test "x$CCACHE_STATUS" != "x"; then
kevinw@2203 209 printf "* ccache status: $CCACHE_STATUS\n"
kevinw@2203 210 fi
aoqi@0 211 printf "\n"
aoqi@0 212
aoqi@0 213 if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then
aoqi@0 214 printf "NOTE: You have requested to build more than one version of the JVM, which\n"
aoqi@0 215 printf "will result in longer build times.\n"
aoqi@0 216 printf "\n"
aoqi@0 217 fi
aoqi@0 218
aoqi@0 219 if test "x$FOUND_ALT_VARIABLES" != "x"; then
aoqi@0 220 printf "WARNING: You have old-style ALT_ environment variables set.\n"
aoqi@0 221 printf "These are not respected, and will be ignored. It is recommended\n"
aoqi@0 222 printf "that you clean your environment. The following variables are set:\n"
aoqi@0 223 printf "$FOUND_ALT_VARIABLES\n"
aoqi@0 224 printf "\n"
aoqi@0 225 fi
aoqi@0 226
aoqi@0 227 if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
aoqi@0 228 printf "WARNING: Your build output directory is not on a local disk.\n"
aoqi@0 229 printf "This will severely degrade build performance!\n"
aoqi@0 230 printf "It is recommended that you create an output directory on a local disk,\n"
aoqi@0 231 printf "and run the configure script again from that directory.\n"
aoqi@0 232 printf "\n"
aoqi@0 233 fi
aoqi@0 234
aoqi@0 235 if test "x$IS_RECONFIGURE" = "xyes"; then
aoqi@0 236 printf "WARNING: The result of this configuration has overridden an older\n"
aoqi@0 237 printf "configuration. You *should* run 'make clean' to make sure you get a\n"
aoqi@0 238 printf "proper build. Failure to do so might result in strange build problems.\n"
aoqi@0 239 printf "\n"
aoqi@0 240 fi
kevinw@2228 241
kevinw@2228 242 if test "x$UNSUPPORTED_TOOLCHAIN_VERSION" = "xyes"; then
kevinw@2228 243 printf "WARNING: The toolchain version used is known to have issues. Please\n"
kevinw@2228 244 printf "consider using a supported version unless you know what you are doing.\n"
kevinw@2228 245 printf "\n"
kevinw@2228 246 fi
aoqi@0 247 ])

mercurial