GNOME Bugzilla – Bug 515561
camel-net-utils.[ch] fails to build on recent fedora development
Last modified: 2013-09-14 16:50:06 UTC
I get this: gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I./.. -I../intl -DCAMEL_LIBEXECDIR=\"/opt/gnome2/libexec\" -DCAMEL_PROVIDERDIR=\"/opt/gnome2/lib/evolution-data-server-1.2/camel-providers\" -DG_LOG_DOMAIN=\"camel\" -DE_DATA_SERVER_PREFIX=\"/opt/gnome2\" -DEVOLUTION_LOCALEDIR=\"/opt/gnome2/share/locale\" -pthread -I/opt/gnome2/include/gnome-vfs-2.0 -I/opt/gnome2/lib/gnome-vfs-2.0/include -I/opt/gnome2/include/gconf/2 -I/opt/gnome2/include/glib-2.0 -I/opt/gnome2/lib/glib-2.0/include -I/usr/include/nspr4 -I/usr/include/nss3 -D_LARGEFILE64_SOURCE -g -O0 -D_FORTIFY_SOURCE=2 -g -O0 -D_FORTIFY_SOURCE=2 -Wall -Wmissing-prototypes -Wno-sign-compare -Wno-pointer-sign -MT camel-mime-utils.lo -MD -MP -MF .deps/camel-mime-utils.Tpo -c camel-mime-utils.c -fPIC -DPIC -o .libs/camel-mime-utils.o In file included from camel-mime-utils.c:55: camel-net-utils.h:52: error: redefinition of 'struct addrinfo' make[3]: *** [camel-mime-utils.lo] Error 1 make[3]: Leaving directory `/home/kmaraas/cvs/gnome/evolution-data-server/camel' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/kmaraas/cvs/gnome/evolution-data-server/camel' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/kmaraas/cvs/gnome/evolution-data-server' make: *** [all] Error 2 Looks like the checks for getaddrinfo/getnameinfo in configure.in fail for some reason: dnl ************************************************** dnl * IPv6 support and getaddrinfo calls dnl ************************************************** AC_CACHE_CHECK([if system supports getaddrinfo and getnameinfo], have_addrinfo, [ AC_TRY_COMPILE([ #include "confdefs.h" #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <stddef.h> ],[ struct addrinfo hints, *res; struct sockaddr_in6 sin6; int af = AF_INET6; char host[NI_MAXHOST]; char serv[NI_MAXSERV]; getaddrinfo ("www.ximian.com", NULL, &hints, &res); freeaddrinfo (res); getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), host, sizeof(host), serv, sizeof(serv), 0); ],[ have_addrinfo=yes ],[ have_addrinfo=no ]) ]) From config.log: dnl ************************************************** dnl * IPv6 support and getaddrinfo calls dnl ************************************************** AC_CACHE_CHECK([if system supports getaddrinfo and getnameinfo], have_addrinfo, [ AC_TRY_COMPILE([ #include "confdefs.h" #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <stddef.h> ],[ struct addrinfo hints, *res; struct sockaddr_in6 sin6; int af = AF_INET6; char host[NI_MAXHOST]; char serv[NI_MAXSERV]; getaddrinfo ("www.ximian.com", NULL, &hints, &res); freeaddrinfo (res); getnameinfo((struct sockaddr *)&sin6, sizeof(sin6), host, sizeof(host), serv, sizeof(serv), 0); ],[ have_addrinfo=yes ],[ have_addrinfo=no ]) ]) From config.log: configure:27241: checking if system supports getaddrinfo and getnameinfo configure:27286: gcc -c -g -O0 -D_FORTIFY_SOURCE=2 -g -O0 -D_FORTIFY_SOURCE=2 conftest.c >&5 conftest.c: In function 'main': conftest.c:75: error: 'NI_MAXHOST' undeclared (first use in this function) conftest.c:75: error: (Each undeclared identifier is reported only once conftest.c:75: error: for each function it appears in.) conftest.c:76: error: 'NI_MAXSERV' undeclared (first use in this function) configure:27292: $? = 1 configure: failed program was: | /* confdefs.h. */ So, first the check shouldn't fail since I do have getaddrinfo, and second the NEED_ADDRINFO case seems to not build either?
So, this change seems to have caused this: http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/resolv/netdb.h.diff?r1=1.47&r2=1.47.2.1&cvsroot=glibc This was probably done because those two defines are not part of IEEE 1003.1-2004 and thus are a GNU extension? Should we #define _GNU_SOURCE in camel-net-utils.h?
*** This bug has been marked as a duplicate of 516074 ***