OSSP CVS Repository

ossp - Difference in ossp-pkg/l2/l2_ut_sa.ac versions 1.3 and 1.4
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/l2/l2_ut_sa.ac 1.3 -> 1.4

--- l2_ut_sa.ac  2001/10/24 13:04:11     1.3
+++ l2_ut_sa.ac  2001/10/26 10:59:47     1.4
@@ -1,39 +1,70 @@
-##
-##  SA - OSSP Socket Abstraction Library
-##  Copyright (c) 2001 The OSSP Project (http://www.ossp.org/)
-##  Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/)
-##
-##  This file is part of OSSP SA, a socket abstraction library which
-##  can be found at http://www.ossp.org/pkg/sa/.
-##
-##  Permission to use, copy, modify, and distribute this software for
-##  any purpose with or without fee is hereby granted, provided that
-##  the above copyright notice and this permission notice appear in all
-##  copies.
-##
-##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
-##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
-##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-##  SUCH DAMAGE.
-##
-##  sa.ac: socket abstraction Autoconf checks
-##
+dnl ##
+dnl ##  SA - OSSP Socket Abstraction Library
+dnl ##  Copyright (c) 2001 Ralf S. Engelschall <rse@engelschall.com>
+dnl ##  Copyright (c) 2001 The OSSP Project <http://www.ossp.org/>
+dnl ##  Copyright (c) 2001 Cable & Wireless Deutschland <http://www.cw.com/de/>
+dnl ##
+dnl ##  This file is part of OSSP SA, a socket abstraction library which
+dnl ##  can be found at http://www.ossp.org/pkg/sa/.
+dnl ##
+dnl ##  Permission to use, copy, modify, and distribute this software for
+dnl ##  any purpose with or without fee is hereby granted, provided that
+dnl ##  the above copyright notice and this permission notice appear in all
+dnl ##  copies.
+dnl ##
+dnl ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+dnl ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+dnl ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+dnl ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+dnl ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+dnl ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+dnl ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+dnl ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+dnl ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+dnl ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+dnl ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+dnl ##  SUCH DAMAGE.
+dnl ##
+dnl ##  sa.ac: socket abstraction Autoconf checks
+dnl ##
 
-AC_DEFUN(AC_CHECK_SA,[
+dnl #   Check for an ANSI C typedef in a header
+dnl #   configure.in:
+dnl #     SA_CHECK_TYPEDEF(<typedef>, <header>)
+dnl #   acconfig.h:
+dnl #     #undef HAVE_<typedef>
+
+AC_DEFUN(SA_CHECK_TYPEDEF,[dnl
+    AC_REQUIRE([AC_HEADER_STDC])dnl
+    AC_MSG_CHECKING(for typedef $1)
+    AC_CACHE_VAL(ac_cv_typedef_$1,[
+        AC_EGREP_CPP(dnl
+changequote(<<,>>)dnl
+<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
+changequote([,]), [
+#include <$2>], 
+            ac_cv_typedef_$1=yes, 
+            ac_cv_typedef_$1=no
+        )
+    ])dnl
+    AC_MSG_RESULT($ac_cv_typedef_$1)
+    if test $ac_cv_typedef_$1 = yes; then
+        AC_DEFINE(HAVE_[]translit($1, [a-z], [A-Z]))
+    fi
+])
+
+dnl #   Check for anything OSSP SA wants to know
+dnl #   configure.in:
+dnl #     SA_CHECK_ALL
+
+AC_DEFUN(SA_CHECK_ALL,[
     #   make sure libnsl and libsocket are linked in if they exist
     AC_CHECK_LIB(nsl, gethostname)
     if test ".`echo $LIBS | grep nsl`" = .; then
         AC_CHECK_LIB(nsl, gethostbyname)
     fi  
     AC_CHECK_LIB(socket, accept)
+
     #   make sure some platforms find their IPv6 library
     AC_CHECK_LIB(inet6, getaddrinfo)
     
@@ -42,5 +73,9 @@
 
     #   check for system functions
     AC_CHECK_FUNCS(inet_aton inet_pton inet_ntoa inet_ntop snprintf)
+
+    dnl # check for network/socket size type
+    SA_CHECK_TYPEDEF(socklen_t, sys/socket.h)
+    SA_CHECK_TYPEDEF(ssize_t, sys/types.h)
 ])
 

CVSTrac 2.0.1