1 /***********************************************************************/
5 /* Xavier Leroy and Damien Doligez, INRIA Rocquencourt */
7 /* Copyright 1996 Institut National de Recherche en Informatique et */
8 /* en Automatique. All rights reserved. This file is distributed */
9 /* under the terms of the GNU Library General Public License, with */
10 /* the special exception on linking described in file ../LICENSE. */
12 /***********************************************************************/
16 /* Main entry point (can be overridden by a user-provided main()
17 function that calls caml_main() later). */
23 CAMLextern
void caml_main (char **);
26 CAMLextern
void caml_expand_command_line (int *, char ***);
29 int main(int argc
, char **argv
)
37 caml_gc_message (-1, "### OCaml runtime: debug mode ###\n", 0);
39 caml_gc_message (-1, "### command line:", 0);
40 for (i
= 0; i
< argc
; i
++){
41 caml_gc_message (-1, " %s", argv
[i
]);
43 caml_gc_message (-1, "\n", 0);
44 ocp
= getenv ("OCAMLRUNPARAM");
45 caml_gc_message (-1, "### OCAMLRUNPARAM=%s\n", ocp
== NULL
? "" : ocp
);
46 cp
= getenv ("CAMLRUNPARAM");
47 caml_gc_message (-1, "### CAMLRUNPARAM=%s\n", cp
== NULL
? "" : cp
);
48 caml_gc_message (-1, "### working dir: %s\n", getcwd (NULL
, 0));
53 /* Expand wildcards and diversions in command line */
54 caml_expand_command_line(&argc
, &argv
);
57 caml_sys_exit(Val_int(0));
58 return 0; /* not reached */