cross-pkg-config prefix with $SYSROOT -I and -L when it does start with /usr : # i586-pc-linux-gnu-pkg-config --cflags --libs libipq -L/usr/i586-pc-linux-gnu/usr/lib -lipq While with no wrapper : # PKG_CONFIG_LIBDIR=/usr/i586-pc-linux-gnu/usr/lib/pkgconfig:/usr/i586-pc-linux-gnu/usr/share/pkgconfig pkg-config --cflags --libs libipq -L/usr/lib -lipq But when .pc file has libdir=/lib, it does not prefix correctly : # PKG_CONFIG_LIBDIR=/usr/i586-pc-linux-gnu/usr/lib/pkgconfig:/usr/i586-pc-linux-gnu/usr/share/pkgconfig pkg-config --cflags --libs libmnl -L/lib -lmnl libmnl.pc file : prefix=/usr exec_prefix=${prefix} libdir=/lib includedir=${prefix}/include Name: libmnl Description: Minimalistic Netlink communication library URL: http://netfilter.org/projects/libmnl/ Version: 1.0.2 Requires: Conflicts: Libs: -L${libdir} -lmnl Cflags: -I${includedir} # i586-pc-linux-gnu-pkg-config --cflags --libs libmnl cross-pkg-config: warning: ### falling down so here is a dump state ###### Error printing enabled by default due to use of --version, --libs, --cflags, --libs-only-l, --libs-only-L, --libs-only-other, --cflags-only-I, --cflags-only-other or --list. Value of --silence-errors: 0 Error printing enabled Adding virtual 'pkg-config' package to list of known packages Scanning directory '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig' Ignoring file '.' in search directory; not a .pc file Ignoring file '..' in search directory; not a .pc file File 'libffi.pc' appears to be a .pc file Will find package 'libffi' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libffi.pc' File 'libipq.pc' appears to be a .pc file Will find package 'libipq' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libipq.pc' File 'glib-2.0.pc' appears to be a .pc file Will find package 'glib-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/glib-2.0.pc' File 'libmnl.pc' appears to be a .pc file Will find package 'libmnl' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libmnl.pc' File 'gmodule-no-export-2.0.pc' appears to be a .pc file Will find package 'gmodule-no-export-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/gmodule-no-export-2.0.pc' File 'gmodule-export-2.0.pc' appears to be a .pc file Will find package 'gmodule-export-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/gmodule-export-2.0.pc' File 'gio-2.0.pc' appears to be a .pc file Will find package 'gio-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/gio-2.0.pc' File 'libxml-2.0.pc' appears to be a .pc file Will find package 'libxml-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libxml-2.0.pc' File 'gmodule-2.0.pc' appears to be a .pc file Will find package 'gmodule-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/gmodule-2.0.pc' File 'gio-unix-2.0.pc' appears to be a .pc file Will find package 'gio-unix-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/gio-unix-2.0.pc' File 'gthread-2.0.pc' appears to be a .pc file Will find package 'gthread-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/gthread-2.0.pc' File 'gobject-2.0.pc' appears to be a .pc file Will find package 'gobject-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/gobject-2.0.pc' Cannot open directory '/usr/i586-pc-linux-gnu/usr/share/pkgconfig' in package search path: No such file or directory Looking for package 'libmnl' Looking for package 'libmnl-uninstalled' Reading 'libmnl' from file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libmnl.pc' Parsing package file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libmnl.pc' line> line> line>prefix=/usr Variable declaration, 'prefix' has value '/usr' line>exec_prefix=${prefix} Variable declaration, 'exec_prefix' has value '/usr' line>libdir=/lib Variable declaration, 'libdir' has value '/lib' line>includedir=${prefix}/include Variable declaration, 'includedir' has value '/usr/include' line> line>Name: libmnl line>Description: Minimalistic Netlink communication library line>URL: http://netfilter.org/projects/libmnl/ line>Version: 1.0.2 line>Requires: line>Conflicts: line>Libs: -L${libdir} -lmnl line>Cflags: -I${includedir} Path position of 'libmnl' is 1 Package libmnl has -I/usr/include in Cflags Removing -I/usr/include from cflags for libmnl Adding 'libmnl' to list of known packages, returning as package 'libmnl' original: libmnl sorted: libmnl original: libmnl sorted: libmnl original: libmnl sorted: libmnl original: libmnl sorted: libmnl -L/lib -lmnl cross-pkg-config: warning: ### end of dump ############################### cross-pkg-config: warning: ### suspicious compile flags dumped here ###### -L/lib cross-pkg-config: warning: ### end of flag dump ########################## cross-pkg-config: error: host -I or -L paths detected: -L/lib -lmnl The following sed fix the output modification (for output= definition) : pkg-config --cflags --libs libmnl | sed -e 's:\(-[IL][[:space:]]*\)\(/usr\|/lib\):\1'"${SYSROOT}"'\2:g' -L/usr/i586-pc-linux-gnu/lib -lmnl Maybe a negative lookahead could be not generic here ? Reproducible: Always
pkg-config should not be outputting -L/lib in the first place
(In reply to comment #1) > pkg-config should not be outputting -L/lib in the first place So for you, it's a bug in libmnl ? It's shouldn't place .so files in /lib ? There no reason for that imho.
(In reply to comment #2) > (In reply to comment #1) > > pkg-config should not be outputting -L/lib in the first place > > So for you, it's a bug in libmnl ? It's shouldn't place .so files in /lib ? > > There no reason for that imho. Or maybe just in ebuild : src_configure() { econf \ - --libdir="${EPREFIX}"/$(get_libdir) + --libdir="${EPREFIX}"/usr/$(get_libdir) }
(In reply to comment #2) no, i'm not saying that at all. i am saying that if a .pc file uses a standard system libdir such as /lib or /lib64 or ..., pkg-config should automatically skip it. it has logic internally to do this for /usr/lib and /usr/lib64 and ...
fixed in 0.28 and 9999
(In reply to Samuli Suominen from comment #5) > fixed in 0.28 and 9999 I have to say that it's not OK with dev-util/pkgconfig-0.28 # PKG_CONFIG_LIBDIR=/usr/i586-pc-linux-gnu/usr/lib/pkgconfig:/usr/i586-pc-linux-gnu/usr/share/pkgconfig pkg-config --cflags --libs libmnl -L/lib -lmnl # i586-pc-linux-gnu-pkg-config --cflags --libs libmnl cross-pkg-config: warning: ### falling down so here is a dump state ###### Error printing enabled by default due to use of output options besides --exists or --atleast/exact/max-version. Value of --silence-errors: 0 Error printing enabled Adding virtual 'pkg-config' package to list of known packages Scanning directory '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig' Ignoring file '.' in search directory; not a .pc file Ignoring file '..' in search directory; not a .pc file File 'libffi.pc' appears to be a .pc file Will find package 'libffi' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libffi.pc' File 'expat.pc' appears to be a .pc file Will find package 'expat' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/expat.pc' File 'openssl.pc' appears to be a .pc file Will find package 'openssl' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/openssl.pc' File 'libipq.pc' appears to be a .pc file Will find package 'libipq' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libipq.pc' File 'sqlite3.pc' appears to be a .pc file Will find package 'sqlite3' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/sqlite3.pc' File 'glib-2.0.pc' appears to be a .pc file Will find package 'glib-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/glib-2.0.pc' File 'libmnl.pc' appears to be a .pc file Will find package 'libmnl' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libmnl.pc' File 'libip4tc.pc' appears to be a .pc file Will find package 'libip4tc' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libip4tc.pc' File 'libpci.pc' appears to be a .pc file Will find package 'libpci' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libpci.pc' File 'python-3.2.pc' appears to be a .pc file Will find package 'python-3.2' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/python-3.2.pc' File 'libip6tc.pc' appears to be a .pc file Will find package 'libip6tc' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libip6tc.pc' File 'libssl.pc' appears to be a .pc file Will find package 'libssl' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libssl.pc' File 'gmodule-no-export-2.0.pc' appears to be a .pc file Will find package 'gmodule-no-export-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/gmodule-no-export-2.0.pc' File 'libnl-1.pc' appears to be a .pc file Will find package 'libnl-1' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libnl-1.pc' File 'libcrypto.pc' appears to be a .pc file Will find package 'libcrypto' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libcrypto.pc' File 'panel.pc' appears to be a .pc file Will find package 'panel' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/panel.pc' File 'zlib.pc' appears to be a .pc file Will find package 'zlib' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/zlib.pc' File 'xtables.pc' appears to be a .pc file Will find package 'xtables' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/xtables.pc' File 'menu.pc' appears to be a .pc file Will find package 'menu' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/menu.pc' File 'gmodule-export-2.0.pc' appears to be a .pc file Will find package 'gmodule-export-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/gmodule-export-2.0.pc' File 'form.pc' appears to be a .pc file Will find package 'form' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/form.pc' File 'gio-2.0.pc' appears to be a .pc file Will find package 'gio-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/gio-2.0.pc' File 'ncurses.pc' appears to be a .pc file Will find package 'ncurses' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/ncurses.pc' File 'libxml-2.0.pc' appears to be a .pc file Will find package 'libxml-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libxml-2.0.pc' File 'libiptc.pc' appears to be a .pc file Will find package 'libiptc' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libiptc.pc' File 'iksemel.pc' appears to be a .pc file Will find package 'iksemel' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/iksemel.pc' File 'gmodule-2.0.pc' appears to be a .pc file Will find package 'gmodule-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/gmodule-2.0.pc' File 'gio-unix-2.0.pc' appears to be a .pc file Will find package 'gio-unix-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/gio-unix-2.0.pc' File 'gthread-2.0.pc' appears to be a .pc file Will find package 'gthread-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/gthread-2.0.pc' File 'libnfnetlink.pc' appears to be a .pc file Will find package 'libnfnetlink' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libnfnetlink.pc' File 'libcurl.pc' appears to be a .pc file Will find package 'libcurl' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libcurl.pc' File 'libkmod.pc' appears to be a .pc file Will find package 'libkmod' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libkmod.pc' File 'popt.pc' appears to be a .pc file Will find package 'popt' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/popt.pc' File 'gobject-2.0.pc' appears to be a .pc file Will find package 'gobject-2.0' in file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/gobject-2.0.pc' Scanning directory '/usr/i586-pc-linux-gnu/usr/share/pkgconfig' Ignoring file '.' in search directory; not a .pc file Ignoring file '..' in search directory; not a .pc file Looking for package 'libmnl' Looking for package 'libmnl-uninstalled' Reading 'libmnl' from file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libmnl.pc' Parsing package file '/usr/i586-pc-linux-gnu/usr/lib/pkgconfig/libmnl.pc' line> line> line>prefix=/usr Variable declaration, 'prefix' has value '/usr' line>exec_prefix=${prefix} Variable declaration, 'exec_prefix' has value '/usr' line>libdir=/lib Variable declaration, 'libdir' has value '/lib' line>includedir=${prefix}/include Variable declaration, 'includedir' has value '/usr/include' line> line>Name: libmnl line>Description: Minimalistic Netlink communication library line>URL: http://netfilter.org/projects/libmnl/ line>Version: 1.0.3 line>Requires: line>Conflicts: line>Libs: -L${libdir} -lmnl line>Cflags: -I${includedir} Path position of 'libmnl' is 1 Adding 'libmnl' to list of known packages Package libmnl has -I/usr/include in Cflags Removing -I/usr/include from cflags for libmnl pre-remove: libmnl post-remove: libmnl adding CFLAGS_OTHER string "" pre-remove: libmnl post-remove: libmnl original: libmnl sorted: libmnl adding CFLAGS_I string "" pre-remove: libmnl post-remove: libmnl original: libmnl sorted: libmnl adding LIBS_L string "-L/lib " pre-remove: libmnl post-remove: libmnl adding LIBS_OTHER | LIBS_l string "-lmnl " returning flags string "-L/lib -lmnl " -L/lib -lmnl cross-pkg-config: warning: ### end of dump ############################### cross-pkg-config: warning: ### suspicious compile flags dumped here ###### -L/lib cross-pkg-config: warning: ### end of flag dump ########################## cross-pkg-config: error: host -I or -L paths detected: -L/lib -lmnl So this deal with error while cross compiling for example net-libs/libnetfilter_acct
(In reply to Bertrand Jacquin from comment #6) > (In reply to Samuli Suominen from comment #5) > > fixed in 0.28 and 9999 > > I have to say that it's not OK with dev-util/pkgconfig-0.28 Or are you hitting bug 512336?
(In reply to Samuli Suominen from comment #7) > (In reply to Bertrand Jacquin from comment #6) > > (In reply to Samuli Suominen from comment #5) > > > fixed in 0.28 and 9999 > > > > I have to say that it's not OK with dev-util/pkgconfig-0.28 > > Or are you hitting bug 512336? This is two differents issues here.
i think it's partially that issue, and partially the abi issue with crossdev-20140729 (which has sysroot improvements) and the fix from bug 512336, libmnl no longer produces output with the cross-pkg-config