+#endif /* !CANNOT_DUMP */
+
+ return lpath;
+}
+
+void
+init_lread (void)
+{
+ /* First, set Vload_path. */
+
+ /* We explicitly ignore EMACSLOADPATH when dumping. */
+ if (NILP (Vpurify_flag) && egetenv ("EMACSLOADPATH"))
+ {
+ Vload_path = decode_env_path ("EMACSLOADPATH", 0, 1);
+
+ /* Check (non-nil) user-supplied elements. */
+ load_path_check (Vload_path);
+
+ /* Replace any nil elements from the environment with the default. */
+ if (Fmemq (Qnil, Vload_path))
+ {
+ Lisp_Object lpath = Vload_path;
+ Lisp_Object elem, default_lpath = load_path_default (1);
+
+ /* Check defaults, before adding site-lisp. */
+ load_path_check (default_lpath);
+
+ /* Add the site-lisp directories to the front of the default. */
+ if (!no_site_lisp)
+ {
+ Lisp_Object sitelisp;
+ sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0);
+ if (! NILP (sitelisp))
+ default_lpath = nconc2 (sitelisp, default_lpath);
+ }
+
+ Vload_path = Qnil;
+
+ /* Replace nils from EMACSLOADPATH by default. */
+ while (CONSP (lpath))
+ {
+ Lisp_Object arg[2];
+ elem = XCAR (lpath);
+ lpath = XCDR (lpath);
+ arg[0] = Vload_path;
+ arg[1] = NILP (elem) ? default_lpath : Fcons (elem, Qnil);
+ Vload_path = Fappend (2, arg);
+ }
+ } /* Fmemq (Qnil, Vload_path) */
+ }
+ else /* Vpurify_flag || !EMACSLOADPATH */
+ {
+ Vload_path = load_path_default (0);
+
+ /* Check before adding site-lisp directories.
+ The install should have created them, but they are not
+ required, so no need to warn if they are absent.
+ Or we might be running before installation. */
+ load_path_check (Vload_path);
+
+ /* Add the site-lisp directories at the front, unless the
+ load-path has somehow already been changed (this can only be
+ from a site-load file during dumping?) from the dumped value.
+ FIXME? Should we ignore any dump_path changes? */
+ if (initialized && !no_site_lisp &&
+ ! NILP (Fequal (dump_path, Vload_path)))
+ {
+ Lisp_Object sitelisp;
+ sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0);
+ if (! NILP (sitelisp)) Vload_path = nconc2 (sitelisp, Vload_path);
+ }
+ } /* !Vpurify_flag && EMACSLOADPATH */