From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA22810; Fri, 18 Apr 2003 14:23:41 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA22992 for ; Fri, 18 Apr 2003 14:23:39 +0200 (MET DST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h3ICNc925279 for ; Fri, 18 Apr 2003 14:23:39 +0200 (MET DST) Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 196Uty-00074h-00; Fri, 18 Apr 2003 14:23:34 +0200 Received: from [80.129.104.150] (helo=gate.gerd-stolpmann.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 196Uty-0001ZA-00; Fri, 18 Apr 2003 14:23:34 +0200 Received: from ice.gerd-stolpmann.de (ice.gerd-stolpmann.de [192.168.0.13]) by gate.gerd-stolpmann.de (Postfix) with ESMTP id 530245717; Fri, 18 Apr 2003 14:27:54 +0200 (CEST) Received: by ice.gerd-stolpmann.de (Postfix, from userid 1000) id C88D9B030; Fri, 18 Apr 2003 14:24:27 +0200 (CEST) Subject: Re: [Caml-list] A step short of -noautolink? From: Gerd Stolpmann To: Jacques Garrigue Cc: lists@gak.com, caml-list@inria.fr In-Reply-To: <20030418091453Y.garrigue@kurims.kyoto-u.ac.jp> References: <4.3.2.7.2.20030417161344.05d6ed50@mail.attbi.com> <20030418091453Y.garrigue@kurims.kyoto-u.ac.jp> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1050668666.1063.35.camel@ice.gerd-stolpmann.de> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 18 Apr 2003 14:24:27 +0200 X-Spam: no; 0.00; gerd:01 stolpmann:01 caml-list:01 -noautolink:01 fre:99 jacques:01 implicitly:01 pcre:01 libpcre:01 -lpcre:01 overlooking:01 fiddling:01 autolink:01 relinking:01 ocamlc:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Am Fre, 2003-04-18 um 02.14 schrieb Jacques Garrigue: > From: Greg Kimberly > > > I'm new to caml so apologies if this is too obvious. > > This doesn't look obvious at all! > > [..] > > So far, so good. Unfortunately, the default build for the examples fails > > because the examples implicitly include pcre.cma which contains linker > > directives which cause the /lib/libpcre.so.0 to be linked- which is the > > wrong version. At this point I can see two possible fixes: > > > > Upgrade the version of libpcre in /lib - not good in the general case as it > > might cause compatiblility problems elsewhere > > > > Use -noautolink in the example makefile to suppress the inclusion of the > > linker directive -lpcre which has been inherited from pcre.cma > > > > This is the solution I'm using but it seems non-optimal to throw away all > > included linker directives just to remove one unwanted dependency. Is there > > some better way to deal with this issue that I'm overlooking? Is there some > > way to tell camlc to ignore a particular inherited directive from a .cma? > > After some fiddling I think I have a solution to your problem. > > You can change the autolink information in a .cma by relinking it, > with the -noautolink option. > > If you just want to strip this information you can write: > ocamlc -a -noautolink -o mypcre.cma pcre.cma > > But you can also replace it with correct information: > ocamlc -a -noautolink -o mypcre.cma pcre.cma -custom \ > -ccopt -L/usr/local/lib -cclib -lpcre_stubs -cclib -lpcre > (I'm not sure of the library name for pcre stubs) > > Note that all this may be irrelevant to dynamically loaded stubs: in > that case details about where to find the C library are inside > dll???.so, and you cannot change them. However, you can change the > load path with LD_LIBRARY_PATH (the system ld.so is at work in this > case, and ocaml knows nothing about it). You can also set LD_RUN_PATH when you build the dll???.so. In this case, the path is stored in the file, and is automatically remembered when the library is loaded. Gerd -- ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de ------------------------------------------------------------ ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners