/* Set `invocation-name' `invocation-directory'. */
-void
+static void
set_invocation_vars (char *argv0, char const *original_pwd)
{
- /* This function can be called from within pdumper or later during
- boot. No need to run it twice. */
- static bool double_run_guard;
- if (double_run_guard)
- return;
- double_run_guard = true;
-
Lisp_Object raw_name, handler;
AUTO_STRING (slash_colon, "/:");
}
}
+/* Initialize a number of variables (ultimately
+ 'Vinvocation_directory') needed by pdumper to complete native code
+ load. */
+
+void
+init_vars_for_load (char *argv0, char const *original_pwd)
+{
+ /* This function is called from within pdumper while loading (as
+ soon as we are able to allocate) or later during boot if pdumper
+ is not used. No need to run it twice. */
+ static bool double_run_guard;
+ if (double_run_guard)
+ return;
+ double_run_guard = true;
+
+ init_callproc_1 (); /* Must precede init_cmdargs and init_sys_modes. */
+ set_invocation_vars (argv0, original_pwd);
+}
+
\f
/* Code for dealing with Lisp access to the Unix command line. */
static void
initial_argv = argv;
initial_argc = argc;
- set_invocation_vars (argv[0], original_pwd);
-
Vinstallation_directory = Qnil;
if (!NILP (Vinvocation_directory))
/* Init buffer storage and default directory of main buffer. */
init_buffer ();
- init_callproc_1 (); /* Must precede init_cmdargs and init_sys_modes. */
+ init_vars_for_load (argv[0], original_pwd);
/* Must precede init_lread. */
init_cmdargs (argc, argv, skip_args, original_pwd);
extern Lisp_Object decode_env_path (const char *, const char *, bool);
extern Lisp_Object empty_unibyte_string, empty_multibyte_string;
extern AVOID terminate_due_to_signal (int, int);
-extern void set_invocation_vars (char *argv0, char const *original_pwd);
+extern void init_vars_for_load (char *, char const *);
#ifdef WINDOWSNT
extern Lisp_Object Vlibrary_cache;
#endif
/* Once we can allocate and before loading .eln files we must set
Vinvocation_directory (.eln paths are relative to it). */
- set_invocation_vars (argv0, original_pwd);
+ init_vars_for_load (argv0, original_pwd);
+
dump_do_all_dump_reloc_for_phase (header, dump_base, LATE_RELOCS);
dump_do_all_dump_reloc_for_phase (header, dump_base, VERY_LATE_RELOCS);
initialized = true;