Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aclocal error: ' is already registered with AC_CONFIG_FILES; and/or $'\r': command not found

Tags:

c

automake

I was building a C automake project. Running "aclocal" is showing the following error.

 $ 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

I am using Cygwin on windows 10.

The configure.ac has the following from the line 886 to the end.

# ----------------------------------------------------------------------
# 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)

As suggested, I used "dos2unix" on every "*.am" files and "configure.ac", but running "make" is showing the following error.

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

Here,

行2: $'\r': 未找到命令

means line 2: $'\r': cannot find the command

Could anyone help me fix this issue?

like image 398
arslan Avatar asked Dec 07 '22 14:12

arslan


1 Answers

It's effectively certain that your issue is caused by DOS newlines.

The giveaway is this error:

' 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

The line beginning with ' is already registered with implies that the cursor was sent back to the beginning of the line partway through writing the line to the console -- the exact behavior of printing a string read from a DOS-format text file while it expecting it to be in UNIX format.


Configuring git to check out text files in UNIX format

git config --global core.autocrlf false
git config --global core.eol lf
like image 64
Charles Duffy Avatar answered Dec 31 '22 00:12

Charles Duffy