Re: Net-SSH2 build process

2010-10-26 Thread Sisyphus

- Original Message - 
From: "Richie" 
To: "Sisyphus" 
Cc: 
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
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net-SSH2 build process

2010-10-28 Thread Sisyphus

- Original Message - 
From: "Richie" 
To: "Sisyphus" 
Cc: 
Sent: Thursday, October 28, 2010 2:08 AM
Subject: Re: Net-SSH2 build process


> On 10/27/2010 2:31 AM, Sisyphus wrote:
>> (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
>>
> Thanks for the information.  Anyway, I've come to rely on this 
> functionality on both Windows and Solaris and so far you seem to be the 
> only one that provides a packaged solution on Windows.

Serguei Trouchelle used to provide Net::SSH2 on his ppm repo - built using 
MSVC++ and the Makefile provided in the win32 folder of the libssh2 source 
distro (I think). You could (as yet another alternative) take a look at the 
win32/Makefile.win32 and see if it offers any joy for you - I haven't tried 
it.

Anyway, under more extensive testing, there was a problem with Serguei's 
build, so he took it off the repo. (The actual problem was that the test 
script that ships with Net::SSH2 segfaulted after test 28 was run. The 
problem may since have been fixed faik.)

> I wanted to learn how to do it just in case :)  I'm actually new to 
> cygwin, but already use msysgit, so I think I will switch to use a full 
> install of msys.

Yes, msys is *my* preferred option. (I use cygwin pretty much only for its 
'git' and 'svn' clients :-)

Cheers,
Rob 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net-SSH2 build process

2010-10-28 Thread Richie

On 10/28/2010 2:33 AM, Sisyphus wrote:
Yes, msys is *my* preferred option. (I use cygwin pretty much only for 
its 'git' and 'svn' clients :-)


Cheers,
Rob
Here are some notes so far (and failures).  On Solaris I had to build 
shared libs to avoid this issue, but shared seems to be more problematic 
though.   Are you using gcc 4.5 and source versions of these packages 
comparable to what I'm attempting to compile?


NOTES (thus far)

msys here http://www.cccp-project.net/nichorai/msys.premade.2010.09.07.7z

zlib here 
http://sourceforge.net/projects/mingw/files/MinGW/zlib/zlib-1.2.3-1-mingw32/zlib-1.2.3-1-mingw32-src.tar.gz/download
./configure && make && make install

openssl here http://www.openssl.org/source/openssl-0.9.8o.tar.gz [had to hack 
e_os2.h remove the static modifier]
./config && make && make install

libssh2 here http://www.libssh2.org/download/libssh2-1.2.7.tar.gz

xpmu...@virtualxp-23999 /c/work/libssh2-1.2.7
$ ./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
checking whether to enable maintainer-specific portions of Makefiles... no
checking for sed... /bin/sed
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking libssh2 version... 1.2.7
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
configure: autobuild project... libssh2
configure: autobuild revision... 1.2.7
configure: autobuild hostname... VirtualXP-23999
configure: autobuild timestamp... 20101028-113322
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for long long... yes
checking if _REENTRANT is already defined... no
checking if _REENTRANT is actually needed... no
checking if _REENTRANT is onwards defined... no
checking for library containing socket... no
checking for library containing inet_addr... no
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking whether ln -s works... no, using cp -p
checking whether make sets $(MAKE)... (cached) yes
checking for sshd... no
checking for as... as
checking for dlltool... dlltool
checking for objdump... objdump
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... c:/msys/1.0/mingw/mingw32/bin/ld.exe
checking if the linker (c:/msys/1.0/mingw/mingw32/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /mingw/bin/nm
checking the name lister (/mingw/bin/nm) interface... BSD nm
checking the maximum length of command line arguments... 8192
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for c:/msys/1.0/mingw/mingw32/bin/ld.exe option to reload object 
files... -r
checking for objdump... (cached) objdump
checking how to recognize dependent libraries... file_magic ^x86 archive 
import|^x86 DLL
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /mingw/bin/nm output from gcc object... ok
checking for dlfcn.h... no
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (c:/msys/1.0/mingw/mingw32/bin/ld.exe) supports 
shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports s

Re: Net-SSH2 build process

2010-10-28 Thread Sisyphus


- Original Message - 
From: "Richie" 

Here are some notes so far (and failures).  On Solaris I had to build
shared libs to avoid this issue, but shared seems to be more problematic
though.   Are you using gcc 4.5 and source versions of these packages
comparable to what I'm attempting to compile?


I've successfully used both 3.4.5 and 4.6.0  - 4.5 should be fine.

As regards my version of MSYS:

$ uname -a
MINGW32_NT-6.0 DESKTOP2 1.0.11(0.46/3/2) 2007-07-29 17:16 i686 unknown

The libssh2 failure in your attachment arises because libssh2.a has been 
statically built (probably because openssl is static, as you suspected) but 
then the process still goes looking for dynamic symbols (the '_imp__' 
prefix).


Usually there's a message about this in the build output (before the library 
gets built).


I don't have a dynamic build of openssl, though I think I've probably tried 
in the past. I'll give it another go later today and see if I can get 
anywhere. I'm fairly sure you'll need a dynamic openssl to build a dynamic 
libssh2. (The Strawberry build of openssl may be usable here if all else 
fails.)


If you decide that a static build of libssh2 will suffice, first run 'make 
distclean', then :


##
In the configure script, change:

case "$host" in
   *-mingw*)
   CFLAGS="$CFLAGS -DLIBSSH2_WIN32 -DWINSOCK_VERSION=0x0200"
   LIBS="$LIBS -lws2_32"
   ;;

to:

case "$host" in
   *-mingw*)
   CFLAGS="$CFLAGS -DWINSOCK_VERSION=0x0200"
   LIBS="$LIBS -lws2_32 -lgdi32"
   ;;

##

(That is, remove the '-DLIBSSH2_WIN32' and add the '-lgdi32'.)

Then (obviously) re-run ./configure with the static and shared args reversed 
, 'make', 'make check' and 'make install'.


Attached is the Net::SSH2 Makefile.PL that I then use to build the module 
against the static libssh2 library. It contains some hard coded paths (to 
msys headers and libraries) which may well be the same as on your machine 
 or might not. Modify those as needed and you should be right.


(It would, of course, be good to be able to also build a libssh2 *dll* - so 
I'll put a bit of effort into that as time permits. I expect that the reason 
I don't already have one somewhere is that I didn't succeed in building 
openssl shared libs.)


Cheers,
Rob 


Makefile.PL
Description: Binary data
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net-SSH2 build process

2010-10-28 Thread Richie

On 10/28/2010 7:35 PM, Sisyphus wrote:
>  (The Strawberry build of openssl may be usable here if all else fails.)
I'm only seeing ssl headers in my portable install.

If you decide that a static build of libssh2 will suffice, first run 
'make distclean', then :


##
(That is, remove the '-DLIBSSH2_WIN32' and add the '-lgdi32'.)


Compiled and installed fine with that change.  I used

./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 install


Attached is the Net::SSH2 Makefile.PL that I then use to build the 
module against the static libssh2 library. It contains some hard coded 
paths (to msys headers and libraries) which may well be the same as on 
your machine  or might not. Modify those as needed and you should 
be right.


Here is where I am confused.  I thought I would stay in msys (at least 
for the purpose of getting SSH2.dll build at least)

(using: push @search_paths, '/local', '/local/ssl')
- see attached file msys1.txt (seems not only is the perl old and 
missing a newer Makemaker, but there are missing header(s)) is 5.6 ok I 
just need more dependencies?


(using: push @search_paths, 'C:/msys/1.0/local', 'C:/msys/1.0/local/ssl')
- i don't expect dmake to work but tried it anyway in strawberry shell, 
see attached file test1.txt








$ perl Makefile.PL

The libssh2 library is required by this module.  If you don't have it, you can
download it from http://www.libssh2.org; you may also need OpenSSL, which can be
obtained from http://www.openssl.org.

Debian:   sudo aptitude install libssh2-1-dev
OpenSUSE: sudo zypper in libssh2-1 libssh2-devel

Checking if your kit is complete...
Looks good
Warning: prerequisite ExtUtils::MakeMaker 6.42 not found at 
/usr/lib/perl5/5.6/ExtUtils/MakeMaker.pm line 347.
Writing Makefile for Net::SSH2

$ make
cp lib/Net/SSH2/PublicKey.pm blib/lib/Net/SSH2/PublicKey.pm
cp lib/Net/SSH2/Listener.pm blib/lib/Net/SSH2/Listener.pm
cp lib/Net/SSH2/SFTP.pm blib/lib/Net/SSH2/SFTP.pm
cp lib/Net/SSH2.pm blib/lib/Net/SSH2.pm
AutoSplitting blib/lib/Net/SSH2.pm (blib/lib/auto/Net/SSH2)
cp lib/Net/SSH2/Dir.pm blib/lib/Net/SSH2/Dir.pm
cp lib/Net/SSH2/Channel.pm blib/lib/Net/SSH2/Channel.pm
cp lib/Net/SSH2/File.pm blib/lib/Net/SSH2/File.pm
/bin/perl "-Iinc" -I/usr/lib/perl5/5.6/msys  /usr/lib/perl5/5.6/ExtUtils/xsubpp 
 -typemap /usr/lib/perl5/5.6/ExtUtils/typemap -typemap typemap SSH2.xs > 
SSH2.xsc && mv SSH2.xsc SSH2.c
gcc -c -I/usr/local/include -I/local/ssl/include -I/local/include 
-I/usr/include -I/usr/local/ssl/include -I. -DPERL_USE_SAFE_PUTENV -DDEBUGGING 
-fno-strict-aliasing -DUSEIMPORTLIB -O2 -fno-unit-at-a-time -g -s -march=i386 
-mtune=i686   -DVERSION=\"0.33\" -DXS_VERSION=\"0.33\"  
-I/usr/lib/perl5/5.6/msys/CORE  SSH2.c
In file included from SSH2.xs:8:0:
C:/msys/1.0/lib/perl5/5.6/msys/CORE/perl.h:649:27: fatal error: netinet/in.h: 
No such file or directory
compilation terminated.
make: *** [SSH2.o] Error 1

$ perl -v

This is perl, v5.6.1 built for msys

Copyright 1987-2001, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.

--
 Welcome to Strawberry Perl Portable Edition!
 * URL - http://www.strawberryperl.com/
 * see README.portable.TXT for more info
--
Perl executable: C:\strawberry\perl\bin\perl.exe
Perl version   : 5.10.1

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\strawberry>cd \formsys\Net-SSH2-0.33

C:\formsys\Net-SSH2-0.33>perl Makefile.PL

The libssh2 library is required by this module.  If you don't have it, you can
download it from http://www.libssh2.org; you may also need OpenSSL, which can be

obtained from http://www.openssl.org.

Debian:   sudo aptitude install libssh2-1-dev
OpenSUSE: sudo zypper in libssh2-1 libssh2-devel

Writing Makefile for Net::SSH2

C:\formsys\Net-SSH2-0.33>dmake
Skip blib\lib\Net\SSH2\File.pm (unchanged)
Skip blib\lib\Net\SSH2\Dir.pm (unchanged)
Skip blib\lib\Net\SSH2\PublicKey.pm (unchanged)
Skip blib\lib\Net\SSH2\SFTP.pm (unchanged)
Skip blib\lib\Net\SSH2\Listener.pm (unchanged)
Skip blib\lib\Net\SSH2\Channel.pm (unchanged)
Skip blib\lib\Net\SSH2.pm (unchanged)
gcc -c  -IC:/msys/1.0/local/include -IC:/msys/1.0/local/ssl/include -I.
-s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DP
ERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX -s -O2-DVERS
ION=\"0.33\"-DXS_VERSION=\"0.33\"  "-IC:\strawberry\perl\lib\CORE"   SSH2.c
Running Mkbootstrap for Net:

Re: Net-SSH2 build process

2010-10-28 Thread Sisyphus

- Original Message - 
From: "Richie" 

> (using: push @search_paths, 'C:/msys/1.0/local', 'C:/msys/1.0/local/ssl')
> - i don't expect dmake to work but tried it anyway in strawberry shell,
> see attached file test1.txt

It should work. (No problem for me on Strawberry 5.12.0.1.)
Looking at test1.txt it seems that there's a pre-existing build. Could you 
run 'dmake realclean', and then try again. (Post the 'dmake' results again 
if it still fails.)

Cheers,
Rob 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net-SSH2 build process

2010-10-28 Thread Sisyphus

- Original Message - 
From: "Sisyphus" 
>
> It should work. (No problem for me on Strawberry 5.12.0.1.)
> Looking at test1.txt it seems that there's a pre-existing build. Could you
> run 'dmake realclean', and then try again. (Post the 'dmake' results again
> if it still fails.)

Aaah ... found a Strawberry 5.10 installation and I get the same error as 
you reported.

Might need to use the same compiler both with Strawberry 5.10 and to build 
libssh2. (Doesn't seem to matter with 5.12.)

Can you alter your Strawberry path so that the mingw installation that built 
libssh2 is found *instead* of the mingw installation that ships with 
Strawberry ? That did the trick for me on Strawberry 5.10:

set PATH=C:\mingw\bin;%PATH%

(or whatever)

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net-SSH2 build process

2010-10-28 Thread Richie
On 10/28/2010 10:30 PM, Sisyphus wrote:
>
> - Original Message - From: "Sisyphus" 
>>
>> It should work. (No problem for me on Strawberry 5.12.0.1.)
>> Looking at test1.txt it seems that there's a pre-existing build. 
>> Could you
>> run 'dmake realclean', and then try again. (Post the 'dmake' results 
>> again
>> if it still fails.)
>
> Aaah ... found a Strawberry 5.10 installation and I get the same error 
> as you reported.
>
> Might need to use the same compiler both with Strawberry 5.10 and to 
> build libssh2. (Doesn't seem to matter with 5.12.)
>
> Can you alter your Strawberry path so that the mingw installation that 
> built libssh2 is found *instead* of the mingw installation that ships 
> with Strawberry ? That did the trick for me on Strawberry 5.10:
>
> set PATH=C:\mingw\bin;%PATH%
>
> (or whatever)
>
> Cheers,
> Rob
>

http://strawberryperl.com/release-notes/5.12.1.0.html mentions Net::SSH2 
does that have any bearing?

Let me update you first and then I will try what you suggest.  If you 
want to take this discussion off list for now we can do that and maybe  
I'll post back a guide to the list or something if somebody interested 
later.  If you want to keep it on list that's cool too.

dmake realclean tried to run "rm" command so I deleted/rextracted 
Netssh2 and copying back over the modified Makefile.PL.  I got the same 
results.  I then changed to use
push @search_paths, 'C:/msys/1.0/local', 'C:/msys/1.0/local/ssl', 
'C:/msys/1.0/mingw'

It looked like it was going to work then ld.exe crashed (got ld.exe 
stopped working dialog).  The box I am on at present is Windows 7 
64bit.  If you think thats a good chance of causing the problems which i 
suspect I'll stop for now until tomorrow when I get at my virtual XP 
install at work.


C:\formsys\Net-SSH2-0.33>dmake
cp lib/Net/SSH2/File.pm blib\lib\Net\SSH2\File.pm
cp lib/Net/SSH2/Dir.pm blib\lib\Net\SSH2\Dir.pm
cp lib/Net/SSH2/PublicKey.pm blib\lib\Net\SSH2\PublicKey.pm
cp lib/Net/SSH2/SFTP.pm blib\lib\Net\SSH2\SFTP.pm
cp lib/Net/SSH2/Listener.pm blib\lib\Net\SSH2\Listener.pm
cp lib/Net/SSH2/Channel.pm blib\lib\Net\SSH2\Channel.pm
cp lib/Net/SSH2.pm blib\lib\Net\SSH2.pm
AutoSplitting blib\lib\Net\SSH2.pm (blib\lib\auto\Net\SSH2)
C:\strawberry\perl\bin\perl.exe "-Iinc" 
C:\strawberry\perl\lib\ExtUtils\xsubpp
-typemap C:\strawberry\perl\lib\ExtUtils\typemap -typemap typemap  
SSH2.xs > SSH
2.xsc && C:\strawberry\perl\bin\perl.exe "-Iinc" -MExtUtils::Command -e 
"mv" --
SSH2.xsc SSH2.c
gcc -c  -IC:/msys/1.0/local/include -IC:/msys/1.0/mingw/include 
-IC:/msys/1.0/lo
cal/ssl/include -I. -s -O2 -DWIN32 -DHAVE_DES_FCRYPT 
-DUSE_SITECUSTOMIZE -DP
ERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing 
-DPERL_MSVCRT_READ
FIX -s -O2-DVERSION=\"0.33\"-DXS_VERSION=\"0.33\"  
"-IC:\strawberry\
perl\lib\CORE"   SSH2.c
Running Mkbootstrap for Net::SSH2 ()
C:\strawberry\perl\bin\perl.exe "-Iinc" -MExtUtils::Command -e "chmod" 
-- 644 SS
H2.bs
C:\strawberry\perl\bin\perl.exe "-Iinc" -MExtUtils::Mksymlists \
  -e "Mksymlists('NAME'=>\"Net::SSH2\", 'DLBASE' => 'SSH2', 
'DL_FUNCS' => {
}, 'FUNCLIST' => [], 'IMPORTS' => {  }, 'DL_VARS' => []);"
dlltool --def SSH2.def --output-exp dll.exp
g++.exe -o blib\arch\auto\Net\SSH2\SSH2.dll -Wl,--base-file -Wl,dll.base 
-mdll -
s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" SSH2.o 
-Wl,--image-bas
e,0x7d37  C:\strawberry\perl\lib\CORE\libperl510.a 
C:\msys\1.0\local\lib\lib
ssh2.a C:\msys\1.0\local\lib\libz.a C:\msys\1.0\local\ssl\lib\libssl.a 
C:\msys\1
.0\local\ssl\lib\libcrypto.a C:\msys\1.0\mingw\lib\libmoldname.a 
C:\msys\1.0\min
gw\lib\libkernel32.a C:\msys\1.0\mingw\lib\libuser32.a 
C:\msys\1.0\mingw\lib\lib
gdi32.a C:\msys\1.0\mingw\lib\libwinspool.a 
C:\msys\1.0\mingw\lib\libcomdlg32.a
C:\msys\1.0\mingw\lib\libadvapi32.a C:\msys\1.0\mingw\lib\libshell32.a 
C:\msys\1
.0\mingw\lib\libole32.a C:\msys\1.0\mingw\lib\liboleaut32.a 
C:\msys\1.0\mingw\li
b\libnetapi32.a C:\msys\1.0\mingw\lib\libuuid.a 
C:\msys\1.0\mingw\lib\libws2_32.
a C:\msys\1.0\mingw\lib\libmpr.a C:\msys\1.0\mingw\lib\libwinmm.a 
C:\msys\1.0\mi
ngw\lib\libversion.a C:\msys\1.0\mingw\lib\libodbc32.a 
C:\msys\1.0\mingw\lib\lib
odbccp32.a dll.exp
collect2: ld returned 255 exit status <<<-crashed here
dmake:  Error code 129, while making 'blib\arch\auto\Net\SSH2\SSH2.dll'

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net-SSH2 build process

2010-10-28 Thread Richie
On 10/28/2010 10:13 PM, Sisyphus wrote:
>
> - Original Message - From: "Richie" 
>
>> (using: push @search_paths, 'C:/msys/1.0/local', 
>> 'C:/msys/1.0/local/ssl')
>> - i don't expect dmake to work but tried it anyway in strawberry shell,
>> see attached file test1.txt
>
> It should work. (No problem for me on Strawberry 5.12.0.1.)
> Looking at test1.txt it seems that there's a pre-existing build. Could 
> you run 'dmake realclean', and then try again. (Post the 'dmake' 
> results again if it still fails.)
>
> Cheers,
> Rob
Just tried 5.12 portable.  Had to use the following pieces, but it worked
push @search_paths, 'C:/msys/1.0/local', 'C:/msys/1.0/local/ssl' , 
'C:/msys/1.0/mingw' (Makefile.PL)
set PATH=C:\msys\1.0\mingw\bin;%PATH% (strawberry shell)

Perhaps the extra search_paths element was needed due to additional 
differences in our msys installs

I will work more on 5.10 tomorrow.  I appreciate all the help :)

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net-SSH2 build process

2010-10-29 Thread sisyphus




> Sisyphus  wrote:
> 
> 
> - Original Message - 
> From: "Richie" 

> collect2: ld returned 255 exit status <<<-crashed here

There have been problems with collect2 and mingw in the past. I would've 
thought they were fixed by the time 5.10 arrived, but perhaps not. (Otherwise I 
don't know what would be causing this.)

Windows XP was not affected; Vista (pre SP1) was ... not sure about Windows 7.

Cheers,
Rob
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net-SSH2 build process

2010-10-29 Thread sisyphus

> From: "Richie" 

> > Just tried 5.12 portable.  Had to use the following pieces, but it 
> worked
> > push @search_paths, 'C:/msys/1.0/local', 'C:/msys/1.0/local/ssl' , 
> > 'C:/msys/1.0/mingw' (Makefile.PL)
> > set PATH=C:\msys\1.0\mingw\bin;%PATH% (strawberry shell)
> > 
> > Perhaps the extra search_paths element was needed due to additional 
> > differences in our msys installs

What's in C:/msys/1.0/mingw ? (My msys/1.0/mingw is empty.)

I need to specify 'C:/msys/1.0/local' and 'C:/msys/1.0/local/ssl' as that's 
where openssl and zlib are for me. 
However, some (most ?) people put their libraries into /mingw by making use of 
the --prefix argument. That way msys finds them by default. 

I guess therefore that, on your machine, there are some libraries in /mingw 
that are needed to build Net::SSH2 - whereas, on my machine, all of those 
libraries are in /usr/local. That should be the only difference.

Good that Strawberry are finally including Net::SSH2 in their distro.

While I think of it - I've found it necessary to apply this patch to SSH2.pm 
(version 0.33):

#

--- C:\perl5121_M/site/lib/Net/SSH2.pm_orig Mon Aug 23 20:06:32 2010
+++ C:\perl5121_M/site/lib/Net/SSH2.pm Mon Aug 23 20:36:30 2010
@@ -373,8 +373,18 @@
$self->error(0, "want $block, have $count"), return
unless $count == $block;
die 'sysread mismatch' unless length $buf == $count;
- $self->error(0, "error writing $count bytes to channel"), return
- unless $chan->write($buf) == $count;
+ my $wrote = 0;
+ while ($wrote >= 0 && $wrote < $count) {
+ my $wr = $chan->write($buf);
+ last if $wr < 0;
+ $wrote += $wr;
+ $buf = substr $buf, $wr;
+ }
+ unless($wrote == $count) {
+ my @error = $self->error();
+ warn "Error writing $count bytes to channel: @error\n";
+ return;
+ }
}


# send/receive SCP acknowledgement

#


See
https://rt.cpan.org/Public/Bug/Display.html?id=59332

for the discussion about it. (If you're not going to use scp it probably 
doesn't matter.)

Cheers,
Rob
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net-SSH2 build process

2010-10-29 Thread Richie
On 10/29/2010 5:05 AM, sisyphus wrote:
> What's in C:/msys/1.0/mingw ? (My msys/1.0/mingw is empty.)
The premade msys that I used (linked in earlier emails) puts the mingw 
install inside the msys structure.  I tied  the install method described 
in the wiki and I think it created a c:\mingw dir and put msys inside of 
that.
> I need to specify 'C:/msys/1.0/local' and 'C:/msys/1.0/local/ssl' as that's 
> where openssl and zlib are for me.
> However, some (most ?) people put their libraries into /mingw by making use 
> of the --prefix argument. That way msys finds them by default.
>
> I guess therefore that, on your machine, there are some libraries in /mingw 
> that are needed to build Net::SSH2 - whereas, on my machine, all of those 
> libraries are in /usr/local. That should be the only difference.
I'm not sure about this. My msys doesn't seem to find all those mingw 
includes by default. With either install method I don't recall that a 
/usr/local exists until I started make install'ing stuff.   Is it 
possible that you have a mount?  I may try to install it according to 
the wiki again but it was so 'piece meal' that when I discovered a 
premade I used that instead.  If you have notes on creating a good msys 
install I'm interested in those too.
> While I think of it - I've found it necessary to apply this patch to SSH2.pm 
> (version 0.33):
>
Thanks for the patch I will need it.
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net-SSH2 build process

2010-10-29 Thread Sisyphus

- Original Message - 
From: "Richie"

> I'm not sure about this. My msys doesn't seem to find all those mingw
> includes by default.

On checking, it looks like I could be mistaken about that.

I was basing that statement on the wiki at
http://www.mingw.org/wiki/MSYS :

#
To install 3rd party library and applications which uses the autotools build
system the following commands are often used.

./configure --prefix=/mingw
make
make install

Installing to "/usr/local" should be avoided, since the MinGW compiler won't
look there by default.
#

Maybe "/mingw" is not the same as "msys/1.0/mingw" ... perhaps it's
someplace else in the msys tree.

Anyway, I've always just let stuff go into /usr/local.
Besides, if one wants the stuff in /usr/local to be found by default one 
could just set the CPATH and LIBRARY_PATH environment variables 
appropriately:
export CPATH=/usr/local/include:/usr/local/ssl/include
export LIBRARY_PATH=/usr/local/lib:/usr/local/ssl/lib

> /usr/local exists until I started make install'ing stuff.   Is it possible
> that you have a mount?  I may try to install it according to the wiki
> again but it was so 'piece meal' that when I discovered a premade I used
> that instead.

If it's working ok (and it sounds like it is), I would happily leave it be.

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net-SSH2 build process

2010-10-29 Thread Richie
On 10/29/2010 9:01 PM, Sisyphus wrote:
>
> Installing to "/usr/local" should be avoided, since the MinGW compiler 
> won't
> look there by default.
> #
>
> Maybe "/mingw" is not the same as "msys/1.0/mingw" ... perhaps it's
> someplace else in the msys tree.

I didn't see any issue until running dmake in the perl shell which 
didn't see all the canned mingw libs/includes.  Do you do anything extra 
to your strawberry shell env (outside of Makefile.PL) to make it aware 
of mingw/msys?
>
> If it's working ok (and it sounds like it is), I would happily leave 
> it be.
>
Yea, although I was able to get a msys setup going using the wiki as 
well, which works.

I've scrapped messing with 5.10 for now though because of the ld.exe 
crashing even on XP.  Here is my last issue:

perl -e "use Net::SSH2"
I get a dialog box -> This application has failed to start because 
libgcc_s_dw2-1.dll was not found.  Reinstalling the application may fix 
this problem.

I worked around it by adding C:\MinGW\bin to PATH for now.  Are doing 
anything extra to incorporate a static gcc lib into the SSH2.dll?
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net-SSH2 build process

2010-10-29 Thread Richie
On 10/29/2010 9:13 PM, Richie wrote:
> I worked around it by adding C:\MinGW\bin to PATH for now.  Are doing 
> anything extra to incorporate a static gcc lib into the SSH2.dll?

Forget about this question.  I checked back on my other box and it 
doesn't see
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net-SSH2 build process

2010-10-29 Thread Richie
On 10/29/2010 10:39 PM, Richie wrote:
> On 10/29/2010 9:13 PM, Richie wrote:
>> I worked around it by adding C:\MinGW\bin to PATH for now.  Are doing 
>> anything extra to incorporate a static gcc lib into the SSH2.dll?
>
> Forget about this question.  I checked back on my other box and it 
> doesn't see
Sorry, I meant to say "I checked back on my other box (premade msys) and 
it doesn't seem to have this issue" :)


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Re: Net-SSH2 build process

2010-10-30 Thread sisyphus




> Richie  wrote:
> 
> On 10/29/2010 10:39 PM, Richie wrote:
> > On 10/29/2010 9:13 PM, Richie wrote:
> >> I worked around it by adding C:\MinGW\bin to PATH for now.  Are doing 
> 
> >> anything extra to incorporate a static gcc lib into the SSH2.dll?
> >
> > Forget about this question.  I checked back on my other box and it 
> > doesn't see
> Sorry, I meant to say "I checked back on my other box (premade msys) and 
> 
> it doesn't seem to have this issue" :)

Yes, I was a bit puzzled by that. I haven't been including libgcc_s_dw2-1.dll 
with any of my ppm packages because I believe it to be unnecessary. When I saw 
that you'd got that pop-up, however, I started to wonder 

Afaik, Net::SSH2, when built against a static libssh2, does not have any 
dependency on libgcc_s_dw2-1.dll - but there may be some caveats to that.

Cheers,
Rob
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs