shishi-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU shishi branch, master, updated. shishi-1-0-1-42-g474e0d2


From: Simon Josefsson
Subject: [SCM] GNU shishi branch, master, updated. shishi-1-0-1-42-g474e0d2
Date: Tue, 02 Apr 2013 23:32:01 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU shishi".

http://git.savannah.gnu.org/cgit/shishi.git/commit/?id=474e0d271883fa219d92e618b6e71100b58591ee

The branch, master has been updated
       via  474e0d271883fa219d92e618b6e71100b58591ee (commit)
      from  44cd36c6e760f0ebd44d20dae62bd5e82175b9ff (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 474e0d271883fa219d92e618b6e71100b58591ee
Author: Mats Erik Andersson <address@hidden>
Date:   Wed Aug 22 20:13:15 2012 +0200

    Locate res_query and libresolv.
    
    For portability res_query must be searched
    in libc, and in libresolv. The latter need
    not even exist on systems such as BSD.
    
    Signed-off-by: Simon Josefsson <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 configure.ac |   31 +++++++++++++++++++++++++------
 lib/resolv.c |   12 ++++++++----
 2 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index f6febc3..bef5885 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,6 +42,12 @@ gl2_EARLY
 gl3_EARLY
 AC_HEADER_STDC
 AC_CHECK_HEADERS(termios.h pwd.h syslog.h arpa/nameser.h netinet/in6.h)
+AC_CHECK_HEADERS(resolv.h, , , [#include <sys/types.h>
+  #include <netinet/in.h>
+  #ifdef HAVE_ARPA_NAMESER_H
+  # include <arpa/nameser.h>
+  #endif
+])
 
 # Used when creating libshishi-XX.def.
 SOVERSION=`expr ${LT_CURRENT} - ${LT_AGE}`
@@ -82,14 +88,27 @@ if test "$ac_cv_libgcrypt" != yes; then
 fi
 
 # Checks for library functions.
-AC_CHECK_FUNCS(signal select ngettext gethostbyname getpwnam getuid)
+AC_CHECK_FUNCS(signal select ngettext gethostbyname getpwnam getuid res_query)
 AC_SEARCH_LIBS(socket, socket)
 AC_SEARCH_LIBS(gethostbyname, nsl)
-AC_LIB_HAVE_LINKFLAGS(resolv,, [
-  #include <netinet/in.h>
-  #include <arpa/nameser.h>
-  #include <resolv.h>
-], [res_query (0, 0, 0, 0, 0);])
+
+# BSD systems deliver res_query in libc.
+# Most of them do not even offer libresolv.
+if test "$ac_cv_func_res_query" != yes; then
+  AC_LIB_HAVE_LINKFLAGS(resolv,, [
+    #include <netinet/in.h>
+    #include <arpa/nameser.h>
+    #include <resolv.h>
+  ], [res_query (0, 0, 0, 0, 0);])
+  # Check again, with newly acquired knowledge.
+  if test "$ac_cv_libresolv" = yes; then
+    AC_DEFINE([HAVE_RES_QUERY], 1,
+      [Define to 1 if you have the res_query function.])
+  fi
+fi
+dnl Declare LIBRESOLV and LTLIBRESOLV in all cases.
+AC_SUBST(LIBRESOLV)
+AC_SUBST(LTLIBRESOLV)
 
 # Shishid needs a logging mechanism, and right now there is no
 # alternative to syslog.  A 'fprintf(stderr,...)' mechanism may be
diff --git a/lib/resolv.c b/lib/resolv.c
index 2aff9fa..615b2fc 100644
--- a/lib/resolv.c
+++ b/lib/resolv.c
@@ -30,11 +30,15 @@
 
 #include "internal.h"
 
-#ifdef HAVE_LIBRESOLV
+#ifdef HAVE_RES_QUERY
 
 #include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
+# ifdef HAVE_ARPA_NAMESER_H
+#  include <arpa/nameser.h>
+# endif
+# ifdef HAVE_RESOLV_H
+#  include <resolv.h>
+# endif
 
 /* the largest packet we'll send and receive */
 #if PACKETSZ > 1024
@@ -263,7 +267,7 @@ shishi_resolv (const char *zone, uint16_t querytype)
   return first;
 }
 
-#else
+#else /* !HAVE_RES_QUERY */
 
 Shishi_dns
 shishi_resolv (const char *zone, uint16_t querytype)


hooks/post-receive
-- 
GNU shishi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]