1 ;;; build-autoloads.el --- Guess what!
3 ;; Copyright (C) 2006 Sebastian Freundt
4 ;; Copyright (C) 2007 Steve Youngs
6 ;; Author: Sebastian Freundt <hroptatyr@sxemacs.org>
7 ;; Maintainer: SXEmacs Development Team
10 ;; This file is part of SXEmacs.
12 ;; SXEmacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; SXEmacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
25 ;;; Synched up with: Not in FSF.
29 ;; This file is only used during SXEmacs builds, it does what the
30 ;; name implies... builds the auto-autoloads.el files for lisp,
31 ;; lisp/mule, lisp/ffi, plus it generates the custom-load.el and
32 ;; custom-define.el files for same. Emodule autoloads are handled
37 (unless (fboundp #'error)
38 (load "loadup-el.el"))
41 (load "byte-optimize.el")
44 ;; lisp/term is missing, but it currently doesn't have any autoloads
46 (defvar autodirs '("."))
48 (when (featurep 'mule) (setq autodirs (cons "mule" autodirs)))
49 (when (fboundp #'ffi-defun) (setq autodirs (cons "ffi" autodirs)))
50 (setq autodirs (nreverse autodirs))
52 (defvar srcdir "../.sxemacs.source.tree/lisp/")
56 (let ((pname (if (string= dir ".") "auto" dir))
57 (adir (concat srcdir dir)))
58 (update-autoload-files adir pname (expand-file-name "auto-autoloads.el" dir) t)
59 (Custom-make-dependencies adir (expand-file-name "custom-load.el" dir))
60 (update-custom-define-files adir pname (expand-file-name "custom-defines.el" dir) t)
65 (defun find-emod-directories ()
66 (let* ((objdir "../modules/")
67 (files (directory-files-recur
70 (replace-in-string e "\\." ""))
74 :result-type #'concat module-extensions)
76 (dir-bloom (make-bloom))
80 (let ((d (car (last (split-string-by-char (file-dirname f) ?/) 2))))
81 (unless (bloom-owns-p dir-bloom d)
82 (bloom-add dir-bloom d)
83 (setq directories (cons d directories)))))
84 :result-type 'void files)
87 (when (featurep 'modules)
88 (let* ((modsrc "../.sxemacs.source.tree/modules/")
90 #'(lambda (d) (concat modsrc d))
91 :result-type #'list (find-emod-directories)))
93 (autofile (expand-file-name "auto-autoloads.el" "../modules/")))
94 (update-autoload-files mods feat autofile t)))
99 ;;; build-autoloads.el ends here