Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[contrib] merge: pull request #60 from 'jlmess77/fix_build_with_libic…

…onv'
  • Loading branch information...
commit 181e5dd3a0d7d43da2f3365123cd78f4fd64cf9e 2 parents 7abe88a + 62907d8
@Aqua-Ye Aqua-Ye authored
Showing with 9 additions and 4 deletions.
  1. +6 −1 build/myocamlbuild_prefix.ml
  2. +3 −3 libbase/mliconv.c
View
7 build/myocamlbuild_prefix.ml
@@ -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 -- *)
View
6 libbase/mliconv.c
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.