René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

Compiling perl 5.8.6 on cygwin

I wanted to compile perl 5.8.6 on cygwin.
So, I downloaded it and did a ./Configure. However, that failed:
$> ./Configure
Sorry, I can't seem to locate the source dir for perl5.  Please start
Configure with an explicit path -- i.e. /some/path/Configure.
OK, converting Configure from dos to unix:
$> unix2dos Configure
Then it worked.
$> make
Another error:
../../miniperl.exe "-I../../lib" "-I../../lib" ../../lib/ExtUtils/xsubpp  -typemap ../../lib/ExtUtils/typemap -typemap typemap  B.xs > B.xsc && mv B.xsc B.c
Code is not inside a function (maybe last function was ended by a blank line  followed by a statement on column one?) in B.xs, line 982
make[1]: *** [B.c] Error 1
make[1]: Leaving directory `/tmp/perl/perl-5.8.6/ext/B'
ext/B/B.xs must be changed (around line 982):
#define PADOP_gv(o)	((o->op_padix \
			  && SvTYPE(PAD_SVl(o->op_padix)) == SVt_PVGV) \
			 ? (GV*)PAD_SVl(o->op_padix) : Nullgv)
becomes:
#define PADOP_gv(o)	((o->op_padix && SvTYPE(PAD_SVl(o->op_padix)) == SVt_PVGV) ? (GV*)PAD_SVl(o->op_padix) : Nullgv)
Similarly, ext/Encode/Unicode/Unicode.xs must be changed around line 87:
#define attr(k, l)  (hv_exists((HV *)SvRV(obj),k,l) ? \
    *hv_fetch((HV *)SvRV(obj),k,l,0) : &PL_sv_undef)
becomes
#define attr(k, l)  (hv_exists((HV *)SvRV(obj),k,l) ?  *hv_fetch((HV *)SvRV(obj),k,l,0) : &PL_sv_undef)
Similarly, xt/ODBM_File/ODBM_File.xs must be changed around line 211. The backslashes must be removed and all lines brought to one line.
When then was antoher error (related to an undefined thingy), I gave up.
Then, I downloaded stable.tar.bz2 instead of stable.tar.gz. The bz2 version made no problems!