common/autoconf/help.m4

Wed, 23 Oct 2013 13:05:58 +0200

author
ihse
date
Wed, 23 Oct 2013 13:05:58 +0200
changeset 868
6f19b2440412
parent 862
dffe654ab24c
child 972
f3697e0783e2
permissions
-rw-r--r--

8001922: Improve freetype handling.
Reviewed-by: erikj

ohair@425 1 #
ohair@425 2 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
ohair@425 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@425 4 #
ohair@425 5 # This code is free software; you can redistribute it and/or modify it
ohair@425 6 # under the terms of the GNU General Public License version 2 only, as
ohair@425 7 # published by the Free Software Foundation. Oracle designates this
ohair@425 8 # particular file as subject to the "Classpath" exception as provided
ohair@425 9 # by Oracle in the LICENSE file that accompanied this code.
ohair@425 10 #
ohair@425 11 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@425 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@425 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@425 14 # version 2 for more details (a copy is included in the LICENSE file that
ohair@425 15 # accompanied this code).
ohair@425 16 #
ohair@425 17 # You should have received a copy of the GNU General Public License version
ohair@425 18 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@425 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@425 20 #
ohair@425 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@425 22 # or visit www.oracle.com if you need additional information or have any
ohair@425 23 # questions.
ohair@425 24 #
ohair@425 25
erikj@458 26 AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
erikj@458 27 [
ihse@839 28 AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd)
erikj@458 29 ])
erikj@458 30
erikj@458 31 AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
erikj@458 32 [
ihse@839 33 # Print a helpful message on how to acquire the necessary build dependency.
ihse@868 34 # $1 is the help tag: freetype, cups, pulse, alsa etc
ihse@839 35 MISSING_DEPENDENCY=$1
ohair@425 36
ihse@862 37 if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
ihse@862 38 cygwin_help $MISSING_DEPENDENCY
ihse@862 39 elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
ihse@862 40 msys_help $MISSING_DEPENDENCY
ihse@862 41 else
ihse@862 42 PKGHANDLER_COMMAND=
ohair@425 43
ihse@862 44 case $PKGHANDLER in
ihse@862 45 apt-get)
ihse@862 46 apt_help $MISSING_DEPENDENCY ;;
ihse@862 47 yum)
ihse@862 48 yum_help $MISSING_DEPENDENCY ;;
ihse@862 49 port)
ihse@862 50 port_help $MISSING_DEPENDENCY ;;
ihse@862 51 pkgutil)
ihse@862 52 pkgutil_help $MISSING_DEPENDENCY ;;
ihse@862 53 pkgadd)
ihse@862 54 pkgadd_help $MISSING_DEPENDENCY ;;
ihse@862 55 * )
ihse@862 56 break ;;
ihse@862 57 esac
ihse@862 58
ihse@862 59 if test "x$PKGHANDLER_COMMAND" != x; then
ihse@862 60 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
ihse@862 61 fi
ihse@839 62 fi
erikj@458 63 ])
ohair@425 64
ohair@494 65 cygwin_help() {
ihse@839 66 case $1 in
ohair@494 67 unzip)
ihse@862 68 PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P unzip )"
ihse@862 69 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
ihse@862 70 ;;
ohair@494 71 zip)
ihse@862 72 PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P zip )"
ihse@862 73 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
ihse@862 74 ;;
ohair@494 75 make)
ihse@862 76 PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P make )"
ihse@862 77 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
ihse@862 78 ;;
ihse@868 79 freetype)
ihse@862 80 if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
ihse@862 81 HELP_MSG="To install freetype, run:
ihse@862 82 wget \"http://gnuwin32.sourceforge.net/downlinks/freetype.php\" -O /tmp/freetype-setup.exe
ihse@862 83 chmod +x /tmp/freetype-setup.exe
ihse@862 84 /tmp/freetype-setup.exe
ihse@862 85 Follow GUI prompts, and install to default directory \"C:\Program Files (x86)\GnuWin32\".
ihse@862 86 After installation, locate lib/libfreetype.dll.a and make a copy with the name freetype.dll."
ihse@862 87 else
ihse@862 88 HELP_MSG="You need to build a 64-bit version of freetype.
ihse@862 89 This is not readily available.
ihse@862 90 You can find source code and build instructions on
ihse@862 91 http://www.freetype.org/
ihse@862 92 If you put the resulting build in \"C:\Program Files\GnuWin32\", it will be found automatically."
ihse@862 93 fi
ihse@862 94 ;;
ohair@494 95 * )
ihse@839 96 break ;;
ihse@839 97 esac
ohair@494 98 }
ohair@494 99
ihse@862 100 msys_help() {
ihse@862 101 PKGHANDLER_COMMAND=""
ihse@862 102 }
ihse@862 103
erikj@458 104 apt_help() {
ihse@839 105 case $1 in
ohair@425 106 devkit)
ihse@839 107 PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
ohair@425 108 openjdk)
ihse@839 109 PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;;
ohair@425 110 alsa)
ihse@839 111 PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
ohair@425 112 cups)
ihse@839 113 PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;;
ihse@868 114 freetype)
ihse@839 115 PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
ohair@425 116 pulse)
ihse@839 117 PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;;
ohair@425 118 x11)
ihse@839 119 PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;;
ohair@425 120 ccache)
ihse@839 121 PKGHANDLER_COMMAND="sudo apt-get install ccache" ;;
ohair@425 122 * )
ihse@839 123 break ;;
ihse@839 124 esac
ohair@425 125 }
ohair@425 126
erikj@458 127 yum_help() {
ihse@839 128 case $1 in
ohair@425 129 devkit)
ihse@839 130 PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
ohair@425 131 openjdk)
ihse@839 132 PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;;
ohair@425 133 alsa)
ihse@839 134 PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
ohair@425 135 cups)
ihse@839 136 PKGHANDLER_COMMAND="sudo yum install cups-devel" ;;
ihse@868 137 freetype)
ihse@839 138 PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
ohair@425 139 pulse)
ihse@839 140 PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;;
ohair@425 141 x11)
ihse@839 142 PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel" ;;
ohair@425 143 ccache)
ihse@839 144 PKGHANDLER_COMMAND="sudo yum install ccache" ;;
ohair@425 145 * )
ihse@839 146 break ;;
ihse@839 147 esac
ohair@425 148 }
ohair@425 149
erikj@458 150 port_help() {
ihse@839 151 PKGHANDLER_COMMAND=""
ohair@425 152 }
ohair@425 153
erikj@458 154 pkgutil_help() {
ihse@839 155 PKGHANDLER_COMMAND=""
ohair@425 156 }
ohair@425 157
erikj@458 158 pkgadd_help() {
ihse@839 159 PKGHANDLER_COMMAND=""
ohair@425 160 }
erikj@458 161
erikj@458 162 AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
erikj@458 163 [
ihse@839 164 # Finally output some useful information to the user
erikj@458 165
ihse@839 166 if test "x$CCACHE_FOUND" != x; then
ihse@839 167 if test "x$HAS_GOOD_CCACHE" = x; then
ihse@839 168 CCACHE_STATUS="installed, but disabled (version older than 3.1.4)"
ihse@839 169 CCACHE_HELP_MSG="You have ccache installed, but it is a version prior to 3.1.4. Try upgrading."
ihse@839 170 else
ihse@839 171 CCACHE_STATUS="installed and in use"
ihse@839 172 fi
ihse@839 173 else
ihse@839 174 if test "x$GCC" = xyes; then
ihse@839 175 CCACHE_STATUS="not installed (consider installing)"
ihse@839 176 CCACHE_HELP_MSG="You do not have ccache installed. Try installing it."
ihse@839 177 else
ihse@839 178 CCACHE_STATUS="not available for your system"
ihse@839 179 fi
ihse@839 180 fi
erikj@458 181
ihse@839 182 printf "\n"
ihse@839 183 printf "====================================================\n"
ihse@839 184 printf "A new configuration has been successfully created in\n"
ihse@839 185 printf "$OUTPUT_ROOT\n"
ihse@839 186 if test "x$CONFIGURE_COMMAND_LINE" != x; then
ihse@839 187 printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n"
ihse@839 188 else
ihse@839 189 printf "using default settings.\n"
ihse@839 190 fi
erikj@458 191
ihse@839 192 printf "\n"
ihse@839 193 printf "Configuration summary:\n"
ihse@839 194 printf "* Debug level: $DEBUG_LEVEL\n"
ihse@839 195 printf "* JDK variant: $JDK_VARIANT\n"
ihse@839 196 printf "* JVM variants: $with_jvm_variants\n"
ihse@839 197 printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
ohair@494 198
ihse@839 199 printf "\n"
ihse@839 200 printf "Tools summary:\n"
ihse@839 201 if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
ihse@839 202 printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n"
ihse@839 203 fi
ihse@839 204 printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
ihse@839 205 printf "* C Compiler: $CC_VENDOR version $CC_VERSION (at $CC)\n"
ihse@839 206 printf "* C++ Compiler: $CXX_VENDOR version $CXX_VERSION (at $CXX)\n"
erikj@458 207
ihse@839 208 printf "\n"
ihse@839 209 printf "Build performance summary:\n"
ihse@839 210 printf "* Cores to use: $JOBS\n"
ihse@839 211 printf "* Memory limit: $MEMORY_SIZE MB\n"
ihse@839 212 printf "* ccache status: $CCACHE_STATUS\n"
ihse@839 213 printf "\n"
erikj@458 214
ihse@839 215 if test "x$CCACHE_HELP_MSG" != x && test "x$HIDE_PERFORMANCE_HINTS" = "xno"; then
ihse@839 216 printf "Build performance tip: ccache gives a tremendous speedup for C++ recompilations.\n"
ihse@839 217 printf "$CCACHE_HELP_MSG\n"
ihse@839 218 HELP_MSG_MISSING_DEPENDENCY([ccache])
ihse@839 219 printf "$HELP_MSG\n"
ihse@839 220 printf "\n"
ihse@839 221 fi
erikj@458 222
ihse@839 223 if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then
ihse@839 224 printf "NOTE: You have requested to build more than one version of the JVM, which\n"
ihse@839 225 printf "will result in longer build times.\n"
ihse@839 226 printf "\n"
ihse@839 227 fi
erikj@458 228
ihse@839 229 if test "x$FOUND_ALT_VARIABLES" != "x"; then
ihse@839 230 printf "WARNING: You have old-style ALT_ environment variables set.\n"
ihse@839 231 printf "These are not respected, and will be ignored. It is recommended\n"
ihse@839 232 printf "that you clean your environment. The following variables are set:\n"
ihse@839 233 printf "$FOUND_ALT_VARIABLES\n"
ihse@839 234 printf "\n"
ihse@839 235 fi
erikj@458 236
ihse@839 237 if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
ihse@839 238 printf "WARNING: Your build output directory is not on a local disk.\n"
ihse@839 239 printf "This will severely degrade build performance!\n"
ihse@839 240 printf "It is recommended that you create an output directory on a local disk,\n"
ihse@839 241 printf "and run the configure script again from that directory.\n"
ihse@839 242 printf "\n"
ihse@839 243 fi
erikj@458 244
ihse@839 245 if test "x$IS_RECONFIGURE" = "xyes"; then
ihse@839 246 printf "WARNING: The result of this configuration has overridden an older\n"
ihse@839 247 printf "configuration. You *should* run 'make clean' to make sure you get a\n"
ihse@839 248 printf "proper build. Failure to do so might result in strange build problems.\n"
ihse@839 249 printf "\n"
ihse@839 250 fi
erikj@458 251 ])

mercurial