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

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

问题描述

我需要在Linux操作系统中安装库的地方我没有苏访问。我使用的〜/本地[/ bin中,/ lib中,/包括],但我不知道我该怎么告诉的./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

当你调用一个autoconf生成的配置与脚本 - preFIX = $ HOME /本地的,config.site将被读取,所有的作业会为您进行。 CPPFLAGS和LDFLAGS应该是你所需要的,但你可以做任何其他所需的任务以及(因此...样品上面)。注意,-I标记属于在CPPFLAGS而不是在CFLAGS,因为-I旨在用于$ P $对 - 处理器,而不是编译

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天全站免登陆