Ticket #69 (closed defect)

Opened 9 years ago

Last modified 8 years ago

Fix MSYS+MINGW

Reported by: carlo_bramini Owned by: bagder
Priority: normal Milestone:
Component: misc Version:
Keywords: Cc: carlo_bramini, bagder
Blocked By: Blocks:

Description

Hello,
I fixed the compilation of libssh2 under MSYS+MINGW, now it works without problems.
The compilation under MSVC works too.
List of changes:

)configure.in
detect mingw32 (or mingw64) compiler, add some CFLAGS and detect the presence of W32API.
select() was not found at configure time because it is declared with PASCAL calling convention, so its name is decorated with "@". Normally such conditions must be fixed by declaring correct prototype, or including good include file (i.e. winsock2.h).

)scp_nonblock.c
)scp_write_nonblock.c
)sftp_RW_nonblock.c
)sftp_mkdir_nonblock.c
)sftp_nonblock.c
)sftp_write_nonblock.c
)sftpdir_nonblock.c
fixed nonblocking examples for Win32/Win64.

)libssh2_priv.h
Declare some useful stuff, mainly moved from libssh2_config.h under /win32 directory

)libssh2_config.h
Removed some stuff for fixing compilation under MSVC

Sincerely,

Carlo Bramini.

Attachments

libssh2.txt (9.3 KB) - added by carlo_bramini 8 years ago.
Fix for this bug.
libssh2_2.txt (3.7 KB) - added by carlo_bramini 8 years ago.
Fix for this bug.

Download all attachments as: .zip

Change History

comment:1 Changed 8 years ago by bagder

Thanks for your work, can you please update your patch against the current CVS as some changes now makes your patch not apply cleanly any more?

Changed 8 years ago by carlo_bramini

Fix for this bug.

comment:2 Changed 8 years ago by carlo_bramini

I updated my patch to the lastest CVS revision.
I hope that it will be fine and I hope to see a new version with mingw+msys support very soon!

Sincerely,

Carlo Bramini
File Added: libssh2.txt

comment:3 Changed 8 years ago by bagder

Thanks, a few remarks though:

1) I committed the fixes for the examples just now

2) It seems you've reverted some win32 changes when you removed newly fixed code from win32/libssh2_config.h and instead insert older-looking code into src/libssh2_priv.h

3) Your configure changes make configure break for me on Linux that's supposedly unreleated to mingw/msys.

Changed 8 years ago by carlo_bramini

Fix for this bug.

comment:4 Changed 8 years ago by carlo_bramini

Hello,
1) thanks!
2) I'm very sorry, it looks like I did the update with too much speed and without enough attention. In the new patch I did it correctly. I also added a little comment into win32/libssh2_config.h about the reason of WINSOCK_VERSION macro define.
3) I moved AC_CHECK_HEADERS macro from the *-mingw* case to the bottom part with all other include checks. I do not know why it happened, but that was the cause of the problem.
I also fixed the test on select() function into ws2_32 with $ac_cv_func_select, now the test is not done if select() has been already found.
Before making this new patch I configured and compiled libssh2 with mingw, MSVC, cygwin and colinux (with Debian 4.0r3) and now everything has been completed successfully.

Sorry for previous trouble...

Sincerely,

Carlo Bramini.
File Added: libssh2_2.txt

comment:5 Changed 8 years ago by bagder

Thanks, this was applied and committed just now!

Note: See TracTickets for help on using tickets.