1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
dnl Copyright (C) 1999 Open Source Telecom Corporation.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a configuration
dnl script generated by Autoconf, you may include it under the same
dnl distribution terms that you use for the rest of that program.
AC_DEFUN(OST_LIB_SOCKET,[
AC_REQUIRE([OST_HEADER_SYSTIME])
ost_cv_inet_sockets=no
ost_cv_unix_sockets=no
ost_cv_lib_socket="c"
AC_CHECK_HEADERS(sys/socket.h,[
AC_CHECK_HEADERS(select.h sys/select.h)
AC_CHECK_HEADERS(arpa/inet.h,
ost_cv_inet_sockets=yes)
AC_CHECK_HEADERS(sys/un.h,
ost_cv_unix_sockets=yes)
], AC_CHECK_HEADERS(winsock.h,
ost_cv_inet_sockets=yes))
AC_CHECK_LIB(socket, socket, [
ost_cv_lib_socket="socket"
LIBS="$LIBS -lsocket"
])
if test $ost_cv_inet_sockets = yes ; then
AC_DEFINE(HAVE_INET_SOCKETS)
AC_CHECK_LIB($ost_cv_lib_socket, inet_aton,[
AC_DEFINE(HAVE_INET_ATON)])
AC_CACHE_CHECK("for socklen_t defined", ost_cv_socklen_t, [
ost_cv_socklen_t='no'
AC_EGREP_HEADER(socklen_t, sys/socket.h,
ost_cv_socklen_t='yes')
])
if test $ost_cv_socklen_t = yes ; then
AC_DEFINE(HAVE_SOCKLEN_T)
fi
fi
if test $ost_cv_unix_sockets = yes ; then
AC_DEFINE(HAVE_UNIX_SOCKETS)
fi
])
dnl ACCONFIG TEMPLATE
dnl #undef HAVE_SYS_SOCKET_H
dnl #undef HAVE_ARPA_INET_H
dnl #undef HAVE_SYS_UN_H
dnl #undef HAVE_SELECT_H
dnl #undef HAVE_SYS_SELECT_H
dnl #undef HAVE_INET_ATON
dnl #undef HAVE_INET_SOCKETS
dnl #undef HAVE_UNIX_SOCKETS
dnl #undef HAVE_SOCKLEN_T
dnl END ACCONFIG
dnl ACCONFIG BOTTOM
dnl
dnl #ifdef HAVE_WINSOCK_H
dnl #include <winsock.h>
dnl #else
dnl #ifdef HAVE_SYS_SOCKET_H
dnl #include <sys/socket.h>
dnl #ifdef HAVE_SELECT_H
dnl #include <select.h>
dnl #else
dnl #ifdef HAVE_SYS_SELECT_H
dnl #include <sys/select.h>
dnl #endif
dnl #endif
dnl #ifdef HAVE_ARPA_INET_H
dnl #include <netinet/in.h>
dnl #include <arpa/inet.h>
dnl #include <netdb.h>
dnl #endif
dnl #ifdef HAVE_SYS_UN_H
dnl #include <sys/un.h>
dnl #endif
dnl #endif
dnl #endif
dnl
dnl #ifndef HAVE_INET_ATON
dnl #define inet_aton(cp, addr) \
dnl (((*(unsigned long int *)(addr)) = inet_addr(cp)) != -1)
dnl #endif
dnl
dnl #ifndef SUN_LEN
dnl #ifdef SCM_RIGHTS
dnl #define HAVE_UN_LEN
dnl #endif
dnl #ifdef __linux
dnl #define HAVE_UN_LEN
dnl #endif
dnl #ifdef HAVE_UN_LEN
dnl #define SUN_LEN(ptr) sizeof(sockaddr_un.sun_len) + \
dnl sizeof(sockaddr_un.sun_family) + sizeof(sockaddr_un.sun_path) + 1
dnl #else
dnl #define SUN_LEN(ptr) ((size_t)((struct sockaddr_un *)0)->sun_path) \
dnl + strlen((ptr)->sun_path))
dnl #endif
dnl #endif
dnl
dnl #ifndef HAVE_SOCKLEN_T
dnl typedef int socklen_t;
dnl #endif
dnl
dnl END ACCONFIG
|