cross-compiling - 使用 autotools 交叉编译时使用 ccache

标签 cross-compiling autotools configure autoconf ccache

我知道交叉编译基于 autoconf 的项目的标准方法:

$ ./configure --host=i686-w64-mingw32

但是,如果我想使用 ccache 怎么办?

我知道我可以覆盖 CC 和 CXX 变量(例如 CC="ccache i686-w64-mingw32-gcc"./configure --host=i686-w64-mingw32)。然而,这似乎是多余的并且容易出错。

有没有标准的方法,我想念一些 CC_PREFIX 变量?

最佳答案

没有,如果你想使用 ccache,你必须改变你的 CC/CXX 参数以及传递 --host

顺便说一下,更喜欢

./configure --host=i686-w64-mingw32 \
    CC="ccache i686-w64-mingw32-gcc" CXX="ccache i686-w64-mingw32-g++"

而不是预先修复环境变量。这样,如果您使用维护者模式,它们将被正确记录为 config.log/config.cache 中的覆盖。

关于cross-compiling - 使用 autotools 交叉编译时使用 ccache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35286702/

相关文章:

Gnu autotools 缺少文件 depcomp

ubuntu - 为什么我在定义 PATH 变量时仍然要使用 --with-boost 选项

linux - 用arm-linux-xxx-gcc编译的用户程序运行在x86机器上?

opencv - 使用 CMake 交叉编译 OpenCV 与 MinGW(在 Linux for Windows 中)

unix - Automake:AM_CFLAGS 无效

c++ - 链接到 libresolv 时 undefined reference

php - phpMyAdmin 的 "Logging out"?

configure - 从非标准位置构建 guile 时找不到 libunistring

linux - 在 darwin for linux 上交叉编译 CGO 应用程序

android - 为 Android 构建时,cmake 无法排除/usr/include