head 1.19; access; symbols LMTP2NNTP_1_4_1:1.18 LMTP2NNTP_1_4_0:1.18 SIO_0_9_3:1.18 SA_1_2_6:1.18 SA_1_2_5:1.18 SA_1_2_4:1.18 SA_1_2_3:1.18 LMTP2NNTP_1_3_0:1.17 LMTP2NNTP_1_3b2:1.17 SA_1_2_2:1.17 LMTP2NNTP_1_3b1:1.16 SA_1_2_1:1.16 LMTP2NNTP_1_3a3:1.16 LMTP2NNTP_1_3a2:1.16 LMTP2NNTP_1_3a1:1.16 SA_1_2_0:1.16 SA_1_1_0:1.14 SIO_0_9_2:1.14 SIO_0_9_1:1.14 LMTP2NNTP_1_2_0:1.14 LMTP2NNTP_1_2b4:1.14 LMTP2NNTP_1_2b3:1.14 LMTP2NNTP_1_2b2:1.14 LMTP2NNTP_1_2b1:1.13 LMTP2NNTP_1_2a8:1.13 SIO_0_9_0:1.13 LMTP2NNTP_1_2a7:1.13 SA_1_0_5:1.13 SA_1_0_4:1.13 SA_1_0_3:1.13 SA_1_0_2:1.12 SA_1_0_1:1.12 SA_1_0_0:1.12 SA_0_9_3:1.12 SA_0_9_2:1.11 LMTP2NNTP_1_2a6:1.10 LMTP2NNTP_1_2a5:1.10 SA_0_9_1:1.10 LMTP2NNTP_1_2a4:1.9 LMTP2NNTP_1_2a3:1.8 SA_0_9_0:1.8 LMTP2NNTP_1_2a1:1.7 LMTP2NNTP_1_1_1:1.7 LMTP2NNTP_1_1_0:1.7 LMTP2NNTP_1_1b4:1.7 LMTP2NNTP_1_1b3:1.7 LMTP2NNTP_1_1b2:1.6 LMTP2NNTP_1_1b1:1.6 SA_0_0_0:1.1.1.1 VENDOR:1.1.1; locks; strict; comment @# @; 1.19 date 2006.06.10.10.00.17; author rse; state Exp; branches; next 1.18; commitid JpcJR7gM5uNpwrAr; 1.18 date 2005.01.24.15.10.09; author rse; state Exp; branches; next 1.17; 1.17 date 2004.06.26.11.59.00; author rse; state Exp; branches; next 1.16; 1.16 date 2004.04.02.18.21.07; author rse; state Exp; branches; next 1.15; 1.15 date 2004.03.26.16.05.59; author thl; state Exp; branches; next 1.14; 1.14 date 2003.02.07.20.47.51; author rse; state Exp; branches; next 1.13; 1.13 date 2003.01.06.13.11.23; author rse; state Exp; branches; next 1.12; 1.12 date 2002.10.26.15.45.32; author rse; state Exp; branches; next 1.11; 1.11 date 2002.10.11.15.27.39; author rse; state Exp; branches; next 1.10; 1.10 date 2002.03.15.10.47.36; author rse; state Exp; branches; next 1.9; 1.9 date 2002.03.14.15.39.43; author thl; state Exp; branches; next 1.8; 1.8 date 2002.01.02.12.43.50; author rse; state Exp; branches; next 1.7; 1.7 date 2001.10.24.12.17.51; author rse; state Exp; branches; next 1.6; 1.6 date 2001.10.10.19.32.29; author rse; state Exp; branches; next 1.5; 1.5 date 2001.10.08.15.01.26; author rse; state Exp; branches; next 1.4; 1.4 date 2001.10.08.14.47.30; author rse; state Exp; branches; next 1.3; 1.3 date 2001.10.08.10.03.54; author rse; state Exp; branches; next 1.2; 1.2 date 2001.10.05.11.48.49; author rse; state Exp; branches; next 1.1; 1.1 date 2001.10.02.13.27.44; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.10.02.13.27.44; author rse; state Exp; branches; next ; desc @@ 1.19 log @Adjusted all copyright messages for year 2006 @ text @dnl ## dnl ## OSSP sa - Socket Abstraction dnl ## Copyright (c) 2001-2006 Ralf S. Engelschall dnl ## Copyright (c) 2001-2006 The OSSP Project dnl ## Copyright (c) 2001-2005 Cable & Wireless dnl ## dnl ## This file is part of OSSP sa, a socket abstraction library which dnl ## can be found at http://www.ossp.org/pkg/lib/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 ## dnl # Check for an ANSI C typedef in a header dnl # configure.in: dnl # SA_CHECK_TYPEDEF(,
) dnl # acconfig.h: dnl # #undef HAVE_ 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]), 1, [Define to 1 if $1 exists]) fi ]) dnl # Check whether to use SO_RCVTIMEO|SO_SNDTIMEO with setsockopt(2) dnl # configure.ac: dnl # SA_CHECK_SOCKOPT(SO_RCVTIMEO) dnl # SA_CHECK_SOCKOPT(SO_SNDTIMEO) dnl # config.h: dnl # #undef USE_SO_RCVTIMEO or #define USE_SO_RCVTIMEO 1 dnl # #undef USE_SO_SNDTIMEO or #define USE_SO_SNDTIMEO 1 AC_DEFUN(SA_CHECK_SOCKOPT, [ AC_MSG_CHECKING(whether to use $1 with setsockopt(2)) AC_TRY_RUN([ #include #include #include int main(void) { int s; struct timeval timeo; timeo.tv_sec = 3; timeo.tv_usec = 3; #ifndef $1 exit(3); #else if ((s = socket(PF_INET, SOCK_STREAM, 0)) == -1) exit(2); /* fails on Solaris 2.6,8,9,10 and Debian 2.2 because SO_RCVTIMEO|SO_SNDTIMEO are defined but not implemented */ if (setsockopt(s, SOL_SOCKET, $1, (void *)&timeo, sizeof(timeo)) == -1) exit(1); exit(0); #endif } ] , [ AC_MSG_RESULT([yes]) AC_DEFINE(USE_$1, 1, [Define to use $1 with setsockopt(2)]) ] , [ AC_MSG_RESULT([no]) ] ) ])dnl dnl ## dnl ## Check for C99 va_copy() implementation dnl ## (and provide fallback implementation if neccessary) dnl ## dnl ## configure.in: dnl ## SA_CHECK_VA_COPY dnl ## foo.c: dnl ## #include "config.h" dnl ## [...] dnl ## va_copy(d,s) dnl ## dnl ## This check is rather complex: first because we really have to dnl ## try various possible implementations in sequence and second, we dnl ## cannot define a macro in config.h with parameters directly. dnl ## dnl # test program for va_copy() implementation changequote(<<,>>) m4_define(__va_copy_test, <<[ #include #include #include #define DO_VA_COPY(d, s) $1 void test(char *str, ...) { va_list ap, ap2; int i; va_start(ap, str); DO_VA_COPY(ap2, ap); for (i = 1; i <= 9; i++) { int k = (int)va_arg(ap, int); if (k != i) abort(); } DO_VA_COPY(ap, ap2); for (i = 1; i <= 9; i++) { int k = (int)va_arg(ap, int); if (k != i) abort(); } va_end(ap); } int main(int argc, char *argv[]) { test("test", 1, 2, 3, 4, 5, 6, 7, 8, 9); exit(0); } ]>>) changequote([,]) dnl # test driver for va_copy() implementation m4_define(__va_copy_check, [ AH_VERBATIM($1, [/* Predefined possible va_copy() implementation (id: $1) */ #define __VA_COPY_USE_$1(d, s) $2]) if test ".$ac_cv_va_copy" = .; then AC_TRY_RUN(__va_copy_test($2), [ac_cv_va_copy="$1"]) fi ]) dnl # Autoconf check for va_copy() implementation checking AC_DEFUN(SA_CHECK_VA_COPY,[ dnl # provide Autoconf display check message AC_MSG_CHECKING(for va_copy() function) dnl # check for various implementations in priorized sequence AC_CACHE_VAL(ac_cv_va_copy, [ ac_cv_va_copy="" dnl # 1. check for standardized C99 macro __va_copy_check(C99, [va_copy((d), (s))]) dnl # 2. check for alternative/deprecated GCC macro __va_copy_check(GCM, [VA_COPY((d), (s))]) dnl # 3. check for internal GCC macro (high-level define) __va_copy_check(GCH, [__va_copy((d), (s))]) dnl # 4. check for internal GCC macro (built-in function) __va_copy_check(GCB, [__builtin_va_copy((d), (s))]) dnl # 5. check for assignment approach (assuming va_list is a struct) __va_copy_check(ASS, [do { (d) = (s); } while (0)]) dnl # 6. check for assignment approach (assuming va_list is a pointer) __va_copy_check(ASP, [do { *(d) = *(s); } while (0)]) dnl # 7. check for memory copying approach (assuming va_list is a struct) __va_copy_check(CPS, [memcpy((void *)&(d), (void *)&(s)), sizeof((s))]) dnl # 8. check for memory copying approach (assuming va_list is a pointer) __va_copy_check(CPP, [memcpy((void *)(d), (void *)(s)), sizeof(*(s))]) if test ".$ac_cv_va_copy" = .; then AC_ERROR([no working implementation found]) fi ]) dnl # optionally activate the fallback implementation if test ".$ac_cv_va_copy" = ".C99"; then AC_DEFINE(HAVE_VA_COPY, 1, [Define if va_copy() macro exists (and no fallback implementation is required)]) fi dnl # declare which fallback implementation to actually use AC_DEFINE_UNQUOTED([__VA_COPY_USE], [__VA_COPY_USE_$ac_cv_va_copy], [Define to id of used va_copy() implementation]) dnl # provide activation hook for fallback implementation AH_VERBATIM([__VA_COPY_ACTIVATION], [/* Optional va_copy() implementation activation */ #ifndef HAVE_VA_COPY #define va_copy(d, s) __VA_COPY_USE(d, s) #endif ]) dnl # provide Autoconf display result message if test ".$ac_cv_va_copy" = ".C99"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no (using fallback implementation)]) 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) # check for system headers AC_CHECK_HEADERS(string.h sys/types.h sys/socket.h netdb.h netinet/in.h) # check for system functions AC_CHECK_FUNCS(inet_addr inet_aton inet_pton inet_ntoa inet_ntop snprintf getaddrinfo) dnl # check for network/socket size type SA_CHECK_TYPEDEF(socklen_t, sys/socket.h) SA_CHECK_TYPEDEF(ssize_t, sys/types.h) SA_CHECK_SOCKOPT(SO_RCVTIMEO) SA_CHECK_SOCKOPT(SO_SNDTIMEO) dnl # check for va_copy() SA_CHECK_VA_COPY ]) @ 1.18 log @welcome 2005 in OSSP sa, too @ text @d3 2 a4 2 dnl ## Copyright (c) 2001-2005 Ralf S. Engelschall dnl ## Copyright (c) 2001-2005 The OSSP Project @ 1.17 log @move va_copy() stuff to sa.ac so it is available in sa-embedding packages @ text @d3 3 a5 3 dnl ## Copyright (c) 2001-2004 Ralf S. Engelschall dnl ## Copyright (c) 2001-2004 The OSSP Project dnl ## Copyright (c) 2001-2004 Cable & Wireless @ 1.16 log @Adjusted all copyright messages for new year 2004. @ text @d98 110 d234 3 @ 1.15 log @Add autoconf check to detect unimplemented setsockopt features. Reported by Amos Gouaux. @ text @d3 3 a5 3 dnl ## Copyright (c) 2001-2003 Ralf S. Engelschall dnl ## Copyright (c) 2001-2003 The OSSP Project dnl ## Copyright (c) 2001-2003 Cable & Wireless Deutschland @ 1.14 log @Add internal address resolving support via the new IEEE Std 1003.1g-2000 ("POSIX.1") getaddrinfo(3) API. This especially provides more portable IPv6 address resolving. @ text @d56 42 d122 2 @ 1.13 log @- Adjusted all copyright messages for new year 2003. - Fixed generated owner in distribution tarball. - Prepare for 1.0.3 release @ text @d75 1 a75 1 AC_CHECK_FUNCS(inet_addr inet_aton inet_pton inet_ntoa inet_ntop snprintf) @ 1.12 log @strip trailing whitespaces @ text @d3 3 a5 3 dnl ## Copyright (c) 2001-2002 Ralf S. Engelschall dnl ## Copyright (c) 2001-2002 The OSSP Project dnl ## Copyright (c) 2001-2002 Cable & Wireless Deutschland @ 1.11 log @- fix inet_ntoa(3) usage - fallback to usage of inet_addr(3) if inet_aton(3) does not exists - add casts for arguments to [gs]etsockopt(3) to shut down warnings (This especially gets OSSP sa running under dead Solaris 2.6...) @ text @d45 2 a46 2 #include <$2>], ac_cv_typedef_$1=yes, d65 1 a65 1 fi d70 1 a70 1 @ 1.10 log @polishing for release @ text @d75 1 a75 1 AC_CHECK_FUNCS(inet_aton inet_pton inet_ntoa inet_ntop snprintf) @ 1.9 log @upgrade to Autoconf 2.53 environment @ text @d2 1 a2 1 dnl ## SA - OSSP Socket Abstraction Library d7 2 a8 2 dnl ## This file is part of OSSP SA, a socket abstraction library which dnl ## can be found at http://www.ossp.org/pkg/sa/. @ 1.8 log @bump copyright year @ text @d52 1 a52 1 AC_DEFINE(HAVE_[]translit($1, [a-z], [A-Z])) @ 1.7 log @make sure some platforms find their IPv6 library @ text @d3 3 a5 3 dnl ## Copyright (c) 2001 Ralf S. Engelschall dnl ## Copyright (c) 2001 The OSSP Project dnl ## Copyright (c) 2001 Cable & Wireless Deutschland @ 1.6 log @support for ssize_t fallback @ text @d67 3 @ 1.5 log @Revert my idea of fixing the socklen_t stuff with a fallback substitution in sa.h, because this is nasty for the inclusion in L2. Do it with a less-heavy #define on-the-fly in sa.h @ text @d76 1 @ 1.4 log @make SA more portable (now also works under Tru64 5.0) @ text @a55 22 dnl # Check for socklen_t dnl # configure.in: dnl # SA_CHECK_SOCKLENTYPE AC_DEFUN(SA_CHECK_SOCKLENTYPE,[dnl SA_CHECK_TYPEDEF(socklen_t, sys/socket.h) AC_MSG_CHECKING(for fallback socklen_t) AC_CACHE_VAL(ac_cv_check_socklentype, [ if test ".$ac_cv_typedef_socklen_t" = .yes; then ac_cv_check_socklentype='socklen_t' else ac_cv_check_socklentype='int' fi ]) AC_MSG_RESULT([$ac_cv_check_socklentype]) SA_FALLBACK_SOCKLEN_T="typedef ${ac_cv_check_socklentype} socklen_t;" if test ".$ac_cv_check_socklentype" = ".socklen_t"; then SA_FALLBACK_SOCKLEN_T="/* $SA_FALLBACK_SOCKLEN_T */" fi AC_SUBST(SA_FALLBACK_SOCKLEN_T) ]) d75 1 a75 1 SA_CHECK_SOCKLENTYPE @ 1.3 log @Various cleanups @ text @d1 29 a29 29 ## ## SA - OSSP Socket Abstraction Library ## Copyright (c) 2001 Ralf S. Engelschall ## Copyright (c) 2001 The OSSP Project ## Copyright (c) 2001 Cable & Wireless Deutschland ## ## 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 ## d31 52 a82 1 AC_DEFUN(AC_CHECK_SA,[ d95 3 @ 1.2 log @use snprintf(3) if exists @ text @d3 3 a5 2 ## Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) ## Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) @ 1.1 log @Initial revision @ text @d42 1 a42 1 AC_CHECK_FUNCS(inet_aton inet_pton inet_ntoa inet_ntop snprintf vsnprintf) @ 1.1.1.1 log @Import first cut of OSSP SA @ text @@