如何添加include和lib路径以配置/制作周期? [英] How to add include and lib paths to configure/make cycle?

查看:73
本文介绍了如何添加include和lib路径以配置/制作周期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个在没有su访问权限的linux框中安装库的地方.我正在使用〜/local [/bin,/lib,/include],但是我不知道如何告诉./configure在那寻找库(特别是我正在尝试编译emacs,这需要libgif ,这不在我的发行版中.)

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).

我尝试添加

export PATH=$PATH:~/local/bin
export LD_LIBRARY_PATH=~/local/lib
export C_INCLUDE_PATH=~/local/include
export CPLUS_INCLUDE_PATH=~/local/include

.bashrc,但似乎不起作用.

to .bashrc but it doesn't seem to work.

推荐答案

您需要config.site文件.试试:

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

每当您使用--prefix = $ HOME/local调用autoconf生成的配置脚本时,都会读取config.site并为您进行所有分配. CPPFLAGS和LDFLAGS应该是您所需要的,但是您也可以进行任何其他所需的分配(因此,在上面的示例中...).请注意,-I标志属于CPPFLAGS而不属于CFLAGS,因为-I是用于预处理程序而非编译器的.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆