diff options
author | Lorenz Kästle <lorenz.kaestle@netways.de> | 2023-03-09 10:03:48 (GMT) |
---|---|---|
committer | Lorenz Kästle <lorenz.kaestle@netways.de> | 2023-03-09 10:03:48 (GMT) |
commit | d0edb72a0c9bc1a28197ab4566928f7ee63a6d43 (patch) | |
tree | 6d524fb16d2dd1aa9f2d98529ef1de7a39f52700 /gl/m4/socketlib.m4 | |
parent | 9fdc82f0543c6e2891c7079f70297f92e8ef4619 (diff) | |
parent | 269718094177fb8a7e3d3005d1310495009fe8c4 (diff) | |
download | monitoring-plugins-d0edb72a0c9bc1a28197ab4566928f7ee63a6d43.tar.gz |
Merge branch 'master' into RincewindsHat-patch-1
Diffstat (limited to 'gl/m4/socketlib.m4')
-rw-r--r-- | gl/m4/socketlib.m4 | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/gl/m4/socketlib.m4 b/gl/m4/socketlib.m4 index b08a72f..a556af1 100644 --- a/gl/m4/socketlib.m4 +++ b/gl/m4/socketlib.m4 | |||
@@ -1,5 +1,5 @@ | |||
1 | # socketlib.m4 serial 1 | 1 | # socketlib.m4 serial 3 |
2 | dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. |
3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl with or without modifications, as long as this notice is preserved. | 5 | dnl with or without modifications, as long as this notice is preserved. |
@@ -14,21 +14,27 @@ AC_DEFUN([gl_SOCKETLIB], | |||
14 | LIBSOCKET= | 14 | LIBSOCKET= |
15 | if test $HAVE_WINSOCK2_H = 1; then | 15 | if test $HAVE_WINSOCK2_H = 1; then |
16 | dnl Native Windows API (not Cygwin). | 16 | dnl Native Windows API (not Cygwin). |
17 | AC_CACHE_CHECK([if we need to call WSAStartup in winsock2.h and -lws2_32], | 17 | dnl If the function WSAStartup exists (declared in <winsock2.h> and |
18 | [gl_cv_func_wsastartup], [ | 18 | dnl defined through -lws2_32), we need to call it. |
19 | gl_save_LIBS="$LIBS" | 19 | AC_CACHE_CHECK([for WSAStartup], |
20 | LIBS="$LIBS -lws2_32" | 20 | [gl_cv_func_wsastartup], [ |
21 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | 21 | gl_save_LIBS="$LIBS" |
22 | LIBS="$LIBS -lws2_32" | ||
23 | AC_LINK_IFELSE( | ||
24 | [AC_LANG_PROGRAM([[ | ||
22 | #ifdef HAVE_WINSOCK2_H | 25 | #ifdef HAVE_WINSOCK2_H |
23 | # include <winsock2.h> | 26 | # include <winsock2.h> |
24 | #endif]], [[ | 27 | #endif]], [[ |
25 | WORD wVersionRequested = MAKEWORD(1, 1); | 28 | WORD wVersionRequested = MAKEWORD(1, 1); |
26 | WSADATA wsaData; | 29 | WSADATA wsaData; |
27 | int err = WSAStartup(wVersionRequested, &wsaData); | 30 | int err = WSAStartup(wVersionRequested, &wsaData); |
28 | WSACleanup ();]])], | 31 | WSACleanup (); |
29 | gl_cv_func_wsastartup=yes, gl_cv_func_wsastartup=no) | 32 | ]]) |
30 | LIBS="$gl_save_LIBS" | 33 | ], |
31 | ]) | 34 | [gl_cv_func_wsastartup=yes], |
35 | [gl_cv_func_wsastartup=no]) | ||
36 | LIBS="$gl_save_LIBS" | ||
37 | ]) | ||
32 | if test "$gl_cv_func_wsastartup" = "yes"; then | 38 | if test "$gl_cv_func_wsastartup" = "yes"; then |
33 | AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.]) | 39 | AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.]) |
34 | LIBSOCKET='-lws2_32' | 40 | LIBSOCKET='-lws2_32' |
@@ -38,6 +44,10 @@ AC_DEFUN([gl_SOCKETLIB], | |||
38 | dnl Solaris has most socket functions in libsocket. | 44 | dnl Solaris has most socket functions in libsocket. |
39 | dnl Haiku has most socket functions in libnetwork. | 45 | dnl Haiku has most socket functions in libnetwork. |
40 | dnl BeOS has most socket functions in libnet. | 46 | dnl BeOS has most socket functions in libnet. |
47 | dnl On HP-UX, do NOT link with libxnet, because in 64-bit mode this would | ||
48 | dnl break code (e.g. in libraries) that invokes accept(), getpeername(), | ||
49 | dnl getsockname(), getsockopt(), or recvfrom() with a 32-bit addrlen. See | ||
50 | dnl "man xopen_networking" for details. | ||
41 | AC_CACHE_CHECK([for library containing setsockopt], [gl_cv_lib_socket], [ | 51 | AC_CACHE_CHECK([for library containing setsockopt], [gl_cv_lib_socket], [ |
42 | gl_cv_lib_socket= | 52 | gl_cv_lib_socket= |
43 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern | 53 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern |