[asterisk-commits] kpfleming: branch group/new_loader_completion r40597 - in /team/group/new_loa...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Aug 19 20:43:54 MST 2006


Author: kpfleming
Date: Sat Aug 19 22:43:54 2006
New Revision: 40597

URL: http://svn.digium.com/view/asterisk?rev=40597&view=rev
Log:
use a configure-script test for res_ninit() instead of #ifdef, which is unreliable

Modified:
    team/group/new_loader_completion/configure
    team/group/new_loader_completion/configure.ac
    team/group/new_loader_completion/include/asterisk/autoconfig.h.in
    team/group/new_loader_completion/main/dns.c

Modified: team/group/new_loader_completion/configure
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/configure?rev=40597&r1=40596&r2=40597&view=diff
==============================================================================
--- team/group/new_loader_completion/configure (original)
+++ team/group/new_loader_completion/configure Sat Aug 19 22:43:54 2006
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 40556 .
+# From configure.ac Revision: 40558 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.60.
 #
@@ -13873,6 +13873,76 @@
 rm -f core conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 
+{ echo "$as_me:$LINENO: checking checking for res_ninit" >&5
+echo $ECHO_N "checking checking for res_ninit... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <resolv.h>
+int
+main ()
+{
+int foo = res_ninit(NULL);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_RES_NINIT 1
+_ACEOF
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
 
 { echo "$as_me:$LINENO: checking checking for compiler 'attribute pure' support" >&5
 echo $ECHO_N "checking checking for compiler 'attribute pure' support... $ECHO_C" >&6; }

Modified: team/group/new_loader_completion/configure.ac
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/configure.ac?rev=40597&r1=40596&r2=40597&view=diff
==============================================================================
--- team/group/new_loader_completion/configure.ac (original)
+++ team/group/new_loader_completion/configure.ac Sat Aug 19 22:43:54 2006
@@ -291,6 +291,15 @@
 AC_MSG_RESULT(no)
 )
 
+AC_MSG_CHECKING(checking for res_ninit)
+AC_LINK_IFELSE(
+	AC_LANG_PROGRAM([#include <resolv.h>],
+			[int foo = res_ninit(NULL);]),
+	AC_MSG_RESULT(yes)
+	AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
+	AC_MSG_RESULT(no)
+)
+
 AST_GCC_ATTRIBUTE(pure)
 AST_GCC_ATTRIBUTE(malloc)
 AST_GCC_ATTRIBUTE(const)

Modified: team/group/new_loader_completion/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/include/asterisk/autoconfig.h.in?rev=40597&r1=40596&r2=40597&view=diff
==============================================================================
--- team/group/new_loader_completion/include/asterisk/autoconfig.h.in (original)
+++ team/group/new_loader_completion/include/asterisk/autoconfig.h.in Sat Aug 19 22:43:54 2006
@@ -266,6 +266,9 @@
 
 /* Define to 1 if you have the `regcomp' function. */
 #undef HAVE_REGCOMP
+
+/* Define to 1 if your system has the re-entrant resolver functions. */
+#undef HAVE_RES_NINIT
 
 /* Define to 1 if you have the `re_comp' function. */
 #undef HAVE_RE_COMP

Modified: team/group/new_loader_completion/main/dns.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/main/dns.c?rev=40597&r1=40596&r2=40597&view=diff
==============================================================================
--- team/group/new_loader_completion/main/dns.c (original)
+++ team/group/new_loader_completion/main/dns.c Sat Aug 19 22:43:54 2006
@@ -177,15 +177,6 @@
 	return 0;
 }
 
-#if defined(res_ninit)
-#define HAS_RES_NINIT
-#else
-AST_MUTEX_DEFINE_STATIC(res_lock);
-#if 0
-#warning "Warning, res_ninit is missing...  Could have reentrancy issues"
-#endif
-#endif
-
 /*! \brief Lookup record in DNS 
 \note Asterisk DNS is synchronus at this time. This means that if your DNS does
 not work properly, Asterisk might not start properly or a channel may lock.



More information about the asterisk-commits mailing list