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 CAA07408; Fri, 18 Apr 2003 02:15:01 +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 CAA07343 for ; Fri, 18 Apr 2003 02:15:00 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h3I0Ew907429 for ; Fri, 18 Apr 2003 02:14:58 +0200 (MET DST) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3p2/3.7W) with ESMTP id JAA21834; Fri, 18 Apr 2003 09:14:51 +0900 (JST) To: lists@gak.com Cc: caml-list@inria.fr Subject: Re: [Caml-list] A step short of -noautolink? In-Reply-To: <4.3.2.7.2.20030417161344.05d6ed50@mail.attbi.com> References: <4.3.2.7.2.20030417161344.05d6ed50@mail.attbi.com> X-Mailer: Mew version 1.94.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20030418091453Y.garrigue@kurims.kyoto-u.ac.jp> Date: Fri, 18 Apr 2003 09:14:53 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) X-Spam: no; 0.00; jacques:01 caml-list:01 -noautolink:01 implicitly:01 pcre:01 libpcre:01 -lpcre:01 overlooking:01 fiddling:01 autolink:01 relinking:01 ocamlc:01 usr:01 dynamically:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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). Cheers, Jacques Garrigue ------------------- 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