From: Jarkko Hietaniemi Date: Wed, 19 Oct 2005 16:19:23 +0000 (+0300) Subject: blead 25801: Symbian batch of today X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1215b447b68a44982cbab6532e02152be37089dd;p=p5sagit%2Fp5-mst-13.2.git blead 25801: Symbian batch of today Message-ID: p4raw-id: //depot/perl@25804 --- diff --git a/perl.h b/perl.h index fd34ea3..9d48457 100644 --- a/perl.h +++ b/perl.h @@ -190,6 +190,11 @@ #define CALLREG_INTUIT_STRING CALL_FPTR(PL_regint_string) #define CALLREGFREE CALL_FPTR(PL_regfree) +/* XXX The PERL_UNUSED_DECL suffix is unfortunately rather inflexible: + * it assumes that in all compilers the way to suppress an "unused" + * warning is to have a suffix. In some compilers that might be a + * a compiler pragma, e.g. #pragma unused(varname). */ + #if defined(__SYMBIAN32__) && defined(__GNUC__) # ifdef __cplusplus # define PERL_UNUSED_DECL diff --git a/pp_sys.c b/pp_sys.c index 29265a3..c2ae681 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -2683,16 +2683,30 @@ PP(pp_ssockopt) PUSHs(sv); break; case OP_SSOCKOPT: { - const char *buf; +#if defined(__SYMBIAN32__) +# define SETSOCKOPT_OPTION_VALUE_T void * +#else +# define SETSOCKOPT_OPTION_VALUE_T const char * +#endif + /* XXX TODO: We need to have a proper type (a Configure probe, + * etc.) for what the C headers think of the third argument of + * setsockopt(), the option_value read-only buffer: is it + * a "char *", or a "void *", const or not. Some compilers + * don't take kindly to e.g. assuming that "char *" implicitly + * promotes to a "void *", or to explicitly promoting/demoting + * consts to non/vice versa. The "const void *" is the SUS + * definition, but that does not fly everywhere for the above + * reasons. */ + SETSOCKOPT_OPTION_VALUE_T buf; int aint; if (SvPOKp(sv)) { STRLEN l; - buf = SvPV_const(sv, l); + buf = (SETSOCKOPT_OPTION_VALUE_T) SvPV_const(sv, l); len = l; } else { aint = (int)SvIV(sv); - buf = (const char*)&aint; + buf = (SETSOCKOPT_OPTION_VALUE_T) &aint; len = sizeof(int); } if (PerlSock_setsockopt(fd, lvl, optname, buf, len) < 0) diff --git a/symbian/config.sh b/symbian/config.sh index 1337d89..313bc40 100644 --- a/symbian/config.sh +++ b/symbian/config.sh @@ -71,6 +71,7 @@ d_chown='undef' d_chroot='undef' d_chsize='undef' d_class='undef' +d_clearenv='undef' d_closedir='undef' d_cmsghdr_s='undef' d_const='define' diff --git a/symbian/symbianish.h b/symbian/symbianish.h index 1aebaf1..4f06e0a 100644 --- a/symbian/symbianish.h +++ b/symbian/symbianish.h @@ -207,3 +207,13 @@ pid_t wait(int *status); #endif /* _MSC_VER */ +#ifdef __MWERKS__ +/* No good way of using the CodeWarrior #pragma unused(varname) with Perl + * source code (e.g. PERL_UNUSED_DECL doesn't work with the pragma syntax). + * Therefore we brutally turn off these particular warnings since there + * is a lot of this in Perl code (pTHX, for example). TOther compilers + * will have to detect these naughty bits. */ +#pragma warn_unusedarg off +#pragma warn_unusedvar off +#pragma warn_emptydecl off +#endif diff --git a/symbian/xsbuild.pl b/symbian/xsbuild.pl index 0f6d66d..eb7c63d 100644 --- a/symbian/xsbuild.pl +++ b/symbian/xsbuild.pl @@ -160,7 +160,7 @@ sub run_PL { print "(patching $BUILDROOT\\lib\\Config.pm)\n"; system_echo("perl -pi.bak -e \"s:\\Q$R_V_SV:$V:\" $BUILDROOT\\lib\\Config.pm"); } - system_echo("perl -I$BUILDROOT\\lib -I$BUILDROOT\\xlib\\symbian $PL") == 0 + system_echo("perl -I$BUILDROOT\\lib -I$BUILDROOT\\xlib\\symbian -I$BUILDROOT\\t\\lib $PL") == 0 or warn "$0: $PL failed.\n"; if ($CoreBuild) { system_echo("copy $BUILDROOT\\lib\\Config.pm.bak $BUILDROOT\\lib\\Config.pm"); @@ -729,6 +729,11 @@ for my $ext (@ARGV) { next if $Config; } + if ($dir eq ".") { + warn "$0: No directory for $ext, skipping...\n"; + next; + } + my $chdir = $ext eq "ext\\XSLoader" ? "ext\\DynaLoader" : $dir; die "$0: no directory '$chdir'\n" unless -d $chdir; update_dir($chdir) or die "$0: chdir '$chdir' failed: $!\n"; @@ -867,10 +872,21 @@ __EOF__ or die "$0: make distclean failed\n"; } } + if ( $ext eq "ext\\Compress\\Zlib" ) { + my @bak; + find( sub { push @bak, $File::Find::name if /\.bak$/ }, "." ); + unlink(@bak) if @bak; + my @src; + find( sub { push @src, $_ if -f $_ }, "zlib-src" ); + unlink(@src) if @src; + unlink("constants.xs"); + } if ( $ext eq "ext\\Devel\\PPPort" ) { unlink("ppport.h"); } } + my @D = glob("../BMARM/*.def ../BWINS/*.def"); + unlink(@D) if @D; my @B = glob("ext/BWINS ext/BMARM ext/*/BWINS ext/*/BMARM Makefile"); rmdir(@B) if @B; }