在 Cygwin 中构建 Emacs 时,目标“自动加载”的配方失败
Posted
技术标签:
【中文标题】在 Cygwin 中构建 Emacs 时,目标“自动加载”的配方失败【英文标题】:Recipe for target `autoloads' failed while building Emacs in Cygwin 【发布时间】:2012-04-12 22:23:12 【问题描述】:我正在尝试使用 Cyqwin 在 64 位 Windows 7 上构建 Emacs:
Emacs 23.3 或 23.4
CYGWIN_NT-6.1-WOW64 1.7.11(0.260/5/3) 2012-02-24 14:05 i686 Cygwin
来自 ./configure 日志的一些信息:
What compiler should emacs be built with?
gcc -g -O2 -Wdeclarati
What operating system and machine description files should Emacs use?
`s/cygwin.h' and `m/intel386.h'
我能够毫无问题地创建 Makefile。但是,如果我运行 make 程序,它会构建几分钟,然后,在某些时候,它会卡住 2 分钟,然后产生错误:
Makefile:149: recipe for target `autoloads' failed
make[2]: *** [autoloads] Interrupt
Makefile:198: recipe for target `/cygdrive/c/emacs-23.3/src/../lisp/loaddefs.el' failed
make[1]: *** [/cygdrive/c/emacs-23.3/src/../lisp/loaddefs.el] Interrupt
Makefile:339: recipe for target `src' failed
make: *** [src] Interrupt
在这两种情况下(Emacs 23.3 和 23.4)Makefile:149 指的是 Emacs\lisp 文件夹中 makefile 的同一部分:
149 autoloads: $(LOADDEFS) doit
150 , chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \
151 $(lisp)/emacs-lisp/cl-loaddefs.el $(lisp)/mail/rmail.el \
152 $(lisp)/dired.el $(lisp)/ibuffer.el
153 wd=$(lisp); $(setwins_almost); \
154 echo Directories: $$wins; \
155 $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
在 23.3 版中。为 *.el 文件生成自动加载时,建筑物卡住了:
Generating autoloads for progmodes/cc-mode.el...
Generating autoloads for progmodes/cc-mode.el...done
Generating autoloads for progmodes/cc-styles.el...
Generating autoloads for progmodes/cc-styles.el...done
Generating autoloads for progmodes/cc-vars.el...
Generating autoloads for progmodes/cc-vars.el...done
Generating autoloads for international/ccl.el...
Makefile:149: recipe for target `autoloads' failed
make[2]: *** [autoloads] Interrupt
在 23.4 版本中,建筑物在保存 loaddefs 时卡住了:
make[2]: Entering directory `/cygdrive/c/emacs-23.4/lisp'
chmod +w /cygdrive/c/emacs-23.4/lisp/ps-print.el /cygdrive/c/emacs-23.4/lisp/emulation/tpu-edt.el \
/cygdrive/c/emacs-23.4/lisp/emacs-lisp/cl-loaddefs.el /cygdrive/c/emacs-23.4/lisp/mail/rmail.el \
/cygdrive/c/emacs-23.4/lisp/dired.el /cygdrive/c/emacs-23.4/lisp/ibuffer.el
wd=/cygdrive/c/emacs-23.4/lisp; subdirs=`(cd $wd; find . -type d -print)`; for file in $subdirs; do case $file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */obsolete | */term ) ;; *) wins="$wins $wd/$file" ;; esac; done ; \
echo Directories: $wins; \
EMACSLOADPATH=/cygdrive/c/emacs-23.4/lisp LC_ALL=C ../src/bootstrap-emacs.exe -batch --no-site-file --multibyte -l autoload --eval '(setq generated-autoload-file "/cygdrive/c/emacs-23.4/lisp/loaddefs.el")' -f batch-update-autoloads $wins
Directories: /cygdrive/c/emacs-23.4/lisp/. /cygdrive/c/emacs-23.4/lisp/./calc /cygdrive/c/emacs-23.4/lisp/./calendar /cygdrive/c/emacs-23.4/lisp/./cedet /cygdrive/c/emacs-23.4/lisp/./cedet/ede /cygdrive/c/emacs-23.4/lisp/./cedet/semantic /cygdrive/c/emacs-23.4/lisp/./cedet/semantic/analyze /cygdrive/c/emacs-23.4/lisp/./cedet/semantic/bovine /cygdrive/c/emacs-23.4/lisp/./cedet/semantic/decorate/cygdrive/c/emacs-23.4/lisp/./cedet/semantic/symref /cygdrive/c/emacs-23.4/lisp/./cedet/semantic/wisent /cygdrive/c/emacs-23.4/lisp/./cedet/srecode /cygdrive/c/emacs-23.4/lisp/./emacs-lisp /cygdrive/c/emacs-23.4/lisp/./emulation /cygdrive/c/emacs-23.4/lisp/./erc /cygdrive/c/emacs-23.4/lisp/./eshell /cygdrive/c/emacs-23.4/lisp/./gnus /cygdrive/c/emacs-23.4/lisp/./international /cygdrive/c/emacs-23.4/lisp/./language /cygdrive/c/emacs-23.4/lisp/./mail /cygdrive/c/emacs-23.4/lisp/./mh-e /cygdrive/c/emacs-23.4/lisp/./net /cygdrive/c/emacs-23.4/lisp/./nxml /cygdrive/c/emacs-23.4/lisp/./org /cygdrive/c/emacs-23.4/lisp/./play /cygdrive/c/emacs-23.4/lisp/./progmodes /cygdrive/c/emacs-23.4/lisp/./textmodes /cygdrive/c/emacs-23.4/lisp/./url
Saving file /cygdrive/c/emacs-23.4/lisp/loaddefs.el...
Makefile:149: recipe for target `autoloads' failed
make[2]: *** [autoloads] Interrupt
有人知道如何修复这个错误吗?错误的 C 编译器?更改生成文件?使用带有某些参数的“make”?
感谢您的帮助或参考。
************ 第 2 部分*********** *
好的,根据您的建议,以下是继续:
1#
make autoloads
不可能,因为这个子部分在子makefile中,所以它会产生错误:
$ make autoloads
chmod +w /cygdrive/c/emacs-23.4/lisp/ps-print.el /cygdrive/c/emacs-23.4/lisp/emulation/tpu-edt.el \
/cygdrive/c/emacs-23.4/lisp/emacs-lisp/cl-loaddefs.el /cygdrive/c/emacs-23.4/lisps/mail/rmail.el \
/cygdrive/c/emacs-23.4/lisp/dired.el /cygdrive/c/emacs-23.4/lisp/ibuffer.el
wd=/cygdrive/c/emacs-23.4/lisp; subdirs=`(cd $wd; find . -type d -print)`; for file in $subdirs; do case $file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */obsolete | */term ) ;; *) wins="$wins $wd/$file" ;; esac; done; \
echo Directories: $wins; \
EMACSLOADPATH=/cygdrive/c/emacs-23.4/lisp LC_ALL=C ../src/emacs -batch --no-site-file --multibyte -l autoload --eval '(setq generated-autoload-file "/cygdrive/c/emacs-23.4/lisp/loaddefs.el")' -f batch-update-autoloads $wins
Directories: /cygdrive/c/emacs-23.4/lisp/. /cygdrive/c/emacs-23.4/lisp/./calc /cygdrive/c/emacs-23.4/lisp/./calendar /cygdrive/c/emacs-23.4/lisp/./cedet /cygdrive/c/emacs-23.4/lisp/./cedet/ede /cygdrive/c/emacs-23.4/lisp/./cedet/semantic /cygdrive/c/emacs-23.4/lisp/./cedet/semantic/analyze /cygdrive/c/emacs-23.4/lisp/./cedet/semantic/bovine /cygdrive/c/emacs-23.4/lisp/./cedet/semantic/decorate /cygdrive/c/emacs-23.4/lisp/./cedet/semantic/symref /cygdrive/c/emacs-23.4/lisp/./cedet/semantic/wisent /cygdrive/c/emacs-23.4/lisp/./cedet/srecode /cygdrive/c/emacs-23.4/lisp/./emacs-lisp /cygdrive/c/emacs-23.4/lisp/./emulation /cygdrive/c/emacs-23.4/lisp/./erc /cygdrive/c/emacs-23.4/lisp/./eshell /cygdrive/c/emacs-23.4/lisp/./gnus /cygdrive/c/emacs-23.4/lisp/./international /cygdrive/c/emacs-23.4/lisp/./language /cygdrive/c/emacs-23.4/lisp/./mail /cygdrive/c/emacs-23.4/lisp/./mh-e /cygdrive/c/emacs-23.4/lisp/./net /cygdrive/c/emacs-23.4/lisp/./nxml /cygdrive/c/emacs-23.4/lisp/./org /cygdrive/c/emacs-23.4/lisp/./play /cygdrive/c/emacs-23.4/lisp/./progmodes /cygdrive/c/emacs-23.4/lisp/./textmodes /cygdrive/c/emacs-23.4/lisp/./url
/bin/sh: line 2: ../src/emacs: No such file or directory
Makefile:149: recipe for target `autoloads' failed
make: *** [autoloads] Error 127
如果我做错了什么,请纠正我。
2#
实际上删除$(LOADDEFS) doit
不会改变结果
3# 只运行第一部分
autoloads:
chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \
$(lisp)/emacs-lisp/cl-loaddefs.el $(lisp)/mail/rmail.el \
$(lisp)/dired.el $(lisp)/ibuffer.el
在自动加载中没有错误地解决,
但是 20 秒后它冻结了一段时间并产生另一个错误
(这个问题的描述如下)
4# 只运行第二部分:
autoloads:
wd=$(lisp); $(setwins_almost); \
echo Directories: $$wins; \
$(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
原点错误
5# 也可以像 3# 一样运行自动加载
wd=$(lisp);
自动加载没有错误,稍后与 3# 相同的错误
6#
使用wd=$(lisp);$(setwins_almost);
运行自动加载
自动加载没有错误,后来与 3# 中的错误相同
7# 也添加一行
echo Directories: $$wins;
自动加载没有错误,稍后与 3# 相同的错误
8# 也添加一行
$(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
当然是原点错误
第二个错误的描述(第 3 部分):
make[2]: Entering directory `/cygdrive/c/emacs-23.4/lisp'
Compiling /cygdrive/c/emacs-23.4/src/../lisp/abbrev.el
>>Error occurred processing /cygdrive/c/emacs-23.4/src/../lisp/abbrev.el: Symbol's value as variabl e is void ((warning-series))
Makefile:1478: recipe for target `compile-onefile' failed
make[2]: *** [compile-onefile] Error 1
make[2]: Leaving directory `/cygdrive/c/emacs-23.4/lisp'
Makefile:195: recipe for target `/cygdrive/c/emacs-23.4/src/../lisp/abbrev.elc' failed
make[1]: *** [/cygdrive/c/emacs-23.4/src/../lisp/abbrev.elc] Error 2
make[1]: Leaving directory `/cygdrive/c/emacs-23.4/src'
Makefile:339: recipe for target `src' failed
make: *** [src] Error 2
在此之前编译了很多 *.el 文件
lisp/
中 Makefile 的一部分
# The src/Makefile.in has its own set of dependencies and when they decide
# that one Lisp file needs to be re-compiled, we had better recompile it as
# well, otherwise every subsequent make will again call us, until we finally
# end up deciding that yes, the file deserves recompilation.
# One option is to try and reproduce exactly the same dependencies here as
# we have in src/Makefile.in, but it turns out to be painful
# (e.g. src/Makefile.in may have a dependency for ../lisp/foo.elc where we
# only know of $(lisp)/foo.elc). So instead we provide a direct way for
# src/Makefile.in to rebuild a particular Lisp file, no questions asked.
# Use byte-compile-refresh-preloaded to try and work around some of
# the most common problems of not bootstrapping from a clean state.
1477 compile-onefile:
1478 @echo Compiling $(THEFILE)
1479 @# Use byte-compile-refresh-preloaded to try and work around some of
1480 @# the most common bootstrapping problems.
1481 @$(emacs) -l bytecomp -f byte-compile-refresh-preloaded $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $(THEFILE)
Makefile中有一个ELC文件列表:
## Explicitly list the .elc files, for the sake of parallel builds.
## http://lists.gnu.org/archive/html/bug-gnu-emacs/2008-05/msg00016.html
## This can probably be done more elegantly, but needs to be portable.
ELCFILES = \
$(lisp)/abbrev.elc \
$(lisp)/abbrevlist.elc \
$(lisp)/add-log.elc \
$(lisp)/align.elc \
$(lisp)/allout.elc \
$(lisp)/ansi-color.elc \
$(lisp)/apropos.elc \
$(lisp)/arc-mode.elc \
...
$(lisp)/info.elc \
$(lisp)/informat.elc \
$(lisp)/international/ccl.elc \
$(lisp)/international/characters.elc \
$(lisp)/international/fontset.elc \
$(lisp)/international/isearch-x.elc \
Makefile 可能会从 *.elc 文件重新创建 *.el 文件,但是所有 *.el 文件都已经存在。好的,现在我有两个错误,其中一个:)(当然如果没有连接)
再次感谢您。
【问题讨论】:
+1 只是为了获得简洁而全面的错误报告。 【参考方案1】:众所周知,生成的 makefile 难以维护和排除故障,但我们可以尝试。有问题的规则有两个先决条件和两个命令,第二个由四个串在一起的 shell 命令组成:
autoloads: $(LOADDEFS) doit
chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \
$(lisp)/emacs-lisp/cl-loaddefs.el $(lisp)/mail/rmail.el \
$(lisp)/dired.el $(lisp)/ibuffer.el
wd=$(lisp); $(setwins_almost); \
echo Directories: $$wins; \
$(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
首先我会尝试make autoloads
。如果出现同样的错误,我们可以继续,否则发布结果。
然后删除先决条件 ($(LOADDEFS) doit
),因为它们应该是幂等的,并且对本规则的操作没有影响(除非 makefile 真的很复杂),然后重试。
然后将命令拆分成更小的命令,一一尝试。首先
autoloads:
chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \
$(lisp)/emacs-lisp/cl-loaddefs.el $(lisp)/mail/rmail.el \
$(lisp)/dired.el $(lisp)/ibuffer.el
这应该没有错误。如果确实如此,则可能缺少其中一个文件;发布结果。如果没有,请尝试不使用第一个命令的第二个命令:
autoloads:
wd=$(lisp); $(setwins_almost); \
echo Directories: $$wins; \
$(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
我希望这会产生与最初相同的错误;如果没有,只需将第一个命令放回并继续。
现在分解第二个命令。前面的部分不能省略,后面的部分依赖于它们,所以先试试
autoloads:
wd=$(lisp);
这应该可以,除非lisp
很奇怪(是的,是的,我知道)。那么
autoloads:
wd=$(lisp); $(setwins_almost);
我敢打赌,这就是它失败的地方, 但如果不是,请继续:
autoloads:
wd=$(lisp); $(setwins_almost); \
echo Directories: $$wins;
应该可以。那么
autoloads:
wd=$(lisp); $(setwins_almost); \
echo Directories: $$wins; \
$(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
几乎肯定会失败。
第一次通过就足够了。告诉我们结果,我们将继续。
【讨论】:
首先,我要感谢您的关注,希望它会有所帮助。您的建议结果将添加到原始问题 (PART2)。 您还可以看到用户 Stafan 的其他答案,我能够编译 Emacs 24。因此,如果您对问题所在不感兴趣,则无需尝试找到解决方案,因为解决这个问题已经没有用了。至少对我来说。不过,再次感谢您。【参考方案2】:我建议您尝试使用 Emacs-24 预测试,如果失败,请将其报告为错误。
【讨论】:
我能说什么:) 你没有回答我的问题,但你确实解决了我的问题。我对构建 Emacs 24 没有任何问题。感谢您的回复!以上是关于在 Cygwin 中构建 Emacs 时,目标“自动加载”的配方失败的主要内容,如果未能解决你的问题,请参考以下文章
将Cygwin Emacs设为Windows explorer默认打开程序
可以在 EmacsW32 和 cygwin 中使用 tramp 吗?