Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FF2 build fails with cairo_font_type_t not declared in scope

13 views
Skip to first unread message

John J Barton

unread,
Dec 22, 2007, 12:09:03 AM12/22/07
to
I built FF3 on linux and it runs. Next I tried FF2
( MOZILLA_1_8_BRANCH ) in a fresh directory. It ends badly. Any
hints? Thanks, John


make[5]: Entering directory `/home/bartonjj/ff2/mozilla/obj-i686-pc-
linux-gnu/content/canvas/src'
nsCanvasRenderingContext2D.cpp
c++ -o nsCanvasRenderingContext2D.o -c -fvisibility=hidden -
DMOZILLA_INTERNAL_API -DOSTYPE=\"Linux2.6\" -DOSARCH=\"Linux\" -
DBUILD_ID=0000000000 -D_IMPL_NS_LAYOUT -I../../../dist/include/xpcom -
I../../../dist/include/string -I../../../dist/include/gfx -I../../../
dist/include/layout -I../../../dist/include/widget -I../../../dist/
include/dom -I../../../dist/include/js -I../../../dist/include/locale -
I../../../dist/include/unicharutil -I../../../dist/include/webshell -
I../../../dist/include/uriloader -I../../../dist/include/htmlparser -
I../../../dist/include/necko -I../../../dist/include/view -I../../../
dist/include/pref -I../../../dist/include/docshell -I../../../dist/
include/xpconnect -I../../../dist/include/xuldoc -I../../../dist/
include/caps -I../../../dist/include/editor -I../../../dist/include/
imglib2 -I../../../dist/include/mimetype -I../../../dist/include/
exthandler -I../../../dist/include/uconv -I../../../dist/include/intl -
I../../../dist/include/plugin -I../../../dist/include/cairo -I../../../
dist/include/libpixman -I../../../dist/include/content -I../../../dist/
include -I../../../dist/include/nspr -I../../../dist/sdk/include
-fPIC -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -
Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-
non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar -pthread -
pipe -DDEBUG -D_DEBUG -DDEBUG_bartonjj -DTRACING -g -fno-inline -O -
I../../../dist/include/cairo -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/
include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/
pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/
include/freetype2 -I/usr/include/libpng12 -DMOZILLA_CLIENT -
include ../../../mozilla-config.h -Wp,-MD,.deps/
nsCanvasRenderingContext2D.pp /home/bartonjj/ff2/mozilla/content/
canvas/src/nsCanvasRenderingContext2D.cpp
/usr/include/pango-1.0/pango/pangocairo.h:71: error:
'cairo_font_type_t' was not declared in this scope
/usr/include/pango-1.0/pango/pangocairo.h:73: error:
'cairo_font_type_t' does not name a type

Mike Shaver

unread,
Dec 22, 2007, 5:50:31 AM12/22/07
to John J Barton, dev-b...@lists.mozilla.org
On Dec 22, 2007 12:09 AM, John J Barton <johnj...@johnjbarton.com> wrote:
> I built FF3 on linux and it runs. Next I tried FF2
> ( MOZILLA_1_8_BRANCH ) in a fresh directory. It ends badly. Any
> hints? Thanks, John

> nsCanvasRenderingContext2D.pp /home/bartonjj/ff2/mozilla/content/


> canvas/src/nsCanvasRenderingContext2D.cpp
> /usr/include/pango-1.0/pango/pangocairo.h:71: error:
> 'cairo_font_type_t' was not declared in this scope
> /usr/include/pango-1.0/pango/pangocairo.h:73: error:
> 'cairo_font_type_t' does not name a type

Looks like you're using --enable-system-cairo, which is virtually
always the wrong thing to do.

Mike

Bob Clary

unread,
Dec 22, 2007, 6:45:49 AM12/22/07
to
John J Barton wrote:
> I built FF3 on linux and it runs. Next I tried FF2
> ( MOZILLA_1_8_BRANCH ) in a fresh directory. It ends badly. Any
> hints? Thanks, John

building on fedora 8?

John J Barton

unread,
Dec 22, 2007, 1:09:25 PM12/22/07
to
On Dec 22, 2:50 am, "Mike Shaver" <mike.sha...@gmail.com> wrote:

This is my .mozconfig file:

mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@

# Options for 'configure' (same as command-line options).
ac_add_options --enable-application=browser
ac_add_options --enable-debug

I don't know from cairo, so I didn't try to enable it.

John J Barton

unread,
Dec 22, 2007, 1:10:18 PM12/22/07
to

Ubuntu 7.1 gutsy gibbon

Justin Dolske

unread,
Dec 22, 2007, 9:28:52 PM12/22/07
to
John J Barton wrote:
> I built FF3 on linux and it runs. Next I tried FF2
> ( MOZILLA_1_8_BRANCH ) in a fresh directory. It ends badly. Any
> hints? Thanks, John

Bug 387239?

Justin

John J. Barton

unread,
Dec 23, 2007, 1:10:55 AM12/23/07
to

Yes, thanks, Ubuntu 7.10 is mentioned as a victim. Bug 344818 seems to
have a patch, but its requires understanding cairo terminology and its
marked WONTFIX.

>
> Justin

Enrico Weigelt

unread,
Dec 26, 2007, 4:05:06 PM12/26/07
to dev-b...@lists.mozilla.org
* Mike Shaver <mike....@gmail.com> wrote:

<snip>

> Looks like you're using --enable-system-cairo, which is virtually
> always the wrong thing to do.

Well, for me it works very good ;-P
BTW: I've completely kicked off all the bundled library stuff ...


cu
--
---------------------------------------------------------------------
Enrico Weigelt == metux IT service - http://www.metux.de/
---------------------------------------------------------------------
Please visit the OpenSource QM Taskforce:
http://wiki.metux.de/public/OpenSource_QM_Taskforce
Patches / Fixes for a lot dozens of packages in dozens of versions:
http://patches.metux.de/
---------------------------------------------------------------------

Andrew Schultz

unread,
Jan 1, 2008, 1:52:23 PM1/1/08
to
John J. Barton wrote:
> Yes, thanks, Ubuntu 7.10 is mentioned as a victim. Bug 344818 seems to
> have a patch, but its requires understanding cairo terminology and its
> marked WONTFIX.

The fix can be a lot simpler than what bug 344818 does. You can patch
configure (or configure.in and re-run autoconf):

@@ -6815,5 +6815,5 @@
PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION)
MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
- MOZ_CAIRO_LIBS=$CAIRO_LIBS
+ MOZ_CAIRO_LIBS="$CAIRO_LIBS $XLDFLAGS -lXrender $XLIBS
-lfontconfig -lfreetype"
fi
fi

And then add the --enable-system-cairo option to your .mozconfig. That
should get you a working build.

--
Andrew Schultz
ajsc...@verizon.net
http://www.sens.buffalo.edu/~ajs42/

Andrew Schultz

unread,
Jan 1, 2008, 1:53:53 PM1/1/08
to

Actually, it's exactly what he needs to add. It's virtually always the
wrong thing to do because it's always broken and all bugs/patches to
make it not-broken have been WONTFIXed.

Enrico Weigelt

unread,
Jan 1, 2008, 7:03:35 PM1/1/08
to dev-b...@lists.mozilla.org
* Andrew Schultz <ajsc...@verizon.net> wrote:

Hi,

> @@ -6815,5 +6815,5 @@
> PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION)
> MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
> - MOZ_CAIRO_LIBS=$CAIRO_LIBS
> + MOZ_CAIRO_LIBS="$CAIRO_LIBS $XLDFLAGS -lXrender $XLIBS
> -lfontconfig -lfreetype"
> fi
> fi

well, at my site (current Gentoo x86), cairo.pc already pulls them in,
so maybe you should check your cairo installation.



> And then add the --enable-system-cairo option to your .mozconfig. That
> should get you a working build.

On my branch, I've completely kicked off the bundled cairo.
Builds very fine (and faster than w/ bundled one).

Andrew Schultz

unread,
Jan 1, 2008, 10:45:37 PM1/1/08
to
Enrico Weigelt wrote:
> * Andrew Schultz <ajsc...@verizon.net> wrote:
>
> Hi,
>
>> @@ -6815,5 +6815,5 @@
>> PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION)
>> MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
>> - MOZ_CAIRO_LIBS=$CAIRO_LIBS
>> + MOZ_CAIRO_LIBS="$CAIRO_LIBS $XLDFLAGS -lXrender $XLIBS
>> -lfontconfig -lfreetype"
>> fi
>> fi
>
> well, at my site (current Gentoo x86), cairo.pc already pulls them in,
> so maybe you should check your cairo installation.

My cairo.pc doesn't. That really means nothing as different versions of
cairo might pull in different libs. And it's not all that relevant
since the linking failures are due to gecko dependencies and not cairo
dependencies (gecko needs to link against the additional libraries and
therefore the mozilla build system should pull them in).

Enrico Weigelt

unread,
Jan 2, 2008, 6:58:39 AM1/2/08
to dev-b...@lists.mozilla.org
* Andrew Schultz <ajsc...@verizon.net> wrote:

> > well, at my site (current Gentoo x86), cairo.pc already pulls them in,
> > so maybe you should check your cairo installation.
>
> My cairo.pc doesn't.

Ah, do you have several cairo-*.pc files ?

Meanwhile I've seen I've forgot something I also did in my patches:
In case you enable certain features are enabled, you need to import
certain cairo backends directly:

configure.in needs also:

+ if test "$MOZ_X11"; then
+ if test "$MOZ_SVG_RENDERER_CAIRO"; then
+ PKG_CHECK_MODULES(CAIRO_XLIB, cairo-xlib >= $CAIRO_VERSION,,:)
+ MOZ_CAIRO_XLIB_CFLAGS=$CAIRO_XLIB_CFLAGS
+ MOZ_CAIRO_XLIB_LIBS="$XLDFLAGS $CAIRO_XLIB_LIBS"
+ fi
+ if test "$MOZ_ENABLE_CANVAS"; then
+ PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION,,:)
+ MOZ_CAIRO_XRENDER_CFLAGS=$CAIRO_XRENDER_CFLAGS
+ MOZ_CAIRO_XRENDER_LIBS="$XLDFLAGS $CAIRO_XRENDER_LIBS"
+ fi
+ fi

and AC_SUBST()'s for these variables.

You'll find it in the OSS-QM patches (dev/unbundle-*.diff)
These unbundle-patches are not cleaned up yet (therefore in dev/), but I'll
commit cleaned packages this afternoon/evening ...

> That really means nothing as different versions of cairo might pull in
> different libs. And it's not all that relevant since the linking failures
> are due to gecko dependencies and not cairo dependencies (gecko needs to
> link against the additional libraries and therefore the mozilla build
> system should pull them in).

Actually, Moz has to directly import certain cairo backends.
I forgot to mention this.

Andrew Schultz

unread,
Jan 2, 2008, 11:52:20 AM1/2/08
to
Enrico Weigelt wrote:
> * Andrew Schultz <ajsc...@verizon.net> wrote:
>
>>> well, at my site (current Gentoo x86), cairo.pc already pulls them in,
>>> so maybe you should check your cairo installation.
>> My cairo.pc doesn't.
>
> Ah, do you have several cairo-*.pc files ?

I do.

> Meanwhile I've seen I've forgot something I also did in my patches:
> In case you enable certain features are enabled, you need to import
> certain cairo backends directly:

Right. I figured.

> configure.in needs also:

Well, I suppose that compiles, but it doesn't seem like the right
solution (in that vein, what I posted is probably also not the right
solution, but it's a one-liner). Like I said, it's not that there are
unresolved cairo/x11 dependencies. The unresolved dependencies have
absolutely nothing to do with cairo. See

https://bugzilla.mozilla.org/show_bug.cgi?id=387239#c4
https://bugzilla.mozilla.org/show_bug.cgi?id=344818#c2

The only reason cairo is involved at all is that if you you're using the
in-tree cairo, it needs to be linked against the X and font libs, and so
the other bits of gecko that also need to be linked against those libs
are OK. If you're using system-cairo, those libs get left out.

John J Barton

unread,
Jan 2, 2008, 1:33:35 PM1/2/08
to
Andrew Schultz wrote:
> John J. Barton wrote:
>> Yes, thanks, Ubuntu 7.10 is mentioned as a victim. Bug 344818 seems to
>> have a patch, but its requires understanding cairo terminology and its
>> marked WONTFIX.
>
> The fix can be a lot simpler than what bug 344818 does. You can patch
> configure (or configure.in and re-run autoconf):
>
> @@ -6815,5 +6815,5 @@
> PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION)
> MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
> - MOZ_CAIRO_LIBS=$CAIRO_LIBS
> + MOZ_CAIRO_LIBS="$CAIRO_LIBS $XLDFLAGS -lXrender $XLIBS
> -lfontconfig -lfreetype"
> fi
> fi
>
> And then add the --enable-system-cairo option to your .mozconfig. That
> should get you a working build.
>
Thanks. The line numbers in the diff did not match mine, but there was
only one line MOZ_CAIRO_LIBS=$CAIRO_LIBS. I added
ac_add_options --enable-system-cairo
and the build completed. The bin file in obj.../dist/bin works.
Thanks,
John.

Enrico Weigelt

unread,
Jan 2, 2008, 8:53:56 PM1/2/08
to dev-b...@lists.mozilla.org
* John J Barton <johnj...@johnjbarton.com> wrote:

Hi,

> Thanks. The line numbers in the diff did not match mine, but there was
> only one line MOZ_CAIRO_LIBS=$CAIRO_LIBS. I added
> ac_add_options --enable-system-cairo
> and the build completed. The bin file in obj.../dist/bin works.

meanwhile I've finished the unbundle patches and uploaded them
to the oss-qm cvs. maybe you'd like to have a look at them.

Enrico Weigelt

unread,
Jan 2, 2008, 9:36:46 PM1/2/08
to dev-b...@lists.mozilla.org
* Andrew Schultz <ajsc...@verizon.net> wrote:

Hi,

> > Ah, do you have several cairo-*.pc files ?
>
> I do.

Okay, then these ones should be imported in an proper place.
My unbundle patch should (IMHO) alrady handle this.

> > configure.in needs also:
>
> Well, I suppose that compiles, but it doesn't seem like the right
> solution (in that vein, what I posted is probably also not the right
> solution, but it's a one-liner). Like I said, it's not that there are
> unresolved cairo/x11 dependencies. The unresolved dependencies have
> absolutely nothing to do with cairo. See

Did you manage track it some bit ?

> https://bugzilla.mozilla.org/show_bug.cgi?id=387239#c4

Comment #4 implies that the canvas stuff needs additional libs and cflags.
I'll add this to my patches.

> The only reason cairo is involved at all is that if you you're using the
> in-tree cairo, it needs to be linked against the X and font libs, and so
> the other bits of gecko that also need to be linked against those libs
> are OK. If you're using system-cairo, those libs get left out.

Another good argument to keep 3rd-party libs out of the tree ;-P

0 new messages