From mboxrd@z Thu Jan 1 00:00:00 1970 X-Sympa-To: caml-list@inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q0DEIMoo025988 for ; Fri, 13 Jan 2012 15:18:22 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsMBAO47EE/RVdQ2kGdsb2JhbABCpQcBiAkIIgEBAQEJCQ0HFAQhgXIBAQEDARICLAEbHQEDAQsGBQsDOCIBEQEFARwGEwgah1gImjkKi2qCb4RVP4hxAgULg3KIIASVEo4IPYN7 X-IronPort-AV: E=Sophos;i="4.71,504,1320620400"; d="scan'208";a="126783747" Received: from mail-vw0-f54.google.com ([209.85.212.54]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 13 Jan 2012 15:18:16 +0100 Received: by vbbfp1 with SMTP id fp1so2064090vbb.27 for ; Fri, 13 Jan 2012 06:18:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=KqAzm4FQuNlXFT8CWVZnARh14EJRVdPVwA29LcpFpKA=; b=niqu8FkB9rLuTWFOZkG+/eQhXc0ekroQRcaTD+H/Y9AN6XNFpa1So9pupJbiwiXwyv ktx2xxVxsN3PKQ3r72VEb/4izT6v3Kd2tkFUizA2iRRnoFkBRSSEFw0PQVDf4kQ2t1eU 4tF+8fcI/i59dzhE4Xnf60ITCFgU53mb7B588= Received: by 10.52.67.229 with SMTP id q5mr373740vdt.14.1326464295864; Fri, 13 Jan 2012 06:18:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.240.130 with HTTP; Fri, 13 Jan 2012 06:17:54 -0800 (PST) In-Reply-To: <1326462965.14288.67.camel@thinkpad> References: <4F102F24.9050000@glondu.net> <1326462965.14288.67.camel@thinkpad> From: Philippe Veber Date: Fri, 13 Jan 2012 15:17:54 +0100 Message-ID: To: Gerd Stolpmann Cc: =?ISO-8859-1?Q?St=E9phane_Glondu?= , caml users Content-Type: multipart/alternative; boundary=20cf307811a029894d04b66989bb X-Validation-by: philippe.veber@gmail.com Subject: Re: [Caml-list] Compiling the ocaml distribution under multiarched Debian/Ubuntu --20cf307811a029894d04b66989bb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2012/1/13 Gerd Stolpmann > Am Freitag, den 13.01.2012, 14:18 +0100 schrieb St=E9phane Glondu: > > Le 13/01/2012 12:59, Philippe Veber a =E9crit : > > > 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/ instead of /usr/lib. I > > > was just bitten by this, when realizing that the ocaml configure scri= pt > > > 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=3D619344). 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=3Dpkg-ocaml-maint/packages/ocaml.git;= a=3Dcommitdiff;h=3D1db9b654b7d8b702cddb44df5aea1982f3120883 > > 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 --20cf307811a029894d04b66989bb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2012/1/13 Gerd Stolpmann <info@gerd-stolpmann.de= >
Am Freitag, den 13.01.2012, 14:18 +0100 schrieb St=E9phane Glondu:
> Le 13/01/2012 12:59, Philippe Veber a =E9crit :=
> > Debian and Ubuntu have not so recently switched to multiarch bina= ries
> > (including libs, see http://wiki.debian.org/Multiarch/Implemen= tation).
> > This is an important change for ocaml C bindings since the librar= ies 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=3D= 619344). Now my
> > question is the following: will this evolution be a problem for G= ODI/odb
> > packages (and more generally source distribution), and what is th= e
> > 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 wil= l
> 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=3Dpkg-ocaml-maint/pac= kages/ocaml.git;a=3Dcommitdiff;h=3D1db9b654b7d8b702cddb44df5aea1982f3120883=

In GODI there is a library searcher for libs that do not suppor= t
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 p= kg-config was updated:

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

--20cf307811a029894d04b66989bb--