]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Ugly patch to link on Windows
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Fri, 25 Jan 2013 20:58:31 +0000 (21:58 +0100)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Fri, 25 Jan 2013 20:58:31 +0000 (21:58 +0100)
Library ws2_32 is required when compiling on Windows but the autoconf macro
to test for a library doesn't work due to the special declaration of the
functions in that library.

configure.in

index eb6ccb4ce34aff33ae4720b74ecf0ffef81b411c..0f90762cffbc3d18d7edf672d24dd3ad069c5028 100644 (file)
@@ -197,6 +197,12 @@ AC_CHECK_FUNCS(fnmatch)
 dnl check for structure members
 AC_CHECK_MEMBER([struct sockaddr_storage.ss_len],[AC_DEFINE([HAVE_SOCKADDR_SA_LEN],1,[ss_len in sockaddr_storage])])
 
+dnl windows require this library
+if test $ac_cv_header_winsock_h = "yes" ; then
+#   AC_CHECK_LIBS([ws2_32],[WSAGetLastError]) fails because of the __stdcall in the function prototype
+   LIBS="$LIBS -lws2_32"
+fi
+
 dnl check for the rlim_t size
 AC_CHECK_SIZEOF(rlim_t,1,[#if HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>