All users were logged out of Bugzilla on October 13th, 2018

Need a configure test for glx

RESOLVED FIXED in mozilla1.9.3a1

Status

--
major
RESOLVED FIXED
9 years ago
8 months ago

People

(Reporter: cjones, Assigned: jimb)

Tracking

Trunk
mozilla1.9.3a1
x86_64
Linux
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

I'm running Ubuntu 9.04 on a machine without hardware accelerated graphics, and hence without glx.  When trying to build m-c (rev 4aa5a9aadcad), I get the following build errors:

ccache g++ -o nsHTMLDocument.o -c -I../../../../dist/system_wrappers -include /home/cjones/mozilla/mozilla-central/config/gcc_hidden.h -DMOZILLA_INTERNAL_API -DOSTYPE=\"Linux2.6\" -DOSARCH=Linux -D_IMPL_NS_LAYOUT  -I/home/cjones/mozilla/mozilla-central/content/html/document/src -I. -I../../../../dist/include -I../../../../dist/include/nsprpub  -I/home/cjones/mozilla/ff-dbg/dist/include/nspr -I/home/cjones/mozilla/ff-dbg/dist/include/nss      -I/home/cjones/mozilla/mozilla-central/content/html/document/src/../../../base/src -I/home/cjones/mozilla/mozilla-central/content/html/document/src/../../../events/src -I/home/cjones/mozilla/mozilla-central/content/html/document/src/../../content/src -I/home/cjones/mozilla/mozilla-central/content/html/document/src/../../../../layout/style -I/home/cjones/mozilla/mozilla-central/content/html/document/src/../../../../dom/base   -fPIC  -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -pedantic -fno-strict-aliasing -fshort-wchar -pthread -pipe  -DDEBUG -D_DEBUG -DDEBUG_cjones -DTRACING -g -fno-inline   -DMOZILLA_CLIENT -include ../../../../mozilla-config.h -Wp,-MD,.deps/nsHTMLDocument.pp /home/cjones/mozilla/mozilla-central/content/html/document/src/nsHTMLDocument.cpp
In file included from /home/cjones/mozilla/mozilla-central/content/canvas/src/WebGLContext.h:59,
                 from /home/cjones/mozilla/mozilla-central/content/canvas/src/WebGLContext.cpp:2:
/home/cjones/mozilla/mozilla-central/content/canvas/src/nsGLPbuffer.h:61:20: error: GL/glx.h: No such file or directory


ccache g++ -o nsAttrAndChildArray.o -c -I../../../dist/system_wrappers -include /home/cjones/mozilla/mozilla-central/config/gcc_hidden.h -DMOZILLA_INTERNAL_API -DOSTYPE=\"Linux2.6\" -DOSARCH=Linux -D_IMPL_NS_LAYOUT  -I/home/cjones/mozilla/mozilla-central/content/base/src -I. -I../../../dist/include -I../../../dist/include/nsprpub  -I/home/cjones/mozilla/ff-dbg/dist/include/nspr -I/home/cjones/mozilla/ff-dbg/dist/include/nss      -I/home/cjones/mozilla/mozilla-central/content/base/src/../../events/src -I/home/cjones/mozilla/mozilla-central/content/base/src/../../xml/content/src -I/home/cjones/mozilla/mozilla-central/content/base/src/../../xul/base/src -I/home/cjones/mozilla/mozilla-central/content/base/src/../../xul/content/src -I/home/cjones/mozilla/mozilla-central/content/base/src/../../html/content/src -I/home/cjones/mozilla/mozilla-central/content/base/src/../../base/src -I/home/cjones/mozilla/mozilla-central/content/base/src/../../xbl/src -I/home/cjones/mozilla/mozilla-central/content/base/src/../../../layout/generic -I/home/cjones/mozilla/mozilla-central/content/base/src/../../../layout/style -I/home/cjones/mozilla/mozilla-central/content/base/src/../../../dom/base -I/home/cjones/mozilla/mozilla-central/content/base/src/../../xml/document/src -I/home/cjones/mozilla/mozilla-central/xpcom/io   -fPIC  -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -pedantic -fno-strict-aliasing -fshort-wchar -pthread -pipe  -DDEBUG -D_DEBUG -DDEBUG_cjones -DTRACING -g -fno-inline   -DMOZILLA_CLIENT -include ../../../mozilla-config.h -Wp,-MD,.deps/nsAttrAndChildArray.pp /home/cjones/mozilla/mozilla-central/content/base/src/nsAttrAndChildArray.cpp
In file included from /home/cjones/mozilla/mozilla-central/content/canvas/src/WebGLContext.h:59,
                 from /home/cjones/mozilla/mozilla-central/content/canvas/src/WebGLContext.cpp:2:
/home/cjones/mozilla/mozilla-central/content/canvas/src/nsGLPbuffer.h:183: error: ISO C++ forbids declaration of ‘Display’ with no type
/home/cjones/mozilla/mozilla-central/content/canvas/src/nsGLPbuffer.h:183: error: expected ‘;’ before ‘*’ token
/home/cjones/mozilla/mozilla-central/content/canvas/src/nsGLPbuffer.h:184: error: ‘GLXFBConfig’ does not name a type
/home/cjones/mozilla/mozilla-central/content/canvas/src/nsGLPbuffer.h:185: error: ‘GLXPbuffer’ does not name a type
/home/cjones/mozilla/mozilla-central/content/canvas/src/nsGLPbuffer.h:186: error: ‘GLXContext’ does not name a type

I worked around this problem by installing libglitz-glx1-dev, and one of its dependencies ended up providing GL/glx.h.

We need a configure test for GL/glx.h.  It'd be nice to provide an error message like that shown when iwlib.h is missing: "Go install package ..."
On second thought, this should probably live in Build Config.
Component: Graphics → Build Config
QA Contact: thebes → build-config

Updated

9 years ago
Duplicate of this bug: 517608
Ah yeah, I thought that was a core dependency on the X11 dev packages, but I guess not.  We need to add this.
Duplicate of this bug: 517831
Blocks: 517557, 516213
mesa-common-dev seems to be the package that's needed on Ubuntu 9.04 (for the headers at least; haven't linked yet)

Comment 6

9 years ago
Created attachment 402028 [details] [diff] [review]
test for GL/glx.h

I think these are the right packages.
This is probably going to need an additional check for Maemo. I actually think you should pull the existing Makefile test for supported platforms:
http://mxr.mozilla.org/mozilla-central/source/content/canvas/src/Makefile.in#58

up into configure, and set DISABLE_WEBGL there, so then you can run this test only if !DISABLE_WEBGL.
(Assignee)

Comment 8

9 years ago
I'd like to second Ted's suggestion that you pull the Makefile test into configure.
I think the Debian/Ubuntu package that's required is actually libgl1-mesa-dev; mesa-common-dev appears to be only part of the GL headers.
(Assignee)

Updated

9 years ago
Assignee: nobody → jim
(Assignee)

Comment 10

9 years ago
Created attachment 407551 [details] [diff] [review]
Use configure script to enable WebGL.

I've submitted this to the try server; if it seems to work, I'll ask for review.
Automatically changing the build configuration based on what headers are available is a bad idea; then you can't figure out the configuration built from what options were given, and builds become less reproducable (if you happen to have installed a package for some other reason, you'll suddenly get a different build doing things the same way).

You want to make failure to have required headers an error:  that error can have useful suggestions, like:
 * what option to pass to disable the thing that requires the header
 * how to install the necessary headers
but it should be an error rather than a warning.
(Assignee)

Updated

9 years ago
Attachment #407551 - Flags: review?(vladimir)
(Assignee)

Comment 12

9 years ago
Comment on attachment 407551 [details] [diff] [review]
Use configure script to enable WebGL.

Seems to be working, and properly choosing between WebGLContext and the fallback on the right platforms.
Comment on attachment 407551 [details] [diff] [review]
Use configure script to enable WebGL.

See comment 11.
Attachment #407551 - Flags: review?(vladimir) → review-
(Assignee)

Comment 14

9 years ago
Created attachment 407773 [details] [diff] [review]
Enable WebGL in configure.in, and check for requisite headers.

Revised to produce an error when the requisite headers are not available, instead of disabling WebGL.
Attachment #407551 - Attachment is obsolete: true
Attachment #407773 - Flags: review?(dbaron)
Attachment #407773 - Flags: review?(vladimir)
Attachment #407773 - Flags: review?(dbaron)
Attachment #407773 - Flags: review+
Comment on attachment 407773 [details] [diff] [review]
Enable WebGL in configure.in, and check for requisite headers.

Yeah, that's probably fine.
Attachment #407773 - Flags: review?(vladimir) → review+

Comment 16

9 years ago
> that error can have useful suggestions, like:
>  * what option to pass to disable the thing that requires the header
>  * how to install the necessary headers

That's very good. Please do implement both of that.
The current patch says:
> Can't find header GL/glx.h for WebGL (install libgl1-mesa-dev
> (Ubuntu) or mesa-libGL-devel (Fedora));

which does the second point, but not the first. In fact, there is no switch at all to disable WebGL.

But that makes it impossible to compile Gecko on a system without 3D / 3D libraries installed. I don't think 3D should be required for building Mozilla. Please provide an way to compile it without. Thanks!
(Assignee)

Updated

9 years ago
Blocks: 523986
(Assignee)

Comment 17

9 years ago
(In reply to comment #16)
> The current patch says:
> > Can't find header GL/glx.h for WebGL (install libgl1-mesa-dev
> > (Ubuntu) or mesa-libGL-devel (Fedora));
> 
> which does the second point, but not the first. In fact, there is no switch at
> all to disable WebGL.
> 
> But that makes it impossible to compile Gecko on a system without 3D / 3D
> libraries installed. I don't think 3D should be required for building Mozilla.
> Please provide an way to compile it without. Thanks!

Filed as bug 523986.
There seems to be some confusion over whether GL libraries are required for building.
It looks to me like nsGLPbufferGLX loads libGL.so.1 dynamically and I can't see it referenced in the dynamic sections Mozilla's objects.
http://hg.mozilla.org/mozilla-central/annotate/be5eeaf56443/content/canvas/src/nsGLPbufferGLX.cpp#l140

This should mean that only the headers are required for a build (as correctly tested in this patch to configure.in).
However the Debian package that provides the headers is mesa-common-dev, so that seems the appropriate package to recommend for building.
http://packages.debian.org/lenny/mesa-common-dev

libgl1-mesa-dev provides a dependency on libgl1-mesa-glx for the libGL.so.1 library (for run-time) and provides the libGL.so sym link for link-time (which we don't use).
http://packages.debian.org/lenny/libgl1-mesa-dev

Comment 19

9 years ago
Thanks, Karl.

On SuSE, package Mesa (which also contains the libs, not Mesa-devel) contains GL/glx.h
(Assignee)

Comment 20

9 years ago
http://hg.mozilla.org/mozilla-central/rev/67641f9e226d

I changed the package recommended for Ubuntu to mesa-common-dev.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
(Assignee)

Updated

9 years ago
Depends on: 524724
Blocks: 518173
Flags: in-testsuite-
Target Milestone: --- → mozilla1.9.3a1

Updated

8 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.