diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2010-04-29 03:19:54 +0200 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2010-04-29 03:19:54 +0200 |
commit | 8d669b6a0a9c78590d926b7132358c6e5482f742 (patch) | |
tree | 70848d93a239e2db29d8b094714ab4439d220919 /m4-local/gethostbyname_r.m4 | |
parent | 2d2f657c1c695771cbd6de495b6d306c5fddb2f5 (diff) | |
download | fetchmail-8d669b6a0a9c78590d926b7132358c6e5482f742.tar.gz fetchmail-8d669b6a0a9c78590d926b7132358c6e5482f742.tar.bz2 fetchmail-8d669b6a0a9c78590d926b7132358c6e5482f742.zip |
Move gethostbyname_r.m4 to m4-local directory where it belongs.
It's not supposed to be updated by autopoint.
Diffstat (limited to 'm4-local/gethostbyname_r.m4')
-rw-r--r-- | m4-local/gethostbyname_r.m4 | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/m4-local/gethostbyname_r.m4 b/m4-local/gethostbyname_r.m4 new file mode 100644 index 00000000..94f36dba --- /dev/null +++ b/m4-local/gethostbyname_r.m4 @@ -0,0 +1,68 @@ +dnl @synopsis ACX_WHICH_GETHOSTBYNAME_R +dnl +dnl Provides a test to determine the correct way to call gethostbyname_r +dnl +dnl defines HAVE_GETHOSTBYNAME_R to the number of arguments required +dnl +dnl e.g. 6 arguments (linux) +dnl e.g. 5 arguments (solaris) +dnl e.g. 3 arguments (osf/1) +dnl +dnl @version $Id: acinclude.m4,v 1.6 2001/10/17 07:19:14 brian Exp $ +dnl @author Brian Stafford <brian@stafford.uklinux.net> +dnl +dnl based on version by Caolan McNamara <caolan@skynet.ie> +dnl based on David Arnold's autoconf suggestion in the threads faq +dnl +AC_DEFUN([ACX_WHICH_GETHOSTBYNAME_R], +[AC_CACHE_CHECK(number of arguments to gethostbyname_r, + acx_which_gethostbyname_r, [ + AC_TRY_LINK([ +# include <netdb.h> + ], [ + + char *name; + struct hostent *he; + struct hostent_data data; + (void) gethostbyname_r(name, he, &data); + + ],acx_which_gethostbyname_r=3, + [ +dnl acx_which_gethostbyname_r=0 + AC_TRY_LINK([ +# include <netdb.h> + ], [ + char *name; + struct hostent *he, *res; + char *buffer = NULL; + int buflen = 2048; + int h_errnop; + (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop) + ],acx_which_gethostbyname_r=6, + + [ +dnl acx_which_gethostbyname_r=0 + AC_TRY_LINK([ +# include <netdb.h> + ], [ + char *name; + struct hostent *he; + char *buffer = NULL; + int buflen = 2048; + int h_errnop; + (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop) + ],acx_which_gethostbyname_r=5,acx_which_gethostbyname_r=0) + + ] + + ) + ] + ) + ]) + +if test $acx_which_gethostbyname_r -gt 0 ; then + AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYNAME_R], $acx_which_gethostbyname_r, + [Number of parameters to gethostbyname_r or 0 if not available]) +fi + +]) |