gobby / libinfinity

libinfinity collaborative editing library
GNU Lesser General Public License v2.1
88 stars 21 forks source link

0.6.3 does not love OS X #7

Closed DomT4 closed 10 years ago

DomT4 commented 10 years ago

Build failures. Build failures galore. Tried with both clang and gcc to no avail.

This is the failure:

/bin/sh ../../libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I../.. -I../../libinfinity  -I../.. -D_REENTRANT -I/usr/local/Cellar/glib/2.42.0/include/glib-2.0 -I/usr/local/Cellar/glib/2.42.0/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/libtasn1/4.2/include -I/usr/local/Cellar/nettle/2.7.1/include -I/usr/local/Cellar/gnutls/3.2.17/include -I/usr/local/Cellar/gsasl/1.8.0/include -I/usr/include/libxml2     -g -O2 -c -o libinfinity_common_la-inf-protocol.lo `test -f 'inf-protocol.c' || echo './'`inf-protocol.c
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I../.. -I../../libinfinity -I../.. -D_REENTRANT -I/usr/local/Cellar/glib/2.42.0/include/glib-2.0 -I/usr/local/Cellar/glib/2.42.0/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/libtasn1/4.2/include -I/usr/local/Cellar/nettle/2.7.1/include -I/usr/local/Cellar/gnutls/3.2.17/include -I/usr/local/Cellar/gsasl/1.8.0/include -I/usr/include/libxml2 -g -O2 -c inf-native-socket.c  -fno-common -DPIC -o .libs/libinfinity_common_la-inf-native-socket.o
inf-name-resolver.c:304:14: error: use of undeclared identifier 'T_SRV'
  if(type != T_SRV)
             ^
inf-name-resolver.c:465:3: error: use of undeclared identifier 'HEADER'
  HEADER* header;
  ^
inf-name-resolver.c:465:11: error: use of undeclared identifier 'header'
  HEADER* header;
          ^
inf-name-resolver.c:486:26: error: use of undeclared identifier 'C_IN'
  len = res_query(query, C_IN, T_SRV, ansbuf, sizeof(ansbuf));
                         ^
inf-name-resolver.c:501:19: error: use of undeclared identifier 'HEADER'
  if(len < sizeof(HEADER))
                  ^
inf-name-resolver.c:509:25: error: use of undeclared identifier 'HEADER'
  cur = ansbuf + sizeof(HEADER);
                        ^
inf-name-resolver.c:511:3: error: use of undeclared identifier 'header'
  header = (HEADER*)msg;
  ^
inf-name-resolver.c:511:13: error: use of undeclared identifier 'HEADER'
  header = (HEADER*)msg;
            ^
inf-name-resolver.c:511:20: error: expected expression
  header = (HEADER*)msg;
                   ^
inf-name-resolver.c:512:23: error: use of undeclared identifier 'header'
  query_count = ntohs(header->qdcount);
                      ^
/usr/include/sys/_endian.h:132:39: note: expanded from macro 'ntohs'
#define ntohs(x)        __DARWIN_OSSwapInt16(x)
                                             ^
/usr/include/libkern/_OSByteOrder.h:72:40: note: expanded from macro '__DARWIN_OSSwapInt16'
    ((__uint16_t)(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)))
                                       ^
inf-name-resolver.c:512:23: error: use of undeclared identifier 'header'
/usr/include/sys/_endian.h:132:39: note: expanded from macro 'ntohs'
#define ntohs(x)        __DARWIN_OSSwapInt16(x)
                                             ^
/usr/include/libkern/_OSByteOrder.h:72:71: note: expanded from macro '__DARWIN_OSSwapInt16'
    ((__uint16_t)(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)))
                                                                      ^
/usr/include/libkern/_OSByteOrder.h:44:34: note: expanded from macro '__DARWIN_OSSwapConstInt16'
    ((__uint16_t)((((__uint16_t)(x) & 0xff00) >> 8) | \
                                 ^
inf-name-resolver.c:512:23: error: use of undeclared identifier 'header'
/usr/include/sys/_endian.h:132:39: note: expanded from macro 'ntohs'
#define ntohs(x)        __DARWIN_OSSwapInt16(x)
                                             ^
/usr/include/libkern/_OSByteOrder.h:72:71: note: expanded from macro '__DARWIN_OSSwapInt16'
    ((__uint16_t)(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)))
                                                                      ^
/usr/include/libkern/_OSByteOrder.h:45:32: note: expanded from macro '__DARWIN_OSSwapConstInt16'
                (((__uint16_t)(x) & 0x00ff) << 8)))
                               ^
inf-name-resolver.c:512:23: error: use of undeclared identifier 'header'
/usr/include/sys/_endian.h:132:39: note: expanded from macro 'ntohs'
#define ntohs(x)        __DARWIN_OSSwapInt16(x)
                                             ^
/usr/include/libkern/_OSByteOrder.h:72:89: note: expanded from macro '__DARWIN_OSSwapInt16'
    ((__uint16_t)(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)))
                                                                                        ^
inf-name-resolver.c:513:24: error: use of undeclared identifier 'header'
  answer_count = ntohs(header->ancount);
                       ^
/usr/include/sys/_endian.h:132:39: note: expanded from macro 'ntohs'
#define ntohs(x)        __DARWIN_OSSwapInt16(x)
                                             ^
/usr/include/libkern/_OSByteOrder.h:72:40: note: expanded from macro '__DARWIN_OSSwapInt16'
    ((__uint16_t)(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)))
                                       ^
inf-name-resolver.c:513:24: error: use of undeclared identifier 'header'
/usr/include/sys/_endian.h:132:39: note: expanded from macro 'ntohs'
#define ntohs(x)        __DARWIN_OSSwapInt16(x)
                                             ^
/usr/include/libkern/_OSByteOrder.h:72:71: note: expanded from macro '__DARWIN_OSSwapInt16'
    ((__uint16_t)(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)))
                                                                      ^
/usr/include/libkern/_OSByteOrder.h:44:34: note: expanded from macro '__DARWIN_OSSwapConstInt16'
    ((__uint16_t)((((__uint16_t)(x) & 0xff00) >> 8) | \
                                 ^
inf-name-resolver.c:513:24: error: use of undeclared identifier 'header'
/usr/include/sys/_endian.h:132:39: note: expanded from macro 'ntohs'
#define ntohs(x)        __DARWIN_OSSwapInt16(x)
                                             ^
/usr/include/libkern/_OSByteOrder.h:72:71: note: expanded from macro '__DARWIN_OSSwapInt16'
    ((__uint16_t)(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)))
                                                                      ^
/usr/include/libkern/_OSByteOrder.h:45:32: note: expanded from macro '__DARWIN_OSSwapConstInt16'
                (((__uint16_t)(x) & 0x00ff) << 8)))
                               ^
inf-name-resolver.c:513:24: error: use of undeclared identifier 'header'
/usr/include/sys/_endian.h:132:39: note: expanded from macro 'ntohs'
#define ntohs(x)        __DARWIN_OSSwapInt16(x)
                                             ^
/usr/include/libkern/_OSByteOrder.h:72:89: note: expanded from macro '__DARWIN_OSSwapInt16'
    ((__uint16_t)(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)))
                                                                                        ^
inf-name-resolver.c:525:20: error: use of undeclared identifier 'QFIXEDSZ'
    if(cur + len + QFIXEDSZ > end)
                   ^
inf-name-resolver.c:531:18: error: use of undeclared identifier 'QFIXEDSZ'
    cur += len + QFIXEDSZ;
                 ^
19 errors generated.
make[3]: *** [libinfinity_common_la-inf-name-resolver.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I../.. -I../../libinfinity -I../.. -D_REENTRANT -I/usr/local/Cellar/glib/2.42.0/include/glib-2.0 -I/usr/local/Cellar/glib/2.42.0/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/libtasn1/4.2/include -I/usr/local/Cellar/nettle/2.7.1/include -I/usr/local/Cellar/gnutls/3.2.17/include -I/usr/local/Cellar/gsasl/1.8.0/include -I/usr/include/libxml2 -g -O2 -c inf-protocol.c  -fno-common -DPIC -o .libs/libinfinity_common_la-inf-protocol.o
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I../.. -I../../libinfinity -I../.. -D_REENTRANT -I/usr/local/Cellar/glib/2.42.0/include/glib-2.0 -I/usr/local/Cellar/glib/2.42.0/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/libtasn1/4.2/include -I/usr/local/Cellar/nettle/2.7.1/include -I/usr/local/Cellar/gnutls/3.2.17/include -I/usr/local/Cellar/gsasl/1.8.0/include -I/usr/include/libxml2 -g -O2 -c inf-native-socket.c -o libinfinity_common_la-inf-native-socket.o >/dev/null 2>&1
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I../.. -I../../libinfinity -I../.. -D_REENTRANT -I/usr/local/Cellar/glib/2.42.0/include/glib-2.0 -I/usr/local/Cellar/glib/2.42.0/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/libtasn1/4.2/include -I/usr/local/Cellar/nettle/2.7.1/include -I/usr/local/Cellar/gnutls/3.2.17/include -I/usr/local/Cellar/gsasl/1.8.0/include -I/usr/include/libxml2 -g -O2 -c inf-protocol.c -o libinfinity_common_la-inf-protocol.o >/dev/null 2>&1
make[2]: *** [install-recursive] Error 1
make[1]: *** [install] Error 2
make: *** [install-recursive] Error 1
aburgm commented 10 years ago

Can you try adding #include <arpa/nameser.h> and #include <arpa/nameser_compat.h> at the top, and see if it fixes the compilation?

DomT4 commented 10 years ago

To the top of libinfinity/common/inf-name-resolver.c?

DomT4 commented 10 years ago

If so, I get a slightly new error:

libtool: compile:  clang -DHAVE_CONFIG_H -I. -I../.. -I../../libinfinity -I../.. -D_REENTRANT -I/usr/local/Cellar/glib/2.42.0/include/glib-2.0 -I/usr/local/Cellar/glib/2.42.0/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/libtasn1/4.2/include -I/usr/local/Cellar/nettle/2.7.1/include -I/usr/local/Cellar/gnutls/3.2.17/include -I/usr/local/Cellar/glib/2.42.0/include/glib-2.0 -I/usr/local/Cellar/glib/2.42.0/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/include/libxml2 -D_REENTRANT -I/usr/local/Cellar/glib/2.42.0/include/glib-2.0 -I/usr/local/Cellar/glib/2.42.0/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/libtasn1/4.2/include -I/usr/local/Cellar/nettle/2.7.1/include -I/usr/local/Cellar/gnutls/3.2.17/include -I/usr/local/Cellar/gsasl/1.8.0/include -I/usr/include/libxml2 -g -O2 -c util/infinoted-plugin-util-navigate-browser.c -o infinoted-plugin-util-navigate-browser.o >/dev/null 2>&1
infinoted-plugin-document-stream.c:885:45: error: use of undeclared identifier 'MSG_NOSIGNAL'
    bytes = send(stream->socket, data, len, MSG_NOSIGNAL);
                                            ^
infinoted-plugin-document-stream.c:993:7: error: use of undeclared identifier 'MSG_NOSIGNAL'
      MSG_NOSIGNAL
      ^
2 errors generated.
make[2]: *** [infinoted-plugin-document-stream.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1
aburgm commented 10 years ago

Okay, that's a different error. That usage should be protected with HAVE_MSG_NOSIGNAL... can you try adding #include "config.h" to that file, and then change the lines where the two errors occur to:

bytes = send(
  stream->socket,
  data,
  len,
#ifdef HAVE_MSG_NOSIGNAL
  MSG_NOSIGNAL
#else
  0
#endif
);

and

bytes = recv(
  stream->socket,
  stream->recv_queue.data + queue_offset,
  stream->recv_queue.alloc - queue_offset,
#ifdef HAVE_MSG_NOSIGNAL
  MSG_NOSIGNAL
#else
  0
#endif
);

If it works I'll commit it to the repository and make another release.

DomT4 commented 10 years ago

Yup! Combination of the libinfinity/common/inf-name-resolver.c patch and the infinoted-plugin-document-stream.c patch did the job! :+1:

aburgm commented 10 years ago

Committed, and a 0.6.4 release will follow shortly.

DomT4 commented 10 years ago

New release compiles absolutely perfectly. Thanks for the quick turnaround here! Appreciate that.