Skip to content

Autoconf discoverability fixes#10186

Merged
shindere merged 3 commits intoocaml:trunkfrom
MisterDA:configure-network-windows-fixes
Feb 10, 2021
Merged

Autoconf discoverability fixes#10186
shindere merged 3 commits intoocaml:trunkfrom
MisterDA:configure-network-windows-fixes

Conversation

@MisterDA
Copy link
Copy Markdown
Contributor

@MisterDA MisterDA commented Feb 1, 2021

Use AC_SEARCH_LIBS to discover network functions when they're not in libc. That way, autoconf passes the correct link flags to link with the libraries.
Use correct headers and link flags with mingw-w64 to discover network functions and types.

@dra27 dra27 requested a review from shindere February 1, 2021 16:45
@shindere
Copy link
Copy Markdown
Contributor

shindere commented Feb 1, 2021 via email

@MisterDA MisterDA force-pushed the configure-network-windows-fixes branch from b9be286 to fb14a70 Compare February 3, 2021 10:56
@MisterDA
Copy link
Copy Markdown
Contributor Author

MisterDA commented Feb 3, 2021

In a private exchange @shindere asked me to double-check if the headers used in configure were used in the code, and it turns out I had used for detecting sockaddr_in6 a header that the doc advises not to use, so I've replaced <winsock2.h> and <ws2ipdef.h> with <ws2tcpip.h> which is necessary and sufficient, and used in the code. Thanks for noticing that!

This is required for configure to pass correct link flags in its
tests, otherwise linking fails.

This doesn't change anything for the MSVC build. Configure doesn't
support it, and emits Gcc build flags that MSVC ignores.
@dra27 dra27 force-pushed the configure-network-windows-fixes branch from fb14a70 to 9675963 Compare February 10, 2021 10:10
Copy link
Copy Markdown
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased to remove the conflict with #10156 - good to go when CI passes

@dra27 dra27 added the merge-me label Feb 10, 2021
@shindere shindere merged commit 1ae9aff into ocaml:trunk Feb 10, 2021
@MisterDA MisterDA deleted the configure-network-windows-fixes branch November 26, 2022 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants