|
Packit |
b513ef |
|
|
Packit |
b513ef |
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>Does findlib support linking of applications as well as
|
|
Packit |
b513ef |
packages?
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
NAME="GENERATOR"
|
|
Packit |
b513ef |
CONTENT="Modular DocBook HTML Stylesheet Version 1.79">
|
|
Packit |
b513ef |
REL="HOME"
|
|
Packit |
b513ef |
TITLE="The findlib User's Guide"
|
|
Packit |
b513ef |
HREF="index.html">
|
|
Packit |
b513ef |
REL="UP"
|
|
Packit |
b513ef |
TITLE="FAQs"
|
|
Packit |
b513ef |
HREF="c429.html">
|
|
Packit |
b513ef |
REL="PREVIOUS"
|
|
Packit |
b513ef |
TITLE="Why does findlib not automatically include the -custom option if
|
|
Packit |
b513ef |
linked with C code?"
|
|
Packit |
b513ef |
HREF="x443.html">
|
|
Packit |
b513ef |
REL="NEXT"
|
|
Packit |
b513ef |
TITLE=" Does Findlib support camlp4?
|
|
Packit |
b513ef |
"
|
|
Packit |
b513ef |
HREF="x461.html">
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
CLASS="SECT1"
|
|
Packit |
b513ef |
BGCOLOR="#FFFFFF"
|
|
Packit |
b513ef |
TEXT="#000000"
|
|
Packit |
b513ef |
LINK="#0000FF"
|
|
Packit |
b513ef |
VLINK="#840084"
|
|
Packit |
b513ef |
ALINK="#0000FF"
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
CLASS="NAVHEADER"
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
SUMMARY="Header navigation table"
|
|
Packit |
b513ef |
WIDTH="100%"
|
|
Packit |
b513ef |
BORDER="0"
|
|
Packit |
b513ef |
CELLPADDING="0"
|
|
Packit |
b513ef |
CELLSPACING="0"
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
COLSPAN="3"
|
|
Packit |
b513ef |
ALIGN="center"
|
|
Packit |
b513ef |
>The findlib User's Guide
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
WIDTH="10%"
|
|
Packit |
b513ef |
ALIGN="left"
|
|
Packit |
b513ef |
VALIGN="bottom"
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
HREF="x443.html"
|
|
Packit |
b513ef |
ACCESSKEY="P"
|
|
Packit |
b513ef |
>Prev
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
WIDTH="80%"
|
|
Packit |
b513ef |
ALIGN="center"
|
|
Packit |
b513ef |
VALIGN="bottom"
|
|
Packit |
b513ef |
>Chapter 7. FAQs
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
WIDTH="10%"
|
|
Packit |
b513ef |
ALIGN="right"
|
|
Packit |
b513ef |
VALIGN="bottom"
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
HREF="x461.html"
|
|
Packit |
b513ef |
ACCESSKEY="N"
|
|
Packit |
b513ef |
>Next
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
ALIGN="LEFT"
|
|
Packit |
b513ef |
WIDTH="100%">
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
CLASS="SECT1"
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
CLASS="SECT1"
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
NAME="AEN449"
|
|
Packit |
b513ef |
>Does findlib support linking of applications as well as
|
|
Packit |
b513ef |
packages?
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
CLASS="emphasis"
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
CLASS="EMPHASIS"
|
|
Packit |
b513ef |
>Short answer:
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
> Yes, but it is not very obvious
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>Applications also depend on other components, they have predicates, sometimes
|
|
Packit |
b513ef |
they need linker options; there seems to be only little difference between
|
|
Packit |
b513ef |
applications (stand-alone programs) and packages. If you want to use the
|
|
Packit |
b513ef |
findlib mechanisms for applications, too, the following trick helps.
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>The environment variable
|
|
Packit |
b513ef |
CLASS="LITERAL"
|
|
Packit |
b513ef |
>OCAMLPATH
|
|
Packit |
b513ef |
> may contain a
|
|
Packit |
b513ef |
colon-separated path of possible sitelib locations. It is allowed to include
|
|
Packit |
b513ef |
"." into the path (Shell commands follow):
|
|
Packit |
b513ef |
|
|
Packit |
b513ef |
|
|
Packit |
b513ef |
CLASS="PROGRAMLISTING"
|
|
Packit |
b513ef |
>OCAMLPATH=.
|
|
Packit |
b513ef |
export OCAMLPATH
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
|
|
Packit |
b513ef |
This makes ".", i.e. your current directory, another sitelib location. You may
|
|
Packit |
b513ef |
now put the components of your applications into subdirectories together with
|
|
Packit |
b513ef |
META files; the hierarchy might look as follows:
|
|
Packit |
b513ef |
|
|
Packit |
b513ef |
|
|
Packit |
b513ef |
CLASS="PROGRAMLISTING"
|
|
Packit |
b513ef |
>./Makefile global Makefile
|
|
Packit |
b513ef |
./localpkg1/META first local package directory: Contains META
|
|
Packit |
b513ef |
./localpkg1/... ... and more
|
|
Packit |
b513ef |
./localpkg2/META second local package dir: Contains META
|
|
Packit |
b513ef |
./localpkg2/... ... and more
|
|
Packit |
b513ef |
...
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
|
|
Packit |
b513ef |
From findlib's point of view, these directories are now package directories,
|
|
Packit |
b513ef |
and you can refer to them on the command line:
|
|
Packit |
b513ef |
|
|
Packit |
b513ef |
|
|
Packit |
b513ef |
CLASS="PROGRAMLISTING"
|
|
Packit |
b513ef |
>ocamlfind ocamlc -o ... -linkpkg -package localpkg1,localpkg2,...
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
|
|
Packit |
b513ef |
If you do not want subdirectories, you can also refer to the META file in the
|
|
Packit |
b513ef |
same directory by the name ".", e.g.:
|
|
Packit |
b513ef |
|
|
Packit |
b513ef |
|
|
Packit |
b513ef |
CLASS="PROGRAMLISTING"
|
|
Packit |
b513ef |
>ocamlfind ocamlc -o ... -linkpkg -package .
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
|
|
Packit |
b513ef |
In this case, the linking information will be taken from
|
|
Packit |
b513ef |
|
|
Packit |
b513ef |
CLASS="LITERAL"
|
|
Packit |
b513ef |
>./META
|
|
Packit |
b513ef |
>.
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
CLASS="NAVFOOTER"
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
ALIGN="LEFT"
|
|
Packit |
b513ef |
WIDTH="100%">
|
|
Packit |
b513ef |
SUMMARY="Footer navigation table"
|
|
Packit |
b513ef |
WIDTH="100%"
|
|
Packit |
b513ef |
BORDER="0"
|
|
Packit |
b513ef |
CELLPADDING="0"
|
|
Packit |
b513ef |
CELLSPACING="0"
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
WIDTH="33%"
|
|
Packit |
b513ef |
ALIGN="left"
|
|
Packit |
b513ef |
VALIGN="top"
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
HREF="x443.html"
|
|
Packit |
b513ef |
ACCESSKEY="P"
|
|
Packit |
b513ef |
>Prev
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
WIDTH="34%"
|
|
Packit |
b513ef |
ALIGN="center"
|
|
Packit |
b513ef |
VALIGN="top"
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
HREF="index.html"
|
|
Packit |
b513ef |
ACCESSKEY="H"
|
|
Packit |
b513ef |
>Home
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
WIDTH="33%"
|
|
Packit |
b513ef |
ALIGN="right"
|
|
Packit |
b513ef |
VALIGN="top"
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
HREF="x461.html"
|
|
Packit |
b513ef |
ACCESSKEY="N"
|
|
Packit |
b513ef |
>Next
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
WIDTH="33%"
|
|
Packit |
b513ef |
ALIGN="left"
|
|
Packit |
b513ef |
VALIGN="top"
|
|
Packit |
b513ef |
>Why does findlib not automatically include the -custom option if
|
|
Packit |
b513ef |
linked with C code?
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
WIDTH="34%"
|
|
Packit |
b513ef |
ALIGN="center"
|
|
Packit |
b513ef |
VALIGN="top"
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
HREF="c429.html"
|
|
Packit |
b513ef |
ACCESSKEY="U"
|
|
Packit |
b513ef |
>Up
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
WIDTH="33%"
|
|
Packit |
b513ef |
ALIGN="right"
|
|
Packit |
b513ef |
VALIGN="top"
|
|
Packit |
b513ef |
>Does Findlib support camlp4?
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|
|
Packit |
b513ef |
>
|