1# hostname.m4 serial 1 (gettext-0.11) 2dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. 3dnl This file is free software; the Free Software Foundation 4dnl gives unlimited permission to copy and/or distribute it, 5dnl with or without modifications, as long as this notice is preserved. 6 7# Prerequisites of the hostname.c program. 8AC_DEFUN([gt_PREREQ_HOSTNAME], 9[ 10 AC_CHECK_HEADERS(arpa/inet.h) 11 AC_CHECK_FUNCS(gethostname gethostbyname inet_ntop) 12 13 AC_MSG_CHECKING([for IPv6 sockets]) 14 AC_CACHE_VAL(gt_cv_socket_ipv6,[ 15 AC_TRY_COMPILE([ 16#include <sys/types.h> 17#include <sys/socket.h> 18#include <netinet/in.h>], 19[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;], 20 gt_cv_socket_ipv6=yes, gt_cv_socket_ipv6=no) 21 ]) 22 AC_MSG_RESULT($gt_cv_socket_ipv6) 23 if test $gt_cv_socket_ipv6 = yes; then 24 AC_DEFINE(HAVE_IPV6, 1, [Define if <sys/socket.h> defines AF_INET6.]) 25 fi 26]) 27