configure: Use the pkg-config helper macro for freetype.

This commit is contained in:
Alexandre Julliard 2013-05-03 17:31:23 +02:00
parent f54b85817b
commit 100806e473
4 changed files with 45 additions and 88 deletions

94
configure vendored
View File

@ -650,9 +650,8 @@ GSTREAMER_INCL
GSTREAMER_LIBS GSTREAMER_LIBS
LIBGETTEXTPO LIBGETTEXTPO
ZLIB ZLIB
FREETYPEINCL FREETYPE_LIBS
FREETYPELIBS FREETYPE_CFLAGS
ft_devel
LCMSLIBS LCMSLIBS
RESOLVLIBS RESOLVLIBS
GPHOTO2_LIBS GPHOTO2_LIBS
@ -874,7 +873,9 @@ GNUTLS_LIBS
SANE_CFLAGS SANE_CFLAGS
SANE_LIBS SANE_LIBS
GPHOTO2_CFLAGS GPHOTO2_CFLAGS
GPHOTO2_LIBS' GPHOTO2_LIBS
FREETYPE_CFLAGS
FREETYPE_LIBS'
# Initialize some variables set by options. # Initialize some variables set by options.
@ -1579,6 +1580,10 @@ Some influential environment variables:
C compiler flags for libgphoto2, overriding pkg-config C compiler flags for libgphoto2, overriding pkg-config
GPHOTO2_LIBS GPHOTO2_LIBS
Linker flags for libgphoto2, overriding pkg-config Linker flags for libgphoto2, overriding pkg-config
FREETYPE_CFLAGS
C compiler flags for freetype2, overriding pkg-config
FREETYPE_LIBS
Linker flags for freetype2, overriding pkg-config
Use these variables to override the choices made by `configure' or to help Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations. it to find libraries and programs with nonstandard names/locations.
@ -10809,68 +10814,28 @@ fi
if test "x$with_freetype" != "xno" if test "x$with_freetype" != "xno"
then then
if test "$PKG_CONFIG" != "false" ac_save_CPPFLAGS="$CPPFLAGS"
then if test -n "$FREETYPE_CFLAGS"; then :
ac_freetype_incl="`$PKG_CONFIG --cflags freetype2 2>/dev/null`"
ac_freetype_libs="`$PKG_CONFIG --libs freetype2 2>/dev/null`"
else
for ac_prog in freetype-config freetype2-config
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; 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_ft_devel+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ft_devel"; then
ac_cv_prog_ft_devel="$ft_devel" # 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_ft_devel="$ac_prog"
$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
elif test -n "$PKG_CONFIG"; then :
FREETYPE_CFLAGS=`$PKG_CONFIG --cflags freetype2 2>/dev/null`
fi fi
FREETYPE_CFLAGS=${FREETYPE_CFLAGS:-`(freetype-config --cflags || freetype2-config --cflags) 2>/dev/null`}
CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
if test -n "$FREETYPE_LIBS"; then :
elif test -n "$PKG_CONFIG"; then :
FREETYPE_LIBS=`$PKG_CONFIG --libs freetype2 2>/dev/null`
fi fi
ft_devel=$ac_cv_prog_ft_devel FREETYPE_LIBS=${FREETYPE_LIBS:-`(freetype-config --libs || freetype2-config --libs) 2>/dev/null`}
if test -n "$ft_devel"; then FREETYPE_LIBS=${FREETYPE_LIBS:-"-lfreetype"}
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ft_devel" >&5
$as_echo "$ft_devel" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$ft_devel" && break
done
test -n "$ft_devel" || ft_devel="no"
if test "$ft_devel" != "no"
then
ac_freetype_incl=`$ft_devel --cflags`
ac_freetype_libs=`$ft_devel --libs`
fi
fi
ac_freetype_libs=${ac_freetype_libs:-"-lfreetype"}
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lfreetype" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lfreetype" >&5
$as_echo_n "checking for -lfreetype... " >&6; } $as_echo_n "checking for -lfreetype... " >&6; }
if ${ac_cv_lib_soname_freetype+:} false; then : if ${ac_cv_lib_soname_freetype+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
ac_check_soname_save_LIBS=$LIBS ac_check_soname_save_LIBS=$LIBS
LIBS="-lfreetype $ac_freetype_libs $LIBS" LIBS="-lfreetype $FREETYPE_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
@ -10919,8 +10884,6 @@ _ACEOF
fi fi
if test "$ft_lib" = "yes" if test "$ft_lib" = "yes"
then then
ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$ac_freetype_incl $CPPFLAGS"
for ac_header in ft2build.h \ for ac_header in ft2build.h \
freetype/freetype.h \ freetype/freetype.h \
freetype/ftglyph.h \ freetype/ftglyph.h \
@ -10977,21 +10940,22 @@ fi
$as_echo "#define HAVE_FREETYPE 1" >>confdefs.h $as_echo "#define HAVE_FREETYPE 1" >>confdefs.h
FREETYPELIBS="$ac_freetype_libs" else
FREETYPE_LIBS=""
FREETYPEINCL="$ac_freetype_incl"
fi fi
else
FREETYPE_LIBS=""
fi fi
CPPFLAGS="$ac_save_CPPFLAGS"
fi fi
if test "x$FREETYPELIBS" = "x"; then : if test "x$ac_cv_header_freetype_freetype_h" != xyes -o "x$wine_cv_fttrigon" != xyes; then :
case "x$with_freetype" in case "x$with_freetype" in
xno) ;; xno) ;;
*) as_fn_error $? "FreeType ${notice_platform}development files not found. Fonts will not be built. *) as_fn_error $? "FreeType ${notice_platform}development files not found. Fonts will not be built.
Use the --without-freetype option if you really want this." "$LINENO" 5 ;; Use the --without-freetype option if you really want this." "$LINENO" 5 ;;
esac esac
fi fi
test "x$FREETYPELIBS" = "x" && enable_fonts=${enable_fonts:-no} test "x$ac_cv_header_freetype_freetype_h" = xyes -a "x$wine_cv_fttrigon" = xyes || enable_fonts=${enable_fonts:-no}
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for parport header/ppdev.h" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for parport header/ppdev.h" >&5
$as_echo_n "checking for parport header/ppdev.h... " >&6; } $as_echo_n "checking for parport header/ppdev.h... " >&6; }

View File

@ -1448,24 +1448,13 @@ WINE_NOTICE_WITH(cms,[test "$ac_cv_lib_lcms_cmsOpenProfileFromFile" != "yes"],
dnl **** Check for FreeType 2 **** dnl **** Check for FreeType 2 ****
if test "x$with_freetype" != "xno" if test "x$with_freetype" != "xno"
then then
if test "$PKG_CONFIG" != "false" ac_save_CPPFLAGS="$CPPFLAGS"
then WINE_PACKAGE_FLAGS(FREETYPE,[freetype2],[-lfreetype],
ac_freetype_incl="`$PKG_CONFIG --cflags freetype2 2>/dev/null`" [(freetype-config --cflags || freetype2-config --cflags)],
ac_freetype_libs="`$PKG_CONFIG --libs freetype2 2>/dev/null`" [(freetype-config --libs || freetype2-config --libs)])
else WINE_CHECK_SONAME(freetype,FT_Init_FreeType,[ft_lib=yes],[ft_lib=no],[$FREETYPE_LIBS])
AC_CHECK_PROGS(ft_devel,[freetype-config freetype2-config],no)
if test "$ft_devel" != "no"
then
ac_freetype_incl=`$ft_devel --cflags`
ac_freetype_libs=`$ft_devel --libs`
fi
fi
ac_freetype_libs=${ac_freetype_libs:-"-lfreetype"}
WINE_CHECK_SONAME(freetype,FT_Init_FreeType,[ft_lib=yes],[ft_lib=no],[$ac_freetype_libs])
if test "$ft_lib" = "yes" if test "$ft_lib" = "yes"
then then
ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$ac_freetype_incl $CPPFLAGS"
AC_CHECK_HEADERS(ft2build.h \ AC_CHECK_HEADERS(ft2build.h \
freetype/freetype.h \ freetype/freetype.h \
freetype/ftglyph.h \ freetype/ftglyph.h \
@ -1489,13 +1478,17 @@ then
if test "$ac_cv_header_freetype_freetype_h" = "yes" -a "$wine_cv_fttrigon" = "yes" if test "$ac_cv_header_freetype_freetype_h" = "yes" -a "$wine_cv_fttrigon" = "yes"
then then
AC_DEFINE(HAVE_FREETYPE, 1, [Define if FreeType 2 is installed]) AC_DEFINE(HAVE_FREETYPE, 1, [Define if FreeType 2 is installed])
AC_SUBST(FREETYPELIBS,"$ac_freetype_libs") else
AC_SUBST(FREETYPEINCL,"$ac_freetype_incl") FREETYPE_LIBS=""
fi fi
else
FREETYPE_LIBS=""
fi fi
CPPFLAGS="$ac_save_CPPFLAGS"
fi fi
WINE_ERROR_WITH(freetype,[test "x$FREETYPELIBS" = "x"],[FreeType ${notice_platform}development files not found. Fonts will not be built.]) WINE_ERROR_WITH(freetype,[test "x$ac_cv_header_freetype_freetype_h" != xyes -o "x$wine_cv_fttrigon" != xyes],
test "x$FREETYPELIBS" = "x" && enable_fonts=${enable_fonts:-no} [FreeType ${notice_platform}development files not found. Fonts will not be built.])
test "x$ac_cv_header_freetype_freetype_h" = xyes -a "x$wine_cv_fttrigon" = xyes || enable_fonts=${enable_fonts:-no}
dnl **** Check for parport (currently Linux only) **** dnl **** Check for parport (currently Linux only) ****
AC_CACHE_CHECK([for parport header/ppdev.h], ac_cv_c_ppdev, AC_CACHE_CHECK([for parport header/ppdev.h], ac_cv_c_ppdev,

View File

@ -2,7 +2,7 @@ EXTRADEFS = -D_GDI32_
MODULE = gdi32.dll MODULE = gdi32.dll
IMPORTLIB = gdi32 IMPORTLIB = gdi32
IMPORTS = advapi32 IMPORTS = advapi32
EXTRAINCL = @FREETYPEINCL@ @FONTCONFIGINCL@ EXTRAINCL = @FREETYPE_CFLAGS@ @FONTCONFIGINCL@
EXTRALIBS = @CARBONLIB@ EXTRALIBS = @CARBONLIB@
DELAYIMPORTS = usp10 DELAYIMPORTS = usp10

View File

@ -1,6 +1,6 @@
DEFS = -D__WINESRC__ $(EXTRADEFS) DEFS = -D__WINESRC__ $(EXTRADEFS)
EXTRAINCL = @FREETYPEINCL@ EXTRAINCL = @FREETYPE_CFLAGS@
FREETYPELIBS = @FREETYPELIBS@ FREETYPELIBS = @FREETYPE_LIBS@
PROGRAMS = \ PROGRAMS = \
fnt2fon$(EXEEXT) \ fnt2fon$(EXEEXT) \