- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我维护了几个使用 automake 构建的项目(我们称它们为 lib1 和 lib2)。 lib2 依赖于 lib1 作为库,我在 CentOS 上的 pkg-config 默认值有一些问题。理想情况下,我希望用户不必设置任何环境变量即可正确安装所有内容。
现在,它只是假设 ${PREFIX}/lib/pkgconfig
作为我的 .pc 文件的目的地,但在 CentOS 7 上,默认为 ${PREFIX}
是/usr/local
但是pkgconfig
默认情况下只查找 /usr/share/pkgconfig
和 /usr/lib64/pkgconfig
.因此,lib2
找不到 lib1
与 pkg-config
并且配置脚本爆炸了。
所以,问题是,我的 make install
怎么办?在 lib1
正确检测目录以安装 pkg-config
文件?
最佳答案
来自 man pkg-config
PKG_INSTALLDIR(DIRECTORY)
Substitutes the variable pkgconfigdir as the location where a module should install pkg-config .pc files. By default the directory is $libdir/pkgconfig, but the default can be changed by passing DIRECTORY. The user can override through the
--with-pkgconfigdir
parameter.
这允许您向用户公开 pkg-config 文件的安装目录(并且 - 如果您的发行版修补 pkg-config 以使用非标准搜索路径,它有望为您的系统选择正确的默认值) .
例子:
配置文件:
[...]
PKG_INSTALLDIR
[...]
生成文件.am:
[...]
pkgconfig_DATA = lib1.pc
[...]
用法
$ ./configure --prefix=/usr --with-pkgconfigdir=/usr/lib64/pkgconfig
请不要对 pkg-config
将在何处查找文件做出特定于发行版的假设。始终使用默认值(它们是默认值是有充分理由的),并提供一种方法来覆盖非标准系统的这些默认值。
那里有很多发行版,仅仅因为在我的社区中一个流行,这并不意味着其他社区也是如此(或不会改变)。
如果您的发行版不遵循标准也没关系,但它应该是一致的;如果它不一致(例如 pkg-config
在 /foo/baz
中寻找文件,但是 PKG_INSTALLDIR
扩展 pkgconfigdir
到 /usr/lib/pkg-config
),那么你应该在你的发行版中报告一个错误。
另外我觉得很奇怪,您的pkg-config
不会在/usr/local
中搜索文件。例如。在我的 Debian/sid 系统上,它首先搜索 /usr/local
,然后搜索 /usr
:
$ which pkg-config
/usr/bin/pkg-config
$ strace -e trace=open pkg-config --cflags foo 2>&1 | grep /usr
open("/usr/local/lib/x86_64-linux-gnu/pkgconfig", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/pkgconfig", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/local/share/pkgconfig", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/pkgconfig", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
open("/usr/lib/pkgconfig", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
open("/usr/share/pkgconfig", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
$
关于centos - 使用 automake 在 CentOS 上将 pkg-config 文件安装到正确的路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28997618/
我编写了一个小型库,我正在尝试将其设置为可与 pkg-config 一起使用,以供我组织中稍后可能需要使用它的人使用。所以我的安装程序在/usr/local/lib/pkgconfig 中放置了一个
我已经通过brew安装了pkg-config和libusb 现在如果我这样做 pkg-config --cflags --libs libusb 我收到以下消息 Package libusb was
我试图更新我的 julia 软件包,但遇到了问题。首先,我跑了Pkg.update()一如既往... julia> Pkg.update() INFO: Updating METADATA... IN
为了创建 .pkg 文件,我使用“Packager.app”。我使用格式 - '平面' 创建项目。当我尝试使用下一个命令签署 .pkg 文件时 productsign --sign“开发者 ID 应用
我有两个模块在一个包下形成循环导入 /test __init__.py a.py b.py a.py import test.b def a(): print("a") b.py im
我正在为需要 NodeJS 的产品构建 OS X .pkg 安装程序。 我正在尝试嵌入 official NodeJS pkg installer 的可能性作为我的安装程序的组件包。 我将官方 pkg
我正在与 OSX 的 packageMaker 作斗争,因为它不允许我创建“.pkg”。相反,它迫使我制作一个“.pkg.mpkg”。 这似乎是一个愚蠢的问题,我应该可以通过几次谷歌搜索来回答,但我无
我正在使用 Comparator对 List 进行排序通过它的属性(类型为 Date )在 viewscoped 托管 bean 中。 问题是我一直收到 ClassCastException如下- j
我尝试使用 travis-ci 检查我的 r 包是否正确。我的包应该导入 r pkg nloptr。而 travis-ci 会在 "r": "oldrel"分支给出错误。我在这里显示错误: confi
我尝试安装 udev。 udev 在 ./configure 期间给我一个错误 --exists: command not found configure: error: pkg-config and
我发现 sudo apt-get install python-和 sudo pip3 install 在不同的地方安装文件。 有没有办法通过对用户透明的两个选项中的任何一个来渲染安装? 在我的特殊情
我已经阅读了几篇关于这个的帖子。 但是他们并没有从我这里解决。 请看资料 brew install pkg-config 完成安装然后 Rangers-iMac:dash ranger$ which
我安装了最新的 anaconda2。我发现 anaconda2/Lib/site-packages/ 中存在相同的包和 anaconda2/pkgs/ . python中调用的区别和pkgs有什么区别
我正在编写一个大小开始增长的 R 包,因此非常感谢在文件夹 pkg/R/和(尤其是)在 pkg/src/中使用自定义结构。 例如,假设我有两个类型 A 的算法系列和一些类型 B 的函数,以及一个主入口
今天在使用 brew reinstall python 在 homebrew 上重新安装 Python 2 之后发生了一件有趣的事情。 异常 Traceback (most recent call l
摘要:最新的 GlassFish 4.1.2 中缺少 pkg-bootstrap.jar 和相关文件,这导致 updatetool 无法运行。在 Windows 10 上安装和运行 updatetoo
我正在尝试创建一个 bash 脚本来自动创建应用内购买 pkg 文件。 我正处于脚本成功创建所有应用内购买 xcodeproj 项目然后使用此命令将它们存档 xcodebuild -scheme $n
有人知道包含 arm-linux-androideabi-pkg-config 工具的 ffmpeg linux arm 平台的任何工具链吗? Android NDK 不包含它。还有人成功地为包含 a
我有以下文件: pkg/__init_.py pkg/module.py 现在,在 pkg/__init__.py 中,如何导入 module? 是吗 import pkg.module 或 impo
我正在使用 Stack 和 Nix 构建一个 Haskell 项目,并依赖于来自 Hackage 的 cairo 库。 当我构建项目时,出现错误:无法找到 pkg-config >= 0.9.0 或
我是一名优秀的程序员,十分优秀!