当前位置: 首页 > 工具软件 > GNU M4 > 使用案例 >

编译makefile失败,提示autom4te: need GNU m4 1.4 or later: /usr/local/bin/m4

皮献
2023-12-01

最近macOS升级到了最新10.13.结果原来的打包脚本就运行失败了,只要make -f 就报错

autom4te: need GNU m4 1.4 or later: /usr/local/bin/m4


1.从题目上查看,应该是m4版本太低导致的,然后这个m4文件的位置在/usr/local/bin/,好,那就进入这里面去查看版本,/usr/local/bin/m4 --version,结果提示

Illegal instruction: 4。

2.嗯好,既然查看不了版本,那我就直接暴力更新,brew upgrade m4。结果显示

Updating Homebrew...

Error: m4 1.4.18 already installed。 

3.又说已经存在了新版本。这就让人很困惑了。

4.那么就试试卸载重装好了,brew uninstall m4 然后brew install m4 

        ==> Downloading https://homebrew.bintray.com/bottles/m4-1.4.18.high_sierra.bottle.tar.gz

        Already downloaded: /Users/polycom/Library/Caches/Homebrew/m4-1.4.18.high_sierra.bottle.tar.gz

        ==> Pouring m4-1.4.18.high_sierra.bottle.tar.gz

        ==> Caveats

        This formula is keg-only, which means it was not symlinked into /usr/local,

        because macOS already provides this software and installing another version in

        parallel can cause all kinds of trouble.

        If you need to have this software first in your PATH run:

        echo 'export PATH="/usr/local/opt/m4/bin:$PATH"' >> ~/.bash_profile

         ==> Summary

        ��  /usr/local/Cellar/m4/1.4.18: 13 files, 630.3KB

5.果然出现了,because macOS already provides this software and installing another version in

        parallel can cause all kinds of trouble.就是说,系统已经提供了这个软件,如果你再安装会有麻烦,而且还给出了他安装的路径usr/local/Cellar/m4/1.4.18

6.那么我就进入到这个路径下,然后再执行m4 --version,果然出现了应有的结果。那么也就是说,在新系统下,这个m4才是可用的。

7.在/usr/local/bin/下面有一个autom4te,这个文件里面第90行,给变量m4赋值了一个地址,原来的是/usr/local/bin/m4,改成/usr/local/Cellar/m4/1.4.18/bin/m4

8.重新make一下,成功。





 类似资料: