caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <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
Date: Sun, 02 Jan 2005 10:35:41 +0900 (JST)	[thread overview]
Message-ID: <20050102.103541.123758549.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <1104505684.8834.851.camel@localhost.localdomain>

From: Mary Fernandez <mff@research.att.com>

> 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


  reply	other threads:[~2005-01-02  1:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-31  2:02 Mary Fernandez
2004-12-31  9:23 ` [Caml-list] " Jacques Garrigue
2004-12-31 15:08   ` Mary Fernandez
2005-01-02  1:35     ` Jacques Garrigue [this message]
2005-01-02 12:23       ` Jacques GARRIGUE
2005-01-04  3:29         ` Mary Fernandez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050102.103541.123758549.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=mff@research.att.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).