How to include PostgreSQL development stuff in SDK?


Hi everybody!

I successfully built an image for an ARM based system running a PostgreSQL server and client by adding the packages "postgresql" and "postgresql-client". However, so far I failed to make the development stuff (libpq-fe.h, pg_config, etc) available in the generated SDK.

Usuallly one uses pg_config to obtain the required include path (pg_config --includedir), the required compiler flags for C and C++ (pg_config --cflags and pg_config --cppflags) as well as the required linker flags (pg_config --libdir and pg_config --ldflags). However, I get the warning during compilation of my own programs:

cc1plus: warning: include location "/usr/include/postgresql" is unsafe for cross-compilation [-Wpoison-system-directories]

Obviously the native pg_config binary of my Ubuntu system is called and hence causes references to the local installation of the libpq-dev package of my Ubuntu system instead of a pg_config binary provided by the SDK. Even worse, the SDK just includes the pg_config binary for the ARM platform, but not for x86_64.

The only way to silence these warnings is to include -Wno-poison-system-directories in my compiler flags. But this is something I really like to avoid. Who knows whether the PostgreSQL development stuff of my local Ubuntu system will always be compatible to the one for the ARM system?

Unfortunately I had no luck including the PostgreSQL development stuff in the SDK. I already tried 'TOOLCHAIN_HOST_TASK_append = " nativesdk-postgresql"', but this ends in an error message like this:

ERROR: Nothing RPROVIDES 'nativesdk-postgresql' (but /opt/PHYTEC_BSPs/yocto_imx7/sources/poky/meta/recipes-core/meta/, /opt/PHYTEC_BSPs/yocto_imx7/sources/poky/meta/recipes-core/meta/ RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'nativesdk-postgresql' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['nativesdk-postgresql']
ERROR: Required build target 'fsl-image-qt5' has no buildable providers.
Missing or unbuildable dependency chain was: ['fsl-image-qt5', 'buildtools-tarball', 'nativesdk-postgresql']

Adding 'PACKAGECONFIG_append_pn-nativesdk += " postgresql"' also does not cause the x86_64 binary of pg_config to be included in the SDK. I assume this causes the ARM binary to be included, but this cannot be used on an x86_64 system.

I searched lots of sites for a solution already, but so far I only found hints how to add packages in general, but nothing in respect to this specific issue.

Can anybody please point out what I am doing wrong or what I need to change to solve this issue?

Many thanks in advance!

Mit freundlichem Gruß
best regards

Thore Böckelmann
Software Design

Mit freundlichen Grüßen / Kind regards 
i. A. Thore Böckelmann


iNOEX GmbH | Maschweg 70 | 49324 Melle | Germany |

Dipl.-Inform. Thore Böckelmann
Software Engineering

FON +49 5422 60507-958 | FAX +49 5422 60507-101


Follow us on   


Innovationen und Ausruestungen fuer die Extrusionstechnik

Geschaeftsfuehrer / Managing Director: Martin Deters, Jan Lohoff 
Sitz der Gesellschaft / Headquarter: Maschweg 70, D-49324 Melle
Registergericht / Register: Amtsgericht Osnabrück
Handelsregisternummer / Registration number: HRB 207338

Bitte beachten Sie die Datenschutzinformationen

Join { to automatically receive all group messages.