Iptables sources ARE not installed in both cases.
This i have got with pkgconfig 0.27.1
./configure --kver=3.6.11-gentoo-HOSTEL7 --kdir=/usr/src/linux --ipt-ver=1.4.16.3 --ipt-lib=/usr/lib64/xtables
Kernel version: 3.6.11-gentoo-HOSTEL7
Kernel sources: /usr/src/linux
Iptables binary version: 1.4.16.3 (user specified)
pkg-config for version 1.4.16.3 exists: Yes
Iptables include path: (pkg-config)
Iptables module path: /usr/lib64/xtables (user specified)
Creating Makefile.. done.
Now run: make all install
Then when i compile it - all is perfect.
And this - with pkgconfig 0.28
./configure --kver=3.6.11-gentoo-HOSTEL7 --kdir=/usr/src/linux --ipt-ver=1.4.16.3 --ipt-lib=/usr/lib64/xtables
Kernel version: 3.6.11-gentoo-HOSTEL7
Kernel sources: /usr/src/linux
Iptables binary version: 1.4.16.3 (user specified)
pkg-config for version 1.4.16.3 exists: Yes
Searching for iptables-1.4.16.3 sources..
./configure: line 150: locate: command not found
! Error: Can not find iptables source directory, try setting it with --ipt-src=
And here - it failes :-(
Downstream bugreport in Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=455984
I dont dig gentoo. Can you show me output of:
# pkg-config --list-all|grep tables
# strace -e file pkg-config --cflags xtables
It will have line like this:
open("/usr/local/lib/pkgconfig/xtables.pc", O_RDONLY) = 3
Then shwo that file:
# cat /usr/local/lib/pkgconfig/xtables.pc
You may show output of both versions of pkgconfig.
From machine with pkgconfig 0.28:
hostel7-gw ~ # pkg-config --list-all | grep iptables
libip4tc libip4tc - iptables IPv4 ruleset ADT and kernel interface
libiptc libiptc - iptables v4/v6 ruleset ADT and kernel interface
libip6tc libip6tc - iptables IPv6 ruleset ADT and kernel interface
hostel7-gw ~ # cat strace-pkg-config.log | grep xtables.pc
stat("/usr/lib64/pkgconfig/xtables.pc", {st_mode=S_IFREG|0644, st_size=278, ...}) = 0
open("/usr/lib64/pkgconfig/xtables.pc", O_RDONLY) = 3
hostel7-gw ~ # cat /usr/lib64/pkgconfig/xtables.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
xtlibdir=/usr/lib64/xtables
includedir=${prefix}/include
Name: xtables
Description: Shared Xtables code for extensions and iproute2
Version: 1.4.16.3
Cflags: -I${includedir}
Libs: -L${libdir} -lxtables
Libs.private: -ldl
strace of 'pkg-config --cflags xtables'
Sorry, mistype first command that you are requested
hostel7-gw ~ # pkg-config --list-all|grep tables
xtables xtables - Shared Xtables code for extensions and iproute2
libip4tc libip4tc - iptables IPv4 ruleset ADT and kernel interface
libiptc libiptc - iptables v4/v6 ruleset ADT and kernel interface
libip6tc libip6tc - iptables IPv6 ruleset ADT and kernel interface
Thanks. But you didn't show me full output of strace. Then, can you show me at least output of: `pkg-config --cflags xtables' ?
Please show output of `pkg-config --cflags xtables' on both versions of pkgconfig.
I have put strace output in attachment
On machine with 0.27.1:
pinkbyte@phantom ~ $ pkg-config --cflags xtables
pinkbyte@phantom ~ $
On machine with 0.28:
hostel7-gw ~ # pkg-config --cflags xtables
hostel7-gw ~ #
So, as you see - output is empty string in both cases.
Try all of these, pls:
pkg-config --print-errors --modversion xtables
pkg-config --print-errors --cflags xtables
pkg-config --exact-version=1.4.16.3 --cflags xtables
On both, or at least on 0.28
On machine with pkgconfig 0.28:
hostel7-gw / # pkg-config --print-errors --modversion xtables
1.4.16.3
hostel7-gw / # pkg-config --print-errors --cflags xtables
hostel7-gw / # pkg-config --exact-version=1.4.16.3 --cflags xtables
Ignoring incompatible output option "--cflags"
Same with 0.27.1:
pinkbyte@phantom / $ pkg-config --print-errors --modversion xtables
1.4.16.3
pinkbyte@phantom / $ pkg-config --print-errors --cflags xtables
pinkbyte@phantom / $ pkg-config --exact-version=1.4.16.3 --cflags xtables
pinkbyte@phantom / $ pkg-config --print-errors --modversion xtables
1.4.16.3
pinkbyte@phantom / $ pkg-config --print-errors --cflags xtables
pinkbyte@phantom / $ pkg-config --exact-version=1.4.16.3 --cflags xtables
As i understand, It seems that problem is with --exact-version, that is more strictly parsed in new pkgconfig? :-/
and sorry for doubling results in 0.27.1 output
No, problem is with --cflags not reporting Cflags as expected. Can you still show full output of `strace -e file pkg-config --cflags xtables' ?
And aditionaly pls show output of:
# pkg-config --cflags xtables
# echo $?
I personally tried new ver of pkg-config and it outputs clags properly:
~/pkg-config-0.28# ./pkg-config --cflags xtables
-I/usr/local/include
As i said earlier - it is attachment. Anyway, i am posting it here:
hostel7-gw ~ # strace -e file pkg-config --cflags xtables
execve("/usr/bin/pkg-config", ["pkg-config", "--cflags", "xtables"], [/* 27 vars */]) = 0
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib64/libglib-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib64/pkgconfig", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
stat("/usr/lib64/pkgconfig/libffi.pc", {st_mode=S_IFREG|0644, st_size=233, ...}) = 0
stat("/usr/lib64/pkgconfig/expat.pc", {st_mode=S_IFREG|0644, st_size=218, ...}) = 0
stat("/usr/lib64/pkgconfig/openssl.pc", {st_mode=S_IFREG|0644, st_size=220, ...}) = 0
stat("/usr/lib64/pkgconfig/menuw.pc", {st_mode=S_IFREG|0644, st_size=265, ...}) = 0
stat("/usr/lib64/pkgconfig/ext2fs.pc", {st_mode=S_IFREG|0644, st_size=221, ...}) = 0
stat("/usr/lib64/pkgconfig/libgvc.pc", {st_mode=S_IFREG|0644, st_size=235, ...}) = 0
stat("/usr/lib64/pkgconfig/expatu.pc", {st_mode=S_IFREG|0644, st_size=219, ...}) = 0
stat("/usr/lib64/pkgconfig/expatw.pc", {st_mode=S_IFREG|0644, st_size=219, ...}) = 0
stat("/usr/lib64/pkgconfig/glib-2.0.pc", {st_mode=S_IFREG|0644, st_size=371, ...}) = 0
stat("/usr/lib64/pkgconfig/ncurses++.pc", {st_mode=S_IFREG|0644, st_size=269, ...}) = 0
stat("/usr/lib64/pkgconfig/freetype2.pc", {st_mode=S_IFREG|0644, st_size=290, ...}) = 0
stat("/usr/lib64/pkgconfig/python-2.7.pc", {st_mode=S_IFREG|0644, st_size=250, ...}) = 0
stat("/usr/lib64/pkgconfig/libip4tc.pc", {st_mode=S_IFREG|0644, st_size=228, ...}) = 0
stat("/usr/lib64/pkgconfig/libpci.pc", {st_mode=S_IFREG|0644, st_size=204, ...}) = 0
stat("/usr/lib64/pkgconfig/libpng.pc", {st_mode=S_IFREG|0644, st_size=236, ...}) = 0
stat("/usr/lib64/pkgconfig/ss.pc", {st_mode=S_IFREG|0644, st_size=247, ...}) = 0
stat("/usr/lib64/pkgconfig/libip6tc.pc", {st_mode=S_IFREG|0644, st_size=228, ...}) = 0
stat("/usr/lib64/pkgconfig/liblzma.pc", {st_mode=S_IFREG|0644, st_size=392, ...}) = 0
stat("/usr/lib64/pkgconfig/libssl.pc", {st_mode=S_IFREG|0644, st_size=290, ...}) = 0
stat("/usr/lib64/pkgconfig/gmodule-no-export-2.0.pc", {st_mode=S_IFREG|0644, st_size=281, ...}) = 0
stat("/usr/lib64/pkgconfig/libudev.pc", {st_mode=S_IFREG|0644, st_size=223, ...}) = 0
stat("/usr/lib64/pkgconfig/ncurses++w.pc", {st_mode=S_IFREG|0644, st_size=294, ...}) = 0
stat("/usr/lib64/pkgconfig/libcrypto.pc", {st_mode=S_IFREG|0644, st_size=260, ...}) = 0
stat("/usr/lib64/pkgconfig/panel.pc", {st_mode=S_IFREG|0644, st_size=245, ...}) = 0
stat("/usr/lib64/pkgconfig/formw.pc", {st_mode=S_IFREG|0644, st_size=265, ...}) = 0
stat("/usr/lib64/pkgconfig/panelw.pc", {st_mode=S_IFREG|0644, st_size=267, ...}) = 0
stat("/usr/lib64/pkgconfig/zlib.pc", {st_mode=S_IFREG|0644, st_size=244, ...}) = 0
stat("/usr/lib64/pkgconfig/xtables.pc", {st_mode=S_IFREG|0644, st_size=278, ...}) = 0
stat("/usr/lib64/pkgconfig/menu.pc", {st_mode=S_IFREG|0644, st_size=243, ...}) = 0
stat("/usr/lib64/pkgconfig/libcgraph.pc", {st_mode=S_IFREG|0644, st_size=309, ...}) = 0
stat("/usr/lib64/pkgconfig/gmodule-export-2.0.pc", {st_mode=S_IFREG|0644, st_size=302, ...}) = 0
stat("/usr/lib64/pkgconfig/blkid.pc", {st_mode=S_IFREG|0644, st_size=236, ...}) = 0
stat("/usr/lib64/pkgconfig/e2p.pc", {st_mode=S_IFREG|0644, st_size=223, ...}) = 0
stat("/usr/lib64/pkgconfig/apr-1.pc", {st_mode=S_IFREG|0644, st_size=343, ...}) = 0
stat("/usr/lib64/pkgconfig/libgvpr.pc", {st_mode=S_IFREG|0644, st_size=216, ...}) = 0
stat("/usr/lib64/pkgconfig/libpcre.pc", {st_mode=S_IFREG|0644, st_size=293, ...}) = 0
stat("/usr/lib64/pkgconfig/form.pc", {st_mode=S_IFREG|0644, st_size=243, ...}) = 0
stat("/usr/lib64/pkgconfig/libpcrecpp.pc", {st_mode=S_IFREG|0644, st_size=248, ...}) = 0
stat("/usr/lib64/pkgconfig/gio-2.0.pc", {st_mode=S_IFREG|0644, st_size=427, ...}) = 0
stat("/usr/lib64/pkgconfig/ncurses.pc", {st_mode=S_IFREG|0644, st_size=236, ...}) = 0
stat("/usr/lib64/pkgconfig/libpcreposix.pc", {st_mode=S_IFREG|0644, st_size=297, ...}) = 0
stat("/usr/lib64/pkgconfig/openrc.pc", {st_mode=S_IFREG|0644, st_size=189, ...}) = 0
stat("/usr/lib64/pkgconfig/mount.pc", {st_mode=S_IFREG|0644, st_size=230, ...}) = 0
stat("/usr/lib64/pkgconfig/ncursesw.pc", {st_mode=S_IFREG|0644, st_size=257, ...}) = 0
stat("/usr/lib64/pkgconfig/libxml-2.0.pc", {st_mode=S_IFREG|0644, st_size=253, ...}) = 0
stat("/usr/lib64/pkgconfig/libpathplan.pc", {st_mode=S_IFREG|0644, st_size=263, ...}) = 0
stat("/usr/lib64/pkgconfig/libiptc.pc", {st_mode=S_IFREG|0644, st_size=205, ...}) = 0
stat("/usr/lib64/pkgconfig/libxdot.pc", {st_mode=S_IFREG|0644, st_size=225, ...}) = 0
stat("/usr/lib64/pkgconfig/gmodule-2.0.pc", {st_mode=S_IFREG|0644, st_size=302, ...}) = 0
stat("/usr/lib64/pkgconfig/gio-unix-2.0.pc", {st_mode=S_IFREG|0644, st_size=279, ...}) = 0
stat("/usr/lib64/pkgconfig/libpng15.pc", {st_mode=S_IFREG|0644, st_size=236, ...}) = 0
stat("/usr/lib64/pkgconfig/uuid.pc", {st_mode=S_IFREG|0644, st_size=226, ...}) = 0
stat("/usr/lib64/pkgconfig/libarchive.pc", {st_mode=S_IFREG|0644, st_size=309, ...}) = 0
stat("/usr/lib64/pkgconfig/com_err.pc", {st_mode=S_IFREG|0644, st_size=245, ...}) = 0
stat("/usr/lib64/pkgconfig/gthread-2.0.pc", {st_mode=S_IFREG|0644, st_size=231, ...}) = 0
stat("/usr/lib64/pkgconfig/einfo.pc", {st_mode=S_IFREG|0644, st_size=182, ...}) = 0
stat("/usr/lib64/pkgconfig/libgraph.pc", {st_mode=S_IFREG|0644, st_size=307, ...}) = 0
stat("/usr/lib64/pkgconfig/libcurl.pc", {st_mode=S_IFREG|0644, st_size=1569, ...}) = 0
stat("/usr/lib64/pkgconfig/popt.pc", {st_mode=S_IFREG|0644, st_size=171, ...}) = 0
stat("/usr/lib64/pkgconfig/libcdt.pc", {st_mode=S_IFREG|0644, st_size=208, ...}) = 0
stat("/usr/lib64/pkgconfig/fontconfig.pc", {st_mode=S_IFREG|0644, st_size=272, ...}) = 0
stat("/usr/lib64/pkgconfig/gobject-2.0.pc", {st_mode=S_IFREG|0644, st_size=254, ...}) = 0
openat(AT_FDCWD, "/usr/share/pkgconfig", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
stat("/usr/share/pkgconfig/udev.pc", {st_mode=S_IFREG|0644, st_size=61, ...}) = 0
stat("/usr/share/pkgconfig/shared-mime-info.pc", {st_mode=S_IFREG|0644, st_size=119, ...}) = 0
open("/usr/lib64/pkgconfig/xtables.pc", O_RDONLY) = 3
+++ exited with 0 +++
hostel7-gw ~ # pkg-config --cflags xtables
hostel7-gw ~ # echo $?
0
And about CFLAGS - as you can see it does not output them in 0.27.1 too, but configuration does not fail - it fails only with 0.28.
Thanks. I understand it does not fail on 0.27.1. But the problem with cflags is more important, and generally it is he same - pkg-config is not reporting what it should report. I don't have idea why, as of yet. Content of /usr/lib64/pkgconfig/xtables.pc which you pasted shows that it have Cflags defined. So it should output it...
> But really, i am tired of that self-made configure stuff mess :-(.
Nice arrogant opition. But I think GNU configure is a real mess.
> --kver=3.6.11-gentoo-HOSTEL7 --kdir=/usr/src/linux --ipt-ver=1.4.16.3 --ipt-lib=/usr/lib64/xtables
Why you hard coding all these parameters, which is mess, if you have just one iptables installed? Mess. Why this `--kdir=/usr/src/linux' ? Its mess. Kernel source show be accessible via /lib/modules/`uname -r`/build in normal system.
Fix your messy gentoo system first, so that `pkg-config' works properly, then may be you can say about code, which rely in it, that is mess.
>Nice arrogant opition. But I think GNU configure is a real mess.
Sorry for harsh words, but your configure script may not support some valuable features for source-based distro. For example(i did not check with your script, just talking generally now) - cross-compilation or installation in Prefix(do not mix this with --prefix, it's more complicated, http://www.gentoo.org/proj/en/gentoo-alt/prefix/\). This features, however, is not critical for inclusion in portage tree.
>Why you hard coding all these parameters, which is mess, if you have just
>one iptables installed? Mess. Why this `--kdir=/usr/src/linux' ? Its mess.
>Kernel source show be accessible via /lib/modules/`uname -r`/build in
>normal system.
>Fix your messy gentoo system first, so that `pkg-config' works properly,
>then may be you can say about code, which rely in it, that is mess.
It is not messy - other packages installs fine. About hardcoding options - it's part of Gentoo QA - we do not accept automagic more that it would be needed. We can have more that one kernel sources installed at once. About iptables version - If i do not define iptables version, configure script fails too(well, it fails in previous version, do not really check if it fails now).
>Kernel source show be accessible via /lib/modules/`uname -r`/build in
>normal system.
Yes, of course, they are accessible, but Gentoo QA says that this is current kernel sources, and building should be done with sources, chosen by user(those, which is installed in /usr/src). For example, user can install new kernel, use eselect to choose it(eselect just points /usr/src/linux symlink to proper kernel sources directory) and build external module for new kernel without rebooting. Then - user reboots into new kernel with already compiled external module.
If we rely on /lib/`uname -r` user should update kernel first, reboot and then - compile a module. And he could not compile module for a different kernel(to test if it fails, before rebooting, for example).
And, once more time, when i reported that to you as upstream, i have tried to build this manually, without portage(but with all those options, that is supported by your configure script) - to exclude distro problems. So, claims about Gentoo buildsystem brokeness seems pointless for me in this case.
FYI, i have to dig deeper myself and that's what i have discovered:
pkgconfig(both 0.27.1 and 0.28) is build on Gentoo with options(note, that this is vanilla options, in Gentoo we have no patches for pkgconfig behaviour):
--with-system-include-path="${EPREFIX}"/usr/include \ --with-system-library-path="${EPREFIX}"/usr/$(get_libdir) \
EPREFIX is empty in normal installation(e.g. not Gentoo/Prefix ones), get_libdir returns 'lib' on clear 32-bit systems and 'lib64' on multilib systems(amd64, for example).
Now, see ./configure --help of pkgconfig:
--with-system-include-path
avoid -I flags from the given path
--with-system-library-path
avoid -L flags from the given path
And one more time - xtables.pc
pinkbyte@phantom /var/tmp/portage/dev-util/pkgconfig-0.28/work/pkg-config-0.28 $ cat /usr/lib64/pkgconfig/xtables.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
xtlibdir=/usr/lib64/xtables
includedir=${prefix}/include
Name: xtables
Description: Shared Xtables code for extensions and iproute2
Version: 1.4.16.3
Cflags: -I${includedir}
Libs: -L${libdir} -lxtables
Libs.private: -ldl
As you see Cflags is '-I/usr/include', so it's dropped by pkgconfig itself and this is correct behaviour
Thanks for explanation about pkgconfig. Probably pkgconfig 0.28 strips space from --cflags output when there is no output. Older verions seems to output blank space. (And that passed some if[]s.)
$ pkg-config --cflags xtables|xxd
0000000: 200a
I need some time to rethink how to check for pkg-config results...
> So, claims about Gentoo buildsystem brokeness seems pointless for me in this case.
Pointless to blame single developer for not supporting all idiosyncrasies of all distributions in the world. If you want to add something to the source for Gentoo - I am not against of it. This is development process, things being developed gradually.
I just commited into git fixed version of configure, please try. That now should correctly handle any version of pkg-config.
>Pointless to blame single developer for not supporting all idiosyncrasies of all distributions in the world.
You are right, sorry for that. Maybe i was so angry, cause i was fighting against one more package with custom buildsystem (FYI, it's iroffer-dinoex - IRC bot to share files via DCC). So, i was wrong in this case...
>I just commited into git fixed version of configure, please try
It works both with 0.27.1 and with 0.28. Thanks.
Thanks!