summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-09-22 06:22:44 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-09-22 06:22:44 +0000
commit3833e2bc3402fadfa2a1d256210a2cd35ba3f062 (patch)
treec385b4af4cfb7e81e98d5598b1756a5ca3c0ada5 /m4
parent0ed6bb9a65c09df997d62e83a07c9426f5aa4838 (diff)
downloadcoreutils-3833e2bc3402fadfa2a1d256210a2cd35ba3f062.tar.xz
New file, from gnulib.
Diffstat (limited to 'm4')
-rw-r--r--m4/getaddrinfo.m419
-rw-r--r--m4/getdelim.m430
-rw-r--r--m4/mbchar.m414
-rw-r--r--m4/mbiter.m414
-rw-r--r--m4/sockpfaf.m439
5 files changed, 116 insertions, 0 deletions
diff --git a/m4/getaddrinfo.m4 b/m4/getaddrinfo.m4
new file mode 100644
index 000000000..4bc9f6719
--- /dev/null
+++ b/m4/getaddrinfo.m4
@@ -0,0 +1,19 @@
+# getaddrinfo.m4 serial 3
+dnl Copyright (C) 2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_GETADDRINFO],
+[
+ AC_SEARCH_LIBS(getaddrinfo, nsl socket)
+ AC_REPLACE_FUNCS(getaddrinfo gai_strerror)
+ gl_PREREQ_GETADDRINFO
+])
+
+# Prerequisites of lib/getaddrinfo.h and lib/getaddrinfo.c.
+AC_DEFUN([gl_PREREQ_GETADDRINFO], [
+ AC_REQUIRE([gl_C_RESTRICT])
+ AC_REQUIRE([gl_SOCKET_FAMILIES])
+ AC_REQUIRE([AC_C_INLINE])
+])
diff --git a/m4/getdelim.m4 b/m4/getdelim.m4
new file mode 100644
index 000000000..340bb7126
--- /dev/null
+++ b/m4/getdelim.m4
@@ -0,0 +1,30 @@
+# getdelim.m4 serial 1
+
+dnl Copyright (C) 2005 Free Software dnl Foundation, Inc.
+dnl
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_PREREQ(2.52)
+
+AC_DEFUN([gl_FUNC_GETDELIM],
+[
+ AC_LIBSOURCES([getdelim.c, getdelim.h])
+
+ dnl Persuade glibc <stdio.h> to declare getdelim().
+ AC_REQUIRE([AC_GNU_SOURCE])
+
+ AC_REPLACE_FUNCS(getdelim)
+ AC_CHECK_DECLS_ONCE(getdelim)
+
+ if test $ac_cv_func_getdelim = no; then
+ gl_PREREQ_GETDELIM
+ fi
+])
+
+# Prerequisites of lib/getdelim.c.
+AC_DEFUN([gl_PREREQ_GETDELIM],
+[
+ AC_CHECK_FUNCS([flockfile funlockfile])
+])
diff --git a/m4/mbchar.m4 b/m4/mbchar.m4
new file mode 100644
index 000000000..dd613cbc6
--- /dev/null
+++ b/m4/mbchar.m4
@@ -0,0 +1,14 @@
+# mbchar.m4 serial 1
+dnl Copyright (C) 2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl autoconf tests required for use of mbchar.m4
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_MBCHAR],
+[
+ AC_REQUIRE([AC_GNU_SOURCE])
+ :
+])
diff --git a/m4/mbiter.m4 b/m4/mbiter.m4
new file mode 100644
index 000000000..3eb92bcca
--- /dev/null
+++ b/m4/mbiter.m4
@@ -0,0 +1,14 @@
+# mbiter.m4 serial 1
+dnl Copyright (C) 2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl autoconf tests required for use of mbiter.h
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_MBITER],
+[
+ AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ :
+])
diff --git a/m4/sockpfaf.m4 b/m4/sockpfaf.m4
new file mode 100644
index 000000000..b224faec5
--- /dev/null
+++ b/m4/sockpfaf.m4
@@ -0,0 +1,39 @@
+# sockpfaf.m4 serial 2
+dnl Copyright (C) 2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Test for some common socket protocol families (PF_INET, PF_INET6, ...)
+dnl and some common address families (AF_INET, AF_INET6, ...).
+dnl This test assumes that a system supports an address family if and only if
+dnl it supports the corresponding protocol family.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_SOCKET_FAMILIES],
+[
+ AC_MSG_CHECKING(for IPv4 sockets)
+ AC_CACHE_VAL(gl_cv_socket_ipv4,
+ [AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>],
+[int x = AF_INET; struct in_addr y; struct sockaddr_in z;],
+ gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)])
+ AC_MSG_RESULT($gl_cv_socket_ipv4)
+ if test $gl_cv_socket_ipv4 = yes; then
+ AC_DEFINE(HAVE_IPV4, 1, [Define to 1 if <sys/socket.h> defines AF_INET.])
+ fi
+
+ AC_MSG_CHECKING(for IPv6 sockets)
+ AC_CACHE_VAL(gl_cv_socket_ipv6,
+ [AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>],
+[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;],
+ gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)])
+ AC_MSG_RESULT($gl_cv_socket_ipv6)
+ if test $gl_cv_socket_ipv6 = yes; then
+ AC_DEFINE(HAVE_IPV6, 1, [Define to 1 if <sys/socket.h> defines AF_INET6.])
+ fi
+])