help.m4 revision 492:e64f2cb57d05
1139969Simp#
21556Srgrimes# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
31556Srgrimes# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
41556Srgrimes#
51556Srgrimes# This code is free software; you can redistribute it and/or modify it
61556Srgrimes# under the terms of the GNU General Public License version 2 only, as
71556Srgrimes# published by the Free Software Foundation.  Oracle designates this
81556Srgrimes# particular file as subject to the "Classpath" exception as provided
91556Srgrimes# by Oracle in the LICENSE file that accompanied this code.
101556Srgrimes#
111556Srgrimes# This code is distributed in the hope that it will be useful, but WITHOUT
121556Srgrimes# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
131556Srgrimes# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
141556Srgrimes# version 2 for more details (a copy is included in the LICENSE file that
151556Srgrimes# accompanied this code).
161556Srgrimes#
171556Srgrimes# You should have received a copy of the GNU General Public License version
181556Srgrimes# 2 along with this work; if not, write to the Free Software Foundation,
191556Srgrimes# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
201556Srgrimes#
211556Srgrimes# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
221556Srgrimes# or visit www.oracle.com if you need additional information or have any
231556Srgrimes# questions.
241556Srgrimes#
251556Srgrimes
261556SrgrimesAC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
271556Srgrimes[
281556Srgrimes    AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd)
29219154Sjilles])
30219154Sjilles
31219154SjillesAC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
32219154Sjilles[
331556Srgrimes    # Print a helpful message on how to acquire the necessary build dependency.
34114433Sobrien    # $1 is the help tag: freetyp2, cups, pulse, alsa etc
351556Srgrimes    MISSING_DEPENDENCY=$1
3620416Ssteve    PKGHANDLER_COMMAND=
371556Srgrimes
381556Srgrimes    case $PKGHANDLER in
391556Srgrimes	apt-get)
401556Srgrimes                apt_help     $MISSING_DEPENDENCY ;;
411556Srgrimes    yum)
4236012Scharnier                yum_help     $MISSING_DEPENDENCY ;;
43114433Sobrien	port)
4436012Scharnier                port_help    $MISSING_DEPENDENCY ;;
4599109Sobrien	pkgutil)
4699109Sobrien                pkgutil_help $MISSING_DEPENDENCY ;;
471556Srgrimes	pkgadd)
481556Srgrimes                pkgadd_help  $MISSING_DEPENDENCY ;;
491556Srgrimes    * )
501556Srgrimes      break ;;
511556Srgrimes    esac
521556Srgrimes
531556Srgrimes    if test "x$PKGHANDLER_COMMAND" != x; then
541556Srgrimes        HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
551556Srgrimes    fi
56216629Sjilles])
57216629Sjilles
58216629Sjillescygwin_help() {
59216629Sjilles    case $1 in
60216629Sjilles    unzip)
61216629Sjilles        PKGHANDLER_COMMAND="cd <location of cygwin setup.exe> && cmd /c setup -q -P unzip" ;;
62127005Sjmallett    zip)
63127005Sjmallett        PKGHANDLER_COMMAND="cd <location of cygwin setup.exe> && cmd /c setup -q -P zip" ;;
64127005Sjmallett    make)
65127005Sjmallett        PKGHANDLER_COMMAND="cd <location of cygwin setup.exe> && cmd /c setup -q -P make" ;;
661556Srgrimes    * )
671556Srgrimes       break ;;
6890110Simp    esac
691556Srgrimes}
701556Srgrimes
711556Srgrimesapt_help() {
721556Srgrimes    case $1 in
731556Srgrimes    devkit)
741556Srgrimes        PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
751556Srgrimes    openjdk)
7620416Ssteve        PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;;
7720416Ssteve    alsa)
7820416Ssteve        PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
7920416Ssteve    cups)
8020416Ssteve        PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;;
8120416Ssteve    freetype2)
8220416Ssteve        PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
8320416Ssteve    pulse)
8420416Ssteve        PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;;
8520416Ssteve    x11)
8620416Ssteve        PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev" ;;
8728554Sjlemon    ccache)
88216629Sjilles        PKGHANDLER_COMMAND="sudo apt-get install ccache" ;;
8920416Ssteve    * )
9020416Ssteve       break ;;
91125156Snjl    esac
9220416Ssteve}
9320416Ssteve
94216629Sjillesyum_help() {
9520416Ssteve    case $1 in
9620416Ssteve    devkit)
97216629Sjilles        PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
981556Srgrimes    openjdk)
991556Srgrimes        PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;;
10020416Ssteve    alsa)
10120416Ssteve        PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
10220416Ssteve    cups)
10320416Ssteve        PKGHANDLER_COMMAND="sudo yum install cups-devel" ;;
10420416Ssteve    freetype2)
10520416Ssteve        PKGHANDLER_COMMAND="sudo yum install freetype2-devel" ;;
10620416Ssteve    pulse)
10720416Ssteve        PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;;
10820416Ssteve    x11)
10920416Ssteve        PKGHANDLER_COMMAND="sudo yum install libXtst-devel" ;;
11020416Ssteve    ccache)
11120416Ssteve        PKGHANDLER_COMMAND="sudo yum install ccache" ;;
11298158Stjr    * )
1131556Srgrimes       break ;;
1141556Srgrimes    esac
11520416Ssteve}
1161556Srgrimes
1171556Srgrimesport_help() {
1181556Srgrimes    PKGHANDLER_COMMAND=""
11928554Sjlemon}
120216629Sjilles
121204308Skibpkgutil_help() {
1221556Srgrimes    PKGHANDLER_COMMAND=""
1231556Srgrimes}
1241556Srgrimes
12520416Sstevepkgadd_help() {
1261556Srgrimes    PKGHANDLER_COMMAND=""
1271556Srgrimes}
12898158Stjr
12998158StjrAC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
13098158Stjr[
13120416Ssteve# Finally output some useful information to the user
1321556Srgrimes
1331556Srgrimesif test "x$CCACHE_FOUND" != x; then
13420416Ssteve	if  test "x$HAS_GOOD_CCACHE" = x; then
135216629Sjilles		CCACHE_STATUS="installed, but disabled (version older than 3.1.4)"
136216629Sjilles		CCACHE_HELP_MSG="You have ccache installed, but it is a version prior to 3.1.4. Try upgrading."
137216629Sjilles	else
138216629Sjilles		CCACHE_STATUS="installed and in use"
139216629Sjilles	fi
140216629Sjilleselse
141216629Sjilles	if test "x$GCC" = xyes; then
142216629Sjilles		CCACHE_STATUS="not installed (consider installing)"
143216629Sjilles		CCACHE_HELP_MSG="You do not have ccache installed. Try installing it."
144216629Sjilles	else
145216629Sjilles		CCACHE_STATUS="not available for your system"
1461556Srgrimes	fi
1471556Srgrimesfi
1481556Srgrimes
1491556Srgrimesprintf "\n"
15020416Ssteveprintf "====================================================\n"
151216629Sjillesprintf "A new configuration has been successfully created in\n"
1521556Srgrimesprintf "$OUTPUT_ROOT\n"
1531556Srgrimesif test "x$CONFIGURE_COMMAND_LINE" != x; then
154127005Sjmallett	printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n"
155127005Sjmallettelse
15620416Ssteve	printf "using default settings.\n"
15720416Sstevefi
15820416Ssteve
159218285Sjillesprintf "\n"
16020416Ssteveprintf "Configuration summary:\n"
161125156Snjlprintf "* Debug level:    $DEBUG_LEVEL\n"
16220416Ssteveprintf "* JDK variant:    $JDK_VARIANT\n"
16320416Ssteveprintf "* JVM variants:   $with_jvm_variants\n"
16420416Ssteveprintf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
16520416Ssteve
16620416Ssteveprintf "\n"
16720416Ssteveprintf "Tools summary:\n"
168127005Sjmallettif test "x$OPENJDK_BUILD_OS" = "xwindows"; then
169127005Sjmallett  printf "* Environment:    $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n"
1701556Srgrimesfi
1711556Srgrimesprintf "* Boot JDK:       $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
1721556Srgrimesprintf "* C Compiler:     $CC_VENDOR version $CC_VERSION (at $CC)\n"
17320416Ssteveprintf "* C++ Compiler:   $CXX_VENDOR version $CXX_VERSION (at $CXX)\n"
174216629Sjilles
175216629Sjillesprintf "\n"
176216629Sjillesprintf "Build performance summary:\n"
177216629Sjillesprintf "* Cores to use:   $NUM_CORES\n"
178216629Sjillesprintf "* Memory limit:   $MEMORY_SIZE MB\n"
1791556Srgrimesprintf "* ccache status:  $CCACHE_STATUS\n"
1801556Srgrimesprintf "\n"
181127005Sjmallett
18290110Simpif test "x$CCACHE_HELP_MSG" != x && test "x$HIDE_PERFORMANCE_HINTS" = "xno"; then
1831556Srgrimes	printf "Build performance tip: ccache gives a tremendous speedup for C++ recompilations.\n"
18420416Ssteve	printf "$CCACHE_HELP_MSG\n"
1851556Srgrimes	HELP_MSG_MISSING_DEPENDENCY([ccache])
186125156Snjl	printf "$HELP_MSG\n"
18720416Ssteve	printf "\n"
188125156Snjlfi
1891556Srgrimes
19020416Ssteveif test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then
19120416Ssteve	printf "NOTE: You have requested to build more than one version of the JVM, which\n"
1921556Srgrimes	printf "will result in longer build times.\n"
1931556Srgrimes	printf "\n"
1941556Srgrimesfi
195127005Sjmallett
19690110Simpif test "x$FOUND_ALT_VARIABLES" != "x"; then
1971556Srgrimes	printf "WARNING: You have old-style ALT_ environment variables set.\n"
1981556Srgrimes	printf "These are not respected, and will be ignored. It is recommended\n"
19926465Scharnier	printf "that you clean your environment. The following variables are set:\n"
20026465Scharnier	printf "$FOUND_ALT_VARIABLES\n"
20126465Scharnier	printf "\n"
20226465Scharnierfi
20326465Scharnier
204216629Sjillesif test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
205216629Sjilles	printf "WARNING: Your build output directory is not on a local disk.\n"
206216629Sjilles	printf "This will severely degrade build performance!\n"
207216629Sjilles	printf "It is recommended that you create an output directory on a local disk,\n"
208216629Sjilles	printf "and run the configure script again from that directory.\n"
2091556Srgrimes	printf "\n"
210fi
211
212if test "x$IS_RECONFIGURE" = "xyes"; then
213	printf "WARNING: The result of this configuration has overridden an older\n"
214	printf "configuration. You *should* run 'make clean' to make sure you get a\n"
215	printf "proper build. Failure to do so might result in strange build problems.\n"
216	printf "\n"
217fi
218])
219