From be2b1f3ea8925b6bda4e84a138b051b8edc2a118 Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 8 Nov 2010 13:59:11 +0000 Subject: * Fix resolver on NetBSD when Exim is linked with pthreads (e.g. when using sqlite). * Pass LDFLAGS for linking (useful with different SDKs on Mac OS X). --- mail/exim/Makefile | 5 +-- mail/exim/distinfo | 5 +-- mail/exim/patches/patch-ab | 13 +++++-- mail/exim/patches/patch-ac | 85 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+), 8 deletions(-) create mode 100644 mail/exim/patches/patch-ac (limited to 'mail') diff --git a/mail/exim/Makefile b/mail/exim/Makefile index 5ccd5b2e181..765287dd683 100644 --- a/mail/exim/Makefile +++ b/mail/exim/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.102 2010/06/06 14:15:30 adam Exp $ +# $NetBSD: Makefile,v 1.103 2010/11/08 13:59:11 adam Exp $ DISTNAME= exim-4.72 CATEGORIES= mail net @@ -50,9 +50,6 @@ OWN_DIRS_PERMS= ${VARBASE}/log/exim ${EXIM_USER} ${EXIM_GROUP} 0750 OWN_DIRS_PERMS+= ${VARBASE}/spool/exim ${EXIM_USER} ${EXIM_GROUP} 0750 SPECIAL_PERMS+= sbin/${PKGSRC_EXIM_VERSION} ${SETUID_ROOT_PERMS} -# XXX: The following will be handled by buildlink3 at some point. -CFLAGS+= ${_STRIPFLAG_CC} - # pay attention to CPPFLAGS as well CFLAGS+= ${CPPFLAGS} diff --git a/mail/exim/distinfo b/mail/exim/distinfo index 83744edb6f6..50dbeb1af64 100644 --- a/mail/exim/distinfo +++ b/mail/exim/distinfo @@ -1,9 +1,10 @@ -$NetBSD: distinfo,v 1.45 2010/06/06 14:15:30 adam Exp $ +$NetBSD: distinfo,v 1.46 2010/11/08 13:59:11 adam Exp $ SHA1 (exim-4.72.tar.bz2) = 3aab453faaa076a6b5f02320d7f8ad8aba21b347 RMD160 (exim-4.72.tar.bz2) = e3ae8dbb056890d49e21e2ba6eaf9cf789ca2c18 Size (exim-4.72.tar.bz2) = 1559031 bytes SHA1 (patch-aa) = cf514f31626cde31747342a2d50edd1dbf7f195f -SHA1 (patch-ab) = f5be62c134b1a2d0870a14546ec0bb62090d498a +SHA1 (patch-ab) = ffb9fb28e4e5548777db31b3de34673a08a1c0fa +SHA1 (patch-ac) = 9a260a07f5e8cc89c60188925f01fc5b46164a37 SHA1 (patch-ae) = 4a9d2fde403cfd6386742b31f062e7801ef081b9 SHA1 (patch-ag) = 8512795060ad913f4699c277867fd24e7a785519 diff --git a/mail/exim/patches/patch-ab b/mail/exim/patches/patch-ab index 1b59e6776f5..a7a8486ecc0 100644 --- a/mail/exim/patches/patch-ab +++ b/mail/exim/patches/patch-ab @@ -1,6 +1,6 @@ -$NetBSD: patch-ab,v 1.14 2009/11/17 06:39:32 adam Exp $ +$NetBSD: patch-ab,v 1.15 2010/11/08 13:59:11 adam Exp $ ---- OS/Makefile-Default.orig 2009-10-16 09:30:54.000000000 +0200 +--- OS/Makefile-Default.orig 2009-10-16 07:30:54.000000000 +0000 +++ OS/Makefile-Default @@ -73,7 +73,7 @@ PERL_COMMAND=/usr/bin/perl @@ -11,3 +11,12 @@ $NetBSD: patch-ab,v 1.14 2009/11/17 06:39:32 adam Exp $ # CFLAGS contains flags to be passed to the compiler. Nothing is defaulted +@@ -86,7 +86,7 @@ CC=gcc + # here; instead each OS-dependent Makefile contains a default setting if one + # is needed. + +-# LFLAGS= ++LFLAGS=$(LDFLAGS) + + + # PCRE_LIBS contains the library to be linked for PCRE diff --git a/mail/exim/patches/patch-ac b/mail/exim/patches/patch-ac new file mode 100644 index 00000000000..38e522a0938 --- /dev/null +++ b/mail/exim/patches/patch-ac @@ -0,0 +1,85 @@ +$NetBSD: patch-ac,v 1.14 2010/11/08 13:59:11 adam Exp $ + +--- src/dns.c.orig 2009-11-16 19:50:36.000000000 +0000 ++++ src/dns.c +@@ -168,18 +168,34 @@ Returns: nothing + void + dns_init(BOOL qualify_single, BOOL search_parents) + { +-if ((_res.options & RES_INIT) == 0) ++struct __res_state *rs; ++#ifdef __NetBSD__ ++rs = __res_get_state(); ++#else ++rs = &_res; ++#endif ++ ++if ((rs->options & RES_INIT) == 0) + { +- DEBUG(D_resolver) _res.options |= RES_DEBUG; /* For Cygwin */ ++ DEBUG(D_resolver) rs->options |= RES_DEBUG; /* For Cygwin */ ++ #ifdef __NetBSD__ ++ __res_put_state(rs); ++ #endif + res_init(); +- DEBUG(D_resolver) _res.options |= RES_DEBUG; ++ DEBUG(D_resolver) rs->options |= RES_DEBUG; ++ #ifdef __NetBSD__ ++ __res_put_state(rs); ++ #endif + } + +-_res.options &= ~(RES_DNSRCH | RES_DEFNAMES); +-_res.options |= (qualify_single? RES_DEFNAMES : 0) | ++rs->options &= ~(RES_DNSRCH | RES_DEFNAMES); ++rs->options |= (qualify_single? RES_DEFNAMES : 0) | + (search_parents? RES_DNSRCH : 0); +-if (dns_retrans > 0) _res.retrans = dns_retrans; +-if (dns_retry > 0) _res.retry = dns_retry; ++if (dns_retrans > 0) rs->retrans = dns_retrans; ++if (dns_retry > 0) rs->retry = dns_retry; ++#ifdef __NetBSD__ ++__res_put_state(rs); ++#endif + } + + +@@ -424,9 +440,15 @@ Returns: the return code + static int + dns_return(uschar *name, int type, int rc) + { ++struct __res_state *rs; ++#ifdef __NetBSD__ ++rs = __res_get_state(); ++#else ++rs = &_res; ++#endif + tree_node *node = store_get_perm(sizeof(tree_node) + 290); + sprintf(CS node->name, "%.255s-%s-%lx", name, dns_text_type(type), +- _res.options); ++ rs->options); + node->data.val = rc; + (void)tree_insertnode(&tree_dns_fails, node); + return rc; +@@ -466,6 +488,12 @@ dns_basic_lookup(dns_answer *dnsa, uscha + int rc = -1; + uschar *save; + #endif ++struct __res_state *rs; ++#ifdef __NetBSD__ ++rs = __res_get_state(); ++#else ++rs = &_res; ++#endif + + tree_node *previous; + uschar node_name[290]; +@@ -476,7 +504,7 @@ have many addresses in the same domain. + caching for successful lookups. */ + + sprintf(CS node_name, "%.255s-%s-%lx", name, dns_text_type(type), +- _res.options); ++ rs->options); + previous = tree_search(tree_dns_fails, node_name); + if (previous != NULL) + { -- cgit v1.2.3