Building Pango with uninstalled Cairo

View: New views
2 Messages — Rating Filter:   Alert me  

Building Pango with uninstalled Cairo

by mpsuzuki :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

4 years ago, Pango is set to ignore the built-but-not-installed
cairo, by following changeset.

commit 08247583a00f69914682ba1807e4e377b6a98e48
Author: Behdad Esfahbod <behdad@...>
Date:   Mon Jan 16 10:28:12 2006 +0000

    Fixes bug #314675, Brian Cameron.
   
    2006-01-16  Behdad Esfahbod  <behdad@...>
   
            Fixes bug #314675, Brian Cameron.
   
            * configure.in: Handle uninstalled cairo.
   
            * pangocairo-uninstalled.pc.in: Fix typo: libpangoxft->libpangocairo.

At that time, the font backend of cairo (win32/ft/atsui)
were checked by AC_CHECK_LIB(), by testing if the function
cairo_win32_scaled_font_select_font() etc exists in libcairo.

AC_CHECK_LIB() is not ready for libtool, so,
when "pkg-config --libs cairo" returns the path of uninstalled
libtool library (this is popular design of uninstalled pkg-config file),
the native linking command

$(CC) -o conftest conftest.c ../xxx/libcairo.la

always fails, because native C compiler cannot handle libtool
library.

So, Brian Cameron's fix is simply disabling the uninstalled
cairo, like this:

    --- pango-1.10.0/configure.in 2005-08-16 00:05:15.000000000 +0100
    +++ pango-1.10.0/configure.in.new 2005-08-26 16:32:36.238282952 +0100
    @@ -281,7 +281,9 @@
       
     if $have_cairo ; then
       pango_save_ldflags=$LDFLAGS
    -  LDFLAGS="$LDFLAGS $CAIRO_LIBS"
    +  m4_pattern_allow([PKG_CONFIG_DISABLE_UNINSTALLED])
    +  INSTALLED_CAIRO_LIBS=`PKG_CONFIG_DISABLE_UNINSTALLED=yes $PKG_CONFIG --libs cairo`
    +  LDFLAGS="$LDFLAGS $INSTALLED_CAIRO_LIBS"
       AC_CHECK_LIB(cairo, cairo_win32_scaled_font_select_font, have_cairo_win32=true, :)
       if $have_cairo_win32 && $have_win32; then
         AC_DEFINE(HAVE_CAIRO_WIN32, 1, [Whether Cairo uses the Win32 GDI for fonts])
   

But, now, configure.in of Pango does not use AC_CHECK_LIB().
It checks the font backend of cairo by only pkg-config, like,

  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 can use the Win32 GDI for fonts])
    cairo_font_backends="win32 $cairo_font_backends"
    have_cairo=true
  fi

So, there's no need to exclude uninstalled cairo anymore.
Either, "INSTALLED_CAIRO_LIBS" are not required.
I propose following patch to re-enable building Pango with
built-but-not-installed cairo. Behdad, could you review?

Regards,
mpsuzuki


diff --git a/configure.in b/configure.in
index 493f86b..1097228 100644
--- a/configure.in
+++ b/configure.in
@@ -368,12 +368,10 @@ cairo_required=1.7.6
 PKG_CHECK_MODULES(CAIRO, cairo >= $cairo_required, have_cairo=true, AC_MSG_RESULT([no]))
   
 if $have_cairo ; then
-  m4_pattern_allow([PKG_CONFIG_DISABLE_UNINSTALLED])
-  INSTALLED_CAIRO_LIBS=`PKG_CONFIG_DISABLE_UNINSTALLED=yes $PKG_CONFIG --libs cairo`
   pango_save_libs=$LIBS
-  LIBS="$LIBS $INSTALLED_CAIRO_LIBS"
+  LIBS="$LIBS $CAIRO_LIBS"
   pango_save_ldflags=$LDFLAGS
-  LDFLAGS="$LDFLAGS $INSTALLED_CAIRO_LIBS"
+  LDFLAGS="$LDFLAGS $CAIRO_LIBS"
 
   have_cairo=false
   cairo_font_backends=""

_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list@...
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list

Re: Building Pango with uninstalled Cairo

by Behdad Esfahbod-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

You're right.  Thanks for the analysis.  I've pushed the fix to master now.
Please test.

behdad

On 10/16/2009 08:11 PM, mpsuzuki@... wrote:

> Hi,
>
> 4 years ago, Pango is set to ignore the built-but-not-installed
> cairo, by following changeset.
>
> commit 08247583a00f69914682ba1807e4e377b6a98e48
> Author: Behdad Esfahbod<behdad@...>
> Date:   Mon Jan 16 10:28:12 2006 +0000
>
>      Fixes bug #314675, Brian Cameron.
>
>      2006-01-16  Behdad Esfahbod<behdad@...>
>
>              Fixes bug #314675, Brian Cameron.
>
>              * configure.in: Handle uninstalled cairo.
>
>              * pangocairo-uninstalled.pc.in: Fix typo: libpangoxft->libpangocairo.
>
> At that time, the font backend of cairo (win32/ft/atsui)
> were checked by AC_CHECK_LIB(), by testing if the function
> cairo_win32_scaled_font_select_font() etc exists in libcairo.
>
> AC_CHECK_LIB() is not ready for libtool, so,
> when "pkg-config --libs cairo" returns the path of uninstalled
> libtool library (this is popular design of uninstalled pkg-config file),
> the native linking command
>
> $(CC) -o conftest conftest.c ../xxx/libcairo.la
>
> always fails, because native C compiler cannot handle libtool
> library.
>
> So, Brian Cameron's fix is simply disabling the uninstalled
> cairo, like this:
>
>      --- pango-1.10.0/configure.in 2005-08-16 00:05:15.000000000 +0100
>      +++ pango-1.10.0/configure.in.new 2005-08-26 16:32:36.238282952 +0100
>      @@ -281,7 +281,9 @@
>
>       if $have_cairo ; then
>         pango_save_ldflags=$LDFLAGS
>      -  LDFLAGS="$LDFLAGS $CAIRO_LIBS"
>      +  m4_pattern_allow([PKG_CONFIG_DISABLE_UNINSTALLED])
>      +  INSTALLED_CAIRO_LIBS=`PKG_CONFIG_DISABLE_UNINSTALLED=yes $PKG_CONFIG --libs cairo`
>      +  LDFLAGS="$LDFLAGS $INSTALLED_CAIRO_LIBS"
>         AC_CHECK_LIB(cairo, cairo_win32_scaled_font_select_font, have_cairo_win32=true, :)
>         if $have_cairo_win32&&  $have_win32; then
>           AC_DEFINE(HAVE_CAIRO_WIN32, 1, [Whether Cairo uses the Win32 GDI for fonts])
>
>
> But, now, configure.in of Pango does not use AC_CHECK_LIB().
> It checks the font backend of cairo by only pkg-config, like,
>
>    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 can use the Win32 GDI for fonts])
>      cairo_font_backends="win32 $cairo_font_backends"
>      have_cairo=true
>    fi
>
> So, there's no need to exclude uninstalled cairo anymore.
> Either, "INSTALLED_CAIRO_LIBS" are not required.
> I propose following patch to re-enable building Pango with
> built-but-not-installed cairo. Behdad, could you review?
>
> Regards,
> mpsuzuki
>
>
> diff --git a/configure.in b/configure.in
> index 493f86b..1097228 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -368,12 +368,10 @@ cairo_required=1.7.6
>   PKG_CHECK_MODULES(CAIRO, cairo>= $cairo_required, have_cairo=true, AC_MSG_RESULT([no]))
>
>   if $have_cairo ; then
> -  m4_pattern_allow([PKG_CONFIG_DISABLE_UNINSTALLED])
> -  INSTALLED_CAIRO_LIBS=`PKG_CONFIG_DISABLE_UNINSTALLED=yes $PKG_CONFIG --libs cairo`
>     pango_save_libs=$LIBS
> -  LIBS="$LIBS $INSTALLED_CAIRO_LIBS"
> +  LIBS="$LIBS $CAIRO_LIBS"
>     pango_save_ldflags=$LDFLAGS
> -  LDFLAGS="$LDFLAGS $INSTALLED_CAIRO_LIBS"
> +  LDFLAGS="$LDFLAGS $CAIRO_LIBS"
>
>     have_cairo=false
>     cairo_font_backends=""
>
>
_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list@...
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list