From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 7B605BB81 for ; Sun, 2 Jan 2005 02:36:06 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j021a5bc012682 for ; Sun, 2 Jan 2005 02:36:06 +0100 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 CAA08274 for ; Sun, 2 Jan 2005 02:36:05 +0100 (MET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j021a3fd023815 for ; Sun, 2 Jan 2005 02:36:04 +0100 Received: from localhost (suiren [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.13.1/8.13.1) with ESMTP id j021Zwb9018643; Sun, 2 Jan 2005 10:36:01 +0900 (JST) Date: Sun, 02 Jan 2005 10:35:41 +0900 (JST) Message-Id: <20050102.103541.123758549.garrigue@math.nagoya-u.ac.jp> To: mff@research.att.com Cc: caml-list@inria.fr Subject: Re: [Caml-list] MacOS port and file formats From: Jacques Garrigue In-Reply-To: <1104505684.8834.851.camel@localhost.localdomain> References: <1104458557.8834.37.camel@localhost.localdomain> <20041231.182319.04680184.garrigue@math.nagoya-u.ac.jp> <1104505684.8834.851.camel@localhost.localdomain> X-Mailer: Mew version 4.0.64 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 41D75005.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41D75003.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 macos:01 o'caml:01 apis:01 o'caml:01 native-code:01 runtime:01 pcre:01 ocamlopt:01 ocamlmklib:01 ocamlmklib:01 bytecode:01 ocaml:01 compilation:01 unix:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: From: Mary Fernandez > Thanks for your message. Here is what I am trying to do. > > My O'Caml application is an XQuery engine. It has three > APIs: one for O'Caml, one for C, and one for Java applications. > > We create a native-code, dynamically linked > C library that includes our O'Caml library, the O'Caml runtime, > and several other C libraries that our application depends upon > the unix, nums, str libraries plus an external PCRE library. > We actually do this by hand with ocamlopt (not ocamlmklib) > because in the past, we found ocamlmklib did not work consistently > on all platforms. To be more precise, ocamlmklib produces two kinds of output: a DLL for dynamic loading in bytecode programs, and a static library for custom and native programs. What you seem to want is a dynamic library to link with native programs, which is out of the specification. On most architectures, the DLL can be used as a dynamic library, but this is not true on darwin, and only partly true on windows (you also need a binding library, which is not kept.) If your concern is darwin, then there is a simple answer: you can just get the installed static library, and turn it into a dynamic library, as all C code on darwin is position independent. Just look for the correct linker incantation in the darwin manual. It's better not to try to meddle with the core ocaml compilation, which has different goals in mind. Hope this helps, Jacques Garrigue