diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-09-07 18:18:06 +0200 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-09-07 18:26:44 +0200 |
commit | f597eff8ddc7a867ed40b388a76484a8c91f793b (patch) | |
tree | dfb79e0c33b2ab7b7386e5dd8954fa69681a5b16 | |
parent | 16d3e8b23941664fd6aaffb952ea2eeb3a2b5b74 (diff) | |
download | libxml2-f597eff8ddc7a867ed40b388a76484a8c91f793b.tar.gz |
autotools: Fix winsock detection
Hardcode the required library on MinGW because winsock uses non-standard
calling conventions on 32-bit Windows which makes AC_SEARCH_LIBS fail.
Should fix #406.
-rw-r--r-- | .gitlab-ci.yml | 10 | ||||
-rw-r--r-- | configure.ac | 29 |
2 files changed, 27 insertions, 12 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1c8cc5a6..d95bf7f8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -74,6 +74,14 @@ mingw:w64-x86_64:shared: CFLAGS: "-O2" MSYSTEM: MINGW64 +mingw:w64-i686:shared: + extends: .mingw + only: + - schedules + variables: + CFLAGS: "-O2" + MSYSTEM: MINGW32 + # Disabled, GCC missing? .mingw:msys:shared: extends: .mingw @@ -96,8 +104,6 @@ mingw:w64-x86_64:shared: cmake:linux:gcc:shared: extends: .cmake:linux -# only: -# - schedules variables: BUILD_SHARED_LIBS: "ON" CC: gcc diff --git a/configure.ac b/configure.ac index 5df1e7bb..b6255f91 100644 --- a/configure.ac +++ b/configure.ac @@ -349,16 +349,25 @@ dnl dnl Checks for inet libraries dnl if test "$with_http" != "no" || test "with_ftp" = "yes"; then - _libs=$LIBS - AC_SEARCH_LIBS(gethostbyname, [nsl ws2_32], [ - if test "$ac_cv_search_gethostbyname" != "none required"; then - NET_LIBS="$NET_LIBS $ac_cv_search_gethostbyname" - fi], [:], [$NET_LIBS]) - AC_SEARCH_LIBS(connect, [bsd socket inet ws2_32], [ - if test "$ac_cv_search_connect" != "none required"; then - NET_LIBS="$NET_LIBS $ac_cv_search_connect" - fi], [:], [$NET_LIBS]) - LIBS=$_libs + case "$host" in + *-*-mingw*) + dnl AC_SEARCH_LIBS doesn't work because of non-standard calling + dnl conventions on 32-bit Windows. + NET_LIBS="$NET_LIBS -lws2_32" + ;; + *) + _libs=$LIBS + AC_SEARCH_LIBS(gethostbyname, [nsl], [ + if test "$ac_cv_search_gethostbyname" != "none required"; then + NET_LIBS="$NET_LIBS $ac_cv_search_gethostbyname" + fi], [:], [$NET_LIBS]) + AC_SEARCH_LIBS(connect, [bsd socket inet], [ + if test "$ac_cv_search_connect" != "none required"; then + NET_LIBS="$NET_LIBS $ac_cv_search_connect" + fi], [:], [$NET_LIBS]) + LIBS=$_libs + ;; + esac dnl Determine what socket length (socklen_t) data type is AC_MSG_CHECKING([for type of socket length (socklen_t)]) |