From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 0CE53BC0A for ; Fri, 25 May 2007 09:32:44 +0200 (CEST) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.231]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4P7WhHu020042 for ; Fri, 25 May 2007 09:32:43 +0200 Received: by wx-out-0506.google.com with SMTP id s9so615390wxc for ; Fri, 25 May 2007 00:32:42 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=Jtq8/umIjrGoPZ7mmypIhIEROaMyV/O8dNai5MQb189Z2gC0dAcW6TDN9eadaGJfYVXBOEA3NAbQLksu2dT+vyxH/2d0X0oIesfUc9Y0hVvuosbbcVR23iuRrg/wYJP/7itlEQe0tZotGEvGax5priUi4wjZYyJn2fEJKC3VRjI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=U2tPxl1lIzA7DLeroUB59b9uN4Sc0sRbrpTonwtvTJRzvB7y5f5wiiHTRdCfgoN+ErvMKYDe1KqyOi15m0WiCRASE1720BR96+k3wJCVhuDhYdxSyNJOH5B5HpsB9g3LvOVp3j9aFZZg96RLWlkYikxNzGKWNXuaGdJsrAfq+7U= Received: by 10.70.111.2 with SMTP id j2mr3563435wxc.1180078362775; Fri, 25 May 2007 00:32:42 -0700 (PDT) Received: by 10.90.31.11 with HTTP; Fri, 25 May 2007 00:32:42 -0700 (PDT) Message-ID: <95513600705250032n4d6bef24vcac6a69e61f6a972@mail.gmail.com> Date: Fri, 25 May 2007 09:32:42 +0200 From: "Olivier Andrieu" Sender: oandrieu@gmail.com To: "Basile STARYNKEVITCH" Subject: Re: [Caml-list] mostly static ocaml binaries Cc: caml-list@inria.fr In-Reply-To: <464DCE27.9000705@starynkevitch.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <464DCE27.9000705@starynkevitch.net> X-Google-Sender-Auth: 5437f96b8741cf60 X-Miltered: at discorde with ID 4656911B.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; andrieu:01 oandrieu:01 ocaml:01 basile:01 basile:01 ocaml:01 usr:01 lib:01 libpcre:01 libc:01 -lpcre:01 lib:01 ocamlopt:01 pcre:01 cmxa:01 Hi, On 5/18/07, Basile STARYNKEVITCH wrote: > Dear All > > I would like to know how to make ocaml with mostly static binaries. > > My motivation is the following: I want to code some dynamic web site but > my small hosting company provide only a very basic linux system. In > particular even the /usr/lib/libpcre.so is not available. > > So I would like to develop an application which only has as dynamic > library the very common ones like libc.so libm.so libdl.so and no much more. > > I know that the request is not very common, I am not familiar enough > with Ocaml linking of C libraries ... it's possible: when you're building the library, instead of specifying the C library to link as -lpcre, specify the static lib directly, eg: ocamlopt -a -o pcre.cmxa ... -cclib /usr/lib/libpcre.a and then link your application as usual (and add the -verbose flag to ocamlopt to check what's going on exactly). If you don't want to re-build the caml pcre library, you could also use the -noautolink flag I think: ocamlopt -o my_app pcre.cmxa -noautolink -cclib /usr/lib/libpcre.a my_app.cmx ... HTH, -- Olivier