configure: Add a pkg-config check for fontconfig.

This commit is contained in:
Alexandre Julliard 2014-01-30 11:39:48 +01:00
parent 8aa64e3580
commit db2be9dc0b
3 changed files with 45 additions and 88 deletions

94
configure vendored
View File

@ -645,7 +645,8 @@ PNG_LIBS
PNG_CFLAGS PNG_CFLAGS
JPEG_LIBS JPEG_LIBS
JPEG_CFLAGS JPEG_CFLAGS
FONTCONFIGINCL FONTCONFIG_LIBS
FONTCONFIG_CFLAGS
CUPSINCL CUPSINCL
CAPI20_LIBS CAPI20_LIBS
CAPI20_CFLAGS CAPI20_CFLAGS
@ -1385,6 +1386,8 @@ GSTREAMER_CFLAGS
GSTREAMER_LIBS GSTREAMER_LIBS
CAPI20_CFLAGS CAPI20_CFLAGS
CAPI20_LIBS CAPI20_LIBS
FONTCONFIG_CFLAGS
FONTCONFIG_LIBS
JPEG_CFLAGS JPEG_CFLAGS
JPEG_LIBS JPEG_LIBS
PNG_CFLAGS PNG_CFLAGS
@ -2116,6 +2119,10 @@ Some influential environment variables:
CAPI20_CFLAGS CAPI20_CFLAGS
C compiler flags for capi20, overriding pkg-config C compiler flags for capi20, overriding pkg-config
CAPI20_LIBS Linker flags for capi20, overriding pkg-config CAPI20_LIBS Linker flags for capi20, overriding pkg-config
FONTCONFIG_CFLAGS
C compiler flags for fontconfig, overriding pkg-config
FONTCONFIG_LIBS
Linker flags for fontconfig, overriding pkg-config
JPEG_CFLAGS C compiler flags for libjpeg, overriding pkg-config JPEG_CFLAGS C compiler flags for libjpeg, overriding pkg-config
JPEG_LIBS Linker flags for libjpeg, overriding pkg-config JPEG_LIBS Linker flags for libjpeg, overriding pkg-config
PNG_CFLAGS C compiler flags for libpng, overriding pkg-config PNG_CFLAGS C compiler flags for libpng, overriding pkg-config
@ -5902,8 +5909,6 @@ OPENGL_LIBS=""
test "x$with_fontconfig" != "xno" || ac_cv_header_fontconfig_fontconfig_h=no
# Check whether --enable-largefile was given. # Check whether --enable-largefile was given.
if test "${enable_largefile+set}" = set; then : if test "${enable_largefile+set}" = set; then :
enableval=$enable_largefile; enableval=$enable_largefile;
@ -6402,7 +6407,6 @@ for ac_header in \
elf.h \ elf.h \
float.h \ float.h \
fnmatch.h \ fnmatch.h \
fontconfig/fontconfig.h \
getopt.h \ getopt.h \
gettext-po.h \ gettext-po.h \
grp.h \ grp.h \
@ -12465,66 +12469,23 @@ This is an error since --with-cups was requested." "$LINENO" 5 ;;
esac esac
fi fi
if test "$ac_cv_header_fontconfig_fontconfig_h" = "yes" if test "x$with_fontconfig" != "xno"
then then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lfontconfig" >&5 if test -n "$FONTCONFIG_CFLAGS"; then :
$as_echo_n "checking for -lfontconfig... " >&6; }
if ${ac_cv_lib_soname_fontconfig+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_soname_save_LIBS=$LIBS
LIBS="-lfontconfig $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error. elif test -n "$PKG_CONFIG"; then :
Use char because int might match the return type of a GCC FONTCONFIG_CFLAGS=`$PKG_CONFIG --cflags fontconfig 2>/dev/null`
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char FcInit ();
int
main ()
{
return FcInit ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
case "$LIBEXT" in
dll) ac_cv_lib_soname_fontconfig=`$ac_cv_path_LDD conftest.exe | grep "fontconfig" | sed -e "s/dll.*/dll/"';2,$d'` ;;
dylib) ac_cv_lib_soname_fontconfig=`otool -L conftest$ac_exeext | grep "libfontconfig\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libfontconfig\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
*) ac_cv_lib_soname_fontconfig=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libfontconfig\\.$LIBEXT" | sed -e "s/^.*\\[\\(libfontconfig\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'`
if test "x$ac_cv_lib_soname_fontconfig" = x; then :
ac_cv_lib_soname_fontconfig=`$LDD conftest$ac_exeext | grep "libfontconfig\\.$LIBEXT" | sed -e "s/^.*\(libfontconfig\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'`
fi ;;
esac
fi fi
rm -f core conftest.err conftest.$ac_objext \ test "$cross_compiling" = yes || FONTCONFIG_CFLAGS=${FONTCONFIG_CFLAGS:-$X_CFLAGS}
conftest$ac_exeext conftest.$ac_ext if test -n "$FONTCONFIG_LIBS"; then :
LIBS=$ac_check_soname_save_LIBS
elif test -n "$PKG_CONFIG"; then :
FONTCONFIG_LIBS=`$PKG_CONFIG --libs fontconfig 2>/dev/null`
fi fi
if test "x$ac_cv_lib_soname_fontconfig" = "x"; then : test "$cross_compiling" = yes || FONTCONFIG_LIBS=${FONTCONFIG_LIBS:-$X_LIBS}
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
$as_echo "not found" >&6; }
else ac_save_CPPFLAGS=$CPPFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_fontconfig" >&5 CPPFLAGS="$CPPFLAGS $FONTCONFIG_CFLAGS"
$as_echo "$ac_cv_lib_soname_fontconfig" >&6; }
cat >>confdefs.h <<_ACEOF
#define SONAME_LIBFONTCONFIG "$ac_cv_lib_soname_fontconfig"
_ACEOF
fi
elif test -n "$X_CFLAGS" -a "x$with_fontconfig" != "xno"
then
ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
$as_unset ac_cv_header_fontconfig_fontconfig_h
for ac_header in fontconfig/fontconfig.h for ac_header in fontconfig/fontconfig.h
do : do :
ac_fn_c_check_header_mongrel "$LINENO" "fontconfig/fontconfig.h" "ac_cv_header_fontconfig_fontconfig_h" "$ac_includes_default" ac_fn_c_check_header_mongrel "$LINENO" "fontconfig/fontconfig.h" "ac_cv_header_fontconfig_fontconfig_h" "$ac_includes_default"
@ -12537,18 +12498,15 @@ fi
done done
CPPFLAGS="$ac_save_CPPFLAGS"
if test "$ac_cv_header_fontconfig_fontconfig_h" = "yes" if test "$ac_cv_header_fontconfig_fontconfig_h" = "yes"
then then
FONTCONFIGINCL="$X_CFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lfontconfig" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lfontconfig" >&5
$as_echo_n "checking for -lfontconfig... " >&6; } $as_echo_n "checking for -lfontconfig... " >&6; }
if ${ac_cv_lib_soname_fontconfig+:} false; then : if ${ac_cv_lib_soname_fontconfig+:} 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="-lfontconfig $X_LIBS $LIBS" LIBS="-lfontconfig $FONTCONFIG_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
@ -12584,7 +12542,7 @@ fi
if test "x$ac_cv_lib_soname_fontconfig" = "x"; then : if test "x$ac_cv_lib_soname_fontconfig" = "x"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
$as_echo "not found" >&6; } $as_echo "not found" >&6; }
FONTCONFIG_CFLAGS=""
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_fontconfig" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_fontconfig" >&5
$as_echo "$ac_cv_lib_soname_fontconfig" >&6; } $as_echo "$ac_cv_lib_soname_fontconfig" >&6; }
@ -12595,7 +12553,13 @@ _ACEOF
fi fi
else
FONTCONFIG_CFLAGS=""
fi fi
CPPFLAGS=$ac_save_CPPFLAGS
test -z "$FONTCONFIG_CFLAGS" || FONTCONFIG_CFLAGS=`echo " $FONTCONFIG_CFLAGS" | sed 's/ -I\([^/]\)/ -I\$(top_builddir)\/\1/g'`
test -z "$FONTCONFIG_LIBS" || FONTCONFIG_LIBS=`echo " $FONTCONFIG_LIBS" | sed 's/ -L\([^/]\)/ -L\$(top_builddir)\/\1/g'`
fi fi
if test "x$ac_cv_lib_soname_fontconfig" = "x"; then : if test "x$ac_cv_lib_soname_fontconfig" = "x"; then :
case "x$with_fontconfig" in case "x$with_fontconfig" in
@ -16492,6 +16456,8 @@ GSTREAMER_CFLAGS = $GSTREAMER_CFLAGS
GSTREAMER_LIBS = $GSTREAMER_LIBS GSTREAMER_LIBS = $GSTREAMER_LIBS
CAPI20_CFLAGS = $CAPI20_CFLAGS CAPI20_CFLAGS = $CAPI20_CFLAGS
CAPI20_LIBS = $CAPI20_LIBS CAPI20_LIBS = $CAPI20_LIBS
FONTCONFIG_CFLAGS = $FONTCONFIG_CFLAGS
FONTCONFIG_LIBS = $FONTCONFIG_LIBS
JPEG_CFLAGS = $JPEG_CFLAGS JPEG_CFLAGS = $JPEG_CFLAGS
JPEG_LIBS = $JPEG_LIBS JPEG_LIBS = $JPEG_LIBS
PNG_CFLAGS = $PNG_CFLAGS PNG_CFLAGS = $PNG_CFLAGS

View File

@ -373,8 +373,6 @@ AC_SUBST(OPENGL_LIBS,"")
dnl **** Check for header files **** dnl **** Check for header files ****
test "x$with_fontconfig" != "xno" || ac_cv_header_fontconfig_fontconfig_h=no
AC_SYS_LARGEFILE() AC_SYS_LARGEFILE()
AC_CHECK_HEADERS(\ AC_CHECK_HEADERS(\
@ -407,7 +405,6 @@ AC_CHECK_HEADERS(\
elf.h \ elf.h \
float.h \ float.h \
fnmatch.h \ fnmatch.h \
fontconfig/fontconfig.h \
getopt.h \ getopt.h \
gettext-po.h \ gettext-po.h \
grp.h \ grp.h \
@ -1616,22 +1613,16 @@ WINE_NOTICE_WITH(cups,[test "x$ac_cv_lib_soname_cups" = "x"],
[libcups ${notice_platform}development files not found, CUPS won't be supported.]) [libcups ${notice_platform}development files not found, CUPS won't be supported.])
dnl **** Check for fontconfig **** dnl **** Check for fontconfig ****
if test "x$with_fontconfig" != "xno"
then
WINE_PACKAGE_FLAGS(FONTCONFIG,[fontconfig],,[$X_CFLAGS],[$X_LIBS],
[AC_CHECK_HEADERS([fontconfig/fontconfig.h])
if test "$ac_cv_header_fontconfig_fontconfig_h" = "yes" if test "$ac_cv_header_fontconfig_fontconfig_h" = "yes"
then then
WINE_CHECK_SONAME(fontconfig,FcInit) WINE_CHECK_SONAME(fontconfig,FcInit,,[FONTCONFIG_CFLAGS=""],[$FONTCONFIG_LIBS])
elif test -n "$X_CFLAGS" -a "x$with_fontconfig" != "xno" else
then FONTCONFIG_CFLAGS=""
dnl fontconfig is in the X directory on Mac OS X fi])
ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
$as_unset ac_cv_header_fontconfig_fontconfig_h
AC_CHECK_HEADERS([fontconfig/fontconfig.h])
CPPFLAGS="$ac_save_CPPFLAGS"
if test "$ac_cv_header_fontconfig_fontconfig_h" = "yes"
then
AC_SUBST(FONTCONFIGINCL,"$X_CFLAGS")
WINE_CHECK_SONAME(fontconfig,FcInit,,,[$X_LIBS])
fi
fi fi
WINE_NOTICE_WITH(fontconfig,[test "x$ac_cv_lib_soname_fontconfig" = "x"], WINE_NOTICE_WITH(fontconfig,[test "x$ac_cv_lib_soname_fontconfig" = "x"],
[fontconfig ${notice_platform}development files not found, fontconfig won't be supported.]) [fontconfig ${notice_platform}development files not found, fontconfig won't be supported.])

View File

@ -2,7 +2,7 @@ EXTRADEFS = -D_GDI32_
MODULE = gdi32.dll MODULE = gdi32.dll
IMPORTLIB = gdi32 IMPORTLIB = gdi32
IMPORTS = advapi32 IMPORTS = advapi32
EXTRAINCL = $(FREETYPE_CFLAGS) @FONTCONFIGINCL@ EXTRAINCL = $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS)
EXTRALIBS = @CARBONLIB@ @APPKITLIB@ EXTRALIBS = @CARBONLIB@ @APPKITLIB@
DELAYIMPORTS = usp10 DELAYIMPORTS = usp10