On 10.12.2011 13:49, Albrecht Schlosser wrote:
> On 10.12.2011 00:26, Ian MacArthur wrote:
>>
>> On 9 Dec 2011, at 12:29, Albrecht Schlosser wrote:

> I remember that Fabien (who implemented the current FLTK cairo support)
> wrote a comment somewhere that pkg-config was used and that he wanted
> to get rid of it, maybe some time in the future. But your way looks
> good. How common is pkg-config these days? Can we assume that it is
> installed (or easily installable) and working everywhere?
>
> Trying configure --enable-cairo on my Ubuntu 11.10 (currently w/o
> cairo) we can see that pkg-config is indeed used in configure:
>
> $ ./configure --enable-cairo
> Package cairo was not found in the pkg-config search path.
> Perhaps you should add the directory containing `cairo.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'cairo' found
>
> I'm going to install cairo now and I'll report what happens ...

Okay, I installed libcairo2-dev, and my Ubuntu 11.10 system also
pulled in libpixman-1-dev, as you can see here:

$ sudo apt-get install libcairo2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
   libcairo-script-interpreter2 libexpat1-dev libfontconfig1-dev
   libfreetype6-dev libglib2.0-dev libpixman-1-dev libpng12-dev
   libxcb-render0-dev libxcb-shm0-dev libxrender-dev x11proto-render-dev
   zlib1g-dev
Suggested packages:
   libcairo2-doc libglib2.0-doc python-subunit
The following NEW packages will be installed:
   libcairo-script-interpreter2 libcairo2-dev libexpat1-dev 
libfontconfig1-dev
   libfreetype6-dev libglib2.0-dev libpixman-1-dev libpng12-dev
   libxcb-render0-dev libxcb-shm0-dev libxrender-dev x11proto-render-dev
   zlib1g-dev
0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded.
Need to get 4.586 kB of archives.
After this operation, 19,7 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
...

After this, ./configure --enable-cairo and make worked w/o errors
and test/cairo-test worked as well, showing "FLTK loves Cairo!"
in blue, red, and green, with gradients etc..

Looking closer at the test program, ldd shows:

$ ldd cairo_test | grep 'cairo\|pixman'
         libcairo.so.2 => /usr/lib/i386-linux-gnu/libcairo.so.2 (0x0098d000)
         libpixman-1.so.0 => /usr/lib/i386-linux-gnu/libpixman-1.so.0 
(0x004ad000)


After removing all references to pixman (header and libs as well)
from FLTK's makeinclude, I can still link successfully, but this
is obviously because the libcairo.so.2 depends on libpixman-1,
and this is resolved dynamically.

I also verified that libcairo.a depends on pixman-1 by trying to
link it statically. It showed obvious dependencies on pixman-1,
but I didn't manage to link it successfully (gave up early, because
I found out what I wanted to know).

Well, I really don't know which version of libcairo I've got here.
http://cairographics.org/ says that the latest release is 1.10.0,
but the download page http://cairographics.org/download/ says that
libcairo2-dev is the package to install for Debian and Ubuntu.
Strange naming conventions, maybe, but not relevant here, probably.

Anyway, the newest Ubuntu version still seems to depend on pixman-1,
but doesn't need it explicitly, if you link with libcairo dynamically,
since it is resolved by the dynamic libs. Does this help us ?

Albrecht
_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to