# HG changeset patch # User mikek # Date 1273930365 -3600 # Node ID b2a53d442fd6a666a9e16f31cfe3d23283ea5c8c # Parent 67f8bb81b0543e6e10d17f2d9627793d60dcc8e9 1) Introducing support for 32/64-bit variants of the patch files 2) Fix bug in fix_epoc32_linux.pl whereby changes to the gcc -preinclude patch file were not applied if already existed. 3) Extending weed_backups.pl to weed the epoc32 tree as well as the package dir 4) Make build_target.pl return non-0 if build has warnings 5) Make build_all.pl fail a target if it has warnings diff -r 67f8bb81b054 -r b2a53d442fd6 cross-plat-dev-utils/README-LINUX --- a/cross-plat-dev-utils/README-LINUX Thu May 13 19:18:16 2010 +0100 +++ b/cross-plat-dev-utils/README-LINUX Sat May 15 14:32:45 2010 +0100 @@ -136,7 +136,7 @@ * weed_backups.pl: ----------------- -Deletes all files in the package dir that end with '~'. +Deletes all files in the package dir and epoc32 tree that end with '~'. * get_upstream.pl CLONEDIR: --------------------------- diff -r 67f8bb81b054 -r b2a53d442fd6 cross-plat-dev-utils/README-WINDOWS --- a/cross-plat-dev-utils/README-WINDOWS Thu May 13 19:18:16 2010 +0100 +++ b/cross-plat-dev-utils/README-WINDOWS Sat May 15 14:32:45 2010 +0100 @@ -134,8 +134,7 @@ * weed_backups.pl: ----------------- -Deletes all files in the package dir that end with '~'. Not useful on -Windows. +Deletes all files in the package dir and epoc32 tree that end with '~'. * get_upstream.pl CLONEDIR: --------------------------- diff -r 67f8bb81b054 -r b2a53d442fd6 cross-plat-dev-utils/apply_patch_file.pm --- a/cross-plat-dev-utils/apply_patch_file.pm Thu May 13 19:18:16 2010 +0100 +++ b/cross-plat-dev-utils/apply_patch_file.pm Sat May 15 14:32:45 2010 +0100 @@ -23,6 +23,7 @@ use File::Copy; use places; use check_os; +use get_wordsize; sub compare_files($$) { @@ -41,6 +42,7 @@ sub apply_patch_file($) { + my $patched = 0; my $patch_file = shift; my ($src_file, $dest_file); my $epocroot = get_epocroot(); @@ -54,7 +56,14 @@ } $src_file = File::Spec->catfile($patch_files_dir,$patch_file); if (! -f $src_file) { - die("*** Error: not found \"$src_file\" ***"); + my $wordsize = get_host_wordsize(); + $wordsize .= "bit"; + if (-f "$src_file\.$wordsize") { + print ">>> Using $wordsize variant of \"$src_file\"\n"; + $src_file .= "\.$wordsize"; + } else { + die("*** Error: not found \"$src_file\" ***"); + } } if ($patch_file =~ /^\$/) { my ($vol,$dir,$file) = File::Spec->splitpath($patch_file); @@ -73,6 +82,7 @@ print ">>> Yes. \"$dest_file\" does not exist\n"; print ">>> Copying \"$src_file\" to \"$dest_file\"n"; copy($src_file,$dest_file) or die $!; + $patched = 1; } else { my $dif = !compare_files($src_file,$dest_file); @@ -87,9 +97,11 @@ print ">>> Backing up \"$dest_file\" as \"$backup\"\n"; copy($dest_file,$backup) or die $!; print ">>> Copying \"$src_file\" to \"$dest_file\"\n"; - copy($src_file,$dest_file) or die $!; + copy($src_file,$dest_file) or die $!; + $patched = 1; } } + return $patched; } 1; diff -r 67f8bb81b054 -r b2a53d442fd6 cross-plat-dev-utils/build_target.pl --- a/cross-plat-dev-utils/build_target.pl Thu May 13 19:18:16 2010 +0100 +++ b/cross-plat-dev-utils/build_target.pl Sat May 15 14:32:45 2010 +0100 @@ -58,12 +58,19 @@ my $cmd = "$raptor -c tools2 -b $bld_inf @ARGV"; print ">>> Executing: $cmd\n"; my $rc = system($cmd) >> 8; +my $warnings = 0; my @build_logs = glob($log_pattern); open BLDLOG, "<$build_logs[-1]" or die $!; while() { print $_; + ++$warnings, if (//); } close BLDLOG; +print "*** Build failed ***\n", if ($rc); +if ($warnings) { + print "*** Build has warnings ***\n"; + $rc = 1; +} exit $rc; diff -r 67f8bb81b054 -r b2a53d442fd6 cross-plat-dev-utils/fix_epoc32_linux.pl --- a/cross-plat-dev-utils/fix_epoc32_linux.pl Thu May 13 19:18:16 2010 +0100 +++ b/cross-plat-dev-utils/fix_epoc32_linux.pl Sat May 15 14:32:45 2010 +0100 @@ -28,26 +28,25 @@ my $wrong_product_variant_hrh = File::Spec->catfile(get_epoc32_dir(),"include","ProductVariant.hrh"); my $right_product_variant_hrh = File::Spec->catfile(get_epoc32_dir(),"include","productvariant.hrh"); if (! -f $right_product_variant_hrh and ! -l $right_product_variant_hrh) { - print ">>> Creating symlink \"$wrong_product_variant_hrh\" -> \"$right_product_variant_hrh\"\n"; + symlink($wrong_product_variant_hrh,$right_product_variant_hrh) or die $!; + print ">>> Created symlink \"$wrong_product_variant_hrh\" -> \"$right_product_variant_hrh\"\n"; print ">>> (workaround for bug #1399)\n"; - symlink($wrong_product_variant_hrh,$right_product_variant_hrh) or die $!; } my $gcc_include_dir = File::Spec->catfile(get_epoc32_dir(),"include","gcc"); if (! -d $gcc_include_dir) { - print ">>> Creating \"$gcc_include_dir\"\n"; mkdir $gcc_include_dir or die $!; + print ">>> Created \"$gcc_include_dir\"\n"; } my $gcc_441_prelinclude_hdr_rel = File::Spec->catfile("epoc32","include","gcc","gcc_4_4_1.h"); my $gcc_441_prelinclude_hdr_abs = File::Spec->catfile("$epocroot","$gcc_441_prelinclude_hdr_rel"); my $gcc_prelinclude_hdr = File::Spec->catfile("$epocroot","epoc32","include","gcc","gcc.h"); -if (! -f $gcc_441_prelinclude_hdr_abs) { - print ">>> Creating \"$gcc_441_prelinclude_hdr_abs\"\n"; - apply_patch_file($gcc_441_prelinclude_hdr_rel); +if (apply_patch_file($gcc_441_prelinclude_hdr_rel)) { + print ">>> Created \"$gcc_441_prelinclude_hdr_abs\"\n"; unlink($gcc_prelinclude_hdr) } if (! -l $gcc_prelinclude_hdr) { - print ">>> Creating symlink \"$gcc_441_prelinclude_hdr_abs\" -> \"$gcc_prelinclude_hdr\"\n"; symlink($gcc_441_prelinclude_hdr_abs,$gcc_prelinclude_hdr); + print ">>> Created symlink \"$gcc_441_prelinclude_hdr_abs\" -> \"$gcc_prelinclude_hdr\"\n"; } exit 0; diff -r 67f8bb81b054 -r b2a53d442fd6 cross-plat-dev-utils/get_wordsize.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cross-plat-dev-utils/get_wordsize.c Sat May 15 14:32:45 2010 +0100 @@ -0,0 +1,22 @@ +/* +Copyright (c) 2010 Symbian Foundation Ltd +This component and the accompanying materials are made available +under the terms of the License "Eclipse Public License v1.0" +which accompanies this distribution, and is available +at the URL "http://www.eclipse.org/legal/epl-v10.html". + +Initial Contributors: +Mike Kinghan, mikek@symbian.org for Symbian Foundation Ltd - initial contribution. + +Program to return the wordsize in bits of the host machine +*/ + +#include +#include + +int main(void) +{ + printf("%lu\n",sizeof(unsigned long)); + exit(0); +} + diff -r 67f8bb81b054 -r b2a53d442fd6 cross-plat-dev-utils/get_wordsize.pm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cross-plat-dev-utils/get_wordsize.pm Sat May 15 14:32:45 2010 +0100 @@ -0,0 +1,44 @@ +#!/usr/bin/perl +# Copyright (c) 2010 Symbian Foundation Ltd +# This component and the accompanying materials are made available +# under the terms of the License "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Mike Kinghan, mikek@symbian.org, for Symbian Foundation Ltd - initial contribution. + +# Subroutine to get the wordsize in bits of the host machine. + +use strict; +use File::Path; +use File::Spec; +use check_os; +use places; + +sub get_host_wordsize() +{ + if (os_is_windows()) { + print ">>> Only 32bit Windows supported\n"; + return 32; + } + my $source = "get_wordsize.c"; + unless(-f "$source") { + die "*** Error: $source not found ***"; + } + my $compile_cmd = "gcc -o get_wordsize $source"; + print ">>> Excuting: $compile_cmd\n"; + system($compile_cmd) >> 8 and die "*** Error: Could not compile $source ***"; + my $get_wordsize = "\.\/get_wordsize"; + print ">>> Excuting: $get_wordsize\n"; + my $wordsize = `$get_wordsize`; + chomp $wordsize; + die "$!", if ($? >> 8); + $wordsize *= 8; + print ">>> Host system wordsize is $wordsize bits\n"; + unlink("get_wordsize") or die $!; + return $wordsize; +} + +1; + diff -r 67f8bb81b054 -r b2a53d442fd6 cross-plat-dev-utils/places.pm diff -r 67f8bb81b054 -r b2a53d442fd6 cross-plat-dev-utils/weed_backups.pl --- a/cross-plat-dev-utils/weed_backups.pl Thu May 13 19:18:16 2010 +0100 +++ b/cross-plat-dev-utils/weed_backups.pl Sat May 15 14:32:45 2010 +0100 @@ -18,11 +18,12 @@ sub delete_backups($); usage(\@ARGV,"This script deletes all files in the package directory " . - "with names ending in '~'\n"); -my $epocroot = get_epocroot(); + "and the epoc32 tree with names ending in '~'\n"); +my $epoc32_dir = get_epoc32_dir(); my $build_pkg_dir = get_pkg_dir(); my $deletes = 0; delete_backups($build_pkg_dir); +delete_backups($epoc32_dir); print ">>> $deletes files deleted\n"; exit 0;