]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
A bit more work on the "centralized" build system (including deleting of obsolete...
authorWillem Toorop <willem@NLnetLabs.nl>
Wed, 30 Nov 2011 14:57:15 +0000 (14:57 +0000)
committerWillem Toorop <willem@NLnetLabs.nl>
Wed, 30 Nov 2011 14:57:15 +0000 (14:57 +0000)
14 files changed:
Makefile.in
configure.ac
examples/ldns-notify.c
examples/ldns-test-edns.c
examples/ldns-testns.c
examples/ldnsd.c
net.c
test/01-compile.tpkg
test/06-drill-lint.tpkg [deleted file]
test/07-compile-examples.tpkg [deleted file]
test/11-examples-lint.tpkg [deleted file]
test/12.unit-tests-dnssec.tpkg
test/13-unit-tests-base.tpkg
test/15.unit-tests-rrtypes.tpkg

index 459aba4b044bb71ddd0483e3e2704afcd748290f..5cf350648495ef279301f029db5dc576c85a536e 100644 (file)
@@ -44,12 +44,16 @@ RUNTIME_PATH        = @RUNTIME_PATH@
 LIBTOOL                = $(libtool) --tag=CC --quiet
 LINT           = splint
 LINTFLAGS      = +quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -preproc -Drlimit=rlimit64 -D__gnuc_va_list=va_list
-LINTFLAGS      +="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t -DRC4_INT=unsigned -fixedformalarray -D"ENGINE=unsigned" -D"RSA=unsigned" -D"DSA=unsigned" -D"EVP_PKEY=unsigned" -D"EVP_MD=unsigned" -D"SSL=unsigned" -D"SSL_CTX=unsigned" -D"X509=unsigned" -D"RC4_KEY=unsigned" -D"EVP_MD_CTX=unsigned" -D"EC_KEY=unsigned" -D"EC_POINT=unsigned" -D"EC_GROUP=unsigned" -D"EVP_PKEY_ASN1_METHOD=struct evp_pkey_asn1_method_st" -D"EVP_PKEY_CTX=struct evp_pkey_ctx_st"
+# Extra flags from configure
+LINTFLAGS      += @LINTFLAGS@
+LINTFLAGS      += "-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t -DRC4_INT=unsigned -fixedformalarray -D"ENGINE=unsigned" -D"RSA=unsigned" -D"DSA=unsigned" -D"EVP_PKEY=unsigned" -D"EVP_MD=unsigned" -D"SSL=unsigned" -D"SSL_CTX=unsigned" -D"X509=unsigned" -D"RC4_KEY=unsigned" -D"EVP_MD_CTX=unsigned" -D"EC_KEY=unsigned" -D"EC_POINT=unsigned" -D"EC_GROUP=unsigned" -D"EVP_PKEY_ASN1_METHOD=struct evp_pkey_asn1_method_st" -D"EVP_PKEY_CTX=struct evp_pkey_ctx_st"
 # compat with OpenBSD
-LINTFLAGS      +="-Dsigset_t=long"
+LINTFLAGS      += "-Dsigset_t=long"
 # FreeBSD8
-LINTFLAGS      +="-D__uint16_t=uint16_t"
-LINTFLAGS      +=@LINTFLAGS@
+LINTFLAGS      += "-D__uint16_t=uint16_t"
+# Ubuntu oneiric"
+LINTFLAGS       += -D"__BEGIN_DECLS=" -D"__ssize_t=ssize_t" -D"__intptr_t=intptr_t" -D"__nonnull(x)=" -D"__THROW=" -D"__wur=" -D"__off_t=unsigned" -D"__off64_t=unsigned" -D"__useconds_t=unsigned" -D"__uid_t=unsigned" -D"__gid_t=unsigned" -D"__attribute_deprecated__=" -D"__pid_t=unsigned" -D"__restrict=" -D"__END_DECLS=" -D"__BEGIN_NAMESPACE_STD=" -D"__END_NAMESPACE_STD=" -D"__BEGIN_NAMESPACE_C99=" -D"__END_NAMESPACE_C99="  -D"__socklen_t=unsigned" -D"sa_family_t=unsigned " -D"__mode_t=unsigned" -D"u_int16_t=uint16_t" -D"u_int32_t=uint32_t" -D"u_int8_t=uint8_t" -D"u_short=unsigned short" -D"__u16=uint16_t" -D"__u32=uint32_t"
+-D"__u64=uint64_t"
 DEPFLAG                = @DEPFLAG@
 
 INSTALL                = $(srcdir)/install-sh 
@@ -108,9 +112,9 @@ setup-builddir:
 putdown-builddir:
        rm -f include/ldns lib config.h
        test ! -d include  || rmdir include  || :
-       test ! -d examples || rmdir examples || :
-       test ! -d drill    || rmdir drill    || :
-       test ! -d compat   || rmdir compat   || :
+       if test -d examples -a ! -f examples/README; then rmdir examples || : ; fi
+       if test -d drill    -a ! -f drill/README   ; then rmdir drill    || : ; fi
+       if test -d compat   -a ! -f compat/malloc.c; then rmdir compat   || : ; fi
 
 drill: drill/drill
 drill/drill: $(DRILL_LOBJS) $(LIB)
@@ -295,7 +299,8 @@ realclean: clean docclean
        rm -f ldns/net.h
        rm -f packaging/ldns-config
        rm -f packaging/libldns.pc
-       test ! -d packaging || rmdir packaging || :
+       if test -d packaging -a ! -f packaging/ldns-config.in ; then \
+            rmdir packaging || : ; fi
        rm -f libtool
        if test -d ldns ; then \
                echo "is builddir srcdir" > ldns/YES ; \
@@ -325,12 +330,24 @@ distclean: realclean
 
 ## No need for changes here
 
-lint:
+lint: @LINT_DRILL@ @LINT_EXAMPLES@
        for i in $(srcdir)/*.c; do \
                $(LINT) $(LINTFLAGS) -I. -I$(srcdir) $(srcdir)/$$i ; \
                if test $$? -ne 0 ; then exit 1 ; fi ; \
        done
 
+lint-drill:
+       for i in $(srcdir)/drill/*.c; do \
+               $(LINT) $(LINTFLAGS) -I. -I$(srcdir) $(srcdir)/$$i ; \
+               if test $$? -ne 0 ; then exit 1 ; fi ; \
+       done
+
+lint-examples:
+       for i in $(srcdir)/examples/*.c; do \
+               $(LINT) $(LINTFLAGS) -I. -I$(srcdir) $(srcdir)/$$i ; \
+               if test $$? -ne 0 ; then exit 1 ; fi ; \
+       done
+
 tags:  $(srcdir)/*.c ldns/*.[ch]
        ctags  -f $(srcdir)/tags $(srcdir)/*.[ch] ldns/*.[ch]
 
index 09409525ff46d8617ba2ddadeeaf88187e348f76..f3912b045ac1bf77cb6a984c930d752fe0094b80 100644 (file)
@@ -104,11 +104,13 @@ if test x_$with_drill != x_no; then
        AC_SUBST(INSTALL_DRILL,[install-drill])
        AC_SUBST(UNINSTALL_DRILL,[uninstall-drill])
        AC_SUBST(CLEAN_DRILL,[clean-drill])
+       AC_SUBST(LINT_DRILL,[lint-drill])
 else
        AC_SUBST(DRILL,[""])
        AC_SUBST(INSTALL_DRILL,[""])
        AC_SUBST(UNINSTALL_DRILL,[""])
        AC_SUBST(CLEAN_DRILL,[""])
+       AC_SUBST(LINT_DRILL,[""])
 fi
 
 
@@ -120,11 +122,13 @@ if test x_$with_examples != x_no; then
        AC_SUBST(INSTALL_EXAMPLES,[install-examples])
        AC_SUBST(UNINSTALL_EXAMPLES,[uninstall-examples])
        AC_SUBST(CLEAN_EXAMPLES,[clean-examples])
+       AC_SUBST(LINT_EXAMPLES,[lint-examples])
 else
        AC_SUBST(EXAMPLES,[""])
        AC_SUBST(INSTALL_EXAMPLES,[""])
        AC_SUBST(UNINSTALL_EXAMPLES,[""])
        AC_SUBST(CLEAN_EXAMPLES,[""])
+       AC_SUBST(LINT_EXAMPLES,[""])
 fi
 
 # add option to disable installation of ldns-config script
@@ -133,8 +137,8 @@ AC_ARG_ENABLE(ldns-config, [ --disable-ldns-config  disable installation of ldns-
 if test "x$enable_ldns_config" = xyes; then
        AC_SUBST(INSTALL_CONFIG, [install-config])
        AC_SUBST(INSTALL_CONFIG_MANPAGE, [install-config-manpage])
-       AC_SUBST(UNINSTALL_CONFIG, [install-config])
-       AC_SUBST(UNINSTALL_CONFIG_MANPAGE, [install-config-manpage])
+       AC_SUBST(UNINSTALL_CONFIG, [uninstall-config])
+       AC_SUBST(UNINSTALL_CONFIG_MANPAGE, [uninstall-config-manpage])
 else
        AC_SUBST(INSTALL_CONFIG, [""])
        AC_SUBST(INSTALL_CONFIG_MANPAGE, [""])
index 39db1030bf3d37baf20ce096cde2ba5ef9e0d613..fb8015dfdd29b49fd165bff970013b958b5d0a9c 100644 (file)
@@ -58,7 +58,9 @@ notify_host(int s, struct addrinfo* res, uint8_t* wire, size_t wiresize,
 {
        int timeout_retry = 5; /* seconds */
        int num_retry = max_num_retry;
+#ifndef S_SPLINT_S
        fd_set rfds;
+#endif
        struct timeval tv;
        int retval = 0;
        ssize_t received = 0;
@@ -83,9 +85,9 @@ notify_host(int s, struct addrinfo* res, uint8_t* wire, size_t wiresize,
                }
 
                /* wait for ACK packet */
+#ifndef S_SPLINT_S
                FD_ZERO(&rfds);
                FD_SET(s, &rfds);
-#ifndef S_SPLINT_S
                tv.tv_sec = timeout_retry; /* seconds */
 #endif
                tv.tv_usec = 0; /* microseconds */
index 2a29f0e810ded6bd9e89c29e86b762e8c26cab15..10958085e008421f30df30cc03360c6f0f27c760 100644 (file)
@@ -30,7 +30,9 @@ convert_addr(char* str, int p, struct sockaddr_storage* addr, socklen_t* len)
        } else {
 #endif
                *len = (socklen_t)sizeof(struct sockaddr_in);
+#ifndef S_SPLINT_S
                ((struct sockaddr_in*)addr)->sin_family = AF_INET;
+#endif
                ((struct sockaddr_in*)addr)->sin_port = htons((uint16_t)p);
                if(inet_pton(AF_INET, str,
                        &((struct sockaddr_in*)addr)->sin_addr) == 1)
index c1f9e1349e3242906bdcac5a68a8311573090faa..100bfbb400be256247ddca9c4837da8d63eb3668 100644 (file)
@@ -216,7 +216,9 @@ static int bind_port(int sock, int port, int fam)
     }
 #endif
 
+#ifndef S_SPLINT_S
     addr.sin_family = AF_INET;
+#endif
     addr.sin_port = (in_port_t)htons((uint16_t)port);
     addr.sin_addr.s_addr = INADDR_ANY;
     return bind(sock, (struct sockaddr *)&addr, (socklen_t) sizeof(addr));
@@ -365,7 +367,9 @@ static struct entry* entries;
 static void
 service(void)
 {
+#ifndef S_SPLINT_S
        fd_set rset, wset, eset;
+#endif
        struct timeval timeout;
        int count;
        int maxfd;
@@ -418,7 +422,7 @@ forkit(int number)
 #endif /* USE_WINSOCK */
 #else /* HAVE_FORK */
                pid_t pid = fork();
-               if(pid == -1) {
+               if(pid == (pid_t) -1) {
                        log_msg("error forking: %s\n", strerror(errno));
                        return;
                }
index 56cf2e0c992945e27cd825601993ac48afa601f5..e2a55200f399c574dd941d6cc3ba8cf5a8ebba6f 100644 (file)
@@ -54,7 +54,9 @@ static int udp_bind(int sock, int port, const char *my_address)
         }
     }
 
+#ifndef S_SPLINT_S
     addr.sin_family = AF_INET;
+#endif
     addr.sin_port = (in_port_t) htons((uint16_t)port);
     addr.sin_addr.s_addr = maddr;
     return bind(sock, (struct sockaddr *)&addr, (socklen_t) sizeof(addr));
diff --git a/net.c b/net.c
index 4407e4ae94ce5bebcc174114583f16d34a4b3c65..870511a75b2df064c49a24d4353e4ee2d4dfafa0 100644 (file)
--- a/net.c
+++ b/net.c
@@ -105,6 +105,8 @@ ldns_send_buffer(ldns_pkt **result, ldns_resolver *r, ldns_buffer *qb, ldns_rdf
                ns = ldns_rdf2native_sockaddr_storage(ns_array[i],
                                ldns_resolver_port(r), &ns_len);
 
+
+#ifndef S_SPLINT_S
                if ((ns->ss_family == AF_INET) &&
                                (ldns_resolver_ip6(r) == LDNS_RESOLV_INET6)) {
                        /* not reachable */
@@ -116,6 +118,7 @@ ldns_send_buffer(ldns_pkt **result, ldns_resolver *r, ldns_buffer *qb, ldns_rdf
                        /* not reachable */
                        continue;
                }
+#endif
 
                all_servers_rtt_inf = false;
 
@@ -265,16 +268,16 @@ ldns_sock_block(int sockfd)
 static int
 ldns_sock_wait(int sockfd, struct timeval timeout, int write)
 {
-       fd_set fds;
        int ret;
 #ifndef S_SPLINT_S
+       fd_set fds;
        FD_ZERO(&fds);
        FD_SET(FD_SET_T sockfd, &fds);
-#endif
        if(write)
                ret = select(sockfd+1, NULL, &fds, NULL, &timeout);
        else
                ret = select(sockfd+1, &fds, NULL, NULL, &timeout);
+#endif
        if(ret == 0)
                /* timeout expired */
                return 0;
@@ -356,11 +359,13 @@ ldns_udp_connect(const struct sockaddr_storage *to, struct timeval ATTR_UNUSED(t
 {
        int sockfd;
 
+#ifndef S_SPLINT_S
        if ((sockfd = socket((int)((struct sockaddr*)to)->sa_family, SOCK_DGRAM, 
                                        IPPROTO_UDP)) 
                        == -1) {
                 return 0;
         }
+#endif
        return sockfd;
 }
 
@@ -370,10 +375,12 @@ ldns_tcp_connect(const struct sockaddr_storage *to, socklen_t tolen,
 {
        int sockfd;
 
+#ifndef S_SPLINT_S
        if ((sockfd = socket((int)((struct sockaddr*)to)->sa_family, SOCK_STREAM, 
                                        IPPROTO_TCP)) == -1) {
                return 0;
        }
+#endif
 
        /* perform nonblocking connect, to be able to wait with select() */
        ldns_sock_nonblock(sockfd);
@@ -714,14 +721,18 @@ ldns_rdf2native_sockaddr_storage(const ldns_rdf *rd, uint16_t port, size_t *size
 
         switch(ldns_rdf_get_type(rd)) {
                 case LDNS_RDF_TYPE_A:
+#ifndef S_SPLINT_S
                         data->ss_family = AF_INET;
+#endif
                         data_in = (struct sockaddr_in*) data;
                         data_in->sin_port = (in_port_t)htons(port);
                         memcpy(&(data_in->sin_addr), ldns_rdf_data(rd), ldns_rdf_size(rd));
                         *size = sizeof(struct sockaddr_in);
                         return data;
                 case LDNS_RDF_TYPE_AAAA:
+#ifndef S_SPLINT_S
                         data->ss_family = AF_INET6;
+#endif
                         data_in6 = (struct sockaddr_in6*) data;
                         data_in6->sin6_port = (in_port_t)htons(port);
                         memcpy(&data_in6->sin6_addr, ldns_rdf_data(rd), ldns_rdf_size(rd));
@@ -733,6 +744,7 @@ ldns_rdf2native_sockaddr_storage(const ldns_rdf *rd, uint16_t port, size_t *size
         }
 }
 
+#ifndef S_SPLINT_S
 ldns_rdf *
 ldns_sockaddr_storage2rdf(struct sockaddr_storage *sock, uint16_t *port)
 {
@@ -765,6 +777,7 @@ ldns_sockaddr_storage2rdf(struct sockaddr_storage *sock, uint16_t *port)
         }
         return addr;
 }
+#endif
 
 /* code from resolver.c */
 ldns_status
index 09f8f4d80ac51a146579e7e8aeb2e99477e2d428..8078a8d6f70a0b65df5b5fbe6537e51526f3f6c1 100644 (file)
Binary files a/test/01-compile.tpkg and b/test/01-compile.tpkg differ
diff --git a/test/06-drill-lint.tpkg b/test/06-drill-lint.tpkg
deleted file mode 100644 (file)
index 771b7fe..0000000
Binary files a/test/06-drill-lint.tpkg and /dev/null differ
diff --git a/test/07-compile-examples.tpkg b/test/07-compile-examples.tpkg
deleted file mode 100644 (file)
index 80ee9dc..0000000
Binary files a/test/07-compile-examples.tpkg and /dev/null differ
diff --git a/test/11-examples-lint.tpkg b/test/11-examples-lint.tpkg
deleted file mode 100644 (file)
index e47244e..0000000
Binary files a/test/11-examples-lint.tpkg and /dev/null differ
index a6f21e649486c4d71f9f444648f91d0ae0927201..67e5b46ad07757deb80e7e0906f35ee24636d42f 100644 (file)
Binary files a/test/12.unit-tests-dnssec.tpkg and b/test/12.unit-tests-dnssec.tpkg differ
index 200315396e5a0dd8eb78c946811ee87110e40ce1..3fd5d77ab0d487ac01c5c7e00b5b9b807a3cd089 100644 (file)
Binary files a/test/13-unit-tests-base.tpkg and b/test/13-unit-tests-base.tpkg differ
index e9b4b819edb8d45572092fee5ce7ca30b1e8e4fb..e5f57692a2106f23b1f9e40419d0623923178327 100644 (file)
Binary files a/test/15.unit-tests-rrtypes.tpkg and b/test/15.unit-tests-rrtypes.tpkg differ