summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2021-09-07 14:53:04 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2023-05-03 23:11:34 -0400
commitc2540871fb1260388771feb244a6eceafd705443 (patch)
tree9d474cf7fa9704d2e499ff485ef00aa33367f428 /configure.ac
parentb86d4117be115bf1aa556130a823bdcd233bd726 (diff)
downloadlighttpd-git-c2540871fb1260388771feb244a6eceafd705443.tar.gz
[build] _WIN32 mingw build
use -lws2_32 instead of -lwsock32
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac32
1 files changed, 30 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 32e0734a..02b1cdf6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -90,6 +90,14 @@ LT_INIT([dlopen disable-static shared])
dnl for solaris
CPPFLAGS="${CPPFLAGS} -D_REENTRANT"
+case "$host_os" in
+ *mingw*)
+ WS2_32_LIB="-lws2_32"
+ AC_SUBST([WS2_32_LIB])
+ ;;
+ *);;
+esac
+
dnl Checks for header files.
dnl checks for sys/wait.h => HAVE_SYS_WAIT_H
@@ -127,6 +135,9 @@ AC_CHECK_MEMBER([struct tm.tm_gmtoff],
[],
[#include <time.h>]
)
+case "$host_os" in
+ *mingw*) AC_DEFINE([HAVE_SOCKLEN_T], [1]) ;;
+ *)
AC_CHECK_TYPES([socklen_t],
[], dnl defines HAVE_SOCKLEN_T
[],
@@ -135,6 +146,8 @@ AC_CHECK_TYPES([socklen_t],
#include <sys/socket.h>
]
)
+;;
+esac
dnl solaris needs -lsocket -lnsl
dnl Haiku needs -lnetwork
@@ -1417,8 +1430,12 @@ esac
AC_MSG_NOTICE([----------------------------------------])
case "$host_os" in
-*mingw* ) LIBS="$LIBS -lwsock32" ;;
-* ) ;;
+ *mingw*)
+ # (-lws2_32 needed to detect inet_pton() and select() on _WIN32)
+ save_LIBS=$LIBS
+ LIBS="$LIBS $WS2_32_LIB"
+ ;;
+ *);;
esac
AC_CHECK_FUNCS([\
@@ -1468,6 +1485,13 @@ if test "$ac_cv_func_poll" = no; then
fi
case "$host_os" in
+ *mingw*)
+ LIBS=$save_LIBS
+ ;;
+ *);;
+esac
+
+case "$host_os" in
*sunos*|*solaris* )
AC_CHECK_HEADERS([priv.h], [AC_CHECK_FUNCS([setpflags])])
AC_CHECK_HEADERS([port.h], [AC_CHECK_FUNCS([port_create])])
@@ -1573,6 +1597,10 @@ if test "$ipv6" = true; then
[ac_cv_ipv6_support=no]
)
])
+ case "$host_os" in
+ *mingw*) ac_cv_ipv6_support=yes ;;
+ *) ;;
+ esac
if test "$ac_cv_ipv6_support" = yes; then
AC_DEFINE([HAVE_IPV6], [1], [Whether to enable IPv6 support])