【发布时间】:2018-12-31 22:11:59
【问题描述】:
注意:一般问题在本文末尾以粗体显示。
我正在尝试使用 Yocto (Rocko) 为我的基于 Linux i.MX6 的嵌入式系统构建 PostGIS 2.2.7。首先,我从 OpenEmbedded Layers (https://layers.openembedded.org/layerindex/recipe/5558/) 安装了 PostgreSQL 9.4.15 以及我可以在安装手册 (https://download.osgeo.org/postgis/docs/postgis-2.2.7.pdf) 中找到的所有(强制)依赖项:GNU C、Proj4、GEOS、LibXML2 和 JSON- C。将以下包添加到我的图像(local.conf)中:
IMAGE_INSTALL_append += " postgresql postgresql-dev postgresql-server-dev proj proj-dev json-c json-c-dev geos geos-dev libxml2 libxml2-dev"
然后我尝试在我的目标系统中编译 PostGIS,并成功地对几个文件进行了一些更改。
最后,只要我想用 Yocto 将 PostGIS 集成到我的图像中,我就编写了 postgis 配方(我有一个带有 postgis-2.2.7.tar.gz tar 的“文件”文件夹):
DESCRIPTION = "PostGIS is a spatial database extender for PostgreSQL object-relational database. It adds support for geographic objects allowing location queries to be run in SQL."
SECTION = "devel"
LICENSE = "GPL-3.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-3.0;md5=c79ff39f19dfec6d293b95dea7b07891"
DEPENDS += "gcc postgresql libxml2 geos proj json-c"
RDEPENDS_${PN} = "postgresql-server-dev postgresql-dev"
SRC_URI = "file://postgis-2.2.7.tar.gz"
EXTRA_OECONF += "\
--without-raster \
--with-pgconfig=${STAGING_BINDIR_CROSS}"
inherit autotools pkgconfig
do_configure () {
oe_runconf
}
do_compile () {
oe_runmake
}
但是当我运行 bitbake 以构建我的图像时,我收到来自 PostGIS 的 do_configure 函数的以下错误
| configure: error: the user-specified pg_config file /home/danlor/yocto-hmcu/build-hmcu/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/postgis/2.2.7-r0/recipe-sysroot/usr/bin/crossscripts does not exist
| NOTE: The following config.log files may provide further information.
| NOTE: /home/danlor/yocto-hmcu/build-hmcu/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/postgis/2.2.7-r0/build/config.log
| ERROR: configure failed | WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/danlor/yocto-hmcu/build-hmcu/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/postgis/2.2.7-r0/temp/log.do_configure.45983)
当然,触发这个错误是因为可执行的 pg_config 不在 ${STAGING_BINDIR_CROSS} 中,要么不在其他地方,而是在 PostgreSQL 的工作文件夹中(在 ../image/usr/bin和 ../package/usr/bin 子文件夹)。我的 /tmp/sysroots 文件夹也是空的。
所以,真正的问题是:如何从我自己的配方中访问由其他配方生成的文件?我需要指定该路径(与其他人一起,从其余依赖项中)为了在我的图像中配置、编译和安装 PostGIS。
编辑 26/07/2018:
pg_config 可以在 postgresql ${WORKDIR} 内的以下目录中找到
./package/usr/bin/pg_config
./package/usr/bin/.debug/pg_config
./package/usr/src/debug/postgresql/9.4.15-r0/postgresql-9.4.15/src/bin/pg_config
./postgresql-9.4.15/src/bin/pg_config
./build/src/bin/pg_config
./build/src/bin/pg_config/pg_config
./packages-split/postgresql-dbg/usr/bin/.debug/pg_config
./packages-split/postgresql-dbg/usr/src/debug/postgresql/9.4.15-r0/postgresql-9.4.15/src/bin/pg_config
./packages-split/postgresql/usr/bin/pg_config
./image/usr/bin/pg_config
【问题讨论】:
标签: postgresql cross-compiling embedded-linux postgis yocto