Opened 16 years ago
Closed 16 years ago
#1257 closed defect (fixed)
configure script doesn't define HAVE_CLOSESOCKET macro
Reported by: | Owned by: | ||
---|---|---|---|
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)
Change History (9)
comment:1 by , 16 years ago
Cc: | added |
---|
comment:2 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
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 , 16 years ago
Attachment: | closesocket.patch added |
---|
bogus closesocket check. Also closesocket definition is wrapped with #ifndef HAVE_CLOSESOCKET
comment:4 by , 16 years ago
comment:5 by , 16 years ago
Status: | reopened → assigned |
---|
(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.
comment:6 by , 16 years ago
attachments.isobsolete: | 0 → 1 |
---|
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 , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I applied your patch, thanks. The other MinGW problems should also have been taken care of.
I have just implemented a test in configure, which I will commit in a moment.