[gnus git] branch master updated: n0-15-44-gdd2c57d =1= * Makefile.in (lick-fail-on-warning): New rule to compile with warnings as errors. (fail-on-warning): Use it.
David Engster <[email protected]>
| Newsgroups | gmane.emacs.gnus.cvs |
|---|---|
| Message-ID | <[email protected]> |
via dd2c57ddd13e84e2909950f05092fbc76515a57c (commit)
from 3921b6be350597edd0d796deefc5174850da768f (commit)
- Log -----------------------------------------------------------------
commit dd2c57ddd13e84e2909950f05092fbc76515a57c
Author: David Engster <[email protected]>
Date: Wed Apr 6 17:52:53 2011 +0200
* Makefile.in (lick-fail-on-warning): New rule to compile with warnings
as errors.
(fail-on-warning): Use it.
* lisp/Makefile.in (fail-on-warning): New rule to compile with warnings as
errors.
* dgnushack.el (dgnushack-compile-error-on-warn): New function to call
dgnushack-compile with error-on-warn enabled, and to signal an error if
clean compilation failed.
(dgnushack-compile): New argument 'error-on-warn'. If non-nil, compile
with `byte-compile-error-on-warn'. Return nil if errors occured.
diff --git a/ChangeLog b/ChangeLog
index 15bedb2..a0ac18a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-04-06 David Engster <[email protected]>
+
+ * Makefile.in (lick-fail-on-warning): New rule to compile with warnings
+ as errors.
+ (fail-on-warning): Use it.
+
2011-03-17 Lars Magne Ingebrigtsen <[email protected]>
* Makefile.in (warn): Add a dummy "warn" target.
diff --git a/Makefile.in b/Makefile.in
index 83d7bfb..b0d335a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -44,11 +44,14 @@ COMMIT_STRING = $(CODENAME)Gnus v$(VERSION) is released.
all: lick info
-fail-on-warning: all
+fail-on-warning: lick-fail-on-warning info
lick:
cd lisp && $(MAKE) EMACS="$(EMACS)" lispdir="$(lispdir)" all
+lick-fail-on-warning:
+ cd lisp && $(MAKE) EMACS="$(EMACS)" lispdir="$(lispdir)" fail-on-warning
+
install:
cd lisp && $(MAKE) EMACS="$(EMACS)" lispdir="$(lispdir)" install
cd texi && $(MAKE) EMACS="$(EMACS)" install
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c6566df..480969b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
+2011-04-06 David Engster <[email protected]>
+
+ * Makefile.in (fail-on-warning): New rule to compile with warnings as
+ errors.
+
+ * dgnushack.el (dgnushack-compile-error-on-warn): New function to call
+ dgnushack-compile with error-on-warn enabled, and to signal an error if
+ clean compilation failed.
+ (dgnushack-compile): New argument 'error-on-warn'. If non-nil, compile
+ with `byte-compile-error-on-warn'. Return nil if errors occured.
+
2011-04-06 Teodor Zlatanov <[email protected]>
* gnus-registry.el: Don't use ERT if it's not available. Load it
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 97b5cc2..3d6f7f5 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -25,6 +25,9 @@ clean-some:
warn: clean-some gnus-load.el
$(EMACS_COMP) --eval '(dgnushack-compile t)' 2>&1 | egrep -v "variable G|inhibit-point-motion-hooks|coding-system|temp-results|variable gnus|variable nn|scroll-in-place|deactivate-mark|filladapt-mode|byte-code-function-p|print-quoted|ps-right-header|ps-left-header|article-inhibit|print-escape|ssl-program-arguments|message-log-max"
+fail-on-warning: clean-some gnus-load.el
+ $(EMACS_COMP) -f dgnushack-compile-error-on-warn
+
# The "clever" rule is unsafe, since redefined macros are loaded from
# .elc files, and not the .el file.
clever some l: gnus-load.el
diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el
index d758100..ee14ff2 100644
--- a/lisp/dgnushack.el
+++ b/lisp/dgnushack.el
@@ -272,12 +272,19 @@ dgnushack-compile-verbosely. All other users should continue to use
dgnushack-compile."
(dgnushack-compile t))
-(defun dgnushack-compile (&optional warn)
+(defun dgnushack-compile-error-on-warn ()
+ "Call dgnushack-compile with minimal warnings, but with error-on-warn ENABLED.
+This means that every warning will be reported as an error."
+ (unless (dgnushack-compile nil t)
+ (error "Error during byte compilation (warnings were reported as errors!).")))
+
+(defun dgnushack-compile (&optional warn error-on-warn)
;;(setq byte-compile-dynamic t)
(unless warn
(setq byte-compile-warnings
'(free-vars unresolved callargs redefine suspicious)))
(let ((files (directory-files srcdir nil "^[^=].*\\.el$"))
+ (compilesuccess t)
;;(byte-compile-generate-call-tree t)
file elc)
;; Avoid barfing (from gnus-xmas) because the etc directory is not yet
@@ -330,8 +337,14 @@ dgnushack-compile."
(when (or (not (file-exists-p
(setq elc (concat (file-name-nondirectory file) "c"))))
(file-newer-than-file-p file elc))
+ (if error-on-warn
+ (let ((byte-compile-error-on-warn t))
+ (unless (ignore-errors
+ (byte-compile-file file))
+ (setq compilesuccess nil)))
(ignore-errors
- (byte-compile-file file))))))
+ (byte-compile-file file)))))
+ compilesuccess))
(defun dgnushack-recompile ()
(require 'gnus)
-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.
Summary of changes:
ChangeLog | 6 ++++++
Makefile.in | 5 ++++-
lisp/ChangeLog | 11 +++++++++++
lisp/Makefile.in | 3 +++
lisp/dgnushack.el | 19 ++++++++++++++++---
5 files changed, 40 insertions(+), 4 deletions(-)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".
The branch, master has been updated
hooks/post-receive
--
Gnus Project