相关疑难解决方法(0)

对configure脚本和Makefile.in感到困惑

我目前正在学习如何使用autoconf/ automaketoolchain.我似乎对这里的工作流程有一个大致的了解 - 基本上你有一个configure.ac生成可执行configure文件的脚本.configure然后由最终用户执行生成的脚本以生成Makefiles,因此可以构建/安装程序.

因此,典型最终用户的安装基本上是:

./configure
make
make install
make clean
Run Code Online (Sandbox Code Playgroud)

好的,现在我在这里困惑:

作为开发人员,我注意到自动生成的配置脚本有时不会运行,并且会出错:

config.status: error: cannot find input file: `somedir/Makefile.in' 
Run Code Online (Sandbox Code Playgroud)

这混淆了我,因为我认为配置脚本应该产生Makefile.in.所以谷歌搜索一些答案,我发现这可以用autogen.sh脚本修复,这基本上"重置"了autoconf环境的状态.一个典型的autogen.sh脚本将是这样的:

aclocal \
&& automake --add-missing \
&& autoconf
Run Code Online (Sandbox Code Playgroud)

好的.但作为终身用户,我终生下载了无数的tarball,我从来没有使用过autogen.sh脚本.我所做的只是解压缩tarball,并执行通常的configure/make/make install/make clean例程.

但作为一个现在正在使用 的开发人员,除非你先运行,否则autoconf它似乎configure并没有真正运行autogen.sh.所以我发现这非常令人困惑,因为我认为最终用户不应该运行autogen.sh.

那么为什么我必须先运行autogen.sh- 才能找到配置脚本Makefile.in?为什么configure脚本不能简单地生成它?

autoconf makefile configure

28
推荐指数
1
解决办法
1万
查看次数

automake出错

我正在尝试为hello world示例C程序创建安装包.

我已经完成了以下工作.

自动扫描

mv configure.scan configure.ac编辑configure.ac以添加一些宏.

aclocal会

在其中创建Makefile.am

bin_PROGRAMS = hello
hello_SOURCES = hello.c
Run Code Online (Sandbox Code Playgroud)

最后我做了automake.

然后我收到了消息..

configure.ac:12: error: required file './compile' not found
configure.ac:12:   'automake --add-missing' can install 'compile'
configure.ac:6: error: required file './missing' not found
configure.ac:6:   'automake --add-missing' can install 'missing'
Makefile.am: error: required file './INSTALL' not found
Makefile.am:   'automake --add-missing' can install 'INSTALL'
Makefile.am: error: required file './NEWS' not found
Makefile.am: error: required file './README' not found
Makefile.am: error: required file './AUTHORS' not found
Makefile.am: error: required …
Run Code Online (Sandbox Code Playgroud)

automake autoconf autotools configure

9
推荐指数
2
解决办法
3万
查看次数

标签 统计

autoconf ×2

configure ×2

automake ×1

autotools ×1

makefile ×1