From edec3c55f6087c04c304b3401e1195926a58ecef Mon Sep 17 00:00:00 2001 From: Wojciech Meyer Date: Sun, 30 Jun 2013 12:42:24 +0000 Subject: [PATCH] configure: add a special case to test for BSD sockets for mingw. (Patch by Adrien Nader!) I tried to use "hasgot" to test it but proved too difficult since you must #include to make link succeed (windows magic) which then makes gcc complain about the prototype being wrong. Since windows already needs a special case in order to add -lws2_32 and since we know for sure it will be available, skip the hasgot test and check $target directly. configure: add a special case to test for BSD sockets for mingw. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13855 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- configure | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure b/configure index f967b0fd3..7757708f1 100755 --- a/configure +++ b/configure @@ -1054,6 +1054,15 @@ elif sh ./hasgot -lnsl -lsocket socket socketpair bind listen accept connect; th cclibs="$cclibs -lnsl -lsocket" echo "#define HAS_SOCKETS" >> s.h has_sockets=yes +else + case "$target" in + *-*-mingw*) + inf "You have BSD sockets (with libraries '-lws2_32')" + cclibs="$cclibs -lws2_32" + echo "#define HAS_SOCKETS" >> s.h + has_sockets=yes ;; + *) ;; + esac fi if sh ./hasgot -i sys/socket.h -t socklen_t; then