A局部错误:';已在AC_CONFIG_文件中注册;和/或$'\r';:找不到命令

A局部错误:';已在AC_CONFIG_文件中注册;和/或$'\r';:找不到命令,c,automake,C,Automake,我在建一个C汽车制造项目。运行“aclocal”会显示以下错误 $ aclocal ' is already registered with AC_CONFIG_FILES./usr/src/ports/autoconf2.5/autoconf2.5-2.69-3.noarch/src/autoconf-2.69/lib/autoconf/status.m4:288: AC_CONFIG_FILES is expanded from... configure.ac:890: the t

我在建一个C汽车制造项目。运行“aclocal”会显示以下错误

 $ aclocal
 ' is already registered with AC_CONFIG_FILES./usr/src/ports/autoconf2.5/autoconf2.5-2.69-3.noarch/src/autoconf-2.69/lib/autoconf/status.m4:288: AC_CONFIG_FILES is 
 expanded from...
 configure.ac:890: the top level
 autom4te-2.69: /usr/bin/m4 failed with exit status: 1
 aclocal-1.15: error: echo failed with exit status: 1
configure.ac:596: the top level
cd ../.. && /bin/sh ./config.status third_party/zdelta-2.1/Makefile depfiles
config.status: creating third_party/zdelta-2.1/Makefile
config.status: executing depfiles commands
source='deflate.c' object='deflate.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh ../../depcomp \
gcc -DHAVE_CONFIG_H -I. -I../../src     -Wall -export-dynamic -O3  -fopenmp -c -o deflate.o deflate.c
../../depcomp:行2: $'\r': 未找到命令
../../depcomp:行5: $'\r': 未找到命令
../../depcomp:行10: $'\r': 未找到命令
../../depcomp:行15: $'\r': 未找到命令
../../depcomp:行20: $'\r': 未找到命令
../../depcomp:行25: $'\r': 未找到命令
../../depcomp:行27: $'\r': 未找到命令
../../depcomp:行64: 未预期的符号 `$'in\r'' 附近有语法错误
'./../depcomp:行64: `case "$depmode" in
make[2]: *** [Makefile:419:deflate.o] 错误 2
make[2]: 离开目录“/cygdrive/c/LaViT2_8_9/lmntal/slim-lightweight- 
hlground/third_party/zdelta-2.1”
make[1]: *** [Makefile:386:all-recursive] 错误 1
make[1]: 离开目录“/cygdrive/c/LaViT2_8_9/lmntal/slim-lightweight- 
hlground/third_party”
make: *** [Makefile:425:all-recursive] 错误 1
我正在windows 10上使用Cygwin

configure.ac从第886行到最后有以下内容

# ----------------------------------------------------------------------
# Create output files
#
echo $SLIM_VERSION > VERSION
AC_OUTPUT(Makefile \
      src/Makefile \
      src/genconfig \
      src/verifier/Makefile \
      src/utility/Makefile \
      src/test/Makefile \
      lib/Makefile \
      ext/Makefile \
      test/Makefile \
      test/system_check/Makefile \
      third_party/Makefile \
      third_party/zdelta-2.1/Makefile \
      third_party/google-perftools-1.8.3/Makefile \
      third_party/google-perftools-1.8.3/src/google/tcmalloc.h \
      third_party/google-perftools-1.8.3/src/windows/google/tcmalloc.h \
      doc/Makefile \
      doc/slim.1)
正如所建议的,我在每个“*.am”文件和“configure.ac”上使用了“dos2unix”,但运行“make”会显示以下错误

 $ aclocal
 ' is already registered with AC_CONFIG_FILES./usr/src/ports/autoconf2.5/autoconf2.5-2.69-3.noarch/src/autoconf-2.69/lib/autoconf/status.m4:288: AC_CONFIG_FILES is 
 expanded from...
 configure.ac:890: the top level
 autom4te-2.69: /usr/bin/m4 failed with exit status: 1
 aclocal-1.15: error: echo failed with exit status: 1
configure.ac:596: the top level
cd ../.. && /bin/sh ./config.status third_party/zdelta-2.1/Makefile depfiles
config.status: creating third_party/zdelta-2.1/Makefile
config.status: executing depfiles commands
source='deflate.c' object='deflate.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh ../../depcomp \
gcc -DHAVE_CONFIG_H -I. -I../../src     -Wall -export-dynamic -O3  -fopenmp -c -o deflate.o deflate.c
../../depcomp:行2: $'\r': 未找到命令
../../depcomp:行5: $'\r': 未找到命令
../../depcomp:行10: $'\r': 未找到命令
../../depcomp:行15: $'\r': 未找到命令
../../depcomp:行20: $'\r': 未找到命令
../../depcomp:行25: $'\r': 未找到命令
../../depcomp:行27: $'\r': 未找到命令
../../depcomp:行64: 未预期的符号 `$'in\r'' 附近有语法错误
'./../depcomp:行64: `case "$depmode" in
make[2]: *** [Makefile:419:deflate.o] 错误 2
make[2]: 离开目录“/cygdrive/c/LaViT2_8_9/lmntal/slim-lightweight- 
hlground/third_party/zdelta-2.1”
make[1]: *** [Makefile:386:all-recursive] 错误 1
make[1]: 离开目录“/cygdrive/c/LaViT2_8_9/lmntal/slim-lightweight- 
hlground/third_party”
make: *** [Makefile:425:all-recursive] 错误 1
这里,

意味着 第2行:$“\r”:找不到该命令


有人能帮我解决这个问题吗?

可以肯定,您的问题是由DOS换行引起的

这是一个错误:

'已在AC_配置文件中注册。/usr/src/ports/autoconf2.5/autoconf2.5-2.69-3.noarch/src/autoconf-2.69/lib/autoconf/status.m4:288:AC_配置文件为

以“
”开头的行已注册为“
”,这意味着在将行写入控制台的过程中,光标被发送回行的开头——这是打印从DOS格式文本文件读取的字符串的确切行为,而它希望该字符串为UNIX格式


配置
git
以签出UNIX格式的文本文件
实际上可以肯定,您的问题是由DOS换行引起的

这是一个错误:

'已在AC_配置文件中注册。/usr/src/ports/autoconf2.5/autoconf2.5-2.69-3.noarch/src/autoconf-2.69/lib/autoconf/status.m4:288:AC_配置文件为

以“
”开头的行已注册为“
”,这意味着在将行写入控制台的过程中,光标被发送回行的开头——这是打印从DOS格式文本文件读取的字符串的确切行为,而它希望该字符串为UNIX格式


配置
git
以签出UNIX格式的文本文件

configure.ac的第890行或其附近出现错误。请复制并粘贴该文件的第880到900行左右。如果您有
grep
,则
grep AC\u CONFIG\u FILES configure.AC
的输出也会有所帮助。如果您没有
grep
,请尝试以其他方式向我们获取该信息(即
configure.ac
中出现字符串
ac\u CONFIG\u FILES
的所有行)。如果您在vim中打开该文件,请运行
:set fileformat=unix
并保存它,这能解决问题吗?@CharlesDuffy我想的是一套与你看起来完全不同的潜在问题。你的假设解释了被破坏的错误信息,而我的假设解释不了;最省力的解决方法可能是使用cygwin自己的git检查您将要使用cygwin工具构建和编译的工作树,而不是使用git for Windows。configure.ac的第890行或附近出现了问题。请复制并粘贴该文件的第880到900行左右。如果您有
grep
,则
grep AC\u CONFIG\u FILES configure.AC
的输出也会有所帮助。如果您没有
grep
,请尝试以其他方式向我们获取该信息(即
configure.ac
中出现字符串
ac\u CONFIG\u FILES
的所有行)。如果您在vim中打开该文件,请运行
:set fileformat=unix
并保存它,这能解决问题吗?@CharlesDuffy我想的是一套与你看起来完全不同的潜在问题。你的假设解释了被破坏的错误信息,而我的假设解释不了;最省力的解决方法可能是使用cygwin自己的git检查您将要使用cygwin工具构建和编译的工作树,而不是使用git for Windows。这一假设的进一步证据是:我在完整的configure.AC中没有看到任何重复的AC_输出/AC_配置文件项,但DOS换行符也可能会阻止M4按预期解释\-换行符,在这种情况下,问题中显示的AC_输出结构将被视为包含许多名为“\”的文件的重复。我正在尝试在cygwin上安装vim,并尝试您的建议。:)如果您还没有vim,是否有
dos2unix
?也可以使用
tr
或其他工具达到相同目的;有关一整套可能的工具,请参阅。@arslan您可能需要转换整个项目中
m4
目录中的所有文件,以及
Makefile.am
文件,以及
configure.ac
本身。命令行工具
dos2unix
可能比vim更容易安装……或者使用Cygwin原生git来避免文件中出现DOS新行。这一假设的进一步证据是:我在完整configure.AC中没有看到任何重复的AC_输出/AC_配置文件项,但DOS换行符也可能会阻止M4按预期解释\-换行符,在这种情况下,问题中显示的AC_输出结构将被视为包含许多名为“\”的文件的重复。我正在尝试在cygwin上安装vim,并尝试您的建议。:)如果您还没有vim,是否有
dos2unix
?也可以使用
tr
或其他工具达到相同目的;有关一整套可能的工具,请参阅。@arslan您可能需要转换整个项目中
m4
目录中的所有文件,以及
Makefile.am
文件,以及
configure.ac
本身。命令行工具
dos2unix
可能比vim更容易安装……或者使用Cygwin原生git避免在文件上首先出现DOS新行。