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 KAA01450; Wed, 6 Nov 2002 10:03:36 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA01374 for ; Wed, 6 Nov 2002 10:03:34 +0100 (MET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id gA693W510826 for ; Wed, 6 Nov 2002 10:03:32 +0100 (MET) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3/3.7W) with ESMTP id SAA03790; Wed, 6 Nov 2002 18:03:29 +0900 (JST) To: ikeda@msi.co.jp Cc: caml-list@inria.fr Subject: Re: [Caml-list] How to create byte-code with static link In-Reply-To: <20021106162942Z.ikeda@msi.co.jp> References: <20021106162942Z.ikeda@msi.co.jp> 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: <20021106180328C.garrigue@kurims.kyoto-u.ac.jp> Date: Wed, 06 Nov 2002 18:03:28 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: IKEDA Katsumi > I make dllfoo.so libfoo.a from foo.c. > Now I can create bar the following > > ocamlc -o bar -dllpath /usr/local/foo/lib -I /usr/local/foo/lib foo.cma bar.cmo > > There are dllfoo.so and libfoo.a in /usr/local/foo/lib > > In this case, dllfoo.so is linked as dynamic link. Not really linked: its name is just added to a table in your ocaml bytecode. The system linker is not called. > Is it possible link bar and libfoo.a as static link? Yes, you just have to add the -custom flag. ocamlc -custom -o bar -I /usr/local/foo/lib foo.cma bar.cmo By the way, ocamlopt always links in custom mode. Note also that -custom is not equivalent to -ccopt -static: this one is passed to the system linker, and is about whether to choose libxxx.so or libxxx.a during a custom link (it does not affect non-custom linkage). --------------------------------------------------------------------------- Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp JG ------------------- 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