----- Original Message ----- 
From: "Richie" <[email protected]>
To: "Sisyphus" <[email protected]>
Cc: <[email protected]>
Sent: Wednesday, October 27, 2010 6:31 AM
Subject: Net-SSH2 build process


> I'd like to get Net::SSH2 to build on strawberry perl 5.10 but ran into 
> SSH2.dll build issues as expected.  Do you mind sharing any of your notes 
> regarding this?  Maybe you have accomplished this yourself?  I'm guessing 
> that you might use cygwin to build the SSH2.dll.  Thanks for any 
> information.

I actually build in the msys shell, and I build only a *static* libssh2 
library.
There's a couple of minor changes that I first have to make to the 
'configure' script that's in the top level source folder - those changes 
would not need to be made when building a libssh2 dll. The command I run is:

./configure --disable-shared --enable-static 
CPPFLAGS="-I/usr/local/include -I/usr/local/ssl/include" 
LDFLAGS="-L/usr/local/lib -L/usr/local/ssl/lib" && make && make check && 
make install

I could also do that as a cross-compilation in Cygwin, in which case the 
following switches would need to be added to the 'configure' command (ie 
before '&& make ...'):

--host=i686-pc-mingw32 --build=i686-pc-cygwin CC='gcc -mno-cygwin' 
host_alias=i686-pc-mingw32

Actually, I'm not sure that *all* of those additional switches are, in fact, 
needed - but that's what I add when I build for MinGW in the Cygwin shell, 
and it has worked quite well on the few occasions I've tried it. (Haven't 
actually tried it with libssh2, however.) The 'CPPFLAGS' and 'LDFLAGS' 
arguments would need to be changed - unless I had mingw-compatible zlib & 
openssl headers and libraries in the locations specified.

If you're building a dll, then '--disable-shared --enable-static' needs to 
become '--disable-static --enable-shared'.

As a cross-compilation, 'make check' won't work, so you'd delete that bit if 
building for MinGW under Cygwin.

Also you'd need to specify the location where you want 'make install' to 
install the files - as you presumably wouldn't want them to go into Cygwin's 
/usr/local (which is where they would go by default). For that you'd add the 
confgure switch:

--prefix=/cygdrive/c/wherever

For a dll, you'll need openssl and zlib dll's to be locatable (and to have 
names that the Cygwin build process recognises ... whatever they may be). 
You might not need to specify  'CPPFLAGS' and 'LDFLAGS' switches (not sure).

The openssl and libz that I use are also static, and were built in the msys 
shell in a similar way to libssh2.
So ... decide how you want to go about it .... static or dynamic ? ... 
cygwin or msys ?

Then give it a crack, and see how it goes. I have Strawberry 5.12.0.1 (but 
not 5.10), so I can probably emulate whatever you do and (hopefully) then 
help out if you strike trouble.

(Btw, the ppm packages for Net-SSH2-0.33 available from the uwinnipeg repo 
should work fine with Strawberry Perl ... but I take it you already know 
that.)

Cheers,
Rob

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to