+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char gethostbyaddr_r (); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyaddr_r ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_gethostbyaddr_r) || defined (__stub___gethostbyaddr_r)
+choke me
+#else
+f = gethostbyaddr_r;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:2517: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:2520: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:2523: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2526: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_gethostbyaddr_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_gethostbyaddr_r=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:2536: result: $ac_cv_func_gethostbyaddr_r" >&5
+echo "${ECHO_T}$ac_cv_func_gethostbyaddr_r" >&6
+if test $ac_cv_func_gethostbyaddr_r = yes; then
+
+ echo "$as_me:2540: checking signature of gethostbyaddr_r" >&5
+echo $ECHO_N "checking signature of gethostbyaddr_r... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2543 "configure"
+#include "confdefs.h"
+
+# include <netdb.h>
+
+int
+main ()
+{
+
+ struct hostent *h, *hp;
+ char *a, *b;
+ int l, bl, t, e;
+ (void) gethostbyaddr_r(a, l, t, h, b, bl, &hp, &e)
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2562: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:2565: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:2568: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2571: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cat >>confdefs.h <<\EOF
+#define HAVE_GETHOSTBYADDR_R_8_ARGS 1
+EOF
+
+ echo "$as_me:2578: result: 8 args" >&5
+echo "${ECHO_T}8 args" >&6
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2586 "configure"
+#include "confdefs.h"
+
+# include <netdb.h>
+
+int
+main ()
+{
+
+ struct hostent *h;
+ char *a, *b;
+ int l, bl, t, e;
+ (void) gethostbyaddr_r(a, l, t, h, b, bl, &e)
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2605: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:2608: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:2611: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2614: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cat >>confdefs.h <<\EOF
+#define HAVE_GETHOSTBYADDR_R_7_ARGS 1
+EOF
+
+ echo "$as_me:2621: result: 7 args" >&5
+echo "${ECHO_T}7 args" >&6
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2629 "configure"
+#include "confdefs.h"
+
+# include <netdb.h>
+
+int
+main ()
+{
+
+ struct hostent_data *d;
+ struct hostent *h;
+ char a,
+ int l, t;
+ (void) gethostbyaddr_r(a, l, t, h, d)
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2649: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:2652: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:2655: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2658: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cat >>confdefs.h <<\EOF
+#define HAVE_GETHOSTBYADDR_R_5_ARGS 1
+EOF
+
+ echo "$as_me:2665: result: 5 args" >&5
+echo "${ECHO_T}5 args" >&6
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ echo "$as_me:2672: result: unrecognised" >&5
+echo "${ECHO_T}unrecognised" >&6
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+else
+
+ echo "$as_me:2686: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+
+echo "$as_me:2691: checking for gethostbyname_r" >&5
+echo $ECHO_N "checking for gethostbyname_r... $ECHO_C" >&6
+if test "${ac_cv_func_gethostbyname_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2697 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char gethostbyname_r (); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname_r ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_gethostbyname_r) || defined (__stub___gethostbyname_r)
+choke me
+#else
+f = gethostbyname_r;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:2728: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:2731: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:2734: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2737: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_gethostbyname_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_gethostbyname_r=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:2747: result: $ac_cv_func_gethostbyname_r" >&5
+echo "${ECHO_T}$ac_cv_func_gethostbyname_r" >&6
+if test $ac_cv_func_gethostbyname_r = yes; then
+
+ echo "$as_me:2751: checking signature of gethostbyname_r" >&5
+echo $ECHO_N "checking signature of gethostbyname_r... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2754 "configure"
+#include "confdefs.h"
+
+# include <netdb.h>
+
+int
+main ()
+{
+
+ struct hostent *h, *r;
+ char *n, *b;
+ int bl, e;
+ (void) gethostbyname_r(n, h, b, bl, &r, &e)
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2773: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:2776: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:2779: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2782: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cat >>confdefs.h <<\EOF
+#define HAVE_GETHOSTBYNAME_R_6_ARGS 1
+EOF
+
+ echo "$as_me:2789: result: 6 args" >&5
+echo "${ECHO_T}6 args" >&6
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2797 "configure"
+#include "confdefs.h"
+
+# include <netdb.h>
+
+int
+main ()
+{
+
+ struct hostent *h;
+ char *n, *b;
+ int bl, e;
+ (void) gethostbyname_r(n, h, b, bl, &e)
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2816: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:2819: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:2822: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2825: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cat >>confdefs.h <<\EOF
+#define HAVE_GETHOSTBYNAME_R_5_ARGS 1
+EOF
+
+ echo "$as_me:2832: result: 5 args" >&5
+echo "${ECHO_T}5 args" >&6
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2840 "configure"
+#include "confdefs.h"
+
+# include <netdb.h>
+
+int
+main ()
+{
+
+ struct hostent_data *d;
+ struct hostent *h;
+ char *n,
+ (void) gethostbyname_r(n, h, d)
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2859: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:2862: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:2865: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2868: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cat >>confdefs.h <<\EOF
+#define HAVE_GETHOSTBYNAME_R_3_ARGS 1
+EOF
+
+ echo "$as_me:2875: result: 3 args" >&5
+echo "${ECHO_T}3 args" >&6
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ echo "$as_me:2882: result: unrecognised" >&5
+echo "${ECHO_T}unrecognised" >&6
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+else
+
+ echo "$as_me:2896: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+
+echo "$as_me:2901: checking for gmtime_r" >&5
+echo $ECHO_N "checking for gmtime_r... $ECHO_C" >&6
+if test "${ac_cv_func_gmtime_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2907 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char gmtime_r (); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gmtime_r ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_gmtime_r) || defined (__stub___gmtime_r)
+choke me
+#else
+f = gmtime_r;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:2938: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:2941: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:2944: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2947: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_gmtime_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_gmtime_r=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:2957: result: $ac_cv_func_gmtime_r" >&5
+echo "${ECHO_T}$ac_cv_func_gmtime_r" >&6
+if test $ac_cv_func_gmtime_r = yes; then
+
+ echo "$as_me:2961: checking signature of gmtime_r" >&5
+echo $ECHO_N "checking signature of gmtime_r... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2964 "configure"
+#include "confdefs.h"
+
+# include <time.h>
+
+int
+main ()
+{
+
+ struct time *t;
+ struct tm *tm;
+ (void) gmtime_r(t, tm)
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2982: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:2985: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:2988: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2991: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ echo "$as_me:2994: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+ cat >>confdefs.h <<\EOF
+#define HAVE_GMTIME_R 1
+EOF
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ echo "$as_me:3004: result: unrecognised" >&5
+echo "${ECHO_T}unrecognised" >&6
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+else
+
+ echo "$as_me:3012: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+
+echo "$as_me:3017: checking for localtime_r" >&5
+echo $ECHO_N "checking for localtime_r... $ECHO_C" >&6
+if test "${ac_cv_func_localtime_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3023 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char localtime_r (); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char localtime_r ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_localtime_r) || defined (__stub___localtime_r)
+choke me
+#else
+f = localtime_r;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:3054: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:3057: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:3060: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3063: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_localtime_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_localtime_r=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:3073: result: $ac_cv_func_localtime_r" >&5
+echo "${ECHO_T}$ac_cv_func_localtime_r" >&6
+if test $ac_cv_func_localtime_r = yes; then
+
+ echo "$as_me:3077: checking signature of localtime_r" >&5
+echo $ECHO_N "checking signature of localtime_r... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3080 "configure"
+#include "confdefs.h"
+
+# include <time.h>
+
+int
+main ()
+{
+
+ struct time *t;
+ struct tm *tm;
+ (void) localtime_r(t, tm)
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3098: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3101: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3104: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3107: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ echo "$as_me:3110: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+ cat >>confdefs.h <<\EOF
+#define HAVE_LOCALTIME_R 1
+EOF
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ echo "$as_me:3120: result: unrecognised" >&5
+echo "${ECHO_T}unrecognised" >&6
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+else
+
+ echo "$as_me:3128: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+
+SOCKET_LIB=
+
+case "$host" in
+*-solaris*) SOCKET_LIB="-lsocket -lnsl"
+ cat >>confdefs.h <<\EOF
+#define __EXTENSIONS__ 1
+EOF
+
+ if test "$GCC" = "yes"; then
+ # Set a GCC specific switch:
+ # This compiler switch makes Solaris thread-safe
+ PTHREAD_LIB=
+ SPECIAL_CFLAGS="-pthreads"
+ else
+ # What do we do without GCC? Guess this:
+ SPECIAL_CFLAGS="-D_REENTRANT"
+ fi
+;;
+esac
+
+case "$host" in
+*-os2-emx*) SOCKET_LIB=-lsocket
+;;
+esac
+
+AMIGAOS_ONLY=#
+
+case "$host" in
+*-amigaos) AMIGAOS_ONLY=
+;;
+esac
+
+echo "$as_me:3165: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3171 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+_ACEOF
+if { (eval echo "$as_me:3179: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:3185: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then