1.1 --- a/common/autoconf/generated-configure.sh Tue Apr 17 09:33:36 2018 -0700 1.2 +++ b/common/autoconf/generated-configure.sh Wed Apr 18 02:21:14 2018 -0700 1.3 @@ -742,6 +742,7 @@ 1.4 GNM 1.5 NM 1.6 STRIP 1.7 +MSBUILD 1.8 DUMPBIN 1.9 RC 1.10 MT 1.11 @@ -1077,6 +1078,7 @@ 1.12 with_freetype 1.13 with_freetype_include 1.14 with_freetype_lib 1.15 +with_freetype_src 1.16 enable_freetype_bundling 1.17 with_alsa 1.18 with_alsa_include 1.19 @@ -1919,6 +1921,9 @@ 1.20 headers under PATH/include) 1.21 --with-freetype-include specify directory for the freetype include files 1.22 --with-freetype-lib specify directory for the freetype library 1.23 + --with-freetype-src specify directory with freetype sources to 1.24 + automatically build the library (experimental, 1.25 + Windows-only) 1.26 --with-alsa specify prefix directory for the alsa package 1.27 (expecting the libraries under PATH/lib and the 1.28 headers under PATH/include) 1.29 @@ -3767,20 +3772,18 @@ 1.30 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 1.31 ;; 1.32 freetype) 1.33 - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then 1.34 - HELP_MSG="To install freetype, run: 1.35 -wget \"http://gnuwin32.sourceforge.net/downlinks/freetype.php\" -O /tmp/freetype-setup.exe 1.36 -chmod +x /tmp/freetype-setup.exe 1.37 -/tmp/freetype-setup.exe 1.38 -Follow GUI prompts, and install to default directory \"C:\Program Files (x86)\GnuWin32\". 1.39 -After installation, locate lib/libfreetype.dll.a and make a copy with the name freetype.dll." 1.40 - else 1.41 - HELP_MSG="You need to build a 64-bit version of freetype. 1.42 -This is not readily available. 1.43 -You can find source code and build instructions on 1.44 -http://www.freetype.org/ 1.45 -If you put the resulting build in \"C:\Program Files\GnuWin32\", it will be found automatically." 1.46 - fi 1.47 + HELP_MSG=" 1.48 +The freetype library can now be build during the configure process. 1.49 +Download the freetype sources and unpack them into an arbitrary directory: 1.50 + 1.51 +wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz 1.52 +tar -xzf freetype-2.5.3.tar.gz 1.53 + 1.54 +Then run configure with '--with-freetype-src=<freetype_src>'. This will 1.55 +automatically build the freetype library into '<freetype_src>/lib64' for 64-bit 1.56 +builds or into '<freetype_src>/lib32' for 32-bit builds. 1.57 +Afterwards you can always use '--with-freetype-include=<freetype_src>/include' 1.58 +and '--with-freetype-lib=<freetype_src>/lib32|64' for other builds." 1.59 ;; 1.60 esac 1.61 } 1.62 @@ -3958,6 +3961,8 @@ 1.63 1.64 1.65 1.66 + 1.67 + 1.68 # 1.69 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. 1.70 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.71 @@ -4237,7 +4242,7 @@ 1.72 #CUSTOM_AUTOCONF_INCLUDE 1.73 1.74 # Do not change or remove the following line, it is needed for consistency checks: 1.75 -DATE_WHEN_GENERATED=1523982801 1.76 +DATE_WHEN_GENERATED=1524043158 1.77 1.78 ############################################################################### 1.79 # 1.80 @@ -25240,6 +25245,10 @@ 1.81 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 1.82 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} 1.83 VS_ENV_CMD="$VS100BASE/$VCVARSFILE" 1.84 + # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see 1.85 + # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 1.86 + # TODO: improve detection for other versions of VS 1.87 + PLATFORM_TOOLSET="v100" 1.88 else 1.89 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 1.90 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} 1.91 @@ -25281,6 +25290,10 @@ 1.92 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 1.93 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} 1.94 VS_ENV_CMD="$VS100BASE/$VCVARSFILE" 1.95 + # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see 1.96 + # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 1.97 + # TODO: improve detection for other versions of VS 1.98 + PLATFORM_TOOLSET="v100" 1.99 else 1.100 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 1.101 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} 1.102 @@ -25311,6 +25324,10 @@ 1.103 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 1.104 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} 1.105 VS_ENV_CMD="$VS100BASE/$VCVARSFILE" 1.106 + # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see 1.107 + # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 1.108 + # TODO: improve detection for other versions of VS 1.109 + PLATFORM_TOOLSET="v100" 1.110 else 1.111 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 1.112 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} 1.113 @@ -25340,6 +25357,10 @@ 1.114 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 1.115 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} 1.116 VS_ENV_CMD="$VS100BASE/$VCVARSFILE" 1.117 + # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see 1.118 + # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 1.119 + # TODO: improve detection for other versions of VS 1.120 + PLATFORM_TOOLSET="v100" 1.121 else 1.122 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 1.123 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} 1.124 @@ -25368,6 +25389,10 @@ 1.125 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 1.126 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} 1.127 VS_ENV_CMD="$VS100BASE/$VCVARSFILE" 1.128 + # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see 1.129 + # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 1.130 + # TODO: improve detection for other versions of VS 1.131 + PLATFORM_TOOLSET="v100" 1.132 else 1.133 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 1.134 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} 1.135 @@ -25410,6 +25435,10 @@ 1.136 else 1.137 VS_ENV_ARGS="/x64" 1.138 fi 1.139 + # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see 1.140 + # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK 1.141 + # TODO: improve detection for other versions of SDK 1.142 + PLATFORM_TOOLSET="Windows7.1SDK" 1.143 else 1.144 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 1.145 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} 1.146 @@ -25452,6 +25481,10 @@ 1.147 else 1.148 VS_ENV_ARGS="/x64" 1.149 fi 1.150 + # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see 1.151 + # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK 1.152 + # TODO: improve detection for other versions of SDK 1.153 + PLATFORM_TOOLSET="Windows7.1SDK" 1.154 else 1.155 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 1.156 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} 1.157 @@ -25494,6 +25527,10 @@ 1.158 else 1.159 VS_ENV_ARGS="/x64" 1.160 fi 1.161 + # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see 1.162 + # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK 1.163 + # TODO: improve detection for other versions of SDK 1.164 + PLATFORM_TOOLSET="Windows7.1SDK" 1.165 else 1.166 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 1.167 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} 1.168 @@ -25535,6 +25572,10 @@ 1.169 else 1.170 VS_ENV_ARGS="/x64" 1.171 fi 1.172 + # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see 1.173 + # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK 1.174 + # TODO: improve detection for other versions of SDK 1.175 + PLATFORM_TOOLSET="Windows7.1SDK" 1.176 else 1.177 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 1.178 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} 1.179 @@ -25575,6 +25616,10 @@ 1.180 else 1.181 VS_ENV_ARGS="/x64" 1.182 fi 1.183 + # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see 1.184 + # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK 1.185 + # TODO: improve detection for other versions of SDK 1.186 + PLATFORM_TOOLSET="Windows7.1SDK" 1.187 else 1.188 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 1.189 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} 1.190 @@ -33628,6 +33673,50 @@ 1.191 $as_echo "$as_me: Rewriting DUMPBIN to \"$new_complete\"" >&6;} 1.192 fi 1.193 1.194 + # We need to check for 'msbuild.exe' because at the place where we expect to 1.195 + # find 'msbuild.exe' there's also a directory called 'msbuild' and configure 1.196 + # won't find the 'msbuild.exe' executable in that case (and the 1.197 + # 'ac_executable_extensions' is unusable due to performance reasons). 1.198 + # Notice that we intentionally don't fix up the path to MSBUILD because we 1.199 + # will call it in a DOS shell during freetype detection on Windows (see 1.200 + # 'LIB_SETUP_FREETYPE' in "libraries.m4" 1.201 + # Extract the first word of "msbuild.exe", so it can be a program name with args. 1.202 +set dummy msbuild.exe; ac_word=$2 1.203 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 1.204 +$as_echo_n "checking for $ac_word... " >&6; } 1.205 +if ${ac_cv_prog_MSBUILD+:} false; then : 1.206 + $as_echo_n "(cached) " >&6 1.207 +else 1.208 + if test -n "$MSBUILD"; then 1.209 + ac_cv_prog_MSBUILD="$MSBUILD" # Let the user override the test. 1.210 +else 1.211 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 1.212 +for as_dir in $PATH 1.213 +do 1.214 + IFS=$as_save_IFS 1.215 + test -z "$as_dir" && as_dir=. 1.216 + for ac_exec_ext in '' $ac_executable_extensions; do 1.217 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 1.218 + ac_cv_prog_MSBUILD="msbuild.exe" 1.219 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 1.220 + break 2 1.221 + fi 1.222 +done 1.223 + done 1.224 +IFS=$as_save_IFS 1.225 + 1.226 +fi 1.227 +fi 1.228 +MSBUILD=$ac_cv_prog_MSBUILD 1.229 +if test -n "$MSBUILD"; then 1.230 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSBUILD" >&5 1.231 +$as_echo "$MSBUILD" >&6; } 1.232 +else 1.233 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 1.234 +$as_echo "no" >&6; } 1.235 +fi 1.236 + 1.237 + 1.238 fi 1.239 1.240 if test "x$OPENJDK_TARGET_OS" = xsolaris; then 1.241 @@ -42808,6 +42897,12 @@ 1.242 withval=$with_freetype_lib; 1.243 fi 1.244 1.245 + 1.246 +# Check whether --with-freetype-src was given. 1.247 +if test "${with_freetype_src+set}" = set; then : 1.248 + withval=$with_freetype_src; 1.249 +fi 1.250 + 1.251 # Check whether --enable-freetype-bundling was given. 1.252 if test "${enable_freetype_bundling+set}" = set; then : 1.253 enableval=$enable_freetype_bundling; 1.254 @@ -42819,7 +42914,7 @@ 1.255 FREETYPE_BUNDLE_LIB_PATH= 1.256 1.257 if test "x$FREETYPE_NOT_NEEDED" = xyes; then 1.258 - if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then 1.259 + if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x || test "x$with_freetype_src" != x; then 1.260 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: freetype not used, so --with-freetype is ignored" >&5 1.261 $as_echo "$as_me: WARNING: freetype not used, so --with-freetype is ignored" >&2;} 1.262 fi 1.263 @@ -42832,6 +42927,428 @@ 1.264 1.265 BUNDLE_FREETYPE="$enable_freetype_bundling" 1.266 1.267 + if test "x$with_freetype_src" != x; then 1.268 + if test "x$OPENJDK_TARGET_OS" = xwindows; then 1.269 + # Try to build freetype if --with-freetype-src was given on Windows 1.270 + 1.271 + FREETYPE_SRC_PATH="$with_freetype_src" 1.272 + BUILD_FREETYPE=yes 1.273 + 1.274 + # Check if the freetype sources are acessible.. 1.275 + if ! test -d $FREETYPE_SRC_PATH; then 1.276 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-freetype-src specified, but can't find path \"$FREETYPE_SRC_PATH\" - ignoring --with-freetype-src" >&5 1.277 +$as_echo "$as_me: WARNING: --with-freetype-src specified, but can't find path \"$FREETYPE_SRC_PATH\" - ignoring --with-freetype-src" >&2;} 1.278 + BUILD_FREETYPE=no 1.279 + fi 1.280 + # ..and contain a vc2010 project file 1.281 + vcxproj_path="$FREETYPE_SRC_PATH/builds/windows/vc2010/freetype.vcxproj" 1.282 + if test "x$BUILD_FREETYPE" = xyes && ! test -s $vcxproj_path; then 1.283 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't find project file $vcxproj_path (you may try a newer freetype version) - ignoring --with-freetype-src" >&5 1.284 +$as_echo "$as_me: WARNING: Can't find project file $vcxproj_path (you may try a newer freetype version) - ignoring --with-freetype-src" >&2;} 1.285 + BUILD_FREETYPE=no 1.286 + fi 1.287 + # Now check if configure found a version of 'msbuild.exe' 1.288 + if test "x$BUILD_FREETYPE" = xyes && test "x$MSBUILD" == x ; then 1.289 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't find an msbuild.exe executable (you may try to install .NET 4.0) - ignoring --with-freetype-src" >&5 1.290 +$as_echo "$as_me: WARNING: Can't find an msbuild.exe executable (you may try to install .NET 4.0) - ignoring --with-freetype-src" >&2;} 1.291 + BUILD_FREETYPE=no 1.292 + fi 1.293 + 1.294 + # Ready to go.. 1.295 + if test "x$BUILD_FREETYPE" = xyes; then 1.296 + 1.297 + # msbuild requires trailing slashes for output directories 1.298 + freetype_lib_path="$FREETYPE_SRC_PATH/lib$OPENJDK_TARGET_CPU_BITS/" 1.299 + freetype_lib_path_unix="$freetype_lib_path" 1.300 + freetype_obj_path="$FREETYPE_SRC_PATH/obj$OPENJDK_TARGET_CPU_BITS/" 1.301 + 1.302 + unix_path="$vcxproj_path" 1.303 + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then 1.304 + windows_path=`$CYGPATH -m "$unix_path"` 1.305 + vcxproj_path="$windows_path" 1.306 + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then 1.307 + windows_path=`cmd //c echo $unix_path` 1.308 + vcxproj_path="$windows_path" 1.309 + fi 1.310 + 1.311 + 1.312 + unix_path="$freetype_lib_path" 1.313 + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then 1.314 + windows_path=`$CYGPATH -m "$unix_path"` 1.315 + freetype_lib_path="$windows_path" 1.316 + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then 1.317 + windows_path=`cmd //c echo $unix_path` 1.318 + freetype_lib_path="$windows_path" 1.319 + fi 1.320 + 1.321 + 1.322 + unix_path="$freetype_obj_path" 1.323 + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then 1.324 + windows_path=`$CYGPATH -m "$unix_path"` 1.325 + freetype_obj_path="$windows_path" 1.326 + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then 1.327 + windows_path=`cmd //c echo $unix_path` 1.328 + freetype_obj_path="$windows_path" 1.329 + fi 1.330 + 1.331 + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then 1.332 + freetype_platform=x64 1.333 + else 1.334 + freetype_platform=win32 1.335 + fi 1.336 + 1.337 + # The original freetype project file is for VS 2010 (i.e. 'v100'), 1.338 + # so we have to adapt the toolset if building with any other toolsed (i.e. SDK). 1.339 + # Currently 'PLATFORM_TOOLSET' is set in 'TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT'/ 1.340 + # 'TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT' in toolchain_windows.m4 1.341 + { $as_echo "$as_me:${as_lineno-$LINENO}: Trying to compile freetype sources with PlatformToolset=$PLATFORM_TOOLSET to $freetype_lib_path_unix ..." >&5 1.342 +$as_echo "$as_me: Trying to compile freetype sources with PlatformToolset=$PLATFORM_TOOLSET to $freetype_lib_path_unix ..." >&6;} 1.343 + 1.344 + # First we try to build the freetype.dll 1.345 + $ECHO -e "@echo off\n"\ 1.346 + "$MSBUILD $vcxproj_path "\ 1.347 + "/p:PlatformToolset=$PLATFORM_TOOLSET "\ 1.348 + "/p:Configuration=\"Release Multithreaded\" "\ 1.349 + "/p:Platform=$freetype_platform "\ 1.350 + "/p:ConfigurationType=DynamicLibrary "\ 1.351 + "/p:TargetName=freetype "\ 1.352 + "/p:OutDir=\"$freetype_lib_path\" "\ 1.353 + "/p:IntDir=\"$freetype_obj_path\" > freetype.log" > freetype.bat 1.354 + cmd /c freetype.bat 1.355 + 1.356 + if test -s "$freetype_lib_path_unix/freetype.dll"; then 1.357 + # If that succeeds we also build freetype.lib 1.358 + $ECHO -e "@echo off\n"\ 1.359 + "$MSBUILD $vcxproj_path "\ 1.360 + "/p:PlatformToolset=$PLATFORM_TOOLSET "\ 1.361 + "/p:Configuration=\"Release Multithreaded\" "\ 1.362 + "/p:Platform=$freetype_platform "\ 1.363 + "/p:ConfigurationType=StaticLibrary "\ 1.364 + "/p:TargetName=freetype "\ 1.365 + "/p:OutDir=\"$freetype_lib_path\" "\ 1.366 + "/p:IntDir=\"$freetype_obj_path\" >> freetype.log" > freetype.bat 1.367 + cmd /c freetype.bat 1.368 + 1.369 + if test -s "$freetype_lib_path_unix/freetype.lib"; then 1.370 + # Once we build both, lib and dll, set freetype lib and include path appropriately 1.371 + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_SRC_PATH/include" 1.372 + POTENTIAL_FREETYPE_LIB_PATH="$freetype_lib_path_unix" 1.373 + { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling freetype sources succeeded! (see freetype.log for build results)" >&5 1.374 +$as_echo "$as_me: Compiling freetype sources succeeded! (see freetype.log for build results)" >&6;} 1.375 + else 1.376 + BUILD_FREETYPE=no 1.377 + fi 1.378 + else 1.379 + BUILD_FREETYPE=no 1.380 + fi 1.381 + fi 1.382 + 1.383 + if test "x$BUILD_FREETYPE" = xyes; then 1.384 + # Okay, we built it. Check that it works. 1.385 + 1.386 + POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" 1.387 + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" 1.388 + METHOD="--with-freetype-src" 1.389 + 1.390 + # First check if the files exists. 1.391 + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then 1.392 + # We found an arbitrary include file. That's a good sign. 1.393 + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 1.394 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} 1.395 + FOUND_FREETYPE=yes 1.396 + 1.397 + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" 1.398 + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then 1.399 + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 1.400 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} 1.401 + FOUND_FREETYPE=no 1.402 + else 1.403 + if test "x$OPENJDK_TARGET_OS" = xwindows; then 1.404 + # On Windows, we will need both .lib and .dll file. 1.405 + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then 1.406 + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 1.407 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} 1.408 + FOUND_FREETYPE=no 1.409 + fi 1.410 + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then 1.411 + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! 1.412 + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" 1.413 + fi 1.414 + fi 1.415 + fi 1.416 + 1.417 + if test "x$FOUND_FREETYPE" = xyes; then 1.418 + 1.419 + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then 1.420 + 1.421 + # Input might be given as Windows format, start by converting to 1.422 + # unix format. 1.423 + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" 1.424 + new_path=`$CYGPATH -u "$path"` 1.425 + 1.426 + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are 1.427 + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered 1.428 + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then 1.429 + # "foo.exe" is OK but "foo" is an error. 1.430 + # 1.431 + # This test is therefore slightly more accurate than "test -f" to check for file precense. 1.432 + # It is also a way to make sure we got the proper file name for the real test later on. 1.433 + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` 1.434 + if test "x$test_shortpath" = x; then 1.435 + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 1.436 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} 1.437 + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 1.438 + fi 1.439 + 1.440 + # Call helper function which possibly converts this using DOS-style short mode. 1.441 + # If so, the updated path is stored in $new_path. 1.442 + 1.443 + input_path="$new_path" 1.444 + # Check if we need to convert this using DOS-style short mode. If the path 1.445 + # contains just simple characters, use it. Otherwise (spaces, weird characters), 1.446 + # take no chances and rewrite it. 1.447 + # Note: m4 eats our [], so we need to use [ and ] instead. 1.448 + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` 1.449 + if test "x$has_forbidden_chars" != x; then 1.450 + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) 1.451 + shortmode_path=`$CYGPATH -s -m -a "$input_path"` 1.452 + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` 1.453 + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then 1.454 + # Going to short mode and back again did indeed matter. Since short mode is 1.455 + # case insensitive, let's make it lowercase to improve readability. 1.456 + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 1.457 + # Now convert it back to Unix-stile (cygpath) 1.458 + input_path=`$CYGPATH -u "$shortmode_path"` 1.459 + new_path="$input_path" 1.460 + fi 1.461 + fi 1.462 + 1.463 + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` 1.464 + if test "x$test_cygdrive_prefix" = x; then 1.465 + # As a simple fix, exclude /usr/bin since it's not a real path. 1.466 + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then 1.467 + # The path is in a Cygwin special directory (e.g. /home). We need this converted to 1.468 + # a path prefixed by /cygdrive for fixpath to work. 1.469 + new_path="$CYGWIN_ROOT_PATH$input_path" 1.470 + fi 1.471 + fi 1.472 + 1.473 + 1.474 + if test "x$path" != "x$new_path"; then 1.475 + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" 1.476 + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 1.477 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} 1.478 + fi 1.479 + 1.480 + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then 1.481 + 1.482 + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" 1.483 + has_colon=`$ECHO $path | $GREP ^.:` 1.484 + new_path="$path" 1.485 + if test "x$has_colon" = x; then 1.486 + # Not in mixed or Windows style, start by that. 1.487 + new_path=`cmd //c echo $path` 1.488 + fi 1.489 + 1.490 + 1.491 + input_path="$new_path" 1.492 + # Check if we need to convert this using DOS-style short mode. If the path 1.493 + # contains just simple characters, use it. Otherwise (spaces, weird characters), 1.494 + # take no chances and rewrite it. 1.495 + # Note: m4 eats our [], so we need to use [ and ] instead. 1.496 + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` 1.497 + if test "x$has_forbidden_chars" != x; then 1.498 + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) 1.499 + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 1.500 + fi 1.501 + 1.502 + 1.503 + windows_path="$new_path" 1.504 + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then 1.505 + unix_path=`$CYGPATH -u "$windows_path"` 1.506 + new_path="$unix_path" 1.507 + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then 1.508 + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` 1.509 + new_path="$unix_path" 1.510 + fi 1.511 + 1.512 + if test "x$path" != "x$new_path"; then 1.513 + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" 1.514 + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 1.515 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} 1.516 + fi 1.517 + 1.518 + # Save the first 10 bytes of this path to the storage, so fixpath can work. 1.519 + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") 1.520 + 1.521 + else 1.522 + # We're on a posix platform. Hooray! :) 1.523 + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" 1.524 + has_space=`$ECHO "$path" | $GREP " "` 1.525 + if test "x$has_space" != x; then 1.526 + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 1.527 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} 1.528 + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 1.529 + fi 1.530 + 1.531 + # Use eval to expand a potential ~ 1.532 + eval path="$path" 1.533 + if test ! -f "$path" && test ! -d "$path"; then 1.534 + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 1.535 + fi 1.536 + 1.537 + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" 1.538 + fi 1.539 + 1.540 + 1.541 + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then 1.542 + 1.543 + # Input might be given as Windows format, start by converting to 1.544 + # unix format. 1.545 + path="$POTENTIAL_FREETYPE_LIB_PATH" 1.546 + new_path=`$CYGPATH -u "$path"` 1.547 + 1.548 + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are 1.549 + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered 1.550 + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then 1.551 + # "foo.exe" is OK but "foo" is an error. 1.552 + # 1.553 + # This test is therefore slightly more accurate than "test -f" to check for file precense. 1.554 + # It is also a way to make sure we got the proper file name for the real test later on. 1.555 + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` 1.556 + if test "x$test_shortpath" = x; then 1.557 + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 1.558 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} 1.559 + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 1.560 + fi 1.561 + 1.562 + # Call helper function which possibly converts this using DOS-style short mode. 1.563 + # If so, the updated path is stored in $new_path. 1.564 + 1.565 + input_path="$new_path" 1.566 + # Check if we need to convert this using DOS-style short mode. If the path 1.567 + # contains just simple characters, use it. Otherwise (spaces, weird characters), 1.568 + # take no chances and rewrite it. 1.569 + # Note: m4 eats our [], so we need to use [ and ] instead. 1.570 + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` 1.571 + if test "x$has_forbidden_chars" != x; then 1.572 + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) 1.573 + shortmode_path=`$CYGPATH -s -m -a "$input_path"` 1.574 + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` 1.575 + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then 1.576 + # Going to short mode and back again did indeed matter. Since short mode is 1.577 + # case insensitive, let's make it lowercase to improve readability. 1.578 + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 1.579 + # Now convert it back to Unix-stile (cygpath) 1.580 + input_path=`$CYGPATH -u "$shortmode_path"` 1.581 + new_path="$input_path" 1.582 + fi 1.583 + fi 1.584 + 1.585 + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` 1.586 + if test "x$test_cygdrive_prefix" = x; then 1.587 + # As a simple fix, exclude /usr/bin since it's not a real path. 1.588 + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then 1.589 + # The path is in a Cygwin special directory (e.g. /home). We need this converted to 1.590 + # a path prefixed by /cygdrive for fixpath to work. 1.591 + new_path="$CYGWIN_ROOT_PATH$input_path" 1.592 + fi 1.593 + fi 1.594 + 1.595 + 1.596 + if test "x$path" != "x$new_path"; then 1.597 + POTENTIAL_FREETYPE_LIB_PATH="$new_path" 1.598 + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 1.599 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} 1.600 + fi 1.601 + 1.602 + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then 1.603 + 1.604 + path="$POTENTIAL_FREETYPE_LIB_PATH" 1.605 + has_colon=`$ECHO $path | $GREP ^.:` 1.606 + new_path="$path" 1.607 + if test "x$has_colon" = x; then 1.608 + # Not in mixed or Windows style, start by that. 1.609 + new_path=`cmd //c echo $path` 1.610 + fi 1.611 + 1.612 + 1.613 + input_path="$new_path" 1.614 + # Check if we need to convert this using DOS-style short mode. If the path 1.615 + # contains just simple characters, use it. Otherwise (spaces, weird characters), 1.616 + # take no chances and rewrite it. 1.617 + # Note: m4 eats our [], so we need to use [ and ] instead. 1.618 + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` 1.619 + if test "x$has_forbidden_chars" != x; then 1.620 + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) 1.621 + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 1.622 + fi 1.623 + 1.624 + 1.625 + windows_path="$new_path" 1.626 + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then 1.627 + unix_path=`$CYGPATH -u "$windows_path"` 1.628 + new_path="$unix_path" 1.629 + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then 1.630 + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` 1.631 + new_path="$unix_path" 1.632 + fi 1.633 + 1.634 + if test "x$path" != "x$new_path"; then 1.635 + POTENTIAL_FREETYPE_LIB_PATH="$new_path" 1.636 + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 1.637 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} 1.638 + fi 1.639 + 1.640 + # Save the first 10 bytes of this path to the storage, so fixpath can work. 1.641 + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") 1.642 + 1.643 + else 1.644 + # We're on a posix platform. Hooray! :) 1.645 + path="$POTENTIAL_FREETYPE_LIB_PATH" 1.646 + has_space=`$ECHO "$path" | $GREP " "` 1.647 + if test "x$has_space" != x; then 1.648 + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 1.649 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} 1.650 + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 1.651 + fi 1.652 + 1.653 + # Use eval to expand a potential ~ 1.654 + eval path="$path" 1.655 + if test ! -f "$path" && test ! -d "$path"; then 1.656 + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 1.657 + fi 1.658 + 1.659 + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" 1.660 + fi 1.661 + 1.662 + 1.663 + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" 1.664 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 1.665 +$as_echo_n "checking for freetype includes... " >&6; } 1.666 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 1.667 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } 1.668 + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" 1.669 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 1.670 +$as_echo_n "checking for freetype libraries... " >&6; } 1.671 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 1.672 +$as_echo "$FREETYPE_LIB_PATH" >&6; } 1.673 + fi 1.674 + 1.675 + if test "x$FOUND_FREETYPE" != xyes; then 1.676 + as_fn_error $? "Can not use the built freetype at location given by --with-freetype-src" "$LINENO" 5 1.677 + fi 1.678 + else 1.679 + { $as_echo "$as_me:${as_lineno-$LINENO}: User specified --with-freetype-src but building freetype failed. (see freetype.log for build results)" >&5 1.680 +$as_echo "$as_me: User specified --with-freetype-src but building freetype failed. (see freetype.log for build results)" >&6;} 1.681 + as_fn_error $? "Consider building freetype manually and using --with-freetype instead." "$LINENO" 5 1.682 + fi 1.683 + else 1.684 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-freetype-src is currently only supported on Windows - ignoring" >&5 1.685 +$as_echo "$as_me: WARNING: --with-freetype-src is currently only supported on Windows - ignoring" >&2;} 1.686 + fi 1.687 + fi 1.688 + 1.689 if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then 1.690 # User has specified settings 1.691