mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Cross Compile OpenSSH-7.5p1 failure


From: Nagaev Boris
Subject: Re: [Mingw-cross-env-list] Cross Compile OpenSSH-7.5p1 failure
Date: Fri, 28 Apr 2017 01:32:57 +0000

Hey Jose

On Thu, Apr 27, 2017 at 9:11 PM, J Gomez <address@hidden> wrote:
> Followed the directions on installing MXE using binary install at
> http://pkg.mxe.cc using Debian Jessie 8.7.1 x64.
>
> Did the following:
>
> sudo apt-get install mxe-i686-w64-mingw32.static-openssl install
> mxe-i686-w64-mingw32.static-zlib mxe-i686-w64-mingw32.static-gcc

The command has extra "install" argument.

> Also added export PATH=$PATH:/usr/lib/mxe/usr/bin to ~/.profile.
>
> Then attempted to compile OpenSSH-7.5p1 using:

I assume you use this file:
https://mirrors.evowise.com/pub/OpenBSD/OpenSSH/portable/openssh-7.5p1.tar.gz


>  ./configure --host=i686-w64-mingw32.static --build=i686
>
> But it fails with:
>
> <snip>
> configure: error: *** Can't find recent OpenSSL libcrypto (see config.log
> for details) ***

I can reproduce it here.

> I'm guessing I have to compile libcryto since I don't see it at
> http://mxe.cc/build-matrix.html?


usr/i686-w64-mingw32.static/lib/libcrypto.a is installed as a part of
openssl package. The problem is that openssh's configure script fails
to find it.

I checked config.log and it has the errors like this:

libcrypto.a(rand_win.o):rand_win.c:(.text+0xf6d): undefined reference
to address@hidden'

This is because libcrypto uses symbols from other libraries
(GetDeviceCaps is from system library gdi32). The full list of these
libraries can be found in file
usr/i686-w64-mingw32.static/lib/pkgconfig/libcrypto.pc

I added the following option to configure:
--with-libs="$(i686-w64-mingw32.static-pkg-config --libs libcrypto)"

Now it fails with another error: checking for socklen_t equivalent...
configure: error: Cannot find a type to use in place of socklen_t

I fixed this error with the following patch:

--- /tmp/openssh-7.5p1/aclocal.m4       2017-03-20 03:39:27.000000000 +0100
+++ aclocal.m4  2017-04-28 03:09:05.245672111 +0200
@@ -152,10 +152,9 @@
         for arg2 in "struct sockaddr" void; do
            for t in int size_t unsigned long "unsigned long"; do
               AC_TRY_COMPILE([
-                 #include <sys/types.h>
-                 #include <sys/socket.h>
+                 #include <ws2tcpip.h>

-                 int getpeername (int, $arg2 *, $t *);
+                 WINSOCK_API_LINKAGE int WSAAPI getpeername (SOCKET,
$arg2 *, $t *);
               ],[
                  $t len;
                  getpeername(0,0,&len);

followed by `autoreconf` invocation.

But when I run `make` tons of errors of missing headers (like
netinet/in.h) appeared.

It looks like the package needs more patching to build with MXE.

PS. There is libssh2 package in MXE.

-- 
Best regards,
Boris Nagaev



reply via email to

[Prev in Thread] Current Thread [Next in Thread]