-;If you want additional libraries to be preloaded and their
-;doc strings kept in the DOC file rather than in core,
-;you may load them with a "site-load.el" file.
-;But you must also cause them to be scanned when the DOC file
-;is generated.
-;For other systems, you must edit ../src/Makefile.in.
-(load "site-load" t)
+;; This file doesn't exist when building a development version of Emacs
+;; from the repository. It is generated just after temacs is built.
+(load "leim/leim-list.el" t)
+
+;; If you want additional libraries to be preloaded and their
+;; doc strings kept in the DOC file rather than in core,
+;; you may load them with a "site-load.el" file.
+;; But you must also cause them to be scanned when the DOC file
+;; is generated.
+(let ((lp load-path))
+ (load "site-load" t)
+ ;; We reset load-path after dumping.
+ ;; For a permanent change in load-path, use configure's
+ ;; --enable-locallisppath option.
+ ;; See http://debbugs.gnu.org/16107 for more details.
+ (or (equal lp load-path)
+ (message "Warning: Change in load-path due to site-load will be \
+lost after dumping")))
+
+;; Make sure default-directory is unibyte when dumping. This is
+;; because we cannot decode and encode it correctly (since the locale
+;; environment is not, and should not be, set up). default-directory
+;; is used every time we call expand-file-name, which we do in every
+;; file primitive. So the only workable solution to support building
+;; in non-ASCII directories is to manipulate unibyte strings in the
+;; current locale's encoding.
+(if (and (or (equal (nth 3 command-line-args) "dump")
+ (equal (nth 4 command-line-args) "dump")
+ (equal (nth 3 command-line-args) "bootstrap")
+ (equal (nth 4 command-line-args) "bootstrap"))
+ (multibyte-string-p default-directory))
+ (error "default-directory must be unibyte when dumping Emacs!"))