Opened 16 years ago

Closed 16 years ago

#1257 closed defect (fixed)

configure script doesn't define HAVE_CLOSESOCKET macro

Reported by: serge.levin.spb@… Owned by: diego@…
Priority: normal Component: build system
Version: HEAD Severity: normal
Keywords: Cc: serge.levin.spb@…
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

Thus, mplayer fails to be built under mingw environment without specifying this macro manually in config.h file.

Attachments (2)

closesocket.patch (6.4 KB ) - added by serge.levin.spb@… 16 years ago.
bogus closesocket check. Also closesocket definition is wrapped with #ifndef HAVE_CLOSESOCKET
configure.patch (556 bytes ) - added by serge.levin.spb@… 16 years ago.
HAVE_CLOSESOCKET determine change

Download all attachments as: .zip

Change History (9)

comment:1 by serge.levin.spb@…, 16 years ago

Cc: serge.levin.spb@… added

comment:2 by diego@…, 16 years ago

Resolution: fixed
Status: newclosed

I have just implemented a test in configure, which I will commit in a moment.

comment:3 by serge.levin.spb@…, 16 years ago

Resolution: fixed
Status: closedreopened

closesocket() check, introduced in r27490 is bogus as far as both closesocket and close functions take one argument - socket (on Windows) or file (on POSIX systems) descriptor to be closed. So with changes, done in r27490 I got wrong check result for closesocket and following desciption in configure.log:

============ Checking for closesocket() ============

#include <arpa/inet.h>
int main(void) { closesocket(); return 0; }

gcc -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 -march=i486 -mtune=i686 -pipe -ffast-math -fomit-frame-pointer -I../live -I/home/levin/bin/include -static -L../live -L/home/levin/bin/lib -lwinmm -o /tmp/mplayer-conf-19168-2232.exe /tmp/mplayer-conf-28946-2232.c
C:/DOCUME~1/Serge/LOCALS~1/Temp/mplayer-conf-28946-2232.c:1:23: arpa/inet.h: No such file or directory
C:/DOCUME~1/Serge/LOCALS~1/Temp/mplayer-conf-28946-2232.c: In function `main':
C:/DOCUME~1/Serge/LOCALS~1/Temp/mplayer-conf-28946-2232.c:2: warning: implicit declaration of function `closesocket'

#include <winsock2.h>
int main(void) { closesocket(); return 0; }

gcc -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 -march=i486 -mtune=i686 -pipe -ffast-math -fomit-frame-pointer -I../live -I/home/levin/bin/include -static -L../live -L/home/levin/bin/lib -lwinmm -o /tmp/mplayer-conf-19168-2232.exe /tmp/mplayer-conf-28946-2232.c
C:/DOCUME~1/Serge/LOCALS~1/Temp/mplayer-conf-28946-2232.c: In function `main':
C:/DOCUME~1/Serge/LOCALS~1/Temp/mplayer-conf-28946-2232.c:2: error: too few arguments to function `closesocket'

Result is: no
##########################################

Also I grepped through the sources and wrapped #define closesocket close with HAVE_CLOSESOCKET, not HAVE_WINSOCK2_H check.

It might be determined whether closesocket function is specific for MS Windows platform only. If it is true, I think it'll be reasonable to merge HAVE_WINSOCK2_H and HAVE_CLOSESOCKET checks.

by serge.levin.spb@…, 16 years ago

Attachment: closesocket.patch added

bogus closesocket check. Also closesocket definition is wrapped with #ifndef HAVE_CLOSESOCKET

comment:4 by serge.levin.spb@…, 16 years ago

comment:5 by diego@…, 16 years ago

Status: reopenedassigned

(In reply to comment #3)

Created an attachment (id=488) [details]
bogus closesocket check. Also closesocket definition is wrapped with #ifndef
HAVE_CLOSESOCKET

Could you please refresh your patch, I have fixed all the code duplication that it exposed.

by serge.levin.spb@…, 16 years ago

Attachment: configure.patch added

HAVE_CLOSESOCKET determine change

comment:6 by serge.levin.spb@…, 16 years ago

attachments.isobsolete: 01

Here is patch, that only changes ./configure script.

But the problem is your latest commit (r27496) totally broke building process under MinGW. Multiple name conflict (e.g. DrawText in libregif and in winuser.h, GUID definition in codec-cfg.h, ...) makes it very hard to build mplayer from sources.

I'm going to investigate the problem deeper, but it'll take alot of time to fix build process and keep sources sanity. So I think, the quickest (but, of course, not the best) solution is to revert changes, made in r27496, and only apply attached configure.patch, which fixes only ./configure script to define/undef HAVE_CLOSESOCKET correctly.

comment:7 by diego@…, 16 years ago

Resolution: fixed
Status: assignedclosed

I applied your patch, thanks. The other MinGW problems should also have been taken care of.

Note: See TracTickets for help on using tickets.