summaryrefslogtreecommitdiff
blob: 85dbc0374e326042ac4384ea180de0964fce9157 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
Patch from upstream, backported to bbdb-3.1.2.

From e028f4d8f04c3db663db023cf5a630461cfda2bd Mon Sep 17 00:00:00 2001
From: Roland Winkler <winkler@gnu.org>
Date: Wed, 23 Jul 2014 03:27:09 +0000
Subject: Do not load init file or site file for byte compilation

--- bbdb-3.1.2-orig/lisp/Makefile.am
+++ bbdb-3.1.2/lisp/Makefile.am
@@ -20,6 +20,9 @@
 # You should have received a copy of the GNU General Public License
 # along with BBDB.  If not, see <http://www.gnu.org/licenses/>.
 
+# --batch implies --no-init-file, yet let's be explicit about what we want
+AM_ELCFLAGS += --no-init-file --no-site-file
+
 dist_lisp_LISP = 				\
 	bbdb.el					\
 	bbdb-anniv.el				\
@@ -70,10 +73,11 @@
 	@echo "" >> $@;
 #	Generated autoload-file must have an absolute path,
 #	$srcdir can be relative.
-	$(EMACS) -batch -l autoload \
+	$(EMACS) --batch $(AM_ELCFLAGS) $(ELCFLAGS) \
+		--load autoload \
 		--eval '(setq generated-autoload-file "'$(abs_builddir)/$@'")' \
 		--eval '(setq make-backup-files nil)' \
-		-f batch-update-autoloads $(srcdir)
+		--funcall batch-update-autoloads $(srcdir)
 
 # Generate bbdb-site.el here as pkgdatadir is only known at "make" time.
 # We protect the autoconf variables in the sed regular expressions
--- bbdb-3.1.2-orig/lisp/makefile-temp
+++ bbdb-3.1.2/lisp/makefile-temp
@@ -43,13 +43,16 @@
 EMACSOPT =
 
 # The actual Emacs command run in the targets below.
-emacs = LC_ALL=C $(EMACS) --batch --directory=./ $(EMACSOPT)
+# --batch implies --no-init-file, yet let's be explicit about what we want
+emacs = LC_ALL=C $(EMACS) --batch --no-init-file --no-site-file \
+		--directory=./ $(EMACSOPT)
+emacs_compile = $(emacs) --funcall batch-byte-compile
 
-# If you want to use BBDB with VM this should point to your vm/lisp directory.
-# See also the target all below.
+# VM is not part of GNU Emacs.  If you want to use BBDB with VM
+# then the variable VMDIR should point to your vm/lisp directory.
 VMDIR =
 
-VM = -eval '(unless (string-match "$(VMDIR)" "") (push "$(VMDIR)" load-path))'
+VM = -eval '(unless (string= "$(VMDIR)" "") (push "$(VMDIR)" load-path))'
 
 .SUFFIXES: .elc .el .tar .Z .gz .uu
 
@@ -89,51 +92,50 @@
 	@echo "" >> $@;
 #	Generated autoload-file must have an absolute path,
 #	$(srcdir) can be relative.
-	$(emacs) -l autoload \
+	$(emacs) --load autoload \
 		--eval '(setq generated-autoload-file "'`pwd`/$@'")' \
 		--eval '(setq make-backup-files nil)' \
-		-f batch-update-autoloads `pwd`
+		--funcall batch-update-autoloads `pwd`
 
 .el.elc:
-	$(emacs) -f batch-byte-compile $<
+	$(emacs_compile) $<
 
 # Not perfect, but better than nothing:  If we do not have / do not use
 # autotools, we simply copy bbdb-site.el.in to bbdb-site.el.
 bbdb-site.el: bbdb-site.el.in
 	$(CP) $< $@
 bbdb-site.elc: bbdb-site.el
-	$(emacs) -f batch-byte-compile $(@:.elc=.el)
+	$(emacs_compile) $(@:.elc=.el)
 
 bbdb.elc: bbdb.el bbdb-site.elc
-	$(emacs) -f batch-byte-compile $(@:.elc=.el)
+	$(emacs_compile) $(@:.elc=.el)
 
 bbdb-com.elc: bbdb-com.el bbdb.elc
-	$(emacs) -f batch-byte-compile $(@:.elc=.el)
+	$(emacs_compile) $(@:.elc=.el)
 bbdb-mua.elc: bbdb-mua.el bbdb-com.elc
-	$(emacs) -eval '(unless (string= "$(VMDIR)" "") (push "$(VMDIR)" load-path) (load "vm" t t))' \
-	-f batch-byte-compile $(@:.elc=.el)
+	$(emacs_compile) -eval '(unless (string= "$(VMDIR)" "") (push "$(VMDIR)" load-path) (load "vm" t t))' \
+	$(@:.elc=.el)
 bbdb-rmail.elc: bbdb-rmail.el bbdb-mua.elc
-	$(emacs) -f batch-byte-compile $(@:.elc=.el)
+	$(emacs_compile) $(@:.elc=.el)
 bbdb-gnus.elc: bbdb-gnus.el bbdb-mua.elc
-	$(emacs) -f batch-byte-compile $(@:.elc=.el)
+	$(emacs_compile) $(@:.elc=.el)
 bbdb-mhe.elc: bbdb-mhe.el bbdb-mua.elc
-	$(emacs) -f batch-byte-compile $(@:.elc=.el)
-# VM is not part of GNU Emacs
+	$(emacs_compile) $(@:.elc=.el)
 bbdb-vm.elc: bbdb-vm.el bbdb-mua.elc
-	$(emacs) $(VM) -f batch-byte-compile $(@:.elc=.el)
+	$(emacs_compile) $(VM) $(@:.elc=.el)
 bbdb-sc.elc: bbdb-sc.el bbdb-mua.elc
-	$(emacs) -f batch-byte-compile $(@:.elc=.el)
+	$(emacs_compile) $(@:.elc=.el)
 
 bbdb-print.elc: bbdb-print.el bbdb-com.elc
-	$(emacs) -f batch-byte-compile $(@:.elc=.el)
+	$(emacs_compile) $(@:.elc=.el)
 bbdb-migrate.elc: bbdb-migrate.el bbdb.elc
-	$(emacs) -f batch-byte-compile $(@:.elc=.el)
+	$(emacs_compile) $(@:.elc=.el)
 bbdb-anniv.elc: bbdb-anniv.el bbdb-com.elc
-	$(emacs) -f batch-byte-compile $(@:.elc=.el)
+	$(emacs_compile) $(@:.elc=.el)
 bbdb-ispell.elc: bbdb-ispell.el bbdb.elc
-	$(emacs) -f batch-byte-compile $(@:.elc=.el)
+	$(emacs_compile) $(@:.elc=.el)
 bbdb-snarf.elc: bbdb-snarf.el bbdb-com.elc
-	$(emacs) -f batch-byte-compile $(@:.elc=.el)
+	$(emacs_compile) $(@:.elc=.el)
 
 install-el: all
 	$(INSTALL) -d -m 0755 "$(lispdir)/"