Bug 1305145 - Move freetype2 detection to Python configure. r=glandium

MozReview-Commit-ID: 1O4SdH0HvzL
This commit is contained in:
Chris Manchester 2016-10-14 11:06:31 -07:00
parent 7d177e214f
commit a3e6682857
2 changed files with 30 additions and 12 deletions

View File

@ -3841,6 +3841,9 @@ if test -n "$MOZ_TREE_FREETYPE"; then
AC_SUBST_LIST(CAIRO_FT_CFLAGS)
fi
AC_SUBST_LIST(FT2_CFLAGS)
AC_SUBST_LIST(FT2_LIBS)
AC_CHECK_PROGS(WGET, wget, "")
AC_SUBST(WGET)
@ -5062,10 +5065,8 @@ AC_SUBST_LIST(GLIB_GMODULE_LIBS)
if test "$USE_FC_FREETYPE"; then
if test "$COMPILE_ENVIRONMENT"; then
dnl ========================================================
dnl = Check for freetype2 and its functionality
dnl = Check for freetype2 functionality
dnl ========================================================
PKG_CHECK_MODULES(FT2, freetype2 >= 6.1.0, _HAVE_FREETYPE2=1, _HAVE_FREETYPE2=)
if test "$_HAVE_FREETYPE2"; then
_SAVE_LIBS="$LIBS"
_SAVE_CFLAGS="$CFLAGS"
@ -5101,12 +5102,7 @@ if test "$USE_FC_FREETYPE"; then
MOZ_CHECK_HEADERS([fontconfig/fcfreetype.h], ,
[AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)], [#include <fontconfig/fontconfig.h>])
CPPFLAGS="$_SAVE_CPPFLAGS"
else
AC_DEFINE(HAVE_FONTCONFIG_FCFREETYPE_H)
fi
FT2_CFLAGS="$FT2_CFLAGS $_FONTCONFIG_CFLAGS"
FT2_LIBS="$FT2_LIBS $_FONTCONFIG_LIBS"
fi
dnl ========================================================

View File

@ -285,10 +285,32 @@ pkg_check_modules('MOZ_PANGO',
fontconfig_info = pkg_check_modules('_FONTCONFIG', 'fontconfig >= 2.7.0',
when=fc_freetype)
add_old_configure_assignment('_FONTCONFIG_CFLAGS',
delayed_getattr(fontconfig_info, 'cflags'))
add_old_configure_assignment('_FONTCONFIG_LIBS',
delayed_getattr(fontconfig_info, 'libs'))
@depends(fc_freetype)
def check_for_freetype2(fc_freetype):
if fc_freetype:
return True
# Check for freetype2. Flags are combined with fontconfig flags.
freetype2_info = pkg_check_modules('_FT2', 'freetype2 >= 6.1.0',
when=check_for_freetype2)
@depends(fontconfig_info, freetype2_info)
def freetype2_combined_info(fontconfig_info, freetype2_info):
if not freetype2_info:
return
if not fontconfig_info:
return freetype2_info
return namespace(
cflags=freetype2_info.cflags + fontconfig_info.cflags,
libs=freetype2_info.libs + fontconfig_info.libs,
)
add_old_configure_assignment('_HAVE_FREETYPE2',
depends_if(freetype2_info)(lambda _: True))
add_old_configure_assignment('FT2_LIBS',
delayed_getattr(freetype2_combined_info, 'libs'))
add_old_configure_assignment('FT2_CFLAGS',
delayed_getattr(freetype2_combined_info, 'cflags'))
# Apple platform decoder support