【发布时间】:2018-08-31 21:19:07
【问题描述】:
我无法运行手动 tar.gz 包安装的配置文件。例如,解压缩文件后,我运行
$ sudo ./vim81/configure
[sudo] password for cli2:
./vim81/configure: line 6: cd: src: No such file or directory
但是,如果我在配置文件所在的目录中,我可以运行配置文件。
$ ./configure
configure: loading cache auto/config.cache
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
...
我的问题是,如果我和源文件不在同一个目录下,如何执行配置文件?
我知道我可以使用yum 或apt-get 来安装vim,但这只是一个示例包,我想为任何包手动执行此操作。谢谢。
【问题讨论】:
-
您不应该使用
sudo构建。如果需要,仅将其用于install。您应该执行./configure && make && sudo make install。我不相信 Autotools 允许在树外构建。您必须从configure所在的目录运行它。 (也许较新的 Autotools 有所不同)。 -
你为什么不想先
cd到目录? -
所以在你的子进程中,做一个
cd。没有? -
@cli2 如果您不知道包含
configure脚本的目录,则无法完成此任务。您的问题需要了解此目录,无论这意味着做出假设还是使用通配符。此外,正如 jww 所解释的那样,您应该只在make install期间需要sudo。 -
@jww,默认情况下,Automake 确实提供了源外构建,但它不是免费的:如果他们不小心,项目维护人员可以编写 Makefile.am 文件,这些文件会中断-源构建。此外,如果作为项目维护者,您在没有 Automake 的情况下使用 Autoconf,那么您将自己获得任何源外构建支持。
标签: linux installation autotools configure autoconf