Skip to content

Conversation

@ffontaine
Copy link
Contributor

Add PkgConfig support to retrieve popt dependencies otherwise static
build can fail if popt has been linked with iconv:

[100%] Linking C executable rdiff
/home/buildroot/autobuild/instance-2/output-1/per-package/librsync/host/opt/ext-toolchain/bin/../lib/gcc/powerpc-buildroot-linux-uclibc/8.3.0/../../../../powerpc-buildroot-linux-uclibc/bin/ld: /home/buildroot/autobuild/instance-2/output-1/per-package/librsync/host/powerpc-buildroot-linux-uclibc/sysroot/usr/lib/libpopt.a(poptint.o): in function `POPT_fprintf':
poptint.c:(.text+0x34c): undefined reference to `libiconv_open

Fixes:

Signed-off-by: Fabrice Fontaine fontaine.fabrice@gmail.com

ffontaine and others added 2 commits December 31, 2019 18:23
Add PkgConfig support to retrieve popt dependencies otherwise static
build can fail if popt has been linked with iconv:

[100%] Linking C executable rdiff
/home/buildroot/autobuild/instance-2/output-1/per-package/librsync/host/opt/ext-toolchain/bin/../lib/gcc/powerpc-buildroot-linux-uclibc/8.3.0/../../../../powerpc-buildroot-linux-uclibc/bin/ld: /home/buildroot/autobuild/instance-2/output-1/per-package/librsync/host/powerpc-buildroot-linux-uclibc/sysroot/usr/lib/libpopt.a(poptint.o): in function `POPT_fprintf':
poptint.c:(.text+0x34c): undefined reference to `libiconv_open

Fixes:
 - http://autobuild.buildroot.org/results/896e8e3efbedad90d66ae8c4e1e50f16206cab49

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
It's possible for find_package() to fail, and thus pkg_search_module() will not be available.

Also FIND_PACKAGE_HANDLE_STANDARD_ARGS() should only be needed when PkgConfig didn't work.
@dbaarda
Copy link
Member

dbaarda commented Jan 1, 2020

Thanks for this... it seems sad that every project needs their own version of this, and searching around it seems like they are all different and probably broken in different ways.

I fixed it a tiny bit more for the case where find_package() fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants