~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to byterun/startup.c

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-05-25 07:40:01 UTC
  • mfrom: (12.1.15 sid)
  • Revision ID: james.westby@ubuntu.com-20110525074001-cxo449ibv0fkjlho
* Provide a way to use legacy custom linking (Closes: #627761)
* Document Debian-specific -custom behaviour in README.Debian
* Properly initialize executable name in caml_startup_code
  (Closes: #627756)

Show diffs side-by-side

added added

removed removed

Lines of Context:
443
443
{
444
444
  value res;
445
445
  char* cds_file;
 
446
  char * exe_name;
 
447
#ifdef __linux__
 
448
  static char proc_self_exe[256];
 
449
#endif
446
450
 
447
451
  caml_init_ieee_floats();
448
452
  caml_init_custom_operations();
455
459
    strcpy(caml_cds_file, cds_file);
456
460
  }
457
461
  parse_camlrunparam();
 
462
  exe_name = argv[0];
 
463
#ifdef __linux__
 
464
  if (caml_executable_name(proc_self_exe, sizeof(proc_self_exe)) == 0)
 
465
    exe_name = proc_self_exe;
 
466
#endif
458
467
  caml_external_raise = NULL;
459
468
  /* Initialize the abstract machine */
460
469
  caml_init_gc (minor_heap_init, heap_size_init, heap_chunk_init,
489
498
  caml_section_table_size = section_table_size;
490
499
  /* Initialize system libraries */
491
500
  caml_init_exceptions();
492
 
  caml_sys_init("", argv);
 
501
  caml_sys_init(exe_name, argv);
493
502
  /* Execute the program */
494
503
  caml_debugger(PROGRAM_START);
495
504
  res = caml_interprete(caml_start_code, caml_code_size);