File tree 3 files changed +33
-5
lines changed
3 files changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ Flag strict
33
33
Description: Strict compile-time checks
34
34
Default: true
35
35
36
+ Flag brewcheck
37
+ Description: Try to check against a homebrewed sqlite3
38
+ Default: false
39
+
36
40
Library sqlite3
37
41
Path: lib
38
42
FindlibName: sqlite3
Original file line number Diff line number Diff line change @@ -708,6 +708,19 @@ let string_trim s =
708
708
else if ! j > = ! i then String. sub s ! i (! j - ! i + 1 )
709
709
else " "
710
710
711
+ let pkg_export =
712
+ let env = BaseEnvLight. load () in
713
+ let bcs = BaseEnvLight. var_get " brewcheck" env in
714
+ let bcs = try bool_of_string bcs with _ -> false in
715
+ if not bcs then " "
716
+ else
717
+ let cmd = " brew ls sqlite | grep pkgconfig" in
718
+ match read_lines_from_cmd ~max_lines: 1 cmd with
719
+ | [fullpath] when fullpath <> " " ->
720
+ let path = Filename. dirname fullpath in
721
+ Printf. sprintf " PKG_CONFIG_PATH=%s" path
722
+ | _ -> " "
723
+
711
724
let () =
712
725
let additional_rules = function
713
726
| After_rules ->
@@ -733,13 +746,13 @@ let () =
733
746
List. map cnv chunks
734
747
in
735
748
let osqlite3_cflags =
736
- let cmd = " pkg-config --cflags sqlite3" in
749
+ let cmd = pkg_export ^ " pkg-config --cflags sqlite3" in
737
750
match read_lines_from_cmd ~max_lines: 1 cmd with
738
751
| [cflags] -> S (ocamlify ~ocaml_flag: " -ccopt" cflags)
739
752
| _ -> failwith " pkg-config failed for cflags"
740
753
in
741
754
let sqlite3_clibs, osqlite3_clibs =
742
- let cmd = " pkg-config --libs sqlite3" in
755
+ let cmd = pkg_export ^ " pkg-config --libs sqlite3" in
743
756
match read_lines_from_cmd ~max_lines: 1 cmd with
744
757
| [libs] ->
745
758
S (split_flags libs), S (ocamlify ~ocaml_flag: " -cclib" libs)
Original file line number Diff line number Diff line change 1
1
(* setup.ml generated for the first time by OASIS v0.3.0 *)
2
2
3
3
(* OASIS_START *)
4
- (* DO NOT EDIT (digest: 1b6fe2a99f7d4b7e0a8fcaf32a49dc1a ) *)
4
+ (* DO NOT EDIT (digest: e68c0022204b3b21947672e8387508b1 ) *)
5
5
(*
6
6
Regenerated by OASIS v0.4.5
7
7
Visit http://oasis.forge.ocamlcore.org for more information and
@@ -7062,6 +7062,17 @@ let setup_t =
7062
7062
flag_description = Some " Strict compile-time checks" ;
7063
7063
flag_default = [(OASISExpr. EBool true , true )]
7064
7064
});
7065
+ Flag
7066
+ ({
7067
+ cs_name = " brewcheck" ;
7068
+ cs_data = PropList.Data. create () ;
7069
+ cs_plugin_data = []
7070
+ },
7071
+ {
7072
+ flag_description =
7073
+ Some " Try to check against a homebrewed sqlite3" ;
7074
+ flag_default = [(OASISExpr. EBool true , false )]
7075
+ });
7065
7076
Library
7066
7077
({
7067
7078
cs_name = " sqlite3" ;
@@ -7512,14 +7523,14 @@ let setup_t =
7512
7523
};
7513
7524
oasis_fn = Some " _oasis" ;
7514
7525
oasis_version = " 0.4.5" ;
7515
- oasis_digest = Some " Ý7ö \022\139 Kuâeùû_¥Ó \019 ? " ;
7526
+ oasis_digest = Some " \t f \154\159 ÒØ ;²Õv \150\148\021 . \014 " ;
7516
7527
oasis_exec = None ;
7517
7528
oasis_setup_args = [] ;
7518
7529
setup_update = false
7519
7530
};;
7520
7531
7521
7532
let setup () = BaseSetup. setup setup_t;;
7522
7533
7523
- # 7524 " setup.ml"
7534
+ # 7535 " setup.ml"
7524
7535
(* OASIS_STOP *)
7525
7536
let () = setup () ;;
You can’t perform that action at this time.
0 commit comments