Skip to content

Commit 2d83e49

Browse files
committed
Updated distribution files
1 parent de61799 commit 2d83e49

File tree

7 files changed

+193
-152
lines changed

7 files changed

+193
-152
lines changed

INSTALL.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
(* OASIS_START *)
2-
(* DO NOT EDIT (digest: 5cd2d4ec584f25e55d5c8bc833957508) *)
2+
(* DO NOT EDIT (digest: 851a53835eb2a813e6aeb1a50279e0d5) *)
33
This is the INSTALL file for the postgresql-ocaml distribution.
44

55
This package uses OASIS to generate its build system. See section OASIS for
6-
full information.
6+
full information.
77

88
Dependencies
99
============

_oasis

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
OASISFormat: 0.4
22
Name: postgresql-ocaml
3-
Version: 2.0.5
3+
Version: 2.0.6
44
Synopsis: postgresql-ocaml - bindings to the PostgreSQL library
55
Description: postgresql-ocaml offers library functions for accessing PostgreSQL databases
66
Authors: Alain Frisch <[email protected]>,

_tags

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# OASIS_START
2-
# DO NOT EDIT (digest: 6130d565a6b8b66ced080f5471d86dbf)
2+
# DO NOT EDIT (digest: 13a07b9ae83498d4d812e34d9fb75898)
33
# Ignore VCS directories, you can use the same kind of rule outside
44
# OASIS_START/STOP if you want to exclude directories that contains
55
# useless stuff for the build process
@@ -23,39 +23,39 @@
2323
"lib/libpostgresql_stubs.a": oasis_library_postgresql_cclib
2424
"lib/dllpostgresql_stubs.so": oasis_library_postgresql_cclib
2525
<lib/postgresql.{cma,cmxa}>: use_libpostgresql_stubs
26-
<lib/*.ml{,i}>: pkg_threads
2726
<lib/*.ml{,i}>: pkg_bigarray
28-
"lib/postgresql_stubs.c": pkg_threads
27+
<lib/*.ml{,i}>: pkg_threads
2928
"lib/postgresql_stubs.c": pkg_bigarray
29+
"lib/postgresql_stubs.c": pkg_threads
3030
# Executable cursor
31-
<examples/cursor.{native,byte}>: use_postgresql
32-
<examples/cursor.{native,byte}>: pkg_threads
3331
<examples/cursor.{native,byte}>: pkg_bigarray
32+
<examples/cursor.{native,byte}>: pkg_threads
33+
<examples/cursor.{native,byte}>: use_postgresql
3434
# Executable dump
35-
<examples/dump.{native,byte}>: use_postgresql
36-
<examples/dump.{native,byte}>: pkg_threads
3735
<examples/dump.{native,byte}>: pkg_bigarray
36+
<examples/dump.{native,byte}>: pkg_threads
37+
<examples/dump.{native,byte}>: use_postgresql
3838
# Executable populate
39-
<examples/populate.{native,byte}>: use_postgresql
40-
<examples/populate.{native,byte}>: pkg_threads
4139
<examples/populate.{native,byte}>: pkg_bigarray
40+
<examples/populate.{native,byte}>: pkg_threads
41+
<examples/populate.{native,byte}>: use_postgresql
4242
# Executable prompt
43-
<examples/prompt.{native,byte}>: use_postgresql
44-
<examples/prompt.{native,byte}>: pkg_threads
4543
<examples/prompt.{native,byte}>: pkg_bigarray
44+
<examples/prompt.{native,byte}>: pkg_threads
45+
<examples/prompt.{native,byte}>: use_postgresql
4646
# Executable prompt_gtk
47-
<examples/prompt_gtk.{native,byte}>: use_postgresql
47+
<examples/prompt_gtk.{native,byte}>: pkg_bigarray
4848
<examples/prompt_gtk.{native,byte}>: pkg_lablgtk2
4949
<examples/prompt_gtk.{native,byte}>: pkg_threads
50-
<examples/prompt_gtk.{native,byte}>: pkg_bigarray
50+
<examples/prompt_gtk.{native,byte}>: use_postgresql
5151
<examples/*.ml{,i}>: pkg_lablgtk2
5252
# Executable test_lo
53-
<examples/test_lo.{native,byte}>: use_postgresql
54-
<examples/test_lo.{native,byte}>: pkg_threads
5553
<examples/test_lo.{native,byte}>: pkg_bigarray
56-
<examples/*.ml{,i}>: use_postgresql
57-
<examples/*.ml{,i}>: pkg_threads
54+
<examples/test_lo.{native,byte}>: pkg_threads
55+
<examples/test_lo.{native,byte}>: use_postgresql
5856
<examples/*.ml{,i}>: pkg_bigarray
57+
<examples/*.ml{,i}>: pkg_threads
58+
<examples/*.ml{,i}>: use_postgresql
5959
# OASIS_STOP
6060

6161
true: -traverse

lib/META

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OASIS_START
2-
# DO NOT EDIT (digest: c31bdca2e2a0e283c7e021158379d1c2)
3-
version = "2.0.5"
2+
# DO NOT EDIT (digest: b1ebcbe4043a5a4e27c03bddf1379855)
3+
version = "2.0.6"
44
description = "postgresql-ocaml - bindings to the PostgreSQL library"
55
requires = "threads bigarray"
66
archive(byte) = "postgresql.cma"

lib/postgresql.mldylib

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
# OASIS_START
2+
# DO NOT EDIT (digest: c26c231d9e6acbc7ff10118d262f3f5e)
13
Postgresql
4+
# OASIS_STOP

myocamlbuild.ml

+61-32
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(* OASIS_START *)
2-
(* DO NOT EDIT (digest: d18e8cffec6dee519b54b3f70fc65adf) *)
2+
(* DO NOT EDIT (digest: d0d7a31f5fe589f4d2ca00034335e395) *)
33
module OASISGettext = struct
44
(* # 22 "src/oasis/OASISGettext.ml" *)
55

@@ -204,26 +204,27 @@ module BaseEnvLight = struct
204204
end
205205

206206

207-
let var_get name env =
208-
let rec var_expand str =
209-
let buff =
210-
Buffer.create ((String.length str) * 2)
211-
in
212-
Buffer.add_substitute
213-
buff
214-
(fun var ->
215-
try
216-
var_expand (MapString.find var env)
217-
with Not_found ->
218-
failwith
219-
(Printf.sprintf
220-
"No variable %s defined when trying to expand %S."
221-
var
222-
str))
223-
str;
224-
Buffer.contents buff
207+
let rec var_expand str env =
208+
let buff =
209+
Buffer.create ((String.length str) * 2)
225210
in
226-
var_expand (MapString.find name env)
211+
Buffer.add_substitute
212+
buff
213+
(fun var ->
214+
try
215+
var_expand (MapString.find var env) env
216+
with Not_found ->
217+
failwith
218+
(Printf.sprintf
219+
"No variable %s defined when trying to expand %S."
220+
var
221+
str))
222+
str;
223+
Buffer.contents buff
224+
225+
226+
let var_get name env =
227+
var_expand (MapString.find name env) env
227228

228229

229230
let var_choose lst env =
@@ -233,7 +234,7 @@ module BaseEnvLight = struct
233234
end
234235

235236

236-
# 236 "myocamlbuild.ml"
237+
# 237 "myocamlbuild.ml"
237238
module MyOCamlbuildFindlib = struct
238239
(* # 22 "src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
239240

@@ -306,6 +307,22 @@ module MyOCamlbuildFindlib = struct
306307
let find_syntaxes () = ["camlp4o"; "camlp4r"]
307308

308309

310+
let well_known_syntax = [
311+
"camlp4.quotations.o";
312+
"camlp4.quotations.r";
313+
"camlp4.exceptiontracer";
314+
"camlp4.extend";
315+
"camlp4.foldgenerator";
316+
"camlp4.listcomprehension";
317+
"camlp4.locationstripper";
318+
"camlp4.macro";
319+
"camlp4.mapgenerator";
320+
"camlp4.metagenerator";
321+
"camlp4.profiler";
322+
"camlp4.tracer"
323+
]
324+
325+
309326
let dispatch =
310327
function
311328
| Before_options ->
@@ -331,13 +348,17 @@ module MyOCamlbuildFindlib = struct
331348
List.iter
332349
begin fun pkg ->
333350
let base_args = [A"-package"; A pkg] in
351+
(* TODO: consider how to really choose camlp4o or camlp4r. *)
334352
let syn_args = [A"-syntax"; A "camlp4o"] in
335353
let args =
336-
(* Heuristic to identify syntax extensions: whether they end in
337-
* ".syntax"; some might not *)
338-
if Filename.check_suffix pkg "syntax"
339-
then syn_args @ base_args
340-
else base_args
354+
(* Heuristic to identify syntax extensions: whether they end in
355+
".syntax"; some might not.
356+
*)
357+
if Filename.check_suffix pkg "syntax" ||
358+
List.mem pkg well_known_syntax then
359+
syn_args @ base_args
360+
else
361+
base_args
341362
in
342363
flag ["ocaml"; "compile"; "pkg_"^pkg] & S args;
343364
flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S args;
@@ -368,7 +389,11 @@ module MyOCamlbuildFindlib = struct
368389
flag ["ocaml"; "pkg_threads"; "compile"] (S[A "-thread"]);
369390
flag ["ocaml"; "pkg_threads"; "doc"] (S[A "-I"; A "+threads"]);
370391
flag ["ocaml"; "pkg_threads"; "link"] (S[A "-thread"]);
371-
flag ["ocaml"; "pkg_threads"; "infer_interface"] (S[A "-thread"])
392+
flag ["ocaml"; "pkg_threads"; "infer_interface"] (S[A "-thread"]);
393+
flag ["ocaml"; "package(threads)"; "compile"] (S[A "-thread"]);
394+
flag ["ocaml"; "package(threads)"; "doc"] (S[A "-I"; A "+threads"]);
395+
flag ["ocaml"; "package(threads)"; "link"] (S[A "-thread"]);
396+
flag ["ocaml"; "package(threads)"; "infer_interface"] (S[A "-thread"]);
372397

373398
| _ ->
374399
()
@@ -527,10 +552,14 @@ module MyOCamlbuildBase = struct
527552
(* Add flags *)
528553
List.iter
529554
(fun (tags, cond_specs) ->
530-
let spec =
531-
BaseEnvLight.var_choose cond_specs env
555+
let spec = BaseEnvLight.var_choose cond_specs env in
556+
let rec eval_specs =
557+
function
558+
| S lst -> S (List.map eval_specs lst)
559+
| A str -> A (BaseEnvLight.var_expand str env)
560+
| spec -> spec
532561
in
533-
flag tags & spec)
562+
flag tags & (eval_specs spec))
534563
t.flags
535564
| _ ->
536565
()
@@ -547,7 +576,7 @@ module MyOCamlbuildBase = struct
547576
end
548577

549578

550-
# 550 "myocamlbuild.ml"
579+
# 579 "myocamlbuild.ml"
551580
open Ocamlbuild_plugin;;
552581
let package_default =
553582
{
@@ -605,7 +634,7 @@ let package_default =
605634

606635
let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
607636

608-
# 609 "myocamlbuild.ml"
637+
# 638 "myocamlbuild.ml"
609638
(* OASIS_STOP *)
610639

611640
let () =

0 commit comments

Comments
 (0)