help.m4 revision 456:c8d320b48626
11553Srgrimes#
21553Srgrimes# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
31553Srgrimes# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
41553Srgrimes#
51553Srgrimes# This code is free software; you can redistribute it and/or modify it
61553Srgrimes# under the terms of the GNU General Public License version 2 only, as
71553Srgrimes# published by the Free Software Foundation.  Oracle designates this
81553Srgrimes# particular file as subject to the "Classpath" exception as provided
91553Srgrimes# by Oracle in the LICENSE file that accompanied this code.
101553Srgrimes#
111553Srgrimes# This code is distributed in the hope that it will be useful, but WITHOUT
121553Srgrimes# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
131553Srgrimes# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
141553Srgrimes# version 2 for more details (a copy is included in the LICENSE file that
151553Srgrimes# accompanied this code).
161553Srgrimes#
171553Srgrimes# You should have received a copy of the GNU General Public License version
181553Srgrimes# 2 along with this work; if not, write to the Free Software Foundation,
191553Srgrimes# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
201553Srgrimes#
211553Srgrimes# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
221553Srgrimes# or visit www.oracle.com if you need additional information or have any
231553Srgrimes# questions.
241553Srgrimes#
251553Srgrimes
261553SrgrimesAC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
271553Srgrimes[
281553Srgrimes    AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd)
291553Srgrimes])
30117278Scharnier
311553SrgrimesAC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
321553Srgrimes[
33117278Scharnier    # Print a helpful message on how to acquire the necessary build dependency.
3430642Scharnier    # $1 is the help tag: freetyp2, cups, pulse, alsa etc
35117278Scharnier    MISSING_DEPENDENCY=$1
36117278Scharnier    PKGHANDLER_COMMAND=
37117278Scharnier
381553Srgrimes    case $PKGHANDLER in
391553Srgrimes	apt-get)
401553Srgrimes                apt_help     $MISSING_DEPENDENCY ;;
4190868Smike    yum)
4290868Smike                yum_help     $MISSING_DEPENDENCY ;;
431553Srgrimes	port)
441553Srgrimes                port_help    $MISSING_DEPENDENCY ;;
451553Srgrimes	pkgutil)
461553Srgrimes                pkgutil_help $MISSING_DEPENDENCY ;;
4730642Scharnier	pkgadd)
481553Srgrimes                pkgadd_help  $MISSING_DEPENDENCY ;;
49116078Simp    * )
501553Srgrimes      break ;;
511553Srgrimes    esac
521553Srgrimes
531553Srgrimes    if test "x$PKGHANDLER_COMMAND" != x; then
541553Srgrimes        HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
551553Srgrimes    fi
561553Srgrimes])
571553Srgrimes
581553Srgrimesapt_help() {
591553Srgrimes    case $1 in
601553Srgrimes    devkit)
611553Srgrimes        PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
621553Srgrimes    openjdk)
631553Srgrimes        PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;;
6430872Scharnier    alsa)
651553Srgrimes        PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
661553Srgrimes    cups)
671553Srgrimes        PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;;
681553Srgrimes    freetype2)
691553Srgrimes        PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
701553Srgrimes    pulse)
711553Srgrimes        PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;;
721553Srgrimes    x11)
731553Srgrimes        PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev" ;;
741611Srgrimes    ccache)
751553Srgrimes        PKGHANDLER_COMMAND="sudo apt-get install ccache" ;;
761553Srgrimes    * )
771553Srgrimes       break ;;
781553Srgrimes    esac
791553Srgrimes}
80246209Scharnier
811553Srgrimesyum_help() {
821553Srgrimes    case $1 in
831553Srgrimes    devkit)
841553Srgrimes        PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
851553Srgrimes    openjdk)
861553Srgrimes        PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;;
871553Srgrimes    alsa)
881553Srgrimes        PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
891553Srgrimes    cups)
901553Srgrimes        PKGHANDLER_COMMAND="sudo yum install cups-devel" ;;
911553Srgrimes    freetype2)
921553Srgrimes        PKGHANDLER_COMMAND="sudo yum install freetype2-devel" ;;
931553Srgrimes    pulse)
941553Srgrimes        PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;;
951553Srgrimes    x11)
961553Srgrimes        PKGHANDLER_COMMAND="sudo yum install libXtst-devel" ;;
971553Srgrimes    ccache)
981553Srgrimes        PKGHANDLER_COMMAND="sudo yum install ccache" ;;
9930642Scharnier    * )
1001553Srgrimes       break ;;
1011553Srgrimes    esac
1021553Srgrimes}
1031553Srgrimes
1041553Srgrimesport_help() {
1051553Srgrimes    PKGHANDLER_COMMAND=""
1061553Srgrimes}
1071553Srgrimes
1081553Srgrimespkgutil_help() {
10930642Scharnier    PKGHANDLER_COMMAND=""
1101553Srgrimes}
11130642Scharnier
1121553Srgrimespkgadd_help() {
1131553Srgrimes    PKGHANDLER_COMMAND=""
1141553Srgrimes}
1151553Srgrimes
1161553SrgrimesAC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
1171553Srgrimes[
1181553Srgrimes# Finally output some useful information to the user
1191553Srgrimes
12030642Scharnierif test "x$CCACHE_FOUND" != x; then
1211553Srgrimes	if  test "x$HAS_GOOD_CCACHE" = x; then
1221553Srgrimes		CCACHE_STATUS="installed, but disabled (version older than 3.1.4)"
1231553Srgrimes		CCACHE_HELP_MSG="You have ccache installed, but it is a version prior to 3.1.4. Try upgrading."
1241553Srgrimes	else
1251553Srgrimes		CCACHE_STATUS="installed and in use"
12630642Scharnier	fi
1271553Srgrimeselse
1281553Srgrimes	if test "x$GCC" = xyes; then
1291553Srgrimes		CCACHE_STATUS="not installed (consider installing)"
1301553Srgrimes		CCACHE_HELP_MSG="You do not have ccache installed. Try installing it."
1311553Srgrimes	else
132239991Sed		CCACHE_STATUS="not available for your system"
1331553Srgrimes	fi
1341553Srgrimesfi
1351553Srgrimes
1361553Srgrimesprintf "\n"
1371553Srgrimesprintf "====================================================\n"
13830642Scharnierprintf "A new configuration has been successfully created in\n"
1391553Srgrimesprintf "$OUTPUT_ROOT\n"
1401553Srgrimesif test "x$CONFIGURE_COMMAND_LINE" != x; then
1411553Srgrimes	printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n"
1421553Srgrimeselse
1431553Srgrimes	printf "using default settings.\n"
1441553Srgrimesfi
1451553Srgrimes
1461553Srgrimesprintf "\n"
1471553Srgrimesprintf "Configuration summary:\n"
1481553Srgrimesprintf "* Debug level:    $DEBUG_LEVEL\n"
1491553Srgrimesprintf "* JDK variant:    $JDK_VARIANT\n"
1501553Srgrimesprintf "* JVM variants:   $with_jvm_variants\n"
1511553Srgrimesprintf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
1521553Srgrimesprintf "* Boot JDK:       $BOOT_JDK\n"
1531553Srgrimes
1541553Srgrimesprintf "\n"
1551553Srgrimesprintf "Build performance summary:\n"
1561553Srgrimesprintf "* Cores to use:   $NUM_CORES\n"
1571553Srgrimesprintf "* Memory limit:   $MEMORY_SIZE MB\n"
1581553Srgrimesprintf "* ccache status:  $CCACHE_STATUS\n"
1591553Srgrimesprintf "\n"
1601553Srgrimes
1611553Srgrimesif test "x$CCACHE_HELP_MSG" != x && test "x$HIDE_PERFORMANCE_HINTS" = "xno"; then
1621553Srgrimes	printf "Build performance tip: ccache gives a tremendous speedup for C++ recompilations.\n"
1631553Srgrimes	printf "$CCACHE_HELP_MSG\n"
1641553Srgrimes	HELP_MSG_MISSING_DEPENDENCY([ccache])
165246209Scharnier	printf "$HELP_MSG\n"
1661553Srgrimes	printf "\n"
1671553Srgrimesfi
1681553Srgrimes
1691553Srgrimesif test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then
1701553Srgrimes	printf "NOTE: You have requested to build more than one version of the JVM, which\n"
1711553Srgrimes	printf "will result in longer build times.\n"
1721553Srgrimes	printf "\n"
1731553Srgrimesfi
17430642Scharnier
1751553Srgrimesif test "x$FOUND_ALT_VARIABLES" != "x"; then
1761553Srgrimes	printf "WARNING: You have old-style ALT_ environment variables set.\n"
1771553Srgrimes	printf "These are not respected, and will be ignored. It is recommended\n"
17830831Scharnier	printf "that you clean your environment. The following variables are set:\n"
17930831Scharnier	printf "$FOUND_ALT_VARIABLES\n"
1801553Srgrimes	printf "\n"
1811553Srgrimesfi
1821553Srgrimes
1831553Srgrimesif test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
184117278Scharnier	printf "WARNING: Your build output directory is not on a local disk.\n"
1851553Srgrimes	printf "This will severely degrade build performance!\n"
1861553Srgrimes	printf "It is recommended that you create an output directory on a local disk,\n"
1871553Srgrimes	printf "and run the configure script again from that directory.\n"
1881553Srgrimes	printf "\n"
1891553Srgrimesfi
1901553Srgrimes
1911553Srgrimesif test "x$IS_RECONFIGURE" = "xyes"; then
1921553Srgrimes	printf "WARNING: The result of this configuration has overridden an older\n"
1931553Srgrimes	printf "configuration. You *should* run 'make clean' to make sure you get a\n"
19430642Scharnier	printf "proper build. Failure to do so might result in strange build problems.\n"
1951553Srgrimes	printf "\n"
1961553Srgrimesfi
1971553Srgrimes])
1981553Srgrimes