Hello Paul, > I installed the following patch to gnulib, to fix the following > symptoms when trying to build coreutils 7.2 on Solaris 8: > > inet_ntop.c:73: error: conflicting types for 'inet_ntop' > /usr/include/arpa/inet.h:55: error: previous declaration of 'inet_ntop' was > here > make[4]: *** [inet_ntop.o] Error 1
The assumption in the 'inet_ntop' module is that if a platform provides the inet_ntop function, it declares it, and vice versa. This is true for Solaris 8. The actual problem is that Solaris 8 defines this function in libnsl, but the code in m4/arpa_inet.m4: AC_REPLACE_FUNCS([inet_ntop]) expects to see this function in libc. There is no point for gnulib to redefine a function that is present in libnsl (and hopefully working). IMO the fix is therefore to add a 'Link' section to the module description module/inet_ntop, and determine its value, say, INET_NTOP_LIB, in the gl_INET_NTOP macro. Btw, your patch was incomplete: 1) It does the redefinition #define inet_ntop rpl_inet_ntop unconditionally, also on platforms on which the inet_ntop function exists in libc and is not replaced by m4/inet_ntop.m4. This will lead to link errors. The fix would have been to add a #if !...@have_inet_ntop@ conditional. 2) When you removed the !...@have_decl_inet_ntop@ conditional, the definition of this macro in m4/inet_ntop.m4, m4/arpa_inet_h.m4, modules/arpa_inet could also be removed. Bruno