2012/1/13 Gerd Stolpmann <info@gerd-stolpmann.de>
Am Freitag, den 13.01.2012, 14:18 +0100 schrieb Stéphane Glondu:
> Le 13/01/2012 12:59, Philippe Veber a écrit :
> > Debian and Ubuntu have not so recently switched to multiarch binaries
> > (including libs, see http://wiki.debian.org/Multiarch/Implementation).
> > This is an important change for ocaml C bindings since the libraries are
> > now to be found in /usr/lib/<arch description> instead of /usr/lib. I
> > was just bitten by this, when realizing that the ocaml configure script
> > couldn't find libX11.so and wouldn't install graphics. A similar problem
> > was handled by the people in charge of debian ocaml packages
> > (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=619344). Now my
> > question is the following: will this evolution be a problem for GODI/odb
> > packages (and more generally source distribution), and what is the
> > advised fix for it?
>
> My advice would be to rely on pkg-config (a kind of ocamlfind for C
> libraries), or similar scripts (pcre-config, etc.) provided by the
> libraries. Otherwise, there is no good, portable (I mean, not
> Debian-specific) way to guess where a library is, and the packager will
> give an explicit path in his call to the configure script in
> debian/rules. By the way, this is what we did for ocaml [1].
>
> [1]
> http://anonscm.debian.org/gitweb/?p=pkg-ocaml-maint/packages/ocaml.git;a=commitdiff;h=1db9b654b7d8b702cddb44df5aea1982f3120883

In GODI there is a library searcher for libs that do not support
pkg-config et al. It just tries a list of typical paths used by various
OS. The method works well if the library is not dependent on other
libraries, and is quite portable. Of course, you cannot be sure to find
the right library if several versions are installed (which is quite
common on non-open-source OS where the developer has to do it on its
own), but otherwise it is good enough for setting a default if the user
does not have special wishes.

So, e.g. for X11, there is no pkg-config, and GODI falls back to
searching. Btw, we don't rely here on what the Ocaml configure script
finds out, but have our own searcher, simply because this makes it
easier to respect users' wishes.
'seems like pkg-config was updated:

pveber@gesundheit:~/usr/src/ocaml-3.12.1$ pkg-config --libs x11
-lX11