]> granicus.if.org Git - curl/commitdiff
Add a 3 argument check for getprotobyname_r
authorYang Tse <yangsita@gmail.com>
Sat, 26 Jul 2008 01:24:50 +0000 (01:24 +0000)
committerYang Tse <yangsita@gmail.com>
Sat, 26 Jul 2008 01:24:50 +0000 (01:24 +0000)
ares/m4/reentrant.m4
m4/reentrant.m4

index 01d2136a73bc8b6278c5e536fe1e27db1aba2e3c..8bffc9b1dc85939a9f85a3c6f8997d5fe750c666 100644 (file)
@@ -83,7 +83,6 @@ dnl makes function strtok_r compiler visible.
 AC_DEFUN([CHECK_NEED_REENTRANT_STRTOK_R], [
   #
   AC_MSG_NOTICE([DEBUG:])
-  AC_MSG_NOTICE([DEBUG:])
   AC_LINK_IFELSE([
     AC_LANG_FUNC_LINK_TRY([strtok_r])
   ],[
@@ -714,6 +713,19 @@ AC_DEFUN([CHECK_NEED_REENTRANT_GETPROTOBYNAME_R], [
     AC_COMPILE_IFELSE([
       AC_LANG_PROGRAM([[
 #include <sys/types.h>
+#include <netdb.h>
+      ]],[[
+        getprotobyname_r(0, 0, 0);
+      ]])
+    ],[
+      AC_MSG_NOTICE([DEBUG: getprotobyname_r proto wout finds... 3 args])
+      tmp_getprotobyname_r="done"
+    ])
+  fi
+  if test "$tmp_getprotobyname_r" = "proto_wout_def"; then
+    AC_COMPILE_IFELSE([
+      AC_LANG_PROGRAM([[
+#include <sys/types.h>
 #include <netdb.h>
       ]],[[
         getprotobyname_r(0, 0, 0, 0);
@@ -742,6 +754,20 @@ AC_DEFUN([CHECK_NEED_REENTRANT_GETPROTOBYNAME_R], [
       AC_LANG_PROGRAM([[
 #define _REENTRANT
 #include <sys/types.h>
+#include <netdb.h>
+      ]],[[
+        getprotobyname_r(0, 0, 0);
+      ]])
+    ],[
+      AC_MSG_NOTICE([DEBUG: getprotobyname_r proto with finds... 3 args])
+      tmp_getprotobyname_r="needs_reentrant"
+    ])
+  fi
+  if test "$tmp_getprotobyname_r" = "proto_with_def"; then
+    AC_COMPILE_IFELSE([
+      AC_LANG_PROGRAM([[
+#define _REENTRANT
+#include <sys/types.h>
 #include <netdb.h>
       ]],[[
         getprotobyname_r(0, 0, 0, 0);
index 8da25bae78e5a246d8fad9612b163fcd52973c69..2e2033a2ac768ace1eac82aa00de203c6746e5d7 100644 (file)
@@ -735,6 +735,28 @@ AC_DEFUN([CHECK_NEED_REENTRANT_GETPROTOBYNAME_R], [
     AC_COMPILE_IFELSE([
       AC_LANG_PROGRAM([[
 #include <sys/types.h>
+#include <netdb.h>
+      ]],[[
+        getprotobyname_r(0, 0, 0);
+      ]])
+    ],[
+      AC_MSG_NOTICE([DEBUG: getprotobyname_r proto wout finds... 3 args])
+      tmp_getprotobyname_r="done"
+    ],[
+      case $host in
+        *-*-osf* | *-*-aix*)
+          AC_MSG_NOTICE([DEBUG: getprotobyname_r proto wout fails... 3 args])
+          echo "-------------------" >&6
+          sed 's/^/| /' conftest.err >&6
+          echo "-------------------" >&6
+          ;;
+      esac
+    ])
+  fi
+  if test "$tmp_getprotobyname_r" = "proto_wout_def"; then
+    AC_COMPILE_IFELSE([
+      AC_LANG_PROGRAM([[
+#include <sys/types.h>
 #include <netdb.h>
       ]],[[
         getprotobyname_r(0, 0, 0, 0);
@@ -781,6 +803,29 @@ AC_DEFUN([CHECK_NEED_REENTRANT_GETPROTOBYNAME_R], [
       AC_LANG_PROGRAM([[
 #define _REENTRANT
 #include <sys/types.h>
+#include <netdb.h>
+      ]],[[
+        getprotobyname_r(0, 0, 0);
+      ]])
+    ],[
+      AC_MSG_NOTICE([DEBUG: getprotobyname_r proto with finds... 3 args])
+      tmp_getprotobyname_r="needs_reentrant"
+    ],[
+      case $host in
+        *-*-osf* | *-*-aix*)
+          AC_MSG_NOTICE([DEBUG: getprotobyname_r proto with fails... 3 args])
+          echo "-------------------" >&6
+          sed 's/^/| /' conftest.err >&6
+          echo "-------------------" >&6
+          ;;
+      esac
+    ])
+  fi
+  if test "$tmp_getprotobyname_r" = "proto_with_def"; then
+    AC_COMPILE_IFELSE([
+      AC_LANG_PROGRAM([[
+#define _REENTRANT
+#include <sys/types.h>
 #include <netdb.h>
       ]],[[
         getprotobyname_r(0, 0, 0, 0);