gpt4 book ai didi

autotools - aclocal 有什么意义?

转载 作者:行者123 更新时间:2023-12-03 07:05:09 24 4
gpt4 key购买 nike

在使用自动工具配置源文件的上下文中,aclocal 脚本和 aclocal.m4 文件有何意义?据我所知,aclocal 会扫描宏文件以查找稍后由 automake 使用的宏。我不太了解这个过程,但似乎扫描功能可以嵌入到 automake 中。

最佳答案

参见Alexandre Duret Lutz's Autotools tutorial ,必读。

它包含解释自动工具项目的不同文件如何相互交互以及使用它们的工具的图表:configure , config.h , config.status , aclocal.m4等等

编辑:John Calcote还在his book about Autotools的第一章中解释了aclocal和aclocal.m4的用途: Chapter 1: A brief introduction to the GNU Autotools :

The aclocal utility is actually documented by the GNU manuals as a temporary work-around for a certain lack of flexibility in Autoconf. Autoconf was designed and written first, and then a few years later, the idea for Automake was conceived as an add-on for Autoconf. But Autoconf was really not designed to be extensible on the scale required by Automake.

...

Essentially, aclocal’s job is to create an aclocal.m4 file by consolidating various macro files from installed Autotool packages and user-specified locations, such that Autoconf can find them all in one place.

...

However, the latest documentation from both sets of tools suggests that the entire aclocal/acinclude paradigm is now obsolete, in favor of a newer method of specifying a directory containing m4 macro files. The current recommendation is that you create a directory in your project directory called simply m4 (acinclude seems more appropriate to this author), and add macros in the form of individual .m4 files to this directory. All files in this directory will be gathered into aclocal.m4 before Autoconf processes your configure.ac file. Ultimately, aclocal will be replaced by functionality in Autoconf itself.

关于autotools - aclocal 有什么意义?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1970926/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com