help.m4 revision 2400:5068c84c0844
11590Srgrimes# 21590Srgrimes# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. 31590Srgrimes# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 41590Srgrimes# 51590Srgrimes# This code is free software; you can redistribute it and/or modify it 61590Srgrimes# under the terms of the GNU General Public License version 2 only, as 71590Srgrimes# published by the Free Software Foundation. Oracle designates this 81590Srgrimes# particular file as subject to the "Classpath" exception as provided 91590Srgrimes# by Oracle in the LICENSE file that accompanied this code. 101590Srgrimes# 111590Srgrimes# This code is distributed in the hope that it will be useful, but WITHOUT 121590Srgrimes# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 131590Srgrimes# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 141590Srgrimes# version 2 for more details (a copy is included in the LICENSE file that 151590Srgrimes# accompanied this code). 161590Srgrimes# 171590Srgrimes# You should have received a copy of the GNU General Public License version 181590Srgrimes# 2 along with this work; if not, write to the Free Software Foundation, 191590Srgrimes# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 201590Srgrimes# 211590Srgrimes# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 221590Srgrimes# or visit www.oracle.com if you need additional information or have any 231590Srgrimes# questions. 241590Srgrimes# 251590Srgrimes 261590SrgrimesAC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP], 271590Srgrimes[ 281590Srgrimes AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd) 291590Srgrimes]) 301590Srgrimes 311590SrgrimesAC_DEFUN([HELP_MSG_MISSING_DEPENDENCY], 321590Srgrimes[ 331590Srgrimes # Print a helpful message on how to acquire the necessary build dependency. 3427888Scharnier # $1 is the help tag: freetype, cups, alsa etc 351590Srgrimes MISSING_DEPENDENCY=$1 361590Srgrimes 3795624Smarkm if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then 381590Srgrimes cygwin_help $MISSING_DEPENDENCY 391590Srgrimes elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then 4095624Smarkm msys_help $MISSING_DEPENDENCY 411590Srgrimes else 421590Srgrimes PKGHANDLER_COMMAND= 431590Srgrimes 441590Srgrimes case $PKGHANDLER in 451590Srgrimes apt-get) 4695624Smarkm apt_help $MISSING_DEPENDENCY ;; 4795624Smarkm yum) 4895624Smarkm yum_help $MISSING_DEPENDENCY ;; 491590Srgrimes port) 5013236Sgraichen port_help $MISSING_DEPENDENCY ;; 511590Srgrimes pkgutil) 521590Srgrimes pkgutil_help $MISSING_DEPENDENCY ;; 5313236Sgraichen pkgadd) 5413236Sgraichen pkgadd_help $MISSING_DEPENDENCY ;; 5595624Smarkm esac 5695624Smarkm 5795624Smarkm if test "x$PKGHANDLER_COMMAND" != x; then 5895624Smarkm HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 5995624Smarkm fi 601590Srgrimes fi 6195624Smarkm]) 6227888Scharnier 6327888Scharniercygwin_help() { 6427888Scharnier case $1 in 6527888Scharnier unzip) 66163599Sru PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P unzip )" 6795624Smarkm HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 6827888Scharnier ;; 691590Srgrimes zip) 70169345Sdwmalone PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P zip )" 7113236Sgraichen HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 7213236Sgraichen ;; 73166646Smpp make) 7416379Salex PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P make )" 751590Srgrimes HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 76227176Sed ;; 7713236Sgraichen freetype) 781590Srgrimes HELP_MSG=" 791590SrgrimesThe freetype library can now be build during the configure process. 801590SrgrimesDownload the freetype sources and unpack them into an arbitrary directory: 811590Srgrimes 821590Srgrimeswget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz 8313236Sgraichentar -xzf freetype-2.5.3.tar.gz 841590Srgrimes 85207736SmckusickThen run configure with '--with-freetype-src=<freetype_src>'. This will 8692921Simpautomatically build the freetype library into '<freetype_src>/lib64' for 64-bit 8795624Smarkmbuilds or into '<freetype_src>/lib32' for 32-bit builds. 88166388SmppAfterwards you can always use '--with-freetype-include=<freetype_src>/include' 89166388Smppand '--with-freetype-lib=<freetype_src>/lib[32|64]' for other builds. 90166388Smpp 91166388SmppAlternatively you can unpack the sources like this to use the default directory: 92166388Smpp 93166646Smpptar --one-top-level=$HOME/freetype --strip-components=1 -xzf freetype-2.5.3.tar.gz" 9495624Smarkm ;; 9595624Smarkm esac 9695624Smarkm} 9795624Smarkm 9895624Smarkmmsys_help() { 99339008Ssef PKGHANDLER_COMMAND="" 10095624Smarkm} 10116379Salex 10213236Sgraichenapt_help() { 103227176Sed case $1 in 104227176Sed reduced) 105227176Sed PKGHANDLER_COMMAND="sudo apt-get install gcc-multilib g++-multilib" ;; 106227176Sed devkit) 107227176Sed PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;; 108227176Sed openjdk) 1091590Srgrimes PKGHANDLER_COMMAND="sudo apt-get install openjdk-8-jdk" ;; 11016379Salex alsa) 11195624Smarkm PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;; 1121590Srgrimes cups) 11313236Sgraichen PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;; 114207736Smckusick freetype) 115166388Smpp PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;; 1161590Srgrimes ffi) 117166646Smpp PKGHANDLER_COMMAND="sudo apt-get install libffi-dev" ;; 1181590Srgrimes x11) 119166646Smpp PKGHANDLER_COMMAND="sudo apt-get install libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;; 120166646Smpp ccache) 121166646Smpp PKGHANDLER_COMMAND="sudo apt-get install ccache" ;; 1221590Srgrimes dtrace) 1231590Srgrimes PKGHANDLER_COMMAND="sudo apt-get install systemtap-sdt-dev" ;; 1241590Srgrimes elf) 125163599Sru PKGHANDLER_COMMAND="sudo apt-get install libelf-dev" ;; 126163599Sru esac 127163599Sru} 128101545Siedowse 129101545Siedowseyum_help() { 130101545Siedowse case $1 in 131101544Siedowse devkit) 132101544Siedowse PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;; 133101544Siedowse openjdk) 134166646Smpp PKGHANDLER_COMMAND="sudo yum install java-1.8.0-openjdk-devel" ;; 135166646Smpp alsa) 136166646Smpp PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;; 1371590Srgrimes cups) 1381590Srgrimes PKGHANDLER_COMMAND="sudo yum install cups-devel" ;; 1391590Srgrimes freetype) 1401590Srgrimes PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;; 1411590Srgrimes x11) 1421590Srgrimes PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXi-devel" ;; 1431590Srgrimes ccache) 1441590Srgrimes PKGHANDLER_COMMAND="sudo yum install ccache" ;; 1451590Srgrimes elf) 1461590Srgrimes PKGHANDLER_COMMAND="sudo yum install elfutils-libelf-devel" ;; 1471590Srgrimes esac 1481590Srgrimes} 1491590Srgrimes 1501590Srgrimesport_help() { 1511590Srgrimes PKGHANDLER_COMMAND="" 1521590Srgrimes} 153166388Smpp 1541590Srgrimespkgutil_help() { 15513236Sgraichen PKGHANDLER_COMMAND="" 156207736Smckusick} 15727888Scharnier 15827888Scharnierpkgadd_help() { 159166388Smpp PKGHANDLER_COMMAND="" 16013236Sgraichen} 16113236Sgraichen 162166388Smpp# This function will check if we're called from the "configure" wrapper while 1631590Srgrimes# printing --help. If so, we will print out additional information that can 164166388Smpp# only be extracted within the autoconf script, and then exit. This must be 1651590Srgrimes# called at the very beginning in configure.ac. 1661590SrgrimesAC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT], 1671590Srgrimes[ 1681590Srgrimes if test "x$CONFIGURE_PRINT_ADDITIONAL_HELP" != x; then 1691590Srgrimes 1701590Srgrimes # Print available toolchains 171166388Smpp $PRINTF "The following toolchains are available as arguments to --with-toolchain-type.\n" 1721590Srgrimes $PRINTF "Which are valid to use depends on the build platform.\n" 173166388Smpp for toolchain in $VALID_TOOLCHAINS_all; do 1741590Srgrimes # Use indirect variable referencing 175166388Smpp toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain 1761590Srgrimes TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} 1771590Srgrimes $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION" 1781590Srgrimes done 1791590Srgrimes $PRINTF "\n" 180166388Smpp 1811590Srgrimes # Print available jvm features 182166388Smpp $PRINTF "The following JVM features are available as arguments to --with-jvm-features.\n" 1831590Srgrimes $PRINTF "Which are valid to use depends on the target platform.\n " 1841590Srgrimes $PRINTF "%s " $VALID_JVM_FEATURES 185166388Smpp $PRINTF "\n" 1861590Srgrimes 1871590Srgrimes # And now exit directly 18816379Salex exit 0 18995624Smarkm fi 1901590Srgrimes]) 1911590Srgrimes 1921590SrgrimesAC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS], 193166646Smpp[ 194166646Smpp # Finally output some useful information to the user 195166646Smpp 1961590Srgrimes printf "\n" 1971590Srgrimes printf "====================================================\n" 1981590Srgrimes if test "x$no_create" != "xyes"; then 1991590Srgrimes if test "x$IS_RECONFIGURE" != "xyes"; then 2001590Srgrimes printf "A new configuration has been successfully created in\n%s\n" "$OUTPUT_ROOT" 2011590Srgrimes else 202166388Smpp printf "The existing configuration has been successfully updated in\n%s\n" "$OUTPUT_ROOT" 20395624Smarkm fi 2041590Srgrimes else 2051590Srgrimes if test "x$IS_RECONFIGURE" != "xyes"; then 20695624Smarkm printf "A configuration has been successfully checked but not created\n" 2071590Srgrimes else 2081590Srgrimes printf "The existing configuration has been successfully checked in\n%s\n" "$OUTPUT_ROOT" 2091590Srgrimes fi 2101590Srgrimes fi 2111590Srgrimes if test "x$CONFIGURE_COMMAND_LINE" != x; then 212166388Smpp printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n" 2131590Srgrimes else 2141590Srgrimes printf "using default settings.\n" 2151590Srgrimes fi 2161590Srgrimes 2171590Srgrimes printf "\n" 218166388Smpp printf "Configuration summary:\n" 21995624Smarkm printf "* Debug level: $DEBUG_LEVEL\n" 2201590Srgrimes printf "* HS debug level: $HOTSPOT_DEBUG_LEVEL\n" 2211590Srgrimes printf "* JDK variant: $JDK_VARIANT\n" 2221590Srgrimes printf "* JVM variants: $JVM_VARIANTS\n" 2231590Srgrimes printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n" 22427888Scharnier printf "* Version string: $VERSION_STRING ($VERSION_SHORT)\n" 225166388Smpp 2261590Srgrimes printf "\n" 227166388Smpp printf "Tools summary:\n" 2281590Srgrimes if test "x$OPENJDK_BUILD_OS" = "xwindows"; then 2291590Srgrimes printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" 2301590Srgrimes fi 2311590Srgrimes printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" 2321590Srgrimes if test "x$TOOLCHAIN_VERSION" != "x"; then 233166388Smpp print_version=" $TOOLCHAIN_VERSION" 23495624Smarkm fi 2351590Srgrimes printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n" 2361590Srgrimes printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n" 23795624Smarkm printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n" 2381590Srgrimes 2391590Srgrimes printf "\n" 2401590Srgrimes printf "Build performance summary:\n" 2411590Srgrimes printf "* Cores to use: $JOBS\n" 2421590Srgrimes printf "* Memory limit: $MEMORY_SIZE MB\n" 243166388Smpp if test "x$CCACHE_STATUS" != "x"; then 2441590Srgrimes printf "* ccache status: $CCACHE_STATUS\n" 2451590Srgrimes fi 2461590Srgrimes printf "\n" 2471590Srgrimes 2481590Srgrimes if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then 249166388Smpp printf "NOTE: You have requested to build more than one version of the JVM, which\n" 25095624Smarkm printf "will result in longer build times.\n" 2511590Srgrimes printf "\n" 2521590Srgrimes fi 2531590Srgrimes 2541590Srgrimes if test "x$FOUND_ALT_VARIABLES" != "x"; then 25527888Scharnier printf "WARNING: You have old-style ALT_ environment variables set.\n" 256166388Smpp printf "These are not respected, and will be ignored. It is recommended\n" 2571590Srgrimes printf "that you clean your environment. The following variables are set:\n" 258166388Smpp printf "$FOUND_ALT_VARIABLES\n" 2591590Srgrimes printf "\n" 2601590Srgrimes fi 26116379Salex 262207736Smckusick if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then 263163599Sru printf "WARNING: Your build output directory is not on a local disk.\n" 264163599Sru printf "This will severely degrade build performance!\n" 265163599Sru printf "It is recommended that you create an output directory on a local disk,\n" 266223690Spluknet printf "and run the configure script again from that directory.\n" 267223690Spluknet printf "\n" 268223690Spluknet fi 269298682Saraujo 270298682Saraujo if test "x$IS_RECONFIGURE" = "xyes" && test "x$no_create" != "xyes"; then 271163599Sru printf "WARNING: The result of this configuration has overridden an older\n" 272163599Sru printf "configuration. You *should* run 'make clean' to make sure you get a\n" 273163599Sru printf "proper build. Failure to do so might result in strange build problems.\n" 274163599Sru printf "\n" 275166388Smpp fi 27695624Smarkm 2771590Srgrimes if test "x$IS_RECONFIGURE" != "xyes" && test "x$no_create" = "xyes"; then 27895624Smarkm printf "WARNING: The result of this configuration was not saved.\n" 27913236Sgraichen printf "You should run without '--no-create | -n' to create the configuration.\n" 28095624Smarkm printf "\n" 28195624Smarkm fi 282181267Sdelphij]) 283166388Smpp 2841590SrgrimesAC_DEFUN_ONCE([HELP_REPEAT_WARNINGS], 2851590Srgrimes[ 2861590Srgrimes # Locate config.log. 2871590Srgrimes if test -e "$CONFIGURESUPPORT_OUTPUTDIR/config.log"; then 2881590Srgrimes CONFIG_LOG_PATH="$CONFIGURESUPPORT_OUTPUTDIR" 2891590Srgrimes elif test -e "./config.log"; then 290207736Smckusick CONFIG_LOG_PATH="." 2911590Srgrimes fi 292166388Smpp 293166388Smpp if test -e "$CONFIG_LOG_PATH/config.log"; then 2941590Srgrimes $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1 295166388Smpp if test $? -eq 0; then 2961590Srgrimes printf "The following warnings were produced. Repeated here for convenience:\n" 29795624Smarkm # We must quote sed expression (using []) to stop m4 from eating the []. 298166388Smpp $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ] 2991590Srgrimes printf "\n" 3001590Srgrimes fi 3011590Srgrimes fi 3021590Srgrimes]) 30395624Smarkm