help.m4 revision 1929:a2a3930ed7c3
118316Swollman# 218316Swollman# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. 318316Swollman# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 418316Swollman# 518316Swollman# This code is free software; you can redistribute it and/or modify it 618316Swollman# under the terms of the GNU General Public License version 2 only, as 718316Swollman# published by the Free Software Foundation. Oracle designates this 818316Swollman# particular file as subject to the "Classpath" exception as provided 918316Swollman# by Oracle in the LICENSE file that accompanied this code. 1018316Swollman# 1118316Swollman# This code is distributed in the hope that it will be useful, but WITHOUT 1218316Swollman# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1318316Swollman# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1446303Smarkm# version 2 for more details (a copy is included in the LICENSE file that 1518316Swollman# accompanied this code). 1618316Swollman# 1718316Swollman# You should have received a copy of the GNU General Public License version 1818316Swollman# 2 along with this work; if not, write to the Free Software Foundation, 1918316Swollman# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2018316Swollman# 2118316Swollman# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2218316Swollman# or visit www.oracle.com if you need additional information or have any 2318316Swollman# questions. 2418316Swollman# 2518316Swollman 2618316SwollmanAC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP], 2718316Swollman[ 2818316Swollman AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd) 2918316Swollman]) 3018316Swollman 3118316SwollmanAC_DEFUN([HELP_MSG_MISSING_DEPENDENCY], 3218316Swollman[ 3318316Swollman # Print a helpful message on how to acquire the necessary build dependency. 3446303Smarkm # $1 is the help tag: freetype, cups, alsa etc 3550476Speter MISSING_DEPENDENCY=$1 3618316Swollman 3718316Swollman if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then 3846303Smarkm cygwin_help $MISSING_DEPENDENCY 3950969Speter elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then 4046303Smarkm msys_help $MISSING_DEPENDENCY 4146303Smarkm else 4218316Swollman PKGHANDLER_COMMAND= 4318316Swollman 4418316Swollman case $PKGHANDLER in 4518316Swollman apt-get) 4618316Swollman apt_help $MISSING_DEPENDENCY ;; 4718316Swollman yum) 4818316Swollman yum_help $MISSING_DEPENDENCY ;; 4918316Swollman port) 5018316Swollman port_help $MISSING_DEPENDENCY ;; 5118316Swollman pkgutil) 5218316Swollman pkgutil_help $MISSING_DEPENDENCY ;; 5318316Swollman pkgadd) 5418316Swollman pkgadd_help $MISSING_DEPENDENCY ;; 5518316Swollman esac 5618316Swollman 5718316Swollman if test "x$PKGHANDLER_COMMAND" != x; then 5837908Scharnier HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 5918316Swollman fi 6018316Swollman fi 6118316Swollman]) 6218316Swollman 6318316Swollmancygwin_help() { 6418316Swollman case $1 in 6518316Swollman unzip) 6618316Swollman PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P unzip )" 6718316Swollman HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 6818316Swollman ;; 6918316Swollman zip) 7018316Swollman PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P zip )" 7118316Swollman HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 7218316Swollman ;; 7318316Swollman make) 7418316Swollman PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P make )" 7518316Swollman HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 7618316Swollman ;; 7718316Swollman freetype) 7818316Swollman HELP_MSG=" 7918316SwollmanThe freetype library can now be build during the configure process. 8046303SmarkmDownload the freetype sources and unpack them into an arbitrary directory: 8146303Smarkm 8218316Swollmanwget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz 8318316Swollmantar -xzf freetype-2.5.3.tar.gz 8418316Swollman 8518316SwollmanThen run configure with '--with-freetype-src=<freetype_src>'. This will 8618316Swollmanautomatically build the freetype library into '<freetype_src>/lib64' for 64-bit 8718316Swollmanbuilds or into '<freetype_src>/lib32' for 32-bit builds. 8846303SmarkmAfterwards you can always use '--with-freetype-include=<freetype_src>/include' 8918316Swollmanand '--with-freetype-lib=<freetype_src>/lib[32|64]' for other builds. 9018316Swollman 9118316SwollmanAlternatively you can unpack the sources like this to use the default directory: 9246303Smarkm 9346303Smarkmtar --one-top-level=$HOME/freetype --strip-components=1 -xzf freetype-2.5.3.tar.gz" 9418316Swollman ;; 9518316Swollman esac 9618316Swollman} 9718316Swollman 9818316Swollmanmsys_help() { 9918316Swollman PKGHANDLER_COMMAND="" 10018316Swollman} 10118316Swollman 10218316Swollmanapt_help() { 10318316Swollman case $1 in 10418316Swollman reduced) 10518316Swollman PKGHANDLER_COMMAND="sudo apt-get install gcc-multilib g++-multilib" ;; 10618316Swollman devkit) 10718316Swollman PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;; 10818316Swollman openjdk) 10918316Swollman PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;; 11018316Swollman alsa) 11118316Swollman PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;; 11246303Smarkm cups) 11346303Smarkm PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;; 11446303Smarkm freetype) 11546303Smarkm PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;; 11618316Swollman ffi) 11718316Swollman PKGHANDLER_COMMAND="sudo apt-get install libffi-dev" ;; 11818316Swollman x11) 11918316Swollman PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;; 12018316Swollman ccache) 12118316Swollman PKGHANDLER_COMMAND="sudo apt-get install ccache" ;; 12218316Swollman esac 12318316Swollman} 12418316Swollman 12546303Smarkmyum_help() { 12646303Smarkm case $1 in 12746303Smarkm devkit) 12818316Swollman PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;; 12920342Swollman openjdk) 13020342Swollman PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;; 13118316Swollman alsa) 13218316Swollman PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;; 13318316Swollman cups) 13418316Swollman PKGHANDLER_COMMAND="sudo yum install cups-devel" ;; 13518316Swollman freetype) 13618316Swollman PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;; 13718316Swollman x11) 13818316Swollman PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXi-devel" ;; 13918316Swollman ccache) 14018316Swollman PKGHANDLER_COMMAND="sudo yum install ccache" ;; 14118316Swollman esac 14219885Swollman} 14319885Swollman 14419885Swollmanport_help() { 14519885Swollman PKGHANDLER_COMMAND="" 14619885Swollman} 14719885Swollman 14818316Swollmanpkgutil_help() { 14919885Swollman PKGHANDLER_COMMAND="" 15018316Swollman} 15118316Swollman 15218316Swollmanpkgadd_help() { 15318316Swollman PKGHANDLER_COMMAND="" 15418316Swollman} 15518316Swollman 15618316Swollman# This function will check if we're called from the "configure" wrapper while 15718316Swollman# printing --help. If so, we will print out additional information that can 15818316Swollman# only be extracted within the autoconf script, and then exit. This must be 15918316Swollman# called at the very beginning in configure.ac. 16018316SwollmanAC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT], 16118316Swollman[ 16218316Swollman if test "x$CONFIGURE_PRINT_ADDITIONAL_HELP" != x; then 16318316Swollman 16418316Swollman # Print available toolchains 16518316Swollman $PRINTF "The following toolchains are available as arguments to --with-toolchain-type.\n" 16618316Swollman $PRINTF "Which are valid to use depends on the build platform.\n" 16718316Swollman for toolchain in $VALID_TOOLCHAINS_all; do 16818316Swollman # Use indirect variable referencing 16919885Swollman toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain 17019885Swollman TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} 17119885Swollman $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION" 17219885Swollman done 17318316Swollman 17418316Swollman # And now exit directly 17519885Swollman exit 0 17618316Swollman fi 17718316Swollman]) 17818316Swollman 17946303SmarkmAC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS], 18046303Smarkm[ 18146303Smarkm # Finally output some useful information to the user 18218316Swollman 18319885Swollman printf "\n" 18419885Swollman printf "====================================================\n" 18518316Swollman if test "x$no_create" != "xyes"; then 18618316Swollman if test "x$IS_RECONFIGURE" != "xyes"; then 18718316Swollman printf "A new configuration has been successfully created in\n%s\n" "$OUTPUT_ROOT" 18818316Swollman else 18918316Swollman printf "The existing configuration has been successfully updated in\n%s\n" "$OUTPUT_ROOT" 19018316Swollman fi 19118316Swollman else 19218316Swollman if test "x$IS_RECONFIGURE" != "xyes"; then 19318316Swollman printf "A configuration has been successfully checked but not created\n" 19418316Swollman else 19518316Swollman printf "The existing configuration has been successfully checked in\n%s\n" "$OUTPUT_ROOT" 19618316Swollman fi 19718316Swollman fi 19818316Swollman if test "x$CONFIGURE_COMMAND_LINE" != x; then 19918316Swollman printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n" 20018316Swollman else 20118316Swollman printf "using default settings.\n" 20218316Swollman fi 20318316Swollman 20418316Swollman printf "\n" 20518316Swollman printf "Configuration summary:\n" 20618316Swollman printf "* Debug level: $DEBUG_LEVEL\n" 20718316Swollman printf "* HS debug level: $HOTSPOT_DEBUG_LEVEL\n" 20818316Swollman printf "* JDK variant: $JDK_VARIANT\n" 20918316Swollman printf "* JVM variants: $with_jvm_variants\n" 21018316Swollman printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n" 21118316Swollman printf "* Version string: $VERSION_STRING ($VERSION_SHORT)\n" 21246303Smarkm 21318316Swollman printf "\n" 21418316Swollman printf "Tools summary:\n" 21518316Swollman if test "x$OPENJDK_BUILD_OS" = "xwindows"; then 21618316Swollman printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" 21718316Swollman fi 21818316Swollman printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" 21946303Smarkm if test "x$TOOLCHAIN_VERSION" != "x"; then 22046303Smarkm print_version=" $TOOLCHAIN_VERSION" 22146303Smarkm fi 22246303Smarkm printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n" 22346303Smarkm printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n" 22446303Smarkm printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n" 22546303Smarkm 22646303Smarkm printf "\n" 22718316Swollman printf "Build performance summary:\n" 22818316Swollman printf "* Cores to use: $JOBS\n" 22918316Swollman printf "* Memory limit: $MEMORY_SIZE MB\n" 23018316Swollman if test "x$CCACHE_STATUS" != "x"; then 23118316Swollman printf "* ccache status: $CCACHE_STATUS\n" 23218316Swollman fi 23318316Swollman printf "\n" 23418316Swollman 23518316Swollman if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then 23618316Swollman printf "NOTE: You have requested to build more than one version of the JVM, which\n" 23718316Swollman printf "will result in longer build times.\n" 23818316Swollman printf "\n" 23918316Swollman fi 24018316Swollman 24118316Swollman if test "x$FOUND_ALT_VARIABLES" != "x"; then 24218316Swollman printf "WARNING: You have old-style ALT_ environment variables set.\n" 24318316Swollman printf "These are not respected, and will be ignored. It is recommended\n" 24418316Swollman printf "that you clean your environment. The following variables are set:\n" 24518316Swollman printf "$FOUND_ALT_VARIABLES\n" 24618316Swollman printf "\n" 24718316Swollman fi 24818316Swollman 24918316Swollman if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then 25018316Swollman printf "WARNING: Your build output directory is not on a local disk.\n" 25118316Swollman printf "This will severely degrade build performance!\n" 25218316Swollman printf "It is recommended that you create an output directory on a local disk,\n" 25318316Swollman printf "and run the configure script again from that directory.\n" 25446303Smarkm printf "\n" 25518316Swollman fi 25618316Swollman 25718316Swollman if test "x$IS_RECONFIGURE" = "xyes" && test "x$no_create" != "xyes"; then 25818316Swollman printf "WARNING: The result of this configuration has overridden an older\n" 25918316Swollman printf "configuration. You *should* run 'make clean' to make sure you get a\n" 26018316Swollman printf "proper build. Failure to do so might result in strange build problems.\n" 26118316Swollman printf "\n" 26218316Swollman fi 26318316Swollman 26418316Swollman if test "x$IS_RECONFIGURE" != "xyes" && test "x$no_create" = "xyes"; then 26518316Swollman printf "WARNING: The result of this configuration was not saved.\n" 26618316Swollman printf "You should run without '--no-create | -n' to create the configuration.\n" 26718316Swollman printf "\n" 26818316Swollman fi 26918316Swollman]) 27019885Swollman 27119885SwollmanAC_DEFUN_ONCE([HELP_REPEAT_WARNINGS], 27219885Swollman[ 27319885Swollman # Locate config.log. 27419885Swollman if test -e "$CONFIGURESUPPORT_OUTPUTDIR/config.log"; then 27546303Smarkm CONFIG_LOG_PATH="$CONFIGURESUPPORT_OUTPUTDIR" 27618316Swollman elif test -e "./config.log"; then 27718316Swollman CONFIG_LOG_PATH="." 27818316Swollman fi 27918316Swollman 28018316Swollman if test -e "$CONFIG_LOG_PATH/config.log"; then 28118316Swollman $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1 28218316Swollman if test $? -eq 0; then 28318316Swollman printf "The following warnings were produced. Repeated here for convenience:\n" 28418316Swollman # We must quote sed expression (using []) to stop m4 from eating the []. 28518316Swollman $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ] 28618316Swollman printf "\n" 28718316Swollman fi 28818316Swollman fi 28918316Swollman]) 29019885Swollman