INN commit: trunk (4 files)
INN Commit
rra at isc.org
Sat Oct 26 18:36:32 UTC 2013
Date: Saturday, October 26, 2013 @ 11:36:31
Author: iulius
Revision: 9549
separate m4 macros for networking and UNIX domain sockets
Use rra-c-util socket.m4 and socket-unix.m4 files.
Added:
trunk/m4/socket-unix.m4
Modified:
trunk/MANIFEST
trunk/configure.ac
trunk/m4/socket.m4
-------------------+
MANIFEST | 1
configure.ac | 1
m4/socket-unix.m4 | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++
m4/socket.m4 | 73 ++++++++++++----------------------------------
4 files changed, 103 insertions(+), 53 deletions(-)
Modified: MANIFEST
===================================================================
--- MANIFEST 2013-10-26 16:38:23 UTC (rev 9548)
+++ MANIFEST 2013-10-26 18:36:31 UTC (rev 9549)
@@ -582,6 +582,7 @@
m4/sendfd.m4 Autoconf macro for STREAMS fd passing
m4/sendmail.m4 Autoconf macro for finding sendmail
m4/snprintf.m4 Autoconf macro to check snprintf
+m4/socket-unix.m4 Autoconf macros to check UNIX domain sockets
m4/socket.m4 Autoconf macros to check socket support
m4/syslog.m4 Autoconf macro for syslog facility
m4/users.m4 Autoconf macro for INN users
Modified: configure.ac
===================================================================
--- configure.ac 2013-10-26 16:38:23 UTC (rev 9548)
+++ configure.ac 2013-10-26 18:36:31 UTC (rev 9549)
@@ -62,6 +62,7 @@
m4_include([m4/sendfd.m4])
m4_include([m4/sendmail.m4])
m4_include([m4/snprintf.m4])
+m4_include([m4/socket-unix.m4])
m4_include([m4/socket.m4])
m4_include([m4/syslog.m4])
m4_include([m4/users.m4])
Added: m4/socket-unix.m4
===================================================================
--- m4/socket-unix.m4 (rev 0)
+++ m4/socket-unix.m4 2013-10-26 18:36:31 UTC (rev 9549)
@@ -0,0 +1,81 @@
+dnl Various checks for UNIX domain socket support and macros.
+dnl $Id$
+dnl
+dnl This is a collection of various Autoconf macros for checking UNIX domain
+dnl socket properties. The macros provided are:
+dnl
+dnl INN_MACRO_SUN_LEN
+dnl INN_SYS_UNIX_SOCKETS
+dnl
+dnl They use a separate internal source macro to make the code easier to read.
+dnl
+dnl The canonical version of this file is maintained in the rra-c-util
+dnl package, available at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+dnl
+dnl Copyright 2009
+dnl The Board of Trustees of the Leland Stanford Junior University
+dnl Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009
+dnl by Internet Systems Consortium, Inc. ("ISC")
+dnl Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+dnl 2002, 2003 by The Internet Software Consortium and Rich Salz
+dnl
+dnl This code is derived from software contributed to the Internet Software
+dnl Consortium by Rich Salz.
+dnl
+dnl Permission to use, copy, modify, and distribute this software for any
+dnl purpose with or without fee is hereby granted, provided that the above
+dnl copyright notice and this permission notice appear in all copies.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+dnl REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+dnl MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY
+dnl SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+dnl IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+dnl Source used by INN_MACRO_SUN_LEN.
+AC_DEFUN([_INN_MACRO_SUN_LEN_SOURCE], [[
+#include <sys/types.h>
+#include <sys/un.h>
+
+int
+main(void)
+{
+ struct sockaddr_un s_un;
+ int i = SUN_LEN(&s_un);
+}
+]])
+
+dnl Check for SUN_LEN, which returns the size of a struct sockaddr_un. Sets
+dnl HAVE_SUN_LEN if the macro is available.
+AC_DEFUN([INN_MACRO_SUN_LEN],
+[AC_CACHE_CHECK([for SUN_LEN macro], [inn_cv_sun_len_macro],
+ [AC_LINK_IFELSE([AC_LANG_SOURCE([_INN_MACRO_SUN_LEN_SOURCE])],
+ [inn_cv_sun_len_macro=yes],
+ [inn_cv_sun_len_macro=no])])
+AS_IF([test x"$inn_cv_sun_len_macro" = xyes],
+ [AC_DEFINE([HAVE_SUN_LEN], 1,
+ [Define if <sys/un.h> defines the SUN_LEN macro.])])])
+
+dnl Source used by INN_SYS_UNIX_SOCKETS.
+AC_DEFUN([_INN_SYS_UNIX_SOCKETS], [[
+#include <sys/types.h>
+#include <sys/socket.h>
+#ifndef AF_UNIX
+error: No UNIX domain sockets!
+#endif
+]])
+
+dnl Check if UNIX domain sockets are supported. Assume that they are if
+dnl AF_UNIX is set in <sys/socket.h>. This loses on really old versions of
+dnl Linux, where AF_UNIX is available but doesn't work, but we don't care
+dnl about Linux 1.0 any more.
+AC_DEFUN([INN_SYS_UNIX_SOCKETS],
+[AC_CACHE_CHECK([for UNIX domain sockets], [inn_cv_sys_unix_sockets],
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_INN_SYS_UNIX_SOCKETS])],
+ [inn_cv_sys_unix_sockets=yes],
+ [inn_cv_sys_unix_sockets=no])])
+AS_IF([test x"$inn_cv_sys_unix_sockets" = xyes],
+ [AC_DEFINE([HAVE_UNIX_DOMAIN_SOCKETS], 1,
+ [Define if you have UNIX domain sockets.])])])
Property changes on: trunk/m4/socket-unix.m4
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision
Modified: m4/socket.m4
===================================================================
--- m4/socket.m4 2013-10-26 16:38:23 UTC (rev 9548)
+++ m4/socket.m4 2013-10-26 18:36:31 UTC (rev 9549)
@@ -1,4 +1,4 @@
-dnl socket.m4 -- Various checks for socket support and macros.
+dnl Various checks for socket support and macros.
dnl $Id$
dnl
dnl This is a collection of various Autoconf macros for checking networking
@@ -7,18 +7,33 @@
dnl INN_FUNC_GETADDRINFO_ADDRCONFIG
dnl INN_MACRO_IN6_ARE_ADDR_EQUAL
dnl INN_MACRO_SA_LEN
-dnl INN_MACRO_SUN_LEN
-dnl INN_SYS_UNIX_SOCKETS
dnl
dnl They use a separate internal source macro to make the code easier to read.
dnl
-dnl Copyright 2008, 2009 Board of Trustees, Leland Stanford Jr. University
+dnl The canonical version of this file is maintained in the rra-c-util
+dnl package, available at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+dnl
+dnl Copyright 2008, 2009, 2011
+dnl The Board of Trustees of the Leland Stanford Junior University
dnl Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009
dnl by Internet Systems Consortium, Inc. ("ISC")
dnl Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
dnl 2002, 2003 by The Internet Software Consortium and Rich Salz
dnl
-dnl See LICENSE for licensing terms.
+dnl This code is derived from software contributed to the Internet Software
+dnl Consortium by Rich Salz.
+dnl
+dnl Permission to use, copy, modify, and distribute this software for any
+dnl purpose with or without fee is hereby granted, provided that the above
+dnl copyright notice and this permission notice appear in all copies.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+dnl REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+dnl MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY
+dnl SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+dnl IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dnl Source used by INN_FUNC_GETADDRINFO_ADDRCONFIG.
AC_DEFUN([_INN_FUNC_GETADDRINFO_ADDRCONFIG_SOURCE], [[
@@ -108,51 +123,3 @@
AS_IF([test x"$inn_cv_sa_len_macro" = xyes],
[AC_DEFINE([HAVE_SA_LEN], 1,
[Define if <sys/socket.h> defines the SA_LEN macro.])])])
-
-dnl Source used by INN_MACRO_SUN_LEN.
-AC_DEFUN([_INN_MACRO_SUN_LEN_SOURCE], [[
-#include <sys/types.h>
-#include <sys/un.h>
-
-int
-main(void)
-{
- struct sockaddr_un s_un;
- int i = SUN_LEN(&s_un);
-}
-]])
-
-dnl Check for SUN_LEN, which returns the size of a struct socket regardless of
-dnl its type. This macro is required POSIX.1g but not that widespread yet.
-dnl Sets HAVE_SUN_LEN if the macro is available.
-AC_DEFUN([INN_MACRO_SUN_LEN],
-[AC_CACHE_CHECK([for SUN_LEN macro], [inn_cv_sun_len_macro],
- [AC_LINK_IFELSE([AC_LANG_SOURCE([_INN_MACRO_SUN_LEN_SOURCE])],
- [inn_cv_sun_len_macro=yes],
- [inn_cv_sun_len_macro=no])])
- AS_IF([test x"$inn_cv_sun_len_macro" = xyes],
- [AC_DEFINE([HAVE_SUN_LEN], 1,
- [Define if <sys/un.h> defines the SUN_LEN macro.])])])
-
-dnl Source used by INN_SYS_UNIX_SOCKETS.
-AC_DEFUN([_INN_SYS_UNIX_SOCKETS], [[
-#include <sys/types.h>
-#include <sys/socket.h>
-#ifndef AF_UNIX
-error: No Unix domain sockets!
-#endif
-]])
-
-dnl Check if Unix domain sockets are supported. Assume that they are if
-dnl AF_UNIX is set in <sys/socket.h>. This loses on really old versions of
-dnl Linux, where AF_UNIX is available but doesn't work, but we don't care
-dnl about Linux 1.0 any more.
-AC_DEFUN([INN_SYS_UNIX_SOCKETS],
-[AC_CACHE_CHECK([for Unix domain sockets], [inn_cv_sys_unix_sockets],
- [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_INN_SYS_UNIX_SOCKETS])],
- [inn_cv_sys_unix_sockets=yes],
- [inn_cv_sys_unix_sockets=no])])
- AS_IF([test x"$inn_cv_sys_unix_sockets" = xyes],
- [AC_DEFINE([HAVE_UNIX_DOMAIN_SOCKETS], 1,
- [Define if you have Unix domain sockets.])])])
-
More information about the inn-committers
mailing list