提交 ef7416ad 编写于 作者: I ihse

8001922: Improve freetype handling.

Reviewed-by: erikj
上级 e0ac1cf5
...@@ -177,6 +177,9 @@ JDKOPT_SETUP_DEBUG_SYMBOLS ...@@ -177,6 +177,9 @@ JDKOPT_SETUP_DEBUG_SYMBOLS
# #
############################################################################### ###############################################################################
# After we have toolchain, we can compile fixpath. It's needed by the lib checks.
BASIC_COMPILE_FIXPATH
LIB_SETUP_INIT LIB_SETUP_INIT
LIB_SETUP_X11 LIB_SETUP_X11
LIB_SETUP_CUPS LIB_SETUP_CUPS
...@@ -185,8 +188,6 @@ LIB_SETUP_ALSA ...@@ -185,8 +188,6 @@ LIB_SETUP_ALSA
LIB_SETUP_MISC_LIBS LIB_SETUP_MISC_LIBS
LIB_SETUP_STATIC_LINK_LIBSTDCPP LIB_SETUP_STATIC_LINK_LIBSTDCPP
# After we have toolchain and the paths to all libraries (needed by msys), we can compile the fixpath helper
BASIC_COMPILE_FIXPATH
############################################################################### ###############################################################################
# #
......
...@@ -31,7 +31,7 @@ AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP], ...@@ -31,7 +31,7 @@ AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY], AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
[ [
# Print a helpful message on how to acquire the necessary build dependency. # Print a helpful message on how to acquire the necessary build dependency.
# $1 is the help tag: freetyp2, cups, pulse, alsa etc # $1 is the help tag: freetype, cups, pulse, alsa etc
MISSING_DEPENDENCY=$1 MISSING_DEPENDENCY=$1
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
...@@ -76,7 +76,7 @@ cygwin_help() { ...@@ -76,7 +76,7 @@ cygwin_help() {
PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P make )" PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P make )"
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'."
;; ;;
freetype2) freetype)
if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
HELP_MSG="To install freetype, run: HELP_MSG="To install freetype, run:
wget \"http://gnuwin32.sourceforge.net/downlinks/freetype.php\" -O /tmp/freetype-setup.exe wget \"http://gnuwin32.sourceforge.net/downlinks/freetype.php\" -O /tmp/freetype-setup.exe
...@@ -111,7 +111,7 @@ apt_help() { ...@@ -111,7 +111,7 @@ apt_help() {
PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;; PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
cups) cups)
PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;; PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;;
freetype2) freetype)
PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;; PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
pulse) pulse)
PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;; PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;;
...@@ -134,7 +134,7 @@ yum_help() { ...@@ -134,7 +134,7 @@ yum_help() {
PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;; PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
cups) cups)
PKGHANDLER_COMMAND="sudo yum install cups-devel" ;; PKGHANDLER_COMMAND="sudo yum install cups-devel" ;;
freetype2) freetype)
PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;; PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
pulse) pulse)
PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;; PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;;
......
...@@ -57,10 +57,9 @@ AC_DEFUN_ONCE([LIB_SETUP_INIT], ...@@ -57,10 +57,9 @@ AC_DEFUN_ONCE([LIB_SETUP_INIT],
ALSA_NOT_NEEDED=yes ALSA_NOT_NEEDED=yes
PULSE_NOT_NEEDED=yes PULSE_NOT_NEEDED=yes
X11_NOT_NEEDED=yes X11_NOT_NEEDED=yes
FREETYPE2_NOT_NEEDED=yes
# If the java runtime framework is disabled, then we need X11. # If the java runtime framework is disabled, then we need X11.
# This will be adjusted below. # This will be adjusted below.
AC_MSG_RESULT([alsa pulse x11 freetype]) AC_MSG_RESULT([alsa pulse x11])
fi fi
if test "x$OPENJDK_TARGET_OS" = xbsd; then if test "x$OPENJDK_TARGET_OS" = xbsd; then
...@@ -70,7 +69,7 @@ AC_DEFUN_ONCE([LIB_SETUP_INIT], ...@@ -70,7 +69,7 @@ AC_DEFUN_ONCE([LIB_SETUP_INIT],
fi fi
if test "x$OPENJDK" = "xfalse"; then if test "x$OPENJDK" = "xfalse"; then
FREETYPE2_NOT_NEEDED=yes FREETYPE_NOT_NEEDED=yes
fi fi
if test "x$SUPPORT_HEADFUL" = xno; then if test "x$SUPPORT_HEADFUL" = xno; then
...@@ -261,151 +260,279 @@ AC_DEFUN_ONCE([LIB_SETUP_CUPS], ...@@ -261,151 +260,279 @@ AC_DEFUN_ONCE([LIB_SETUP_CUPS],
]) ])
AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE],
[
POTENTIAL_FREETYPE_INCLUDE_PATH="$1"
POTENTIAL_FREETYPE_LIB_PATH="$2"
METHOD="$3"
# 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.
AC_MSG_NOTICE([Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD])
FOUND_FREETYPE=yes
FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}"
if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then
AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location.])
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
AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location.])
FOUND_FREETYPE=no
fi
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
# On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess!
POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64"
fi
fi
fi
if test "x$FOUND_FREETYPE" = xyes; then
BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_INCLUDE_PATH)
BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_LIB_PATH)
FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH"
AC_MSG_CHECKING([for freetype includes])
AC_MSG_RESULT([$FREETYPE_INCLUDE_PATH])
FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH"
AC_MSG_CHECKING([for freetype libraries])
AC_MSG_RESULT([$FREETYPE_LIB_PATH])
fi
])
AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
[ [
############################################################################### ###############################################################################
# #
# The ubiquitous freetype2 library is used to render fonts. # The ubiquitous freetype library is used to render fonts.
# #
AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype], AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype],
[specify prefix directory for the freetype2 package [specify prefix directory for the freetype package
(expecting the libraries under PATH/lib and the headers under PATH/include)])]) (expecting the libraries under PATH/lib and the headers under PATH/include)])])
AC_ARG_WITH(freetype-include, [AS_HELP_STRING([--with-freetype-include],
# If we are using the OS installed system lib for freetype, then we do not need to copy it to the build tree [specify directory for the freetype include files])])
USING_SYSTEM_FT_LIB=false AC_ARG_WITH(freetype-lib, [AS_HELP_STRING([--with-freetype-lib],
[specify directory for the freetype library])])
if test "x$FREETYPE2_NOT_NEEDED" = xyes; then 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@:>@])])
FREETYPE_CFLAGS=
FREETYPE_LIBS=
FREETYPE_BUNDLE_LIB_PATH=
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; 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
FREETYPE2_CFLAGS= if test "x$enable_freetype_bundling" != x; then
FREETYPE2_LIBS= AC_MSG_WARN([freetype not used, so --enable-freetype-bundling is ignored])
FREETYPE2_LIB_PATH= fi
else else
FREETYPE2_FOUND=no # freetype is needed to build; go get it!
if test "x$with_freetype" != x; then BUNDLE_FREETYPE="$enable_freetype_bundling"
BASIC_FIXUP_PATH(with_freetype)
FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype" if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then
FREETYPE2_LIB_PATH="$with_freetype/lib" # User has specified settings
if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -d "$with_freetype/lib/amd64"; then
FREETYPE2_LIBS="-L$with_freetype/lib/amd64 -lfreetype" if test "x$BUNDLE_FREETYPE" = x; then
FREETYPE2_LIB_PATH="$with_freetype/lib/amd64" # If not specified, default is to bundle freetype
BUNDLE_FREETYPE=yes
fi fi
if test "x$OPENJDK_TARGET_OS" = xwindows; then
FREETYPE2_LIBS="$with_freetype/lib/freetype.lib" if test "x$with_freetype" != x; then
POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include"
POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib"
fi fi
FREETYPE2_CFLAGS="-I$with_freetype/include"
if test -s $with_freetype/include/ft2build.h && test -d $with_freetype/include/freetype2/freetype; then # Allow --with-freetype-lib and --with-freetype-include to override
FREETYPE2_CFLAGS="-I$with_freetype/include/freetype2 -I$with_freetype/include" if test "x$with_freetype_include" != x; then
POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include"
fi fi
FREETYPE2_FOUND=yes if test "x$with_freetype_lib" != x; then
if test "x$FREETYPE2_FOUND" = xyes; then POTENTIAL_FREETYPE_LIB_PATH="$with_freetype_lib"
# Verify that the directories exist fi
if ! test -d "$with_freetype/lib" || ! test -d "$with_freetype/include"; then
AC_MSG_ERROR([Could not find the expected directories $with_freetype/lib and $with_freetype/include]) if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x && test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
fi # Okay, we got it. Check that it works.
# List the contents of the lib. LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype])
FREETYPELIB=`ls $with_freetype/lib/libfreetype.so $with_freetype/lib/freetype.dll 2> /dev/null` if test "x$FOUND_FREETYPE" != xyes; then
if test "x$FREETYPELIB" = x; then AC_MSG_ERROR([Can not find or use freetype at location given by --with-freetype])
AC_MSG_ERROR([Could not find libfreetype.so nor freetype.dll in $with_freetype/lib])
fi fi
# Check one h-file else
if ! test -s "$with_freetype/include/ft2build.h"; then # User specified only one of lib or include. This is an error.
AC_MSG_ERROR([Could not find $with_freetype/include/ft2build.h]) if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" = x ; then
AC_MSG_NOTICE([User specified --with-freetype-lib but not --with-freetype-include])
AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.])
else
AC_MSG_NOTICE([User specified --with-freetype-include but not --with-freetype-lib])
AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.])
fi fi
fi fi
fi else
if test "x$FREETYPE2_FOUND" = xno; then # User did not specify settings, but we need freetype. Try to locate it.
BDEPS_CHECK_MODULE(FREETYPE2, freetype2, xxx, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no])
USING_SYSTEM_FT_LIB=true if test "x$BUNDLE_FREETYPE" = x; then
fi # If not specified, default is to bundle freetype only on windows
if test "x$FREETYPE2_FOUND" = xno && test "x$OPENJDK_TARGET_OS" = xwindows; then if test "x$OPENJDK_TARGET_OS" = xwindows; then
FREETYPELOCATION="$PROGRAMFILES/GnuWin32" BUNDLE_FREETYPE=yes
BASIC_FIXUP_PATH(FREETYPELOCATION) else
AC_MSG_CHECKING([for freetype in some standard windows locations]) BUNDLE_FREETYPE=no
if test -s "$FREETYPELOCATION/include/ft2build.h" && test -d "$FREETYPELOCATION/include/freetype2/freetype"; then
FREETYPE2_CFLAGS="-I$FREETYPELOCATION/include/freetype2 -I$FREETYPELOCATION/include"
FREETYPE2_LIBS="$FREETYPELOCATION/lib/freetype.lib"
FREETYPE2_LIB_PATH="$FREETYPELOCATION/lib"
if ! test -s "$FREETYPE2_LIBS"; then
AC_MSG_ERROR([Could not find $FREETYPE2_LIBS])
fi fi
if ! test -s "$FREETYPE2_LIB_PATH/freetype.dll"; then fi
AC_MSG_ERROR([Could not find $FREETYPE2_LIB_PATH/freetype.dll])
if test "x$FOUND_FREETYPE" != xyes; then
# Check builddeps
BDEPS_CHECK_MODULE(FREETYPE, freetype2, xxx, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no])
# BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling.
if test "x$FOUND_FREETYPE" = xyes; then
if test "x$BUNDLE_FREETYPE" = xyes; then
AC_MSG_NOTICE([Found freetype using builddeps, but ignoring since we can not bundle that])
FOUND_FREETYPE=no
else
AC_MSG_CHECKING([for freetype])
AC_MSG_RESULT([yes (using builddeps)])
fi
fi fi
USING_SYSTEM_FT_LIB=true
FREETYPE2_FOUND=yes
fi fi
AC_MSG_RESULT([$FREETYPE2_FOUND])
fi if test "x$FOUND_FREETYPE" != xyes; then
if test "x$FREETYPE2_FOUND" = xno; then # Check modules using pkg-config, but only if we have it (ugly output results otherwise)
PKG_CHECK_MODULES(FREETYPE2, freetype2, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no]) if test "x$PKG_CONFIG" != x; then
# On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. PKG_CHECK_MODULES(FREETYPE, freetype2, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no])
FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's/-lz//g'` if test "x$FOUND_FREETYPE" = xyes; then
USING_SYSTEM_FT_LIB=true # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us.
# 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'`
if test "x$FREETYPE2_FOUND" = xyes && test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64
FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's?/lib?/lib/amd64?g'` if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'`
fi
# BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling.
if test "x$BUNDLE_FREETYPE" = xyes; then
AC_MSG_NOTICE([Found freetype using pkg-config, but ignoring since we can not bundle that])
FOUND_FREETYPE=no
else
AC_MSG_CHECKING([for freetype])
AC_MSG_RESULT([yes (using pkg-config)])
fi
fi
fi
fi fi
fi
if test "x$FREETYPE2_FOUND" = xno; then
AC_MSG_CHECKING([for freetype in some standard locations])
if test -s $SYS_ROOT/usr/X11/include/ft2build.h && test -d $SYS_ROOT/usr/X11/include/freetype2/freetype; then if test "x$FOUND_FREETYPE" != xyes; then
DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/X11/include/freetype2 -I$SYS_ROOT/usr/X11/include" # Check in well-known locations
DEFAULT_FREETYPE_LIBS="-L$SYS_ROOT/usr/X11/lib -lfreetype" if test "x$OPENJDK_TARGET_OS" = xwindows; then
FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32"
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
if test "x$FOUND_FREETYPE" != xyes; then
FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32"
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
fi
else
if test "x$SYS_ROOT" = "x/"; then
FREETYPE_ROOT=
else
FREETYPE_ROOT="$SYS_ROOT"
fi
FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr"
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
if test "x$FOUND_FREETYPE" != xyes; then
FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr/X11"
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
fi
if test "x$FOUND_FREETYPE" != xyes; then
FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr"
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/x86_64-linux-gnu], [well-known location])
else
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/i386-linux-gnu], [well-known location])
if test "x$FOUND_FREETYPE" != xyes; then
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib32], [well-known location])
fi
fi
fi
fi
fi # end check in well-known locations
if test "x$FOUND_FREETYPE" != xyes; then
HELP_MSG_MISSING_DEPENDENCY([freetype])
AC_MSG_ERROR([Could not find freetype! $HELP_MSG ])
fi fi
if test -s $SYS_ROOT/usr/include/ft2build.h && test -d $SYS_ROOT/usr/include/freetype2/freetype; then fi # end user specified settings
DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/include/freetype2"
DEFAULT_FREETYPE_LIBS="-lfreetype" # Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir.
if test "x$FREETYPE_CFLAGS" = x; then
BASIC_FIXUP_PATH(FREETYPE_INCLUDE_PATH)
if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then
FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH/freetype2 -I$FREETYPE_INCLUDE_PATH"
else
FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH"
fi fi
PREV_CXXCFLAGS="$CXXFLAGS"
PREV_LDFLAGS="$LDFLAGS"
CXXFLAGS="$CXXFLAGS $DEFAULT_FREETYPE_CFLAGS"
LDFLAGS="$LDFLAGS $DEFAULT_FREETYPE_LIBS"
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include<ft2build.h>
#include FT_FREETYPE_H
int main() { return 0; }
]])],
[
# Yes, the default cflags and libs did the trick.
FREETYPE2_FOUND=yes
FREETYPE2_CFLAGS="$DEFAULT_FREETYPE_CFLAGS"
FREETYPE2_LIBS="$DEFAULT_FREETYPE_LIBS"
],
[
FREETYPE2_FOUND=no
]
)
CXXCFLAGS="$PREV_CXXFLAGS"
LDFLAGS="$PREV_LDFLAGS"
AC_MSG_RESULT([$FREETYPE2_FOUND])
USING_SYSTEM_FT_LIB=true
fi fi
if test "x$FREETYPE2_FOUND" = xno; then
HELP_MSG_MISSING_DEPENDENCY([freetype2]) if test "x$FREETYPE_LIBS" = x; then
AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ]) BASIC_FIXUP_PATH(FREETYPE_LIB_PATH)
if test "x$OPENJDK_TARGET_OS" = xwindows; then
FREETYPE_LIBS="$FREETYPE_LIB_PATH/freetype.lib"
else
FREETYPE_LIBS="-L$FREETYPE_LIB_PATH -lfreetype"
fi
fi fi
if test "x$OPENJDK_TARGET_OS" != xwindows; then # Try to compile it
# AC_CHECK_LIB does not support use of cl.exe AC_MSG_CHECKING([if we can compile and link with freetype])
PREV_LDFLAGS="$LDFLAGS" AC_LANG_PUSH(C++)
LDFLAGS="$FREETYPE2_LIBS" PREV_CXXCFLAGS="$CXXFLAGS"
AC_CHECK_LIB(freetype, FT_Init_FreeType, PREV_LDFLAGS="$LDFLAGS"
FREETYPE2_FOUND=true, PREV_CXX="$CXX"
AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ])) CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS"
LDFLAGS="$PREV_LDFLAGS" LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
CXX="$FIXPATH $CXX"
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include<ft2build.h>
#include FT_FREETYPE_H
int main () {
FT_Init_FreeType(NULL);
return 0;
}
]])],
[
AC_MSG_RESULT([yes])
],
[
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([Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS])
HELP_MSG_MISSING_DEPENDENCY([freetype])
AC_MSG_ERROR([Can not continue without freetype. $HELP_MSG])
]
)
CXXCFLAGS="$PREV_CXXFLAGS"
LDFLAGS="$PREV_LDFLAGS"
CXX="$PREV_CXX"
AC_LANG_POP(C++)
AC_MSG_CHECKING([if we should bundle freetype])
if test "x$BUNDLE_FREETYPE" = xyes; then
FREETYPE_BUNDLE_LIB_PATH="$FREETYPE_LIB_PATH"
fi fi
fi AC_MSG_RESULT([$BUNDLE_FREETYPE])
fi # end freetype needed
AC_SUBST(USING_SYSTEM_FT_LIB) AC_SUBST(FREETYPE_BUNDLE_LIB_PATH)
AC_SUBST(FREETYPE2_LIB_PATH) AC_SUBST(FREETYPE_CFLAGS)
AC_SUBST(FREETYPE2_CFLAGS) AC_SUBST(FREETYPE_LIBS)
AC_SUBST(FREETYPE2_LIBS)
]) ])
AC_DEFUN_ONCE([LIB_SETUP_ALSA], AC_DEFUN_ONCE([LIB_SETUP_ALSA],
......
...@@ -268,13 +268,9 @@ SJAVAC_SERVER_DIR:=@SJAVAC_SERVER_DIR@ ...@@ -268,13 +268,9 @@ SJAVAC_SERVER_DIR:=@SJAVAC_SERVER_DIR@
# Number of parallel jobs to use for compilation # Number of parallel jobs to use for compilation
JOBS?=@JOBS@ JOBS?=@JOBS@
# The OpenJDK makefiles should be changed to using the standard FREETYPE_LIBS:=@FREETYPE_LIBS@
# configure output ..._CFLAGS and ..._LIBS. In the meantime we FREETYPE_CFLAGS:=@FREETYPE_CFLAGS@
# extract the information here. FREETYPE_BUNDLE_LIB_PATH=@FREETYPE_BUNDLE_LIB_PATH@
FREETYPE2_LIB_PATH:=@FREETYPE2_LIB_PATH@
FREETYPE2_LIBS:=@FREETYPE2_LIBS@
FREETYPE2_CFLAGS:=@FREETYPE2_CFLAGS@
USING_SYSTEM_FT_LIB=@USING_SYSTEM_FT_LIB@
CUPS_CFLAGS:=@CUPS_CFLAGS@ CUPS_CFLAGS:=@CUPS_CFLAGS@
ALSA_LIBS:=@ALSA_LIBS@ ALSA_LIBS:=@ALSA_LIBS@
ALSA_CFLAGS:=@ALSA_CFLAGS@ ALSA_CFLAGS:=@ALSA_CFLAGS@
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册