summaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorPhillip Lord <phillip.lord@russet.org.uk>2016-10-27 08:07:05 +0100
committerPhillip Lord <phillip.lord@russet.org.uk>2016-12-13 22:15:32 +0000
commitc27b645956a11fab1dd8fa189254d525390958f5 (patch)
treea32dc7bbc8758a5656b2be8f712614a9085592d6 /admin
parent9e6618becaa15b104f18d54371f35f065f430f81 (diff)
downloademacs-c27b645956a11fab1dd8fa189254d525390958f5.tar.gz
Replace ldefs-boot with a much smaller file
* Makefile.in (bootstrap-build,generate-ldefs-boot): New targets. (bootstrap): Depend on bootstrap-build. * admin/ldefs-clean.el: New file. * lisp/Makefile.in (compile-first): Depend on loaddefs.el * lisp/ldefs-boot.el: Remove. * lisp/ldefs-boot-auto.el: New file. * lisp/ldefs-boot-manual.el: New file. * lisp/loadup.el: Load ldefs-boot-manual.el. * src/emacs.c (generating_ldefs_boot): New variable. (main): Check whether we are generating ldefs. * src/eval.c (autoload-do-load): Dump autoload forms to stderr when requested. * src/lisp.h (generating_ldefs_boot): New variable. * admin/gitmerge.el, admin/make-tarball.txt, admin/notes/copyright, lisp/Makefile.in, lisp/cus-dep.el, lisp/emacs-lisp/elint.el, lisp/finder.el, lisp/loadup.el, msdos/mainmake.v2: Update reference to ldefs-boot. * admin/update_autogen: Alter mechanism for ldefs-boot generation.
Diffstat (limited to 'admin')
-rw-r--r--admin/gitmerge.el2
-rw-r--r--admin/ldefs-clean.el63
-rw-r--r--admin/make-tarball.txt4
-rw-r--r--admin/notes/copyright6
-rwxr-xr-xadmin/update_autogen19
5 files changed, 78 insertions, 16 deletions
diff --git a/admin/gitmerge.el b/admin/gitmerge.el
index d2cb1e8df03..ca2886370a1 100644
--- a/admin/gitmerge.el
+++ b/admin/gitmerge.el
@@ -292,7 +292,7 @@ Returns non-nil if conflicts remain."
))
;; Try to resolve the conflicts.
(cond
- ((member file '("configure" "lisp/ldefs-boot.el"
+ ((member file '("configure" "lisp/ldefs-boot-auto.el"
"lisp/emacs-lisp/cl-loaddefs.el"))
;; We are in the file's buffer, so names are relative.
(call-process "git" nil t nil "checkout" "--"
diff --git a/admin/ldefs-clean.el b/admin/ldefs-clean.el
new file mode 100644
index 00000000000..89c77a750e9
--- /dev/null
+++ b/admin/ldefs-clean.el
@@ -0,0 +1,63 @@
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file takes the output from the "generate-ldefs-boot" make
+;; target, takes the relevant autoload forms, removes everything else
+;; and adds some comments.
+
+(defun ldefs-clean-uniquify-region-lines (beg end)
+ "Remove duplicate adjacent lines in region."
+ (save-excursion
+ (goto-char beg)
+ (while (re-search-forward "^\\(.*\n\\)\\1+" end t)
+ (replace-match "\\1"))))
+
+(defun ldefs-clean-uniquify-buffer-lines ()
+ "Remove duplicate adjacent lines in the current buffer."
+ (interactive)
+ (ldefs-clean-uniquify-region-lines (point-min) (point-max)))
+
+(defun ldefs-clean-up ()
+ "Clean up output from build and turn it into ldefs-boot-auto.el."
+ (interactive)
+ (goto-char (point-max))
+ ;; We only need the autoloads up till loaddefs.el is
+ ;; generated. After this, ldefs-boot.el is not needed
+ (search-backward " GEN loaddefs.el")
+ (delete-region (point) (point-max))
+ (keep-lines "(autoload" (point-min) (point-max))
+ (sort-lines nil (point-min) (point-max))
+ (ldefs-clean-uniquify-buffer-lines)
+ (goto-char (point-min))
+ (insert
+ ";; This file is autogenerated by admin/ldefs-clean.el
+;; Do not edit
+")
+ (goto-char (point-max))
+ (insert
+ ";; Local Variables:
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; End:"))
+
+
+(defun ldefs-clean ()
+ (find-file "lisp/ldefs-boot-auto.temp")
+ (ldefs-clean-up)
+ (write-file "ldefs-boot-auto.el"))
diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt
index 77486cc6399..369d169cb9a 100644
--- a/admin/make-tarball.txt
+++ b/admin/make-tarball.txt
@@ -84,9 +84,7 @@ General steps (for each step, check for possible errors):
make -C etc/refcards
make -C etc/refcards clean
-5. Copy lisp/loaddefs.el to lisp/ldefs-boot.el.
-
- Commit ChangeLog.N, etc/AUTHORS, lisp/ldefs-boot.el, and the
+5. Commit ChangeLog.N, etc/AUTHORS, lisp/ldefs-boot.el, and the
files changed by M-x set-version.
If someone else made a commit between step 1 and now,
diff --git a/admin/notes/copyright b/admin/notes/copyright
index 2dc33c164a9..6cfc331914c 100644
--- a/admin/notes/copyright
+++ b/admin/notes/copyright
@@ -45,9 +45,9 @@ available.
The definition of triviality is a little vague, but a rule of thumb is
that any file with less than 15 lines of actual content is trivial. If
-a file is auto-generated (eg ldefs-boot.el) from another one in the
-repository, then it does not really matter about adding a copyright
-statement to the generated file.
+a file is auto-generated from another one in the repository, then it
+does not really matter about adding a copyright statement to the
+generated file.
Legal advice says that we could, if we wished, put a license notice
even in trivial files, because copyright law in general looks at the
diff --git a/admin/update_autogen b/admin/update_autogen
index f27bfe0d148..98be4ed8fe0 100755
--- a/admin/update_autogen
+++ b/admin/update_autogen
@@ -92,7 +92,7 @@ changelog_flag=
## Parameters.
ldefs_in=lisp/loaddefs.el
-ldefs_out=lisp/ldefs-boot.el
+ldefs_boot=lisp/ldefs-boot.el
changelog_n=$(sed -n 's/CHANGELOG_HISTORY_INDEX_MAX *= *//p' Makefile.in)
changelog_files="ChangeLog.$changelog_n"
sources="configure.ac lib/Makefile.am"
@@ -370,19 +370,12 @@ echo "Running lisp/ make..."
make -C lisp "$@" autoloads EMACS=../src/bootstrap-emacs || die "make src error"
-
-## Ignore comment differences.
-[ ! "$lboot_flag" ] || \
- diff -q -I '^;' $ldefs_in $ldefs_out || \
- cp $ldefs_in $ldefs_out || die "cp ldefs_boot error"
-
-
echo "Checking status of loaddef files..."
## It probably would be fine to just check+commit lisp/, since
## making autoloads should not effect any other files. But better
## safe than sorry.
-modified=$(status $genfiles $ldefs_out) || die
+modified=$(status $genfiles) || die
commit "loaddefs" $modified || die "commit error"
@@ -396,6 +389,14 @@ commit "loaddefs" $modified || die "commit error"
}
+
+## Regenerate ldefs-boot if we are told to
+[ ! "$lboot_flag" ] || {
+ make generate-ldefs-boot || die
+ modified=$(status $ldefs_boot) || die
+ commit $ldefs_boot $modified || die "commit error"
+}
+
exit 0
### update_autogen ends here