如何添加 include 和 lib 路径来配置/制作循环? [英] How to add include and lib paths to configure/make cycle?
问题描述
我需要一个地方在我没有 su 访问权限的 linux 机器中安装库.我正在使用 ~/local[/bin,/lib,/include],但我不知道如何告诉 ./configure 在那里查找库(特别是,我正在尝试编译需要 libgif 的 emacs,我的发行版中没有).
我尝试添加
export PATH=$PATH:~/local/bin导出 LD_LIBRARY_PATH=~/local/lib导出 C_INCLUDE_PATH=~/local/include导出 CPLUS_INCLUDE_PATH=~/local/include
到 .bashrc 但它似乎不起作用.
您需要一个 config.site 文件.试试:
<前>$ mkdir -p ~/local/share$猫<每当您使用 --prefix=$HOME/local 调用 autoconf 生成的配置脚本时,将读取 config.site 并为您进行所有分配.CPPFLAGS 和 LDFLAGS 应该是您所需要的,但您也可以进行任何其他所需的分配(因此是上面示例中的 ...).请注意,-I 标志属于 CPPFLAGS 而不是 CFLAGS,因为 -I 用于预处理器而不是编译器.
I need a place to install libraries in a linux box I have no su access to. I'm using ~/local[/bin,/lib,/include], but I don't know how can I tell ./configure to look for libraries there (particularly, I'm trying to compile emacs, which needs libgif, which doesn't come in my distro).
I tried adding
export PATH=$PATH:~/local/bin
export LD_LIBRARY_PATH=~/local/lib
export C_INCLUDE_PATH=~/local/include
export CPLUS_INCLUDE_PATH=~/local/include
to .bashrc but it doesn't seem to work.
You want a config.site file. Try:
$ mkdir -p ~/local/share $ cat << EOF > ~/local/share/config.site CPPFLAGS=-I$HOME/local/include LDFLAGS=-L$HOME/local/lib ... EOF
Whenever you invoke an autoconf generated configure script with --prefix=$HOME/local, the config.site will be read and all the assignments will be made for you. CPPFLAGS and LDFLAGS should be all you need, but you can make any other desired assignments as well (hence the ... in the sample above). Note that -I flags belong in CPPFLAGS and not in CFLAGS, as -I is intended for the pre-processor and not the compiler.
这篇关于如何添加 include 和 lib 路径来配置/制作循环?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!