ohair@425: # kevinw@2206: # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. ohair@425: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ohair@425: # ohair@425: # This code is free software; you can redistribute it and/or modify it ohair@425: # under the terms of the GNU General Public License version 2 only, as ohair@425: # published by the Free Software Foundation. Oracle designates this ohair@425: # particular file as subject to the "Classpath" exception as provided ohair@425: # by Oracle in the LICENSE file that accompanied this code. ohair@425: # ohair@425: # This code is distributed in the hope that it will be useful, but WITHOUT ohair@425: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ohair@425: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ohair@425: # version 2 for more details (a copy is included in the LICENSE file that ohair@425: # accompanied this code). ohair@425: # ohair@425: # You should have received a copy of the GNU General Public License version ohair@425: # 2 along with this work; if not, write to the Free Software Foundation, ohair@425: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ohair@425: # ohair@425: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@425: # or visit www.oracle.com if you need additional information or have any ohair@425: # questions. ohair@425: # ohair@425: erikj@458: AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP], erikj@458: [ ihse@839: AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd) erikj@458: ]) erikj@458: erikj@458: AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY], erikj@458: [ ihse@839: # Print a helpful message on how to acquire the necessary build dependency. ihse@868: # $1 is the help tag: freetype, cups, pulse, alsa etc ihse@839: MISSING_DEPENDENCY=$1 ohair@425: ihse@862: if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then ihse@862: cygwin_help $MISSING_DEPENDENCY ihse@862: elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then ihse@862: msys_help $MISSING_DEPENDENCY ihse@862: else ihse@862: PKGHANDLER_COMMAND= ohair@425: ihse@862: case $PKGHANDLER in ihse@862: apt-get) ihse@862: apt_help $MISSING_DEPENDENCY ;; ihse@862: yum) ihse@862: yum_help $MISSING_DEPENDENCY ;; ihse@862: port) ihse@862: port_help $MISSING_DEPENDENCY ;; ihse@862: pkgutil) ihse@862: pkgutil_help $MISSING_DEPENDENCY ;; ihse@862: pkgadd) ihse@862: pkgadd_help $MISSING_DEPENDENCY ;; ihse@862: esac ihse@862: ihse@862: if test "x$PKGHANDLER_COMMAND" != x; then ihse@862: HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." ihse@862: fi ihse@839: fi erikj@458: ]) ohair@425: ohair@494: cygwin_help() { ihse@839: case $1 in ohair@494: unzip) ihse@862: PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P unzip )" ihse@862: HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." ihse@862: ;; ohair@494: zip) ihse@862: PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P zip )" ihse@862: HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." ihse@862: ;; ohair@494: make) ihse@862: PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P make )" ihse@862: HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." ihse@862: ;; ihse@868: freetype) kevinw@2220: HELP_MSG=" kevinw@2220: The freetype library can now be build during the configure process. kevinw@2220: Download the freetype sources and unpack them into an arbitrary directory: kevinw@2220: kevinw@2220: wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz kevinw@2220: tar -xzf freetype-2.5.3.tar.gz kevinw@2220: kevinw@2220: Then run configure with '--with-freetype-src='. This will kevinw@2220: automatically build the freetype library into '/lib64' for 64-bit kevinw@2220: builds or into '/lib32' for 32-bit builds. kevinw@2220: Afterwards you can always use '--with-freetype-include=/include' kevinw@2220: and '--with-freetype-lib=/lib[32|64]' for other builds." ihse@862: ;; ihse@839: esac ohair@494: } ohair@494: ihse@862: msys_help() { ihse@862: PKGHANDLER_COMMAND="" ihse@862: } ihse@862: erikj@458: apt_help() { ihse@839: case $1 in ohair@425: devkit) ihse@839: PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;; ohair@425: openjdk) ihse@839: PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;; ohair@425: alsa) ihse@839: PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;; ohair@425: cups) ihse@839: PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;; prr@2400: fontconfig) prr@2400: PKGHANDLER_COMMAND="sudo apt-get install libfontconfig1-dev" ;; ihse@868: freetype) ihse@839: PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;; ohair@425: pulse) ihse@839: PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;; ohair@425: x11) ihse@839: PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;; ohair@425: ccache) ihse@839: PKGHANDLER_COMMAND="sudo apt-get install ccache" ;; ihse@839: esac ohair@425: } ohair@425: erikj@458: yum_help() { ihse@839: case $1 in ohair@425: devkit) ihse@839: PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;; ohair@425: openjdk) ihse@839: PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;; ohair@425: alsa) ihse@839: PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;; ohair@425: cups) ihse@839: PKGHANDLER_COMMAND="sudo yum install cups-devel" ;; prr@2400: fontconfig) prr@2400: PKGHANDLER_COMMAND="sudo yum install fontconfig-devel" ;; ihse@868: freetype) ihse@839: PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;; ohair@425: pulse) ihse@839: PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;; ohair@425: x11) ihse@839: PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel" ;; ohair@425: ccache) ihse@839: PKGHANDLER_COMMAND="sudo yum install ccache" ;; ihse@839: esac ohair@425: } ohair@425: erikj@458: port_help() { ihse@839: PKGHANDLER_COMMAND="" ohair@425: } ohair@425: erikj@458: pkgutil_help() { ihse@839: PKGHANDLER_COMMAND="" ohair@425: } ohair@425: erikj@458: pkgadd_help() { ihse@839: PKGHANDLER_COMMAND="" ohair@425: } erikj@458: kevinw@2206: # This function will check if we're called from the "configure" wrapper while kevinw@2206: # printing --help. If so, we will print out additional information that can kevinw@2206: # only be extracted within the autoconf script, and then exit. This must be kevinw@2206: # called at the very beginning in configure.ac. kevinw@2206: AC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT], kevinw@2206: [ kevinw@2206: if test "x$CONFIGURE_PRINT_TOOLCHAIN_LIST" != x; then kevinw@2206: $PRINTF "The following toolchains are available as arguments to --with-toolchain-type.\n" kevinw@2206: $PRINTF "Which are valid to use depends on the build platform.\n" kevinw@2206: for toolchain in $VALID_TOOLCHAINS_all; do kevinw@2206: # Use indirect variable referencing kevinw@2206: toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain kevinw@2206: TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} kevinw@2206: $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION" kevinw@2206: done kevinw@2206: kevinw@2206: # And now exit directly kevinw@2206: exit 0 kevinw@2206: fi kevinw@2206: ]) kevinw@2206: erikj@458: AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS], erikj@458: [ ihse@839: # Finally output some useful information to the user erikj@458: ihse@839: printf "\n" ihse@839: printf "====================================================\n" ihse@839: printf "A new configuration has been successfully created in\n" ihse@839: printf "$OUTPUT_ROOT\n" ihse@839: if test "x$CONFIGURE_COMMAND_LINE" != x; then ihse@839: printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n" ihse@839: else ihse@839: printf "using default settings.\n" ihse@839: fi erikj@458: ihse@839: printf "\n" ihse@839: printf "Configuration summary:\n" ihse@839: printf "* Debug level: $DEBUG_LEVEL\n" ihse@839: printf "* JDK variant: $JDK_VARIANT\n" ihse@839: printf "* JVM variants: $with_jvm_variants\n" ihse@839: printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n" ohair@494: ihse@839: printf "\n" ihse@839: printf "Tools summary:\n" ihse@839: if test "x$OPENJDK_BUILD_OS" = "xwindows"; then ihse@839: printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" ihse@839: fi ihse@839: printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" kevinw@2228: printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n" kevinw@2206: printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n" kevinw@2206: printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n" erikj@458: ihse@839: printf "\n" ihse@839: printf "Build performance summary:\n" ihse@839: printf "* Cores to use: $JOBS\n" ihse@839: printf "* Memory limit: $MEMORY_SIZE MB\n" kevinw@2203: if test "x$CCACHE_STATUS" != "x"; then kevinw@2203: printf "* ccache status: $CCACHE_STATUS\n" kevinw@2203: fi ihse@839: printf "\n" erikj@458: ihse@839: if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then ihse@839: printf "NOTE: You have requested to build more than one version of the JVM, which\n" ihse@839: printf "will result in longer build times.\n" ihse@839: printf "\n" ihse@839: fi erikj@458: ihse@839: if test "x$FOUND_ALT_VARIABLES" != "x"; then ihse@839: printf "WARNING: You have old-style ALT_ environment variables set.\n" ihse@839: printf "These are not respected, and will be ignored. It is recommended\n" ihse@839: printf "that you clean your environment. The following variables are set:\n" ihse@839: printf "$FOUND_ALT_VARIABLES\n" ihse@839: printf "\n" ihse@839: fi erikj@458: ihse@839: if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then ihse@839: printf "WARNING: Your build output directory is not on a local disk.\n" ihse@839: printf "This will severely degrade build performance!\n" ihse@839: printf "It is recommended that you create an output directory on a local disk,\n" ihse@839: printf "and run the configure script again from that directory.\n" ihse@839: printf "\n" ihse@839: fi erikj@458: ihse@839: if test "x$IS_RECONFIGURE" = "xyes"; then ihse@839: printf "WARNING: The result of this configuration has overridden an older\n" ihse@839: printf "configuration. You *should* run 'make clean' to make sure you get a\n" ihse@839: printf "proper build. Failure to do so might result in strange build problems.\n" ihse@839: printf "\n" ihse@839: fi kevinw@2228: kevinw@2228: if test "x$UNSUPPORTED_TOOLCHAIN_VERSION" = "xyes"; then kevinw@2228: printf "WARNING: The toolchain version used is known to have issues. Please\n" kevinw@2228: printf "consider using a supported version unless you know what you are doing.\n" kevinw@2228: printf "\n" kevinw@2228: fi erikj@458: ])