1995-08-09 08:06:35 -07:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Objective Caml */
|
1995-08-09 08:06:35 -07:00
|
|
|
/* */
|
|
|
|
/* Xavier Leroy and Damien Doligez, INRIA Rocquencourt */
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Copyright 1996 Institut National de Recherche en Informatique et */
|
1999-11-17 10:59:06 -08:00
|
|
|
/* en Automatique. All rights reserved. This file is distributed */
|
2001-12-07 05:41:02 -08:00
|
|
|
/* under the terms of the GNU Library General Public License, with */
|
|
|
|
/* the special exception on linking described in file ../LICENSE. */
|
1995-08-09 08:06:35 -07:00
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2000-01-07 08:05:19 -08:00
|
|
|
/* Main entry point (can be overridden by a user-provided main()
|
1999-11-29 11:03:08 -08:00
|
|
|
function that calls caml_main() later). */
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
#include "misc.h"
|
1996-10-07 06:20:13 -07:00
|
|
|
#include "mlvalues.h"
|
|
|
|
#include "sys.h"
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
CAMLextern void caml_main (char **);
|
1996-11-02 10:00:46 -08:00
|
|
|
|
1996-09-06 09:51:56 -07:00
|
|
|
#ifdef _WIN32
|
2004-01-01 08:42:43 -08:00
|
|
|
CAMLextern void caml_expand_command_line (int *, char ***);
|
1996-09-06 09:51:56 -07:00
|
|
|
#endif
|
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
int main(int argc, char **argv)
|
1995-05-04 03:15:53 -07:00
|
|
|
{
|
2008-02-29 04:56:15 -08:00
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
|
|
|
char *ocp;
|
|
|
|
char *cp;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
caml_gc_message (-1, "### OCaml runtime: debug mode ###\n", 0);
|
|
|
|
#if 0
|
|
|
|
caml_gc_message (-1, "### command line:", 0);
|
|
|
|
for (i = 0; i < argc; i++){
|
|
|
|
caml_gc_message (-1, " %s", argv[i]);
|
|
|
|
}
|
|
|
|
caml_gc_message (-1, "\n", 0);
|
|
|
|
ocp = getenv ("OCAMLRUNPARAM");
|
|
|
|
caml_gc_message (-1, "### OCAMLRUNPARAM=%s\n", ocp == NULL ? "" : ocp);
|
|
|
|
cp = getenv ("CAMLRUNPARAM");
|
|
|
|
caml_gc_message (-1, "### CAMLRUNPARAM=%s\n", cp == NULL ? "" : cp);
|
|
|
|
caml_gc_message (-1, "### working dir: %s\n", getcwd (NULL, 0));
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#endif
|
1996-09-06 09:51:56 -07:00
|
|
|
#ifdef _WIN32
|
2001-10-30 01:20:48 -08:00
|
|
|
/* Expand wildcards and diversions in command line */
|
2004-01-01 08:42:43 -08:00
|
|
|
caml_expand_command_line(&argc, &argv);
|
1996-11-02 10:00:46 -08:00
|
|
|
#endif
|
1996-11-07 02:57:59 -08:00
|
|
|
caml_main(argv);
|
2003-12-15 10:37:24 -08:00
|
|
|
caml_sys_exit(Val_int(0));
|
1996-10-07 06:20:13 -07:00
|
|
|
return 0; /* not reached */
|
1995-05-04 03:15:53 -07:00
|
|
|
}
|