|Anonymous | Login | Signup for a new account||2014-11-24 03:50 CET|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005477||OCaml||OCaml general||public||2012-01-13 18:25||2013-08-31 12:46|
|Target Version||Fixed in Version||3.13.0+dev|
|Summary||0005477: ocaml graphics not working on popular Linux distros; ocaml should use pkg-config to get X11 switches|
|Description||There is now pkg-config support for libx in x.org's version of X for some time. This is a more reliable way for finding libx than searching in hard-coded locations, as it is currently done in Ocaml's configure script.|
The problem becomes now more urgent because distributions have started to ship multiarch binaries/libraries which are no longer stored at the classic places. The libraries are now in /usr/lib/<arch> or /usr/lib/<arch>/<pkg>, and ocaml fails to find them. Affected distros are Ubuntu Natty and Debian Wheezy so far.
|Steps To Reproduce||See e.g. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=619344 [^]|
|Additional Information||The suggested fix is to try "pkg-config --libs x11" before starting to search possible places for libx.|
pkg-config is supported for X11 since around 2005, and is now even widely available.
|Tags||No tags attached.|
|Attached Files|| configure.x11.patch [^] (790 bytes) 2012-01-15 09:07 [Show Content]
configure-x11-gerd.diff [^] (8,040 bytes) 2012-01-17 14:53 [Show Content]
configure-x11-trunk.patch [^] (3,787 bytes) 2012-01-31 18:06 [Show Content]
It's a great idea to try pkg-config first. A proposal for a patch would be very welcome.
|I've attached a first shot (configure.x11.patch). I tried to keep modifications to the minimum.|
Looking at Philippe's patch. On my system the two pkg-config commands output the empty string. I think this is not properly handled: "test -f $dir/X11/X.h" does not work when $dir is empty. Same with the library test. I think the proper way to go is to just believe pkg-config when it exits with code 0, and not testing the existence of files. A meaningful test would be compiling a test program with the flags.
Also, we should be prepared that pkg-config is not available, and just use the old code then.
Philippe: I don't understand the sed.
|Attached my shot at the problem: configure-x11-gerd.diff|
|Gerd's patch looks good to me. Thanks. To be reviewed and applied.|
The patch requires some work, to be applied to trunk (it is based on 3.12.1).
In the meantime, maybe some developers could try it on their systems, to be sure it does not break working configuration.
I tested it on Linux amd64/Ubuntu 10.10 Maverick, and it worked for me.
There is an obvious typo in Gerd's patch: if pkg-config returns without error, then it sets the variable "X11_include" with a capital X, a variable that is not used anywhere else.
So I'm surprised it works on Ubuntu.
|"pkg-config --cflags x11" returns an empty string on Debian Wheezy and Ubuntu 11.xx (and probably 10.xx too… I didn't test other versions). So that might explain it.|
edited on: 2012-02-01 22:31
I have adapted Gerd's patch to trunk and removed the bug. Tested on MacOSX 10.6. It selects macports' X11 library in preference to Apple's but that works just as well.
Tested also on 32-bit Ubuntu 11.04.
And also on 32-bit Windows7/cygwin.
Committed to trunk [3.13.0] (commit 12110)
|2012-01-13 18:25||gerd||New Issue|
|2012-01-14 20:07||xleroy||Note Added: 0006682|
|2012-01-14 20:07||xleroy||Status||new => feedback|
|2012-01-14 20:08||xleroy||Relationship added||related to 0005453|
|2012-01-15 09:07||pveber||File Added: configure.x11.patch|
|2012-01-15 09:09||pveber||Note Added: 0006686|
|2012-01-17 14:08||gerd||Note Added: 0006693|
|2012-01-17 14:08||gerd||Status||feedback => new|
|2012-01-17 14:53||gerd||File Added: configure-x11-gerd.diff|
|2012-01-17 14:53||gerd||Note Added: 0006694|
|2012-01-17 15:28||xleroy||Note Added: 0006696|
|2012-01-17 15:28||xleroy||Status||new => confirmed|
|2012-01-17 21:46||lefessan||Note Added: 0006705|
|2012-01-31 14:35||doligez||Note Added: 0006858|
|2012-01-31 16:26||mehdi||Note Added: 0006860|
|2012-01-31 18:06||doligez||File Added: configure-x11-trunk.patch|
|2012-01-31 18:11||doligez||Note Added: 0006862|
|2012-01-31 18:59||doligez||Note Edited: 0006862||View Revisions|
|2012-02-01 22:31||doligez||Note Edited: 0006862||View Revisions|
|2012-02-02 10:14||doligez||Status||confirmed => resolved|
|2012-02-02 10:14||doligez||Resolution||open => fixed|
|2012-02-02 10:14||doligez||Fixed in Version||=> 3.13.0+dev|
|2012-02-12 14:56||protz||Relationship added||has duplicate 0005423|
|2013-08-31 12:46||xleroy||Status||resolved => closed|
|Copyright © 2000 - 2011 MantisBT Group|