help.m4 revision 1228:eefa97d0d263
162642Sn_hibma# 262642Sn_hibma# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. 362642Sn_hibma# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 462642Sn_hibma# 562642Sn_hibma# This code is free software; you can redistribute it and/or modify it 662642Sn_hibma# under the terms of the GNU General Public License version 2 only, as 762642Sn_hibma# published by the Free Software Foundation. Oracle designates this 862642Sn_hibma# particular file as subject to the "Classpath" exception as provided 962642Sn_hibma# by Oracle in the LICENSE file that accompanied this code. 1062642Sn_hibma# 1162642Sn_hibma# This code is distributed in the hope that it will be useful, but WITHOUT 1262642Sn_hibma# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1362642Sn_hibma# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1462642Sn_hibma# version 2 for more details (a copy is included in the LICENSE file that 1562642Sn_hibma# accompanied this code). 1662642Sn_hibma# 1762642Sn_hibma# You should have received a copy of the GNU General Public License version 1862642Sn_hibma# 2 along with this work; if not, write to the Free Software Foundation, 1962642Sn_hibma# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2062642Sn_hibma# 2162642Sn_hibma# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2262642Sn_hibma# or visit www.oracle.com if you need additional information or have any 2362642Sn_hibma# questions. 2462642Sn_hibma# 2562642Sn_hibma 2662642Sn_hibmaAC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP], 2762642Sn_hibma[ 2862642Sn_hibma AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd) 2962642Sn_hibma]) 3062642Sn_hibma 3162642Sn_hibmaAC_DEFUN([HELP_MSG_MISSING_DEPENDENCY], 3262642Sn_hibma[ 3362642Sn_hibma # Print a helpful message on how to acquire the necessary build dependency. 3462642Sn_hibma # $1 is the help tag: freetype, cups, pulse, alsa etc 3562642Sn_hibma MISSING_DEPENDENCY=$1 3662642Sn_hibma 3762642Sn_hibma if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then 3862642Sn_hibma cygwin_help $MISSING_DEPENDENCY 3962642Sn_hibma elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then 4062642Sn_hibma msys_help $MISSING_DEPENDENCY 4162642Sn_hibma else 42113273Smdodd PKGHANDLER_COMMAND= 43188945Sthompsa 4462642Sn_hibma case $PKGHANDLER in 45227196Sed apt-get) 46225839Smav apt_help $MISSING_DEPENDENCY ;; 47225839Smav yum) 48225839Smav yum_help $MISSING_DEPENDENCY ;; 49225839Smav port) 50225839Smav port_help $MISSING_DEPENDENCY ;; 51225839Smav pkgutil) 52225839Smav pkgutil_help $MISSING_DEPENDENCY ;; 53227196Sed pkgadd) 54227196Sed pkgadd_help $MISSING_DEPENDENCY ;; 55227196Sed esac 56227196Sed 57227196Sed if test "x$PKGHANDLER_COMMAND" != x; then 5862642Sn_hibma HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 59225839Smav fi 60225839Smav fi 61225839Smav]) 62225839Smav 63225839Smavcygwin_help() { 64225839Smav case $1 in 6562642Sn_hibma unzip) 66225839Smav PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P unzip )" 67225839Smav HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 6862642Sn_hibma ;; 69225839Smav zip) 70225839Smav PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P zip )" 71225839Smav HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 72225839Smav ;; 73225839Smav make) 74225839Smav PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P make )" 7562642Sn_hibma HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 76225839Smav ;; 77225839Smav freetype) 78225839Smav HELP_MSG=" 79225839SmavThe freetype library can now be build during the configure process. 80225839SmavDownload the freetype sources and unpack them into an arbitrary directory: 81225839Smav 82225839Smavwget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz 83225839Smavtar -xzf freetype-2.5.3.tar.gz 84225839Smav 85225839SmavThen run configure with '--with-freetype-src=<freetype_src>'. This will 86225839Smavautomatically build the freetype library into '<freetype_src>/lib64' for 64-bit 87225839Smavbuilds or into '<freetype_src>/lib32' for 32-bit builds. 88225839SmavAfterwards you can always use '--with-freetype-include=<freetype_src>/include' 89225839Smavand '--with-freetype-lib=<freetype_src>/lib[32|64]' for other builds." 90225839Smav ;; 91225839Smav esac 92225839Smav} 93225839Smav 94225839Smavmsys_help() { 95225839Smav PKGHANDLER_COMMAND="" 96225839Smav} 97225839Smav 98225839Smavapt_help() { 99225839Smav case $1 in 100225839Smav devkit) 101225839Smav PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;; 102225839Smav openjdk) 103225839Smav PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;; 104225839Smav alsa) 105225839Smav PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;; 106225839Smav cups) 107225839Smav PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;; 108225839Smav freetype) 109225839Smav PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;; 110225839Smav pulse) 111225839Smav PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;; 112225839Smav x11) 113225839Smav PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;; 114225839Smav ccache) 115225839Smav PKGHANDLER_COMMAND="sudo apt-get install ccache" ;; 116225839Smav esac 117225839Smav} 118225839Smav 119225839Smavyum_help() { 120225839Smav case $1 in 121225839Smav devkit) 122225839Smav PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;; 123225839Smav openjdk) 124225839Smav PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;; 125225839Smav alsa) 126225839Smav PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;; 127225839Smav cups) 128225839Smav PKGHANDLER_COMMAND="sudo yum install cups-devel" ;; 129225839Smav freetype) 130225839Smav PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;; 131225839Smav pulse) 13262642Sn_hibma PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;; 133225839Smav x11) 134225839Smav PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXi-devel" ;; 135225839Smav ccache) 136225839Smav PKGHANDLER_COMMAND="sudo yum install ccache" ;; 137225839Smav esac 138225839Smav} 139225839Smav 140225839Smavport_help() { 141225839Smav PKGHANDLER_COMMAND="" 142225839Smav} 143225839Smav 144225839Smavpkgutil_help() { 145225839Smav PKGHANDLER_COMMAND="" 146225839Smav} 147225839Smav 148225839Smavpkgadd_help() { 149225839Smav PKGHANDLER_COMMAND="" 150225839Smav} 151225839Smav 152225839Smav# This function will check if we're called from the "configure" wrapper while 153225839Smav# printing --help. If so, we will print out additional information that can 154225839Smav# only be extracted within the autoconf script, and then exit. This must be 155225839Smav# called at the very beginning in configure.ac. 156225839SmavAC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT], 157225839Smav[ 158225839Smav if test "x$CONFIGURE_PRINT_TOOLCHAIN_LIST" != x; then 159225839Smav $PRINTF "The following toolchains are available as arguments to --with-toolchain-type.\n" 160225839Smav $PRINTF "Which are valid to use depends on the build platform.\n" 161225839Smav for toolchain in $VALID_TOOLCHAINS_all; do 162225839Smav # Use indirect variable referencing 163225839Smav toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain 164225839Smav TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} 165225839Smav $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION" 166225839Smav done 167225839Smav 168225839Smav # And now exit directly 169225839Smav exit 0 170225839Smav fi 171225839Smav]) 172225839Smav 173225839SmavAC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS], 174225839Smav[ 175225839Smav # Finally output some useful information to the user 176225839Smav 17762642Sn_hibma printf "\n" 17862642Sn_hibma printf "====================================================\n" 179225839Smav if test "x$no_create" != "xyes"; then 18062642Sn_hibma if test "x$IS_RECONFIGURE" != "xyes"; then 18162642Sn_hibma printf "A new configuration has been successfully created in\n%s\n" "$OUTPUT_ROOT" 18262642Sn_hibma else 183164531Sgrog printf "The existing configuration has been successfully updated in\n%s\n" "$OUTPUT_ROOT" 184164531Sgrog fi 185235519Smav else 186194789Sdelphij if test "x$IS_RECONFIGURE" != "xyes"; then 187164531Sgrog printf "A configuration has been successfully checked but not created\n" 188164531Sgrog else 189235519Smav printf "The existing configuration has been successfully checked in\n%s\n" "$OUTPUT_ROOT" 190194789Sdelphij fi 191225839Smav fi 192225839Smav if test "x$CONFIGURE_COMMAND_LINE" != x; then 193225839Smav printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n" 194225839Smav else 19562642Sn_hibma printf "using default settings.\n" 19662642Sn_hibma fi 19762642Sn_hibma 198225839Smav printf "\n" 19987699Smarkm printf "Configuration summary:\n" 20062642Sn_hibma printf "* Debug level: $DEBUG_LEVEL\n" 20162642Sn_hibma printf "* HS debug level: $HOTSPOT_DEBUG_LEVEL\n" 20262642Sn_hibma printf "* JDK variant: $JDK_VARIANT\n" 203224511Smav printf "* JVM variants: $with_jvm_variants\n" 204224511Smav printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n" 205164531Sgrog 20662642Sn_hibma printf "\n" 207224511Smav printf "Tools summary:\n" 208224511Smav if test "x$OPENJDK_BUILD_OS" = "xwindows"; then 20962642Sn_hibma printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" 21062642Sn_hibma fi 21162642Sn_hibma printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" 21262642Sn_hibma printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n" 21362642Sn_hibma printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n" 21462642Sn_hibma printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n" 21562642Sn_hibma 21662642Sn_hibma printf "\n" 21762642Sn_hibma printf "Build performance summary:\n" 21862642Sn_hibma printf "* Cores to use: $JOBS\n" 219224511Smav printf "* Memory limit: $MEMORY_SIZE MB\n" 220224511Smav if test "x$CCACHE_STATUS" != "x"; then 221224511Smav printf "* ccache status: $CCACHE_STATUS\n" 222224511Smav fi 223224511Smav printf "\n" 224224511Smav 225224511Smav if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then 226224511Smav printf "NOTE: You have requested to build more than one version of the JVM, which\n" 227224511Smav printf "will result in longer build times.\n" 228224511Smav printf "\n" 229224511Smav fi 230224511Smav 231224511Smav if test "x$FOUND_ALT_VARIABLES" != "x"; then 232224511Smav printf "WARNING: You have old-style ALT_ environment variables set.\n" 233224511Smav printf "These are not respected, and will be ignored. It is recommended\n" 234224511Smav printf "that you clean your environment. The following variables are set:\n" 235224511Smav printf "$FOUND_ALT_VARIABLES\n" 236224511Smav printf "\n" 237225839Smav fi 23862642Sn_hibma 23962642Sn_hibma if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then 24062642Sn_hibma printf "WARNING: Your build output directory is not on a local disk.\n" 24162642Sn_hibma printf "This will severely degrade build performance!\n" 24267256Sn_hibma printf "It is recommended that you create an output directory on a local disk,\n" 24362642Sn_hibma printf "and run the configure script again from that directory.\n" 244224511Smav printf "\n" 24562642Sn_hibma fi 24662642Sn_hibma 247224511Smav if test "x$IS_RECONFIGURE" = "xyes" && test "x$no_create" != "xyes"; then 248224511Smav printf "WARNING: The result of this configuration has overridden an older\n" 249164531Sgrog printf "configuration. You *should* run 'make clean' to make sure you get a\n" 25062642Sn_hibma printf "proper build. Failure to do so might result in strange build problems.\n" 25162642Sn_hibma printf "\n" 25262642Sn_hibma fi 25362642Sn_hibma 25462642Sn_hibma if test "x$IS_RECONFIGURE" != "xyes" && test "x$no_create" = "xyes"; then 25562642Sn_hibma printf "WARNING: The result of this configuration was not saved.\n" 25662642Sn_hibma printf "You should run without '--no-create | -n' to create the configuration.\n" 25762642Sn_hibma printf "\n" 25862642Sn_hibma fi 25962642Sn_hibma]) 26062642Sn_hibma 26162642Sn_hibmaAC_DEFUN_ONCE([HELP_REPEAT_WARNINGS], 26262642Sn_hibma[ 26362642Sn_hibmaif test -e "$OUTPUT_ROOT/config.log"; then 26462642Sn_hibma $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" > /dev/null 2>&1 26562642Sn_hibma if test $? -eq 0; then 26662642Sn_hibma printf "The following warnings were produced. Repeated here for convenience:\n" 267224511Smav # We must quote sed expression (using []) to stop m4 from eating the []. 26875606Sn_hibma $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ] 26962642Sn_hibma printf "\n" 270224511Smav fi 27167256Sn_hibmafi 27267256Sn_hibma 273224511Smav]) 27467256Sn_hibma