Ticket #70 (closed defect: lackofresponse)
function socket.c, line 399, `IPV6_V6ONLY' undeclared
| Reported by: | cfriedt | Owned by: | lathiat |
|---|---|---|---|
| Milestone: | Component: | avahi-core | |
| Keywords: | IPV6_V6ONLY | Cc: |
Description
Hi avahi people,
I'm trying to compile avahi for an embedded device and I would like to only have the avahi-core library. I've disabled everything else as far as I could tell. There doesn't seem to be a ./configure option for IPV6 so aside from altering the code, I don't think there's any way for me to prevent the compile-time error further below.
This happens both with 0.6.15 and 0.6.12, and likely the versions in between.
My ./configure line is here:
CC=arm-linux-gcc ./configure --build=i686-pc-linux-gnu --host=arm-9tdmi-linux-gnu --prefix=$PWD/../avahi-0.6.12-arm --disable-glib --disable-qt3 --disable-qt4 --disable-gtk --disable-dbus --disable-expat --disable-gdbm --disable-libdaemon --disable-python --disable-pygtk --disable-python-dbus --disable-mono --disable-monodoc --disable-doxygen-doc --disable-manpages --with-distro=debian
I just grepped for IPV6_V6ONLY recursively through /usr/include, and i found it in:
/usr/include/linux/in6.h
/usr/include/linux/in6.h:172:#define IPV6_V6ONLY
Is this a known bug? Would it fix the problem by simply adding
#ifdef ... ipv6 code #endif
code to the function / header files (socket.c/h i guess) ? Is there some reason why IPv6 is always built?
Many thanks. I'm going to patch this myself for now, should I send you the diff?
~/Chris
arm-linux-gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. "-DDEBUG_TRAP=__asm__(\"int \$3\")" -g -O2 -Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline -MT libavahi_core_la-socket.lo -MD -MP -MF .deps/libavahi_core_la-socket.Tpo -c socket.c -fPIC -DPIC -o .libs/libavahi_core_la-socket.o socket.c: In function `avahi_open_socket_ipv6': socket.c:399: error: `IPV6_V6ONLY' undeclared (first use in this function) socket.c:399: error: (Each undeclared identifier is reported only once socket.c:399: error: for each function it appears in.) socket.c: In function `avahi_send_dns_packet_ipv4': socket.c:520: warning: cast increases required alignment of target type socket.c: In function `avahi_send_dns_packet_ipv6': socket.c:603: warning: cast increases required alignment of target type socket.c: In function `avahi_recv_dns_packet_ipv4': socket.c:692: warning: cast increases required alignment of target type socket.c:698: warning: cast increases required alignment of target type socket.c: In function `avahi_recv_dns_packet_ipv6': socket.c:815: warning: cast increases required alignment of target type socket.c:822: warning: cast increases required alignment of target type make[2]: *** [libavahi_core_la-socket.lo] Error 1 make[2]: Leaving directory `/home/cfriedt/Desktop/avahi-0.6.12/avahi-core' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/cfriedt/Desktop/avahi-0.6.12' make: *** [all] Error 2
