当前位置: 首页 > 工具软件 > bash-lib > 使用案例 >

Ubuntu linux编译alsa-lib报错 automake-1.16: command not found 的解决方案

蓬运诚
2023-12-01

在编译alsa的时候报错,config完毕后,make错误如下: line 81: automake-1.16: command not found

root@sw-desktop:/home/libalsa/src/alsa-lib-1.2.3.2/alsa-lib-1.2.3.2# make
 cd . && /bin/bash /home/libalsa/src/alsa-lib-1.2.3.2/alsa-lib-1.2.3.2/missing automake-1.16 --foreign
/home/libalsa/src/alsa-lib-1.2.3.2/alsa-lib-1.2.3.2/missing: line 81: automake-1.16: command not found
WARNING: 'automake-1.16' is missing on your system.
         You should only need it if you modified 'Makefile.am' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'automake' program is part of the GNU Automake package:
         <https://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <https://www.gnu.org/software/autoconf>
         <https://www.gnu.org/software/m4/>
         <https://www.perl.org/>
Makefile:357: recipe for target 'Makefile.in' failed
make: *** [Makefile.in] Error 1

而我的automke的版本为1.15

 $automake --version
automake (GNU automake) 1.15
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Tom Tromey <tromey@redhat.com>
       and Alexandre Duret-Lutz <adl@gnu.org>.

于是卸载了这个automake后,http://ftp.gnu.org/gnu/automake/下载了最新的1.16,然后安装,然后继续编译alsa,报错:

error: version mismatch.  This is Automake 1.16,

root@sw-desktop:/home/libalsa/src/alsa-lib-1.2.3.2/alsa-lib-1.2.3.2# make
 cd . && /bin/bash /home/libalsa/src/alsa-lib-1.2.3.2/alsa-lib-1.2.3.2/missing automake-1.16 --foreign
configure.ac:16: error: version mismatch.  This is Automake 1.16,
configure.ac:16: but the definition used by this AM_INIT_AUTOMAKE
configure.ac:16: comes from Automake 1.16.1.  You should recreate
configure.ac:16: aclocal.m4 with aclocal and run automake again.
WARNING: 'automake-1.16' is probably too old.
         You should only need it if you modified 'Makefile.am' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'automake' program is part of the GNU Automake package:
         <https://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <https://www.gnu.org/software/autoconf>
         <https://www.gnu.org/software/m4/>
         <https://www.perl.org/>
Makefile:357: recipe for target 'Makefile.in' failed
make: *** [Makefile.in] Error 1

解决方案是:

1 、autoscan 用 autoscan 产生一个 configure.in 的原型,执行autoscan 后会产生一个configure.scan 的文件,可以用它作为 configure.in文件的蓝本。
2、 执行 aclocal 和 autoconf ,分別会产生 aclocal.m4 及 configure 两个文件 
3、然后执行: automake --add-missing
4、 最后执行: ./configure

其实不要重新安装automake,在此记录一下,后面学习alsa会用到!

 类似资料: