SCons - 非标准位置的标题/库 [英] SCons - Headers/Libraries in a non-standard location

查看:48
本文介绍了SCons - 非标准位置的标题/库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 SCons 来编译需要一组依赖项的程序,这些依赖项已安装在非标准位置.

I'm trying to use SCons to compile a program that requires a set of dependencies which I've installed in a non-standard location.

我已经在/home/dja/ocr 中安装了依赖项.现在我正在尝试编译主程序,但不知道如何告诉 SCons 在哪里查找库和头文件.

I've installed the dependencies in /home/dja/ocr. Now I'm trying to compile the main program and can't figure out how to tell SCons where to look for the libraries and headers.

我尝试过(其中包括):

I've tried (amongst others):

scons prefix=/home/dja/ocr

scons includepath=/home/dja/ocr/include libpath=/home/dja/ocr/lib

env LIBPATH=/home/dja/ocr/lib INCLUDEPATH=/home/dja/ocr/include scons

...etc...

结果总是一样的:

scons: Reading SConscript files ...  
Currently supported OS version: Ubuntu 10.04  
Checking for C++ library iulib... no  
AssertionError: :  
  File "/home/dja/ocr/src/ocropus/SConstruct", line 107:  
    assert conf.CheckLibWithHeader("iulib","iulib/iulib.h","C++");  

我无法在 Google 上找到答案.

I haven't been able to find an answer on Google.

让它工作的正确 SCons foo 是什么?

What is the correct SCons foo to get this to work?

推荐答案

ma​​ke 及其对某些环境变量的约定或 --with-X 选项不同configure,SConstruct 的作者需要为用户提供一种指定覆盖的方法.默认情况下,scons 不会从环境中读取构建变量.

Unlike with make and its conventions for certain environment variables or the --with-X options to configure, the author of the SConstruct needs to provide a way for a user to specify overrides. By default, scons doesn't read build variables from the environment.

有多种处理用户配置的方法(请参阅变量刚刚了解到),但我不知道广受尊重的惯例.对于处于您位置的用户,您需要依靠作者编写的构建文档或体面的 scons --help 描述,或者自己阅读 SConstruct(有时您不得不求助于写得不好非常规的Makefile).

There are various ways of handling user configuration (see Variables which I just learned about), but I'm not aware of widely honored conventions. And for the user in your position, you need to rely on the author writing build documentation or a decent scons --help description, or resort to reading the SConstruct yourself (which you sometimes have to resort to with badly written unconventional Makefiles).

顺便说一句,如果我对 scons 的了解已经过时,我很乐意在这方面得到纠正.

BTW, I would be happy to be corrected on this if my knowledge of scons is out of date.

这篇关于SCons - 非标准位置的标题/库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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