1057 |
with e -> lprintf_nl () "Exception %s while options backup" (Printexc2.to_string e); raise e |
with e -> lprintf_nl () "Exception %s while options backup" (Printexc2.to_string e); raise e |
1058 |
end; |
end; |
1059 |
lprintf_nl () "Options backup as %s correctly saved" format |
lprintf_nl () "Options backup as %s correctly saved" format |
1060 |
|
|
1061 |
|
let buildinfo () = |
1062 |
|
( |
1063 |
|
"MLNet Multi-Network p2p client version " ^ Autoconf.current_version |
1064 |
|
^ (if Autoconf.scm_version <> "" then "\nSCM version info: " ^ Autoconf.scm_version else "") |
1065 |
|
^ "\nNetworks: " ^ !networks_string |
1066 |
|
^ "\nOcaml version: " ^ Autoconf.ocaml_version |
1067 |
|
^ "\nBuild on: " ^ Autoconf.build_system |
1068 |
|
^ (if Autoconf.glibc_version <> "" then " with glibc " ^ Autoconf.glibc_version else "") |
1069 |
|
^ (let real_glibc_version = MlUnix.glibc_version_num () in |
1070 |
|
if real_glibc_version <> Autoconf.glibc_version |
1071 |
|
&& real_glibc_version <> "" then |
1072 |
|
Printf.sprintf " (DANGER: glibc %s present on system)" real_glibc_version else "") |
1073 |
|
^ (if Autoconf.configure_arguments <> "" then "\nConfigure arguments: " ^ Autoconf.configure_arguments else "") |
1074 |
|
^ (if !patches_string <> "" then "\n" ^ !patches_string else "") |
1075 |
|
^ "\nFeatures:" |
1076 |
|
^ (if BasicSocket.has_threads () then " threads" else " no-threads") |
1077 |
|
^ (if Autoconf.has_zlib then |
1078 |
|
begin |
1079 |
|
let s = Zlib.zlib_version_num () in |
1080 |
|
Printf.sprintf " zlib%s" (if s <> "" then "-" ^ s else "") |
1081 |
|
end |
1082 |
|
else " no-zlib") |
1083 |
|
^ (if Autoconf.has_bzip2 then |
1084 |
|
begin |
1085 |
|
let s = |
1086 |
|
(* catch the exception in the case Bzip2.bzlib_version_num returns an empty string *) |
1087 |
|
try |
1088 |
|
List.hd(String2.split_simplify |
1089 |
|
(Bzip2.bzlib_version_num ()) ',') |
1090 |
|
with e -> "" |
1091 |
|
in |
1092 |
|
Printf.sprintf " bzip2%s" (if s <> "" then "-" ^ s else "") |
1093 |
|
end |
1094 |
|
else " no-bzip2") |
1095 |
|
^ (if Autoconf.has_gd && Autoconf.has_gd_png && Autoconf.has_gd_jpg then |
1096 |
|
Printf.sprintf " gd(jpg/png%s)" |
1097 |
|
(let s = CommonGraphics.png_version_num () in |
1098 |
|
if s <> "" then "-" ^ s else "") |
1099 |
|
else "") |
1100 |
|
^ (if Autoconf.has_gd && Autoconf.has_gd_png && not Autoconf.has_gd_jpg then |
1101 |
|
Printf.sprintf " gd(png%s)" |
1102 |
|
(let s = CommonGraphics.png_version_num () in |
1103 |
|
if s <> "" then "-" ^ s else "") |
1104 |
|
else "") |
1105 |
|
^ (if Autoconf.has_gd && not Autoconf.has_gd_png && Autoconf.has_gd_jpg then " gd(jpg)" else "") |
1106 |
|
^ (if not Autoconf.has_gd then " no-gd" else "") |
1107 |
|
^ (if Autoconf.has_iconv then " iconv" else " no-iconv") |
1108 |
|
^ (if Autoconf.check_bounds then " check-bounds" else " no-check-bounds") |
1109 |
|
^ " " ^ Autoconf.sha1_version |
1110 |
|
^ "\nLanguage: " ^ Charset.default_language |
1111 |
|
^ " - locale: " ^ Charset.locstr |
1112 |
|
^ "\n max_string_length: " ^ string_of_int Sys.max_string_length |
1113 |
|
^ " - word_size: " ^ string_of_int Sys.word_size |
1114 |
|
^ " - max_array_length: " ^ string_of_int Sys.max_array_length |
1115 |
|
^ "\n max file descriptors: " ^ string_of_int (Unix2.c_getdtablesize ()) |
1116 |
|
^ " - max useable file size: " ^ |
1117 |
|
(match Unix2.c_sizeofoff_t () with |
1118 |
|
| 4 -> "2GB" |
1119 |
|
|
1120 |
|
| _ -> Printf.sprintf "2^%d-1 bits (do the maths ;-p)" ((Unix2.c_sizeofoff_t () *8)-1) |
1121 |
|
|
1122 |
|
(* |
1123 |
|
| _ -> Printf.sprintf "%s" |
1124 |
|
((*size_of_int64*)(string_of_float(((2. ** (float_of_int((Unix2.c_sizeofoff_t () * 8)-1))) -. 1.)/. 8.))) |
1125 |
|
*) |
1126 |
|
|
1127 |
|
)) |