Opened 8 years ago

Closed 6 years ago

#5675 closed defect (wontfix)

winsock.m4's functionality can be replaced with AC_TRY_LINK

Reported by: asn Owned by: asn
Priority: Medium Milestone:
Component: Archived/Obfsproxy Version:
Severity: Keywords: building
Cc: zackw@… Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


rsavoye thinks that m4/winsock.m4 is useless and it can simply be replaced with AC_TRY_LINK.

Furthermore, rsavoye thinks that m4/winsock.m4 is broken here:

    for ac_lib in '' -lws2_32; do

Child Tickets

Change History (3)

comment:1 Changed 8 years ago by zwol

Cc: zackw@… added

I'm not especially proud of winsock.m4, but I do not believe it is "useless" or that it "can simply be replaced with AC_TRY_LINK." From IRC:

<zwol> the issue is that [AC_TRY_LINK, AC_CHECK_LIB, and AC_SEARCH_LIBS] all *fail* to find ntohl in -lws2_32 on Windows
<zwol> because it doesn't get declared correctly [so the linker is looking for the wrong symbol].
<zwol> in order to find ntohl in -lws2_32 on Windows, we have to control the test program so we can make it include <winsock2.h>.  That's the point of winsock.m4.
<zwol> The point of the "for ac_lib in '' -lws2_32" construct is to check first for *no* special library.  That was copied verbatim from AC_SEARCH_LIBS.

Having said that, I am interested to see what you manage to come up with. It may well be possible to do something simpler than what I did.

Note that I was doing native compilation on Windows XP in the MinGW environment. It is entirely possible that cross-compiling to MinGW behaves differently.

comment:2 Changed 8 years ago by zwol

N.B. AC_TRY_LINK is deprecated, you're supposed to use AC_LINK_IFELSE now. AC_CHECK_LIB is not officially deprecated, but should be; use AC_SEARCH_LIBS instead, to avoid pulling in a library you don't actually need.

comment:3 Changed 6 years ago by asn

Resolution: wontfix
Status: newclosed

This ticket is about the old C-based obfsproxy. Closing.

Note: See TracTickets for help on using tickets.