Making all in ntpd make[2]: Entering directory `/var/tmp/portage/ntp-4.1.1a/work/ntp-4.1.1a/ntpd' source='ntp_config.c' object='ntp_config.o' libtool=no \ depfile='.deps/ntp_config.Po' tmpdepfile='.deps/ntp_config.TPo' \ depmode=gcc /bin/sh ../depcomp \ i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../librsaref -march=i686 -O3 -pipe -Wall -Wcast-qual -Wmissing-prototypes -Wshadow -Wstrict-prototypes -pipe -c `test -f ntp_config.c || echo './'`ntp_config.c ntp_config.c:130: `CONFIG_PHONE' undeclared here (not in a function) ntp_config.c:130: initializer element is not constant ntp_config.c:130: (near initialization for `keywords[21].keytype') ntp_config.c: In function `getconfig': ntp_config.c:1619: `CONFIG_PHONE' undeclared (first use in this function) ntp_config.c:1619: (Each undeclared identifier is reported only once ntp_config.c:1619: for each function it appears in.) make[2]: *** [ntp_config.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/ntp-4.1.1a/work/ntp-4.1.1a/ntpd' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/ntp-4.1.1a/work/ntp-4.1.1a' make: *** [all] Error 2 !!! ERROR: The ebuild did not complete successfully. !!! Function src_compile, Line 10, Exitcode 2 !!! (no error message) !!! emerge aborting on /usr/portage/net-misc/ntp/ntp-4.1.1a.ebuild . Don't ask me what CONFIG_PHONE is or where it comes from. There are no use flags to turn on/off...
Which gcc are you using? It works just fine here, and CONFIG_PHONE is part of the package. What filesystems (note the 's') are you using? Try this: host ntpd # pwd /var/tmp/portage/ntp-4.1.1a/work/ntp-4.1.1a/ntpd host ntpd # cpp -DHAVE_CONFIG_H -I../include -I. -I.. -I../librsaref ntp_config.c | grep 'phone' extern char sys_phone[][60 ]; { "phone", 29 }, char sys_phone[5 ][60 ]; memset((char *)sys_phone, 0, sizeof(sys_phone)); (void)strncpy(sys_phone[i - 1], sys_phone[i - 1][0] = '\0'; host ntpd # What you are looking for the the line that has the 29 in it. If it doesn't, what errors do you get?
The problem is that /usr/include/linux/autoconf.h does /usr/include/linux/autoconf.h:#undef CONFIG_PHONE and for some reason autoconf.h gets included down the line. /usr/include/linux on my system is a symlink to /usr/src/linux, which in turn is a symlink to linux-2.4.19-r7, the kernel I run. autoconf.h is automatically created my Linux' make menuconfig, and does not contain any #ifdef guards that easily prevents it from being included. Any ideas (apart from adding telephony support to my kernel, which I really don't need nor want) ?
THe contents of /usr/include/linux/autoconf.h shouldn't have anything to do with it. I'll check again but I don't think they are ever referenced. Did you try any of the stuff I suggested?
Yes, I tried what you suggested. CONFIG_PHONE is not expanded, it looks like this: [#31 /var/tmp/portage/ntp-4.1.1a/work/ntp-4.1.1a/ntpd] gcc -E -DHAVE_CONFIG_H -I../include -I. -I.. -I../librsaref ntp_config.c | grep phone extern char sys_phone[][60 ]; { "phone", CONFIG_PHONE }, char sys_phone[5 ][60 ]; memset((char *)sys_phone, 0, sizeof(sys_phone)); (void)strncpy(sys_phone[i - 1], sys_phone[i - 1][0] = '\0'; If I remove /usr/include/linux/autoconf.h, CONFIG_PHONE is replaced with 29, as it should. After removing autoconf.h, I get the errors: [#26 /var/tmp/portage/ntp-4.1.1a/work/ntp-4.1.1a/ntpd] gcc -E -DHAVE_CONFIG_H -I../include -I. -I.. -I../librsaref ntp_config.c >! foo In file included from /usr/include/linux/param.h:4, from /usr/include/sys/param.h:24, from ntp_config.c:28: /usr/include/asm/param.h:4: linux/autoconf.h: No such file or directory Now, the problem occurs only because I have symlinked /usr/include/linux and /usr/include/asm (this was done because another package [was it freeswan ?] wouldn't compile without it). If I restore the header directories from the linux-headers package, ntp compiles and installs very nicely. For future reference, I guess we should mark all packages that need the /usr/include/linux to be a symlink to the properly patched kernel _BAD_, and rather require them to also update linux-headers ?
The bug is in some other package according to karltk - closing.
got a fix :)
http://cvs.gentoo.org/cgi-bin/viewcvs.cgi/gentoo-x86/net-misc/ntp/files/linux-config-phone.patch?rev=1.1&content-type=text/vnd.viewcvs-markup