Codebase list findlib / upstream/1.6.1
Imported Upstream version 1.6.1 Stephane Glondu 7 years ago
69 changed file(s) with 5212 addition(s) and 4537 deletion(s). Raw diff Collapse all Expand all
7070
7171 .PHONY: install-doc
7272 install-doc:
73 mkdir -p $(prefix)$(OCAMLFIND_MAN)/man1 $(prefix)$(OCAMLFIND_MAN)/man3 $(prefix)$(OCAMLFIND_MAN)/man5
74 -cp doc/ref-man/ocamlfind.1 $(prefix)$(OCAMLFIND_MAN)/man1
75 -cp doc/ref-man/META.5 doc/ref-man/site-lib.5 doc/ref-man/findlib.conf.5 $(prefix)$(OCAMLFIND_MAN)/man5
73 mkdir -p "$(prefix)$(OCAMLFIND_MAN)/man1" "$(prefix)$(OCAMLFIND_MAN)/man3 $(prefix)$(OCAMLFIND_MAN)/man5"
74 -cp doc/ref-man/ocamlfind.1 "$(prefix)$(OCAMLFIND_MAN)/man1"
75 -cp doc/ref-man/META.5 doc/ref-man/site-lib.5 doc/ref-man/findlib.conf.5 "$(prefix)$(OCAMLFIND_MAN)/man5"
7676
7777 .PHONY: uninstall-doc
7878 uninstall-doc:
79 rm -f $(prefix)$(OCAMLFIND_MAN)/man1/ocamlfind.1
80 rm -f $(prefix)$(OCAMLFIND_MAN)/man3/Findlib.3
81 rm -f $(prefix)$(OCAMLFIND_MAN)/man3/Topfind.3
82 rm -f $(prefix)$(OCAMLFIND_MAN)/man5/META.5
83 rm -f $(prefix)$(OCAMLFIND_MAN)/man5/site-lib.5
79 rm -f "$(prefix)$(OCAMLFIND_MAN)/man1/ocamlfind.1"
80 rm -f "$(prefix)$(OCAMLFIND_MAN)/man3/Findlib.3"
81 rm -f "$(prefix)$(OCAMLFIND_MAN)/man3/Topfind.3"
82 rm -f "$(prefix)$(OCAMLFIND_MAN)/man5/META.5"
83 rm -f "$(prefix)$(OCAMLFIND_MAN)/man5/site-lib.5"
8484
8585
8686 .PHONY: install-meta
00 #! /bin/sh
1 # $Id: configure 260 2015-10-25 12:43:38Z gerd $
1 # $Id: configure 278 2015-12-07 14:34:54Z gerd $
22 # ----------------------------------------------------------------------
33 #
44
66
77 #set -x
88
9 version="1.5.6"
9 version="1.6.1"
1010
1111 # Remember the old IFS value:
1212 oldifs="$IFS"
200200 CYGWIN*)
201201 exec_suffix=.exe
202202 echo "Cygwin build environment found; using .exe as suffix for binaries"
203 ;;
204 MSYS_NT*)
205 exec_suffix=.exe
206 echo "MSYS_NT build environment found; using .exe as suffix for binaries"
203207 ;;
204208 MINGW*)
205209 exec_suffix=.exe
8484 List of Changes
8585 ==============================================================================
8686
87 - 1.6.1: Just an important doc fix.
88
89 - 1.6.0: Adding support for dynamically loading packages (François Bobot):
90 new "plugin" variable, new Fl_dynload module.
91 New command "ocamlfind lint" for checking META files (François Bobot).
92 Also support MSYS_NT on Windows. Permit spaces in install paths (Christophe
93 Troestler).
94 Allow to query the location of the META file of a package: "ocamlfind query
95 -format '%m'" (Gerd Stolpmann).
96 Get the install path for the META file of packages: "ocamlfind printconf
97 metapath" (Gerd Stolpmann).
98
8799 - 1.5.6: for MSVC build fixing bad filename suffix (Dmitry Bely).
88100 The switch -only-show did not work as described. (Error report from Bob
89101 Atkey.)
109109 <ul>
110110
111111 <li>
112 <p><em>1.6.1:</em> Just an important doc fix.</p>
113 </li>
114
115 <li>
116 <p><em>1.6.0:</em> Adding support for dynamically loading
117 packages (François Bobot): new "plugin" variable, new
118 Fl_dynload module.</p>
119 <p>New command "ocamlfind lint" for checking META files
120 (François Bobot).</p>
121 <p>Also support MSYS_NT on Windows. Permit spaces in install
122 paths (Christophe Troestler).</p>
123 <p>Allow to query the location of the META file of a package:
124 "ocamlfind query -format '%m'" (Gerd Stolpmann).</p>
125 <p>Get the install path for the META file of packages:
126 "ocamlfind printconf metapath" (Gerd Stolpmann).</p>
127 </li>
128
129 <li>
112130 <p><em>1.5.6:</em> for MSVC build fixing bad filename suffix
113131 (Dmitry Bely).</p>
114132 <p>The switch -only-show did not work as described.
111111 HREF="x352.html"
112112 >Plugins</A
113113 ></DT
114 ><DT
115 ><A
116 HREF="x388.html"
117 >Lint</A
118 ></DT
114119 ></DL
115120 ></DIV
116121 ><DIV
+0
-204
doc/guide-html/c388.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >How to create your own packages</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib User's Guide"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="User's Guide"
13 HREF="p35.html"><LINK
14 REL="PREVIOUS"
15 TITLE="Plugins"
16 HREF="x352.html"><LINK
17 REL="NEXT"
18 TITLE="Change your Makefile"
19 HREF="x396.html"></HEAD
20 ><BODY
21 CLASS="CHAPTER"
22 BGCOLOR="#FFFFFF"
23 TEXT="#000000"
24 LINK="#0000FF"
25 VLINK="#840084"
26 ALINK="#0000FF"
27 ><DIV
28 CLASS="NAVHEADER"
29 ><TABLE
30 SUMMARY="Header navigation table"
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >The findlib User's Guide</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="x352.html"
48 ACCESSKEY="P"
49 >Prev</A
50 ></TD
51 ><TD
52 WIDTH="80%"
53 ALIGN="center"
54 VALIGN="bottom"
55 ></TD
56 ><TD
57 WIDTH="10%"
58 ALIGN="right"
59 VALIGN="bottom"
60 ><A
61 HREF="x396.html"
62 ACCESSKEY="N"
63 >Next</A
64 ></TD
65 ></TR
66 ></TABLE
67 ><HR
68 ALIGN="LEFT"
69 WIDTH="100%"></DIV
70 ><DIV
71 CLASS="CHAPTER"
72 ><H1
73 ><A
74 NAME="AEN388"
75 ></A
76 >Chapter 6. How to create your own packages</H1
77 ><DIV
78 CLASS="TOC"
79 ><DL
80 ><DT
81 ><B
82 >Table of Contents</B
83 ></DT
84 ><DT
85 ><A
86 HREF="c388.html#AEN390"
87 >Installing and removing packages</A
88 ></DT
89 ><DT
90 ><A
91 HREF="x396.html"
92 >Change your Makefile</A
93 ></DT
94 ><DT
95 ><A
96 HREF="x414.html"
97 >Using the Makefile wizard</A
98 ></DT
99 ></DL
100 ></DIV
101 ><DIV
102 CLASS="SECT1"
103 ><H1
104 CLASS="SECT1"
105 ><A
106 NAME="AEN390"
107 >Installing and removing packages</A
108 ></H1
109 ><P
110 >The ocamlfind command can install and remove packages. For example,
111 to install a package p containing the files META, m1.cmi, m2.cmi, p.cma,
112 run
113
114 <PRE
115 CLASS="PROGRAMLISTING"
116 >ocamlfind install p META m1.cmi m2.cmi p.cma</PRE
117 >
118
119 This installs the files into the default location for new packages
120 (set in ocamlfind.conf). If you have files that are not always built,
121 add these after the -optional switch:
122
123 <PRE
124 CLASS="PROGRAMLISTING"
125 >ocamlfind install p META m1.cmi m2.cmi p.cma -optional p.cmxa p.cmxs</PRE
126 >
127
128 To remove the package, run
129
130 <PRE
131 CLASS="PROGRAMLISTING"
132 >ocamlfind remove p</PRE
133 >
134
135 Note that every package must have a META file, it is not possible to
136 omit it.</P
137 ></DIV
138 ></DIV
139 ><DIV
140 CLASS="NAVFOOTER"
141 ><HR
142 ALIGN="LEFT"
143 WIDTH="100%"><TABLE
144 SUMMARY="Footer navigation table"
145 WIDTH="100%"
146 BORDER="0"
147 CELLPADDING="0"
148 CELLSPACING="0"
149 ><TR
150 ><TD
151 WIDTH="33%"
152 ALIGN="left"
153 VALIGN="top"
154 ><A
155 HREF="x352.html"
156 ACCESSKEY="P"
157 >Prev</A
158 ></TD
159 ><TD
160 WIDTH="34%"
161 ALIGN="center"
162 VALIGN="top"
163 ><A
164 HREF="index.html"
165 ACCESSKEY="H"
166 >Home</A
167 ></TD
168 ><TD
169 WIDTH="33%"
170 ALIGN="right"
171 VALIGN="top"
172 ><A
173 HREF="x396.html"
174 ACCESSKEY="N"
175 >Next</A
176 ></TD
177 ></TR
178 ><TR
179 ><TD
180 WIDTH="33%"
181 ALIGN="left"
182 VALIGN="top"
183 >Plugins</TD
184 ><TD
185 WIDTH="34%"
186 ALIGN="center"
187 VALIGN="top"
188 ><A
189 HREF="p35.html"
190 ACCESSKEY="U"
191 >Up</A
192 ></TD
193 ><TD
194 WIDTH="33%"
195 ALIGN="right"
196 VALIGN="top"
197 >Change your Makefile</TD
198 ></TR
199 ></TABLE
200 ></DIV
201 ></BODY
202 ></HTML
203 >
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >How to create your own packages</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib User's Guide"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="User's Guide"
13 HREF="p35.html"><LINK
14 REL="PREVIOUS"
15 TITLE="Lint"
16 HREF="x388.html"><LINK
17 REL="NEXT"
18 TITLE="Change your Makefile"
19 HREF="x403.html"></HEAD
20 ><BODY
21 CLASS="CHAPTER"
22 BGCOLOR="#FFFFFF"
23 TEXT="#000000"
24 LINK="#0000FF"
25 VLINK="#840084"
26 ALINK="#0000FF"
27 ><DIV
28 CLASS="NAVHEADER"
29 ><TABLE
30 SUMMARY="Header navigation table"
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >The findlib User's Guide</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="x388.html"
48 ACCESSKEY="P"
49 >Prev</A
50 ></TD
51 ><TD
52 WIDTH="80%"
53 ALIGN="center"
54 VALIGN="bottom"
55 ></TD
56 ><TD
57 WIDTH="10%"
58 ALIGN="right"
59 VALIGN="bottom"
60 ><A
61 HREF="x403.html"
62 ACCESSKEY="N"
63 >Next</A
64 ></TD
65 ></TR
66 ></TABLE
67 ><HR
68 ALIGN="LEFT"
69 WIDTH="100%"></DIV
70 ><DIV
71 CLASS="CHAPTER"
72 ><H1
73 ><A
74 NAME="AEN395"
75 ></A
76 >Chapter 6. How to create your own packages</H1
77 ><DIV
78 CLASS="TOC"
79 ><DL
80 ><DT
81 ><B
82 >Table of Contents</B
83 ></DT
84 ><DT
85 ><A
86 HREF="c395.html#AEN397"
87 >Installing and removing packages</A
88 ></DT
89 ><DT
90 ><A
91 HREF="x403.html"
92 >Change your Makefile</A
93 ></DT
94 ><DT
95 ><A
96 HREF="x421.html"
97 >Using the Makefile wizard</A
98 ></DT
99 ></DL
100 ></DIV
101 ><DIV
102 CLASS="SECT1"
103 ><H1
104 CLASS="SECT1"
105 ><A
106 NAME="AEN397"
107 >Installing and removing packages</A
108 ></H1
109 ><P
110 >The ocamlfind command can install and remove packages. For example,
111 to install a package p containing the files META, m1.cmi, m2.cmi, p.cma,
112 run
113
114 <PRE
115 CLASS="PROGRAMLISTING"
116 >ocamlfind install p META m1.cmi m2.cmi p.cma</PRE
117 >
118
119 This installs the files into the default location for new packages
120 (set in ocamlfind.conf). If you have files that are not always built,
121 add these after the -optional switch:
122
123 <PRE
124 CLASS="PROGRAMLISTING"
125 >ocamlfind install p META m1.cmi m2.cmi p.cma -optional p.cmxa p.cmxs</PRE
126 >
127
128 To remove the package, run
129
130 <PRE
131 CLASS="PROGRAMLISTING"
132 >ocamlfind remove p</PRE
133 >
134
135 Note that every package must have a META file, it is not possible to
136 omit it.</P
137 ></DIV
138 ></DIV
139 ><DIV
140 CLASS="NAVFOOTER"
141 ><HR
142 ALIGN="LEFT"
143 WIDTH="100%"><TABLE
144 SUMMARY="Footer navigation table"
145 WIDTH="100%"
146 BORDER="0"
147 CELLPADDING="0"
148 CELLSPACING="0"
149 ><TR
150 ><TD
151 WIDTH="33%"
152 ALIGN="left"
153 VALIGN="top"
154 ><A
155 HREF="x388.html"
156 ACCESSKEY="P"
157 >Prev</A
158 ></TD
159 ><TD
160 WIDTH="34%"
161 ALIGN="center"
162 VALIGN="top"
163 ><A
164 HREF="index.html"
165 ACCESSKEY="H"
166 >Home</A
167 ></TD
168 ><TD
169 WIDTH="33%"
170 ALIGN="right"
171 VALIGN="top"
172 ><A
173 HREF="x403.html"
174 ACCESSKEY="N"
175 >Next</A
176 ></TD
177 ></TR
178 ><TR
179 ><TD
180 WIDTH="33%"
181 ALIGN="left"
182 VALIGN="top"
183 >Lint</TD
184 ><TD
185 WIDTH="34%"
186 ALIGN="center"
187 VALIGN="top"
188 ><A
189 HREF="p35.html"
190 ACCESSKEY="U"
191 >Up</A
192 ></TD
193 ><TD
194 WIDTH="33%"
195 ALIGN="right"
196 VALIGN="top"
197 >Change your Makefile</TD
198 ></TR
199 ></TABLE
200 ></DIV
201 ></BODY
202 ></HTML
203 >
+0
-250
doc/guide-html/c422.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >FAQs</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib User's Guide"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="User's Guide"
13 HREF="p35.html"><LINK
14 REL="PREVIOUS"
15 TITLE="Using the Makefile wizard"
16 HREF="x414.html"><LINK
17 REL="NEXT"
18 TITLE="Why does findlib not automatically include the -custom option if
19 linked with C code?"
20 HREF="x436.html"></HEAD
21 ><BODY
22 CLASS="CHAPTER"
23 BGCOLOR="#FFFFFF"
24 TEXT="#000000"
25 LINK="#0000FF"
26 VLINK="#840084"
27 ALINK="#0000FF"
28 ><DIV
29 CLASS="NAVHEADER"
30 ><TABLE
31 SUMMARY="Header navigation table"
32 WIDTH="100%"
33 BORDER="0"
34 CELLPADDING="0"
35 CELLSPACING="0"
36 ><TR
37 ><TH
38 COLSPAN="3"
39 ALIGN="center"
40 >The findlib User's Guide</TH
41 ></TR
42 ><TR
43 ><TD
44 WIDTH="10%"
45 ALIGN="left"
46 VALIGN="bottom"
47 ><A
48 HREF="x414.html"
49 ACCESSKEY="P"
50 >Prev</A
51 ></TD
52 ><TD
53 WIDTH="80%"
54 ALIGN="center"
55 VALIGN="bottom"
56 ></TD
57 ><TD
58 WIDTH="10%"
59 ALIGN="right"
60 VALIGN="bottom"
61 ><A
62 HREF="x436.html"
63 ACCESSKEY="N"
64 >Next</A
65 ></TD
66 ></TR
67 ></TABLE
68 ><HR
69 ALIGN="LEFT"
70 WIDTH="100%"></DIV
71 ><DIV
72 CLASS="CHAPTER"
73 ><H1
74 ><A
75 NAME="AEN422"
76 ></A
77 >Chapter 7. FAQs</H1
78 ><DIV
79 CLASS="TOC"
80 ><DL
81 ><DT
82 ><B
83 >Table of Contents</B
84 ></DT
85 ><DT
86 ><A
87 HREF="c422.html#AEN424"
88 >Does findlib support the autolink feature of O'Caml 3?</A
89 ></DT
90 ><DT
91 ><A
92 HREF="x436.html"
93 >Why does findlib not automatically include the -custom option if
94 linked with C code?</A
95 ></DT
96 ><DT
97 ><A
98 HREF="x442.html"
99 >Does findlib support linking of applications as well as
100 packages?</A
101 ></DT
102 ><DT
103 ><A
104 HREF="x454.html"
105 >Does Findlib support camlp4?</A
106 ></DT
107 ><DT
108 ><A
109 HREF="x506.html"
110 >Does Findlib support ppx-style preprocessors?</A
111 ></DT
112 ><DT
113 ><A
114 HREF="x513.html"
115 >Why do some people install the .cmx files?</A
116 ></DT
117 ><DT
118 ><A
119 HREF="x517.html"
120 >How do I express conflicts?</A
121 ></DT
122 ></DL
123 ></DIV
124 ><DIV
125 CLASS="SECT1"
126 ><H1
127 CLASS="SECT1"
128 ><A
129 NAME="AEN424"
130 >Does findlib support the autolink feature of O'Caml 3?</A
131 ></H1
132 ><P
133 ><SPAN
134 CLASS="emphasis"
135 ><I
136 CLASS="EMPHASIS"
137 >Short answer:</I
138 ></SPAN
139 > Findlib is compatible with autolink</P
140 ><P
141 >The new archive format introduced with O'Caml 3 can store the linker options
142 that are necessary to link an archive. For example:
143
144 <PRE
145 CLASS="PROGRAMLISTING"
146 >ocamlc -a -o myarchive.cma mymodule.cmo -cclib -lmylibrary</PRE
147 >
148
149 This command does not only create the new archive
150 <TT
151 CLASS="LITERAL"
152 >myarchive.cma</TT
153 >, but it also writes into a special section of
154 that file that the linker option <TT
155 CLASS="LITERAL"
156 >-cclib -lmylibrary</TT
157 > is
158 necessary to link this archive.</P
159 ><P
160 >This means for findlib that most of the "linkopts" attributes in META files
161 have become superflous: The compiler itself already knows the linker options,
162 we do not need to tell the compiler the options. We could simply leave all
163 "linkopts" attributes out.</P
164 ><P
165 >Of course, the "linkopts" feature of findlib still works. This is necessary
166 because findlib should keep the compatibility with older software, and because
167 "linkopts" is more powerful (you can have conditional linker options).</P
168 ><P
169 >If you have software that must run in both O'Caml 2 and O'Caml 3 environments,
170 you can make your "linkopts" attribute dependent on the "autolink"
171 predicate. For example:
172
173 <PRE
174 CLASS="PROGRAMLISTING"
175 >linkopts = "-cclib -lmylibrary"
176 linkopts(autolink) = ""</PRE
177 >
178
179 The findlib installation for O'Caml 3 will take the second line which is
180 reasonable because ocamlc already knows how to link; the installation for
181 O'Caml 2 never sets the "autolink" predicate and therefore uses the first line.</P
182 ></DIV
183 ></DIV
184 ><DIV
185 CLASS="NAVFOOTER"
186 ><HR
187 ALIGN="LEFT"
188 WIDTH="100%"><TABLE
189 SUMMARY="Footer navigation table"
190 WIDTH="100%"
191 BORDER="0"
192 CELLPADDING="0"
193 CELLSPACING="0"
194 ><TR
195 ><TD
196 WIDTH="33%"
197 ALIGN="left"
198 VALIGN="top"
199 ><A
200 HREF="x414.html"
201 ACCESSKEY="P"
202 >Prev</A
203 ></TD
204 ><TD
205 WIDTH="34%"
206 ALIGN="center"
207 VALIGN="top"
208 ><A
209 HREF="index.html"
210 ACCESSKEY="H"
211 >Home</A
212 ></TD
213 ><TD
214 WIDTH="33%"
215 ALIGN="right"
216 VALIGN="top"
217 ><A
218 HREF="x436.html"
219 ACCESSKEY="N"
220 >Next</A
221 ></TD
222 ></TR
223 ><TR
224 ><TD
225 WIDTH="33%"
226 ALIGN="left"
227 VALIGN="top"
228 >Using the Makefile wizard</TD
229 ><TD
230 WIDTH="34%"
231 ALIGN="center"
232 VALIGN="top"
233 ><A
234 HREF="p35.html"
235 ACCESSKEY="U"
236 >Up</A
237 ></TD
238 ><TD
239 WIDTH="33%"
240 ALIGN="right"
241 VALIGN="top"
242 >Why does findlib not automatically include the -custom option if
243 linked with C code?</TD
244 ></TR
245 ></TABLE
246 ></DIV
247 ></BODY
248 ></HTML
249 >
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >FAQs</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib User's Guide"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="User's Guide"
13 HREF="p35.html"><LINK
14 REL="PREVIOUS"
15 TITLE="Using the Makefile wizard"
16 HREF="x421.html"><LINK
17 REL="NEXT"
18 TITLE="Why does findlib not automatically include the -custom option if
19 linked with C code?"
20 HREF="x443.html"></HEAD
21 ><BODY
22 CLASS="CHAPTER"
23 BGCOLOR="#FFFFFF"
24 TEXT="#000000"
25 LINK="#0000FF"
26 VLINK="#840084"
27 ALINK="#0000FF"
28 ><DIV
29 CLASS="NAVHEADER"
30 ><TABLE
31 SUMMARY="Header navigation table"
32 WIDTH="100%"
33 BORDER="0"
34 CELLPADDING="0"
35 CELLSPACING="0"
36 ><TR
37 ><TH
38 COLSPAN="3"
39 ALIGN="center"
40 >The findlib User's Guide</TH
41 ></TR
42 ><TR
43 ><TD
44 WIDTH="10%"
45 ALIGN="left"
46 VALIGN="bottom"
47 ><A
48 HREF="x421.html"
49 ACCESSKEY="P"
50 >Prev</A
51 ></TD
52 ><TD
53 WIDTH="80%"
54 ALIGN="center"
55 VALIGN="bottom"
56 ></TD
57 ><TD
58 WIDTH="10%"
59 ALIGN="right"
60 VALIGN="bottom"
61 ><A
62 HREF="x443.html"
63 ACCESSKEY="N"
64 >Next</A
65 ></TD
66 ></TR
67 ></TABLE
68 ><HR
69 ALIGN="LEFT"
70 WIDTH="100%"></DIV
71 ><DIV
72 CLASS="CHAPTER"
73 ><H1
74 ><A
75 NAME="AEN429"
76 ></A
77 >Chapter 7. FAQs</H1
78 ><DIV
79 CLASS="TOC"
80 ><DL
81 ><DT
82 ><B
83 >Table of Contents</B
84 ></DT
85 ><DT
86 ><A
87 HREF="c429.html#AEN431"
88 >Does findlib support the autolink feature of O'Caml 3?</A
89 ></DT
90 ><DT
91 ><A
92 HREF="x443.html"
93 >Why does findlib not automatically include the -custom option if
94 linked with C code?</A
95 ></DT
96 ><DT
97 ><A
98 HREF="x449.html"
99 >Does findlib support linking of applications as well as
100 packages?</A
101 ></DT
102 ><DT
103 ><A
104 HREF="x461.html"
105 >Does Findlib support camlp4?</A
106 ></DT
107 ><DT
108 ><A
109 HREF="x513.html"
110 >Does Findlib support ppx-style preprocessors?</A
111 ></DT
112 ><DT
113 ><A
114 HREF="x520.html"
115 >Why do some people install the .cmx files?</A
116 ></DT
117 ><DT
118 ><A
119 HREF="x524.html"
120 >How do I express conflicts?</A
121 ></DT
122 ></DL
123 ></DIV
124 ><DIV
125 CLASS="SECT1"
126 ><H1
127 CLASS="SECT1"
128 ><A
129 NAME="AEN431"
130 >Does findlib support the autolink feature of O'Caml 3?</A
131 ></H1
132 ><P
133 ><SPAN
134 CLASS="emphasis"
135 ><I
136 CLASS="EMPHASIS"
137 >Short answer:</I
138 ></SPAN
139 > Findlib is compatible with autolink</P
140 ><P
141 >The new archive format introduced with O'Caml 3 can store the linker options
142 that are necessary to link an archive. For example:
143
144 <PRE
145 CLASS="PROGRAMLISTING"
146 >ocamlc -a -o myarchive.cma mymodule.cmo -cclib -lmylibrary</PRE
147 >
148
149 This command does not only create the new archive
150 <TT
151 CLASS="LITERAL"
152 >myarchive.cma</TT
153 >, but it also writes into a special section of
154 that file that the linker option <TT
155 CLASS="LITERAL"
156 >-cclib -lmylibrary</TT
157 > is
158 necessary to link this archive.</P
159 ><P
160 >This means for findlib that most of the "linkopts" attributes in META files
161 have become superflous: The compiler itself already knows the linker options,
162 we do not need to tell the compiler the options. We could simply leave all
163 "linkopts" attributes out.</P
164 ><P
165 >Of course, the "linkopts" feature of findlib still works. This is necessary
166 because findlib should keep the compatibility with older software, and because
167 "linkopts" is more powerful (you can have conditional linker options).</P
168 ><P
169 >If you have software that must run in both O'Caml 2 and O'Caml 3 environments,
170 you can make your "linkopts" attribute dependent on the "autolink"
171 predicate. For example:
172
173 <PRE
174 CLASS="PROGRAMLISTING"
175 >linkopts = "-cclib -lmylibrary"
176 linkopts(autolink) = ""</PRE
177 >
178
179 The findlib installation for O'Caml 3 will take the second line which is
180 reasonable because ocamlc already knows how to link; the installation for
181 O'Caml 2 never sets the "autolink" predicate and therefore uses the first line.</P
182 ></DIV
183 ></DIV
184 ><DIV
185 CLASS="NAVFOOTER"
186 ><HR
187 ALIGN="LEFT"
188 WIDTH="100%"><TABLE
189 SUMMARY="Footer navigation table"
190 WIDTH="100%"
191 BORDER="0"
192 CELLPADDING="0"
193 CELLSPACING="0"
194 ><TR
195 ><TD
196 WIDTH="33%"
197 ALIGN="left"
198 VALIGN="top"
199 ><A
200 HREF="x421.html"
201 ACCESSKEY="P"
202 >Prev</A
203 ></TD
204 ><TD
205 WIDTH="34%"
206 ALIGN="center"
207 VALIGN="top"
208 ><A
209 HREF="index.html"
210 ACCESSKEY="H"
211 >Home</A
212 ></TD
213 ><TD
214 WIDTH="33%"
215 ALIGN="right"
216 VALIGN="top"
217 ><A
218 HREF="x443.html"
219 ACCESSKEY="N"
220 >Next</A
221 ></TD
222 ></TR
223 ><TR
224 ><TD
225 WIDTH="33%"
226 ALIGN="left"
227 VALIGN="top"
228 >Using the Makefile wizard</TD
229 ><TD
230 WIDTH="34%"
231 ALIGN="center"
232 VALIGN="top"
233 ><A
234 HREF="p35.html"
235 ACCESSKEY="U"
236 >Up</A
237 ></TD
238 ><TD
239 WIDTH="33%"
240 ALIGN="right"
241 VALIGN="top"
242 >Why does findlib not automatically include the -custom option if
243 linked with C code?</TD
244 ></TR
245 ></TABLE
246 ></DIV
247 ></BODY
248 ></HTML
249 >
292292 HREF="x352.html"
293293 >Plugins</A
294294 ></DT
295 ><DT
296 ><A
297 HREF="x388.html"
298 >Lint</A
299 ></DT
295300 ></DL
296301 ></DD
297302 ><DT
298303 >6. <A
299 HREF="c388.html"
304 HREF="c395.html"
300305 >How to create your own packages</A
301306 ></DT
302307 ><DD
303308 ><DL
304309 ><DT
305310 ><A
306 HREF="c388.html#AEN390"
311 HREF="c395.html#AEN397"
307312 >Installing and removing packages</A
308313 ></DT
309314 ><DT
310315 ><A
311 HREF="x396.html"
316 HREF="x403.html"
312317 >Change your Makefile</A
313318 ></DT
314319 ><DT
315320 ><A
316 HREF="x414.html"
321 HREF="x421.html"
317322 >Using the Makefile wizard</A
318323 ></DT
319324 ></DL
320325 ></DD
321326 ><DT
322327 >7. <A
323 HREF="c422.html"
328 HREF="c429.html"
324329 >FAQs</A
325330 ></DT
326331 ><DD
327332 ><DL
328333 ><DT
329334 ><A
330 HREF="c422.html#AEN424"
335 HREF="c429.html#AEN431"
331336 >Does findlib support the autolink feature of O'Caml 3?</A
332337 ></DT
333338 ><DT
334339 ><A
335 HREF="x436.html"
340 HREF="x443.html"
336341 >Why does findlib not automatically include the -custom option if
337342 linked with C code?</A
338343 ></DT
339344 ><DT
340345 ><A
341 HREF="x442.html"
346 HREF="x449.html"
342347 >Does findlib support linking of applications as well as
343348 packages?</A
344349 ></DT
345350 ><DT
346351 ><A
347 HREF="x454.html"
352 HREF="x461.html"
348353 >Does Findlib support camlp4?</A
349354 ></DT
350355 ><DT
351356 ><A
352 HREF="x506.html"
357 HREF="x513.html"
353358 >Does Findlib support ppx-style preprocessors?</A
354359 ></DT
355360 ><DT
356361 ><A
357 HREF="x513.html"
362 HREF="x520.html"
358363 >Why do some people install the .cmx files?</A
359364 ></DT
360365 ><DT
361366 ><A
362 HREF="x517.html"
367 HREF="x524.html"
363368 >How do I express conflicts?</A
364369 ></DT
365370 ></DL
108108 ></DT
109109 ><DT
110110 >6. <A
111 HREF="c388.html"
111 HREF="c395.html"
112112 >How to create your own packages</A
113113 ></DT
114114 ><DT
115115 >7. <A
116 HREF="c422.html"
116 HREF="c429.html"
117117 >FAQs</A
118118 ></DT
119119 ></DL
1515 TITLE="Glue code"
1616 HREF="x345.html"><LINK
1717 REL="NEXT"
18 TITLE="How to create your own packages"
19 HREF="c388.html"></HEAD
18 TITLE="Lint"
19 HREF="x388.html"></HEAD
2020 ><BODY
2121 CLASS="SECT1"
2222 BGCOLOR="#FFFFFF"
5858 ALIGN="right"
5959 VALIGN="bottom"
6060 ><A
61 HREF="c388.html"
61 HREF="x388.html"
6262 ACCESSKEY="N"
6363 >Next</A
6464 ></TD
261261 ALIGN="right"
262262 VALIGN="top"
263263 ><A
264 HREF="c388.html"
264 HREF="x388.html"
265265 ACCESSKEY="N"
266266 >Next</A
267267 ></TD
285285 WIDTH="33%"
286286 ALIGN="right"
287287 VALIGN="top"
288 >How to create your own packages</TD
288 >Lint</TD
289289 ></TR
290290 ></TABLE
291291 ></DIV
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Lint</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib User's Guide"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="Complex packages"
13 HREF="c278.html"><LINK
14 REL="PREVIOUS"
15 TITLE="Plugins"
16 HREF="x352.html"><LINK
17 REL="NEXT"
18 TITLE="How to create your own packages"
19 HREF="c395.html"></HEAD
20 ><BODY
21 CLASS="SECT1"
22 BGCOLOR="#FFFFFF"
23 TEXT="#000000"
24 LINK="#0000FF"
25 VLINK="#840084"
26 ALINK="#0000FF"
27 ><DIV
28 CLASS="NAVHEADER"
29 ><TABLE
30 SUMMARY="Header navigation table"
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >The findlib User's Guide</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="x352.html"
48 ACCESSKEY="P"
49 >Prev</A
50 ></TD
51 ><TD
52 WIDTH="80%"
53 ALIGN="center"
54 VALIGN="bottom"
55 >Chapter 5. Complex packages</TD
56 ><TD
57 WIDTH="10%"
58 ALIGN="right"
59 VALIGN="bottom"
60 ><A
61 HREF="c395.html"
62 ACCESSKEY="N"
63 >Next</A
64 ></TD
65 ></TR
66 ></TABLE
67 ><HR
68 ALIGN="LEFT"
69 WIDTH="100%"></DIV
70 ><DIV
71 CLASS="SECT1"
72 ><H1
73 CLASS="SECT1"
74 ><A
75 NAME="AEN388"
76 >Lint</A
77 ></H1
78 ><P
79 ><SPAN
80 CLASS="emphasis"
81 ><I
82 CLASS="EMPHASIS"
83 >(Since findlib-1.6.)</I
84 ></SPAN
85 ></P
86 ><P
87 >As it has become more and more complicated to write correct META files
88 there is now some support for recognizing typical problems. Just use
89
90 <PRE
91 CLASS="PROGRAMLISTING"
92 >ocamlfind lint META</PRE
93 >
94
95 to check the file META in the current directory. The tool reports problematic
96 lines in META, e.g.
97
98 <PRE
99 CLASS="PROGRAMLISTING"
100 >archive(byte,plugin) = "oUnit.cma"
101 This specification of dynamic loading is deprecated, you should add a "plugin(...)" variable.
102
103 archive(native,plugin) = "oUnit.cmxs"
104 This specification of dynamic loading is deprecated, you should add a "plugin(...)" variable.</PRE
105 >&#13;</P
106 ></DIV
107 ><DIV
108 CLASS="NAVFOOTER"
109 ><HR
110 ALIGN="LEFT"
111 WIDTH="100%"><TABLE
112 SUMMARY="Footer navigation table"
113 WIDTH="100%"
114 BORDER="0"
115 CELLPADDING="0"
116 CELLSPACING="0"
117 ><TR
118 ><TD
119 WIDTH="33%"
120 ALIGN="left"
121 VALIGN="top"
122 ><A
123 HREF="x352.html"
124 ACCESSKEY="P"
125 >Prev</A
126 ></TD
127 ><TD
128 WIDTH="34%"
129 ALIGN="center"
130 VALIGN="top"
131 ><A
132 HREF="index.html"
133 ACCESSKEY="H"
134 >Home</A
135 ></TD
136 ><TD
137 WIDTH="33%"
138 ALIGN="right"
139 VALIGN="top"
140 ><A
141 HREF="c395.html"
142 ACCESSKEY="N"
143 >Next</A
144 ></TD
145 ></TR
146 ><TR
147 ><TD
148 WIDTH="33%"
149 ALIGN="left"
150 VALIGN="top"
151 >Plugins</TD
152 ><TD
153 WIDTH="34%"
154 ALIGN="center"
155 VALIGN="top"
156 ><A
157 HREF="c278.html"
158 ACCESSKEY="U"
159 >Up</A
160 ></TD
161 ><TD
162 WIDTH="33%"
163 ALIGN="right"
164 VALIGN="top"
165 >How to create your own packages</TD
166 ></TR
167 ></TABLE
168 ></DIV
169 ></BODY
170 ></HTML
171 >
+0
-248
doc/guide-html/x396.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Change your Makefile</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib User's Guide"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="How to create your own packages"
13 HREF="c388.html"><LINK
14 REL="PREVIOUS"
15 TITLE="How to create your own packages"
16 HREF="c388.html"><LINK
17 REL="NEXT"
18 TITLE="Using the Makefile wizard"
19 HREF="x414.html"></HEAD
20 ><BODY
21 CLASS="SECT1"
22 BGCOLOR="#FFFFFF"
23 TEXT="#000000"
24 LINK="#0000FF"
25 VLINK="#840084"
26 ALINK="#0000FF"
27 ><DIV
28 CLASS="NAVHEADER"
29 ><TABLE
30 SUMMARY="Header navigation table"
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >The findlib User's Guide</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="c388.html"
48 ACCESSKEY="P"
49 >Prev</A
50 ></TD
51 ><TD
52 WIDTH="80%"
53 ALIGN="center"
54 VALIGN="bottom"
55 >Chapter 6. How to create your own packages</TD
56 ><TD
57 WIDTH="10%"
58 ALIGN="right"
59 VALIGN="bottom"
60 ><A
61 HREF="x414.html"
62 ACCESSKEY="N"
63 >Next</A
64 ></TD
65 ></TR
66 ></TABLE
67 ><HR
68 ALIGN="LEFT"
69 WIDTH="100%"></DIV
70 ><DIV
71 CLASS="SECT1"
72 ><H1
73 CLASS="SECT1"
74 ><A
75 NAME="AEN396"
76 >Change your Makefile</A
77 ></H1
78 ><P
79 >Here is a commented version of a Makefile that may be used to compile
80 and link a package. It describes the frequent case that the package
81 simply consists of a bundle of modules that are dependent on other
82 packages.</P
83 ><P
84 >First, some general definitions. NAME is the name of the package. The
85 OBJECTS variable enumerates the bytecode objects, whereas XOBJECTS
86 names the native objects. The same naming convention is used for
87 ARCHIVE and XARCHIVE, specifying the resulting bytecode, resp. native
88 archive file. The REQUIRES variable lists the names of the packages
89 that are needed for this package. If you need additional predicates,
90 put them into the PREDICATES variable.</P
91 ><PRE
92 CLASS="PROGRAMLISTING"
93 >NAME = p
94
95 OCAMLC = ocamlfind ocamlc
96 OCAMLOPT = ocamlfind ocamlopt
97 OCAMLDEP = ocamldep
98
99 OBJECTS = p1.cmo p2.cmo
100 XOBJECTS = p1.cmx p2.cmx
101
102 ARCHIVE = $(NAME).cma
103 XARCHIVE = $(NAME).cmxa
104 SARCHIVE = $(NAME).cmxs
105
106 REQUIRES = unix str q r s
107 PREDICATES =</PRE
108 ><P
109 >The default goal is "all", causing the bytecode archive to be
110 created. In order to get a native archive, choose "opt" as second goal.
111 (The ".PHONY" line is a declaration meaningful for GNU-make; "all" and
112 "opt" are only virtual goals as there no files "all", or "opt" which
113 is indicated by making them dependents of ".PHONY".)</P
114 ><PRE
115 CLASS="PROGRAMLISTING"
116 >.PHONY: all opt
117 all: $(ARCHIVE)
118 opt: $(XARCHIVE) $(SARCHIVE)</PRE
119 ><P
120 >The following two rules create the bytecode resp. native archive from
121 the objects.</P
122 ><PRE
123 CLASS="PROGRAMLISTING"
124 >$(ARCHIVE): $(OBJECTS)
125 $(OCAMLC) -a -o $(ARCHIVE) -package "$(REQUIRES)" -linkpkg \
126 -predicates "$(PREDICATES)" $(OBJECTS)
127 $(XARCHIVE): $(XOBJECTS)
128 $(OCAMLOPT) -a -o $(XARCHIVE) -package "$(REQUIRES)" -linkpkg \
129 -predicates "$(PREDICATES)" $(XOBJECTS)
130
131 $(SARCHIVE): $(XARCHIVE)
132 $(OCAMLOPT) -shared -o $(SARCHIVE) $(XARCHIVE) || true</PRE
133 ><P
134 >Note that the cmxs archive is optional: we just ignore the error
135 when it cannot be built.</P
136 ><P
137 >These rules compile the modules independently. The lines similar to
138 ".ml.cmo" must be read: "How to transform files with suffix .ml into
139 files with suffix .cmo". The corresponding command can refer to the
140 input file as "$&lt;" and to the output file(s) as "$@".</P
141 ><PRE
142 CLASS="PROGRAMLISTING"
143 >.SUFFIXES: .cmo .cmi .cmx .ml .mli
144
145 .ml.cmo:
146 $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
147 -c $&lt;
148 .mli.cmi:
149 $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
150 -c $&lt;
151 .ml.cmx:
152 $(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
153 -c $&lt;</PRE
154 ><P
155 >The "depend" goal is the file describing the dependencies within the
156 package; it is created by ocamldep.</P
157 ><PRE
158 CLASS="PROGRAMLISTING"
159 >depend: *.ml *.mli
160 $(OCAMLDEP) *.ml *.mli &gt;depend
161 include depend</PRE
162 ><P
163 >The "install" rule is a bit tricky. First it is tested if there is a
164 native archive to install, and if so, the variable "extra" contains
165 the corresponding files. The "ocamlfind install" command creates a new
166 package directory and puts the given files into it.</P
167 ><PRE
168 CLASS="PROGRAMLISTING"
169 >.PHONY: install uninstall
170 install: all
171 ocamlfind install $(NAME) *.mli *.cmi $(ARCHIVE) META \
172 -optional $(XARCHIVE) $(SARCHIVE)
173
174 uninstall:
175 ocamlfind remove $(NAME)</PRE
176 ><P
177 >Last but not least a cleanup rule:</P
178 ><PRE
179 CLASS="PROGRAMLISTING"
180 >.PHONY: clean
181 rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.a</PRE
182 ></DIV
183 ><DIV
184 CLASS="NAVFOOTER"
185 ><HR
186 ALIGN="LEFT"
187 WIDTH="100%"><TABLE
188 SUMMARY="Footer navigation table"
189 WIDTH="100%"
190 BORDER="0"
191 CELLPADDING="0"
192 CELLSPACING="0"
193 ><TR
194 ><TD
195 WIDTH="33%"
196 ALIGN="left"
197 VALIGN="top"
198 ><A
199 HREF="c388.html"
200 ACCESSKEY="P"
201 >Prev</A
202 ></TD
203 ><TD
204 WIDTH="34%"
205 ALIGN="center"
206 VALIGN="top"
207 ><A
208 HREF="index.html"
209 ACCESSKEY="H"
210 >Home</A
211 ></TD
212 ><TD
213 WIDTH="33%"
214 ALIGN="right"
215 VALIGN="top"
216 ><A
217 HREF="x414.html"
218 ACCESSKEY="N"
219 >Next</A
220 ></TD
221 ></TR
222 ><TR
223 ><TD
224 WIDTH="33%"
225 ALIGN="left"
226 VALIGN="top"
227 >How to create your own packages</TD
228 ><TD
229 WIDTH="34%"
230 ALIGN="center"
231 VALIGN="top"
232 ><A
233 HREF="c388.html"
234 ACCESSKEY="U"
235 >Up</A
236 ></TD
237 ><TD
238 WIDTH="33%"
239 ALIGN="right"
240 VALIGN="top"
241 >Using the Makefile wizard</TD
242 ></TR
243 ></TABLE
244 ></DIV
245 ></BODY
246 ></HTML
247 >
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Change your Makefile</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib User's Guide"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="How to create your own packages"
13 HREF="c395.html"><LINK
14 REL="PREVIOUS"
15 TITLE="How to create your own packages"
16 HREF="c395.html"><LINK
17 REL="NEXT"
18 TITLE="Using the Makefile wizard"
19 HREF="x421.html"></HEAD
20 ><BODY
21 CLASS="SECT1"
22 BGCOLOR="#FFFFFF"
23 TEXT="#000000"
24 LINK="#0000FF"
25 VLINK="#840084"
26 ALINK="#0000FF"
27 ><DIV
28 CLASS="NAVHEADER"
29 ><TABLE
30 SUMMARY="Header navigation table"
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >The findlib User's Guide</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="c395.html"
48 ACCESSKEY="P"
49 >Prev</A
50 ></TD
51 ><TD
52 WIDTH="80%"
53 ALIGN="center"
54 VALIGN="bottom"
55 >Chapter 6. How to create your own packages</TD
56 ><TD
57 WIDTH="10%"
58 ALIGN="right"
59 VALIGN="bottom"
60 ><A
61 HREF="x421.html"
62 ACCESSKEY="N"
63 >Next</A
64 ></TD
65 ></TR
66 ></TABLE
67 ><HR
68 ALIGN="LEFT"
69 WIDTH="100%"></DIV
70 ><DIV
71 CLASS="SECT1"
72 ><H1
73 CLASS="SECT1"
74 ><A
75 NAME="AEN403"
76 >Change your Makefile</A
77 ></H1
78 ><P
79 >Here is a commented version of a Makefile that may be used to compile
80 and link a package. It describes the frequent case that the package
81 simply consists of a bundle of modules that are dependent on other
82 packages.</P
83 ><P
84 >First, some general definitions. NAME is the name of the package. The
85 OBJECTS variable enumerates the bytecode objects, whereas XOBJECTS
86 names the native objects. The same naming convention is used for
87 ARCHIVE and XARCHIVE, specifying the resulting bytecode, resp. native
88 archive file. The REQUIRES variable lists the names of the packages
89 that are needed for this package. If you need additional predicates,
90 put them into the PREDICATES variable.</P
91 ><PRE
92 CLASS="PROGRAMLISTING"
93 >NAME = p
94
95 OCAMLC = ocamlfind ocamlc
96 OCAMLOPT = ocamlfind ocamlopt
97 OCAMLDEP = ocamldep
98
99 OBJECTS = p1.cmo p2.cmo
100 XOBJECTS = p1.cmx p2.cmx
101
102 ARCHIVE = $(NAME).cma
103 XARCHIVE = $(NAME).cmxa
104 SARCHIVE = $(NAME).cmxs
105
106 REQUIRES = unix str q r s
107 PREDICATES =</PRE
108 ><P
109 >The default goal is "all", causing the bytecode archive to be
110 created. In order to get a native archive, choose "opt" as second goal.
111 (The ".PHONY" line is a declaration meaningful for GNU-make; "all" and
112 "opt" are only virtual goals as there no files "all", or "opt" which
113 is indicated by making them dependents of ".PHONY".)</P
114 ><PRE
115 CLASS="PROGRAMLISTING"
116 >.PHONY: all opt
117 all: $(ARCHIVE)
118 opt: $(XARCHIVE) $(SARCHIVE)</PRE
119 ><P
120 >The following two rules create the bytecode resp. native archive from
121 the objects.</P
122 ><PRE
123 CLASS="PROGRAMLISTING"
124 >$(ARCHIVE): $(OBJECTS)
125 $(OCAMLC) -a -o $(ARCHIVE) -package "$(REQUIRES)" -linkpkg \
126 -predicates "$(PREDICATES)" $(OBJECTS)
127 $(XARCHIVE): $(XOBJECTS)
128 $(OCAMLOPT) -a -o $(XARCHIVE) -package "$(REQUIRES)" -linkpkg \
129 -predicates "$(PREDICATES)" $(XOBJECTS)
130
131 $(SARCHIVE): $(XARCHIVE)
132 $(OCAMLOPT) -shared -o $(SARCHIVE) $(XARCHIVE) || true</PRE
133 ><P
134 >Note that the cmxs archive is optional: we just ignore the error
135 when it cannot be built.</P
136 ><P
137 >These rules compile the modules independently. The lines similar to
138 ".ml.cmo" must be read: "How to transform files with suffix .ml into
139 files with suffix .cmo". The corresponding command can refer to the
140 input file as "$&lt;" and to the output file(s) as "$@".</P
141 ><PRE
142 CLASS="PROGRAMLISTING"
143 >.SUFFIXES: .cmo .cmi .cmx .ml .mli
144
145 .ml.cmo:
146 $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
147 -c $&lt;
148 .mli.cmi:
149 $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
150 -c $&lt;
151 .ml.cmx:
152 $(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
153 -c $&lt;</PRE
154 ><P
155 >The "depend" goal is the file describing the dependencies within the
156 package; it is created by ocamldep.</P
157 ><PRE
158 CLASS="PROGRAMLISTING"
159 >depend: *.ml *.mli
160 $(OCAMLDEP) *.ml *.mli &gt;depend
161 include depend</PRE
162 ><P
163 >The "install" rule is a bit tricky. First it is tested if there is a
164 native archive to install, and if so, the variable "extra" contains
165 the corresponding files. The "ocamlfind install" command creates a new
166 package directory and puts the given files into it.</P
167 ><PRE
168 CLASS="PROGRAMLISTING"
169 >.PHONY: install uninstall
170 install: all
171 ocamlfind install $(NAME) *.mli *.cmi $(ARCHIVE) META \
172 -optional $(XARCHIVE) $(SARCHIVE)
173
174 uninstall:
175 ocamlfind remove $(NAME)</PRE
176 ><P
177 >Last but not least a cleanup rule:</P
178 ><PRE
179 CLASS="PROGRAMLISTING"
180 >.PHONY: clean
181 rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.a</PRE
182 ></DIV
183 ><DIV
184 CLASS="NAVFOOTER"
185 ><HR
186 ALIGN="LEFT"
187 WIDTH="100%"><TABLE
188 SUMMARY="Footer navigation table"
189 WIDTH="100%"
190 BORDER="0"
191 CELLPADDING="0"
192 CELLSPACING="0"
193 ><TR
194 ><TD
195 WIDTH="33%"
196 ALIGN="left"
197 VALIGN="top"
198 ><A
199 HREF="c395.html"
200 ACCESSKEY="P"
201 >Prev</A
202 ></TD
203 ><TD
204 WIDTH="34%"
205 ALIGN="center"
206 VALIGN="top"
207 ><A
208 HREF="index.html"
209 ACCESSKEY="H"
210 >Home</A
211 ></TD
212 ><TD
213 WIDTH="33%"
214 ALIGN="right"
215 VALIGN="top"
216 ><A
217 HREF="x421.html"
218 ACCESSKEY="N"
219 >Next</A
220 ></TD
221 ></TR
222 ><TR
223 ><TD
224 WIDTH="33%"
225 ALIGN="left"
226 VALIGN="top"
227 >How to create your own packages</TD
228 ><TD
229 WIDTH="34%"
230 ALIGN="center"
231 VALIGN="top"
232 ><A
233 HREF="c395.html"
234 ACCESSKEY="U"
235 >Up</A
236 ></TD
237 ><TD
238 WIDTH="33%"
239 ALIGN="right"
240 VALIGN="top"
241 >Using the Makefile wizard</TD
242 ></TR
243 ></TABLE
244 ></DIV
245 ></BODY
246 ></HTML
247 >
+0
-188
doc/guide-html/x414.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Using the Makefile wizard</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib User's Guide"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="How to create your own packages"
13 HREF="c388.html"><LINK
14 REL="PREVIOUS"
15 TITLE="Change your Makefile"
16 HREF="x396.html"><LINK
17 REL="NEXT"
18 TITLE="FAQs"
19 HREF="c422.html"></HEAD
20 ><BODY
21 CLASS="SECT1"
22 BGCOLOR="#FFFFFF"
23 TEXT="#000000"
24 LINK="#0000FF"
25 VLINK="#840084"
26 ALINK="#0000FF"
27 ><DIV
28 CLASS="NAVHEADER"
29 ><TABLE
30 SUMMARY="Header navigation table"
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >The findlib User's Guide</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="x396.html"
48 ACCESSKEY="P"
49 >Prev</A
50 ></TD
51 ><TD
52 WIDTH="80%"
53 ALIGN="center"
54 VALIGN="bottom"
55 >Chapter 6. How to create your own packages</TD
56 ><TD
57 WIDTH="10%"
58 ALIGN="right"
59 VALIGN="bottom"
60 ><A
61 HREF="c422.html"
62 ACCESSKEY="N"
63 >Next</A
64 ></TD
65 ></TR
66 ></TABLE
67 ><HR
68 ALIGN="LEFT"
69 WIDTH="100%"></DIV
70 ><DIV
71 CLASS="SECT1"
72 ><H1
73 CLASS="SECT1"
74 ><A
75 NAME="AEN414"
76 >Using the Makefile wizard</A
77 ></H1
78 ><P
79 >Especially for beginners, the findlib distribution includes a GUI to
80 create Makefiles. As this is an optional feature, it must have been
81 selected when findlib was built (option -with-toolbox). To invoke the
82 GUI, run the command
83
84 <PRE
85 CLASS="PROGRAMLISTING"
86 >$ ocamlfind findlib/make_wizard</PRE
87 >
88
89 (Btw, this is the general syntax to run executables installed in
90 package directories.) The wizard starts, and allows you to describe
91 your project. When you save the result, not only a "Makefile" is
92 created, but also the file ".make-wizard" containing the state.
93 If you later start the wizard again, this file will be automatically
94 loaded, and you can modify your definition.</P
95 ><P
96 >The wizard consists of seven (hopefully self-explanatory) pages
97 you can fill out. The basic idea is that the .ml, .mli, .mly, and .mll
98 files in the current directory are compiled to a .cma or .cmxa
99 archive, and that optionally executables are created from this archive
100 and from additional modules (main programs). This scheme can be both
101 used for libraries and application programs.</P
102 ><P
103 >You can choose packages you want to use in your library or
104 program by clicking at them in a selection box. The camlp4 syntax
105 parsers can be optionally enabled. The modules to be compiled can
106 be picked from the current directory, they must be selected in the
107 right order, however.</P
108 ><P
109 >The generated "Makefile" defines a number of logical targets
110 (like "all", "opt", etc) that are explained at the beginning of the
111 file. The file is fully commented, and not very difficult to understand.
112 Only traditional Makefile syntax is used, so it is expected that it
113 works for every version of the "make" utility.</P
114 ><P
115 >When you build the project, the META file is created
116 dynamically. If you do not like this, set the variable MAKE_META to
117 the empty string. (It is a good idea to put such setting into a
118 second file, and enter the name of this file into the box "Local
119 extensions in" of the wizard, so you can generate the "Makefile" again
120 without overwriting your own modifications. This second file can
121 override the setting in the generated "Makefile".)</P
122 ></DIV
123 ><DIV
124 CLASS="NAVFOOTER"
125 ><HR
126 ALIGN="LEFT"
127 WIDTH="100%"><TABLE
128 SUMMARY="Footer navigation table"
129 WIDTH="100%"
130 BORDER="0"
131 CELLPADDING="0"
132 CELLSPACING="0"
133 ><TR
134 ><TD
135 WIDTH="33%"
136 ALIGN="left"
137 VALIGN="top"
138 ><A
139 HREF="x396.html"
140 ACCESSKEY="P"
141 >Prev</A
142 ></TD
143 ><TD
144 WIDTH="34%"
145 ALIGN="center"
146 VALIGN="top"
147 ><A
148 HREF="index.html"
149 ACCESSKEY="H"
150 >Home</A
151 ></TD
152 ><TD
153 WIDTH="33%"
154 ALIGN="right"
155 VALIGN="top"
156 ><A
157 HREF="c422.html"
158 ACCESSKEY="N"
159 >Next</A
160 ></TD
161 ></TR
162 ><TR
163 ><TD
164 WIDTH="33%"
165 ALIGN="left"
166 VALIGN="top"
167 >Change your Makefile</TD
168 ><TD
169 WIDTH="34%"
170 ALIGN="center"
171 VALIGN="top"
172 ><A
173 HREF="c388.html"
174 ACCESSKEY="U"
175 >Up</A
176 ></TD
177 ><TD
178 WIDTH="33%"
179 ALIGN="right"
180 VALIGN="top"
181 >FAQs</TD
182 ></TR
183 ></TABLE
184 ></DIV
185 ></BODY
186 ></HTML
187 >
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Using the Makefile wizard</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib User's Guide"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="How to create your own packages"
13 HREF="c395.html"><LINK
14 REL="PREVIOUS"
15 TITLE="Change your Makefile"
16 HREF="x403.html"><LINK
17 REL="NEXT"
18 TITLE="FAQs"
19 HREF="c429.html"></HEAD
20 ><BODY
21 CLASS="SECT1"
22 BGCOLOR="#FFFFFF"
23 TEXT="#000000"
24 LINK="#0000FF"
25 VLINK="#840084"
26 ALINK="#0000FF"
27 ><DIV
28 CLASS="NAVHEADER"
29 ><TABLE
30 SUMMARY="Header navigation table"
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >The findlib User's Guide</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="x403.html"
48 ACCESSKEY="P"
49 >Prev</A
50 ></TD
51 ><TD
52 WIDTH="80%"
53 ALIGN="center"
54 VALIGN="bottom"
55 >Chapter 6. How to create your own packages</TD
56 ><TD
57 WIDTH="10%"
58 ALIGN="right"
59 VALIGN="bottom"
60 ><A
61 HREF="c429.html"
62 ACCESSKEY="N"
63 >Next</A
64 ></TD
65 ></TR
66 ></TABLE
67 ><HR
68 ALIGN="LEFT"
69 WIDTH="100%"></DIV
70 ><DIV
71 CLASS="SECT1"
72 ><H1
73 CLASS="SECT1"
74 ><A
75 NAME="AEN421"
76 >Using the Makefile wizard</A
77 ></H1
78 ><P
79 >Especially for beginners, the findlib distribution includes a GUI to
80 create Makefiles. As this is an optional feature, it must have been
81 selected when findlib was built (option -with-toolbox). To invoke the
82 GUI, run the command
83
84 <PRE
85 CLASS="PROGRAMLISTING"
86 >$ ocamlfind findlib/make_wizard</PRE
87 >
88
89 (Btw, this is the general syntax to run executables installed in
90 package directories.) The wizard starts, and allows you to describe
91 your project. When you save the result, not only a "Makefile" is
92 created, but also the file ".make-wizard" containing the state.
93 If you later start the wizard again, this file will be automatically
94 loaded, and you can modify your definition.</P
95 ><P
96 >The wizard consists of seven (hopefully self-explanatory) pages
97 you can fill out. The basic idea is that the .ml, .mli, .mly, and .mll
98 files in the current directory are compiled to a .cma or .cmxa
99 archive, and that optionally executables are created from this archive
100 and from additional modules (main programs). This scheme can be both
101 used for libraries and application programs.</P
102 ><P
103 >You can choose packages you want to use in your library or
104 program by clicking at them in a selection box. The camlp4 syntax
105 parsers can be optionally enabled. The modules to be compiled can
106 be picked from the current directory, they must be selected in the
107 right order, however.</P
108 ><P
109 >The generated "Makefile" defines a number of logical targets
110 (like "all", "opt", etc) that are explained at the beginning of the
111 file. The file is fully commented, and not very difficult to understand.
112 Only traditional Makefile syntax is used, so it is expected that it
113 works for every version of the "make" utility.</P
114 ><P
115 >When you build the project, the META file is created
116 dynamically. If you do not like this, set the variable MAKE_META to
117 the empty string. (It is a good idea to put such setting into a
118 second file, and enter the name of this file into the box "Local
119 extensions in" of the wizard, so you can generate the "Makefile" again
120 without overwriting your own modifications. This second file can
121 override the setting in the generated "Makefile".)</P
122 ></DIV
123 ><DIV
124 CLASS="NAVFOOTER"
125 ><HR
126 ALIGN="LEFT"
127 WIDTH="100%"><TABLE
128 SUMMARY="Footer navigation table"
129 WIDTH="100%"
130 BORDER="0"
131 CELLPADDING="0"
132 CELLSPACING="0"
133 ><TR
134 ><TD
135 WIDTH="33%"
136 ALIGN="left"
137 VALIGN="top"
138 ><A
139 HREF="x403.html"
140 ACCESSKEY="P"
141 >Prev</A
142 ></TD
143 ><TD
144 WIDTH="34%"
145 ALIGN="center"
146 VALIGN="top"
147 ><A
148 HREF="index.html"
149 ACCESSKEY="H"
150 >Home</A
151 ></TD
152 ><TD
153 WIDTH="33%"
154 ALIGN="right"
155 VALIGN="top"
156 ><A
157 HREF="c429.html"
158 ACCESSKEY="N"
159 >Next</A
160 ></TD
161 ></TR
162 ><TR
163 ><TD
164 WIDTH="33%"
165 ALIGN="left"
166 VALIGN="top"
167 >Change your Makefile</TD
168 ><TD
169 WIDTH="34%"
170 ALIGN="center"
171 VALIGN="top"
172 ><A
173 HREF="c395.html"
174 ACCESSKEY="U"
175 >Up</A
176 ></TD
177 ><TD
178 WIDTH="33%"
179 ALIGN="right"
180 VALIGN="top"
181 >FAQs</TD
182 ></TR
183 ></TABLE
184 ></DIV
185 ></BODY
186 ></HTML
187 >
+0
-170
doc/guide-html/x436.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Why does findlib not automatically include the -custom option if
5 linked with C code?</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9 REL="HOME"
10 TITLE="The findlib User's Guide"
11 HREF="index.html"><LINK
12 REL="UP"
13 TITLE="FAQs"
14 HREF="c422.html"><LINK
15 REL="PREVIOUS"
16 TITLE="FAQs"
17 HREF="c422.html"><LINK
18 REL="NEXT"
19 TITLE="Does findlib support linking of applications as well as
20 packages?"
21 HREF="x442.html"></HEAD
22 ><BODY
23 CLASS="SECT1"
24 BGCOLOR="#FFFFFF"
25 TEXT="#000000"
26 LINK="#0000FF"
27 VLINK="#840084"
28 ALINK="#0000FF"
29 ><DIV
30 CLASS="NAVHEADER"
31 ><TABLE
32 SUMMARY="Header navigation table"
33 WIDTH="100%"
34 BORDER="0"
35 CELLPADDING="0"
36 CELLSPACING="0"
37 ><TR
38 ><TH
39 COLSPAN="3"
40 ALIGN="center"
41 >The findlib User's Guide</TH
42 ></TR
43 ><TR
44 ><TD
45 WIDTH="10%"
46 ALIGN="left"
47 VALIGN="bottom"
48 ><A
49 HREF="c422.html"
50 ACCESSKEY="P"
51 >Prev</A
52 ></TD
53 ><TD
54 WIDTH="80%"
55 ALIGN="center"
56 VALIGN="bottom"
57 >Chapter 7. FAQs</TD
58 ><TD
59 WIDTH="10%"
60 ALIGN="right"
61 VALIGN="bottom"
62 ><A
63 HREF="x442.html"
64 ACCESSKEY="N"
65 >Next</A
66 ></TD
67 ></TR
68 ></TABLE
69 ><HR
70 ALIGN="LEFT"
71 WIDTH="100%"></DIV
72 ><DIV
73 CLASS="SECT1"
74 ><H1
75 CLASS="SECT1"
76 ><A
77 NAME="AEN436"
78 >Why does findlib not automatically include the -custom option if
79 linked with C code?</A
80 ></H1
81 ><P
82 ><SPAN
83 CLASS="emphasis"
84 ><I
85 CLASS="EMPHASIS"
86 >Short answer:</I
87 ></SPAN
88 >
89 Because there are several ways of linking, and findlib is not the
90 right instance to find out the right way</P
91 ><P
92 >Recent versions of OCaml support DLLs, at least for some
93 platforms. Here, the option -custom is not necessary at all, because the
94 C libraries can be looked up and loaded at runtime. The option -custom
95 would have the effect of forcing static linking.</P
96 ><P
97 >But even for platforms without DLL support, there are two
98 alternatives. One possibility is to use -custom, and the other is to
99 create runtime systems with -make-runtime, and reference them with
100 -use-runtime. Fortunately, recent versions of OCaml select now themselves
101 -custom automatically if -make-runtime is omitted, so findlib needs not to
102 bother with it.</P
103 ></DIV
104 ><DIV
105 CLASS="NAVFOOTER"
106 ><HR
107 ALIGN="LEFT"
108 WIDTH="100%"><TABLE
109 SUMMARY="Footer navigation table"
110 WIDTH="100%"
111 BORDER="0"
112 CELLPADDING="0"
113 CELLSPACING="0"
114 ><TR
115 ><TD
116 WIDTH="33%"
117 ALIGN="left"
118 VALIGN="top"
119 ><A
120 HREF="c422.html"
121 ACCESSKEY="P"
122 >Prev</A
123 ></TD
124 ><TD
125 WIDTH="34%"
126 ALIGN="center"
127 VALIGN="top"
128 ><A
129 HREF="index.html"
130 ACCESSKEY="H"
131 >Home</A
132 ></TD
133 ><TD
134 WIDTH="33%"
135 ALIGN="right"
136 VALIGN="top"
137 ><A
138 HREF="x442.html"
139 ACCESSKEY="N"
140 >Next</A
141 ></TD
142 ></TR
143 ><TR
144 ><TD
145 WIDTH="33%"
146 ALIGN="left"
147 VALIGN="top"
148 >FAQs</TD
149 ><TD
150 WIDTH="34%"
151 ALIGN="center"
152 VALIGN="top"
153 ><A
154 HREF="c422.html"
155 ACCESSKEY="U"
156 >Up</A
157 ></TD
158 ><TD
159 WIDTH="33%"
160 ALIGN="right"
161 VALIGN="top"
162 >Does findlib support linking of applications as well as
163 packages?</TD
164 ></TR
165 ></TABLE
166 ></DIV
167 ></BODY
168 ></HTML
169 >
+0
-211
doc/guide-html/x442.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Does findlib support linking of applications as well as
5 packages?</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9 REL="HOME"
10 TITLE="The findlib User's Guide"
11 HREF="index.html"><LINK
12 REL="UP"
13 TITLE="FAQs"
14 HREF="c422.html"><LINK
15 REL="PREVIOUS"
16 TITLE="Why does findlib not automatically include the -custom option if
17 linked with C code?"
18 HREF="x436.html"><LINK
19 REL="NEXT"
20 TITLE=" Does Findlib support camlp4?
21 "
22 HREF="x454.html"></HEAD
23 ><BODY
24 CLASS="SECT1"
25 BGCOLOR="#FFFFFF"
26 TEXT="#000000"
27 LINK="#0000FF"
28 VLINK="#840084"
29 ALINK="#0000FF"
30 ><DIV
31 CLASS="NAVHEADER"
32 ><TABLE
33 SUMMARY="Header navigation table"
34 WIDTH="100%"
35 BORDER="0"
36 CELLPADDING="0"
37 CELLSPACING="0"
38 ><TR
39 ><TH
40 COLSPAN="3"
41 ALIGN="center"
42 >The findlib User's Guide</TH
43 ></TR
44 ><TR
45 ><TD
46 WIDTH="10%"
47 ALIGN="left"
48 VALIGN="bottom"
49 ><A
50 HREF="x436.html"
51 ACCESSKEY="P"
52 >Prev</A
53 ></TD
54 ><TD
55 WIDTH="80%"
56 ALIGN="center"
57 VALIGN="bottom"
58 >Chapter 7. FAQs</TD
59 ><TD
60 WIDTH="10%"
61 ALIGN="right"
62 VALIGN="bottom"
63 ><A
64 HREF="x454.html"
65 ACCESSKEY="N"
66 >Next</A
67 ></TD
68 ></TR
69 ></TABLE
70 ><HR
71 ALIGN="LEFT"
72 WIDTH="100%"></DIV
73 ><DIV
74 CLASS="SECT1"
75 ><H1
76 CLASS="SECT1"
77 ><A
78 NAME="AEN442"
79 >Does findlib support linking of applications as well as
80 packages?</A
81 ></H1
82 ><P
83 ><SPAN
84 CLASS="emphasis"
85 ><I
86 CLASS="EMPHASIS"
87 >Short answer:</I
88 ></SPAN
89 > Yes, but it is not very obvious</P
90 ><P
91 >Applications also depend on other components, they have predicates, sometimes
92 they need linker options; there seems to be only little difference between
93 applications (stand-alone programs) and packages. If you want to use the
94 findlib mechanisms for applications, too, the following trick helps.</P
95 ><P
96 >The environment variable <TT
97 CLASS="LITERAL"
98 >OCAMLPATH</TT
99 > may contain a
100 colon-separated path of possible sitelib locations. It is allowed to include
101 "." into the path (Shell commands follow):
102
103 <PRE
104 CLASS="PROGRAMLISTING"
105 >OCAMLPATH=.
106 export OCAMLPATH</PRE
107 >
108
109 This makes ".", i.e. your current directory, another sitelib location. You may
110 now put the components of your applications into subdirectories together with
111 META files; the hierarchy might look as follows:
112
113 <PRE
114 CLASS="PROGRAMLISTING"
115 >./Makefile global Makefile
116 ./localpkg1/META first local package directory: Contains META
117 ./localpkg1/... ... and more
118 ./localpkg2/META second local package dir: Contains META
119 ./localpkg2/... ... and more
120 ...</PRE
121 >
122
123 From findlib's point of view, these directories are now package directories,
124 and you can refer to them on the command line:
125
126 <PRE
127 CLASS="PROGRAMLISTING"
128 >ocamlfind ocamlc -o ... -linkpkg -package localpkg1,localpkg2,...</PRE
129 >
130
131 If you do not want subdirectories, you can also refer to the META file in the
132 same directory by the name ".", e.g.:
133
134 <PRE
135 CLASS="PROGRAMLISTING"
136 >ocamlfind ocamlc -o ... -linkpkg -package .</PRE
137 >
138
139 In this case, the linking information will be taken from
140 <TT
141 CLASS="LITERAL"
142 >./META</TT
143 >.</P
144 ></DIV
145 ><DIV
146 CLASS="NAVFOOTER"
147 ><HR
148 ALIGN="LEFT"
149 WIDTH="100%"><TABLE
150 SUMMARY="Footer navigation table"
151 WIDTH="100%"
152 BORDER="0"
153 CELLPADDING="0"
154 CELLSPACING="0"
155 ><TR
156 ><TD
157 WIDTH="33%"
158 ALIGN="left"
159 VALIGN="top"
160 ><A
161 HREF="x436.html"
162 ACCESSKEY="P"
163 >Prev</A
164 ></TD
165 ><TD
166 WIDTH="34%"
167 ALIGN="center"
168 VALIGN="top"
169 ><A
170 HREF="index.html"
171 ACCESSKEY="H"
172 >Home</A
173 ></TD
174 ><TD
175 WIDTH="33%"
176 ALIGN="right"
177 VALIGN="top"
178 ><A
179 HREF="x454.html"
180 ACCESSKEY="N"
181 >Next</A
182 ></TD
183 ></TR
184 ><TR
185 ><TD
186 WIDTH="33%"
187 ALIGN="left"
188 VALIGN="top"
189 >Why does findlib not automatically include the -custom option if
190 linked with C code?</TD
191 ><TD
192 WIDTH="34%"
193 ALIGN="center"
194 VALIGN="top"
195 ><A
196 HREF="c422.html"
197 ACCESSKEY="U"
198 >Up</A
199 ></TD
200 ><TD
201 WIDTH="33%"
202 ALIGN="right"
203 VALIGN="top"
204 >Does Findlib support camlp4?</TD
205 ></TR
206 ></TABLE
207 ></DIV
208 ></BODY
209 ></HTML
210 >
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Why does findlib not automatically include the -custom option if
5 linked with C code?</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9 REL="HOME"
10 TITLE="The findlib User's Guide"
11 HREF="index.html"><LINK
12 REL="UP"
13 TITLE="FAQs"
14 HREF="c429.html"><LINK
15 REL="PREVIOUS"
16 TITLE="FAQs"
17 HREF="c429.html"><LINK
18 REL="NEXT"
19 TITLE="Does findlib support linking of applications as well as
20 packages?"
21 HREF="x449.html"></HEAD
22 ><BODY
23 CLASS="SECT1"
24 BGCOLOR="#FFFFFF"
25 TEXT="#000000"
26 LINK="#0000FF"
27 VLINK="#840084"
28 ALINK="#0000FF"
29 ><DIV
30 CLASS="NAVHEADER"
31 ><TABLE
32 SUMMARY="Header navigation table"
33 WIDTH="100%"
34 BORDER="0"
35 CELLPADDING="0"
36 CELLSPACING="0"
37 ><TR
38 ><TH
39 COLSPAN="3"
40 ALIGN="center"
41 >The findlib User's Guide</TH
42 ></TR
43 ><TR
44 ><TD
45 WIDTH="10%"
46 ALIGN="left"
47 VALIGN="bottom"
48 ><A
49 HREF="c429.html"
50 ACCESSKEY="P"
51 >Prev</A
52 ></TD
53 ><TD
54 WIDTH="80%"
55 ALIGN="center"
56 VALIGN="bottom"
57 >Chapter 7. FAQs</TD
58 ><TD
59 WIDTH="10%"
60 ALIGN="right"
61 VALIGN="bottom"
62 ><A
63 HREF="x449.html"
64 ACCESSKEY="N"
65 >Next</A
66 ></TD
67 ></TR
68 ></TABLE
69 ><HR
70 ALIGN="LEFT"
71 WIDTH="100%"></DIV
72 ><DIV
73 CLASS="SECT1"
74 ><H1
75 CLASS="SECT1"
76 ><A
77 NAME="AEN443"
78 >Why does findlib not automatically include the -custom option if
79 linked with C code?</A
80 ></H1
81 ><P
82 ><SPAN
83 CLASS="emphasis"
84 ><I
85 CLASS="EMPHASIS"
86 >Short answer:</I
87 ></SPAN
88 >
89 Because there are several ways of linking, and findlib is not the
90 right instance to find out the right way</P
91 ><P
92 >Recent versions of OCaml support DLLs, at least for some
93 platforms. Here, the option -custom is not necessary at all, because the
94 C libraries can be looked up and loaded at runtime. The option -custom
95 would have the effect of forcing static linking.</P
96 ><P
97 >But even for platforms without DLL support, there are two
98 alternatives. One possibility is to use -custom, and the other is to
99 create runtime systems with -make-runtime, and reference them with
100 -use-runtime. Fortunately, recent versions of OCaml select now themselves
101 -custom automatically if -make-runtime is omitted, so findlib needs not to
102 bother with it.</P
103 ></DIV
104 ><DIV
105 CLASS="NAVFOOTER"
106 ><HR
107 ALIGN="LEFT"
108 WIDTH="100%"><TABLE
109 SUMMARY="Footer navigation table"
110 WIDTH="100%"
111 BORDER="0"
112 CELLPADDING="0"
113 CELLSPACING="0"
114 ><TR
115 ><TD
116 WIDTH="33%"
117 ALIGN="left"
118 VALIGN="top"
119 ><A
120 HREF="c429.html"
121 ACCESSKEY="P"
122 >Prev</A
123 ></TD
124 ><TD
125 WIDTH="34%"
126 ALIGN="center"
127 VALIGN="top"
128 ><A
129 HREF="index.html"
130 ACCESSKEY="H"
131 >Home</A
132 ></TD
133 ><TD
134 WIDTH="33%"
135 ALIGN="right"
136 VALIGN="top"
137 ><A
138 HREF="x449.html"
139 ACCESSKEY="N"
140 >Next</A
141 ></TD
142 ></TR
143 ><TR
144 ><TD
145 WIDTH="33%"
146 ALIGN="left"
147 VALIGN="top"
148 >FAQs</TD
149 ><TD
150 WIDTH="34%"
151 ALIGN="center"
152 VALIGN="top"
153 ><A
154 HREF="c429.html"
155 ACCESSKEY="U"
156 >Up</A
157 ></TD
158 ><TD
159 WIDTH="33%"
160 ALIGN="right"
161 VALIGN="top"
162 >Does findlib support linking of applications as well as
163 packages?</TD
164 ></TR
165 ></TABLE
166 ></DIV
167 ></BODY
168 ></HTML
169 >
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Does findlib support linking of applications as well as
5 packages?</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9 REL="HOME"
10 TITLE="The findlib User's Guide"
11 HREF="index.html"><LINK
12 REL="UP"
13 TITLE="FAQs"
14 HREF="c429.html"><LINK
15 REL="PREVIOUS"
16 TITLE="Why does findlib not automatically include the -custom option if
17 linked with C code?"
18 HREF="x443.html"><LINK
19 REL="NEXT"
20 TITLE=" Does Findlib support camlp4?
21 "
22 HREF="x461.html"></HEAD
23 ><BODY
24 CLASS="SECT1"
25 BGCOLOR="#FFFFFF"
26 TEXT="#000000"
27 LINK="#0000FF"
28 VLINK="#840084"
29 ALINK="#0000FF"
30 ><DIV
31 CLASS="NAVHEADER"
32 ><TABLE
33 SUMMARY="Header navigation table"
34 WIDTH="100%"
35 BORDER="0"
36 CELLPADDING="0"
37 CELLSPACING="0"
38 ><TR
39 ><TH
40 COLSPAN="3"
41 ALIGN="center"
42 >The findlib User's Guide</TH
43 ></TR
44 ><TR
45 ><TD
46 WIDTH="10%"
47 ALIGN="left"
48 VALIGN="bottom"
49 ><A
50 HREF="x443.html"
51 ACCESSKEY="P"
52 >Prev</A
53 ></TD
54 ><TD
55 WIDTH="80%"
56 ALIGN="center"
57 VALIGN="bottom"
58 >Chapter 7. FAQs</TD
59 ><TD
60 WIDTH="10%"
61 ALIGN="right"
62 VALIGN="bottom"
63 ><A
64 HREF="x461.html"
65 ACCESSKEY="N"
66 >Next</A
67 ></TD
68 ></TR
69 ></TABLE
70 ><HR
71 ALIGN="LEFT"
72 WIDTH="100%"></DIV
73 ><DIV
74 CLASS="SECT1"
75 ><H1
76 CLASS="SECT1"
77 ><A
78 NAME="AEN449"
79 >Does findlib support linking of applications as well as
80 packages?</A
81 ></H1
82 ><P
83 ><SPAN
84 CLASS="emphasis"
85 ><I
86 CLASS="EMPHASIS"
87 >Short answer:</I
88 ></SPAN
89 > Yes, but it is not very obvious</P
90 ><P
91 >Applications also depend on other components, they have predicates, sometimes
92 they need linker options; there seems to be only little difference between
93 applications (stand-alone programs) and packages. If you want to use the
94 findlib mechanisms for applications, too, the following trick helps.</P
95 ><P
96 >The environment variable <TT
97 CLASS="LITERAL"
98 >OCAMLPATH</TT
99 > may contain a
100 colon-separated path of possible sitelib locations. It is allowed to include
101 "." into the path (Shell commands follow):
102
103 <PRE
104 CLASS="PROGRAMLISTING"
105 >OCAMLPATH=.
106 export OCAMLPATH</PRE
107 >
108
109 This makes ".", i.e. your current directory, another sitelib location. You may
110 now put the components of your applications into subdirectories together with
111 META files; the hierarchy might look as follows:
112
113 <PRE
114 CLASS="PROGRAMLISTING"
115 >./Makefile global Makefile
116 ./localpkg1/META first local package directory: Contains META
117 ./localpkg1/... ... and more
118 ./localpkg2/META second local package dir: Contains META
119 ./localpkg2/... ... and more
120 ...</PRE
121 >
122
123 From findlib's point of view, these directories are now package directories,
124 and you can refer to them on the command line:
125
126 <PRE
127 CLASS="PROGRAMLISTING"
128 >ocamlfind ocamlc -o ... -linkpkg -package localpkg1,localpkg2,...</PRE
129 >
130
131 If you do not want subdirectories, you can also refer to the META file in the
132 same directory by the name ".", e.g.:
133
134 <PRE
135 CLASS="PROGRAMLISTING"
136 >ocamlfind ocamlc -o ... -linkpkg -package .</PRE
137 >
138
139 In this case, the linking information will be taken from
140 <TT
141 CLASS="LITERAL"
142 >./META</TT
143 >.</P
144 ></DIV
145 ><DIV
146 CLASS="NAVFOOTER"
147 ><HR
148 ALIGN="LEFT"
149 WIDTH="100%"><TABLE
150 SUMMARY="Footer navigation table"
151 WIDTH="100%"
152 BORDER="0"
153 CELLPADDING="0"
154 CELLSPACING="0"
155 ><TR
156 ><TD
157 WIDTH="33%"
158 ALIGN="left"
159 VALIGN="top"
160 ><A
161 HREF="x443.html"
162 ACCESSKEY="P"
163 >Prev</A
164 ></TD
165 ><TD
166 WIDTH="34%"
167 ALIGN="center"
168 VALIGN="top"
169 ><A
170 HREF="index.html"
171 ACCESSKEY="H"
172 >Home</A
173 ></TD
174 ><TD
175 WIDTH="33%"
176 ALIGN="right"
177 VALIGN="top"
178 ><A
179 HREF="x461.html"
180 ACCESSKEY="N"
181 >Next</A
182 ></TD
183 ></TR
184 ><TR
185 ><TD
186 WIDTH="33%"
187 ALIGN="left"
188 VALIGN="top"
189 >Why does findlib not automatically include the -custom option if
190 linked with C code?</TD
191 ><TD
192 WIDTH="34%"
193 ALIGN="center"
194 VALIGN="top"
195 ><A
196 HREF="c429.html"
197 ACCESSKEY="U"
198 >Up</A
199 ></TD
200 ><TD
201 WIDTH="33%"
202 ALIGN="right"
203 VALIGN="top"
204 >Does Findlib support camlp4?</TD
205 ></TR
206 ></TABLE
207 ></DIV
208 ></BODY
209 ></HTML
210 >
+0
-384
doc/guide-html/x454.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 > Does Findlib support camlp4?
5 </TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9 REL="HOME"
10 TITLE="The findlib User's Guide"
11 HREF="index.html"><LINK
12 REL="UP"
13 TITLE="FAQs"
14 HREF="c422.html"><LINK
15 REL="PREVIOUS"
16 TITLE="Does findlib support linking of applications as well as
17 packages?"
18 HREF="x442.html"><LINK
19 REL="NEXT"
20 TITLE=" Does Findlib support ppx-style preprocessors?
21 "
22 HREF="x506.html"></HEAD
23 ><BODY
24 CLASS="SECT1"
25 BGCOLOR="#FFFFFF"
26 TEXT="#000000"
27 LINK="#0000FF"
28 VLINK="#840084"
29 ALINK="#0000FF"
30 ><DIV
31 CLASS="NAVHEADER"
32 ><TABLE
33 SUMMARY="Header navigation table"
34 WIDTH="100%"
35 BORDER="0"
36 CELLPADDING="0"
37 CELLSPACING="0"
38 ><TR
39 ><TH
40 COLSPAN="3"
41 ALIGN="center"
42 >The findlib User's Guide</TH
43 ></TR
44 ><TR
45 ><TD
46 WIDTH="10%"
47 ALIGN="left"
48 VALIGN="bottom"
49 ><A
50 HREF="x442.html"
51 ACCESSKEY="P"
52 >Prev</A
53 ></TD
54 ><TD
55 WIDTH="80%"
56 ALIGN="center"
57 VALIGN="bottom"
58 >Chapter 7. FAQs</TD
59 ><TD
60 WIDTH="10%"
61 ALIGN="right"
62 VALIGN="bottom"
63 ><A
64 HREF="x506.html"
65 ACCESSKEY="N"
66 >Next</A
67 ></TD
68 ></TR
69 ></TABLE
70 ><HR
71 ALIGN="LEFT"
72 WIDTH="100%"></DIV
73 ><DIV
74 CLASS="SECT1"
75 ><H1
76 CLASS="SECT1"
77 ><A
78 NAME="AEN454"
79 >Does Findlib support camlp4?</A
80 ></H1
81 ><P
82 > <SPAN
83 CLASS="emphasis"
84 ><I
85 CLASS="EMPHASIS"
86 >Short answer:</I
87 ></SPAN
88 > Yes, but there is only little
89 documentation.</P
90 ><P
91 > Since Findlib-0.4, there is some experimental camlp4 support. For
92 example, the following compiler invocation chooses the revised syntax:
93
94 <PRE
95 CLASS="PROGRAMLISTING"
96 >ocamlfind ocamlc -syntax camlp4r -package camlp4 -c file.ml</PRE
97 >
98
99 As you can see, camlp4 must be included as package, and the
100 -syntax option must specify which syntax is selected (either
101 <TT
102 CLASS="LITERAL"
103 >camlp4o</TT
104 > or <TT
105 CLASS="LITERAL"
106 >camlp4r</TT
107 >).</P
108 ><P
109 > If you want to pass additional options to the preprocessor,
110 you can use the <TT
111 CLASS="LITERAL"
112 >-ppopt</TT
113 > option:
114
115 <PRE
116 CLASS="PROGRAMLISTING"
117 >ocamlfind ocamlc -syntax camlp4r -package camlp4 -ppopt pa_ifdef.cmo -c file.ml</PRE
118 >
119 </P
120 ><P
121 >From the toploop, the following commands work:
122
123 <PRE
124 CLASS="PROGRAMLISTING"
125 >$ ocaml
126 Objective Caml version 3.07+2
127
128 # #use "./topfind";;
129 - : unit = ()
130 Findlib has been successfully loaded. Additional directives:
131 #require "package";; to load a package
132 #list;; to list the available packages
133 #camlp4o;; to load camlp4 (standard syntax)
134 #camlp4r;; to load camlp4 (revised syntax)
135 #predicates "p,q,...";; to set these predicates
136 Topfind.reset();; to force that packages will be reloaded
137 #thread;; to enable threads
138
139 - : unit = ()
140 # #camlp4o;; (* or camlp4r *)
141 /opt/godi/lib/ocaml/std-lib/camlp4: added to search path
142 /opt/godi/lib/ocaml/std-lib/camlp4/camlp4o.cma: loaded
143 Camlp4 Parsing version 3.07+2
144
145 # _</PRE
146 >&#13;</P
147 ><DIV
148 CLASS="SECT2"
149 ><H2
150 CLASS="SECT2"
151 ><A
152 NAME="AEN467"
153 >The concept</A
154 ></H2
155 ><P
156 >If you have a <TT
157 CLASS="LITERAL"
158 >-syntax</TT
159 > option on the command line,
160 ocamlfind will generate a <TT
161 CLASS="LITERAL"
162 >-pp</TT
163 > parameter and pass it to the
164 invoked compiler. This is performed as follows: The specified packages are
165 inspected under a certain set of predicates, the <SPAN
166 CLASS="emphasis"
167 ><I
168 CLASS="EMPHASIS"
169 >syntax
170 predicates</I
171 ></SPAN
172 >. The syntax predicates are <TT
173 CLASS="LITERAL"
174 >syntax</TT
175 >,
176 <TT
177 CLASS="LITERAL"
178 >preprocessor</TT
179 >, and the predicates following
180 <TT
181 CLASS="LITERAL"
182 >-syntax</TT
183 >. The predicate <TT
184 CLASS="LITERAL"
185 >syntax</TT
186 > simply
187 means that the <TT
188 CLASS="LITERAL"
189 >-syntax</TT
190 > option has been specified.
191 The predicate <TT
192 CLASS="LITERAL"
193 >preprocessor</TT
194 > means that the preprocessor
195 command is being constructed. The predicates added by
196 <TT
197 CLASS="LITERAL"
198 >-syntax</TT
199 > may be used to distinguish between syntax variants
200 (currently <TT
201 CLASS="LITERAL"
202 >camlp4o</TT
203 > and <TT
204 CLASS="LITERAL"
205 >camlp4r</TT
206 >).</P
207 ><P
208 >The packages are searched for a variable <TT
209 CLASS="LITERAL"
210 >preprocessor</TT
211 >;
212 normally the <TT
213 CLASS="LITERAL"
214 >camlp4</TT
215 > package defines it as (see its META
216 file):
217
218 <PRE
219 CLASS="PROGRAMLISTING"
220 >preprocessor = "camlp4 -nolib"</PRE
221 >
222
223 Now that the name of the preprocessor command is known, the arguments of the
224 command are looked up. The META files are evaluated under the syntax
225 predicates, and all <TT
226 CLASS="LITERAL"
227 >archive</TT
228 > variables are collected and
229 passed as arguments to the preprocessor. For example, the camlp4 package
230 defines:
231
232 <PRE
233 CLASS="PROGRAMLISTING"
234 >archive(syntax,preprocessor,camlp4o) = "pa_o.cmo pa_op.cmo pr_dump.cmo"
235 archive(syntax,preprocessor,camlp4r) = "pa_r.cmo pa_rp.cmo pr_dump.cmo"</PRE
236 >
237
238 Note that the predicate <TT
239 CLASS="LITERAL"
240 >preprocessor</TT
241 > prevents ocamlfind from
242 including these archives into the regular list of archives to link.</P
243 ></DIV
244 ><DIV
245 CLASS="SECT2"
246 ><H2
247 CLASS="SECT2"
248 ><A
249 NAME="AEN489"
250 >How to write a META file for your own syntax extension</A
251 ></H2
252 ><P
253 >Suppose you have two archives: <TT
254 CLASS="LITERAL"
255 >pa_myext.cma</TT
256 > contains the
257 extension code of camlp4, and <TT
258 CLASS="LITERAL"
259 >run_myext.cma</TT
260 > contains runtime
261 material that must be present in programs compiled with your extensions. Your
262 META file should look as follows:
263
264 <PRE
265 CLASS="PROGRAMLISTING"
266 >requires = "camlp4"
267 archive(syntax,toploop) = "pa_myext.cma run_myext.cma"
268 archive(syntax,preprocessor) = "pa_myext.cma"
269 archive(syntax,byte) = "run_myext.cma"
270 archive(syntax,native) = "run_myext.cmxa"</PRE
271 >
272
273 You may add dependencies on <TT
274 CLASS="LITERAL"
275 >camlp4o</TT
276 > or
277 <TT
278 CLASS="LITERAL"
279 >camlp4r</TT
280 > if you have archives only working for one of the two
281 syntax variants.</P
282 ><P
283 >To compile a program using your syntax extension package, one should use:
284
285 <PRE
286 CLASS="PROGRAMLISTING"
287 >ocamlfind ocamlc -package yourname -syntax variant ...</PRE
288 ></P
289 ></DIV
290 ><DIV
291 CLASS="SECT2"
292 ><H2
293 CLASS="SECT2"
294 ><A
295 NAME="AEN499"
296 >Example</A
297 ></H2
298 ><P
299 >The package <TT
300 CLASS="LITERAL"
301 >xstrp4</TT
302 > defines a syntax extension allowing
303 $-substitutions in O'Caml strings. Version 1.0 of this package takes advantage
304 from the new camlp4 support of findlib; you may have a look at it for an
305 example.</P
306 ><P
307 >You can find <TT
308 CLASS="LITERAL"
309 >xstrp4</TT
310 >
311 <A
312 HREF="/projects/xstrp4.html"
313 TARGET="_top"
314 >here</A
315 >.</P
316 ></DIV
317 ></DIV
318 ><DIV
319 CLASS="NAVFOOTER"
320 ><HR
321 ALIGN="LEFT"
322 WIDTH="100%"><TABLE
323 SUMMARY="Footer navigation table"
324 WIDTH="100%"
325 BORDER="0"
326 CELLPADDING="0"
327 CELLSPACING="0"
328 ><TR
329 ><TD
330 WIDTH="33%"
331 ALIGN="left"
332 VALIGN="top"
333 ><A
334 HREF="x442.html"
335 ACCESSKEY="P"
336 >Prev</A
337 ></TD
338 ><TD
339 WIDTH="34%"
340 ALIGN="center"
341 VALIGN="top"
342 ><A
343 HREF="index.html"
344 ACCESSKEY="H"
345 >Home</A
346 ></TD
347 ><TD
348 WIDTH="33%"
349 ALIGN="right"
350 VALIGN="top"
351 ><A
352 HREF="x506.html"
353 ACCESSKEY="N"
354 >Next</A
355 ></TD
356 ></TR
357 ><TR
358 ><TD
359 WIDTH="33%"
360 ALIGN="left"
361 VALIGN="top"
362 >Does findlib support linking of applications as well as
363 packages?</TD
364 ><TD
365 WIDTH="34%"
366 ALIGN="center"
367 VALIGN="top"
368 ><A
369 HREF="c422.html"
370 ACCESSKEY="U"
371 >Up</A
372 ></TD
373 ><TD
374 WIDTH="33%"
375 ALIGN="right"
376 VALIGN="top"
377 >Does Findlib support ppx-style preprocessors?</TD
378 ></TR
379 ></TABLE
380 ></DIV
381 ></BODY
382 ></HTML
383 >
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 > Does Findlib support camlp4?
5 </TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9 REL="HOME"
10 TITLE="The findlib User's Guide"
11 HREF="index.html"><LINK
12 REL="UP"
13 TITLE="FAQs"
14 HREF="c429.html"><LINK
15 REL="PREVIOUS"
16 TITLE="Does findlib support linking of applications as well as
17 packages?"
18 HREF="x449.html"><LINK
19 REL="NEXT"
20 TITLE=" Does Findlib support ppx-style preprocessors?
21 "
22 HREF="x513.html"></HEAD
23 ><BODY
24 CLASS="SECT1"
25 BGCOLOR="#FFFFFF"
26 TEXT="#000000"
27 LINK="#0000FF"
28 VLINK="#840084"
29 ALINK="#0000FF"
30 ><DIV
31 CLASS="NAVHEADER"
32 ><TABLE
33 SUMMARY="Header navigation table"
34 WIDTH="100%"
35 BORDER="0"
36 CELLPADDING="0"
37 CELLSPACING="0"
38 ><TR
39 ><TH
40 COLSPAN="3"
41 ALIGN="center"
42 >The findlib User's Guide</TH
43 ></TR
44 ><TR
45 ><TD
46 WIDTH="10%"
47 ALIGN="left"
48 VALIGN="bottom"
49 ><A
50 HREF="x449.html"
51 ACCESSKEY="P"
52 >Prev</A
53 ></TD
54 ><TD
55 WIDTH="80%"
56 ALIGN="center"
57 VALIGN="bottom"
58 >Chapter 7. FAQs</TD
59 ><TD
60 WIDTH="10%"
61 ALIGN="right"
62 VALIGN="bottom"
63 ><A
64 HREF="x513.html"
65 ACCESSKEY="N"
66 >Next</A
67 ></TD
68 ></TR
69 ></TABLE
70 ><HR
71 ALIGN="LEFT"
72 WIDTH="100%"></DIV
73 ><DIV
74 CLASS="SECT1"
75 ><H1
76 CLASS="SECT1"
77 ><A
78 NAME="AEN461"
79 >Does Findlib support camlp4?</A
80 ></H1
81 ><P
82 > <SPAN
83 CLASS="emphasis"
84 ><I
85 CLASS="EMPHASIS"
86 >Short answer:</I
87 ></SPAN
88 > Yes, but there is only little
89 documentation.</P
90 ><P
91 > Since Findlib-0.4, there is some experimental camlp4 support. For
92 example, the following compiler invocation chooses the revised syntax:
93
94 <PRE
95 CLASS="PROGRAMLISTING"
96 >ocamlfind ocamlc -syntax camlp4r -package camlp4 -c file.ml</PRE
97 >
98
99 As you can see, camlp4 must be included as package, and the
100 -syntax option must specify which syntax is selected (either
101 <TT
102 CLASS="LITERAL"
103 >camlp4o</TT
104 > or <TT
105 CLASS="LITERAL"
106 >camlp4r</TT
107 >).</P
108 ><P
109 > If you want to pass additional options to the preprocessor,
110 you can use the <TT
111 CLASS="LITERAL"
112 >-ppopt</TT
113 > option:
114
115 <PRE
116 CLASS="PROGRAMLISTING"
117 >ocamlfind ocamlc -syntax camlp4r -package camlp4 -ppopt pa_ifdef.cmo -c file.ml</PRE
118 >
119 </P
120 ><P
121 >From the toploop, the following commands work:
122
123 <PRE
124 CLASS="PROGRAMLISTING"
125 >$ ocaml
126 Objective Caml version 3.07+2
127
128 # #use "./topfind";;
129 - : unit = ()
130 Findlib has been successfully loaded. Additional directives:
131 #require "package";; to load a package
132 #list;; to list the available packages
133 #camlp4o;; to load camlp4 (standard syntax)
134 #camlp4r;; to load camlp4 (revised syntax)
135 #predicates "p,q,...";; to set these predicates
136 Topfind.reset();; to force that packages will be reloaded
137 #thread;; to enable threads
138
139 - : unit = ()
140 # #camlp4o;; (* or camlp4r *)
141 /opt/godi/lib/ocaml/std-lib/camlp4: added to search path
142 /opt/godi/lib/ocaml/std-lib/camlp4/camlp4o.cma: loaded
143 Camlp4 Parsing version 3.07+2
144
145 # _</PRE
146 >&#13;</P
147 ><DIV
148 CLASS="SECT2"
149 ><H2
150 CLASS="SECT2"
151 ><A
152 NAME="AEN474"
153 >The concept</A
154 ></H2
155 ><P
156 >If you have a <TT
157 CLASS="LITERAL"
158 >-syntax</TT
159 > option on the command line,
160 ocamlfind will generate a <TT
161 CLASS="LITERAL"
162 >-pp</TT
163 > parameter and pass it to the
164 invoked compiler. This is performed as follows: The specified packages are
165 inspected under a certain set of predicates, the <SPAN
166 CLASS="emphasis"
167 ><I
168 CLASS="EMPHASIS"
169 >syntax
170 predicates</I
171 ></SPAN
172 >. The syntax predicates are <TT
173 CLASS="LITERAL"
174 >syntax</TT
175 >,
176 <TT
177 CLASS="LITERAL"
178 >preprocessor</TT
179 >, and the predicates following
180 <TT
181 CLASS="LITERAL"
182 >-syntax</TT
183 >. The predicate <TT
184 CLASS="LITERAL"
185 >syntax</TT
186 > simply
187 means that the <TT
188 CLASS="LITERAL"
189 >-syntax</TT
190 > option has been specified.
191 The predicate <TT
192 CLASS="LITERAL"
193 >preprocessor</TT
194 > means that the preprocessor
195 command is being constructed. The predicates added by
196 <TT
197 CLASS="LITERAL"
198 >-syntax</TT
199 > may be used to distinguish between syntax variants
200 (currently <TT
201 CLASS="LITERAL"
202 >camlp4o</TT
203 > and <TT
204 CLASS="LITERAL"
205 >camlp4r</TT
206 >).</P
207 ><P
208 >The packages are searched for a variable <TT
209 CLASS="LITERAL"
210 >preprocessor</TT
211 >;
212 normally the <TT
213 CLASS="LITERAL"
214 >camlp4</TT
215 > package defines it as (see its META
216 file):
217
218 <PRE
219 CLASS="PROGRAMLISTING"
220 >preprocessor = "camlp4 -nolib"</PRE
221 >
222
223 Now that the name of the preprocessor command is known, the arguments of the
224 command are looked up. The META files are evaluated under the syntax
225 predicates, and all <TT
226 CLASS="LITERAL"
227 >archive</TT
228 > variables are collected and
229 passed as arguments to the preprocessor. For example, the camlp4 package
230 defines:
231
232 <PRE
233 CLASS="PROGRAMLISTING"
234 >archive(syntax,preprocessor,camlp4o) = "pa_o.cmo pa_op.cmo pr_dump.cmo"
235 archive(syntax,preprocessor,camlp4r) = "pa_r.cmo pa_rp.cmo pr_dump.cmo"</PRE
236 >
237
238 Note that the predicate <TT
239 CLASS="LITERAL"
240 >preprocessor</TT
241 > prevents ocamlfind from
242 including these archives into the regular list of archives to link.</P
243 ></DIV
244 ><DIV
245 CLASS="SECT2"
246 ><H2
247 CLASS="SECT2"
248 ><A
249 NAME="AEN496"
250 >How to write a META file for your own syntax extension</A
251 ></H2
252 ><P
253 >Suppose you have two archives: <TT
254 CLASS="LITERAL"
255 >pa_myext.cma</TT
256 > contains the
257 extension code of camlp4, and <TT
258 CLASS="LITERAL"
259 >run_myext.cma</TT
260 > contains runtime
261 material that must be present in programs compiled with your extensions. Your
262 META file should look as follows:
263
264 <PRE
265 CLASS="PROGRAMLISTING"
266 >requires = "camlp4"
267 archive(syntax,toploop) = "pa_myext.cma run_myext.cma"
268 archive(syntax,preprocessor) = "pa_myext.cma"
269 archive(syntax,byte) = "run_myext.cma"
270 archive(syntax,native) = "run_myext.cmxa"</PRE
271 >
272
273 You may add dependencies on <TT
274 CLASS="LITERAL"
275 >camlp4o</TT
276 > or
277 <TT
278 CLASS="LITERAL"
279 >camlp4r</TT
280 > if you have archives only working for one of the two
281 syntax variants.</P
282 ><P
283 >To compile a program using your syntax extension package, one should use:
284
285 <PRE
286 CLASS="PROGRAMLISTING"
287 >ocamlfind ocamlc -package yourname -syntax variant ...</PRE
288 ></P
289 ></DIV
290 ><DIV
291 CLASS="SECT2"
292 ><H2
293 CLASS="SECT2"
294 ><A
295 NAME="AEN506"
296 >Example</A
297 ></H2
298 ><P
299 >The package <TT
300 CLASS="LITERAL"
301 >xstrp4</TT
302 > defines a syntax extension allowing
303 $-substitutions in O'Caml strings. Version 1.0 of this package takes advantage
304 from the new camlp4 support of findlib; you may have a look at it for an
305 example.</P
306 ><P
307 >You can find <TT
308 CLASS="LITERAL"
309 >xstrp4</TT
310 >
311 <A
312 HREF="/projects/xstrp4.html"
313 TARGET="_top"
314 >here</A
315 >.</P
316 ></DIV
317 ></DIV
318 ><DIV
319 CLASS="NAVFOOTER"
320 ><HR
321 ALIGN="LEFT"
322 WIDTH="100%"><TABLE
323 SUMMARY="Footer navigation table"
324 WIDTH="100%"
325 BORDER="0"
326 CELLPADDING="0"
327 CELLSPACING="0"
328 ><TR
329 ><TD
330 WIDTH="33%"
331 ALIGN="left"
332 VALIGN="top"
333 ><A
334 HREF="x449.html"
335 ACCESSKEY="P"
336 >Prev</A
337 ></TD
338 ><TD
339 WIDTH="34%"
340 ALIGN="center"
341 VALIGN="top"
342 ><A
343 HREF="index.html"
344 ACCESSKEY="H"
345 >Home</A
346 ></TD
347 ><TD
348 WIDTH="33%"
349 ALIGN="right"
350 VALIGN="top"
351 ><A
352 HREF="x513.html"
353 ACCESSKEY="N"
354 >Next</A
355 ></TD
356 ></TR
357 ><TR
358 ><TD
359 WIDTH="33%"
360 ALIGN="left"
361 VALIGN="top"
362 >Does findlib support linking of applications as well as
363 packages?</TD
364 ><TD
365 WIDTH="34%"
366 ALIGN="center"
367 VALIGN="top"
368 ><A
369 HREF="c429.html"
370 ACCESSKEY="U"
371 >Up</A
372 ></TD
373 ><TD
374 WIDTH="33%"
375 ALIGN="right"
376 VALIGN="top"
377 >Does Findlib support ppx-style preprocessors?</TD
378 ></TR
379 ></TABLE
380 ></DIV
381 ></BODY
382 ></HTML
383 >
+0
-172
doc/guide-html/x506.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 > Does Findlib support ppx-style preprocessors?
5 </TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9 REL="HOME"
10 TITLE="The findlib User's Guide"
11 HREF="index.html"><LINK
12 REL="UP"
13 TITLE="FAQs"
14 HREF="c422.html"><LINK
15 REL="PREVIOUS"
16 TITLE=" Does Findlib support camlp4?
17 "
18 HREF="x454.html"><LINK
19 REL="NEXT"
20 TITLE="Why do some people install the .cmx files?"
21 HREF="x513.html"></HEAD
22 ><BODY
23 CLASS="SECT1"
24 BGCOLOR="#FFFFFF"
25 TEXT="#000000"
26 LINK="#0000FF"
27 VLINK="#840084"
28 ALINK="#0000FF"
29 ><DIV
30 CLASS="NAVHEADER"
31 ><TABLE
32 SUMMARY="Header navigation table"
33 WIDTH="100%"
34 BORDER="0"
35 CELLPADDING="0"
36 CELLSPACING="0"
37 ><TR
38 ><TH
39 COLSPAN="3"
40 ALIGN="center"
41 >The findlib User's Guide</TH
42 ></TR
43 ><TR
44 ><TD
45 WIDTH="10%"
46 ALIGN="left"
47 VALIGN="bottom"
48 ><A
49 HREF="x454.html"
50 ACCESSKEY="P"
51 >Prev</A
52 ></TD
53 ><TD
54 WIDTH="80%"
55 ALIGN="center"
56 VALIGN="bottom"
57 >Chapter 7. FAQs</TD
58 ><TD
59 WIDTH="10%"
60 ALIGN="right"
61 VALIGN="bottom"
62 ><A
63 HREF="x513.html"
64 ACCESSKEY="N"
65 >Next</A
66 ></TD
67 ></TR
68 ></TABLE
69 ><HR
70 ALIGN="LEFT"
71 WIDTH="100%"></DIV
72 ><DIV
73 CLASS="SECT1"
74 ><H1
75 CLASS="SECT1"
76 ><A
77 NAME="AEN506"
78 >Does Findlib support ppx-style preprocessors?</A
79 ></H1
80 ><P
81 > <SPAN
82 CLASS="emphasis"
83 ><I
84 CLASS="EMPHASIS"
85 >Short answer:</I
86 ></SPAN
87 > Yes, but there is only little
88 documentation.</P
89 ><P
90 >Since findlib-1.5, ppx-style preprocessors are supported
91 to some extent. A package can now define a "ppx" property which is simply
92 a command to run as preprocessor (the command gets the marshalled AST
93 as input, and must generate the transformed AST in its output; see the
94 -ppx option of ocamlc/ocamlopt). A META file can simply look like:
95
96 <PRE
97 CLASS="PROGRAMLISTING"
98 >ppx = "./command"</PRE
99 >
100
101 when "command" is installed in the package directory (but you can also
102 omit "./" to search it, and you can prefix it with "@name/" if the command
103 is taken from another package "name").</P
104 ><P
105 >This feature is still a bit experimental.</P
106 ></DIV
107 ><DIV
108 CLASS="NAVFOOTER"
109 ><HR
110 ALIGN="LEFT"
111 WIDTH="100%"><TABLE
112 SUMMARY="Footer navigation table"
113 WIDTH="100%"
114 BORDER="0"
115 CELLPADDING="0"
116 CELLSPACING="0"
117 ><TR
118 ><TD
119 WIDTH="33%"
120 ALIGN="left"
121 VALIGN="top"
122 ><A
123 HREF="x454.html"
124 ACCESSKEY="P"
125 >Prev</A
126 ></TD
127 ><TD
128 WIDTH="34%"
129 ALIGN="center"
130 VALIGN="top"
131 ><A
132 HREF="index.html"
133 ACCESSKEY="H"
134 >Home</A
135 ></TD
136 ><TD
137 WIDTH="33%"
138 ALIGN="right"
139 VALIGN="top"
140 ><A
141 HREF="x513.html"
142 ACCESSKEY="N"
143 >Next</A
144 ></TD
145 ></TR
146 ><TR
147 ><TD
148 WIDTH="33%"
149 ALIGN="left"
150 VALIGN="top"
151 >Does Findlib support camlp4?</TD
152 ><TD
153 WIDTH="34%"
154 ALIGN="center"
155 VALIGN="top"
156 ><A
157 HREF="c422.html"
158 ACCESSKEY="U"
159 >Up</A
160 ></TD
161 ><TD
162 WIDTH="33%"
163 ALIGN="right"
164 VALIGN="top"
165 >Why do some people install the .cmx files?</TD
166 ></TR
167 ></TABLE
168 ></DIV
169 ></BODY
170 ></HTML
171 >
11 <HTML
22 ><HEAD
33 ><TITLE
4 >Why do some people install the .cmx files?</TITLE
4 > Does Findlib support ppx-style preprocessors?
5 </TITLE
56 ><META
67 NAME="GENERATOR"
78 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
1011 HREF="index.html"><LINK
1112 REL="UP"
1213 TITLE="FAQs"
13 HREF="c422.html"><LINK
14 HREF="c429.html"><LINK
1415 REL="PREVIOUS"
15 TITLE=" Does Findlib support ppx-style preprocessors?
16 TITLE=" Does Findlib support camlp4?
1617 "
17 HREF="x506.html"><LINK
18 HREF="x461.html"><LINK
1819 REL="NEXT"
19 TITLE="How do I express conflicts?"
20 HREF="x517.html"></HEAD
20 TITLE="Why do some people install the .cmx files?"
21 HREF="x520.html"></HEAD
2122 ><BODY
2223 CLASS="SECT1"
2324 BGCOLOR="#FFFFFF"
4546 ALIGN="left"
4647 VALIGN="bottom"
4748 ><A
48 HREF="x506.html"
49 HREF="x461.html"
4950 ACCESSKEY="P"
5051 >Prev</A
5152 ></TD
5960 ALIGN="right"
6061 VALIGN="bottom"
6162 ><A
62 HREF="x517.html"
63 HREF="x520.html"
6364 ACCESSKEY="N"
6465 >Next</A
6566 ></TD
7475 CLASS="SECT1"
7576 ><A
7677 NAME="AEN513"
77 >Why do some people install the .cmx files?</A
78 >Does Findlib support ppx-style preprocessors?</A
7879 ></H1
7980 ><P
80 >In principle, it is not necessary to install the .cmx
81 files created by the ocamlopt compiler, as the .a and .cmxa files
82 already contain the assembly code and all needed auxiliary information.
83 However, it may be sensible to install the .cmx files, too. They
84 contain the intermediate code of small functions that are candidates
85 for inlining, and installing them allows the compiler to do inlining
86 even across library boundaries. Note that only very small functions
87 can be inlined at all, and that there are language elements that
88 prevent inlining (e.g. raising an exception with an argument), so
89 it makes only sense when the library actually has such functions
90 and really profits from inlining.</P
81 > <SPAN
82 CLASS="emphasis"
83 ><I
84 CLASS="EMPHASIS"
85 >Short answer:</I
86 ></SPAN
87 > Yes, but there is only little
88 documentation.</P
9189 ><P
92 >Inlining has also disadvantages: The library can no
93 longer be replaced by a different version even if the interface
94 remains exactly the same, because code using the library may have
95 inlined code of the old version.</P
90 >Since findlib-1.5, ppx-style preprocessors are supported
91 to some extent. A package can now define a "ppx" property which is simply
92 a command to run as preprocessor (the command gets the marshalled AST
93 as input, and must generate the transformed AST in its output; see the
94 -ppx option of ocamlc/ocamlopt). A META file can simply look like:
95
96 <PRE
97 CLASS="PROGRAMLISTING"
98 >ppx = "./command"</PRE
99 >
100
101 when "command" is installed in the package directory (but you can also
102 omit "./" to search it, and you can prefix it with "@name/" if the command
103 is taken from another package "name").</P
104 ><P
105 >This feature is still a bit experimental.</P
96106 ></DIV
97107 ><DIV
98108 CLASS="NAVFOOTER"
110120 ALIGN="left"
111121 VALIGN="top"
112122 ><A
113 HREF="x506.html"
123 HREF="x461.html"
114124 ACCESSKEY="P"
115125 >Prev</A
116126 ></TD
128138 ALIGN="right"
129139 VALIGN="top"
130140 ><A
131 HREF="x517.html"
141 HREF="x520.html"
132142 ACCESSKEY="N"
133143 >Next</A
134144 ></TD
138148 WIDTH="33%"
139149 ALIGN="left"
140150 VALIGN="top"
141 >Does Findlib support ppx-style preprocessors?</TD
151 >Does Findlib support camlp4?</TD
142152 ><TD
143153 WIDTH="34%"
144154 ALIGN="center"
145155 VALIGN="top"
146156 ><A
147 HREF="c422.html"
157 HREF="c429.html"
148158 ACCESSKEY="U"
149159 >Up</A
150160 ></TD
152162 WIDTH="33%"
153163 ALIGN="right"
154164 VALIGN="top"
155 >How do I express conflicts?</TD
165 >Why do some people install the .cmx files?</TD
156166 ></TR
157167 ></TABLE
158168 ></DIV
+0
-188
doc/guide-html/x517.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >How do I express conflicts?</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib User's Guide"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="FAQs"
13 HREF="c422.html"><LINK
14 REL="PREVIOUS"
15 TITLE="Why do some people install the .cmx files?"
16 HREF="x513.html"></HEAD
17 ><BODY
18 CLASS="SECT1"
19 BGCOLOR="#FFFFFF"
20 TEXT="#000000"
21 LINK="#0000FF"
22 VLINK="#840084"
23 ALINK="#0000FF"
24 ><DIV
25 CLASS="NAVHEADER"
26 ><TABLE
27 SUMMARY="Header navigation table"
28 WIDTH="100%"
29 BORDER="0"
30 CELLPADDING="0"
31 CELLSPACING="0"
32 ><TR
33 ><TH
34 COLSPAN="3"
35 ALIGN="center"
36 >The findlib User's Guide</TH
37 ></TR
38 ><TR
39 ><TD
40 WIDTH="10%"
41 ALIGN="left"
42 VALIGN="bottom"
43 ><A
44 HREF="x513.html"
45 ACCESSKEY="P"
46 >Prev</A
47 ></TD
48 ><TD
49 WIDTH="80%"
50 ALIGN="center"
51 VALIGN="bottom"
52 >Chapter 7. FAQs</TD
53 ><TD
54 WIDTH="10%"
55 ALIGN="right"
56 VALIGN="bottom"
57 >&nbsp;</TD
58 ></TR
59 ></TABLE
60 ><HR
61 ALIGN="LEFT"
62 WIDTH="100%"></DIV
63 ><DIV
64 CLASS="SECT1"
65 ><H1
66 CLASS="SECT1"
67 ><A
68 NAME="AEN517"
69 >How do I express conflicts?</A
70 ></H1
71 ><P
72 >A conflict means that a certain combination of packages
73 and package features will not work. A number of conflict conditions
74 can be expressed:</P
75 ><P
76 ></P
77 ><UL
78 ><LI
79 ><P
80 >To state that a package will not work if a certain
81 predicate is set, use the <TT
82 CLASS="LITERAL"
83 >error</TT
84 > variable. For example,
85 when package p does not work for multi-threaded programs:
86
87 <PRE
88 CLASS="PROGRAMLISTING"
89 >error(mt) = "Package p is incompatible with multi-threaded programs"</PRE
90 >
91
92 This works for other standard predicates, too.</P
93 ></LI
94 ><LI
95 ><P
96 >To state that a package will not work together with
97 another package, it is possible to make <TT
98 CLASS="LITERAL"
99 >error</TT
100 > dependent
101 on package predicates. For example, when package p does not work
102 together with q:
103
104 <PRE
105 CLASS="PROGRAMLISTING"
106 >error(pkg_q) = "Package p is incompatible with package q"</PRE
107 >
108
109 This also works with subpackages (e.g. <TT
110 CLASS="LITERAL"
111 >pkg_q.q_sub</TT
112 >).
113 </P
114 ></LI
115 ></UL
116 ><P
117 >Note that such error conditions should only be added if there is
118 absolutely no chance to get the combination of packages and features running.
119 For example, in the case of multi-threaded programs it is often possible
120 to add wrappers around unsafe libraries to fix the incompatibility.
121 </P
122 ><P
123 >It is not possible to express incompatibilities between package
124 versions. Such incompatibilities should be detected when software is
125 installed, not when it is used.</P
126 ></DIV
127 ><DIV
128 CLASS="NAVFOOTER"
129 ><HR
130 ALIGN="LEFT"
131 WIDTH="100%"><TABLE
132 SUMMARY="Footer navigation table"
133 WIDTH="100%"
134 BORDER="0"
135 CELLPADDING="0"
136 CELLSPACING="0"
137 ><TR
138 ><TD
139 WIDTH="33%"
140 ALIGN="left"
141 VALIGN="top"
142 ><A
143 HREF="x513.html"
144 ACCESSKEY="P"
145 >Prev</A
146 ></TD
147 ><TD
148 WIDTH="34%"
149 ALIGN="center"
150 VALIGN="top"
151 ><A
152 HREF="index.html"
153 ACCESSKEY="H"
154 >Home</A
155 ></TD
156 ><TD
157 WIDTH="33%"
158 ALIGN="right"
159 VALIGN="top"
160 >&nbsp;</TD
161 ></TR
162 ><TR
163 ><TD
164 WIDTH="33%"
165 ALIGN="left"
166 VALIGN="top"
167 >Why do some people install the .cmx files?</TD
168 ><TD
169 WIDTH="34%"
170 ALIGN="center"
171 VALIGN="top"
172 ><A
173 HREF="c422.html"
174 ACCESSKEY="U"
175 >Up</A
176 ></TD
177 ><TD
178 WIDTH="33%"
179 ALIGN="right"
180 VALIGN="top"
181 >&nbsp;</TD
182 ></TR
183 ></TABLE
184 ></DIV
185 ></BODY
186 ></HTML
187 >
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Why do some people install the .cmx files?</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib User's Guide"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="FAQs"
13 HREF="c429.html"><LINK
14 REL="PREVIOUS"
15 TITLE=" Does Findlib support ppx-style preprocessors?
16 "
17 HREF="x513.html"><LINK
18 REL="NEXT"
19 TITLE="How do I express conflicts?"
20 HREF="x524.html"></HEAD
21 ><BODY
22 CLASS="SECT1"
23 BGCOLOR="#FFFFFF"
24 TEXT="#000000"
25 LINK="#0000FF"
26 VLINK="#840084"
27 ALINK="#0000FF"
28 ><DIV
29 CLASS="NAVHEADER"
30 ><TABLE
31 SUMMARY="Header navigation table"
32 WIDTH="100%"
33 BORDER="0"
34 CELLPADDING="0"
35 CELLSPACING="0"
36 ><TR
37 ><TH
38 COLSPAN="3"
39 ALIGN="center"
40 >The findlib User's Guide</TH
41 ></TR
42 ><TR
43 ><TD
44 WIDTH="10%"
45 ALIGN="left"
46 VALIGN="bottom"
47 ><A
48 HREF="x513.html"
49 ACCESSKEY="P"
50 >Prev</A
51 ></TD
52 ><TD
53 WIDTH="80%"
54 ALIGN="center"
55 VALIGN="bottom"
56 >Chapter 7. FAQs</TD
57 ><TD
58 WIDTH="10%"
59 ALIGN="right"
60 VALIGN="bottom"
61 ><A
62 HREF="x524.html"
63 ACCESSKEY="N"
64 >Next</A
65 ></TD
66 ></TR
67 ></TABLE
68 ><HR
69 ALIGN="LEFT"
70 WIDTH="100%"></DIV
71 ><DIV
72 CLASS="SECT1"
73 ><H1
74 CLASS="SECT1"
75 ><A
76 NAME="AEN520"
77 >Why do some people install the .cmx files?</A
78 ></H1
79 ><P
80 >In principle, it is not necessary to install the .cmx
81 files created by the ocamlopt compiler, as the .a and .cmxa files
82 already contain the assembly code and all needed auxiliary information.
83 However, it may be sensible to install the .cmx files, too. They
84 contain the intermediate code of small functions that are candidates
85 for inlining, and installing them allows the compiler to do inlining
86 even across library boundaries. Note that only very small functions
87 can be inlined at all, and that there are language elements that
88 prevent inlining (e.g. raising an exception with an argument), so
89 it makes only sense when the library actually has such functions
90 and really profits from inlining.</P
91 ><P
92 >Inlining has also disadvantages: The library can no
93 longer be replaced by a different version even if the interface
94 remains exactly the same, because code using the library may have
95 inlined code of the old version.</P
96 ></DIV
97 ><DIV
98 CLASS="NAVFOOTER"
99 ><HR
100 ALIGN="LEFT"
101 WIDTH="100%"><TABLE
102 SUMMARY="Footer navigation table"
103 WIDTH="100%"
104 BORDER="0"
105 CELLPADDING="0"
106 CELLSPACING="0"
107 ><TR
108 ><TD
109 WIDTH="33%"
110 ALIGN="left"
111 VALIGN="top"
112 ><A
113 HREF="x513.html"
114 ACCESSKEY="P"
115 >Prev</A
116 ></TD
117 ><TD
118 WIDTH="34%"
119 ALIGN="center"
120 VALIGN="top"
121 ><A
122 HREF="index.html"
123 ACCESSKEY="H"
124 >Home</A
125 ></TD
126 ><TD
127 WIDTH="33%"
128 ALIGN="right"
129 VALIGN="top"
130 ><A
131 HREF="x524.html"
132 ACCESSKEY="N"
133 >Next</A
134 ></TD
135 ></TR
136 ><TR
137 ><TD
138 WIDTH="33%"
139 ALIGN="left"
140 VALIGN="top"
141 >Does Findlib support ppx-style preprocessors?</TD
142 ><TD
143 WIDTH="34%"
144 ALIGN="center"
145 VALIGN="top"
146 ><A
147 HREF="c429.html"
148 ACCESSKEY="U"
149 >Up</A
150 ></TD
151 ><TD
152 WIDTH="33%"
153 ALIGN="right"
154 VALIGN="top"
155 >How do I express conflicts?</TD
156 ></TR
157 ></TABLE
158 ></DIV
159 ></BODY
160 ></HTML
161 >
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >How do I express conflicts?</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib User's Guide"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="FAQs"
13 HREF="c429.html"><LINK
14 REL="PREVIOUS"
15 TITLE="Why do some people install the .cmx files?"
16 HREF="x520.html"></HEAD
17 ><BODY
18 CLASS="SECT1"
19 BGCOLOR="#FFFFFF"
20 TEXT="#000000"
21 LINK="#0000FF"
22 VLINK="#840084"
23 ALINK="#0000FF"
24 ><DIV
25 CLASS="NAVHEADER"
26 ><TABLE
27 SUMMARY="Header navigation table"
28 WIDTH="100%"
29 BORDER="0"
30 CELLPADDING="0"
31 CELLSPACING="0"
32 ><TR
33 ><TH
34 COLSPAN="3"
35 ALIGN="center"
36 >The findlib User's Guide</TH
37 ></TR
38 ><TR
39 ><TD
40 WIDTH="10%"
41 ALIGN="left"
42 VALIGN="bottom"
43 ><A
44 HREF="x520.html"
45 ACCESSKEY="P"
46 >Prev</A
47 ></TD
48 ><TD
49 WIDTH="80%"
50 ALIGN="center"
51 VALIGN="bottom"
52 >Chapter 7. FAQs</TD
53 ><TD
54 WIDTH="10%"
55 ALIGN="right"
56 VALIGN="bottom"
57 >&nbsp;</TD
58 ></TR
59 ></TABLE
60 ><HR
61 ALIGN="LEFT"
62 WIDTH="100%"></DIV
63 ><DIV
64 CLASS="SECT1"
65 ><H1
66 CLASS="SECT1"
67 ><A
68 NAME="AEN524"
69 >How do I express conflicts?</A
70 ></H1
71 ><P
72 >A conflict means that a certain combination of packages
73 and package features will not work. A number of conflict conditions
74 can be expressed:</P
75 ><P
76 ></P
77 ><UL
78 ><LI
79 ><P
80 >To state that a package will not work if a certain
81 predicate is set, use the <TT
82 CLASS="LITERAL"
83 >error</TT
84 > variable. For example,
85 when package p does not work for multi-threaded programs:
86
87 <PRE
88 CLASS="PROGRAMLISTING"
89 >error(mt) = "Package p is incompatible with multi-threaded programs"</PRE
90 >
91
92 This works for other standard predicates, too.</P
93 ></LI
94 ><LI
95 ><P
96 >To state that a package will not work together with
97 another package, it is possible to make <TT
98 CLASS="LITERAL"
99 >error</TT
100 > dependent
101 on package predicates. For example, when package p does not work
102 together with q:
103
104 <PRE
105 CLASS="PROGRAMLISTING"
106 >error(pkg_q) = "Package p is incompatible with package q"</PRE
107 >
108
109 This also works with subpackages (e.g. <TT
110 CLASS="LITERAL"
111 >pkg_q.q_sub</TT
112 >).
113 </P
114 ></LI
115 ></UL
116 ><P
117 >Note that such error conditions should only be added if there is
118 absolutely no chance to get the combination of packages and features running.
119 For example, in the case of multi-threaded programs it is often possible
120 to add wrappers around unsafe libraries to fix the incompatibility.
121 </P
122 ><P
123 >It is not possible to express incompatibilities between package
124 versions. Such incompatibilities should be detected when software is
125 installed, not when it is used.</P
126 ></DIV
127 ><DIV
128 CLASS="NAVFOOTER"
129 ><HR
130 ALIGN="LEFT"
131 WIDTH="100%"><TABLE
132 SUMMARY="Footer navigation table"
133 WIDTH="100%"
134 BORDER="0"
135 CELLPADDING="0"
136 CELLSPACING="0"
137 ><TR
138 ><TD
139 WIDTH="33%"
140 ALIGN="left"
141 VALIGN="top"
142 ><A
143 HREF="x520.html"
144 ACCESSKEY="P"
145 >Prev</A
146 ></TD
147 ><TD
148 WIDTH="34%"
149 ALIGN="center"
150 VALIGN="top"
151 ><A
152 HREF="index.html"
153 ACCESSKEY="H"
154 >Home</A
155 ></TD
156 ><TD
157 WIDTH="33%"
158 ALIGN="right"
159 VALIGN="top"
160 >&nbsp;</TD
161 ></TR
162 ><TR
163 ><TD
164 WIDTH="33%"
165 ALIGN="left"
166 VALIGN="top"
167 >Why do some people install the .cmx files?</TD
168 ><TD
169 WIDTH="34%"
170 ALIGN="center"
171 VALIGN="top"
172 ><A
173 HREF="c429.html"
174 ACCESSKEY="U"
175 >Up</A
176 ></TD
177 ><TD
178 WIDTH="33%"
179 ALIGN="right"
180 VALIGN="top"
181 >&nbsp;</TD
182 ></TR
183 ></TABLE
184 ></DIV
185 ></BODY
186 ></HTML
187 >
+0
-139
doc/ref-html/c1060.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >The findlib library</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib Reference Manual"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="Library"
13 HREF="p1058.html"><LINK
14 REL="PREVIOUS"
15 TITLE="Library"
16 HREF="p1058.html"></HEAD
17 ><BODY
18 CLASS="CHAPTER"
19 BGCOLOR="#FFFFFF"
20 TEXT="#000000"
21 LINK="#0000FF"
22 VLINK="#840084"
23 ALINK="#0000FF"
24 ><DIV
25 CLASS="NAVHEADER"
26 ><TABLE
27 SUMMARY="Header navigation table"
28 WIDTH="100%"
29 BORDER="0"
30 CELLPADDING="0"
31 CELLSPACING="0"
32 ><TR
33 ><TH
34 COLSPAN="3"
35 ALIGN="center"
36 >The findlib Reference Manual</TH
37 ></TR
38 ><TR
39 ><TD
40 WIDTH="10%"
41 ALIGN="left"
42 VALIGN="bottom"
43 ><A
44 HREF="p1058.html"
45 ACCESSKEY="P"
46 >Prev</A
47 ></TD
48 ><TD
49 WIDTH="80%"
50 ALIGN="center"
51 VALIGN="bottom"
52 ></TD
53 ><TD
54 WIDTH="10%"
55 ALIGN="right"
56 VALIGN="bottom"
57 >&nbsp;</TD
58 ></TR
59 ></TABLE
60 ><HR
61 ALIGN="LEFT"
62 WIDTH="100%"></DIV
63 ><DIV
64 CLASS="CHAPTER"
65 ><H1
66 ><A
67 NAME="AEN1060"
68 ></A
69 >Chapter 1. The findlib library</H1
70 ><P
71 > <A
72 HREF="lib/index.html"
73 TARGET="_top"
74 >The findlib library</A
75 >
76 </P
77 ></DIV
78 ><DIV
79 CLASS="NAVFOOTER"
80 ><HR
81 ALIGN="LEFT"
82 WIDTH="100%"><TABLE
83 SUMMARY="Footer navigation table"
84 WIDTH="100%"
85 BORDER="0"
86 CELLPADDING="0"
87 CELLSPACING="0"
88 ><TR
89 ><TD
90 WIDTH="33%"
91 ALIGN="left"
92 VALIGN="top"
93 ><A
94 HREF="p1058.html"
95 ACCESSKEY="P"
96 >Prev</A
97 ></TD
98 ><TD
99 WIDTH="34%"
100 ALIGN="center"
101 VALIGN="top"
102 ><A
103 HREF="index.html"
104 ACCESSKEY="H"
105 >Home</A
106 ></TD
107 ><TD
108 WIDTH="33%"
109 ALIGN="right"
110 VALIGN="top"
111 >&nbsp;</TD
112 ></TR
113 ><TR
114 ><TD
115 WIDTH="33%"
116 ALIGN="left"
117 VALIGN="top"
118 >Library</TD
119 ><TD
120 WIDTH="34%"
121 ALIGN="center"
122 VALIGN="top"
123 ><A
124 HREF="p1058.html"
125 ACCESSKEY="U"
126 >Up</A
127 ></TD
128 ><TD
129 WIDTH="33%"
130 ALIGN="right"
131 VALIGN="top"
132 >&nbsp;</TD
133 ></TR
134 ></TABLE
135 ></DIV
136 ></BODY
137 ></HTML
138 >
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >The findlib library</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib Reference Manual"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="Library"
13 HREF="p1079.html"><LINK
14 REL="PREVIOUS"
15 TITLE="Library"
16 HREF="p1079.html"></HEAD
17 ><BODY
18 CLASS="CHAPTER"
19 BGCOLOR="#FFFFFF"
20 TEXT="#000000"
21 LINK="#0000FF"
22 VLINK="#840084"
23 ALINK="#0000FF"
24 ><DIV
25 CLASS="NAVHEADER"
26 ><TABLE
27 SUMMARY="Header navigation table"
28 WIDTH="100%"
29 BORDER="0"
30 CELLPADDING="0"
31 CELLSPACING="0"
32 ><TR
33 ><TH
34 COLSPAN="3"
35 ALIGN="center"
36 >The findlib Reference Manual</TH
37 ></TR
38 ><TR
39 ><TD
40 WIDTH="10%"
41 ALIGN="left"
42 VALIGN="bottom"
43 ><A
44 HREF="p1079.html"
45 ACCESSKEY="P"
46 >Prev</A
47 ></TD
48 ><TD
49 WIDTH="80%"
50 ALIGN="center"
51 VALIGN="bottom"
52 ></TD
53 ><TD
54 WIDTH="10%"
55 ALIGN="right"
56 VALIGN="bottom"
57 >&nbsp;</TD
58 ></TR
59 ></TABLE
60 ><HR
61 ALIGN="LEFT"
62 WIDTH="100%"></DIV
63 ><DIV
64 CLASS="CHAPTER"
65 ><H1
66 ><A
67 NAME="AEN1081"
68 ></A
69 >Chapter 1. The findlib library</H1
70 ><P
71 > <A
72 HREF="lib/index.html"
73 TARGET="_top"
74 >The findlib library</A
75 >
76 </P
77 ></DIV
78 ><DIV
79 CLASS="NAVFOOTER"
80 ><HR
81 ALIGN="LEFT"
82 WIDTH="100%"><TABLE
83 SUMMARY="Footer navigation table"
84 WIDTH="100%"
85 BORDER="0"
86 CELLPADDING="0"
87 CELLSPACING="0"
88 ><TR
89 ><TD
90 WIDTH="33%"
91 ALIGN="left"
92 VALIGN="top"
93 ><A
94 HREF="p1079.html"
95 ACCESSKEY="P"
96 >Prev</A
97 ></TD
98 ><TD
99 WIDTH="34%"
100 ALIGN="center"
101 VALIGN="top"
102 ><A
103 HREF="index.html"
104 ACCESSKEY="H"
105 >Home</A
106 ></TD
107 ><TD
108 WIDTH="33%"
109 ALIGN="right"
110 VALIGN="top"
111 >&nbsp;</TD
112 ></TR
113 ><TR
114 ><TD
115 WIDTH="33%"
116 ALIGN="left"
117 VALIGN="top"
118 >Library</TD
119 ><TD
120 WIDTH="34%"
121 ALIGN="center"
122 VALIGN="top"
123 ><A
124 HREF="p1079.html"
125 ACCESSKEY="U"
126 >Up</A
127 ></TD
128 ><TD
129 WIDTH="33%"
130 ALIGN="right"
131 VALIGN="top"
132 >&nbsp;</TD
133 ></TR
134 ></TABLE
135 ></DIV
136 ></BODY
137 ></HTML
138 >
6161 ></DD
6262 ><DT
6363 >II. <A
64 HREF="p698.html"
64 HREF="p719.html"
6565 >Files</A
6666 ></DT
6767 ><DD
6868 ><DL
6969 ><DT
7070 ><A
71 HREF="r700.html"
71 HREF="r721.html"
7272 >META</A
7373 >&nbsp;--&nbsp;[File that specifies metainformation of OCaml packages]</DT
7474 ><DT
7575 ><A
76 HREF="r804.html"
76 HREF="r825.html"
7777 >findlib.conf</A
7878 >&nbsp;--&nbsp;[Configuration of findlib/ocamlfind]</DT
7979 ><DT
8080 ><A
81 HREF="r1000.html"
81 HREF="r1021.html"
8282 >site-lib</A
8383 >&nbsp;--&nbsp;[Location of package directories]</DT
8484 ></DL
8585 ></DD
8686 ><DT
8787 >III. <A
88 HREF="p1058.html"
88 HREF="p1079.html"
8989 >Library</A
9090 ></DT
9191 ><DD
9292 ><DL
9393 ><DT
9494 >1. <A
95 HREF="c1060.html"
95 HREF="c1081.html"
9696 >The findlib library</A
9797 ></DT
9898 ></DL
130130 Raises <code class="code">No_such_package</code> if the package cannot be found.<br>
131131 </div>
132132
133 <pre><span id="VALpackage_meta_file"><span class="keyword">val</span> package_meta_file</span> : <code class="type">string -> string</code></pre><div class="info ">
134 Get the absolute path of the META file of the given package<br>
135 </div>
136
133137 <pre><span id="VALignore_dups_in"><span class="keyword">val</span> ignore_dups_in</span> : <code class="type">unit -> string option</code></pre><div class="info ">
134138 If <code class="code">Some d</code>, duplicate packages below <code class="code">d</code> are ignored, and do not
135139 produce warnings. (Only affects the generation of warnings.)<br>
227231 <code><span class="keyword">|</span></code></td>
228232 <td align="left" valign="top" >
229233 <code><span id="TYPEELTrectype.Record_core"><span class="constructor">Record_core</span></span></code></td>
230 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The package is part of the executable core</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
234 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
235 The package is part of the executable core<br>
236 </div>
237 </td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
231238 </tr>
232239 <tr>
233240 <td align="left" valign="top" >
234241 <code><span class="keyword">|</span></code></td>
235242 <td align="left" valign="top" >
236243 <code><span id="TYPEELTrectype.Record_load"><span class="constructor">Record_load</span></span></code></td>
237 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The package has been dynamically loaded</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
244 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
245 The package has been dynamically loaded<br>
246 </div>
247 </td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
238248 </tr></table>
239249
240250
5555 <p>
5656 <ul>
5757 <li>First, the "plugin" variable is checked (instead of "archive"), e.g.
58 <pre class="codepre"><code class="code">plugin(bytecode) = "my_plugin.cma"
58 <pre class="codepre"><code class="code">plugin(byte) = "my_plugin.cma"
5959 plugin(native) = "my_plugin.cmxs"
6060 </code></pre>
6161 This is the preferred style.</li>
4444 <code>&nbsp;&nbsp;</code></td>
4545 <td align="left" valign="top" >
4646 <code><span id="TYPEELTpkg_definition.def_var">def_var</span>&nbsp;: <code class="type">string</code>;</code></td>
47 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The name of the defined variable</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
47 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
48 The name of the defined variable<br>
49 </div>
50 </td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
4851 </tr>
4952 <tr>
5053 <td align="left" valign="top" >
5154 <code>&nbsp;&nbsp;</code></td>
5255 <td align="left" valign="top" >
5356 <code><span id="TYPEELTpkg_definition.def_flav">def_flav</span>&nbsp;: <code class="type"><a href="Fl_metascanner.html#TYPEflavour">flavour</a></code>;</code></td>
54 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The flavour of the definition</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
57 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
58 The flavour of the definition<br>
59 </div>
60 </td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
5561 </tr>
5662 <tr>
5763 <td align="left" valign="top" >
5864 <code>&nbsp;&nbsp;</code></td>
5965 <td align="left" valign="top" >
6066 <code><span id="TYPEELTpkg_definition.def_preds">def_preds</span>&nbsp;: <code class="type"><a href="Fl_metascanner.html#TYPEformal_pred">formal_pred</a> list</code>;</code></td>
61 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The formal predicates of the def</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
67 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
68 The formal predicates of the def<br>
69 </div>
70 </td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
6271 </tr>
6372 <tr>
6473 <td align="left" valign="top" >
6574 <code>&nbsp;&nbsp;</code></td>
6675 <td align="left" valign="top" >
6776 <code><span id="TYPEELTpkg_definition.def_value">def_value</span>&nbsp;: <code class="type">string</code>;</code></td>
68 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The value assigned to the variable</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
77 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
78 The value assigned to the variable<br>
79 </div>
80 </td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
6981 </tr></table>
7082 }
7183
118130 <pre><span id="VALparse2"><span class="keyword">val</span> parse2</span> : <code class="type">Pervasives.in_channel -> <a href="Fl_metascanner.html#TYPEpkg_expr">pkg_expr</a></code></pre>
119131 <pre><span id="VALparse2_lexing"><span class="keyword">val</span> parse2_lexing</span> : <code class="type">Lexing.lexbuf -> <a href="Fl_metascanner.html#TYPEpkg_expr">pkg_expr</a></code></pre>
120132 <pre><span id="VALparse_lexing"><span class="keyword">val</span> parse_lexing</span> : <code class="type">Lexing.lexbuf -> <a href="Fl_metascanner.html#TYPEpkg_expr">pkg_expr</a></code></pre>
133 <pre><span id="VALprint_def"><span class="keyword">val</span> print_def</span> : <code class="type">Pervasives.out_channel -> <a href="Fl_metascanner.html#TYPEpkg_definition">pkg_definition</a> -> unit</code></pre><div class="info ">
134 <code class="code">print_def ch def</code>:
135 Outputs the definition to a channel.<br>
136 </div>
137
121138 <pre><span id="VALprint"><span class="keyword">val</span> print</span> : <code class="type">Pervasives.out_channel -> <a href="Fl_metascanner.html#TYPEpkg_expr">pkg_expr</a> -> unit</code></pre><div class="info ">
122139 <code class="code">print ch expr</code>:
123140 Outputs the package expression to a channel.<br>
3636 <code>&nbsp;&nbsp;</code></td>
3737 <td align="left" valign="top" >
3838 <code><span id="TYPEELTpackage.package_name">package_name</span>&nbsp;: <code class="type">string</code>;</code></td>
39 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The fully qualified package name, i.e. for subpackages the
39 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
40 The fully qualified package name, i.e. for subpackages the
4041 names of the containing packages are prepended and the name
41 components are separated by '.'</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
42 components are separated by '.'<br>
43 </div>
44 </td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
4245 </tr>
4346 <tr>
4447 <td align="left" valign="top" >
4548 <code>&nbsp;&nbsp;</code></td>
4649 <td align="left" valign="top" >
4750 <code><span id="TYPEELTpackage.package_dir">package_dir</span>&nbsp;: <code class="type">string</code>;</code></td>
48 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The directory where to lookup package files</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
51 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
52 The directory where to lookup package files<br>
53 </div>
54 </td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
55 </tr>
56 <tr>
57 <td align="left" valign="top" >
58 <code>&nbsp;&nbsp;</code></td>
59 <td align="left" valign="top" >
60 <code><span id="TYPEELTpackage.package_meta">package_meta</span>&nbsp;: <code class="type">string</code>;</code></td>
61 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
62 The path to the META file<br>
63 </div>
64 </td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
4965 </tr>
5066 <tr>
5167 <td align="left" valign="top" >
5268 <code>&nbsp;&nbsp;</code></td>
5369 <td align="left" valign="top" >
5470 <code><span id="TYPEELTpackage.package_defs">package_defs</span>&nbsp;: <code class="type"><a href="Fl_metascanner.html#TYPEpkg_definition">Fl_metascanner.pkg_definition</a> list</code>;</code></td>
55 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The definitions in the META file</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
71 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
72 The definitions in the META file<br>
73 </div>
74 </td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
5675 </tr>
5776 <tr>
5877 <td align="left" valign="top" >
5978 <code>&nbsp;&nbsp;</code></td>
6079 <td align="left" valign="top" >
6180 <code><span id="TYPEELTpackage.package_priv">package_priv</span>&nbsp;: <code class="type"><a href="Fl_package_base.html#TYPEpackage_priv">package_priv</a></code>;</code></td>
62 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Private part of the definition</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
81 <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
82 Private part of the definition<br>
83 </div>
84 </td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
6385 </tr></table>
6486 }
6587
0 <html>
1 <head>
2 <link rel="stylesheet" href="style.css" type="text/css">
3 <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
4 <link rel="Start" href="index.html">
5 <link title="Index of types" rel=Appendix href="index_types.html">
6 <link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
7 <link title="Index of values" rel=Appendix href="index_values.html">
8 <link title="Index of modules" rel=Appendix href="index_modules.html">
9 <link title="Findlib" rel="Chapter" href="Findlib.html">
10 <link title="Fl_package_base" rel="Chapter" href="Fl_package_base.html">
11 <link title="Fl_metascanner" rel="Chapter" href="Fl_metascanner.html">
12 <link title="Fl_dynload" rel="Chapter" href="Fl_dynload.html">
13 <link title="Topfind" rel="Chapter" href="Topfind.html"><title>The Findlib Library : Index of extensions</title>
14 </head>
15 <body>
16 <div class="navbar">&nbsp;<a class="up" href="index.html" title="Index">Up</a>
17 &nbsp;</div>
18 <h1>Index of extensions</h1>
19 <table>
20 </table>
21 </body>
22 </html>
186186 stored.
187187 </div>
188188 </td></tr>
189 <tr><td><a href="Findlib.html#VALpackage_meta_file">package_meta_file</a> [<a href="Findlib.html">Findlib</a>]</td>
190 <td><div class="info">
191 Get the absolute path of the META file of the given package
192 </div>
193 </td></tr>
189194 <tr><td><a href="Findlib.html#VALpackage_property">package_property</a> [<a href="Findlib.html">Findlib</a>]</td>
190195 <td><div class="info">
191196 <code class="code">package_property predlist pkg propname</code>:
239244 Outputs the package expression to a channel.
240245 </div>
241246 </td></tr>
247 <tr><td><a href="Fl_metascanner.html#VALprint_def">print_def</a> [<a href="Fl_metascanner.html">Fl_metascanner</a>]</td>
248 <td><div class="info">
249 <code class="code">print_def ch def</code>:
250 Outputs the definition to a channel.
251 </div>
252 </td></tr>
242253 <tr><td align="left"><br>Q</td></tr>
243254 <tr><td><a href="Fl_package_base.html#VALquery">query</a> [<a href="Fl_package_base.html">Fl_package_base</a>]</td>
244255 <td><div class="info">
5555 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;ocaml_stdlib&nbsp;:&nbsp;unit&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;string<br>
5656 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;ocaml_ldconf&nbsp;:&nbsp;unit&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;string<br>
5757 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;package_directory&nbsp;:&nbsp;string&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;string<br>
58 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;package_meta_file&nbsp;:&nbsp;string&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;string<br>
5859 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;ignore_dups_in&nbsp;:&nbsp;unit&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;string&nbsp;option<br>
5960 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;package_property&nbsp;:&nbsp;string&nbsp;list&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;string&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;string&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;string<br>
6061 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;package_property_2&nbsp;:<br>
2929 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;parse2&nbsp;:&nbsp;<span class="constructor">Pervasives</span>.in_channel&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="constructor">Fl_metascanner</span>.pkg_expr<br>
3030 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;parse2_lexing&nbsp;:&nbsp;<span class="constructor">Lexing</span>.lexbuf&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="constructor">Fl_metascanner</span>.pkg_expr<br>
3131 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;parse_lexing&nbsp;:&nbsp;<span class="constructor">Lexing</span>.lexbuf&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="constructor">Fl_metascanner</span>.pkg_expr<br>
32 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;print_def&nbsp;:<br>
33 &nbsp;&nbsp;&nbsp;&nbsp;<span class="constructor">Pervasives</span>.out_channel&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="constructor">Fl_metascanner</span>.pkg_definition&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;unit<br>
3234 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;print&nbsp;:&nbsp;<span class="constructor">Pervasives</span>.out_channel&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="constructor">Fl_metascanner</span>.pkg_expr&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;unit<br>
3335 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;lookup&nbsp;:<br>
3436 &nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;string&nbsp;list&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="constructor">Fl_metascanner</span>.pkg_definition&nbsp;list&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;string<br>
1616 &nbsp;&nbsp;<span class="keyword">type</span>&nbsp;package&nbsp;=&nbsp;{<br>
1717 &nbsp;&nbsp;&nbsp;&nbsp;package_name&nbsp;:&nbsp;string;<br>
1818 &nbsp;&nbsp;&nbsp;&nbsp;package_dir&nbsp;:&nbsp;string;<br>
19 &nbsp;&nbsp;&nbsp;&nbsp;package_meta&nbsp;:&nbsp;string;<br>
1920 &nbsp;&nbsp;&nbsp;&nbsp;package_defs&nbsp;:&nbsp;<span class="constructor">Fl_metascanner</span>.pkg_definition&nbsp;list;<br>
2021 &nbsp;&nbsp;&nbsp;&nbsp;package_priv&nbsp;:&nbsp;<span class="constructor">Fl_package_base</span>.package_priv;<br>
2122 &nbsp;&nbsp;}<br>
+0
-154
doc/ref-html/p1058.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Library</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib Reference Manual"
10 HREF="index.html"><LINK
11 REL="PREVIOUS"
12 TITLE="site-lib"
13 HREF="r1000.html"><LINK
14 REL="NEXT"
15 TITLE="The findlib library"
16 HREF="c1060.html"></HEAD
17 ><BODY
18 CLASS="PART"
19 BGCOLOR="#FFFFFF"
20 TEXT="#000000"
21 LINK="#0000FF"
22 VLINK="#840084"
23 ALINK="#0000FF"
24 ><DIV
25 CLASS="NAVHEADER"
26 ><TABLE
27 SUMMARY="Header navigation table"
28 WIDTH="100%"
29 BORDER="0"
30 CELLPADDING="0"
31 CELLSPACING="0"
32 ><TR
33 ><TH
34 COLSPAN="3"
35 ALIGN="center"
36 >The findlib Reference Manual</TH
37 ></TR
38 ><TR
39 ><TD
40 WIDTH="10%"
41 ALIGN="left"
42 VALIGN="bottom"
43 ><A
44 HREF="r1000.html"
45 ACCESSKEY="P"
46 >Prev</A
47 ></TD
48 ><TD
49 WIDTH="80%"
50 ALIGN="center"
51 VALIGN="bottom"
52 ></TD
53 ><TD
54 WIDTH="10%"
55 ALIGN="right"
56 VALIGN="bottom"
57 ><A
58 HREF="c1060.html"
59 ACCESSKEY="N"
60 >Next</A
61 ></TD
62 ></TR
63 ></TABLE
64 ><HR
65 ALIGN="LEFT"
66 WIDTH="100%"></DIV
67 ><DIV
68 CLASS="PART"
69 ><A
70 NAME="AEN1058"
71 ></A
72 ><DIV
73 CLASS="TITLEPAGE"
74 ><H1
75 CLASS="TITLE"
76 >III. Library</H1
77 ><DIV
78 CLASS="TOC"
79 ><DL
80 ><DT
81 ><B
82 >Table of Contents</B
83 ></DT
84 ><DT
85 >1. <A
86 HREF="c1060.html"
87 >The findlib library</A
88 ></DT
89 ></DL
90 ></DIV
91 ></DIV
92 ></DIV
93 ><DIV
94 CLASS="NAVFOOTER"
95 ><HR
96 ALIGN="LEFT"
97 WIDTH="100%"><TABLE
98 SUMMARY="Footer navigation table"
99 WIDTH="100%"
100 BORDER="0"
101 CELLPADDING="0"
102 CELLSPACING="0"
103 ><TR
104 ><TD
105 WIDTH="33%"
106 ALIGN="left"
107 VALIGN="top"
108 ><A
109 HREF="r1000.html"
110 ACCESSKEY="P"
111 >Prev</A
112 ></TD
113 ><TD
114 WIDTH="34%"
115 ALIGN="center"
116 VALIGN="top"
117 ><A
118 HREF="index.html"
119 ACCESSKEY="H"
120 >Home</A
121 ></TD
122 ><TD
123 WIDTH="33%"
124 ALIGN="right"
125 VALIGN="top"
126 ><A
127 HREF="c1060.html"
128 ACCESSKEY="N"
129 >Next</A
130 ></TD
131 ></TR
132 ><TR
133 ><TD
134 WIDTH="33%"
135 ALIGN="left"
136 VALIGN="top"
137 >site-lib</TD
138 ><TD
139 WIDTH="34%"
140 ALIGN="center"
141 VALIGN="top"
142 >&nbsp;</TD
143 ><TD
144 WIDTH="33%"
145 ALIGN="right"
146 VALIGN="top"
147 >The findlib library</TD
148 ></TR
149 ></TABLE
150 ></DIV
151 ></BODY
152 ></HTML
153 >
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Library</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib Reference Manual"
10 HREF="index.html"><LINK
11 REL="PREVIOUS"
12 TITLE="site-lib"
13 HREF="r1021.html"><LINK
14 REL="NEXT"
15 TITLE="The findlib library"
16 HREF="c1081.html"></HEAD
17 ><BODY
18 CLASS="PART"
19 BGCOLOR="#FFFFFF"
20 TEXT="#000000"
21 LINK="#0000FF"
22 VLINK="#840084"
23 ALINK="#0000FF"
24 ><DIV
25 CLASS="NAVHEADER"
26 ><TABLE
27 SUMMARY="Header navigation table"
28 WIDTH="100%"
29 BORDER="0"
30 CELLPADDING="0"
31 CELLSPACING="0"
32 ><TR
33 ><TH
34 COLSPAN="3"
35 ALIGN="center"
36 >The findlib Reference Manual</TH
37 ></TR
38 ><TR
39 ><TD
40 WIDTH="10%"
41 ALIGN="left"
42 VALIGN="bottom"
43 ><A
44 HREF="r1021.html"
45 ACCESSKEY="P"
46 >Prev</A
47 ></TD
48 ><TD
49 WIDTH="80%"
50 ALIGN="center"
51 VALIGN="bottom"
52 ></TD
53 ><TD
54 WIDTH="10%"
55 ALIGN="right"
56 VALIGN="bottom"
57 ><A
58 HREF="c1081.html"
59 ACCESSKEY="N"
60 >Next</A
61 ></TD
62 ></TR
63 ></TABLE
64 ><HR
65 ALIGN="LEFT"
66 WIDTH="100%"></DIV
67 ><DIV
68 CLASS="PART"
69 ><A
70 NAME="AEN1079"
71 ></A
72 ><DIV
73 CLASS="TITLEPAGE"
74 ><H1
75 CLASS="TITLE"
76 >III. Library</H1
77 ><DIV
78 CLASS="TOC"
79 ><DL
80 ><DT
81 ><B
82 >Table of Contents</B
83 ></DT
84 ><DT
85 >1. <A
86 HREF="c1081.html"
87 >The findlib library</A
88 ></DT
89 ></DL
90 ></DIV
91 ></DIV
92 ></DIV
93 ><DIV
94 CLASS="NAVFOOTER"
95 ><HR
96 ALIGN="LEFT"
97 WIDTH="100%"><TABLE
98 SUMMARY="Footer navigation table"
99 WIDTH="100%"
100 BORDER="0"
101 CELLPADDING="0"
102 CELLSPACING="0"
103 ><TR
104 ><TD
105 WIDTH="33%"
106 ALIGN="left"
107 VALIGN="top"
108 ><A
109 HREF="r1021.html"
110 ACCESSKEY="P"
111 >Prev</A
112 ></TD
113 ><TD
114 WIDTH="34%"
115 ALIGN="center"
116 VALIGN="top"
117 ><A
118 HREF="index.html"
119 ACCESSKEY="H"
120 >Home</A
121 ></TD
122 ><TD
123 WIDTH="33%"
124 ALIGN="right"
125 VALIGN="top"
126 ><A
127 HREF="c1081.html"
128 ACCESSKEY="N"
129 >Next</A
130 ></TD
131 ></TR
132 ><TR
133 ><TD
134 WIDTH="33%"
135 ALIGN="left"
136 VALIGN="top"
137 >site-lib</TD
138 ><TD
139 WIDTH="34%"
140 ALIGN="center"
141 VALIGN="top"
142 >&nbsp;</TD
143 ><TD
144 WIDTH="33%"
145 ALIGN="right"
146 VALIGN="top"
147 >The findlib library</TD
148 ></TR
149 ></TABLE
150 ></DIV
151 ></BODY
152 ></HTML
153 >
+0
-164
doc/ref-html/p698.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Files</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib Reference Manual"
10 HREF="index.html"><LINK
11 REL="PREVIOUS"
12 TITLE="ocamlfind"
13 HREF="r17.html"><LINK
14 REL="NEXT"
15 TITLE="META"
16 HREF="r700.html"></HEAD
17 ><BODY
18 CLASS="PART"
19 BGCOLOR="#FFFFFF"
20 TEXT="#000000"
21 LINK="#0000FF"
22 VLINK="#840084"
23 ALINK="#0000FF"
24 ><DIV
25 CLASS="NAVHEADER"
26 ><TABLE
27 SUMMARY="Header navigation table"
28 WIDTH="100%"
29 BORDER="0"
30 CELLPADDING="0"
31 CELLSPACING="0"
32 ><TR
33 ><TH
34 COLSPAN="3"
35 ALIGN="center"
36 >The findlib Reference Manual</TH
37 ></TR
38 ><TR
39 ><TD
40 WIDTH="10%"
41 ALIGN="left"
42 VALIGN="bottom"
43 ><A
44 HREF="r17.html"
45 ACCESSKEY="P"
46 >Prev</A
47 ></TD
48 ><TD
49 WIDTH="80%"
50 ALIGN="center"
51 VALIGN="bottom"
52 ></TD
53 ><TD
54 WIDTH="10%"
55 ALIGN="right"
56 VALIGN="bottom"
57 ><A
58 HREF="r700.html"
59 ACCESSKEY="N"
60 >Next</A
61 ></TD
62 ></TR
63 ></TABLE
64 ><HR
65 ALIGN="LEFT"
66 WIDTH="100%"></DIV
67 ><DIV
68 CLASS="PART"
69 ><A
70 NAME="AEN698"
71 ></A
72 ><DIV
73 CLASS="TITLEPAGE"
74 ><H1
75 CLASS="TITLE"
76 >II. Files</H1
77 ><DIV
78 CLASS="TOC"
79 ><DL
80 ><DT
81 ><B
82 >Table of Contents</B
83 ></DT
84 ><DT
85 ><A
86 HREF="r700.html"
87 >META</A
88 >&nbsp;--&nbsp;[File that specifies metainformation of OCaml packages]</DT
89 ><DT
90 ><A
91 HREF="r804.html"
92 >findlib.conf</A
93 >&nbsp;--&nbsp;[Configuration of findlib/ocamlfind]</DT
94 ><DT
95 ><A
96 HREF="r1000.html"
97 >site-lib</A
98 >&nbsp;--&nbsp;[Location of package directories]</DT
99 ></DL
100 ></DIV
101 ></DIV
102 ></DIV
103 ><DIV
104 CLASS="NAVFOOTER"
105 ><HR
106 ALIGN="LEFT"
107 WIDTH="100%"><TABLE
108 SUMMARY="Footer navigation table"
109 WIDTH="100%"
110 BORDER="0"
111 CELLPADDING="0"
112 CELLSPACING="0"
113 ><TR
114 ><TD
115 WIDTH="33%"
116 ALIGN="left"
117 VALIGN="top"
118 ><A
119 HREF="r17.html"
120 ACCESSKEY="P"
121 >Prev</A
122 ></TD
123 ><TD
124 WIDTH="34%"
125 ALIGN="center"
126 VALIGN="top"
127 ><A
128 HREF="index.html"
129 ACCESSKEY="H"
130 >Home</A
131 ></TD
132 ><TD
133 WIDTH="33%"
134 ALIGN="right"
135 VALIGN="top"
136 ><A
137 HREF="r700.html"
138 ACCESSKEY="N"
139 >Next</A
140 ></TD
141 ></TR
142 ><TR
143 ><TD
144 WIDTH="33%"
145 ALIGN="left"
146 VALIGN="top"
147 >ocamlfind</TD
148 ><TD
149 WIDTH="34%"
150 ALIGN="center"
151 VALIGN="top"
152 >&nbsp;</TD
153 ><TD
154 WIDTH="33%"
155 ALIGN="right"
156 VALIGN="top"
157 >META</TD
158 ></TR
159 ></TABLE
160 ></DIV
161 ></BODY
162 ></HTML
163 >
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Files</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib Reference Manual"
10 HREF="index.html"><LINK
11 REL="PREVIOUS"
12 TITLE="ocamlfind"
13 HREF="r17.html"><LINK
14 REL="NEXT"
15 TITLE="META"
16 HREF="r721.html"></HEAD
17 ><BODY
18 CLASS="PART"
19 BGCOLOR="#FFFFFF"
20 TEXT="#000000"
21 LINK="#0000FF"
22 VLINK="#840084"
23 ALINK="#0000FF"
24 ><DIV
25 CLASS="NAVHEADER"
26 ><TABLE
27 SUMMARY="Header navigation table"
28 WIDTH="100%"
29 BORDER="0"
30 CELLPADDING="0"
31 CELLSPACING="0"
32 ><TR
33 ><TH
34 COLSPAN="3"
35 ALIGN="center"
36 >The findlib Reference Manual</TH
37 ></TR
38 ><TR
39 ><TD
40 WIDTH="10%"
41 ALIGN="left"
42 VALIGN="bottom"
43 ><A
44 HREF="r17.html"
45 ACCESSKEY="P"
46 >Prev</A
47 ></TD
48 ><TD
49 WIDTH="80%"
50 ALIGN="center"
51 VALIGN="bottom"
52 ></TD
53 ><TD
54 WIDTH="10%"
55 ALIGN="right"
56 VALIGN="bottom"
57 ><A
58 HREF="r721.html"
59 ACCESSKEY="N"
60 >Next</A
61 ></TD
62 ></TR
63 ></TABLE
64 ><HR
65 ALIGN="LEFT"
66 WIDTH="100%"></DIV
67 ><DIV
68 CLASS="PART"
69 ><A
70 NAME="AEN719"
71 ></A
72 ><DIV
73 CLASS="TITLEPAGE"
74 ><H1
75 CLASS="TITLE"
76 >II. Files</H1
77 ><DIV
78 CLASS="TOC"
79 ><DL
80 ><DT
81 ><B
82 >Table of Contents</B
83 ></DT
84 ><DT
85 ><A
86 HREF="r721.html"
87 >META</A
88 >&nbsp;--&nbsp;[File that specifies metainformation of OCaml packages]</DT
89 ><DT
90 ><A
91 HREF="r825.html"
92 >findlib.conf</A
93 >&nbsp;--&nbsp;[Configuration of findlib/ocamlfind]</DT
94 ><DT
95 ><A
96 HREF="r1021.html"
97 >site-lib</A
98 >&nbsp;--&nbsp;[Location of package directories]</DT
99 ></DL
100 ></DIV
101 ></DIV
102 ></DIV
103 ><DIV
104 CLASS="NAVFOOTER"
105 ><HR
106 ALIGN="LEFT"
107 WIDTH="100%"><TABLE
108 SUMMARY="Footer navigation table"
109 WIDTH="100%"
110 BORDER="0"
111 CELLPADDING="0"
112 CELLSPACING="0"
113 ><TR
114 ><TD
115 WIDTH="33%"
116 ALIGN="left"
117 VALIGN="top"
118 ><A
119 HREF="r17.html"
120 ACCESSKEY="P"
121 >Prev</A
122 ></TD
123 ><TD
124 WIDTH="34%"
125 ALIGN="center"
126 VALIGN="top"
127 ><A
128 HREF="index.html"
129 ACCESSKEY="H"
130 >Home</A
131 ></TD
132 ><TD
133 WIDTH="33%"
134 ALIGN="right"
135 VALIGN="top"
136 ><A
137 HREF="r721.html"
138 ACCESSKEY="N"
139 >Next</A
140 ></TD
141 ></TR
142 ><TR
143 ><TD
144 WIDTH="33%"
145 ALIGN="left"
146 VALIGN="top"
147 >ocamlfind</TD
148 ><TD
149 WIDTH="34%"
150 ALIGN="center"
151 VALIGN="top"
152 >&nbsp;</TD
153 ><TD
154 WIDTH="33%"
155 ALIGN="right"
156 VALIGN="top"
157 >META</TD
158 ></TR
159 ></TABLE
160 ></DIV
161 ></BODY
162 ></HTML
163 >
+0
-401
doc/ref-html/r1000.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >site-lib</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib Reference Manual"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="Files"
13 HREF="p698.html"><LINK
14 REL="PREVIOUS"
15 TITLE="findlib.conf"
16 HREF="r804.html"><LINK
17 REL="NEXT"
18 TITLE="Library"
19 HREF="p1058.html"></HEAD
20 ><BODY
21 CLASS="REFENTRY"
22 BGCOLOR="#FFFFFF"
23 TEXT="#000000"
24 LINK="#0000FF"
25 VLINK="#840084"
26 ALINK="#0000FF"
27 ><DIV
28 CLASS="NAVHEADER"
29 ><TABLE
30 SUMMARY="Header navigation table"
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >The findlib Reference Manual</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="r804.html"
48 ACCESSKEY="P"
49 >Prev</A
50 ></TD
51 ><TD
52 WIDTH="80%"
53 ALIGN="center"
54 VALIGN="bottom"
55 ></TD
56 ><TD
57 WIDTH="10%"
58 ALIGN="right"
59 VALIGN="bottom"
60 ><A
61 HREF="p1058.html"
62 ACCESSKEY="N"
63 >Next</A
64 ></TD
65 ></TR
66 ></TABLE
67 ><HR
68 ALIGN="LEFT"
69 WIDTH="100%"></DIV
70 ><H1
71 ><A
72 NAME="AEN1000"
73 ></A
74 >site-lib</H1
75 ><DIV
76 CLASS="REFNAMEDIV"
77 ><A
78 NAME="SITE-LIB"
79 ></A
80 ><H2
81 >Name</H2
82 >site-lib&nbsp;--&nbsp;[Location of package directories]</DIV
83 ><DIV
84 CLASS="REFSYNOPSISDIV"
85 ><A
86 NAME="AEN1008"
87 ></A
88 ><H2
89 >STANDARD LAYOUT</H2
90 ><PRE
91 CLASS="SYNOPSIS"
92 >...somewhere in the filesystem hierarchy...
93 |
94 \
95 site-lib
96 |
97 +- (optional) stublibs
98 +- (optional) postinstall
99 +- (optional) postremove
100 |
101 +- <TT
102 CLASS="REPLACEABLE"
103 ><I
104 >package1</I
105 ></TT
106 >
107 | |
108 | +- META
109 | +- <TT
110 CLASS="REPLACEABLE"
111 ><I
112 >archive files</I
113 ></TT
114 >
115 | +- <TT
116 CLASS="REPLACEABLE"
117 ><I
118 >interface definitions</I
119 ></TT
120 >
121 |
122 +- <TT
123 CLASS="REPLACEABLE"
124 ><I
125 >package2</I
126 ></TT
127 >
128 +
129 :
130 :
131 \
132 <TT
133 CLASS="REPLACEABLE"
134 ><I
135 >packageN</I
136 ></TT
137 ></PRE
138 ></DIV
139 ><DIV
140 CLASS="REFSECT1"
141 ><A
142 NAME="AEN1016"
143 ></A
144 ><H2
145 >DESCRIPTION</H2
146 ><P
147 >Every installation of "findlib" has a default location for package
148 directories, which is normally a directory called "site-lib". The
149 location can be set by the configuration variables
150 <TT
151 CLASS="LITERAL"
152 >path</TT
153 > (used to look up packages), and
154 <TT
155 CLASS="LITERAL"
156 >destdir</TT
157 > (used to install new packages);
158 see <A
159 HREF="r804.html#FINDLIB.CONF"
160 >findlib.conf</A
161 >.</P
162 ><P
163 >The name of a package is the name of the package directory. For
164 example, if <TT
165 CLASS="LITERAL"
166 >destdir=/usr/local/lib/ocaml/site-lib</TT
167 >, the
168 package p will be installed in the subdirectory
169 <TT
170 CLASS="LITERAL"
171 >/usr/local/lib/ocaml/site-lib/p</TT
172 >. This subdirectory
173 must contain the META file and all other files belonging to the package.
174 Package names must not contain the '.' character.</P
175 ><P
176 >The variable <TT
177 CLASS="LITERAL"
178 >destdir</TT
179 > specifies the directory for
180 new packages. You can only have one such directory at a time; but of
181 course you can change this directory in findlib.conf. The command
182 <TT
183 CLASS="LITERAL"
184 >ocamlfind install</TT
185 > puts new packages into this
186 directory; it is recommended to use this command for installation
187 because it ensures that the directory layout is right.</P
188 ><P
189 >For searching packages, findlib uses (only) the variable
190 <TT
191 CLASS="LITERAL"
192 >path</TT
193 > which may name several locations to look at.</P
194 ><P
195 >For systems with DLL support another directory may exist: stublibs.
196 If present, findlib will install DLLs into this directory that is
197 shared by all packages at the same site-lib location. Findlib remembers
198 which DLL belongs to which package by special files with the suffix
199 ".owner"; e.g. for the DLL "dllpcre.so" there is another file
200 "dllpcre.so.owner" containing the string "pcre", so findlib knows
201 that the package "pcre" owns this DLL. It is not possible that a DLL
202 is owned by several packages.</P
203 ><P
204 >If the stublibs directory does not exist, DLLs are installed regularly
205 in the package directories like any other file.</P
206 ><P
207 >For special needs, a postinstall and/or a postremove script may be
208 installed in the site-lib directory. These scripts are invoked after
209 installation or removal of a package, respectively.</P
210 ></DIV
211 ><DIV
212 CLASS="REFSECT1"
213 ><A
214 NAME="AEN1033"
215 ></A
216 ><H2
217 >ALTERNATE LAYOUT</H2
218 ><P
219 >&#13;<PRE
220 CLASS="PROGRAMLISTING"
221 >...somewhere in the filesystem hierarchy...
222 |
223 \
224 site-lib
225 |
226 +- (optional) stublibs
227 +- (optional) postinstall
228 +- (optional) postremove
229 |
230 +- <TT
231 CLASS="REPLACEABLE"
232 ><I
233 >package1</I
234 ></TT
235 >
236 | |
237 | +- <TT
238 CLASS="REPLACEABLE"
239 ><I
240 >archive files</I
241 ></TT
242 >
243 | +- <TT
244 CLASS="REPLACEABLE"
245 ><I
246 >interface definitions</I
247 ></TT
248 >
249 |
250 +- <TT
251 CLASS="REPLACEABLE"
252 ><I
253 >package2</I
254 ></TT
255 >
256 +
257 :
258 :
259 \
260 : <TT
261 CLASS="REPLACEABLE"
262 ><I
263 >packageN</I
264 ></TT
265 >
266 |
267 \
268 metaregistry
269 |
270 +- META.package1
271 +- META.package2
272 +
273 :
274 \
275 META.packageN</PRE
276 ></P
277 ><P
278 >This is an alternate directory layout collecting all META files in one
279 directory. You can configure this layout by setting
280 <TT
281 CLASS="LITERAL"
282 >path</TT
283 > to the absolute location of
284 <TT
285 CLASS="LITERAL"
286 >metaregistry</TT
287 >. Findlib recognizes that there are
288 META files in this directory and uses them; it is not necessary to
289 include <TT
290 CLASS="LITERAL"
291 >site-lib</TT
292 > into the <TT
293 CLASS="LITERAL"
294 >path</TT
295 >.</P
296 ><P
297 >In order to work, the META files must contain a
298 <TT
299 CLASS="LITERAL"
300 >directory</TT
301 > directive pointing to the corresponding
302 package directory that resides below <TT
303 CLASS="LITERAL"
304 >site-lib</TT
305 >.</P
306 ><P
307 >The command <TT
308 CLASS="LITERAL"
309 >ocamlfind install</TT
310 > copes with this
311 layout, too. The variable <TT
312 CLASS="LITERAL"
313 >destdir</TT
314 > must contain the
315 absolute location of <TT
316 CLASS="LITERAL"
317 >site-lib</TT
318 >, and the variable
319 <TT
320 CLASS="LITERAL"
321 >metadir</TT
322 > must contain the absolute location of
323 <TT
324 CLASS="LITERAL"
325 >metaregistry</TT
326 >. Note that <TT
327 CLASS="LITERAL"
328 >ocamlfind
329 install</TT
330 > automatically adds a <TT
331 CLASS="LITERAL"
332 >directory</TT
333 >
334 directive to the META file, so you need not do it manually.</P
335 ></DIV
336 ><DIV
337 CLASS="NAVFOOTER"
338 ><HR
339 ALIGN="LEFT"
340 WIDTH="100%"><TABLE
341 SUMMARY="Footer navigation table"
342 WIDTH="100%"
343 BORDER="0"
344 CELLPADDING="0"
345 CELLSPACING="0"
346 ><TR
347 ><TD
348 WIDTH="33%"
349 ALIGN="left"
350 VALIGN="top"
351 ><A
352 HREF="r804.html"
353 ACCESSKEY="P"
354 >Prev</A
355 ></TD
356 ><TD
357 WIDTH="34%"
358 ALIGN="center"
359 VALIGN="top"
360 ><A
361 HREF="index.html"
362 ACCESSKEY="H"
363 >Home</A
364 ></TD
365 ><TD
366 WIDTH="33%"
367 ALIGN="right"
368 VALIGN="top"
369 ><A
370 HREF="p1058.html"
371 ACCESSKEY="N"
372 >Next</A
373 ></TD
374 ></TR
375 ><TR
376 ><TD
377 WIDTH="33%"
378 ALIGN="left"
379 VALIGN="top"
380 >findlib.conf</TD
381 ><TD
382 WIDTH="34%"
383 ALIGN="center"
384 VALIGN="top"
385 ><A
386 HREF="p698.html"
387 ACCESSKEY="U"
388 >Up</A
389 ></TD
390 ><TD
391 WIDTH="33%"
392 ALIGN="right"
393 VALIGN="top"
394 >Library</TD
395 ></TR
396 ></TABLE
397 ></DIV
398 ></BODY
399 ></HTML
400 >
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >site-lib</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib Reference Manual"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="Files"
13 HREF="p719.html"><LINK
14 REL="PREVIOUS"
15 TITLE="findlib.conf"
16 HREF="r825.html"><LINK
17 REL="NEXT"
18 TITLE="Library"
19 HREF="p1079.html"></HEAD
20 ><BODY
21 CLASS="REFENTRY"
22 BGCOLOR="#FFFFFF"
23 TEXT="#000000"
24 LINK="#0000FF"
25 VLINK="#840084"
26 ALINK="#0000FF"
27 ><DIV
28 CLASS="NAVHEADER"
29 ><TABLE
30 SUMMARY="Header navigation table"
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >The findlib Reference Manual</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="r825.html"
48 ACCESSKEY="P"
49 >Prev</A
50 ></TD
51 ><TD
52 WIDTH="80%"
53 ALIGN="center"
54 VALIGN="bottom"
55 ></TD
56 ><TD
57 WIDTH="10%"
58 ALIGN="right"
59 VALIGN="bottom"
60 ><A
61 HREF="p1079.html"
62 ACCESSKEY="N"
63 >Next</A
64 ></TD
65 ></TR
66 ></TABLE
67 ><HR
68 ALIGN="LEFT"
69 WIDTH="100%"></DIV
70 ><H1
71 ><A
72 NAME="AEN1021"
73 ></A
74 >site-lib</H1
75 ><DIV
76 CLASS="REFNAMEDIV"
77 ><A
78 NAME="SITE-LIB"
79 ></A
80 ><H2
81 >Name</H2
82 >site-lib&nbsp;--&nbsp;[Location of package directories]</DIV
83 ><DIV
84 CLASS="REFSYNOPSISDIV"
85 ><A
86 NAME="AEN1029"
87 ></A
88 ><H2
89 >STANDARD LAYOUT</H2
90 ><PRE
91 CLASS="SYNOPSIS"
92 >...somewhere in the filesystem hierarchy...
93 |
94 \
95 site-lib
96 |
97 +- (optional) stublibs
98 +- (optional) postinstall
99 +- (optional) postremove
100 |
101 +- <TT
102 CLASS="REPLACEABLE"
103 ><I
104 >package1</I
105 ></TT
106 >
107 | |
108 | +- META
109 | +- <TT
110 CLASS="REPLACEABLE"
111 ><I
112 >archive files</I
113 ></TT
114 >
115 | +- <TT
116 CLASS="REPLACEABLE"
117 ><I
118 >interface definitions</I
119 ></TT
120 >
121 |
122 +- <TT
123 CLASS="REPLACEABLE"
124 ><I
125 >package2</I
126 ></TT
127 >
128 +
129 :
130 :
131 \
132 <TT
133 CLASS="REPLACEABLE"
134 ><I
135 >packageN</I
136 ></TT
137 ></PRE
138 ></DIV
139 ><DIV
140 CLASS="REFSECT1"
141 ><A
142 NAME="AEN1037"
143 ></A
144 ><H2
145 >DESCRIPTION</H2
146 ><P
147 >Every installation of "findlib" has a default location for package
148 directories, which is normally a directory called "site-lib". The
149 location can be set by the configuration variables
150 <TT
151 CLASS="LITERAL"
152 >path</TT
153 > (used to look up packages), and
154 <TT
155 CLASS="LITERAL"
156 >destdir</TT
157 > (used to install new packages);
158 see <A
159 HREF="r825.html#FINDLIB.CONF"
160 >findlib.conf</A
161 >.</P
162 ><P
163 >The name of a package is the name of the package directory. For
164 example, if <TT
165 CLASS="LITERAL"
166 >destdir=/usr/local/lib/ocaml/site-lib</TT
167 >, the
168 package p will be installed in the subdirectory
169 <TT
170 CLASS="LITERAL"
171 >/usr/local/lib/ocaml/site-lib/p</TT
172 >. This subdirectory
173 must contain the META file and all other files belonging to the package.
174 Package names must not contain the '.' character.</P
175 ><P
176 >The variable <TT
177 CLASS="LITERAL"
178 >destdir</TT
179 > specifies the directory for
180 new packages. You can only have one such directory at a time; but of
181 course you can change this directory in findlib.conf. The command
182 <TT
183 CLASS="LITERAL"
184 >ocamlfind install</TT
185 > puts new packages into this
186 directory; it is recommended to use this command for installation
187 because it ensures that the directory layout is right.</P
188 ><P
189 >For searching packages, findlib uses (only) the variable
190 <TT
191 CLASS="LITERAL"
192 >path</TT
193 > which may name several locations to look at.</P
194 ><P
195 >For systems with DLL support another directory may exist: stublibs.
196 If present, findlib will install DLLs into this directory that is
197 shared by all packages at the same site-lib location. Findlib remembers
198 which DLL belongs to which package by special files with the suffix
199 ".owner"; e.g. for the DLL "dllpcre.so" there is another file
200 "dllpcre.so.owner" containing the string "pcre", so findlib knows
201 that the package "pcre" owns this DLL. It is not possible that a DLL
202 is owned by several packages.</P
203 ><P
204 >If the stublibs directory does not exist, DLLs are installed regularly
205 in the package directories like any other file.</P
206 ><P
207 >For special needs, a postinstall and/or a postremove script may be
208 installed in the site-lib directory. These scripts are invoked after
209 installation or removal of a package, respectively.</P
210 ></DIV
211 ><DIV
212 CLASS="REFSECT1"
213 ><A
214 NAME="AEN1054"
215 ></A
216 ><H2
217 >ALTERNATE LAYOUT</H2
218 ><P
219 >&#13;<PRE
220 CLASS="PROGRAMLISTING"
221 >...somewhere in the filesystem hierarchy...
222 |
223 \
224 site-lib
225 |
226 +- (optional) stublibs
227 +- (optional) postinstall
228 +- (optional) postremove
229 |
230 +- <TT
231 CLASS="REPLACEABLE"
232 ><I
233 >package1</I
234 ></TT
235 >
236 | |
237 | +- <TT
238 CLASS="REPLACEABLE"
239 ><I
240 >archive files</I
241 ></TT
242 >
243 | +- <TT
244 CLASS="REPLACEABLE"
245 ><I
246 >interface definitions</I
247 ></TT
248 >
249 |
250 +- <TT
251 CLASS="REPLACEABLE"
252 ><I
253 >package2</I
254 ></TT
255 >
256 +
257 :
258 :
259 \
260 : <TT
261 CLASS="REPLACEABLE"
262 ><I
263 >packageN</I
264 ></TT
265 >
266 |
267 \
268 metaregistry
269 |
270 +- META.package1
271 +- META.package2
272 +
273 :
274 \
275 META.packageN</PRE
276 ></P
277 ><P
278 >This is an alternate directory layout collecting all META files in one
279 directory. You can configure this layout by setting
280 <TT
281 CLASS="LITERAL"
282 >path</TT
283 > to the absolute location of
284 <TT
285 CLASS="LITERAL"
286 >metaregistry</TT
287 >. Findlib recognizes that there are
288 META files in this directory and uses them; it is not necessary to
289 include <TT
290 CLASS="LITERAL"
291 >site-lib</TT
292 > into the <TT
293 CLASS="LITERAL"
294 >path</TT
295 >.</P
296 ><P
297 >In order to work, the META files must contain a
298 <TT
299 CLASS="LITERAL"
300 >directory</TT
301 > directive pointing to the corresponding
302 package directory that resides below <TT
303 CLASS="LITERAL"
304 >site-lib</TT
305 >.</P
306 ><P
307 >The command <TT
308 CLASS="LITERAL"
309 >ocamlfind install</TT
310 > copes with this
311 layout, too. The variable <TT
312 CLASS="LITERAL"
313 >destdir</TT
314 > must contain the
315 absolute location of <TT
316 CLASS="LITERAL"
317 >site-lib</TT
318 >, and the variable
319 <TT
320 CLASS="LITERAL"
321 >metadir</TT
322 > must contain the absolute location of
323 <TT
324 CLASS="LITERAL"
325 >metaregistry</TT
326 >. Note that <TT
327 CLASS="LITERAL"
328 >ocamlfind
329 install</TT
330 > automatically adds a <TT
331 CLASS="LITERAL"
332 >directory</TT
333 >
334 directive to the META file, so you need not do it manually.</P
335 ></DIV
336 ><DIV
337 CLASS="NAVFOOTER"
338 ><HR
339 ALIGN="LEFT"
340 WIDTH="100%"><TABLE
341 SUMMARY="Footer navigation table"
342 WIDTH="100%"
343 BORDER="0"
344 CELLPADDING="0"
345 CELLSPACING="0"
346 ><TR
347 ><TD
348 WIDTH="33%"
349 ALIGN="left"
350 VALIGN="top"
351 ><A
352 HREF="r825.html"
353 ACCESSKEY="P"
354 >Prev</A
355 ></TD
356 ><TD
357 WIDTH="34%"
358 ALIGN="center"
359 VALIGN="top"
360 ><A
361 HREF="index.html"
362 ACCESSKEY="H"
363 >Home</A
364 ></TD
365 ><TD
366 WIDTH="33%"
367 ALIGN="right"
368 VALIGN="top"
369 ><A
370 HREF="p1079.html"
371 ACCESSKEY="N"
372 >Next</A
373 ></TD
374 ></TR
375 ><TR
376 ><TD
377 WIDTH="33%"
378 ALIGN="left"
379 VALIGN="top"
380 >findlib.conf</TD
381 ><TD
382 WIDTH="34%"
383 ALIGN="center"
384 VALIGN="top"
385 ><A
386 HREF="p719.html"
387 ACCESSKEY="U"
388 >Up</A
389 ></TD
390 ><TD
391 WIDTH="33%"
392 ALIGN="right"
393 VALIGN="top"
394 >Library</TD
395 ></TR
396 ></TABLE
397 ></DIV
398 ></BODY
399 ></HTML
400 >
1616 HREF="p15.html"><LINK
1717 REL="NEXT"
1818 TITLE="Files"
19 HREF="p698.html"></HEAD
19 HREF="p719.html"></HEAD
2020 ><BODY
2121 CLASS="REFENTRY"
2222 BGCOLOR="#FFFFFF"
5858 ALIGN="right"
5959 VALIGN="bottom"
6060 ><A
61 HREF="p698.html"
61 HREF="p719.html"
6262 ACCESSKEY="N"
6363 >Next</A
6464 ></TD
190190 >
191191 or: <A
192192 HREF="r17.html#OCAMLFIND.LIST"
193 >ocamlfind lint <TT
194 CLASS="REPLACEABLE"
195 ><I
196 >META</I
197 ></TT
198 ></A
199 >
200 or: <A
201 HREF="r17.html#OCAMLFIND.LIST"
193202 >ocamlfind list [-describe]</A
194203 >
195204 or: <A
230239 ><DIV
231240 CLASS="REFSECT1"
232241 ><A
233 NAME="AEN58"
242 NAME="AEN60"
234243 ></A
235244 ><H2
236245 ><A
241250 ><DIV
242251 CLASS="REFSECT2"
243252 ><A
244 NAME="AEN61"
253 NAME="AEN63"
245254 ></A
246255 ><H3
247256 >Synopsis</H3
295304 ><DIV
296305 CLASS="REFSECT2"
297306 ><A
298 NAME="AEN70"
307 NAME="AEN72"
299308 ></A
300309 ><H3
301310 >Description</H3
324333 ><DIV
325334 CLASS="REFSECT2"
326335 ><A
327 NAME="AEN75"
336 NAME="AEN77"
328337 ></A
329338 ><H3
330339 >Options</H3
481490 ><DIV
482491 CLASS="REFSECT2"
483492 ><A
484 NAME="AEN143"
493 NAME="AEN145"
485494 ></A
486495 ><H3
487496 >Placeholders meaningful in the -format option</H3
509518 >Replaced by the package directory</P
510519 ></DD
511520 ><DT
521 >%m</DT
522 ><DD
523 ><P
524 >Replaced by the path to the META file (new since findlib-1.6)</P
525 ></DD
526 ><DT
512527 >%D</DT
513528 ><DD
514529 ><P
579594 ><DIV
580595 CLASS="REFSECT1"
581596 ><A
582 NAME="AEN195"
597 NAME="AEN201"
583598 ></A
584599 ><H2
585600 ><A
602617 ><DIV
603618 CLASS="REFSECT2"
604619 ><A
605 NAME="AEN201"
620 NAME="AEN207"
606621 ></A
607622 ><H3
608623 >Synopsis</H3
687702 ><DIV
688703 CLASS="REFSECT2"
689704 ><A
690 NAME="AEN216"
705 NAME="AEN222"
691706 ></A
692707 ><H3
693708 >Description</H3
739754 ><DIV
740755 CLASS="REFSECT2"
741756 ><A
742 NAME="AEN227"
757 NAME="AEN233"
743758 ></A
744759 ><H3
745760 >Options for compiling and linking</H3
922937 ><DIV
923938 CLASS="REFSECT2"
924939 ><A
925 NAME="AEN295"
940 NAME="AEN301"
926941 ></A
927942 ><H3
928943 >Options for preprocessing</H3
982997 ><DIV
983998 CLASS="REFSECT2"
984999 ><A
985 NAME="AEN315"
1000 NAME="AEN321"
9861001 ></A
9871002 ><H3
9881003 >Predicates for compiling and linking</H3
10841099 ><DIV
10851100 CLASS="REFSECT2"
10861101 ><A
1087 NAME="AEN359"
1102 NAME="AEN365"
10881103 ></A
10891104 ><H3
10901105 >Predicates for preprocessing</H3
11411156 ><DIV
11421157 CLASS="REFSECT2"
11431158 ><A
1144 NAME="AEN381"
1159 NAME="AEN387"
11451160 ></A
11461161 ><H3
11471162 >Special behaviour of "ocamlmktop"</H3
11581173 ><DIV
11591174 CLASS="REFSECT2"
11601175 ><A
1161 NAME="AEN385"
1176 NAME="AEN391"
11621177 ></A
11631178 ><H3
11641179 >Fixup of the dependency graph for multi-threading</H3
11741189 ><DIV
11751190 CLASS="REFSECT2"
11761191 ><A
1177 NAME="AEN388"
1192 NAME="AEN394"
11781193 ></A
11791194 ><H3
11801195 >Extended file naming</H3
12171232 ><DIV
12181233 CLASS="REFSECT2"
12191234 ><A
1220 NAME="AEN397"
1235 NAME="AEN403"
12211236 ></A
12221237 ><H3
12231238 >How to set the names of the compiler executables</H3
12891304 ><P
12901305 >Alternatively, you can change the configuration file
12911306 <A
1292 HREF="r804.html#FINDLIB.CONF"
1307 HREF="r825.html#FINDLIB.CONF"
12931308 >findlib.conf</A
12941309 >.</P
12951310 ></DIV
12971312 ><DIV
12981313 CLASS="REFSECT1"
12991314 ><A
1300 NAME="AEN417"
1315 NAME="AEN423"
13011316 ></A
13021317 ><H2
13031318 ><A
13081323 ><DIV
13091324 CLASS="REFSECT2"
13101325 ><A
1311 NAME="AEN420"
1326 NAME="AEN426"
13121327 ></A
13131328 ><H3
13141329 >Synopsis</H3
13621377 ><DIV
13631378 CLASS="REFSECT2"
13641379 ><A
1365 NAME="AEN430"
1380 NAME="AEN436"
13661381 ></A
13671382 ><H3
13681383 >Description</H3
13781393 ><DIV
13791394 CLASS="REFSECT1"
13801395 ><A
1381 NAME="AEN434"
1396 NAME="AEN440"
13821397 ></A
13831398 ><H2
13841399 ><A
13891404 ><DIV
13901405 CLASS="REFSECT2"
13911406 ><A
1392 NAME="AEN437"
1407 NAME="AEN443"
13931408 ></A
13941409 ><H3
13951410 >Synopsis</H3
14411456 ><DIV
14421457 CLASS="REFSECT2"
14431458 ><A
1444 NAME="AEN447"
1459 NAME="AEN453"
14451460 ></A
14461461 ><H3
14471462 >Description</H3
14601475 ><DIV
14611476 CLASS="REFSECT2"
14621477 ><A
1463 NAME="AEN452"
1478 NAME="AEN458"
14641479 ></A
14651480 ><H3
14661481 >Options</H3
15591574 ><DIV
15601575 CLASS="REFSECT2"
15611576 ><A
1562 NAME="AEN489"
1577 NAME="AEN495"
15631578 ></A
15641579 ><H3
15651580 >Example</H3
15891604 ><DIV
15901605 CLASS="REFSECT1"
15911606 ><A
1592 NAME="AEN496"
1607 NAME="AEN502"
15931608 ></A
15941609 ><H2
15951610 ><A
16001615 ><DIV
16011616 CLASS="REFSECT2"
16021617 ><A
1603 NAME="AEN499"
1618 NAME="AEN505"
16041619 ></A
16051620 ><H3
16061621 >Synopsis</H3
16241639 ><DIV
16251640 CLASS="REFSECT2"
16261641 ><A
1627 NAME="AEN504"
1642 NAME="AEN510"
16281643 ></A
16291644 ><H3
16301645 >Description</H3
16601675 ><DIV
16611676 CLASS="REFSECT1"
16621677 ><A
1663 NAME="AEN514"
1678 NAME="AEN520"
16641679 ></A
16651680 ><H2
16661681 ><A
16711686 ><DIV
16721687 CLASS="REFSECT2"
16731688 ><A
1674 NAME="AEN517"
1689 NAME="AEN523"
16751690 ></A
16761691 ><H3
16771692 >Synopsis</H3
17181733 ><DIV
17191734 CLASS="REFSECT2"
17201735 ><A
1721 NAME="AEN526"
1736 NAME="AEN532"
17221737 ></A
17231738 ><H3
17241739 >Description</H3
17311746 ><DIV
17321747 CLASS="REFSECT2"
17331748 ><A
1734 NAME="AEN529"
1749 NAME="AEN535"
17351750 ></A
17361751 ><H3
17371752 >Options</H3
18151830 ><DIV
18161831 CLASS="REFSECT1"
18171832 ><A
1818 NAME="AEN556"
1833 NAME="AEN562"
18191834 ></A
18201835 ><H2
18211836 ><A
18261841 ><DIV
18271842 CLASS="REFSECT2"
18281843 ><A
1829 NAME="AEN559"
1844 NAME="AEN565"
18301845 ></A
18311846 ><H3
18321847 >Synopsis</H3
18801895 ><DIV
18811896 CLASS="REFSECT2"
18821897 ><A
1883 NAME="AEN569"
1898 NAME="AEN575"
18841899 ></A
18851900 ><H3
18861901 >Description</H3
18911906 >destdir</TT
18921907 > of
18931908 <A
1894 HREF="r804.html#FINDLIB.CONF"
1909 HREF="r825.html#FINDLIB.CONF"
18951910 >findlib.conf</A
18961911 >), or in the directory
18971912 specified by the -destdir option. This
19131928 >metadir</TT
19141929 > of
19151930 <A
1916 HREF="r804.html#FINDLIB.CONF"
1931 HREF="r825.html#FINDLIB.CONF"
19171932 >findlib.conf</A
19181933 >, or to specify the
19191934 -metadir option. In this case, the file called META is copied to the
19912006 ><DIV
19922007 CLASS="REFSECT1"
19932008 ><A
1994 NAME="AEN593"
2009 NAME="AEN599"
19952010 ></A
19962011 ><H2
19972012 ><A
20022017 ><DIV
20032018 CLASS="REFSECT2"
20042019 ><A
2005 NAME="AEN596"
2020 NAME="AEN602"
20062021 ></A
20072022 ><H3
20082023 >Synopsis</H3
20362051 ><DIV
20372052 CLASS="REFSECT2"
20382053 ><A
2039 NAME="AEN603"
2054 NAME="AEN609"
20402055 ></A
20412056 ><H3
20422057 >Description</H3
20472062 >destdir</TT
20482063 > of
20492064 <A
2050 HREF="r804.html#FINDLIB.CONF"
2065 HREF="r825.html#FINDLIB.CONF"
20512066 >findlib.conf</A
20522067 >). If the package
20532068 resides at a different location, it will not be removed by default;
20642079 >metadir</TT
20652080 > variable
20662081 of <A
2067 HREF="r804.html#FINDLIB.CONF"
2082 HREF="r825.html#FINDLIB.CONF"
20682083 >findlib.conf</A
20692084 >, or by specifying
20702085 the -metadir option.</P
20902105 ><DIV
20912106 CLASS="REFSECT1"
20922107 ><A
2093 NAME="AEN616"
2108 NAME="AEN622"
20942109 ></A
20952110 ><H2
20962111 ><A
21012116 ><DIV
21022117 CLASS="REFSECT2"
21032118 ><A
2104 NAME="AEN619"
2119 NAME="AEN625"
21052120 ></A
21062121 ><H3
21072122 >Synopsis</H3
21122127 ><DIV
21132128 CLASS="REFSECT2"
21142129 ><A
2115 NAME="AEN622"
2130 NAME="AEN628"
21162131 ></A
21172132 ><H3
21182133 >Description</H3
21242139 ><DIV
21252140 CLASS="REFSECT1"
21262141 ><A
2127 NAME="AEN625"
2142 NAME="AEN631"
21282143 ></A
21292144 ><H2
21302145 ><A
2131 NAME="OCAMLFIND.PRINTCONF"
2132 ></A
2133 >
2134 THE "printconf" SUBCOMMAND</H2
2135 ><DIV
2136 CLASS="REFSECT2"
2137 ><A
2138 NAME="AEN628"
2146 NAME="OCAMLFIND.LINT"
2147 ></A
2148 >
2149 THE "lint" SUBCOMMAND</H2
2150 ><DIV
2151 CLASS="REFSECT2"
2152 ><A
2153 NAME="AEN634"
21392154 ></A
21402155 ><H3
21412156 >Synopsis</H3
21422157 ><PRE
21432158 CLASS="PROGRAMLISTING"
2144 >ocamlfind printconf [ conf | path | destdir | metadir | stdlib | ldconf ]</PRE
2145 ></DIV
2146 ><DIV
2147 CLASS="REFSECT2"
2148 ><A
2149 NAME="AEN631"
2159 >ocamlfind lint <TT
2160 CLASS="REPLACEABLE"
2161 ><I
2162 >file</I
2163 ></TT
2164 ></PRE
2165 ></DIV
2166 ><DIV
2167 CLASS="REFSECT2"
2168 ><A
2169 NAME="AEN638"
2170 ></A
2171 ><H3
2172 >Description</H3
2173 ><P
2174 >Checks the META file, and reports possible problems.</P
2175 ></DIV
2176 ></DIV
2177 ><DIV
2178 CLASS="REFSECT1"
2179 ><A
2180 NAME="AEN641"
2181 ></A
2182 ><H2
2183 ><A
2184 NAME="OCAMLFIND.PRINTCONF"
2185 ></A
2186 >
2187 THE "printconf" SUBCOMMAND</H2
2188 ><DIV
2189 CLASS="REFSECT2"
2190 ><A
2191 NAME="AEN644"
2192 ></A
2193 ><H3
2194 >Synopsis</H3
2195 ><PRE
2196 CLASS="PROGRAMLISTING"
2197 >ocamlfind printconf [ conf | path | destdir | metadir | metapath | stdlib | ldconf ]</PRE
2198 ></DIV
2199 ><DIV
2200 CLASS="REFSECT2"
2201 ><A
2202 NAME="AEN647"
21502203 ></A
21512204 ><H3
21522205 >Description</H3
22052258 ><DT
22062259 ><TT
22072260 CLASS="LITERAL"
2261 >metapath</TT
2262 ></DT
2263 ><DD
2264 ><P
2265 >Prints the path where the META file is installed for
2266 a fictive package. The name of the package is marked with '%s' in the
2267 path. For instance, this command could output "/some/path/%s/META" or
2268 "/some/path/META.%s", depending on the layout.</P
2269 ></DD
2270 ><DT
2271 ><TT
2272 CLASS="LITERAL"
22082273 >stdlib</TT
22092274 ></DT
22102275 ><DD
22272292 ><DIV
22282293 CLASS="REFSECT1"
22292294 ><A
2230 NAME="AEN665"
2295 NAME="AEN686"
22312296 ></A
22322297 ><H2
22332298 ><A
22382303 ><DIV
22392304 CLASS="REFSECT2"
22402305 ><A
2241 NAME="AEN668"
2306 NAME="AEN689"
22422307 ></A
22432308 ><H3
22442309 >Synopsis</H3
22642329 ><DIV
22652330 CLASS="REFSECT2"
22662331 ><A
2267 NAME="AEN674"
2332 NAME="AEN695"
22682333 ></A
22692334 ><H3
22702335 >Description</H3
22992364 ><DIV
23002365 CLASS="REFSECT1"
23012366 ><A
2302 NAME="AEN682"
2367 NAME="AEN703"
23032368 ></A
23042369 ><H2
23052370 > CONFIGURATION FILE, ENVIRONMENT VARIABLES</H2
23072372 > The configuration file and environment variables are documented
23082373 in the manual page for
23092374 <A
2310 HREF="r804.html#FINDLIB.CONF"
2375 HREF="r825.html#FINDLIB.CONF"
23112376 >findlib.conf</A
23122377 >.</P
23132378 ></DIV
23142379 ><DIV
23152380 CLASS="REFSECT1"
23162381 ><A
2317 NAME="AEN686"
2382 NAME="AEN707"
23182383 ></A
23192384 ><H2
23202385 ><A
23252390 ><DIV
23262391 CLASS="REFSECT2"
23272392 ><A
2328 NAME="AEN689"
2393 NAME="AEN710"
23292394 ></A
23302395 ><H3
23312396 >Synopsis</H3
23412406 ><DIV
23422407 CLASS="REFSECT2"
23432408 ><A
2344 NAME="AEN693"
2409 NAME="AEN714"
23452410 ></A
23462411 ><H3
23472412 >Description</H3
23562421 can switch to different command sets. For instance, the toolchain
23572422 "foo" may consist of a patched ocamlc compiler.
23582423 See <A
2359 HREF="r804.html#FINDLIB.CONF"
2424 HREF="r825.html#FINDLIB.CONF"
23602425 >findlib.conf</A
23612426 > how to
23622427 configure toolchains.</P
23962461 ALIGN="right"
23972462 VALIGN="top"
23982463 ><A
2399 HREF="p698.html"
2464 HREF="p719.html"
24002465 ACCESSKEY="N"
24012466 >Next</A
24022467 ></TD
+0
-564
doc/ref-html/r700.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >META</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib Reference Manual"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="Files"
13 HREF="p698.html"><LINK
14 REL="PREVIOUS"
15 TITLE="Files"
16 HREF="p698.html"><LINK
17 REL="NEXT"
18 TITLE="findlib.conf"
19 HREF="r804.html"></HEAD
20 ><BODY
21 CLASS="REFENTRY"
22 BGCOLOR="#FFFFFF"
23 TEXT="#000000"
24 LINK="#0000FF"
25 VLINK="#840084"
26 ALINK="#0000FF"
27 ><DIV
28 CLASS="NAVHEADER"
29 ><TABLE
30 SUMMARY="Header navigation table"
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >The findlib Reference Manual</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="p698.html"
48 ACCESSKEY="P"
49 >Prev</A
50 ></TD
51 ><TD
52 WIDTH="80%"
53 ALIGN="center"
54 VALIGN="bottom"
55 ></TD
56 ><TD
57 WIDTH="10%"
58 ALIGN="right"
59 VALIGN="bottom"
60 ><A
61 HREF="r804.html"
62 ACCESSKEY="N"
63 >Next</A
64 ></TD
65 ></TR
66 ></TABLE
67 ><HR
68 ALIGN="LEFT"
69 WIDTH="100%"></DIV
70 ><H1
71 ><A
72 NAME="AEN700"
73 ></A
74 >META</H1
75 ><DIV
76 CLASS="REFNAMEDIV"
77 ><A
78 NAME="META"
79 ></A
80 ><H2
81 >Name</H2
82 >META&nbsp;--&nbsp;[File that specifies metainformation of OCaml packages]</DIV
83 ><DIV
84 CLASS="REFSYNOPSISDIV"
85 ><A
86 NAME="AEN708"
87 ></A
88 ><H2
89 >GRAMMAR</H2
90 ><PRE
91 CLASS="SYNOPSIS"
92 > metafile ::= entry*
93 entry ::= assignment | addition | subpackage
94 subpackage ::= "package" pkgname '(' metafile ')'
95 assignment ::= variable_name [ formal_predicates ] '=' value
96 addition ::= variable_name [ formal_predicates ] '+=' value
97 formal_predicates ::= '(' formal_predicate { ',' formal_predicate } ')'
98 variable_name ::= name
99 formal_predicate ::= name | '-' name
100 name ::= [ 'A'-'Z' 'a'-'z' '0'-'9' '_' '.' ]+
101 pkgname ::= '"' (character but not '.')* '"'
102 value ::= '"' character* '"'</PRE
103 ></DIV
104 ><DIV
105 CLASS="REFSECT1"
106 ><A
107 NAME="AEN711"
108 ></A
109 ><H2
110 >DESCRIPTION</H2
111 ><P
112 >If a package directory contains a file with the fixed name "META" it
113 is interpreted as described here. The file is a sequence of entries
114 following the given grammar; every entry defines a variable under a
115 certain condition given by the list of formal predicates, or it
116 introduces a subpackage.</P
117 ><P
118 >There is a list of predefined variables and a list of standard
119 predicates. These variables define: required packages, description, version
120 information, directories, archive files, and linker options. The
121 predicates denote circumstances of the application of the variables:
122 whether the bytecode or the native compiler is used, if there is a
123 toploop compiled in, details of multi-threading execution, details of
124 profiling. </P
125 ></DIV
126 ><DIV
127 CLASS="REFSECT1"
128 ><A
129 NAME="AEN715"
130 ></A
131 ><H2
132 >DETAILS OF THE FILE FORMAT</H2
133 ><P
134 >The file consists of a sequence of entries which must be formed as the
135 grammar prescribes. The lexical tokens are names, values, and
136 interpunctuation like '(', ',' and so on. Note that linefeeds do not
137 play a special role, i.e. an entry definition may be given in more than
138 one line, or several definitions may occur on a single line. There may
139 be comments which begin with '#' and run until the end of the line.</P
140 ><P
141 >Names are sequences of the characters A-Z, a-z, 0-9, or _. Names
142 containing capital letters and names beginning with digits are
143 allowed but not recommended.</P
144 ><P
145 >Values are enclosed between double quotes. Values may contain any
146 character. The characters " and \ must be preceded by backslashes. </P
147 ><P
148 >Package names must not contain the '.' character because it is used
149 as delimiter of compound names.</P
150 ></DIV
151 ><DIV
152 CLASS="REFSECT1"
153 ><A
154 NAME="AEN721"
155 ></A
156 ><H2
157 >MAIN PACKAGES AND SUBPACKAGES</H2
158 ><P
159 >The outermost variable assignments and additions belong to the main
160 package. The name of the main package is not defined within META;
161 it is either the name of the directory containing META or the suffix
162 of the META file (if the name of the META file is formed like
163 META.name).</P
164 ><P
165 >The keyword <TT
166 CLASS="LITERAL"
167 >package</TT
168 > starts the definition
169 of a subpackage. There must not be two such definitions with the
170 same name. Within the parantheses, the variable assignments and
171 additions refer to the subpackage. It is allowed that a subpackage
172 contains further subpackages.</P
173 ><P
174 >The package name following <TT
175 CLASS="LITERAL"
176 >package</TT
177 >
178 is the local name relative to the main package, i.e. the
179 name of the main package is not mentioned. At all other places,
180 however, the subpackage must be prefixed by the name of the
181 containing package, separated by a '.'.</P
182 ><P
183 >Subpackages are independent of the containing package, except
184 that the subpackage points to the same installation directory as
185 the containing package (i.e. the location of the installation directory
186 is inherited from the containing package).</P
187 ></DIV
188 ><DIV
189 CLASS="REFSECT1"
190 ><A
191 NAME="AEN729"
192 ></A
193 ><H2
194 >SEMANTICS OF VARIABLE DEFINITIONS</H2
195 ><P
196 >In order to determine the value of a variable, first all assignments
197 are inspected, and the most specific assignment is taken (if there is
198 none, the empty string will be taken as value). In a second step,
199 all additions are gone through one after the other in the order
200 they occur in the file, and the values of all matching additions are
201 appended to the current value. In the following, it is further
202 clarified which assignment is the most specific, which additions
203 actually match, and how the details of the value addition look like.</P
204 ><P
205 > The most specific assignment is selected upon a set of actual
206 predicates, i.e. the set of predicates that are assumed to be true.
207 The predicates occuring in the definitions of assignments and
208 additions are called formal predicates. They may be positive or
209 negative; the latter are prepended by a '-' sign. In order to
210 determine the value after the evaluation of the assignments, the
211 following rules apply: </P
212 ><P
213 ></P
214 ><UL
215 COMPACT="COMPACT"
216 ><LI
217 STYLE="list-style-type: disc"
218 ><P
219 > An assignment can only be used if all positive formal
220 predicates are included in the set of actual predicates, and if all
221 negative formal predicates are not included in the set of actual
222 predicates. Such an assignment is called
223 <SPAN
224 CLASS="emphasis"
225 ><I
226 CLASS="EMPHASIS"
227 >applicable</I
228 ></SPAN
229 >. If there is no such assignment, the
230 variable will have no value. </P
231 ></LI
232 ><LI
233 STYLE="list-style-type: disc"
234 ><P
235 >If there is more than one applicable assignment, the definition with
236 the biggest number of formal predicates is selected.</P
237 ></LI
238 ><LI
239 STYLE="list-style-type: disc"
240 ><P
241 >If there is still more than one applicable assignment, both applicable
242 and with a maximum number of formal predicates, the definition that is defined
243 first is selected.</P
244 ></LI
245 ></UL
246 ><P
247 >An addition is matching when all positive formal predicates are
248 included in the set of actual predicates, and all negative formal
249 predicates are not included.</P
250 ><P
251 >The value of an addition is appended to the current value with
252 implicit white space as separator.</P
253 ></DIV
254 ><DIV
255 CLASS="REFSECT1"
256 ><A
257 NAME="AEN743"
258 ></A
259 ><H2
260 >VARIABLES</H2
261 ><P
262 >There is a set of variables with predefined meaning:</P
263 ><P
264 ></P
265 ><UL
266 COMPACT="COMPACT"
267 ><LI
268 STYLE="list-style-type: disc"
269 ><P
270 > The
271 variable "directory" redefines the location of the package
272 directory. Normally, the META file is the first file read in the
273 package directory, and before any other file is read, the "directory"
274 variable is evaluated in order to see if the package directory must be
275 changed. The value of the "directory" variable is determined with an
276 empty set of actual predicates. The value must be either: an absolute
277 path name of the alternate directory, or a path name relative to the
278 stdlib directory of OCaml (written "+path"), or a normal relative path
279 name (without special syntax). In the latter case, the interpretation
280 depends on whether it is contained in a main or sub package, and
281 whether the standard repository layout or the alternate layout is in
282 effect (see <A
283 HREF="r1000.html#SITE-LIB"
284 >site-lib</A
285 > for these terms).
286 For a main package in standard layout the base directory is the
287 directory physically containing the META file, and the relative path
288 is interpreted for this base directory. For a main package in
289 alternate layout the base directory is the directory physically
290 containing the META.pkg files. The base directory for subpackages is
291 the package directory of the containing package. (In the case
292 that a subpackage definition does not have a "directory" setting,
293 the subpackage simply inherits the package directory of the containing
294 package. By writing a "directory" directive one can change this
295 location again.)</P
296 ></LI
297 ><LI
298 STYLE="list-style-type: disc"
299 ><P
300 >
301 The variable "requires" specifies the list of required packages. The
302 names of the packages must be separated by white space and/or commas.
303 The names must be fully qualified (i.e. when they refer to a subpackage,
304 the names of all containing packages must be prepended, separated by
305 '.').</P
306 ></LI
307 ><LI
308 STYLE="list-style-type: disc"
309 ><P
310 >
311 The variable "description" may include a short description of the
312 package (displayed by <TT
313 CLASS="LITERAL"
314 >ocamlfind list</TT
315 >).</P
316 ></LI
317 ><LI
318 STYLE="list-style-type: disc"
319 ><P
320 >
321 The variable "version" specifies the version string.</P
322 ></LI
323 ><LI
324 STYLE="list-style-type: disc"
325 ><P
326 >
327 The variable "archive" specifies the list of archive files. These
328 files should be given either as (1) plain names without any directory
329 information; they are only searched in the package directory.
330 (2) Or they have the form "+path" in which case the files are looked up
331 relative to the standard library. (3) Or they have the form "@name/file"
332 in which case the files are looked up in the package directory
333 of another package. (4) Or they are given as absolute paths.</P
334 ><P
335 >The
336 names of the files must be separated by white space and/or commas.
337 In the preprocessor stage, the archive files are passed as extensions
338 to the preprocessor (camlp4) call. In the linker stage (-linkpkg), the archive
339 files are linked. In the compiler stage, the archive files are ignored.</P
340 ><P
341 >Note that "archive" should only be used for archive files that are
342 intended to be included in executables or loaded into toploops. For
343 modules loaded at runtime there is the separate variable "plugin".</P
344 ></LI
345 ><LI
346 STYLE="list-style-type: disc"
347 ><P
348 >
349 The variable "plugin" specifies the plugin archives of the package.
350 These can be dynamically loaded with the <TT
351 CLASS="LITERAL"
352 >Fl_dynload</TT
353 >
354 module. The plugin archives can have ".cmo", ".cma", or ".cmxs" suffix.</P
355 ></LI
356 ><LI
357 STYLE="list-style-type: disc"
358 ><P
359 >
360 The variable "linkopts" specifies additional linker options.</P
361 ></LI
362 ><LI
363 STYLE="list-style-type: disc"
364 ><P
365 >The variable "error" can be used to signal error conditions. When
366 this variable is applicable, the ocaml compilers are stopped, and
367 an error message is printed. The message is the value of the variable.</P
368 ></LI
369 ><LI
370 STYLE="list-style-type: disc"
371 ><P
372 >
373 The variable "exists_if" can be used to disable subpackages. The
374 value of "exists_if" is a file; the subpackage is hidden if this
375 file does not exist. You can also enumerate several files, and the
376 subpackage is hidden if none of the files exist.</P
377 ></LI
378 ><LI
379 STYLE="list-style-type: disc"
380 ><P
381 >The variable "ppx" is a command that is added to the compiler invocation
382 via the -ppx option (available since OCaml-4.01). If the command is
383 relative to the current directory (e.g. ./cmd), the command is expected
384 in the package directory. The special forms as defined for "archive"
385 are also available (e.g. @otherpkg/cmd). Additional arguments can be
386 specified on the ocamlfind command line with the -ppxopt option
387 or the "ppxopt" variable.</P
388 ></LI
389 ><LI
390 STYLE="list-style-type: disc"
391 ><P
392 >The variable "ppxopt" is a set of options that are added to the ppx
393 rewriter invocation. The contents of the variable consists of one or
394 several whitespace-separated parts. Every part consists of several
395 comma-separated subparts; the first subpart indicates the package
396 that contains the ppx rewriter invocation, the rest contain the options
397 to be appended. If the option is a path relative to the current directory
398 (e.g. ./foo.cma), the path is expanded relative to the package directory.
399 The special forms as defined for "archive" are also available
400 (e.g. @otherpkg/foo.cma).</P
401 ></LI
402 ></UL
403 ><P
404 >It is possible to define additional variables but there is currently
405 no software interpreting them.</P
406 ></DIV
407 ><DIV
408 CLASS="REFSECT1"
409 ><A
410 NAME="AEN775"
411 ></A
412 ><H2
413 >PREDICATES</H2
414 ><P
415 >There is a list of standard predicates:</P
416 ><P
417 ></P
418 ><UL
419 COMPACT="COMPACT"
420 ><LI
421 STYLE="list-style-type: disc"
422 ><P
423 >The "byte" predicate means that the bytecode compiler is used.</P
424 ></LI
425 ><LI
426 STYLE="list-style-type: disc"
427 ><P
428 >The "native" predicate means that the native compiler is used.</P
429 ></LI
430 ><LI
431 STYLE="list-style-type: disc"
432 ><P
433 >The "toploop" predicate means that the toploop is available in the
434 linked program. It is only set when the toploop is running, not when
435 the toploop is generated.</P
436 ></LI
437 ><LI
438 STYLE="list-style-type: disc"
439 ><P
440 >The "create_toploop" predicate means that a toploop is created (using
441 ocamlmktop).</P
442 ></LI
443 ><LI
444 STYLE="list-style-type: disc"
445 ><P
446 >The "mt" predicate means that the program is multi-threaded.</P
447 ></LI
448 ><LI
449 STYLE="list-style-type: disc"
450 ><P
451 >The "mt_posix" predicate means that in the case "mt" is set, too, the
452 POSIX libraries are used to implement threads.</P
453 ></LI
454 ><LI
455 STYLE="list-style-type: disc"
456 ><P
457 >The "mt_vm" predicate means that in the case "mt" is set, too, the
458 VM-based libraries are used to implement threads.</P
459 ></LI
460 ><LI
461 STYLE="list-style-type: disc"
462 ><P
463 >The "gprof" predicate means that in the case "native" is set, too, the
464 program is compiled for profiling</P
465 ></LI
466 ><LI
467 STYLE="list-style-type: disc"
468 ><P
469 >The "autolink" predicate means that ocamlc can/will perform automatic linking.</P
470 ></LI
471 ><LI
472 STYLE="list-style-type: disc"
473 ><P
474 >The "preprocessor" predicate means that the META variables are scanned for
475 preprocessor options.</P
476 ></LI
477 ><LI
478 STYLE="list-style-type: disc"
479 ><P
480 >The "syntax" predicate means that the -syntax option is present on the
481 command line.</P
482 ></LI
483 ><LI
484 STYLE="list-style-type: disc"
485 ><P
486 >Legacy: The "plugin" predicate could be used in some versions of findlib
487 to select cmxs archives instead of cmxa archives. This use is still possible
488 but discouraged.</P
489 ></LI
490 ></UL
491 ><P
492 >In addition to these predicates, there are package predicates
493 for every package that is finally selected. Of course, this kind of
494 predicate must not be used to select "directory" and "requires"
495 variables, but for the other variables they are perfectly valid.
496 The package predicates have the form "pkg_" plus the name of the
497 package (fully qualified).</P
498 ></DIV
499 ><DIV
500 CLASS="NAVFOOTER"
501 ><HR
502 ALIGN="LEFT"
503 WIDTH="100%"><TABLE
504 SUMMARY="Footer navigation table"
505 WIDTH="100%"
506 BORDER="0"
507 CELLPADDING="0"
508 CELLSPACING="0"
509 ><TR
510 ><TD
511 WIDTH="33%"
512 ALIGN="left"
513 VALIGN="top"
514 ><A
515 HREF="p698.html"
516 ACCESSKEY="P"
517 >Prev</A
518 ></TD
519 ><TD
520 WIDTH="34%"
521 ALIGN="center"
522 VALIGN="top"
523 ><A
524 HREF="index.html"
525 ACCESSKEY="H"
526 >Home</A
527 ></TD
528 ><TD
529 WIDTH="33%"
530 ALIGN="right"
531 VALIGN="top"
532 ><A
533 HREF="r804.html"
534 ACCESSKEY="N"
535 >Next</A
536 ></TD
537 ></TR
538 ><TR
539 ><TD
540 WIDTH="33%"
541 ALIGN="left"
542 VALIGN="top"
543 >Files</TD
544 ><TD
545 WIDTH="34%"
546 ALIGN="center"
547 VALIGN="top"
548 ><A
549 HREF="p698.html"
550 ACCESSKEY="U"
551 >Up</A
552 ></TD
553 ><TD
554 WIDTH="33%"
555 ALIGN="right"
556 VALIGN="top"
557 >findlib.conf</TD
558 ></TR
559 ></TABLE
560 ></DIV
561 ></BODY
562 ></HTML
563 >
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >META</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib Reference Manual"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="Files"
13 HREF="p719.html"><LINK
14 REL="PREVIOUS"
15 TITLE="Files"
16 HREF="p719.html"><LINK
17 REL="NEXT"
18 TITLE="findlib.conf"
19 HREF="r825.html"></HEAD
20 ><BODY
21 CLASS="REFENTRY"
22 BGCOLOR="#FFFFFF"
23 TEXT="#000000"
24 LINK="#0000FF"
25 VLINK="#840084"
26 ALINK="#0000FF"
27 ><DIV
28 CLASS="NAVHEADER"
29 ><TABLE
30 SUMMARY="Header navigation table"
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >The findlib Reference Manual</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="p719.html"
48 ACCESSKEY="P"
49 >Prev</A
50 ></TD
51 ><TD
52 WIDTH="80%"
53 ALIGN="center"
54 VALIGN="bottom"
55 ></TD
56 ><TD
57 WIDTH="10%"
58 ALIGN="right"
59 VALIGN="bottom"
60 ><A
61 HREF="r825.html"
62 ACCESSKEY="N"
63 >Next</A
64 ></TD
65 ></TR
66 ></TABLE
67 ><HR
68 ALIGN="LEFT"
69 WIDTH="100%"></DIV
70 ><H1
71 ><A
72 NAME="AEN721"
73 ></A
74 >META</H1
75 ><DIV
76 CLASS="REFNAMEDIV"
77 ><A
78 NAME="META"
79 ></A
80 ><H2
81 >Name</H2
82 >META&nbsp;--&nbsp;[File that specifies metainformation of OCaml packages]</DIV
83 ><DIV
84 CLASS="REFSYNOPSISDIV"
85 ><A
86 NAME="AEN729"
87 ></A
88 ><H2
89 >GRAMMAR</H2
90 ><PRE
91 CLASS="SYNOPSIS"
92 > metafile ::= entry*
93 entry ::= assignment | addition | subpackage
94 subpackage ::= "package" pkgname '(' metafile ')'
95 assignment ::= variable_name [ formal_predicates ] '=' value
96 addition ::= variable_name [ formal_predicates ] '+=' value
97 formal_predicates ::= '(' formal_predicate { ',' formal_predicate } ')'
98 variable_name ::= name
99 formal_predicate ::= name | '-' name
100 name ::= [ 'A'-'Z' 'a'-'z' '0'-'9' '_' '.' ]+
101 pkgname ::= '"' (character but not '.')* '"'
102 value ::= '"' character* '"'</PRE
103 ></DIV
104 ><DIV
105 CLASS="REFSECT1"
106 ><A
107 NAME="AEN732"
108 ></A
109 ><H2
110 >DESCRIPTION</H2
111 ><P
112 >If a package directory contains a file with the fixed name "META" it
113 is interpreted as described here. The file is a sequence of entries
114 following the given grammar; every entry defines a variable under a
115 certain condition given by the list of formal predicates, or it
116 introduces a subpackage.</P
117 ><P
118 >There is a list of predefined variables and a list of standard
119 predicates. These variables define: required packages, description, version
120 information, directories, archive files, and linker options. The
121 predicates denote circumstances of the application of the variables:
122 whether the bytecode or the native compiler is used, if there is a
123 toploop compiled in, details of multi-threading execution, details of
124 profiling. </P
125 ></DIV
126 ><DIV
127 CLASS="REFSECT1"
128 ><A
129 NAME="AEN736"
130 ></A
131 ><H2
132 >DETAILS OF THE FILE FORMAT</H2
133 ><P
134 >The file consists of a sequence of entries which must be formed as the
135 grammar prescribes. The lexical tokens are names, values, and
136 interpunctuation like '(', ',' and so on. Note that linefeeds do not
137 play a special role, i.e. an entry definition may be given in more than
138 one line, or several definitions may occur on a single line. There may
139 be comments which begin with '#' and run until the end of the line.</P
140 ><P
141 >Names are sequences of the characters A-Z, a-z, 0-9, or _. Names
142 containing capital letters and names beginning with digits are
143 allowed but not recommended.</P
144 ><P
145 >Values are enclosed between double quotes. Values may contain any
146 character. The characters " and \ must be preceded by backslashes. </P
147 ><P
148 >Package names must not contain the '.' character because it is used
149 as delimiter of compound names.</P
150 ></DIV
151 ><DIV
152 CLASS="REFSECT1"
153 ><A
154 NAME="AEN742"
155 ></A
156 ><H2
157 >MAIN PACKAGES AND SUBPACKAGES</H2
158 ><P
159 >The outermost variable assignments and additions belong to the main
160 package. The name of the main package is not defined within META;
161 it is either the name of the directory containing META or the suffix
162 of the META file (if the name of the META file is formed like
163 META.name).</P
164 ><P
165 >The keyword <TT
166 CLASS="LITERAL"
167 >package</TT
168 > starts the definition
169 of a subpackage. There must not be two such definitions with the
170 same name. Within the parantheses, the variable assignments and
171 additions refer to the subpackage. It is allowed that a subpackage
172 contains further subpackages.</P
173 ><P
174 >The package name following <TT
175 CLASS="LITERAL"
176 >package</TT
177 >
178 is the local name relative to the main package, i.e. the
179 name of the main package is not mentioned. At all other places,
180 however, the subpackage must be prefixed by the name of the
181 containing package, separated by a '.'.</P
182 ><P
183 >Subpackages are independent of the containing package, except
184 that the subpackage points to the same installation directory as
185 the containing package (i.e. the location of the installation directory
186 is inherited from the containing package).</P
187 ></DIV
188 ><DIV
189 CLASS="REFSECT1"
190 ><A
191 NAME="AEN750"
192 ></A
193 ><H2
194 >SEMANTICS OF VARIABLE DEFINITIONS</H2
195 ><P
196 >In order to determine the value of a variable, first all assignments
197 are inspected, and the most specific assignment is taken (if there is
198 none, the empty string will be taken as value). In a second step,
199 all additions are gone through one after the other in the order
200 they occur in the file, and the values of all matching additions are
201 appended to the current value. In the following, it is further
202 clarified which assignment is the most specific, which additions
203 actually match, and how the details of the value addition look like.</P
204 ><P
205 > The most specific assignment is selected upon a set of actual
206 predicates, i.e. the set of predicates that are assumed to be true.
207 The predicates occuring in the definitions of assignments and
208 additions are called formal predicates. They may be positive or
209 negative; the latter are prepended by a '-' sign. In order to
210 determine the value after the evaluation of the assignments, the
211 following rules apply: </P
212 ><P
213 ></P
214 ><UL
215 COMPACT="COMPACT"
216 ><LI
217 STYLE="list-style-type: disc"
218 ><P
219 > An assignment can only be used if all positive formal
220 predicates are included in the set of actual predicates, and if all
221 negative formal predicates are not included in the set of actual
222 predicates. Such an assignment is called
223 <SPAN
224 CLASS="emphasis"
225 ><I
226 CLASS="EMPHASIS"
227 >applicable</I
228 ></SPAN
229 >. If there is no such assignment, the
230 variable will have no value. </P
231 ></LI
232 ><LI
233 STYLE="list-style-type: disc"
234 ><P
235 >If there is more than one applicable assignment, the definition with
236 the biggest number of formal predicates is selected.</P
237 ></LI
238 ><LI
239 STYLE="list-style-type: disc"
240 ><P
241 >If there is still more than one applicable assignment, both applicable
242 and with a maximum number of formal predicates, the definition that is defined
243 first is selected.</P
244 ></LI
245 ></UL
246 ><P
247 >An addition is matching when all positive formal predicates are
248 included in the set of actual predicates, and all negative formal
249 predicates are not included.</P
250 ><P
251 >The value of an addition is appended to the current value with
252 implicit white space as separator.</P
253 ></DIV
254 ><DIV
255 CLASS="REFSECT1"
256 ><A
257 NAME="AEN764"
258 ></A
259 ><H2
260 >VARIABLES</H2
261 ><P
262 >There is a set of variables with predefined meaning:</P
263 ><P
264 ></P
265 ><UL
266 COMPACT="COMPACT"
267 ><LI
268 STYLE="list-style-type: disc"
269 ><P
270 > The
271 variable "directory" redefines the location of the package
272 directory. Normally, the META file is the first file read in the
273 package directory, and before any other file is read, the "directory"
274 variable is evaluated in order to see if the package directory must be
275 changed. The value of the "directory" variable is determined with an
276 empty set of actual predicates. The value must be either: an absolute
277 path name of the alternate directory, or a path name relative to the
278 stdlib directory of OCaml (written "+path"), or a normal relative path
279 name (without special syntax). In the latter case, the interpretation
280 depends on whether it is contained in a main or sub package, and
281 whether the standard repository layout or the alternate layout is in
282 effect (see <A
283 HREF="r1021.html#SITE-LIB"
284 >site-lib</A
285 > for these terms).
286 For a main package in standard layout the base directory is the
287 directory physically containing the META file, and the relative path
288 is interpreted for this base directory. For a main package in
289 alternate layout the base directory is the directory physically
290 containing the META.pkg files. The base directory for subpackages is
291 the package directory of the containing package. (In the case
292 that a subpackage definition does not have a "directory" setting,
293 the subpackage simply inherits the package directory of the containing
294 package. By writing a "directory" directive one can change this
295 location again.)</P
296 ></LI
297 ><LI
298 STYLE="list-style-type: disc"
299 ><P
300 >
301 The variable "requires" specifies the list of required packages. The
302 names of the packages must be separated by white space and/or commas.
303 The names must be fully qualified (i.e. when they refer to a subpackage,
304 the names of all containing packages must be prepended, separated by
305 '.').</P
306 ></LI
307 ><LI
308 STYLE="list-style-type: disc"
309 ><P
310 >
311 The variable "description" may include a short description of the
312 package (displayed by <TT
313 CLASS="LITERAL"
314 >ocamlfind list</TT
315 >).</P
316 ></LI
317 ><LI
318 STYLE="list-style-type: disc"
319 ><P
320 >
321 The variable "version" specifies the version string.</P
322 ></LI
323 ><LI
324 STYLE="list-style-type: disc"
325 ><P
326 >
327 The variable "archive" specifies the list of archive files. These
328 files should be given either as (1) plain names without any directory
329 information; they are only searched in the package directory.
330 (2) Or they have the form "+path" in which case the files are looked up
331 relative to the standard library. (3) Or they have the form "@name/file"
332 in which case the files are looked up in the package directory
333 of another package. (4) Or they are given as absolute paths.</P
334 ><P
335 >The
336 names of the files must be separated by white space and/or commas.
337 In the preprocessor stage, the archive files are passed as extensions
338 to the preprocessor (camlp4) call. In the linker stage (-linkpkg), the archive
339 files are linked. In the compiler stage, the archive files are ignored.</P
340 ><P
341 >Note that "archive" should only be used for archive files that are
342 intended to be included in executables or loaded into toploops. For
343 modules loaded at runtime there is the separate variable "plugin".</P
344 ></LI
345 ><LI
346 STYLE="list-style-type: disc"
347 ><P
348 >
349 The variable "plugin" specifies the plugin archives of the package.
350 These can be dynamically loaded with the <TT
351 CLASS="LITERAL"
352 >Fl_dynload</TT
353 >
354 module. The plugin archives can have ".cmo", ".cma", or ".cmxs" suffix.</P
355 ></LI
356 ><LI
357 STYLE="list-style-type: disc"
358 ><P
359 >
360 The variable "linkopts" specifies additional linker options.</P
361 ></LI
362 ><LI
363 STYLE="list-style-type: disc"
364 ><P
365 >The variable "error" can be used to signal error conditions. When
366 this variable is applicable, the ocaml compilers are stopped, and
367 an error message is printed. The message is the value of the variable.</P
368 ></LI
369 ><LI
370 STYLE="list-style-type: disc"
371 ><P
372 >
373 The variable "exists_if" can be used to disable subpackages. The
374 value of "exists_if" is a file; the subpackage is hidden if this
375 file does not exist. You can also enumerate several files, and the
376 subpackage is hidden if none of the files exist.</P
377 ></LI
378 ><LI
379 STYLE="list-style-type: disc"
380 ><P
381 >The variable "ppx" is a command that is added to the compiler invocation
382 via the -ppx option (available since OCaml-4.01). If the command is
383 relative to the current directory (e.g. ./cmd), the command is expected
384 in the package directory. The special forms as defined for "archive"
385 are also available (e.g. @otherpkg/cmd). Additional arguments can be
386 specified on the ocamlfind command line with the -ppxopt option
387 or the "ppxopt" variable.</P
388 ></LI
389 ><LI
390 STYLE="list-style-type: disc"
391 ><P
392 >The variable "ppxopt" is a set of options that are added to the ppx
393 rewriter invocation. The contents of the variable consists of one or
394 several whitespace-separated parts. Every part consists of several
395 comma-separated subparts; the first subpart indicates the package
396 that contains the ppx rewriter invocation, the rest contain the options
397 to be appended. If the option is a path relative to the current directory
398 (e.g. ./foo.cma), the path is expanded relative to the package directory.
399 The special forms as defined for "archive" are also available
400 (e.g. @otherpkg/foo.cma).</P
401 ></LI
402 ></UL
403 ><P
404 >It is possible to define additional variables but there is currently
405 no software interpreting them.</P
406 ></DIV
407 ><DIV
408 CLASS="REFSECT1"
409 ><A
410 NAME="AEN796"
411 ></A
412 ><H2
413 >PREDICATES</H2
414 ><P
415 >There is a list of standard predicates:</P
416 ><P
417 ></P
418 ><UL
419 COMPACT="COMPACT"
420 ><LI
421 STYLE="list-style-type: disc"
422 ><P
423 >The "byte" predicate means that the bytecode compiler is used.</P
424 ></LI
425 ><LI
426 STYLE="list-style-type: disc"
427 ><P
428 >The "native" predicate means that the native compiler is used.</P
429 ></LI
430 ><LI
431 STYLE="list-style-type: disc"
432 ><P
433 >The "toploop" predicate means that the toploop is available in the
434 linked program. It is only set when the toploop is running, not when
435 the toploop is generated.</P
436 ></LI
437 ><LI
438 STYLE="list-style-type: disc"
439 ><P
440 >The "create_toploop" predicate means that a toploop is created (using
441 ocamlmktop).</P
442 ></LI
443 ><LI
444 STYLE="list-style-type: disc"
445 ><P
446 >The "mt" predicate means that the program is multi-threaded.</P
447 ></LI
448 ><LI
449 STYLE="list-style-type: disc"
450 ><P
451 >The "mt_posix" predicate means that in the case "mt" is set, too, the
452 POSIX libraries are used to implement threads.</P
453 ></LI
454 ><LI
455 STYLE="list-style-type: disc"
456 ><P
457 >The "mt_vm" predicate means that in the case "mt" is set, too, the
458 VM-based libraries are used to implement threads.</P
459 ></LI
460 ><LI
461 STYLE="list-style-type: disc"
462 ><P
463 >The "gprof" predicate means that in the case "native" is set, too, the
464 program is compiled for profiling</P
465 ></LI
466 ><LI
467 STYLE="list-style-type: disc"
468 ><P
469 >The "autolink" predicate means that ocamlc can/will perform automatic linking.</P
470 ></LI
471 ><LI
472 STYLE="list-style-type: disc"
473 ><P
474 >The "preprocessor" predicate means that the META variables are scanned for
475 preprocessor options.</P
476 ></LI
477 ><LI
478 STYLE="list-style-type: disc"
479 ><P
480 >The "syntax" predicate means that the -syntax option is present on the
481 command line.</P
482 ></LI
483 ><LI
484 STYLE="list-style-type: disc"
485 ><P
486 >Legacy: The "plugin" predicate could be used in some versions of findlib
487 to select cmxs archives instead of cmxa archives. This use is still possible
488 but discouraged.</P
489 ></LI
490 ></UL
491 ><P
492 >In addition to these predicates, there are package predicates
493 for every package that is finally selected. Of course, this kind of
494 predicate must not be used to select "directory" and "requires"
495 variables, but for the other variables they are perfectly valid.
496 The package predicates have the form "pkg_" plus the name of the
497 package (fully qualified).</P
498 ></DIV
499 ><DIV
500 CLASS="NAVFOOTER"
501 ><HR
502 ALIGN="LEFT"
503 WIDTH="100%"><TABLE
504 SUMMARY="Footer navigation table"
505 WIDTH="100%"
506 BORDER="0"
507 CELLPADDING="0"
508 CELLSPACING="0"
509 ><TR
510 ><TD
511 WIDTH="33%"
512 ALIGN="left"
513 VALIGN="top"
514 ><A
515 HREF="p719.html"
516 ACCESSKEY="P"
517 >Prev</A
518 ></TD
519 ><TD
520 WIDTH="34%"
521 ALIGN="center"
522 VALIGN="top"
523 ><A
524 HREF="index.html"
525 ACCESSKEY="H"
526 >Home</A
527 ></TD
528 ><TD
529 WIDTH="33%"
530 ALIGN="right"
531 VALIGN="top"
532 ><A
533 HREF="r825.html"
534 ACCESSKEY="N"
535 >Next</A
536 ></TD
537 ></TR
538 ><TR
539 ><TD
540 WIDTH="33%"
541 ALIGN="left"
542 VALIGN="top"
543 >Files</TD
544 ><TD
545 WIDTH="34%"
546 ALIGN="center"
547 VALIGN="top"
548 ><A
549 HREF="p719.html"
550 ACCESSKEY="U"
551 >Up</A
552 ></TD
553 ><TD
554 WIDTH="33%"
555 ALIGN="right"
556 VALIGN="top"
557 >findlib.conf</TD
558 ></TR
559 ></TABLE
560 ></DIV
561 ></BODY
562 ></HTML
563 >
+0
-844
doc/ref-html/r804.html less more
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >findlib.conf</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib Reference Manual"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="Files"
13 HREF="p698.html"><LINK
14 REL="PREVIOUS"
15 TITLE="META"
16 HREF="r700.html"><LINK
17 REL="NEXT"
18 TITLE="site-lib"
19 HREF="r1000.html"></HEAD
20 ><BODY
21 CLASS="REFENTRY"
22 BGCOLOR="#FFFFFF"
23 TEXT="#000000"
24 LINK="#0000FF"
25 VLINK="#840084"
26 ALINK="#0000FF"
27 ><DIV
28 CLASS="NAVHEADER"
29 ><TABLE
30 SUMMARY="Header navigation table"
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >The findlib Reference Manual</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="r700.html"
48 ACCESSKEY="P"
49 >Prev</A
50 ></TD
51 ><TD
52 WIDTH="80%"
53 ALIGN="center"
54 VALIGN="bottom"
55 ></TD
56 ><TD
57 WIDTH="10%"
58 ALIGN="right"
59 VALIGN="bottom"
60 ><A
61 HREF="r1000.html"
62 ACCESSKEY="N"
63 >Next</A
64 ></TD
65 ></TR
66 ></TABLE
67 ><HR
68 ALIGN="LEFT"
69 WIDTH="100%"></DIV
70 ><H1
71 ><A
72 NAME="AEN804"
73 ></A
74 >findlib.conf</H1
75 ><DIV
76 CLASS="REFNAMEDIV"
77 ><A
78 NAME="FINDLIB.CONF"
79 ></A
80 ><H2
81 >Name</H2
82 >findlib.conf&nbsp;--&nbsp;[Configuration of findlib/ocamlfind]</DIV
83 ><DIV
84 CLASS="REFSECT1"
85 ><A
86 NAME="AEN812"
87 ></A
88 ><H2
89 >GENERAL</H2
90 ><P
91 >There are three possibilities to configure the findlib library:
92
93 <P
94 ></P
95 ><DIV
96 CLASS="VARIABLELIST"
97 ><DL
98 ><DT
99 >Build time:</DT
100 ><DD
101 ><P
102 > Before findlib is compiled, a "configure" script is invoked to figure
103 out the settings that are most likely to work on the system. Most
104 settings are simply entered into text files and can easily be changed
105 after installation. The following properties cannot be changed later
106 because they are compiled into the resulting binaries:
107
108 <P
109 ></P
110 ><UL
111 ><LI
112 ><P
113 > The default location of the configuration file findlib.conf. However,
114 you can set a different location by the environment variable
115 <TT
116 CLASS="LITERAL"
117 >OCAMLFIND_CONF</TT
118 >.
119 </P
120 ></LI
121 ><LI
122 ><P
123 > Whether the installed O'Caml version supports autolinking or not.
124 </P
125 ></LI
126 ></UL
127 >
128 </P
129 ></DD
130 ><DT
131 >Configuration file findlib.conf:</DT
132 ><DD
133 ><P
134 > An initial version of this file is generated by the configure script,
135 but you are free to modify it later. Most important, this file
136 contains the system-wide search path used to look up packages, and the
137 default location where to install new packages.
138 </P
139 ><P
140 > All files with the suffix ".conf" found in the directory
141 findlib.conf.d are also scanned for parameters.
142 </P
143 ></DD
144 ><DT
145 >Environment variables:</DT
146 ><DD
147 ><P
148 > The settings of findlib.conf can be overridden by environment variables.
149 </P
150 ></DD
151 ></DL
152 ></DIV
153 >
154
155 Last but not least, several settings can also be passed as
156 command-line options, or by invoking the function
157 <TT
158 CLASS="LITERAL"
159 >Findlib.init</TT
160 >. </P
161 ></DIV
162 ><DIV
163 CLASS="REFSECT1"
164 ><A
165 NAME="AEN836"
166 ></A
167 ><H2
168 >findlib.conf</H2
169 ><P
170 >The directory containing findlib.conf is determined at build time (by
171 running the configure script), the fallback default is
172 <TT
173 CLASS="LITERAL"
174 >/usr/local/etc</TT
175 >. You can set a different location by
176 changing the environment variable <TT
177 CLASS="LITERAL"
178 >OCAMLFIND_CONF</TT
179 >
180 which must contain the absolute path of findlib.conf.</P
181 ><P
182 >The file has the same syntax as <A
183 HREF="r700.html#META"
184 ><TT
185 CLASS="LITERAL"
186 >META</TT
187 ></A
188 >, i.e. it consists of a
189 number of lines with the format
190
191 <PRE
192 CLASS="PROGRAMLISTING"
193 ><TT
194 CLASS="REPLACEABLE"
195 ><I
196 >variable</I
197 ></TT
198 > = "<TT
199 CLASS="REPLACEABLE"
200 ><I
201 >value</I
202 ></TT
203 >"</PRE
204 ></P
205 ><P
206 >Here is the list of allowed variables:
207
208 <P
209 ></P
210 ><DIV
211 CLASS="VARIABLELIST"
212 ><DL
213 ><DT
214 ><TT
215 CLASS="LITERAL"
216 >path</TT
217 ></DT
218 ><DD
219 ><P
220 > The search path for META files/package directories. The variable
221 enumerates directories which are separated by colons (Windows:
222 semicolons), and these directories are tried in turn to find a certain
223 package. More exactly, if d is such a directory and p the searched
224 package, the search algorithm will first check whether d/p/META
225 exists. In this case, this META file is taken, and d/p is the package
226 directory. Second, the algorithm tries d/META.p, but the package
227 directory must be specified in this META.p file by a
228 <TT
229 CLASS="LITERAL"
230 >directory</TT
231 > directive.
232 </P
233 ><P
234 > Note that the first found META file is taken, so the order of the
235 directories in the search path counts.
236 </P
237 ><P
238 > This variable is required.
239 </P
240 ><P
241 > Example:
242
243 <PRE
244 CLASS="PROGRAMLISTING"
245 >path = "/usr/local/lib/ocaml/site-lib:/usr/lib/ocaml/site-lib"</PRE
246 >
247 </P
248 ></DD
249 ></DL
250 ></DIV
251 >
252
253
254 <P
255 ></P
256 ><DIV
257 CLASS="VARIABLELIST"
258 ><DL
259 ><DT
260 ><TT
261 CLASS="LITERAL"
262 >destdir</TT
263 ></DT
264 ><DD
265 ><P
266 > This variable determines the location where <TT
267 CLASS="LITERAL"
268 >ocamlfind
269 install</TT
270 > puts the packages by default: If d is this
271 directory, and p the package to install, a new subdirectory d/p will
272 be created containing all the files of the package.
273 </P
274 ><P
275 >Example:
276 <PRE
277 CLASS="PROGRAMLISTING"
278 >destdir = "/usr/local/lib/ocaml/site-lib"</PRE
279 >
280 </P
281 ><P
282 > This variable is required.
283 </P
284 ></DD
285 ></DL
286 ></DIV
287 >
288
289
290 <P
291 ></P
292 ><DIV
293 CLASS="VARIABLELIST"
294 ><DL
295 ><DT
296 ><TT
297 CLASS="LITERAL"
298 >metadir</TT
299 ></DT
300 ><DD
301 ><P
302 > If set, the command <TT
303 CLASS="LITERAL"
304 >ocamlfind install</TT
305 > will put the
306 META files of packages into this directory (files are named META.p
307 where p=package name); otherwise the META files are put into the
308 package directories like any other file.
309 </P
310 ><P
311 >Example:
312 <PRE
313 CLASS="PROGRAMLISTING"
314 >metadir = "/var/lib/findlib/metaregistry"</PRE
315 >
316 </P
317 ><P
318 > This variable is optional. It is not used by default.
319 </P
320 ></DD
321 ></DL
322 ></DIV
323 >
324
325
326 <P
327 ></P
328 ><DIV
329 CLASS="VARIABLELIST"
330 ><DL
331 ><DT
332 ><TT
333 CLASS="LITERAL"
334 >ocamlc</TT
335 >,
336 <TT
337 CLASS="LITERAL"
338 >ocamlopt</TT
339 >,
340 <TT
341 CLASS="LITERAL"
342 >ocamlcp</TT
343 >,
344 <TT
345 CLASS="LITERAL"
346 >ocamlmktop</TT
347 >,
348 <TT
349 CLASS="LITERAL"
350 >ocamldoc</TT
351 >,
352 <TT
353 CLASS="LITERAL"
354 >ocamldep</TT
355 >,
356 <TT
357 CLASS="LITERAL"
358 >ocamlbrowser</TT
359 ></DT
360 ><DD
361 ><P
362 > If you want to call other executables than "ocamlc", "ocamlopt",
363 "ocamlcp", "ocamlmktop", "ocamldoc", "ocamldep", and
364 "ocamlbrowser", you can
365 set the names of
366 the executables here. The command <TT
367 CLASS="LITERAL"
368 >ocamlfind</TT
369 > looks
370 into these four variables to determine the names of the compilers to
371 call.
372 </P
373 ><P
374 >Example:
375 <PRE
376 CLASS="PROGRAMLISTING"
377 >ocamlc = "ocamlc.opt"
378 ocamlopt = "ocamlopt.opt"
379 ocamlcp = "ocamlcp.opt"
380 ocamlmktop = "ocamlmktop.opt"</PRE
381 >
382 </P
383 ><P
384 > This variable is optional. It is not used by default.
385 </P
386 ></DD
387 ></DL
388 ></DIV
389 >
390
391 <P
392 ></P
393 ><DIV
394 CLASS="VARIABLELIST"
395 ><DL
396 ><DT
397 ><TT
398 CLASS="LITERAL"
399 >stdlib</TT
400 ></DT
401 ><DD
402 ><P
403 > This variable determines the location of the standard library. This must
404 be the same directory for which the O'Caml compilers are configured.
405 </P
406 ><P
407 > This variable is optional. It is not recommend to set this variable
408 unless you know what you are doing!
409 </P
410 ></DD
411 ></DL
412 ></DIV
413 >
414
415 <P
416 ></P
417 ><DIV
418 CLASS="VARIABLELIST"
419 ><DL
420 ><DT
421 ><TT
422 CLASS="LITERAL"
423 >ldconf</TT
424 ></DT
425 ><DD
426 ><P
427 > This variable determines the location of the ld.conf file. This must
428 be the same file the O'Caml compilers read in; it is updated by
429 ocamlfind when installing and removing packages. You can set this
430 variable to the special value "<TT
431 CLASS="LITERAL"
432 >ignore</TT
433 >" to disable
434 the automatic modification of the ld.conf file.
435 </P
436 ><P
437 > If not set, the ld.conf file is assumed to reside in the O'Caml
438 standard library directory.
439 </P
440 ><P
441 > This variable is optional. It is not recommended to set this variable
442 unless you know what you are doing!
443 </P
444 ></DD
445 ></DL
446 ></DIV
447 ></P
448 ><P
449 >Toolchains: It is possible to have variants of the original configuration.
450 These variants are called "toolchains" because they are intended to
451 select different compilers, e.g. patched compilers. In order to
452 set a variable for a certain toolchain, use the syntax
453
454 <PRE
455 CLASS="PROGRAMLISTING"
456 ><TT
457 CLASS="REPLACEABLE"
458 ><I
459 >variable</I
460 ></TT
461 >(<TT
462 CLASS="REPLACEABLE"
463 ><I
464 >toolchain</I
465 ></TT
466 >) = "<TT
467 CLASS="REPLACEABLE"
468 ><I
469 >value</I
470 ></TT
471 >"</PRE
472 >
473
474 For example:
475
476 <PRE
477 CLASS="PROGRAMLISTING"
478 >ocamlc(mypatch) = "ocamlc-mypatch"</PRE
479 >
480
481 When the toolchain "mypatch" is selected, this compiler will be used instead
482 of the standard one.</P
483 ><P
484 >In order to switch to a certain toolchain, use the -toolchain
485 option of <A
486 HREF="r17.html#OCAMLFIND"
487 >ocamlfind</A
488 >.</P
489 ></DIV
490 ><DIV
491 CLASS="REFSECT1"
492 ><A
493 NAME="AEN919"
494 ></A
495 ><H2
496 >Environment</H2
497 ><P
498 >A number of environment variables modifies the behaviour of
499 findlib/ocamlfind:
500
501 <P
502 ></P
503 ><DIV
504 CLASS="VARIABLELIST"
505 ><DL
506 ><DT
507 ><TT
508 CLASS="LITERAL"
509 >OCAMLFIND_CONF</TT
510 ></DT
511 ><DD
512 ><P
513 > This variable overrides the location of the configuration file
514 findlib.conf. It must contain the absolute path name of this file.
515 </P
516 ></DD
517 ></DL
518 ></DIV
519 >
520
521 <P
522 ></P
523 ><DIV
524 CLASS="VARIABLELIST"
525 ><DL
526 ><DT
527 ><TT
528 CLASS="LITERAL"
529 >OCAMLFIND_TOOLCHAIN</TT
530 ></DT
531 ><DD
532 ><P
533 > This variable sets the currently selected toolchain when
534 a <TT
535 CLASS="LITERAL"
536 >-toolchain</TT
537 > option is not passed
538 on the command line.
539 </P
540 ></DD
541 ></DL
542 ></DIV
543 >
544
545 <P
546 ></P
547 ><DIV
548 CLASS="VARIABLELIST"
549 ><DL
550 ><DT
551 ><TT
552 CLASS="LITERAL"
553 >OCAMLPATH</TT
554 ></DT
555 ><DD
556 ><P
557 > This variable may contain an additional search path for package
558 directories. It is treated as if the directories were prepended to
559 the configuration variable <TT
560 CLASS="LITERAL"
561 >path</TT
562 >.
563 </P
564 ></DD
565 ></DL
566 ></DIV
567 >
568
569 <P
570 ></P
571 ><DIV
572 CLASS="VARIABLELIST"
573 ><DL
574 ><DT
575 ><TT
576 CLASS="LITERAL"
577 >OCAMLFIND_DESTDIR</TT
578 ></DT
579 ><DD
580 ><P
581 > This variable overrides the configuration variable
582 <TT
583 CLASS="LITERAL"
584 >destdir</TT
585 >.
586 </P
587 ></DD
588 ></DL
589 ></DIV
590 >
591
592 <P
593 ></P
594 ><DIV
595 CLASS="VARIABLELIST"
596 ><DL
597 ><DT
598 ><TT
599 CLASS="LITERAL"
600 >OCAMLFIND_METADIR</TT
601 ></DT
602 ><DD
603 ><P
604 > This variable overrides the configuration variable
605 <TT
606 CLASS="LITERAL"
607 >metadir</TT
608 >.
609 </P
610 ></DD
611 ></DL
612 ></DIV
613 >
614
615 <P
616 ></P
617 ><DIV
618 CLASS="VARIABLELIST"
619 ><DL
620 ><DT
621 ><TT
622 CLASS="LITERAL"
623 >OCAMLFIND_COMMANDS</TT
624 ></DT
625 ><DD
626 ><P
627 > This variable overrides the configuration variables
628 <TT
629 CLASS="LITERAL"
630 >ocamlc</TT
631 >, <TT
632 CLASS="LITERAL"
633 >ocamlopt</TT
634 >,
635 <TT
636 CLASS="LITERAL"
637 >ocamlcp</TT
638 >, <TT
639 CLASS="LITERAL"
640 >ocamlmktop</TT
641 >,
642 <TT
643 CLASS="LITERAL"
644 >ocamldoc</TT
645 >, <TT
646 CLASS="LITERAL"
647 >ocamldep</TT
648 >, and/or
649 <TT
650 CLASS="LITERAL"
651 >ocamlbrowser</TT
652 >.
653 Its value must conform to the syntax
654
655 <PRE
656 CLASS="PROGRAMLISTING"
657 >ocamlc=<TT
658 CLASS="REPLACEABLE"
659 ><I
660 >name</I
661 ></TT
662 > ocamlopt=<TT
663 CLASS="REPLACEABLE"
664 ><I
665 >name</I
666 ></TT
667 > ocamlcp=<TT
668 CLASS="REPLACEABLE"
669 ><I
670 >name</I
671 ></TT
672 > ocamlmktop=<TT
673 CLASS="REPLACEABLE"
674 ><I
675 >name</I
676 ></TT
677 > ocamldoc=<TT
678 CLASS="REPLACEABLE"
679 ><I
680 >name</I
681 ></TT
682 > ocamldep=<TT
683 CLASS="REPLACEABLE"
684 ><I
685 >name</I
686 ></TT
687 > ocamlbrowser=<TT
688 CLASS="REPLACEABLE"
689 ><I
690 >name</I
691 ></TT
692 ></PRE
693 >
694 </P
695 ><P
696 >Example:
697 <PRE
698 CLASS="PROGRAMLISTING"
699 >ocamlc=ocamlc-3.00 ocamlopt=ocamlopt-3.00 ocamlcp=ocamlcp-3.00 ocamlmktop=ocamlmktop-3.00</PRE
700 >
701 </P
702 ></DD
703 ></DL
704 ></DIV
705 >
706
707 <P
708 ></P
709 ><DIV
710 CLASS="VARIABLELIST"
711 ><DL
712 ><DT
713 ><TT
714 CLASS="LITERAL"
715 >CAMLLIB</TT
716 > or <TT
717 CLASS="LITERAL"
718 >OCAMLLIB</TT
719 ></DT
720 ><DD
721 ><P
722 > This variable overrides the configuration variable
723 <TT
724 CLASS="LITERAL"
725 >stdlib</TT
726 >.
727 </P
728 ></DD
729 ></DL
730 ></DIV
731 >
732
733 <P
734 ></P
735 ><DIV
736 CLASS="VARIABLELIST"
737 ><DL
738 ><DT
739 ><TT
740 CLASS="LITERAL"
741 >OCAMLFIND_LDCONF</TT
742 ></DT
743 ><DD
744 ><P
745 > This variable overrides the configuration variable
746 <TT
747 CLASS="LITERAL"
748 >ldconf</TT
749 >.
750 </P
751 ></DD
752 ></DL
753 ></DIV
754 >
755
756 <P
757 ></P
758 ><DIV
759 CLASS="VARIABLELIST"
760 ><DL
761 ><DT
762 ><TT
763 CLASS="LITERAL"
764 >OCAMLFIND_IGNORE_DUPS_IN</TT
765 ></DT
766 ><DD
767 ><P
768 > This variable instructs findlib not to emit warnings that packages
769 or module occur several times. The variable must be set to the
770 directory where the packages reside that are to be ignored for this
771 warning.
772 </P
773 ></DD
774 ></DL
775 ></DIV
776 >
777 &#13;</P
778 ></DIV
779 ><DIV
780 CLASS="NAVFOOTER"
781 ><HR
782 ALIGN="LEFT"
783 WIDTH="100%"><TABLE
784 SUMMARY="Footer navigation table"
785 WIDTH="100%"
786 BORDER="0"
787 CELLPADDING="0"
788 CELLSPACING="0"
789 ><TR
790 ><TD
791 WIDTH="33%"
792 ALIGN="left"
793 VALIGN="top"
794 ><A
795 HREF="r700.html"
796 ACCESSKEY="P"
797 >Prev</A
798 ></TD
799 ><TD
800 WIDTH="34%"
801 ALIGN="center"
802 VALIGN="top"
803 ><A
804 HREF="index.html"
805 ACCESSKEY="H"
806 >Home</A
807 ></TD
808 ><TD
809 WIDTH="33%"
810 ALIGN="right"
811 VALIGN="top"
812 ><A
813 HREF="r1000.html"
814 ACCESSKEY="N"
815 >Next</A
816 ></TD
817 ></TR
818 ><TR
819 ><TD
820 WIDTH="33%"
821 ALIGN="left"
822 VALIGN="top"
823 >META</TD
824 ><TD
825 WIDTH="34%"
826 ALIGN="center"
827 VALIGN="top"
828 ><A
829 HREF="p698.html"
830 ACCESSKEY="U"
831 >Up</A
832 ></TD
833 ><TD
834 WIDTH="33%"
835 ALIGN="right"
836 VALIGN="top"
837 >site-lib</TD
838 ></TR
839 ></TABLE
840 ></DIV
841 ></BODY
842 ></HTML
843 >
0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
1 <HTML
2 ><HEAD
3 ><TITLE
4 >findlib.conf</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
8 REL="HOME"
9 TITLE="The findlib Reference Manual"
10 HREF="index.html"><LINK
11 REL="UP"
12 TITLE="Files"
13 HREF="p719.html"><LINK
14 REL="PREVIOUS"
15 TITLE="META"
16 HREF="r721.html"><LINK
17 REL="NEXT"
18 TITLE="site-lib"
19 HREF="r1021.html"></HEAD
20 ><BODY
21 CLASS="REFENTRY"
22 BGCOLOR="#FFFFFF"
23 TEXT="#000000"
24 LINK="#0000FF"
25 VLINK="#840084"
26 ALINK="#0000FF"
27 ><DIV
28 CLASS="NAVHEADER"
29 ><TABLE
30 SUMMARY="Header navigation table"
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >The findlib Reference Manual</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="r721.html"
48 ACCESSKEY="P"
49 >Prev</A
50 ></TD
51 ><TD
52 WIDTH="80%"
53 ALIGN="center"
54 VALIGN="bottom"
55 ></TD
56 ><TD
57 WIDTH="10%"
58 ALIGN="right"
59 VALIGN="bottom"
60 ><A
61 HREF="r1021.html"
62 ACCESSKEY="N"
63 >Next</A
64 ></TD
65 ></TR
66 ></TABLE
67 ><HR
68 ALIGN="LEFT"
69 WIDTH="100%"></DIV
70 ><H1
71 ><A
72 NAME="AEN825"
73 ></A
74 >findlib.conf</H1
75 ><DIV
76 CLASS="REFNAMEDIV"
77 ><A
78 NAME="FINDLIB.CONF"
79 ></A
80 ><H2
81 >Name</H2
82 >findlib.conf&nbsp;--&nbsp;[Configuration of findlib/ocamlfind]</DIV
83 ><DIV
84 CLASS="REFSECT1"
85 ><A
86 NAME="AEN833"
87 ></A
88 ><H2
89 >GENERAL</H2
90 ><P
91 >There are three possibilities to configure the findlib library:
92
93 <P
94 ></P
95 ><DIV
96 CLASS="VARIABLELIST"
97 ><DL
98 ><DT
99 >Build time:</DT
100 ><DD
101 ><P
102 > Before findlib is compiled, a "configure" script is invoked to figure
103 out the settings that are most likely to work on the system. Most
104 settings are simply entered into text files and can easily be changed
105 after installation. The following properties cannot be changed later
106 because they are compiled into the resulting binaries:
107
108 <P
109 ></P
110 ><UL
111 ><LI
112 ><P
113 > The default location of the configuration file findlib.conf. However,
114 you can set a different location by the environment variable
115 <TT
116 CLASS="LITERAL"
117 >OCAMLFIND_CONF</TT
118 >.
119 </P
120 ></LI
121 ><LI
122 ><P
123 > Whether the installed O'Caml version supports autolinking or not.
124 </P
125 ></LI
126 ></UL
127 >
128 </P
129 ></DD
130 ><DT
131 >Configuration file findlib.conf:</DT
132 ><DD
133 ><P
134 > An initial version of this file is generated by the configure script,
135 but you are free to modify it later. Most important, this file
136 contains the system-wide search path used to look up packages, and the
137 default location where to install new packages.
138 </P
139 ><P
140 > All files with the suffix ".conf" found in the directory
141 findlib.conf.d are also scanned for parameters.
142 </P
143 ></DD
144 ><DT
145 >Environment variables:</DT
146 ><DD
147 ><P
148 > The settings of findlib.conf can be overridden by environment variables.
149 </P
150 ></DD
151 ></DL
152 ></DIV
153 >
154
155 Last but not least, several settings can also be passed as
156 command-line options, or by invoking the function
157 <TT
158 CLASS="LITERAL"
159 >Findlib.init</TT
160 >. </P
161 ></DIV
162 ><DIV
163 CLASS="REFSECT1"
164 ><A
165 NAME="AEN857"
166 ></A
167 ><H2
168 >findlib.conf</H2
169 ><P
170 >The directory containing findlib.conf is determined at build time (by
171 running the configure script), the fallback default is
172 <TT
173 CLASS="LITERAL"
174 >/usr/local/etc</TT
175 >. You can set a different location by
176 changing the environment variable <TT
177 CLASS="LITERAL"
178 >OCAMLFIND_CONF</TT
179 >
180 which must contain the absolute path of findlib.conf.</P
181 ><P
182 >The file has the same syntax as <A
183 HREF="r721.html#META"
184 ><TT
185 CLASS="LITERAL"
186 >META</TT
187 ></A
188 >, i.e. it consists of a
189 number of lines with the format
190
191 <PRE
192 CLASS="PROGRAMLISTING"
193 ><TT
194 CLASS="REPLACEABLE"
195 ><I
196 >variable</I
197 ></TT
198 > = "<TT
199 CLASS="REPLACEABLE"
200 ><I
201 >value</I
202 ></TT
203 >"</PRE
204 ></P
205 ><P
206 >Here is the list of allowed variables:
207
208 <P
209 ></P
210 ><DIV
211 CLASS="VARIABLELIST"
212 ><DL
213 ><DT
214 ><TT
215 CLASS="LITERAL"
216 >path</TT
217 ></DT
218 ><DD
219 ><P
220 > The search path for META files/package directories. The variable
221 enumerates directories which are separated by colons (Windows:
222 semicolons), and these directories are tried in turn to find a certain
223 package. More exactly, if d is such a directory and p the searched
224 package, the search algorithm will first check whether d/p/META
225 exists. In this case, this META file is taken, and d/p is the package
226 directory. Second, the algorithm tries d/META.p, but the package
227 directory must be specified in this META.p file by a
228 <TT
229 CLASS="LITERAL"
230 >directory</TT
231 > directive.
232 </P
233 ><P
234 > Note that the first found META file is taken, so the order of the
235 directories in the search path counts.
236 </P
237 ><P
238 > This variable is required.
239 </P
240 ><P
241 > Example:
242
243 <PRE
244 CLASS="PROGRAMLISTING"
245 >path = "/usr/local/lib/ocaml/site-lib:/usr/lib/ocaml/site-lib"</PRE
246 >
247 </P
248 ></DD
249 ></DL
250 ></DIV
251 >
252
253
254 <P
255 ></P
256 ><DIV
257 CLASS="VARIABLELIST"
258 ><DL
259 ><DT
260 ><TT
261 CLASS="LITERAL"
262 >destdir</TT
263 ></DT
264 ><DD
265 ><P
266 > This variable determines the location where <TT
267 CLASS="LITERAL"
268 >ocamlfind
269 install</TT
270 > puts the packages by default: If d is this
271 directory, and p the package to install, a new subdirectory d/p will
272 be created containing all the files of the package.
273 </P
274 ><P
275 >Example:
276 <PRE
277 CLASS="PROGRAMLISTING"
278 >destdir = "/usr/local/lib/ocaml/site-lib"</PRE
279 >
280 </P
281 ><P
282 > This variable is required.
283 </P
284 ></DD
285 ></DL
286 ></DIV
287 >
288
289
290 <P
291 ></P
292 ><DIV
293 CLASS="VARIABLELIST"
294 ><DL
295 ><DT
296 ><TT
297 CLASS="LITERAL"
298 >metadir</TT
299 ></DT
300 ><DD
301 ><P
302 > If set, the command <TT
303 CLASS="LITERAL"
304 >ocamlfind install</TT
305 > will put the
306 META files of packages into this directory (files are named META.p
307 where p=package name); otherwise the META files are put into the
308 package directories like any other file.
309 </P
310 ><P
311 >Example:
312 <PRE
313 CLASS="PROGRAMLISTING"
314 >metadir = "/var/lib/findlib/metaregistry"</PRE
315 >
316 </P
317 ><P
318 > This variable is optional. It is not used by default.
319 </P
320 ></DD
321 ></DL
322 ></DIV
323 >
324
325
326 <P
327 ></P
328 ><DIV
329 CLASS="VARIABLELIST"
330 ><DL
331 ><DT
332 ><TT
333 CLASS="LITERAL"
334 >ocamlc</TT
335 >,
336 <TT
337 CLASS="LITERAL"
338 >ocamlopt</TT
339 >,
340 <TT
341 CLASS="LITERAL"
342 >ocamlcp</TT
343 >,
344 <TT
345 CLASS="LITERAL"
346 >ocamlmktop</TT
347 >,
348 <TT
349 CLASS="LITERAL"
350 >ocamldoc</TT
351 >,
352 <TT
353 CLASS="LITERAL"
354 >ocamldep</TT
355 >,
356 <TT
357 CLASS="LITERAL"
358 >ocamlbrowser</TT
359 ></DT
360 ><DD
361 ><P
362 > If you want to call other executables than "ocamlc", "ocamlopt",
363 "ocamlcp", "ocamlmktop", "ocamldoc", "ocamldep", and
364 "ocamlbrowser", you can
365 set the names of
366 the executables here. The command <TT
367 CLASS="LITERAL"
368 >ocamlfind</TT
369 > looks
370 into these four variables to determine the names of the compilers to
371 call.
372 </P
373 ><P
374 >Example:
375 <PRE
376 CLASS="PROGRAMLISTING"
377 >ocamlc = "ocamlc.opt"
378 ocamlopt = "ocamlopt.opt"
379 ocamlcp = "ocamlcp.opt"
380 ocamlmktop = "ocamlmktop.opt"</PRE
381 >
382 </P
383 ><P
384 > This variable is optional. It is not used by default.
385 </P
386 ></DD
387 ></DL
388 ></DIV
389 >
390
391 <P
392 ></P
393 ><DIV
394 CLASS="VARIABLELIST"
395 ><DL
396 ><DT
397 ><TT
398 CLASS="LITERAL"
399 >stdlib</TT
400 ></DT
401 ><DD
402 ><P
403 > This variable determines the location of the standard library. This must
404 be the same directory for which the O'Caml compilers are configured.
405 </P
406 ><P
407 > This variable is optional. It is not recommend to set this variable
408 unless you know what you are doing!
409 </P
410 ></DD
411 ></DL
412 ></DIV
413 >
414
415 <P
416 ></P
417 ><DIV
418 CLASS="VARIABLELIST"
419 ><DL
420 ><DT
421 ><TT
422 CLASS="LITERAL"
423 >ldconf</TT
424 ></DT
425 ><DD
426 ><P
427 > This variable determines the location of the ld.conf file. This must
428 be the same file the O'Caml compilers read in; it is updated by
429 ocamlfind when installing and removing packages. You can set this
430 variable to the special value "<TT
431 CLASS="LITERAL"
432 >ignore</TT
433 >" to disable
434 the automatic modification of the ld.conf file.
435 </P
436 ><P
437 > If not set, the ld.conf file is assumed to reside in the O'Caml
438 standard library directory.
439 </P
440 ><P
441 > This variable is optional. It is not recommended to set this variable
442 unless you know what you are doing!
443 </P
444 ></DD
445 ></DL
446 ></DIV
447 ></P
448 ><P
449 >Toolchains: It is possible to have variants of the original configuration.
450 These variants are called "toolchains" because they are intended to
451 select different compilers, e.g. patched compilers. In order to
452 set a variable for a certain toolchain, use the syntax
453
454 <PRE
455 CLASS="PROGRAMLISTING"
456 ><TT
457 CLASS="REPLACEABLE"
458 ><I
459 >variable</I
460 ></TT
461 >(<TT
462 CLASS="REPLACEABLE"
463 ><I
464 >toolchain</I
465 ></TT
466 >) = "<TT
467 CLASS="REPLACEABLE"
468 ><I
469 >value</I
470 ></TT
471 >"</PRE
472 >
473
474 For example:
475
476 <PRE
477 CLASS="PROGRAMLISTING"
478 >ocamlc(mypatch) = "ocamlc-mypatch"</PRE
479 >
480
481 When the toolchain "mypatch" is selected, this compiler will be used instead
482 of the standard one.</P
483 ><P
484 >In order to switch to a certain toolchain, use the -toolchain
485 option of <A
486 HREF="r17.html#OCAMLFIND"
487 >ocamlfind</A
488 >.</P
489 ></DIV
490 ><DIV
491 CLASS="REFSECT1"
492 ><A
493 NAME="AEN940"
494 ></A
495 ><H2
496 >Environment</H2
497 ><P
498 >A number of environment variables modifies the behaviour of
499 findlib/ocamlfind:
500
501 <P
502 ></P
503 ><DIV
504 CLASS="VARIABLELIST"
505 ><DL
506 ><DT
507 ><TT
508 CLASS="LITERAL"
509 >OCAMLFIND_CONF</TT
510 ></DT
511 ><DD
512 ><P
513 > This variable overrides the location of the configuration file
514 findlib.conf. It must contain the absolute path name of this file.
515 </P
516 ></DD
517 ></DL
518 ></DIV
519 >
520
521 <P
522 ></P
523 ><DIV
524 CLASS="VARIABLELIST"
525 ><DL
526 ><DT
527 ><TT
528 CLASS="LITERAL"
529 >OCAMLFIND_TOOLCHAIN</TT
530 ></DT
531 ><DD
532 ><P
533 > This variable sets the currently selected toolchain when
534 a <TT
535 CLASS="LITERAL"
536 >-toolchain</TT
537 > option is not passed
538 on the command line.
539 </P
540 ></DD
541 ></DL
542 ></DIV
543 >
544
545 <P
546 ></P
547 ><DIV
548 CLASS="VARIABLELIST"
549 ><DL
550 ><DT
551 ><TT
552 CLASS="LITERAL"
553 >OCAMLPATH</TT
554 ></DT
555 ><DD
556 ><P
557 > This variable may contain an additional search path for package
558 directories. It is treated as if the directories were prepended to
559 the configuration variable <TT
560 CLASS="LITERAL"
561 >path</TT
562 >.
563 </P
564 ></DD
565 ></DL
566 ></DIV
567 >
568
569 <P
570 ></P
571 ><DIV
572 CLASS="VARIABLELIST"
573 ><DL
574 ><DT
575 ><TT
576 CLASS="LITERAL"
577 >OCAMLFIND_DESTDIR</TT
578 ></DT
579 ><DD
580 ><P
581 > This variable overrides the configuration variable
582 <TT
583 CLASS="LITERAL"
584 >destdir</TT
585 >.
586 </P
587 ></DD
588 ></DL
589 ></DIV
590 >
591
592 <P
593 ></P
594 ><DIV
595 CLASS="VARIABLELIST"
596 ><DL
597 ><DT
598 ><TT
599 CLASS="LITERAL"
600 >OCAMLFIND_METADIR</TT
601 ></DT
602 ><DD
603 ><P
604 > This variable overrides the configuration variable
605 <TT
606 CLASS="LITERAL"
607 >metadir</TT
608 >.
609 </P
610 ></DD
611 ></DL
612 ></DIV
613 >
614
615 <P
616 ></P
617 ><DIV
618 CLASS="VARIABLELIST"
619 ><DL
620 ><DT
621 ><TT
622 CLASS="LITERAL"
623 >OCAMLFIND_COMMANDS</TT
624 ></DT
625 ><DD
626 ><P
627 > This variable overrides the configuration variables
628 <TT
629 CLASS="LITERAL"
630 >ocamlc</TT
631 >, <TT
632 CLASS="LITERAL"
633 >ocamlopt</TT
634 >,
635 <TT
636 CLASS="LITERAL"
637 >ocamlcp</TT
638 >, <TT
639 CLASS="LITERAL"
640 >ocamlmktop</TT
641 >,
642 <TT
643 CLASS="LITERAL"
644 >ocamldoc</TT
645 >, <TT
646 CLASS="LITERAL"
647 >ocamldep</TT
648 >, and/or
649 <TT
650 CLASS="LITERAL"
651 >ocamlbrowser</TT
652 >.
653 Its value must conform to the syntax
654
655 <PRE
656 CLASS="PROGRAMLISTING"
657 >ocamlc=<TT
658 CLASS="REPLACEABLE"
659 ><I
660 >name</I
661 ></TT
662 > ocamlopt=<TT
663 CLASS="REPLACEABLE"
664 ><I
665 >name</I
666 ></TT
667 > ocamlcp=<TT
668 CLASS="REPLACEABLE"
669 ><I
670 >name</I
671 ></TT
672 > ocamlmktop=<TT
673 CLASS="REPLACEABLE"
674 ><I
675 >name</I
676 ></TT
677 > ocamldoc=<TT
678 CLASS="REPLACEABLE"
679 ><I
680 >name</I
681 ></TT
682 > ocamldep=<TT
683 CLASS="REPLACEABLE"
684 ><I
685 >name</I
686 ></TT
687 > ocamlbrowser=<TT
688 CLASS="REPLACEABLE"
689 ><I
690 >name</I
691 ></TT
692 ></PRE
693 >
694 </P
695 ><P
696 >Example:
697 <PRE
698 CLASS="PROGRAMLISTING"
699 >ocamlc=ocamlc-3.00 ocamlopt=ocamlopt-3.00 ocamlcp=ocamlcp-3.00 ocamlmktop=ocamlmktop-3.00</PRE
700 >
701 </P
702 ></DD
703 ></DL
704 ></DIV
705 >
706
707 <P
708 ></P
709 ><DIV
710 CLASS="VARIABLELIST"
711 ><DL
712 ><DT
713 ><TT
714 CLASS="LITERAL"
715 >CAMLLIB</TT
716 > or <TT
717 CLASS="LITERAL"
718 >OCAMLLIB</TT
719 ></DT
720 ><DD
721 ><P
722 > This variable overrides the configuration variable
723 <TT
724 CLASS="LITERAL"
725 >stdlib</TT
726 >.
727 </P
728 ></DD
729 ></DL
730 ></DIV
731 >
732
733 <P
734 ></P
735 ><DIV
736 CLASS="VARIABLELIST"
737 ><DL
738 ><DT
739 ><TT
740 CLASS="LITERAL"
741 >OCAMLFIND_LDCONF</TT
742 ></DT
743 ><DD
744 ><P
745 > This variable overrides the configuration variable
746 <TT
747 CLASS="LITERAL"
748 >ldconf</TT
749 >.
750 </P
751 ></DD
752 ></DL
753 ></DIV
754 >
755
756 <P
757 ></P
758 ><DIV
759 CLASS="VARIABLELIST"
760 ><DL
761 ><DT
762 ><TT
763 CLASS="LITERAL"
764 >OCAMLFIND_IGNORE_DUPS_IN</TT
765 ></DT
766 ><DD
767 ><P
768 > This variable instructs findlib not to emit warnings that packages
769 or module occur several times. The variable must be set to the
770 directory where the packages reside that are to be ignored for this
771 warning.
772 </P
773 ></DD
774 ></DL
775 ></DIV
776 >
777 &#13;</P
778 ></DIV
779 ><DIV
780 CLASS="NAVFOOTER"
781 ><HR
782 ALIGN="LEFT"
783 WIDTH="100%"><TABLE
784 SUMMARY="Footer navigation table"
785 WIDTH="100%"
786 BORDER="0"
787 CELLPADDING="0"
788 CELLSPACING="0"
789 ><TR
790 ><TD
791 WIDTH="33%"
792 ALIGN="left"
793 VALIGN="top"
794 ><A
795 HREF="r721.html"
796 ACCESSKEY="P"
797 >Prev</A
798 ></TD
799 ><TD
800 WIDTH="34%"
801 ALIGN="center"
802 VALIGN="top"
803 ><A
804 HREF="index.html"
805 ACCESSKEY="H"
806 >Home</A
807 ></TD
808 ><TD
809 WIDTH="33%"
810 ALIGN="right"
811 VALIGN="top"
812 ><A
813 HREF="r1021.html"
814 ACCESSKEY="N"
815 >Next</A
816 ></TD
817 ></TR
818 ><TR
819 ><TD
820 WIDTH="33%"
821 ALIGN="left"
822 VALIGN="top"
823 >META</TD
824 ><TD
825 WIDTH="34%"
826 ALIGN="center"
827 VALIGN="top"
828 ><A
829 HREF="p719.html"
830 ACCESSKEY="U"
831 >Up</A
832 ></TD
833 ><TD
834 WIDTH="33%"
835 ALIGN="right"
836 VALIGN="top"
837 >site-lib</TD
838 ></TR
839 ></TABLE
840 ></DIV
841 ></BODY
842 ></HTML
843 >
7979 \&\ \ \ or:\ ocamlfind\ remove\ [-help\ |\ other\ options]\ \c
8080 .ft I
8181 package_name\c
82 .ft B
83 \&
84 .br
85 \&\ \ \ or:\ ocamlfind\ lint\ \c
86 .ft I
87 META\c
8288 .ft B
8389 \&
8490 .br
514520 .ft R
515521 .ft R
516522 Replaced by the package directory\c
523 .RE
524 .ft R
525 .sp
526 .RS "2m"
527 .ft R
528 %m\c
529 .RE
530 .ft R
531 .sp
532 .RS "7m"
533 .ft R
534 .ft R
535 Replaced by the path to the META file (new since findlib-1.6)\c
517536 .RE
518537 .ft R
519538 .sp
24152434 This command lists all packages in the search path. The option -describe\c
24162435 \&
24172436 outputs the package descriptions, too.\c
2418 .SH "THE 'printconf' SUBCOMMAND"
2437 .SH "THE 'lint' SUBCOMMAND"
24192438 .ft R
24202439 .SS "Synopsis"
24212440 .ft R
24222441 .ft R
24232442 .ft B
24242443 .nf
2425 ocamlfind\ printconf\ [\ conf\ |\ path\ |\ destdir\ |\ metadir\ |\ stdlib\ |\ ldconf\ ]\c
2444 ocamlfind\ lint\ \c
2445 .ft I
2446 file\c
2447 .ft B
24262448 .ft R
24272449 .fi
24282450 .SS "Description"
24292451 .ft R
24302452 .ft R
2453 Checks the META file, and reports possible problems.\c
2454 .SH "THE 'printconf' SUBCOMMAND"
2455 .ft R
2456 .SS "Synopsis"
2457 .ft R
2458 .ft R
2459 .ft B
2460 .nf
2461 ocamlfind\ printconf\ [\ conf\ |\ path\ |\ destdir\ |\ metadir\ |\ metapath\ |\ stdlib\ |\ ldconf\ ]\c
2462 .ft R
2463 .fi
2464 .SS "Description"
2465 .ft R
2466 .ft R
24312467 This command prints the effective configuration after reading the\c
24322468 \&
24332469 configuration file, and after applying the various environment\c
24982534 Prints the location where META files are installed and\c
24992535 \&
25002536 \& removed (if the alternative layout is used).\c
2537 .RE
2538 .ft R
2539 .sp
2540 .RS "2m"
2541 .ft R
2542 metapath\c
2543 .RE
2544 .ft R
2545 .sp
2546 .RS "7m"
2547 .ft R
2548 .ft R
2549 Prints the path where the META file is installed for\c
2550 \&
2551 a fictive package. The name of the package is marked with '%s' in the\c
2552 \&
2553 path. For instance, this command could output "/some/path/%s/META" or\c
2554 \&
2555 "/some/path/META.%s", depending on the layout.\c
25012556 .RE
25022557 .ft R
25032558 .sp
18061806 </sect2>
18071807 </sect1>
18081808
1809
1810
1811 <sect1>
1812 <title>Lint</title>
1813
1814 <para><emphasis>(Since findlib-1.6.)</emphasis></para>
1815
1816 <para>
1817 As it has become more and more complicated to write correct META files
1818 there is now some support for recognizing typical problems. Just use
1819
1820 <programlisting>
1821 ocamlfind lint META
1822 </programlisting>
1823
1824 to check the file META in the current directory. The tool reports problematic
1825 lines in META, e.g.
1826
1827 <programlisting>
1828 archive(byte,plugin) = "oUnit.cma"
1829 This specification of dynamic loading is deprecated, you should add a "plugin(...)" variable.
1830
1831 archive(native,plugin) = "oUnit.cmxs"
1832 This specification of dynamic loading is deprecated, you should add a "plugin(...)" variable.
1833 </programlisting>
1834
1835 </para>
1836 </sect1>
18091837 </chapter>
1838
18101839
18111840 <!-- ********************************************************************** -->
18121841
2525 or: <link linkend="ocamlfind.ocamlbrowser">ocamlfind ocamlbrowser [-help | other options]</link>
2626 or: <link linkend="ocamlfind.install">ocamlfind install [-help | other options] <replaceable>package_name</replaceable> <replaceable>file</replaceable> ...</link>
2727 or: <link linkend="ocamlfind.remove">ocamlfind remove [-help | other options] <replaceable>package_name</replaceable></link>
28 or: <link linkend="ocamlfind.list">ocamlfind lint <replaceable>META</replaceable></link>
2829 or: <link linkend="ocamlfind.list">ocamlfind list [-describe]</link>
2930 or: <link linkend="ocamlfind.printconf">ocamlfind printconf [ variable ]</link>
3031 or: <link linkend="ocamlfind.pkgcmd">ocamlfind <replaceable>package</replaceable>/<replaceable>command</replaceable> <replaceable>arg</replaceable> ...</link>
201202 <varlistentry>
202203 <term>%d</term>
203204 <listitem><para>Replaced by the package directory</para></listitem>
205 </varlistentry>
206 <varlistentry>
207 <term>%m</term>
208 <listitem><para>Replaced by the path to the META file (new since findlib-1.6)
209 </para></listitem>
204210 </varlistentry>
205211 <varlistentry>
206212 <term>%D</term>
11921198 </refsect2>
11931199 </refsect1>
11941200
1201 <!-- ********************************************************************** -->
1202
1203 <refsect1>
1204 <title><anchor id="ocamlfind.lint">
1205 THE "lint" SUBCOMMAND
1206 </title>
1207
1208 <refsect2>
1209 <title>Synopsis</title>
1210 <programlisting>
1211 ocamlfind lint <replaceable>file</replaceable>
1212 </programlisting>
1213 </refsect2>
1214
1215 <refsect2>
1216 <title>Description</title>
1217 <para>
1218 Checks the META file, and reports possible problems.
1219 </para>
1220 </refsect2>
1221 </refsect1>
11951222
11961223 <!-- ********************************************************************** -->
11971224
12031230 <refsect2>
12041231 <title>Synopsis</title>
12051232 <programlisting>
1206 ocamlfind printconf [ conf | path | destdir | metadir | stdlib | ldconf ]
1233 ocamlfind printconf [ conf | path | destdir | metadir | metapath | stdlib | ldconf ]
12071234 </programlisting>
12081235 </refsect2>
12091236
12401267 removed (if the alternative layout is used).</para></listitem>
12411268 </varlistentry>
12421269 <varlistentry>
1270 <term><literal>metapath</literal></term>
1271 <listitem><para>Prints the path where the META file is installed for
1272 a fictive package. The name of the package is marked with '%s' in the
1273 path. For instance, this command could output "/some/path/%s/META" or
1274 "/some/path/META.%s", depending on the layout.</para></listitem>
1275 </varlistentry>
1276 <varlistentry>
12431277 <term><literal>stdlib</literal></term>
12441278 <listitem><para>Prints the location of the standard library.
12451279 </para></listitem>
5959 >package_name</REPLACEABLE></LINK>
6060 or: <LINK
6161 LINKEND="OCAMLFIND.LIST"
62 >ocamlfind lint <REPLACEABLE
63 >META</REPLACEABLE></LINK>
64 or: <LINK
65 LINKEND="OCAMLFIND.LIST"
6266 >ocamlfind list [-describe]</LINK>
6367 or: <LINK
6468 LINKEND="OCAMLFIND.PRINTCONF"
225229 >%d</TERM><LISTITEM
226230 ><PARA
227231 >Replaced by the package directory</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY
232 ><TERM
233 >%m</TERM><LISTITEM
234 ><PARA
235 >Replaced by the path to the META file (new since findlib-1.6)</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY
228236 ><TERM
229237 >%D</TERM><LISTITEM
230238 ><PARA
10721080 outputs the package descriptions, too.</PARA></REFSECT2></REFSECT1><REFSECT1
10731081 ><TITLE
10741082 ><ANCHOR
1083 ID="OCAMLFIND.LINT"
1084 ></ANCHOR>
1085 THE "lint" SUBCOMMAND</TITLE><REFSECT2
1086 ><TITLE
1087 >Synopsis</TITLE><PROGRAMLISTING
1088 FORMAT="LINESPECIFIC"
1089 >ocamlfind lint <REPLACEABLE
1090 >file</REPLACEABLE></PROGRAMLISTING></REFSECT2><REFSECT2
1091 ><TITLE
1092 >Description</TITLE><PARA
1093 >Checks the META file, and reports possible problems.</PARA></REFSECT2></REFSECT1><REFSECT1
1094 ><TITLE
1095 ><ANCHOR
10751096 ID="OCAMLFIND.PRINTCONF"
10761097 ></ANCHOR>
10771098 THE "printconf" SUBCOMMAND</TITLE><REFSECT2
10781099 ><TITLE
10791100 >Synopsis</TITLE><PROGRAMLISTING
10801101 FORMAT="LINESPECIFIC"
1081 >ocamlfind printconf [ conf | path | destdir | metadir | stdlib | ldconf ]</PROGRAMLISTING></REFSECT2><REFSECT2
1102 >ocamlfind printconf [ conf | path | destdir | metadir | metapath | stdlib | ldconf ]</PROGRAMLISTING></REFSECT2><REFSECT2
10821103 ><TITLE
10831104 >Description</TITLE><PARA
10841105 >This command prints the effective configuration after reading the
11161137 ><PARA
11171138 >Prints the location where META files are installed and
11181139 removed (if the alternative layout is used).</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY
1140 ><TERM
1141 ><LITERAL
1142 MOREINFO="NONE"
1143 >metapath</LITERAL></TERM><LISTITEM
1144 ><PARA
1145 >Prints the path where the META file is installed for
1146 a fictive package. The name of the package is marked with '%s' in the
1147 path. For instance, this command could output "/some/path/%s/META" or
1148 "/some/path/META.%s", depending on the layout.</PARA></LISTITEM></VARLISTENTRY><VARLISTENTRY
11191149 ><TERM
11201150 ><LITERAL
11211151 MOREINFO="NONE"
55 archive(byte,toploop) = "findlib.cma findlib_top.cma"
66 archive(byte,create_toploop) = "findlib.cma findlib_top.cma"
77 archive(native) = "findlib.cmxa"
8 plugin(byte) = "findlib.cma"
89 plugin(native) = "findlib.cmxs"
910
1011 package "dynload" (
1415 archive(byte) = "findlib_dynload.cma"
1516 archive(native) = "findlib_dynload.cmxa"
1617 #Even if it strange and discouraged to dynload this package
17 archive(byte,plugin) = "findlib_dynload.cma"
18 archive(native,plugin) = "findlib_dynload.cmxs"
18 plugin(byte) = "findlib_dynload.cma"
19 plugin(native) = "findlib_dynload.cmxs"
1920 linkopts = "-linkall"
2021 )
2222
2323 OBJECTS = findlib_config.cmo fl_split.cmo fl_metatoken.cmo fl_meta.cmo \
2424 fl_metascanner.cmo fl_topo.cmo fl_package_base.cmo \
25 findlib.cmo fl_args.cmo
25 findlib.cmo fl_args.cmo fl_lint.cmo
2626 TOBJECTS = topfind.cmo
2727
2828 XOBJECTS = $(OBJECTS:.cmo=.cmx)
0 (* $Id: findlib.ml 254 2015-05-02 18:41:01Z gerd $
0 (* $Id: findlib.ml 272 2015-12-07 13:47:02Z gerd $
11 * ----------------------------------------------------------------------
22 *
33 *)
346346 ;;
347347
348348
349 let package_meta_file pkg =
350 lazy_init();
351 (Fl_package_base.query pkg).Fl_package_base.package_meta
352 ;;
353
354
349355 let package_property_2 predlist pkg propname =
350356 lazy_init();
351357 let l = Fl_package_base.query pkg in
0 (* $Id: findlib.mli 254 2015-05-02 18:41:01Z gerd $
0 (* $Id: findlib.mli 272 2015-12-07 13:47:02Z gerd $
11 * ----------------------------------------------------------------------
22 *
33 *)
131131 * Raises [No_such_package] if the package cannot be found.
132132 *)
133133
134 val package_meta_file : string -> string
135 (** Get the absolute path of the META file of the given package *)
136
134137 val ignore_dups_in : unit -> string option
135138 (** If [Some d], duplicate packages below [d] are ignored, and do not
136139 * produce warnings. (Only affects the generation of warnings.)
0 (* $Id: fl_dynload.mli 259 2015-05-03 14:36:24Z gerd $ *)
0 (* $Id: fl_dynload.mli 277 2015-12-07 14:33:35Z gerd $ *)
11
22 (** Utilities for loading dynamically packages *)
33
2424
2525 - First, the "plugin" variable is checked (instead of "archive"), e.g.
2626 {[
27 plugin(bytecode) = "my_plugin.cma"
27 plugin(byte) = "my_plugin.cma"
2828 plugin(native) = "my_plugin.cmxs"
2929 ]}
3030 This is the preferred style.
0 (* $Id: fl_lint.ml 267 2015-12-07 13:05:29Z gerd $ -*- tuareg -*-
1 * ----------------------------------------------------------------------
2 *
3 *)
4
5 open Fl_metascanner
6
7 module Have = struct
8 module T = struct
9 type mode = [`Byte | `Native | `Toploop | `Preprocessor | `Ppx_driver]
10 type t = [
11 `Mode of [ `TooMany | `None]
12 (** problem in the number of mode (byte,native,syntax,...)
13 in the variable *)
14 | `Archive of [`Plugin|`NoPlugin] * mode
15 (** archive(plugin,...) or archive(...)) *)
16 | `Plugin of [`Plugin|`NoPlugin] * mode
17 (** plugin(...) *)
18 | `Description
19 | `Requires
20 | `Version
21 ]
22 let compare = compare
23 end
24 include T
25 module Set = Set.Make(T)
26 module Map = Map.Make(T)
27 end
28
29 let scan_def acc def =
30 let add have = Have.Map.add have def acc in
31 let has_plugin_pred = List.mem (`Pred "plugin") def.def_preds in
32 let plugin = if has_plugin_pred then `Plugin else `NoPlugin in
33 let modes = [ "byte", `Byte;
34 "native", `Native;
35 "toploop", `Toploop;
36 "preprocessor", `Preprocessor;
37 "ppx_driver", `Ppx_driver
38 ] in
39 let modes =
40 List.filter
41 (fun (p,_) -> List.mem (`Pred p) def.def_preds)
42 modes
43 in
44 let modes = List.map snd modes in
45 match def.def_var, modes with
46 (** For archive the modes are used in multiple ways, so we can't
47 check exhaustiveness or presence.
48 *)
49 | "plugin", [] -> add (`Mode(`None))
50 | "plugin", _::_::_ -> add (`Mode(`TooMany))
51
52 | "archive", [mode] -> add (`Archive(plugin,mode))
53 | "plugin", [mode] -> add (`Plugin(plugin,mode))
54 | "description", _ -> add `Description
55 | "requires", _ -> add `Requires
56 | "version", _ -> add `Version
57 | _ -> acc
58
59
60 let warn_def ~warned pkg =
61 let haves =
62 List.fold_left scan_def Have.Map.empty pkg.pkg_defs
63 in
64 let mem x = Have.Map.mem x haves in
65 let find x = Have.Map.find x haves in
66 let warning fmt = warned := true; Printf.printf fmt in
67 let if_ ?has ?(has_not=[]) msg =
68 match has, has_not with
69 | Some has, [] when mem has ->
70 warning "%a%s\n\n" print_def (find has) msg;
71 | Some has, has_not when mem has && not (List.exists mem has_not) ->
72 warning "%a%s\n\n" print_def (find has) msg;
73 | None, has_not when not (List.exists mem has_not) ->
74 warning "%s\n\n" msg;
75 | _ -> ()
76 in
77 if_ ~has_not:[`Description]
78 "You should add a description.";
79 if_ ~has_not:[`Version]
80 "You should add a version.";
81 if_ ~has_not:[`Requires]
82 "You should add the required libraries. You can silent this \
83 warning by using the empty string.";
84 if_ ~has:(`Mode(`TooMany))
85 "This variable should have only one mode
86 (\"byte\", \"native\").";
87 if_ ~has:(`Mode(`None))
88 "This variable should have at least the predicate \
89 \"byte\" or \"native\".";
90 let with_mode mode =
91 if_ ~has:(`Plugin (`Plugin,mode))
92 "You must not add the predicate \"plugin\" to the variable \
93 \"plugin\".";
94 if_ ~has:(`Archive (`Plugin,mode)) ~has_not:[`Plugin (`NoPlugin,mode)]
95 "This specification of dynamic loading is deprecated, you should add a \
96 \"plugin(...)\" variable.";
97 if_ ~has:(`Archive (`NoPlugin,mode))
98 ~has_not:[`Plugin (`NoPlugin,mode);`Archive (`Plugin,mode)]
99 "This variable indicates how to link statically, you should add a \
100 \"plugin(...)\" variable for linking dynamically.";
101 in
102 with_mode `Byte;
103 with_mode `Native
104
105 let warn pkg =
106 let warned = ref false in
107 let rec aux pkg =
108 warn_def ~warned pkg;
109 List.iter (fun (_,pkg) -> aux pkg) pkg.pkg_children;
110 in
111 aux pkg;
112 !warned
0 (* $Id: fl_meta.mll 85 2006-01-01 19:04:38Z gerd $
0 (* $Id: fl_meta.mll 273 2015-12-07 14:20:45Z gerd $
11 * ----------------------------------------------------------------------
22 *
33 *)
4545 let s1 = Lexing.lexeme lexbuf in
4646 let s2 = String.sub s1 1 (String.length s1 - 2) in
4747 let l2 = String.length s2 in
48 let rec count i n =
48 let b = Buffer.create 80 in
49 let rec fill i =
4950 if i<l2 then
5051 match s2.[i] with
51 '\\' -> count (i+2) (n+1)
52 | _ -> count (i+1) (n+1)
53 else
54 n
55 in
56 let s3 = String.create (count 0 0) in
57 let rec fill i n =
58 if i<l2 then
59 match s2.[i] with
60 '\\' -> s3.[n] <- s2.[i+1]; fill (i+2) (n+1)
61 | c -> s3.[n] <- c; fill (i+1) (n+1)
62 else
63 ()
64 in
65 fill 0 0;
66 String s3
52 | '\\' -> Buffer.add_char b s2.[i+1]; fill (i+2)
53 | c -> Buffer.add_char b c; fill (i+1) in
54 fill 0;
55 String (Buffer.contents b)
6756 }
6857
6958 | [ ' ' '\t' '\r' ]
107107 (try parse_all need_rparen __strm
108108 with | Stream.Failure -> raise (Stream.Error "")) in
109109 let (args, flav, value) = props in (* TODO: Check args *)
110 let args' = Sort.list ( <= ) (mk_set args) in
110 let args' = List.sort compare (mk_set args) in
111111 let def =
112112 {
113113 def_var = n;
368368 get_rule parse_properties ()
369369 (error_msg "Error in 'name = value' clause") line col in
370370 let rest = parse_all need_rparen in (* TODO: Check args *)
371 let args' = Sort.list ( <= ) (mk_set args) in
371 let args' = List.sort compare (mk_set args) in
372372 let def =
373373 {
374374 def_var = n;
493493 with | Stream.Error "" -> raise (Stream.Error "Syntax Error")
494494
495495 let parse2 ch = parse2_lexing (Lexing.from_channel ch)
496
496
497 let escape s = (* no Str available :-( *)
498 let b = Buffer.create (String.length s)
499 in
500 (for k = 0 to (String.length s) - 1 do
501 (match s.[k] with
502 | '\\' -> Buffer.add_string b "\\\\"
503 | '"' -> Buffer.add_string b "\\\""
504 | c -> Buffer.add_char b c)
505 done;
506 Buffer.contents b)
507
508 let print_def f def =
509 let format_pred = function | `Pred s -> s | `NegPred s -> "-" ^ s in
510 fprintf f "%s%s %s \"%s\"\n" def.def_var
511 (match def.def_preds with
512 | [] -> ""
513 | l -> "(" ^ ((String.concat "," (List.map format_pred l)) ^ ")"))
514 (match def.def_flav with | `BaseDef -> "=" | `Appendix -> "+=")
515 (escape def.def_value)
516
517
497518 let rec print f pkg =
498 let escape s = (* no Str available :-( *)
499 let b = Buffer.create (String.length s)
500 in
501 (for k = 0 to (String.length s) - 1 do
502 (match s.[k] with
503 | '\\' -> Buffer.add_string b "\\\\"
504 | '"' -> Buffer.add_string b "\\\""
505 | c -> Buffer.add_char b c)
506 done;
507 Buffer.contents b) in
508 let format_pred = function | `Pred s -> s | `NegPred s -> "-" ^ s in
509 let print_def def =
510 fprintf f "%s%s %s \"%s\"\n" def.def_var
511 (match def.def_preds with
512 | [] -> ""
513 | l -> "(" ^ ((String.concat "," (List.map format_pred l)) ^ ")"))
514 (match def.def_flav with | `BaseDef -> "=" | `Appendix -> "+=")
515 (escape def.def_value)
516 in
517 (List.iter print_def pkg.pkg_defs;
519 (List.iter (print_def f) pkg.pkg_defs;
518520 List.iter
519521 (fun (name, child) ->
520522 (fprintf f "\npackage \"%s\" (\n" (escape name);
0 (* $Id: fl_metascanner.mli 254 2015-05-02 18:41:01Z gerd $
0 (* $Id: fl_metascanner.mli 264 2015-12-07 12:48:08Z gerd $
11 * ----------------------------------------------------------------------
22 *
33 *)
5959 val parse2_lexing : Lexing.lexbuf -> pkg_expr
6060 val parse_lexing : Lexing.lexbuf -> pkg_expr
6161
62
63 val print_def : out_channel -> pkg_definition -> unit
64 (** [print_def ch def]:
65 * Outputs the definition to a channel.
66 *)
67
6268 val print : out_channel -> pkg_expr -> unit
6369 (** [print ch expr]:
6470 * Outputs the package expression to a channel.
0 (* $Id: fl_metascanner.src 195 2013-06-05 23:29:59Z gerd $ -*- tuareg -*-
0 (* $Id: fl_metascanner.src 273 2015-12-07 14:20:45Z gerd $ -*- tuareg -*-
11 * ----------------------------------------------------------------------
22 *
33 *)
9595 ->
9696 let (args, flav, value) = props in
9797 (* TODO: Check args *)
98 let args' = Sort.list ( <= ) (mk_set args) in
98 let args' = List.sort ( <= ) (mk_set args) in
9999 let def = { def_var = n;
100100 def_flav = flav;
101101 def_preds = args';
307307 let (args, flav, value) = get_rule parse_properties () (error_msg "Error in 'name = value' clause") line col in
308308 let rest = parse_all need_rparen in
309309 (* TODO: Check args *)
310 let args' = Sort.list ( <= ) (mk_set args) in
310 let args' = List.sort ( <= ) (mk_set args) in
311311 let def = { def_var = n;
312312 def_flav = flav;
313313 def_preds = args';
0 (* $Id: fl_package_base.ml 141 2011-04-06 20:27:53Z gerd $
0 (* $Id: fl_package_base.ml 272 2015-12-07 13:47:02Z gerd $
11 * ----------------------------------------------------------------------
22 *
33 *)
1010 type package =
1111 { package_name : string;
1212 package_dir : string;
13 package_meta : string;
1314 package_defs : Fl_metascanner.pkg_definition list;
1415 package_priv : package_priv
1516 }
120121 let p =
121122 { package_name = p_name;
122123 package_dir = d';
124 package_meta = meta_file;
123125 package_defs = pkg_expr.pkg_defs;
124126 package_priv = { missing_reqs = [] }
125127 } in
0 (* $Id: fl_package_base.mli 141 2011-04-06 20:27:53Z gerd $
0 (* $Id: fl_package_base.mli 272 2015-12-07 13:47:02Z gerd $
11 * ----------------------------------------------------------------------
22 *
33 *)
1212 *)
1313 package_dir : string;
1414 (** The directory where to lookup package files *)
15 package_meta : string;
16 (** The path to the META file *)
1517 package_defs : Fl_metascanner.pkg_definition list;
1618 (** The definitions in the META file *)
1719 package_priv : package_priv;
0 (* $Id: fl_split.ml 66 2004-01-30 15:44:33Z gerd $
0 (* $Id: fl_split.ml 273 2015-12-07 14:20:45Z gerd $
11 * ----------------------------------------------------------------------
22 *
33 *)
103103 ;;
104104
105105
106 let norm_dir d =
106 let norm_dir s =
107107 (* Converts the file name of the directory [d] to the normal form.
108108 * For Unix, the '/' characters at the end are removed, and multiple
109109 * '/' are deleted.
110110 * For Windows, all '/' characters are converted to '\'. Two
111111 * backslashes at the beginning are tolerated.
112112 *)
113 let s = String.copy d in
114 let l = String.length d in
113 let b = Buffer.create 80 in
114 let l = String.length s in
115115 let norm_dir_unix() =
116 Buffer.add_char b s.[0];
116117 for k = 1 to l - 1 do
117 if s.[k] = '/' && s.[k-1] = '/' then s.[k] <- Char.chr 0;
118 if s.[k] = '/' && k = l-1 then s.[k] <- Char.chr 0
118 let c = s.[k] in
119 if not ((c = '/' && s.[k-1] = '/') || (c = '/' && k = l-1)) then
120 Buffer.add_char b c
119121 done
120122 in
123 let is_slash =
124 function
125 | '/' | '\\' -> true
126 | _ -> false in
121127 let norm_dir_win() =
122 if l >= 1 && s.[0] = '/' then s.[0] <- '\\';
123 if l >= 2 && s.[1] = '/' then s.[1] <- '\\';
128 if l >= 1 && s.[0] = '/' then
129 Buffer.add_char b '\\' else Buffer.add_char b s.[0];
130 if l >= 2 && s.[1] = '/' then
131 Buffer.add_char b '\\' else Buffer.add_char b s.[1];
124132 for k = 2 to l - 1 do
125 if s.[k] = '/' then s.[k] <- '\\';
126 if s.[k] = '\\' && s.[k-1] = '\\' then s.[k] <- Char.chr 0;
127 if s.[k] = '\\' && k = l-1 then s.[k] <- Char.chr 0
133 let c = s.[k] in
134 if is_slash c then (
135 if not (is_slash s.[k-1] || k = l-1) then
136 Buffer.add_char b '\\'
137 ) else
138 Buffer.add_char b c
128139 done
129140 in
130 let expunge() =
131 let n = ref 0 in
132 for k = 0 to l - 1 do
133 if s.[k] = Char.chr 0 then incr n
134 done;
135 let s' = String.create (l - !n) in
136 n := 0;
137 for k = 0 to l - 1 do
138 if s.[k] <> Char.chr 0 then begin
139 s'.[ !n ] <- s.[k];
140 incr n
141 end
142 done;
143 s'
144 in
145141 match Sys.os_type with
146 "Unix" | "Cygwin" -> norm_dir_unix(); expunge()
147 | "Win32" -> norm_dir_win(); expunge()
142 "Unix" | "Cygwin" -> norm_dir_unix(); Buffer.contents b
143 | "Win32" -> norm_dir_win(); Buffer.contents b
148144 | _ -> failwith "This os_type is not supported"
149145 ;;
0 (* $Id: frontend.ml 255 2015-05-03 13:40:48Z gerd $
0 (* $Id: frontend.ml 273 2015-12-07 14:20:45Z gerd $
11 * ----------------------------------------------------------------------
22 *
33 *)
99 type mode =
1010 M_use | M_query | M_install | M_remove | M_compiler of string | M_dep
1111 | M_printconf | M_list | M_browser | M_call of (string*string)
12 | M_doc
12 | M_doc | M_lint
1313 ;;
1414
1515
2828 let slashify s =
2929 match Findlib_config.system with
3030 | "mingw" | "mingw64" | "cygwin" ->
31 let u = String.copy s in
32 for k = 0 to String.length u - 1 do
33 if u.[k] = '\\' then u.[k] <- '/'
34 done;
35 u
31 let b = Buffer.create 80 in
32 String.iter
33 (function
34 | '\\' -> Buffer.add_char b '/'
35 | c -> Buffer.add_char b c
36 )
37 s;
38 Buffer.contents b
3639 | _ ->
3740 s
3841
669672 (* format:
670673 * %p package name
671674 * %d package directory
675 * %m META file
672676 * %D description
673677 * %v version
674678 * %a archive file(s)
685689 let spec =
686690 [ "%p", [pkg];
687691 "%d", [out_path dir];
692 "%m", [out_path (package_meta_file pkg)];
688693 "%D", [try package_property predicates pkg "description"
689694 with Not_found -> "[n/a]"];
690695 "%v", [try package_property predicates pkg "version"
717722
718723 %p package name
719724 %d package directory
725 %m META file
720726 %D description
721727 %v version
722728 %a archive file(s)
17771783 outpath in
17781784 try
17791785 let buflen = 4096 in
1780 let buf = String.create buflen in
1786 let buf = String.create buflen in (* FIXME: Bytes.create *)
17811787 let pos = ref 0 in
17821788 let len = ref (input ch_in buf 0 buflen) in
17831789 while !len > 0 do
19421948
19431949 type which = Auto | Dll | No_dll;;
19441950
1951 let meta_pkg meta_name =
1952 let f = open_in meta_name in
1953 try
1954 let pkg = Fl_metascanner.parse f in
1955 close_in f;
1956 pkg
1957 with
1958 | Failure s
1959 | Stream.Error s ->
1960 close_in f;
1961 failwith ("Cannot parse '" ^ meta_name ^ "': " ^ s)
1962
1963
19451964 let install_package () =
19461965 let destdir = ref (default_location()) in
19471966 let metadir = ref (meta_directory()) in
20492068 else
20502069 failwith "The META file is missing" in
20512070
2052 let meta_pkg =
2053 let f = open_in meta_name in
2054 try
2055 let pkg = Fl_metascanner.parse f in
2056 close_in f;
2057 pkg
2058 with
2059 | Failure s
2060 | Stream.Error s ->
2061 close_in f;
2062 failwith ("Cannot parse '" ^ meta_name ^ "': " ^ s)
2063 in
2071 let meta_pkg = meta_pkg meta_name in
20642072
20652073 if not !add_files then (
20662074 (* Check for frequent reasons why installation can go wrong *)
23332341 in
23342342
23352343 let var = ref None in
2336 let errmsg = "usage: ocamlfind printconf (conf|path|destdir|metadir|stdlib|ldconf)" in
2344 let errmsg = "usage: ocamlfind printconf (conf|path|destdir|metadir|effmetadir|stdlib|ldconf)" in
23372345
23382346 parse_args
23392347 []
23402348 (fun s ->
23412349 if !var <> None then raise(Arg.Bad "Unexpected argument");
23422350 match s with
2343 ("conf" | "path" | "destdir" | "metadir" | "stdlib" | "ldconf") ->
2351 ("conf" | "path" | "destdir" | "metadir" | "metapath" | "stdlib" | "ldconf") ->
23442352 var := Some s
23452353 | _ ->
23462354 raise(Arg.Bad "Bad argument");
23752383 print_endline (Findlib.default_location())
23762384 | Some "metadir" ->
23772385 print_endline (Findlib.meta_directory())
2386 | Some "metapath" ->
2387 let mdir = Findlib.meta_directory() in
2388 let ddir = Findlib.default_location() in
2389 print_endline
2390 (if mdir <> "" then mdir ^ "/META.%s" else ddir ^ "/%s/META")
23782391 | Some "stdlib" ->
23792392 print_endline (Findlib.ocaml_stdlib())
23802393 | Some "ldconf" ->
23992412 end;
24002413 let args = Array.to_list (Array.sub Sys.argv 2 (Array.length Sys.argv -2)) in
24012414 run_command Normal path args
2415 ;;
2416
2417 (** lint META file *)
2418 let lint () =
2419
2420 let meta_files = Queue.create () in
2421
2422 parse_args
2423 ~align:false
2424 ( Arg.align [
2425 ])
2426 (fun s -> if Sys.file_exists s
2427 then Queue.add s meta_files
2428 else raise(Arg.Bad (Printf.sprintf "%s: file doesn't exists" s)))
2429 "usage: ocamlfind ocamldoc <options> <files>...";
2430
2431 let error =
2432 Queue.fold (fun error file ->
2433 let pkg = meta_pkg file in
2434 let error = Fl_lint.warn pkg || error in
2435 error
2436 ) false meta_files in
2437 exit (if error then 1 else 0)
24022438 ;;
24032439
24042440
24222458 | ("ocamldoc"|"-ocamldoc"|"doc") -> incr Arg.current; M_doc
24232459 | ("printconf"|"-printconf") -> incr Arg.current; M_printconf
24242460 | ("list"|"-list") -> incr Arg.current; M_list
2461 | ("lint"|"-lint") -> incr Arg.current; M_lint
24252462 | "-toolchain" ->
24262463 let t = try arg (k+2) with Not_found -> raise Usage in
24272464 Findlib.init ~toolchain:t ();
24652502 | M_doc -> ocamldoc()
24662503 | M_call(pkg,cmd) -> ocamlcall pkg cmd
24672504 | M_compiler which -> ocamlc which ()
2505 | M_lint -> lint()
24682506 with
24692507 Usage ->
24702508 prerr_endline "Usage: ocamlfind query [-help | other options] <package_name> ...";
24822520 prerr_endline " or: ocamlfind install [-help | other options] <package_name> <file> ...";
24832521 prerr_endline " or: ocamlfind remove [-help | other options] <package_name>";
24842522 prerr_endline " or: ocamlfind printconf [-help] [variable]";
2523 prerr_endline " or: ocamlfind lint [-help] <file>";
24852524 prerr_endline " or: ocamlfind list";
24862525 prerr_endline " or: ocamlfind pkg/cmd arg ...";
24872526 prerr_endline "Select toolchain with:";