Skip to content

Commit

Permalink
[fix] build/myocamlbuild_prefix.ml and libbase/mliconv.c: Fix the bui…
Browse files Browse the repository at this point in the history
…ld on FreeBSD with libiconv.
  • Loading branch information
Jeremy Messenger authored and Jeremy Messenger committed Jun 12, 2012
1 parent af6c538 commit 62907d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion build/myocamlbuild_prefix.ml
Original file line number Diff line number Diff line change
Expand Up @@ -549,9 +549,14 @@ let _ = dispatch begin function
flag ["ocaml"; "native"; "link"; tag] (S[A"-ccopt";A("-L"^dir);A"-cclib";A("-l"^name)]);
in

(* In the memory.c in FreeBSD part that uses kvm_getprocs() required link with -lkvm. *)
if is_fbsd then
(* In the memory.c in FreeBSD part that uses kvm_getprocs() required
link with -lkvm. *)
flag ["use_stubs"; "link"] (S[A "-cclib";A "-lkvm"]);
(* Build with converters/libiconv port, which it installs in the
/usr/local by default *)
flag ["iconv"; "compile"] (S[A"-I";A "/usr/local/include"]);
flag ["iconv"; "link"] (S[A"-ccopt";A "-L/usr/local/lib";A "-cclib";A "-liconv"]);

(* -- Don't forget that the rest of the "mlstate build stdlib" is in --
-- myocamlbuild_suffix.ml. The rest comes from the build_rules*.ml in each repo -- *)
6 changes: 3 additions & 3 deletions libbase/mliconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ CAMLprim value mliconv_convert(value conv, value source)
CAMLparam2(conv, source);
CAMLlocal1(result);
struct mliconv_t *internal = mliconv_val(conv);
/* #if !defined(__APPLE__) */
/* const */
/* #endif */
#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__))
const
#endif
char *s = String_val(source);
size_t s_len = caml_string_length(source);
size_t d_len = s_len * 6;
Expand Down

0 comments on commit 62907d8

Please sign in to comment.