Skip to content

Commit

Permalink
Bug 496244 – Don't use freetype-config, use pkg-config
Browse files Browse the repository at this point in the history
2008-01-29  Behdad Esfahbod  <[email protected]>

        Bug 496244 – Don't use freetype-config, use pkg-config

        * configure.in:
        Don't use freetype-config.  Also cleanup lots of old stale macros
        around configure.in.

        * pango-uninstalled.pc.in:
        * pango.pc.in:
        * pangocairo-uninstalled.pc.in:
        * pangocairo.pc.in:
        * pangoft2-uninstalled.pc.in:
        * pangoft2.pc.in:
        * pangowin32.pc.in:
        * pangox-uninstalled.pc.in:
        * pangox.pc.in:
        * pangoxft-uninstalled.pc.in:
        * pangoxft.pc.in:
        And cleaned up all the pkg-config files as a result.


svn path=/trunk/; revision=2559
  • Loading branch information
behdad authored and Behdad Esfahbod committed Jan 29, 2008
1 parent bfa586f commit 701bdf2
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 106 deletions.
143 changes: 64 additions & 79 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -222,44 +222,28 @@ have_xft=false
#
PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 1.0.1, have_fontconfig=true, AC_MSG_RESULT([no]))

#
# Checks for FreeType
#
if $have_fontconfig ; then
#
# Checks for FreeType
#
FREETYPE_LIBS=
FREETYPE_CFLAGS=
AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
if test "x$FREETYPE_CONFIG" != "xno" ; then
FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`

pango_save_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
AC_CHECK_LIB(freetype, FT_Get_Next_Char, have_freetype=true, :)
LDFLAGS=$pango_save_ldflags
fi

FREETYPE_LIBS="$FONTCONFIG_LIBS $FREETYPE_LIBS"
FREETYPE_CFLAGS="$FONTCONFIG_CFLAGS $FREETYPE_CFLAGS"

AC_SUBST(FREETYPE_LIBS)
AC_SUBST(FREETYPE_CFLAGS)
# The first version of freetype with a .pc file is 2.1.5. That's recent
# enough for all the functions we use I guess. No version check needed.
PKG_CHECK_MODULES(FREETYPE, freetype2, have_freetype=true, AC_MSG_RESULT([no]))
fi
if $have_freetype ; then
AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library])

#
# Checks for Xft/XRender
#
if $have_x && $have_freetype ; then
PKG_CHECK_MODULES(XFT, xft >= 2.0.0 xrender, have_xft=true, AC_MSG_RESULT([no]))
if $have_xft ; then
AC_DEFINE(HAVE_XFT, 1, [Have Xft library])
fi
fi
elif test "x$pango_os_win32" != xyes; then
AC_MSG_WARN([No fontconfig found, skipping tests for FreeType and Xft])
fi

AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype)

#
# Checks for Xft/XRender
#
if $have_x && $have_freetype ; then
PKG_CHECK_MODULES(XFT, xft >= 2.0.0 xrender, have_xft=true, AC_MSG_RESULT([no]))
fi
if $have_xft ; then
AC_DEFINE(HAVE_XFT, 1, [Have Xft library])
fi
AM_CONDITIONAL(HAVE_XFT, $have_xft)

#
Expand Down Expand Up @@ -345,48 +329,54 @@ if $have_cairo ; then
pango_save_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS $INSTALLED_CAIRO_LIBS"

PKG_CHECK_EXISTS(cairo-png >= $cairo_required, have_cairo_png=true, :)
if $have_cairo_png; then
AC_DEFINE(HAVE_CAIRO_PNG, 1, [Whether Cairo has PNG support])
fi

PKG_CHECK_EXISTS(cairo-ps >= $cairo_required, have_cairo_ps=true, :)
if $have_cairo_ps; then
AC_DEFINE(HAVE_CAIRO_PS, 1, [Whether Cairo has PS support])
fi

PKG_CHECK_EXISTS(cairo-pdf >= $cairo_required, have_cairo_pdf=true, :)
if $have_cairo_pdf; then
AC_DEFINE(HAVE_CAIRO_PDF, 1, [Whether Cairo has PDF support])
fi

PKG_CHECK_EXISTS(cairo-xlib >= $cairo_required, have_cairo_xlib=true, :)
if $have_cairo_xlib; then
AC_DEFINE(HAVE_CAIRO_XLIB, 1, [Whether Cairo has Xlib support])
fi

have_cairo=false

PKG_CHECK_EXISTS(cairo-win32 >= $cairo_required, have_cairo_win32=true, :)
if $have_cairo_win32 && $have_win32; then
if $have_win32; then
PKG_CHECK_EXISTS(cairo-win32 >= $cairo_required, have_cairo_win32=true, :)
fi
if $have_cairo_win32; then
AC_DEFINE(HAVE_CAIRO_WIN32, 1, [Whether Cairo uses the Win32 GDI for fonts])
have_cairo=true
fi

PKG_CHECK_EXISTS(cairo-ft >= $cairo_required, have_cairo_freetype=true, :)
if $have_cairo_freetype && $have_freetype ; then
if $have_freetype; then
PKG_CHECK_EXISTS(cairo-ft >= $cairo_required, have_cairo_freetype=true, :)
fi
if $have_cairo_freetype; then
AC_DEFINE(HAVE_CAIRO_FREETYPE, 1, [Whether Cairo uses FreeType for fonts])
have_cairo=true
fi

PKG_CHECK_EXISTS(cairo-atsui >= $cairo_required, have_cairo_atsui=true, :)
if $have_cairo_atsui && $have_atsui ; then
if $have_atsui; then
PKG_CHECK_EXISTS(cairo-atsui >= $cairo_required, have_cairo_atsui=true, :)
fi
if $have_cairo_atsui; then
AC_DEFINE(HAVE_CAIRO_ATSUI, 1, [Whether Cairo uses ATSUI for fonts])
have_cairo=true
fi

if $have_cairo ; then
AC_DEFINE(HAVE_CAIRO, 1, [Have usable Cairo library and font backend])

PKG_CHECK_EXISTS(cairo-png >= $cairo_required, have_cairo_png=true, :)
if $have_cairo_png; then
AC_DEFINE(HAVE_CAIRO_PNG, 1, [Whether Cairo has PNG support])
fi

PKG_CHECK_EXISTS(cairo-ps >= $cairo_required, have_cairo_ps=true, :)
if $have_cairo_ps; then
AC_DEFINE(HAVE_CAIRO_PS, 1, [Whether Cairo has PS support])
fi

PKG_CHECK_EXISTS(cairo-pdf >= $cairo_required, have_cairo_pdf=true, :)
if $have_cairo_pdf; then
AC_DEFINE(HAVE_CAIRO_PDF, 1, [Whether Cairo has PDF support])
fi

PKG_CHECK_EXISTS(cairo-xlib >= $cairo_required, have_cairo_xlib=true, :)
if $have_cairo_xlib; then
AC_DEFINE(HAVE_CAIRO_XLIB, 1, [Whether Cairo has Xlib support])
fi
fi

LIBS=$pango_save_libs
Expand All @@ -398,18 +388,18 @@ AM_CONDITIONAL(HAVE_CAIRO_PNG, $have_cairo_png)
AM_CONDITIONAL(HAVE_CAIRO_PS, $have_cairo_ps)
AM_CONDITIONAL(HAVE_CAIRO_PDF, $have_cairo_pdf)
AM_CONDITIONAL(HAVE_CAIRO_XLIB, $have_cairo_xlib)
AM_CONDITIONAL(HAVE_CAIRO_WIN32, $have_cairo_win32 && $have_win32)
AM_CONDITIONAL(HAVE_CAIRO_FREETYPE, $have_cairo_freetype && $have_freetype)
AM_CONDITIONAL(HAVE_CAIRO_ATSUI, $have_cairo_atsui && $have_atsui)
AM_CONDITIONAL(HAVE_CAIRO_WIN32, $have_cairo_win32)
AM_CONDITIONAL(HAVE_CAIRO_FREETYPE, $have_cairo_freetype)
AM_CONDITIONAL(HAVE_CAIRO_ATSUI, $have_cairo_atsui)

#
# We must have some backend defined, in order for the pango-querymodules
# rule in pango/Makefile.am to work correctly. If you are up to writing
# a new Pango backend outside of Pango, you are up to sending the necessary
# patch to fix that rule. :-)
#
if $have_freetype || $have_x || $have_xft || $have_win32 || $have_cairo_atsui ; then : ; else
AC_MSG_ERROR([*** Didn't find any of FreeType, X11, ATSUI, or Win32.
if $have_freetype || $have_x || $have_xft || $have_cairo; then : ; else
AC_MSG_ERROR([*** Could not enable any of FreeType, X11, Cairo, or Win32 backends.
*** Must have at least one backend to build Pango.])
fi

Expand Down Expand Up @@ -683,28 +673,23 @@ case $enable_explicit_deps in
esac
AC_MSG_RESULT($enable_explicit_deps)

PKGCONFIG_X_LIBS=
PKGCONFIG_XFT_LIBS=
PKGCONFIG_FREETYPE_LIBS=
PKGCONFIG_MATH_LIBS=
PKGCONFIG_CAIRO_LIBS=
PKGCONFIG_CAIRO_REQUIRES=

if test $enable_explicit_deps = yes ; then
PKGCONFIG_X_LIBS="$X_LIBS $X_EXTRA_LIBS"
PKGCONFIG_XFT_LIBS=$XFT_LIBS
PKGCONFIG_FREETYPE_LIBS=$FREETYPE_LIBS
PKGCONFIG_MATH_LIBS=-lm
PKGCONFIG_CAIRO_LIBS=$FREETYPE_LIBS
if $have_cairo_freetype ; then
PKGCONFIG_CAIRO_REQUIRES=pangoft2

X_LIBS="$X_LIBS $X_EXTRA_LIBS"

if $have_cairo_freetype; then
PKGCONFIG_CAIRO_REQUIRES="$PKGCONFIG_CAIRO_REQUIRES pangoft2"
fi
if $have_cairo_win32; then
PKGCONFIG_CAIRO_REQUIRES="$PKGCONFIG_CAIRO_REQUIRES pangowin32"
fi
fi

AC_SUBST(PKGCONFIG_X_LIBS)
AC_SUBST(PKGCONFIG_XFT_LIBS)
AC_SUBST(PKGCONFIG_FREETYPE_LIBS)
AC_SUBST(PKGCONFIG_MATH_LIBS)
AC_SUBST(PKGCONFIG_CAIRO_LIBS)
AC_SUBST(PKGCONFIG_CAIRO_REQUIRES)
AM_CONDITIONAL(DISABLE_EXPLICIT_DEPS, test $enable_explicit_deps = no)

Expand Down
3 changes: 1 addition & 2 deletions pango-uninstalled.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ Name: Pango Uninstalled
Description: Internationalized text handling, Not Installed
Version: @VERSION@
Requires: glib-2.0,gobject-2.0,gmodule-no-export-2.0
Libs: ${pc_top_builddir}/${pcfiledir}/pango/libpango-@[email protected]
Libs: ${pc_top_builddir}/${pcfiledir}/pango/libpango-@[email protected] @PKGCONFIG_MATH_LIBS@
Cflags: -I${pc_top_builddir}/${pcfiledir}/@srcdir@

1 change: 0 additions & 1 deletion pango.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ Version: @VERSION@
Requires: glib-2.0,gobject-2.0,gmodule-no-export-2.0
Libs: -L${libdir} -lpango-@PANGO_API_VERSION@ @PKGCONFIG_MATH_LIBS@
Cflags: -I${includedir}/pango-1.0

3 changes: 1 addition & 2 deletions pangocairo-uninstalled.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ Name: Pango Cairo Uninstalled
Description: Cairo rendering support for Pango, Not Installed
Version: @VERSION@
Requires: pango cairo @PKGCONFIG_CAIRO_REQUIRES@
Libs: ${pc_top_builddir}/${pcfiledir}/pango/libpangocairo-@[email protected] @PKGCONFIG_CAIRO_LIBS@
Libs: ${pc_top_builddir}/${pcfiledir}/pango/libpangocairo-@[email protected]
Cflags: -I${pc_top_builddir}/${pcfiledir}/@srcdir@

2 changes: 1 addition & 1 deletion pangocairo.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Name: Pango Cairo
Description: Cairo rendering support for Pango
Version: @VERSION@
Requires: pango cairo @PKGCONFIG_CAIRO_REQUIRES@
Libs: -L${libdir} -lpangocairo-@PANGO_API_VERSION@ @PKGCONFIG_CAIRO_LIBS@
Libs: -L${libdir} -lpangocairo-@PANGO_API_VERSION@
Cflags: -I${includedir}/pango-1.0
6 changes: 3 additions & 3 deletions pangoft2-uninstalled.pc.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Name: Pango FT2 Uninstalled
Description: Freetype 2.0 font support for Pango, Not Installed
Version: @VERSION@
Requires: pango
Libs: ${pc_top_builddir}/${pcfiledir}/pango/libpangoft2-@[email protected] @FREETYPE_LIBS@
Cflags: -I${pc_top_builddir}/${pcfiledir}/@srcdir@ @FREETYPE_CFLAGS@
Requires: pango freetype2
Libs: ${pc_top_builddir}/${pcfiledir}/pango/libpangoft2-@[email protected]
Cflags: -I${pc_top_builddir}/${pcfiledir}/@srcdir@

11 changes: 5 additions & 6 deletions pangoft2.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: Pango FT2
Description: Freetype 2.0 font support for Pango
Name: Pango FT2 and Pango Fc
Description: Freetype 2.0 and fontconfig font support for Pango
Version: @VERSION@
Requires: pango
Libs: -L${libdir} -lpangoft2-@PANGO_API_VERSION@ @PKGCONFIG_FREETYPE_LIBS@
Cflags: -I${includedir}/pango-1.0 @FONTCONFIG_CFLAGS@ @FREETYPE_CFLAGS@

Requires: pango freetype2 fontconfig
Libs: -L${libdir} -lpangoft2-@PANGO_API_VERSION@
Cflags: -I${includedir}/pango-1.0
3 changes: 1 addition & 2 deletions pangowin32.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ Name: Pango Win32
Description: Win32 GDI font support for Pango
Version: @VERSION@
Requires: pango
Libs: -L${libdir} -lpangowin32-@PANGO_API_VERSION@
Libs: -L${libdir} -lpangowin32-@PANGO_API_VERSION@ @WIN32_LIBS@
Cflags: -I${includedir}/pango-1.0

2 changes: 1 addition & 1 deletion pangox-uninstalled.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Description: X Window System font support for Pango, Not Installed
Version: @VERSION@
Requires: pango
Libs: ${pc_top_builddir}/${pcfiledir}/pango/libpangox-@[email protected] @X_LIBS@
Cflags: -I${pc_top_builddir}/${pcfiledir}/@srcdir@
Cflags: -I${pc_top_builddir}/${pcfiledir}/@srcdir@ @X_CFLAGS@
3 changes: 1 addition & 2 deletions pangox.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ Name: Pango X
Description: X Window System font support for Pango
Version: @VERSION@
Requires: pango
Libs: -L${libdir} -lpangox-@PANGO_API_VERSION@ @PKGCONFIG_X_LIBS@
Libs: -L${libdir} -lpangox-@PANGO_API_VERSION@ @X_LIBS@
Cflags: -I${includedir}/pango-1.0 @X_CFLAGS@

7 changes: 3 additions & 4 deletions pangoxft-uninstalled.pc.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Name: Pango Xft Uninstalled
Description: Xft font support for Pango, Not Installed
Version: @VERSION@
Requires: pango
Libs: ${pc_top_builddir}/${pcfiledir}/pango/libpangoxft-@[email protected] @XFT_LIBS@
Cflags: -I${pc_top_builddir}/${pcfiledir}/@srcdir@ @X_CFLAGS@ @FREETYPE_CFLAGS@

Requires: pango pangoft2 xft
Libs: ${pc_top_builddir}/${pcfiledir}/pango/libpangoxft-@[email protected]
Cflags: -I${pc_top_builddir}/${pcfiledir}/@srcdir@
6 changes: 3 additions & 3 deletions pangoxft.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ includedir=@includedir@
Name: Pango Xft
Description: Xft font support for Pango
Version: @VERSION@
Requires: pango pangoft2
Libs: -L${libdir} -lpangoxft-@PANGO_API_VERSION@ @PKGCONFIG_XFT_LIBS@
Cflags: -I${includedir}/pango-1.0 @XFT_CFLAGS@
Requires: pango pangoft2 xft
Libs: -L${libdir} -lpangoxft-@PANGO_API_VERSION@
Cflags: -I${includedir}/pango-1.0

0 comments on commit 701bdf2

Please sign in to comment.