提交 d9570ccd 编写于 作者: S simonis

8057538: Build the freetype library during configure on Windows

Reviewed-by: erikj, ihse
上级 fc19efef
...@@ -753,6 +753,7 @@ MCS ...@@ -753,6 +753,7 @@ MCS
GNM GNM
NM NM
STRIP STRIP
MSBUILD
DUMPBIN DUMPBIN
RC RC
MT MT
...@@ -1088,6 +1089,7 @@ with_cups_include ...@@ -1088,6 +1089,7 @@ with_cups_include
with_freetype with_freetype
with_freetype_include with_freetype_include
with_freetype_lib with_freetype_lib
with_freetype_src
enable_freetype_bundling enable_freetype_bundling
with_alsa with_alsa
with_alsa_include with_alsa_include
...@@ -1942,6 +1944,9 @@ Optional Packages: ...@@ -1942,6 +1944,9 @@ Optional Packages:
headers under PATH/include) headers under PATH/include)
--with-freetype-include specify directory for the freetype include files --with-freetype-include specify directory for the freetype include files
--with-freetype-lib specify directory for the freetype library --with-freetype-lib specify directory for the freetype library
--with-freetype-src specify directory with freetype sources to
automatically build the library (experimental,
Windows-only)
--with-alsa specify prefix directory for the alsa package --with-alsa specify prefix directory for the alsa package
(expecting the libraries under PATH/lib and the (expecting the libraries under PATH/lib and the
headers under PATH/include) headers under PATH/include)
...@@ -3882,20 +3887,18 @@ cygwin_help() { ...@@ -3882,20 +3887,18 @@ cygwin_help() {
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
;; ;;
freetype) freetype)
if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then HELP_MSG="
HELP_MSG="To install freetype, run: The freetype library can now be build during the configure process.
wget \"http://gnuwin32.sourceforge.net/downlinks/freetype.php\" -O /tmp/freetype-setup.exe Download the freetype sources and unpack them into an arbitrary directory:
chmod +x /tmp/freetype-setup.exe
/tmp/freetype-setup.exe wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz
Follow GUI prompts, and install to default directory \"C:\Program Files (x86)\GnuWin32\". tar -xzf freetype-2.5.3.tar.gz
After installation, locate lib/libfreetype.dll.a and make a copy with the name freetype.dll."
else Then run configure with '--with-freetype-src=<freetype_src>'. This will
HELP_MSG="You need to build a 64-bit version of freetype. automatically build the freetype library into '<freetype_src>/lib64' for 64-bit
This is not readily available. builds or into '<freetype_src>/lib32' for 32-bit builds.
You can find source code and build instructions on Afterwards you can always use '--with-freetype-include=<freetype_src>/include'
http://www.freetype.org/ and '--with-freetype-lib=<freetype_src>/lib32|64' for other builds."
If you put the resulting build in \"C:\Program Files\GnuWin32\", it will be found automatically."
fi
;; ;;
esac esac
} }
...@@ -4060,6 +4063,8 @@ pkgadd_help() { ...@@ -4060,6 +4063,8 @@ pkgadd_help() {
# #
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
...@@ -4321,7 +4326,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++" ...@@ -4321,7 +4326,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
#CUSTOM_AUTOCONF_INCLUDE #CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks: # Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1409311712 DATE_WHEN_GENERATED=1410280734
############################################################################### ###############################################################################
# #
...@@ -26881,6 +26886,10 @@ $as_echo "no" >&6; } ...@@ -26881,6 +26886,10 @@ $as_echo "no" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
VS_ENV_CMD="$VS100BASE/$VCVARSFILE" VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
# PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
# 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
# TODO: improve detection for other versions of VS
PLATFORM_TOOLSET="v100"
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
...@@ -26922,6 +26931,10 @@ $as_echo "$as_me: Please point to the VC/bin directory within the Visual Studio ...@@ -26922,6 +26931,10 @@ $as_echo "$as_me: Please point to the VC/bin directory within the Visual Studio
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
VS_ENV_CMD="$VS100BASE/$VCVARSFILE" VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
# PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
# 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
# TODO: improve detection for other versions of VS
PLATFORM_TOOLSET="v100"
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
...@@ -26952,6 +26965,10 @@ $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studi ...@@ -26952,6 +26965,10 @@ $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studi
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
VS_ENV_CMD="$VS100BASE/$VCVARSFILE" VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
# PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
# 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
# TODO: improve detection for other versions of VS
PLATFORM_TOOLSET="v100"
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
...@@ -26981,6 +26998,10 @@ $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studi ...@@ -26981,6 +26998,10 @@ $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studi
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
VS_ENV_CMD="$VS100BASE/$VCVARSFILE" VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
# PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
# 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
# TODO: improve detection for other versions of VS
PLATFORM_TOOLSET="v100"
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
...@@ -27009,6 +27030,10 @@ $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studi ...@@ -27009,6 +27030,10 @@ $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studi
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
VS_ENV_CMD="$VS100BASE/$VCVARSFILE" VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
# PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
# 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
# TODO: improve detection for other versions of VS
PLATFORM_TOOLSET="v100"
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
...@@ -27051,6 +27076,10 @@ $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" ...@@ -27051,6 +27076,10 @@ $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD"
else else
VS_ENV_ARGS="/x64" VS_ENV_ARGS="/x64"
fi fi
# PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
# 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
# TODO: improve detection for other versions of SDK
PLATFORM_TOOLSET="Windows7.1SDK"
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
...@@ -27093,6 +27122,10 @@ $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" ...@@ -27093,6 +27122,10 @@ $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD"
else else
VS_ENV_ARGS="/x64" VS_ENV_ARGS="/x64"
fi fi
# PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
# 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
# TODO: improve detection for other versions of SDK
PLATFORM_TOOLSET="Windows7.1SDK"
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
...@@ -27135,6 +27168,10 @@ $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" ...@@ -27135,6 +27168,10 @@ $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD"
else else
VS_ENV_ARGS="/x64" VS_ENV_ARGS="/x64"
fi fi
# PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
# 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
# TODO: improve detection for other versions of SDK
PLATFORM_TOOLSET="Windows7.1SDK"
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
...@@ -27176,6 +27213,10 @@ $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" ...@@ -27176,6 +27213,10 @@ $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD"
else else
VS_ENV_ARGS="/x64" VS_ENV_ARGS="/x64"
fi fi
# PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
# 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
# TODO: improve detection for other versions of SDK
PLATFORM_TOOLSET="Windows7.1SDK"
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
...@@ -27216,6 +27257,10 @@ $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" ...@@ -27216,6 +27257,10 @@ $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD"
else else
VS_ENV_ARGS="/x64" VS_ENV_ARGS="/x64"
fi fi
# PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
# 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
# TODO: improve detection for other versions of SDK
PLATFORM_TOOLSET="Windows7.1SDK"
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
...@@ -35112,6 +35157,50 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow ...@@ -35112,6 +35157,50 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow
$as_echo "$as_me: Rewriting DUMPBIN to \"$new_complete\"" >&6;} $as_echo "$as_me: Rewriting DUMPBIN to \"$new_complete\"" >&6;}
fi fi
# We need to check for 'msbuild.exe' because at the place where we expect to
# find 'msbuild.exe' there's also a directory called 'msbuild' and configure
# won't find the 'msbuild.exe' executable in that case (and the
# 'ac_executable_extensions' is unusable due to performance reasons).
# Notice that we intentionally don't fix up the path to MSBUILD because we
# will call it in a DOS shell during freetype detection on Windows (see
# 'LIB_SETUP_FREETYPE' in "libraries.m4"
# Extract the first word of "msbuild.exe", so it can be a program name with args.
set dummy msbuild.exe; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_MSBUILD+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$MSBUILD"; then
ac_cv_prog_MSBUILD="$MSBUILD" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_MSBUILD="msbuild.exe"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
MSBUILD=$ac_cv_prog_MSBUILD
if test -n "$MSBUILD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSBUILD" >&5
$as_echo "$MSBUILD" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi fi
if test "x$OPENJDK_TARGET_OS" = xsolaris; then if test "x$OPENJDK_TARGET_OS" = xsolaris; then
...@@ -44318,6 +44407,12 @@ if test "${with_freetype_lib+set}" = set; then : ...@@ -44318,6 +44407,12 @@ if test "${with_freetype_lib+set}" = set; then :
withval=$with_freetype_lib; withval=$with_freetype_lib;
fi fi
# Check whether --with-freetype-src was given.
if test "${with_freetype_src+set}" = set; then :
withval=$with_freetype_src;
fi
# Check whether --enable-freetype-bundling was given. # Check whether --enable-freetype-bundling was given.
if test "${enable_freetype_bundling+set}" = set; then : if test "${enable_freetype_bundling+set}" = set; then :
enableval=$enable_freetype_bundling; enableval=$enable_freetype_bundling;
...@@ -44329,7 +44424,7 @@ fi ...@@ -44329,7 +44424,7 @@ fi
FREETYPE_BUNDLE_LIB_PATH= FREETYPE_BUNDLE_LIB_PATH=
if test "x$FREETYPE_NOT_NEEDED" = xyes; then if test "x$FREETYPE_NOT_NEEDED" = xyes; then
if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then 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
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: freetype not used, so --with-freetype is ignored" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: freetype not used, so --with-freetype is ignored" >&5
$as_echo "$as_me: WARNING: freetype not used, so --with-freetype is ignored" >&2;} $as_echo "$as_me: WARNING: freetype not used, so --with-freetype is ignored" >&2;}
fi fi
...@@ -44342,6 +44437,429 @@ $as_echo "$as_me: WARNING: freetype not used, so --enable-freetype-bundling is i ...@@ -44342,6 +44437,429 @@ $as_echo "$as_me: WARNING: freetype not used, so --enable-freetype-bundling is i
BUNDLE_FREETYPE="$enable_freetype_bundling" BUNDLE_FREETYPE="$enable_freetype_bundling"
if test "x$with_freetype_src" != x; then
if test "x$OPENJDK_TARGET_OS" = xwindows; then
# Try to build freetype if --with-freetype-src was given on Windows
FREETYPE_SRC_PATH="$with_freetype_src"
BUILD_FREETYPE=yes
# Check if the freetype sources are acessible..
if ! test -d $FREETYPE_SRC_PATH; then
{ $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
$as_echo "$as_me: WARNING: --with-freetype-src specified, but can't find path \"$FREETYPE_SRC_PATH\" - ignoring --with-freetype-src" >&2;}
BUILD_FREETYPE=no
fi
# ..and contain a vc2010 project file
vcxproj_path="$FREETYPE_SRC_PATH/builds/windows/vc2010/freetype.vcxproj"
if test "x$BUILD_FREETYPE" = xyes && ! test -s $vcxproj_path; then
{ $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
$as_echo "$as_me: WARNING: Can't find project file $vcxproj_path (you may try a newer freetype version) - ignoring --with-freetype-src" >&2;}
BUILD_FREETYPE=no
fi
# Now check if configure found a version of 'msbuild.exe'
if test "x$BUILD_FREETYPE" = xyes && test "x$MSBUILD" == x ; then
{ $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
$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;}
BUILD_FREETYPE=no
fi
# Ready to go..
if test "x$BUILD_FREETYPE" = xyes; then
# msbuild requires trailing slashes for output directories
freetype_lib_path="$FREETYPE_SRC_PATH/lib$OPENJDK_TARGET_CPU_BITS/"
freetype_lib_path_unix="$freetype_lib_path"
freetype_obj_path="$FREETYPE_SRC_PATH/obj$OPENJDK_TARGET_CPU_BITS/"
unix_path="$vcxproj_path"
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
windows_path=`$CYGPATH -m "$unix_path"`
vcxproj_path="$windows_path"
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
windows_path=`cmd //c echo $unix_path`
vcxproj_path="$windows_path"
fi
unix_path="$freetype_lib_path"
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
windows_path=`$CYGPATH -m "$unix_path"`
freetype_lib_path="$windows_path"
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
windows_path=`cmd //c echo $unix_path`
freetype_lib_path="$windows_path"
fi
unix_path="$freetype_obj_path"
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
windows_path=`$CYGPATH -m "$unix_path"`
freetype_obj_path="$windows_path"
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
windows_path=`cmd //c echo $unix_path`
freetype_obj_path="$windows_path"
fi
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
freetype_platform=x64
else
freetype_platform=win32
fi
# The original freetype project file is for VS 2010 (i.e. 'v100'),
# so we have to adapt the toolset if building with any other toolsed (i.e. SDK).
# Currently 'PLATFORM_TOOLSET' is set in 'TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT'/
# 'TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT' in toolchain_windows.m4
{ $as_echo "$as_me:${as_lineno-$LINENO}: Trying to compile freetype sources with PlatformToolset=$PLATFORM_TOOLSET to $freetype_lib_path_unix ..." >&5
$as_echo "$as_me: Trying to compile freetype sources with PlatformToolset=$PLATFORM_TOOLSET to $freetype_lib_path_unix ..." >&6;}
# First we try to build the freetype.dll
$ECHO -e "@echo off\n"\
"$MSBUILD $vcxproj_path "\
"/p:PlatformToolset=$PLATFORM_TOOLSET "\
"/p:Configuration=\"Release Multithreaded\" "\
"/p:Platform=$freetype_platform "\
"/p:ConfigurationType=DynamicLibrary "\
"/p:TargetName=freetype "\
"/p:OutDir=\"$freetype_lib_path\" "\
"/p:IntDir=\"$freetype_obj_path\" > freetype.log" > freetype.bat
cmd /c freetype.bat
if test -s "$freetype_lib_path_unix/freetype.dll"; then
# If that succeeds we also build freetype.lib
$ECHO -e "@echo off\n"\
"$MSBUILD $vcxproj_path "\
"/p:PlatformToolset=$PLATFORM_TOOLSET "\
"/p:Configuration=\"Release Multithreaded\" "\
"/p:Platform=$freetype_platform "\
"/p:ConfigurationType=StaticLibrary "\
"/p:TargetName=freetype "\
"/p:OutDir=\"$freetype_lib_path\" "\
"/p:IntDir=\"$freetype_obj_path\" >> freetype.log" > freetype.bat
cmd /c freetype.bat
if test -s "$freetype_lib_path_unix/freetype.lib"; then
# Once we build both, lib and dll, set freetype lib and include path appropriately
POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_SRC_PATH/include"
POTENTIAL_FREETYPE_LIB_PATH="$freetype_lib_path_unix"
{ $as_echo "$as_me:${as_lineno-$LINENO}: Compiling freetype sources succeeded! (see freetype.log for build results)" >&5
$as_echo "$as_me: Compiling freetype sources succeeded! (see freetype.log for build results)" >&6;}
else
BUILD_FREETYPE=no
fi
else
BUILD_FREETYPE=no
fi
fi
if test "x$BUILD_FREETYPE" = xyes; then
# Okay, we built it. Check that it works.
POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH"
POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH"
METHOD="--with-freetype-src"
# First check if the files exists.
if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then
# We found an arbitrary include file. That's a good sign.
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5
$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;}
FOUND_FREETYPE=yes
FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}"
if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5
$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;}
FOUND_FREETYPE=no
else
if test "x$OPENJDK_TARGET_OS" = xwindows; then
# On Windows, we will need both .lib and .dll file.
if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5
$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;}
FOUND_FREETYPE=no
fi
elif test "x$OPENJDK_TARGET_OS" = xsolaris \
&& test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
# Found lib in isa dir, use that instead.
POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
fi
fi
fi
if test "x$FOUND_FREETYPE" = xyes; then
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
# Input might be given as Windows format, start by converting to
# unix format.
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
new_path=`$CYGPATH -u "$path"`
# Cygwin tries to hide some aspects of the Windows file system, such that binaries are
# named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
# the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
# "foo.exe" is OK but "foo" is an error.
#
# This test is therefore slightly more accurate than "test -f" to check for file precense.
# It is also a way to make sure we got the proper file name for the real test later on.
test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
if test "x$test_shortpath" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5
fi
# Call helper function which possibly converts this using DOS-style short mode.
# If so, the updated path is stored in $new_path.
input_path="$new_path"
# Check if we need to convert this using DOS-style short mode. If the path
# contains just simple characters, use it. Otherwise (spaces, weird characters),
# take no chances and rewrite it.
# Note: m4 eats our [], so we need to use [ and ] instead.
has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
if test "x$has_forbidden_chars" != x; then
# Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
shortmode_path=`$CYGPATH -s -m -a "$input_path"`
path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
# Going to short mode and back again did indeed matter. Since short mode is
# case insensitive, let's make it lowercase to improve readability.
shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
# Now convert it back to Unix-stile (cygpath)
input_path=`$CYGPATH -u "$shortmode_path"`
new_path="$input_path"
fi
fi
test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
if test "x$test_cygdrive_prefix" = x; then
# As a simple fix, exclude /usr/bin since it's not a real path.
if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
# The path is in a Cygwin special directory (e.g. /home). We need this converted to
# a path prefixed by /cygdrive for fixpath to work.
new_path="$CYGWIN_ROOT_PATH$input_path"
fi
fi
if test "x$path" != "x$new_path"; then
POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path"
{ $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5
$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
fi
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
has_colon=`$ECHO $path | $GREP ^.:`
new_path="$path"
if test "x$has_colon" = x; then
# Not in mixed or Windows style, start by that.
new_path=`cmd //c echo $path`
fi
input_path="$new_path"
# Check if we need to convert this using DOS-style short mode. If the path
# contains just simple characters, use it. Otherwise (spaces, weird characters),
# take no chances and rewrite it.
# Note: m4 eats our [], so we need to use [ and ] instead.
has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
if test "x$has_forbidden_chars" != x; then
# Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
fi
windows_path="$new_path"
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
unix_path=`$CYGPATH -u "$windows_path"`
new_path="$unix_path"
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
new_path="$unix_path"
fi
if test "x$path" != "x$new_path"; then
POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path"
{ $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5
$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
fi
# Save the first 10 bytes of this path to the storage, so fixpath can work.
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
# We're on a posix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
fi
# Use eval to expand a potential ~
eval path="$path"
if test ! -f "$path" && test ! -d "$path"; then
as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
fi
POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
fi
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
# Input might be given as Windows format, start by converting to
# unix format.
path="$POTENTIAL_FREETYPE_LIB_PATH"
new_path=`$CYGPATH -u "$path"`
# Cygwin tries to hide some aspects of the Windows file system, such that binaries are
# named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
# the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
# "foo.exe" is OK but "foo" is an error.
#
# This test is therefore slightly more accurate than "test -f" to check for file precense.
# It is also a way to make sure we got the proper file name for the real test later on.
test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
if test "x$test_shortpath" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5
fi
# Call helper function which possibly converts this using DOS-style short mode.
# If so, the updated path is stored in $new_path.
input_path="$new_path"
# Check if we need to convert this using DOS-style short mode. If the path
# contains just simple characters, use it. Otherwise (spaces, weird characters),
# take no chances and rewrite it.
# Note: m4 eats our [], so we need to use [ and ] instead.
has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
if test "x$has_forbidden_chars" != x; then
# Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
shortmode_path=`$CYGPATH -s -m -a "$input_path"`
path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
# Going to short mode and back again did indeed matter. Since short mode is
# case insensitive, let's make it lowercase to improve readability.
shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
# Now convert it back to Unix-stile (cygpath)
input_path=`$CYGPATH -u "$shortmode_path"`
new_path="$input_path"
fi
fi
test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
if test "x$test_cygdrive_prefix" = x; then
# As a simple fix, exclude /usr/bin since it's not a real path.
if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
# The path is in a Cygwin special directory (e.g. /home). We need this converted to
# a path prefixed by /cygdrive for fixpath to work.
new_path="$CYGWIN_ROOT_PATH$input_path"
fi
fi
if test "x$path" != "x$new_path"; then
POTENTIAL_FREETYPE_LIB_PATH="$new_path"
{ $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5
$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
fi
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
path="$POTENTIAL_FREETYPE_LIB_PATH"
has_colon=`$ECHO $path | $GREP ^.:`
new_path="$path"
if test "x$has_colon" = x; then
# Not in mixed or Windows style, start by that.
new_path=`cmd //c echo $path`
fi
input_path="$new_path"
# Check if we need to convert this using DOS-style short mode. If the path
# contains just simple characters, use it. Otherwise (spaces, weird characters),
# take no chances and rewrite it.
# Note: m4 eats our [], so we need to use [ and ] instead.
has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
if test "x$has_forbidden_chars" != x; then
# Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
fi
windows_path="$new_path"
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
unix_path=`$CYGPATH -u "$windows_path"`
new_path="$unix_path"
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
new_path="$unix_path"
fi
if test "x$path" != "x$new_path"; then
POTENTIAL_FREETYPE_LIB_PATH="$new_path"
{ $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5
$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
fi
# Save the first 10 bytes of this path to the storage, so fixpath can work.
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
# We're on a posix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_LIB_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
fi
# Use eval to expand a potential ~
eval path="$path"
if test ! -f "$path" && test ! -d "$path"; then
as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
fi
POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
fi
FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5
$as_echo_n "checking for freetype includes... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5
$as_echo "$FREETYPE_INCLUDE_PATH" >&6; }
FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5
$as_echo_n "checking for freetype libraries... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5
$as_echo "$FREETYPE_LIB_PATH" >&6; }
fi
if test "x$FOUND_FREETYPE" != xyes; then
as_fn_error $? "Can not use the built freetype at location given by --with-freetype-src" "$LINENO" 5
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: User specified --with-freetype-src but building freetype failed. (see freetype.log for build results)" >&5
$as_echo "$as_me: User specified --with-freetype-src but building freetype failed. (see freetype.log for build results)" >&6;}
as_fn_error $? "Consider building freetype manually and using --with-freetype instead." "$LINENO" 5
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-freetype-src is currently only supported on Windows - ignoring" >&5
$as_echo "$as_me: WARNING: --with-freetype-src is currently only supported on Windows - ignoring" >&2;}
fi
fi
if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then
# User has specified settings # User has specified settings
...@@ -75,20 +75,18 @@ cygwin_help() { ...@@ -75,20 +75,18 @@ cygwin_help() {
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
;; ;;
freetype) freetype)
if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then HELP_MSG="
HELP_MSG="To install freetype, run: The freetype library can now be build during the configure process.
wget \"http://gnuwin32.sourceforge.net/downlinks/freetype.php\" -O /tmp/freetype-setup.exe Download the freetype sources and unpack them into an arbitrary directory:
chmod +x /tmp/freetype-setup.exe
/tmp/freetype-setup.exe wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz
Follow GUI prompts, and install to default directory \"C:\Program Files (x86)\GnuWin32\". tar -xzf freetype-2.5.3.tar.gz
After installation, locate lib/libfreetype.dll.a and make a copy with the name freetype.dll."
else Then run configure with '--with-freetype-src=<freetype_src>'. This will
HELP_MSG="You need to build a 64-bit version of freetype. automatically build the freetype library into '<freetype_src>/lib64' for 64-bit
This is not readily available. builds or into '<freetype_src>/lib32' for 32-bit builds.
You can find source code and build instructions on Afterwards you can always use '--with-freetype-include=<freetype_src>/include'
http://www.freetype.org/ and '--with-freetype-lib=<freetype_src>/lib[32|64]' for other builds."
If you put the resulting build in \"C:\Program Files\GnuWin32\", it will be found automatically."
fi
;; ;;
esac esac
} }
......
...@@ -247,12 +247,95 @@ AC_DEFUN_ONCE([LIB_SETUP_CUPS], ...@@ -247,12 +247,95 @@ AC_DEFUN_ONCE([LIB_SETUP_CUPS],
]) ])
AC_DEFUN([LIB_BUILD_FREETYPE],
[
FREETYPE_SRC_PATH="$1"
BUILD_FREETYPE=yes
# Check if the freetype sources are acessible..
if ! test -d $FREETYPE_SRC_PATH; then
AC_MSG_WARN([--with-freetype-src specified, but can't find path "$FREETYPE_SRC_PATH" - ignoring --with-freetype-src])
BUILD_FREETYPE=no
fi
# ..and contain a vc2010 project file
vcxproj_path="$FREETYPE_SRC_PATH/builds/windows/vc2010/freetype.vcxproj"
if test "x$BUILD_FREETYPE" = xyes && ! test -s $vcxproj_path; then
AC_MSG_WARN([Can't find project file $vcxproj_path (you may try a newer freetype version) - ignoring --with-freetype-src])
BUILD_FREETYPE=no
fi
# Now check if configure found a version of 'msbuild.exe'
if test "x$BUILD_FREETYPE" = xyes && test "x$MSBUILD" == x ; then
AC_MSG_WARN([Can't find an msbuild.exe executable (you may try to install .NET 4.0) - ignoring --with-freetype-src])
BUILD_FREETYPE=no
fi
# Ready to go..
if test "x$BUILD_FREETYPE" = xyes; then
# msbuild requires trailing slashes for output directories
freetype_lib_path="$FREETYPE_SRC_PATH/lib$OPENJDK_TARGET_CPU_BITS/"
freetype_lib_path_unix="$freetype_lib_path"
freetype_obj_path="$FREETYPE_SRC_PATH/obj$OPENJDK_TARGET_CPU_BITS/"
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(vcxproj_path)
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(freetype_lib_path)
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(freetype_obj_path)
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
freetype_platform=x64
else
freetype_platform=win32
fi
# The original freetype project file is for VS 2010 (i.e. 'v100'),
# so we have to adapt the toolset if building with any other toolsed (i.e. SDK).
# Currently 'PLATFORM_TOOLSET' is set in 'TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT'/
# 'TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT' in toolchain_windows.m4
AC_MSG_NOTICE([Trying to compile freetype sources with PlatformToolset=$PLATFORM_TOOLSET to $freetype_lib_path_unix ...])
# First we try to build the freetype.dll
$ECHO -e "@echo off\n"\
"$MSBUILD $vcxproj_path "\
"/p:PlatformToolset=$PLATFORM_TOOLSET "\
"/p:Configuration=\"Release Multithreaded\" "\
"/p:Platform=$freetype_platform "\
"/p:ConfigurationType=DynamicLibrary "\
"/p:TargetName=freetype "\
"/p:OutDir=\"$freetype_lib_path\" "\
"/p:IntDir=\"$freetype_obj_path\" > freetype.log" > freetype.bat
cmd /c freetype.bat
if test -s "$freetype_lib_path_unix/freetype.dll"; then
# If that succeeds we also build freetype.lib
$ECHO -e "@echo off\n"\
"$MSBUILD $vcxproj_path "\
"/p:PlatformToolset=$PLATFORM_TOOLSET "\
"/p:Configuration=\"Release Multithreaded\" "\
"/p:Platform=$freetype_platform "\
"/p:ConfigurationType=StaticLibrary "\
"/p:TargetName=freetype "\
"/p:OutDir=\"$freetype_lib_path\" "\
"/p:IntDir=\"$freetype_obj_path\" >> freetype.log" > freetype.bat
cmd /c freetype.bat
if test -s "$freetype_lib_path_unix/freetype.lib"; then
# Once we build both, lib and dll, set freetype lib and include path appropriately
POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_SRC_PATH/include"
POTENTIAL_FREETYPE_LIB_PATH="$freetype_lib_path_unix"
AC_MSG_NOTICE([Compiling freetype sources succeeded! (see freetype.log for build results)])
else
BUILD_FREETYPE=no
fi
else
BUILD_FREETYPE=no
fi
fi
])
AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE], AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE],
[ [
POTENTIAL_FREETYPE_INCLUDE_PATH="$1" POTENTIAL_FREETYPE_INCLUDE_PATH="$1"
POTENTIAL_FREETYPE_LIB_PATH="$2" POTENTIAL_FREETYPE_LIB_PATH="$2"
METHOD="$3" METHOD="$3"
# First check if the files exists. # First check if the files exists.
if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then
# We found an arbitrary include file. That's a good sign. # We found an arbitrary include file. That's a good sign.
...@@ -305,6 +388,8 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], ...@@ -305,6 +388,8 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
[specify directory for the freetype include files])]) [specify directory for the freetype include files])])
AC_ARG_WITH(freetype-lib, [AS_HELP_STRING([--with-freetype-lib], AC_ARG_WITH(freetype-lib, [AS_HELP_STRING([--with-freetype-lib],
[specify directory for the freetype library])]) [specify directory for the freetype library])])
AC_ARG_WITH(freetype-src, [AS_HELP_STRING([--with-freetype-src],
[specify directory with freetype sources to automatically build the library (experimental, Windows-only)])])
AC_ARG_ENABLE(freetype-bundling, [AS_HELP_STRING([--disable-freetype-bundling], AC_ARG_ENABLE(freetype-bundling, [AS_HELP_STRING([--disable-freetype-bundling],
[disable bundling of the freetype library with the build result @<:@enabled on Windows or when using --with-freetype, disabled otherwise@:>@])]) [disable bundling of the freetype library with the build result @<:@enabled on Windows or when using --with-freetype, disabled otherwise@:>@])])
...@@ -313,7 +398,7 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], ...@@ -313,7 +398,7 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
FREETYPE_BUNDLE_LIB_PATH= FREETYPE_BUNDLE_LIB_PATH=
if test "x$FREETYPE_NOT_NEEDED" = xyes; then if test "x$FREETYPE_NOT_NEEDED" = xyes; then
if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then 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
AC_MSG_WARN([freetype not used, so --with-freetype is ignored]) AC_MSG_WARN([freetype not used, so --with-freetype is ignored])
fi fi
if test "x$enable_freetype_bundling" != x; then if test "x$enable_freetype_bundling" != x; then
...@@ -324,6 +409,25 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], ...@@ -324,6 +409,25 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
BUNDLE_FREETYPE="$enable_freetype_bundling" BUNDLE_FREETYPE="$enable_freetype_bundling"
if test "x$with_freetype_src" != x; then
if test "x$OPENJDK_TARGET_OS" = xwindows; then
# Try to build freetype if --with-freetype-src was given on Windows
LIB_BUILD_FREETYPE([$with_freetype_src])
if test "x$BUILD_FREETYPE" = xyes; then
# Okay, we built it. Check that it works.
LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype-src])
if test "x$FOUND_FREETYPE" != xyes; then
AC_MSG_ERROR([Can not use the built freetype at location given by --with-freetype-src])
fi
else
AC_MSG_NOTICE([User specified --with-freetype-src but building freetype failed. (see freetype.log for build results)])
AC_MSG_ERROR([Consider building freetype manually and using --with-freetype instead.])
fi
else
AC_MSG_WARN([--with-freetype-src is currently only supported on Windows - ignoring])
fi
fi
if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then
# User has specified settings # User has specified settings
...@@ -331,12 +435,12 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], ...@@ -331,12 +435,12 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
# If not specified, default is to bundle freetype # If not specified, default is to bundle freetype
BUNDLE_FREETYPE=yes BUNDLE_FREETYPE=yes
fi fi
if test "x$with_freetype" != x; then if test "x$with_freetype" != x; then
POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include" POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include"
POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib" POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib"
fi fi
# Allow --with-freetype-lib and --with-freetype-include to override # Allow --with-freetype-lib and --with-freetype-include to override
if test "x$with_freetype_include" != x; then if test "x$with_freetype_include" != x; then
POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include" POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include"
...@@ -468,7 +572,7 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], ...@@ -468,7 +572,7 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH" FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH"
fi fi
fi fi
if test "x$FREETYPE_LIBS" = x; then if test "x$FREETYPE_LIBS" = x; then
BASIC_FIXUP_PATH(FREETYPE_LIB_PATH) BASIC_FIXUP_PATH(FREETYPE_LIB_PATH)
if test "x$OPENJDK_TARGET_OS" = xwindows; then if test "x$OPENJDK_TARGET_OS" = xwindows; then
...@@ -484,7 +588,7 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], ...@@ -484,7 +588,7 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
PREV_CXXCFLAGS="$CXXFLAGS" PREV_CXXCFLAGS="$CXXFLAGS"
PREV_LIBS="$LIBS" PREV_LIBS="$LIBS"
PREV_CXX="$CXX" PREV_CXX="$CXX"
CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS"
LIBS="$LIBS $FREETYPE_LIBS" LIBS="$LIBS $FREETYPE_LIBS"
CXX="$FIXPATH $CXX" CXX="$FIXPATH $CXX"
AC_LINK_IFELSE([AC_LANG_SOURCE([[ AC_LINK_IFELSE([AC_LANG_SOURCE([[
...@@ -502,9 +606,9 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], ...@@ -502,9 +606,9 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
AC_MSG_NOTICE([Could not compile and link with freetype. This might be a 32/64-bit mismatch.]) AC_MSG_NOTICE([Could not compile and link with freetype. This might be a 32/64-bit mismatch.])
AC_MSG_NOTICE([Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS]) AC_MSG_NOTICE([Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS])
HELP_MSG_MISSING_DEPENDENCY([freetype]) HELP_MSG_MISSING_DEPENDENCY([freetype])
AC_MSG_ERROR([Can not continue without freetype. $HELP_MSG]) AC_MSG_ERROR([Can not continue without freetype. $HELP_MSG])
] ]
) )
......
...@@ -557,6 +557,14 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA], ...@@ -557,6 +557,14 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
BASIC_FIXUP_EXECUTABLE(RC) BASIC_FIXUP_EXECUTABLE(RC)
AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,) AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,)
BASIC_FIXUP_EXECUTABLE(DUMPBIN) BASIC_FIXUP_EXECUTABLE(DUMPBIN)
# We need to check for 'msbuild.exe' because at the place where we expect to
# find 'msbuild.exe' there's also a directory called 'msbuild' and configure
# won't find the 'msbuild.exe' executable in that case (and the
# 'ac_executable_extensions' is unusable due to performance reasons).
# Notice that we intentionally don't fix up the path to MSBUILD because we
# will call it in a DOS shell during freetype detection on Windows (see
# 'LIB_SETUP_FREETYPE' in "libraries.m4"
AC_CHECK_PROG([MSBUILD], [msbuild.exe], [msbuild.exe],,,)
fi fi
if test "x$OPENJDK_TARGET_OS" = xsolaris; then if test "x$OPENJDK_TARGET_OS" = xsolaris; then
......
...@@ -33,6 +33,10 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT], ...@@ -33,6 +33,10 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT],
if test -f "$VS100BASE/$VCVARSFILE"; then if test -f "$VS100BASE/$VCVARSFILE"; then
AC_MSG_NOTICE([Found Visual Studio installation at $VS100BASE using $METHOD]) AC_MSG_NOTICE([Found Visual Studio installation at $VS100BASE using $METHOD])
VS_ENV_CMD="$VS100BASE/$VCVARSFILE" VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
# PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
# 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
# TODO: improve detection for other versions of VS
PLATFORM_TOOLSET="v100"
else else
AC_MSG_NOTICE([Found Visual Studio installation at $VS100BASE using $METHOD]) AC_MSG_NOTICE([Found Visual Studio installation at $VS100BASE using $METHOD])
AC_MSG_NOTICE([Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring]) AC_MSG_NOTICE([Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring])
...@@ -61,6 +65,10 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT], ...@@ -61,6 +65,10 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT],
else else
VS_ENV_ARGS="/x64" VS_ENV_ARGS="/x64"
fi fi
# PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
# 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
# TODO: improve detection for other versions of SDK
PLATFORM_TOOLSET="Windows7.1SDK"
else else
AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD]) AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD])
AC_MSG_NOTICE([Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring]) AC_MSG_NOTICE([Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册