From 22d2cf0e896458143b271f75e204f5b4001d8f23 Mon Sep 17 00:00:00 2001 From: bg66 Date: Mon, 26 Mar 2007 05:06:59 +0000 Subject: [PATCH] * COMPILE.in: Rename from `COMPILE'. (mixi-modules): New variable. (mixi-compile): Use it. (mixi-install): Ditto. (mixi-compile-package): Ditto. (mixi-install-package): Ditto. (mixi-compile-modules): Follow the change above. (mixi-install-modules): Ditto. * .cvsignore: Add COMPILE. * acinclude.m4 (AC_EXAMINE_MODULES): New function. (AC_CHECK_SHIMBUN): Don't use AC_SUBST. (AC_CHECK_GNUS): Ditto. (AC_CHECK_WL): Ditto. (AC_CHECK_RIECE): Ditto. * configure.ac: Use AC_EXAMINE_MODULES. (HAVE_SHIMBUN): Abolish. (HAVE_GNUS): Ditto. (HAVE_WL): Ditto. (HAVE_RIECE): Ditto. (AC_CONFIG_FILES): Add COMPILE. * Makefile.am (MODULES_MIXI): Abolish. (MODULES_SHIMBUN): Ditto. (MODULES_GNUS): Ditto. (MODULES_WL): Ditto. (MODULES_RIECE): Ditto. (MODULES): Ditto. (DISTCLEANFILES): New variable. (EXTRA_DIST): Follow the change above. (elc): Ditto. (install): Ditto. (package): Ditto. (install-package): Ditto. --- .cvsignore | 1 + COMPILE | 77 --------------------------------------------------------- COMPILE.in | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ChangeLog | 35 ++++++++++++++++++++++++++ Makefile.am | 37 +++++----------------------- acinclude.m4 | 31 ++++++++++++++++++++--- configure.ac | 7 ++---- 7 files changed, 149 insertions(+), 117 deletions(-) delete mode 100644 COMPILE create mode 100644 COMPILE.in diff --git a/.cvsignore b/.cvsignore index e742c1f..4529f65 100644 --- a/.cvsignore +++ b/.cvsignore @@ -11,3 +11,4 @@ config.status config.cache COPYING INSTALL +COMPILE diff --git a/COMPILE b/COMPILE deleted file mode 100644 index 38e3db9..0000000 --- a/COMPILE +++ /dev/null @@ -1,77 +0,0 @@ -;;; -*- Emacs-Lisp -*- - -(defun mixi-compile-modules (modules) - (let ((load-path (cons nil load-path)) - error-modules) - (while modules - (let ((source (expand-file-name (car modules)))) - (if (file-newer-than-file-p source (concat source "c")) - (condition-case error - (byte-compile-file source) - (error - (setq error-modules (cons (car modules) error-modules)))))) - (setq modules (cdr modules))) - (if error-modules - (princ (concat "\n\ - WARNING: --------------------------------------------------------- - WARNING: Couldn't compile following modules: - WARNING: - WARNING: " (mapconcat #'identity error-modules ", ") "\n\ - WARNING: - WARNING: You should probably stop here, try \"make distclean\" to clear - WARNING: the last build, and then reconfigure. - WARNING: ---------------------------------------------------------\n\n"))))) - -(defun mixi-install-modules (modules dest just-print) - (unless (or just-print (file-exists-p dest)) - (make-directory dest t)) - (while modules - (let ((name (car modules))) - (princ (format "%s -> %s\n" name dest)) - (unless just-print - (copy-file (expand-file-name name) - (expand-file-name name dest) - t t)) - (princ (format "%sc -> %s\n" name dest)) - (unless just-print - (if (file-exists-p (expand-file-name (concat name "c"))) - (copy-file (expand-file-name (concat name "c")) - (expand-file-name (concat name "c") dest) - t t) - (princ (format "(%s was not successfully compiled, ignored)\n" - name))))) - (setq modules (cdr modules)))) - -(defun mixi-install-just-print-p () - (let ((flag (getenv "MAKEFLAGS")) - case-fold-search) - (if flag - (string-match "^\\(\\(--[^ ]+ \\)+-\\|[^ =-]\\)*n" flag)))) - -(defun mixi-compile () - (mixi-compile-modules command-line-args-left)) - -(defun mixi-install () - (mixi-install-modules - (cdr command-line-args-left) - (expand-file-name "mixi" (car command-line-args-left)) - (mixi-install-just-print-p))) - -(defun mixi-compile-package () - (let ((modules (cdr command-line-args-left)) - command-line-args-left) - (setq autoload-package-name "mixi") - (add-to-list 'command-line-args-left ".") - (batch-update-directory) - (add-to-list 'command-line-args-left ".") - (Custom-make-dependencies) - (mixi-compile-modules - (append modules - '("auto-autoloads.el" "custom-load.el"))))) - -(defun mixi-install-package () - (mixi-install-modules - (append (cdr command-line-args-left) - '("auto-autoloads.el" "custom-load.el")) - (expand-file-name "lisp/mixi" (car command-line-args-left)) - (mixi-install-just-print-p))) diff --git a/COMPILE.in b/COMPILE.in new file mode 100644 index 0000000..27179a8 --- /dev/null +++ b/COMPILE.in @@ -0,0 +1,78 @@ +;;; -*- Emacs-Lisp -*- + +(defvar mixi-modules + '(@MODULES@)) + +(defun mixi-compile-modules (modules) + (let ((load-path (cons nil load-path)) + error-modules) + (while modules + (let ((source (expand-file-name (symbol-name (car modules))))) + (if (file-newer-than-file-p source (concat source "c")) + (condition-case error + (byte-compile-file source) + (error + (setq error-modules (cons (car modules) error-modules)))))) + (setq modules (cdr modules))) + (if error-modules + (princ (concat "\n\ + WARNING: --------------------------------------------------------- + WARNING: Couldn't compile following modules: + WARNING: + WARNING: " (mapconcat #'symbol-name error-modules ", ") "\n\ + WARNING: + WARNING: You should probably stop here, try \"make distclean\" to clear + WARNING: the last build, and then reconfigure. + WARNING: ---------------------------------------------------------\n\n"))))) + +(defun mixi-install-modules (modules dest just-print) + (unless (or just-print (file-exists-p dest)) + (make-directory dest t)) + (while modules + (let ((name (symbol-name (car modules)))) + (princ (format "%s -> %s\n" name dest)) + (unless just-print + (copy-file (expand-file-name name) + (expand-file-name name dest) + t t)) + (princ (format "%sc -> %s\n" name dest)) + (unless just-print + (if (file-exists-p (expand-file-name (concat name "c"))) + (copy-file (expand-file-name (concat name "c")) + (expand-file-name (concat name "c") dest) + t t) + (princ (format "(%s was not successfully compiled, ignored)\n" + name))))) + (setq modules (cdr modules)))) + +(defun mixi-install-just-print-p () + (let ((flag (getenv "MAKEFLAGS")) + case-fold-search) + (if flag + (string-match "^\\(\\(--[^ ]+ \\)+-\\|[^ =-]\\)*n" flag)))) + +(defun mixi-compile () + (mixi-compile-modules mixi-modules)) + +(defun mixi-install () + (mixi-install-modules + mixi-modules + (expand-file-name "mixi" (car command-line-args-left)) + (mixi-install-just-print-p))) + +(defun mixi-compile-package () + (setq autoload-package-name "mixi") + (add-to-list 'command-line-args-left ".") + (batch-update-directory) + (add-to-list 'command-line-args-left ".") + (Custom-make-dependencies) + (mixi-compile-modules + (append mixi-modules + '(auto-autoloads.el custom-load.el)))) + +(defun mixi-install-package () + (mixi-install-modules + (append mixi-modules + '(auto-autoloads.el custom-load.el)) + (expand-file-name "lisp/mixi" (car command-line-args-left)) + (mixi-install-just-print-p))) diff --git a/ChangeLog b/ChangeLog index 2588c4f..82bfef7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,38 @@ +2007-03-26 OHASHI Akira + + * COMPILE.in: Rename from `COMPILE'. + (mixi-modules): New variable. + (mixi-compile): Use it. + (mixi-install): Ditto. + (mixi-compile-package): Ditto. + (mixi-install-package): Ditto. + (mixi-compile-modules): Follow the change above. + (mixi-install-modules): Ditto. + * .cvsignore: Add COMPILE. + * acinclude.m4 (AC_EXAMINE_MODULES): New function. + (AC_CHECK_SHIMBUN): Don't use AC_SUBST. + (AC_CHECK_GNUS): Ditto. + (AC_CHECK_WL): Ditto. + (AC_CHECK_RIECE): Ditto. + * configure.ac: Use AC_EXAMINE_MODULES. + (HAVE_SHIMBUN): Abolish. + (HAVE_GNUS): Ditto. + (HAVE_WL): Ditto. + (HAVE_RIECE): Ditto. + (AC_CONFIG_FILES): Add COMPILE. + * Makefile.am (MODULES_MIXI): Abolish. + (MODULES_SHIMBUN): Ditto. + (MODULES_GNUS): Ditto. + (MODULES_WL): Ditto. + (MODULES_RIECE): Ditto. + (MODULES): Ditto. + (DISTCLEANFILES): New variable. + (EXTRA_DIST): Follow the change above. + (elc): Ditto. + (install): Ditto. + (package): Ditto. + (install-package): Ditto. + 2007-03-25 Hiroya Murata * sb-mixi.el (shimbun-mixi-default-group-alist): New constant; diff --git a/Makefile.am b/Makefile.am index f2dba83..79a5c61 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,46 +1,21 @@ -MODULES_MIXI = mixi.el mixi-utils.el mixi-atom.el mixi-ticker.el -MODULES_SHIMBUN = sb-mixi.el -MODULES_GNUS = mixi-gnus.el -MODULES_WL = mixi-wl.el -MODULES_RIECE = riece-mixi.el CONTRIB = contrib/atom.cgi contrib/atom.sh -EXTRA_DIST = INSTALL-CVS COMPILE ChangeLog $(MODULES_MIXI) $(MODULES_SHIMBUN) \ - $(MODULES_GNUS) $(MODULES_WL) $(MODULES_RIECE) $(CONTRIB) +EXTRA_DIST = INSTALL-CVS ChangeLog @MODULES_ALL@ $(CONTRIB) CLEANFILES = auto-autoloads.el custom-load.el *.elc +DISTCLEANFILES = COMPILE AUTOMAKE_OPTIONS = no-dependencies FLAGS ?= -batch -q -no-site-file -MODULES = $(MODULES_MIXI) - -if HAVE_SHIMBUN -MODULES += $(MODULES_SHIMBUN) - -if HAVE_GNUS -MODULES += $(MODULES_GNUS) -endif - -if HAVE_WL -MODULES += $(MODULES_WL) -endif - -endif - -if HAVE_RIECE -MODULES += $(MODULES_RIECE) -endif - all: elc elc: - $(EMACS) $(FLAGS) -l COMPILE -f mixi-compile $(MODULES) + $(EMACS) $(FLAGS) -l COMPILE -f mixi-compile install: elc - $(EMACS) $(FLAGS) -l COMPILE -f mixi-install $(lispdir) $(MODULES) + $(EMACS) $(FLAGS) -l COMPILE -f mixi-install $(lispdir) package: - $(XEMACS) $(FLAGS) -l COMPILE -f mixi-compile-package $(MODULES) + $(XEMACS) $(FLAGS) -l COMPILE -f mixi-compile-package install-package: package - $(XEMACS) $(FLAGS) -l COMPILE -f mixi-install-package $(PACKAGEDIR) \ - $(MODULES) + $(XEMACS) $(FLAGS) -l COMPILE -f mixi-install-package $(PACKAGEDIR) diff --git a/acinclude.m4 b/acinclude.m4 index b31ccb8..92d09ee 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -125,7 +125,6 @@ AC_DEFUN([AC_CHECK_SHIMBUN], [ else HAVE_SHIMBUN=$withval fi], HAVE_SHIMBUN=yes) - AC_SUBST(HAVE_SHIMBUN) if test "${HAVE_SHIMBUN}" = yes; then AC_EMACS_LISP(shimbun_dir,(file-name-directory (locate-library \"shimbun\")),"noecho") @@ -157,7 +156,6 @@ AC_DEFUN([AC_CHECK_GNUS], [ else HAVE_GNUS=$withval fi], HAVE_GNUS=yes) - AC_SUBST(HAVE_GNUS) if test "${HAVE_GNUS}" = yes; then AC_EMACS_LISP(gnus_dir,(file-name-directory (locate-library \"gnus\")),"noecho") @@ -189,7 +187,6 @@ AC_DEFUN([AC_CHECK_WL], [ else HAVE_WL=$withval fi], HAVE_WL=yes) - AC_SUBST(HAVE_WL) if test "${HAVE_WL}" = yes; then AC_EMACS_LISP(wl_dir,(file-name-directory (locate-library \"wl\")),"noecho") @@ -221,7 +218,6 @@ AC_DEFUN([AC_CHECK_RIECE], [ else HAVE_RIECE=$withval fi], HAVE_RIECE=yes) - AC_SUBST(HAVE_RIECE) if test "${HAVE_RIECE}" = yes; then AC_EMACS_LISP(riece_dir,(file-name-directory (locate-library \"riece\")),"noecho") @@ -291,3 +287,30 @@ AC_DEFUN([AC_ADD_LOAD_PATH], ADDITIONAL_LOAD_PATH=) AC_SUBST(ADDITIONAL_LOAD_PATH)]) +AC_DEFUN([AC_EXAMINE_MODULES], + [dnl Examine install files. + + MODULES_MIXI="mixi.el mixi-utils.el mixi-atom.el mixi-ticker.el" + MODULES_SHIMBUN="sb-mixi.el" + MODULES_GNUS="mixi-gnus.el" + MODULES_WL="mixi-wl.el" + MODULES_RIECE="riece-mixi.el" + + MODULES=${MODULES_MIXI} + MODULES_ALL="${MODULES} ${MODULES_SHIMBUN} ${MODULES_GNUS} ${MODULES_WL} ${MODULES_RIECE}" + + if test ${HAVE_SHIMBUN} = yes; then + MODULES="${MODULES} ${MODULES_SHIMBUN}" + if test ${HAVE_GNUS} = yes; then + MODULES="${MODULES} ${MODULES_GNUS}" + fi + if test ${HAVE_WL} = yes; then + MODULES="${MODULES} ${MODULES_WL}" + fi + fi + if test ${HAVE_RIECE} = yes; then + MODULES="${MODULES} ${MODULES_RIECE}" + fi + + AC_SUBST(MODULES) + AC_SUBST(MODULES_ALL)]) diff --git a/configure.ac b/configure.ac index 814d408..0994fe6 100644 --- a/configure.ac +++ b/configure.ac @@ -12,10 +12,7 @@ AC_CHECK_GNUS AC_CHECK_WL AC_CHECK_RIECE -AM_CONDITIONAL(HAVE_SHIMBUN, test "${HAVE_SHIMBUN}" = yes) -AM_CONDITIONAL(HAVE_GNUS, test "${HAVE_GNUS}" = yes) -AM_CONDITIONAL(HAVE_WL, test "${HAVE_WL}" = yes) -AM_CONDITIONAL(HAVE_RIECE, test "${HAVE_RIECE}" = yes) +AC_EXAMINE_MODULES -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([Makefile COMPILE]) AC_OUTPUT -- 1.7.10.4